>> I need some help with my idea about PF.
>> So, assume that we want to assign all packets passed that rule to one
>> of _subqueues_ of "pq" queue. Not to "pq" itself. That assignment must
>> be based on packet's destination IP address, so packets to 192.168.0.1
>> must be assigned to "pq_1" queue, packets to 192.168.0.2 - to "pq_2",
>> and so on.
>> I "implement" that idea...
>> Again, my "implementation" is very ugly, it's becouse I'm not very
>> familiar with PF code yet. Here is the diff:
>
> You can try to finish this patch here:
> It gives WFQ properties to HFSC/PRIQ cause CBQ has it already.
At first, I asked for help with PF, because I'm not very familiar with
it's code. So, at first, I want study PF code principles.
Sorry, I don't see any useful knowledge in the patch you showed. It
contains only some ALTQ-only additions, may be it'll be interesting
somewhen... but not now. My primary goal now is to study PF.
Secondly, WFQ do not give me what I want. It divides _parent_ queue to
N equal flows.
Instead, I want to setup _child_ (sub)queue bandwidth to some limit
that can't be exceeded. Of course, summ bandwidth of all child queues
can't exceed parent bandwidth.
Furthermore, somewhen I want to achieve situation like this:
altq on $if cbq bandwidth 100Mb queue { std, ..., pq }
queue ...
queue pq bandwidth 1M priority 1 cbq { pq_1, pq_2, pq_3,...}
queue pq_1 bandwidth 256K
queue pq_2 bandwidth 256K
queue pq_3 bandwidth 256K
queue pq_4 bandwidth 256K
queue pq_5 bandwidth 256K
queue pq_6 bandwidth 256K
queue pq_7 bandwidth 256K
...
Here, you see, the sum bandwidth of all child queues is much more than
bandwidth of parent queue. So, when there will be more than 4 IP's
(256K * 4 = 1M) and if they all will try to exploit full allowed
bandwidth they will be limited by ALTQ, so they sum bandwidth will be
limited to parent's bandwidth (1M).
What for? I have some users who pay me for 256K/256K "unlimit". So, I
want that they could not get more bandwidth than 256K for each user,
no matter how many "free, unused" bandwidth I got to my ISP at any
time. And I want also limit they sum bandwidth - if they all will
start download I'll be sure that they not "eat" all my bandwidth.
In the last stage I want implement automatically creation of subqueues
by using some keyword for parent queue. For example:
altq on $if cbq bandwidth 100Mb queue { std, ..., pq }
queue ...
queue pq bandwidth 1M priority 1 cbq spray_to_subqueues_by_dst_IP
s_bandwidth 256K
And some addition keyword to rule:
pass out on $if ... from any to 192.168.0.0/24 ... queue pq
spray_to_subqueues_by_dst_IP
Parser will see rule, calculate how many IP's it covers, and creates
that many subqueues (same that showed in above examples.).
That's my "dream".
Again. I asking about help with PF. If start to question, I ask: how
can I get tag of some queue (I know name of that queue, "pq_1" for
example) from pt_test() function? Give me any tips please, code, point
to places in code, or some.
--
antonvm