Greetings,
My question deals with the htb version of wonder shaper. I used it
for some time without much alteration except I noticed something odd
in the way the rates are set up for the 3 htb classes. The way I
understand it, there are 3 classes:
1:10 - high prio class with rate ${UPLINK}kbit
1:20 - bulk/default class with rate $[9*$UPLINK/10]kbit
1:30 - bulk/default low priority class with rate $[8*$UPLINK/10]kbit
No class has any ceiling set (I think it defaults to the parent rate
which would be ${UPLINK}kbit).
Now my concern is how these are divided up. Shouldn''t the sum varying
rates of the different classes be equal to $UPLINK? As I understand
it, htb classes use "rate" as a *guaranteed* bandwidth, with the
ability to lend if using less, and to borrow up to the specified
ceiling if more is needed.
For example, in my setup my 1:10 class gets 100kbit fixed rate with an
$UPLINK ceiling:
tc class add dev $DEV parent 1:1 classid 1:10 htb rate 100kbit \
ceil ${UPLINK}kbit burst 6k prio 1
My 1:20 then gets the rest of $UPLINK - 1kbit (more on the 1kbit in a
sec) with the same ceiling but a lower priority:
tc class add dev $DEV parent 1:1 classid 1:20 htb \
rate $[($UPLINK - 100) - 1]kbit \
ceil ${UPLINK}kbit burst 6k prio 2
My 1:30 low prio class now only gets 1kbit guaranteed bandwidth and a
lower ceiling of available bandwidth for borrowing and an even lower
priority (and less burst rights):
tc class add dev $DEV parent 1:1 classid 1:30 htb rate 1kbit \
ceil $[9*$UPLINK/10]kbit prio 3
So in this situation, all classes can borrow from each other if the
bandwidth is unused, although each still gets its guaranteed bandwidth
as soon as its requested. 1:30 gets a terrible guaranteed but since
it can borrow the rest it doesn''t matter much (I usually dump
bittorrent traffic etc.. into this class). In fact, the guaranteed
rates don''t matter so much as the ceilings and priorities do since
with htb it''s clearer and easier to set policy using the borrowing
mechanisms. In this manner the rates, ceilings and priorities can be
adjusted accordingly.
Let me know if I''m understanding the nature of htb wrong and if this
doesn''t make any sense. The last update to wonder shaper was quite a
while back so I understand that it''s likely that it''s not
actively
maintain it anymore. Any feedback you can provide would be great.
To be honest, I''d been using wonder shaper "as is" and
didn''t see any
outstanding problems with it so it seems to work even if the
guaranteed bandwidth is more than the total bandwidth. I''ve pondered
over the script for a while though, and it''s been bugging me since
I''m
not sure if the script is in error if my understanding of htb is off.
-rob