Re: [LARTC] HTB: why should "sum (rate of children) <= parent rate"?

Linux Advanced Routing and Traffic Control

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sunday 18 May 2003 19:18, Martin A. Brown wrote:
> Maybe this is just for Stef?
>
> In answering Miernik's question (which Stef already answered), I read
> this:
>
>   http://www.docum.org/stef.coene/qos/faq/cache/13.html
>
> I thought it didn't matter what the rate was in a parent class?  I thought
> that it only mattered what the ceil was in a parent class.  I'm doubting
> myself now that I read this FAQ answer.
>
> My understanding:
>
>   The parent class is only consulted by the child class when the child
>   class has exceeded its rate and wants to borrow from the parent.  So,
>   the parent class rate is not consulted, but the ceil is used to
>   determine whether or not to lend?
>
> Is my understanding wrong?
>
> What's the story!?
Take this example :

tc class add dev eth0 classid 1:1 parent 1:0 htb rate 200kbps ceil 50kbps
tc class add dev eth0 classid 1:10 parent 1:1 htb rate 150kbps ceil 128kbps
tc class add dev eth0 classid 1:20 parent 1:1 htb rate 150kbps ceil 128kbps

Both classes will get 150kbps.  So no parent ceil/rate is checked/respected.

I also did some tests to find out how the parent rate is used to split the 
traffic to child classes.  Example :

tc class add dev eth0 classid 1:1 parent 1:0 htb rate 200kbps
tc class add dev eth0 classid 1:10 parent 1:1 htb rate 150kbps ceil 200kbps
tc class add dev eth0 classid 1:20 parent 1:1 htb rate 50kbps ceil 200kbps
tc class add dev eth0 classid 1:100 parent 1:10 htb rate 50kbps ceil 200kbps
tc class add dev eth0 classid 1:200 parent 1:20 htb rate 50kbps ceil 200kbps

And this results is 75% for class 1:10.

But

tc class add dev eth0 classid 1:1 parent 1:0 htb rate 200kbps
tc class add dev eth0 classid 1:10 parent 1:1 htb rate 150kbps ceil 200kbps
tc class add dev eth0 classid 1:20 parent 1:1 htb rate 50kbps ceil 200kbps
tc class add dev eth0 classid 1:100 parent 1:10 htb rate 80kbps ceil 200kbps
tc class add dev eth0 classid 1:200 parent 1:20 htb rate 80kbps ceil 200kbps

gives 65% to class 1:100.  

So it's not clear to me how the rate of the parent is used in the 
calculations.  It is, but I don't know how.

For the ceil :

tc class add dev eth0 classid 1:1 parent 1:0 htb rate 100kbps
tc class add dev eth0 classid 1:10 parent 1:1 htb rate 150kbps ceil 100kbps
tc class add dev eth0 classid 1:20 parent 1:1 htb rate 50kbps ceil 100kbps
tc class add dev eth0 classid 1:100 parent 1:10 htb rate 20kbps ceil 200kbps
tc class add dev eth0 classid 1:200 parent 1:20 htb rate 20kbps ceil 200kbps

Total bandwidth is 200kbps.  So the 100kbps ceil is never respected.

Stef

-- 

stef.coene@xxxxxxxxx
 "Using Linux as bandwidth manager"
     http://www.docum.org/
     #lartc @ irc.oftc.net



[Index of Archives]     [LARTC Home Page]     [Netfilter]     [Netfilter Development]     [Network Development]     [Bugtraq]     [GCC Help]     [Yosemite News]     [Linux Kernel]     [Fedora Users]
  Powered by Linux