[LARTC] HTB classes: is it true that the rate of a parent MUST be exactly equal to the sum of rates of it's children?

Linux Advanced Routing and Traffic Control

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

 



When configuring HTB classes, is it true that the rate of a parent 
MUST be exactly equal to the sum of rates of it's children?

For example let's say I have a 160Kbit link, and two clients. I want 
each of them to have equal transfer rate, and ceil each of them to 
70Kbit. I leave 5% of the link idle as suggested on 
http://www.docum.org/stef.coene/qos/faq/cache/9.html

Lets compare two possible setups:

In setup A I assume that the rate of a parent class DOES NOT have to be 
equal to the sum of the rates of its child classes.

In setup B I assume that the rate of a parent class MUST be equal to 
the rates of its child classes.


Setup A:

tc qdisc add dev eth0 root handle 1: htb
tc class add dev eth0 parent 1:   classid 1:1  htb rate 150Kbit  ceil 150Kbit
tc class add dev eth0 parent 1:1  classid 1:2  htb rate  70Kbit  ceil  70Kbit
tc class add dev eth0 parent 1:1  classid 1:3  htb rate  70Kbit  ceil  70Kbit


Setup B:

tc qdisc add dev eth0 root handle 1: htb
tc class add dev eth0 parent 1:   classid 1:1  htb rate  80Kbit  ceil 150Kbit
tc class add dev eth0 parent 1:1  classid 1:2  htb rate  40Kbit  ceil  70Kbit
tc class add dev eth0 parent 1:1  classid 1:3  htb rate  40Kbit  ceil  70Kbit


Of course the correspnding filters to these, but I ommit them here, 
because it's not needed to show what I mean.

There are no other classeson eth0, and the filters are setupthis way 
that traffic can go either to class 1:2 or class 1:3 and nowhere else. 
There is no unclassified traffic.

In this situation: Are both setups valid? If yes are they equivalent? 
If not, then how the traffic will differ?

Does the rate of a parent class MUST be greater or equal than the sum 
of the rates of it children? 
Or does it have to be exactly equal? 
What happens if it is smaller? 
What happens if it is larger?

The reason I ask, is that I want to know, is it possible to add a 
third client to this setup, without changing the 1:1 class. Or do I 
have to recalculate and change the parent class, each time I change 
the rate of any of it's children?

If I add a third class, the setups will look like this:

Setup A:

tc qdisc add dev eth0 root handle 1: htb
tc class add dev eth0 parent 1:   classid 1:1  htb rate 150Kbit  ceil 150Kbit
tc class add dev eth0 parent 1:1  classid 1:2  htb rate  70Kbit  ceil  70Kbit
tc class add dev eth0 parent 1:1  classid 1:3  htb rate  70Kbit  ceil  70Kbit
tc class add dev eth0 parent 1:1  classid 1:4  htb rate  70Kbit  ceil  70Kbit


Setup B:

tc qdisc add dev eth0 root handle 1: htb
tc class add dev eth0 parent 1:   classid 1:1  htb rate 120Kbit  ceil 150Kbit
tc class add dev eth0 parent 1:1  classid 1:2  htb rate  40Kbit  ceil  70Kbit
tc class add dev eth0 parent 1:1  classid 1:3  htb rate  40Kbit  ceil  70Kbit
tc class add dev eth0 parent 1:1  classid 1:4  htb rate  40Kbit  ceil  70Kbit

Are both setups equivalent now?
Are they both valid?
If they are equivalent, then is one of them somehow better?
If they are not, then why?

If setup B is the only validsetup, then what if I want to add 50 
clients to this link, and also give each one a ceil of 70Kbit.
Each of them will use the link rarely, so statistically there will be 
no more then two clients on this link at the same time.
Should I then setup for each of the clinents   rate 3Kbit ceil 70Kbit :

tc qdisc add dev eth0 root handle 1: htb
tc class add dev eth0 parent 1:   classid 1:1  htb rate 150Kbit  ceil 150Kbit
tc class add dev eth0 parent 1:1  classid 1:2  htb rate   3Kbit  ceil  70Kbit
tc class add dev eth0 parent 1:1  classid 1:3  htb rate   3Kbit  ceil  70Kbit
tc class add dev eth0 parent 1:1  classid 1:4  htb rate   3Kbit  ceil  70Kbit
... and so on?

I've read http://www.docum.org and http://www.lartc.org/howto/ but I 
didn't find a strict anwser to this question.

-- 
    Miernik         ________________________ jabber:miernik@xxxxxxxxxxxxx
__ ICQ: 4004001 ___/__ tel: +48608233394 __/      mailto:miernik@xxxxxxxx
Latest news about infringing people's freedom cases: 
http://www.stallman.org/



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