Re: htb child classes don't borrow form "parent's parent class" :(

Linux Advanced Routing and Traffic Control

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

 



On Saturday 18 June 2005 15:09, Bernd Froemel wrote:
> Am I missing an important point? Unfortunately I couldn't find any
> examples showing a more complex tree.

Yes, unless I'm completely mistaken, you misunderstood something about the 
way QDiscs and especially HTB works.

Your old setup looked something like this:

1: HTB Qdisc
 | | |
 | | \--- 1:1 HTB Root Class (10mbit)
 | |      |
 | |      \--- 1:10 HTB Child Class (1kbit/512kbit)
 | |
 | \--- 1:f1 HTB Root Class (2048kbit)
 |      |
 |      \--- 1:a1 HTB Child Class (2048kbit)
 |      \--- 1:b1 HTB Child Class (2048kbit)
 |      \--- 1:c1 HTB Child Class (2048kbit)
 |
 \--- 1:f2 HTB Root Class (1024kbit)
      |
      \--- 1:a2 HTB Child Class (1024kbit)
      \--- 1:b2 HTB Child Class (1024kbit)
      \--- 1:c2 HTB Child Class (1024kbit)

Root classes are independent from each other. A HTB qdisc by itself has 
unlimited bandwidth. Limiting is done by the classes, the root class 
imposing a global limit. You have three root classes, and a total 
bandwidth capacity of 10mbit+2048kbit+1024kbit on your link. This is 
assuming that the ceil parameter does not have any effect for root 
classes, otherwise you'd have 30mbit altogether.

Now, the 1:f1 class has a guaranteed rate of 2048kbit. It's children, 1:a1 
1:b1 and 1:c1 also have 2048kbit guaranteed each. This is impossible, 
since a parent with only 2048kbit guaranteed bandwidth cannot guarantee 
three times as much bandwidth to it's children. The 1:f2 class has the 
same problem.

Your new setup isn't any different; instead of using more than one root 
class, you now use nested HTB qdiscs, which is extremely nasty:

1: HTB QDisc
 |
 \--- 1:1 HTB Root Class (10MBit)
      |
      \--- 1:10 HTB Child Class (8MBit/10MBit)
      |    *
      |    \--- 10: HTB QDisc
      |         |
      |         \--- 10:f1 HTB Root Class (2MBit)
      |              *
      |              \--- f1: HTB QDisc
      |                   [...]
      |
      \--- 1:40 HTB Child Class (2MBit/2MBit)

The tree is broken at *. Although it looks like the HTB QDiscs depend on 
each other, they actually don't really know about each other. There is no 
borrowing/lending possible across different QDiscs / root classes.

You should build a tree with only one HTB QDisc and only one root class.
Something similar to this:

1: HTB QDisc
 |
 \--- 1:1 HTB Root Class (10MBit) [The total link capacity]
      |
      \--- 1:10 HTB Child Class (7MBit/10MBit) [High priority stuff]
      |    |
      |    \--- 1:a1 HTB Child Class (3MBit/10MBit)
      |    \--- 1:b1 HTB Child Class (2MBit/10MBit)
      |    \--- 1:c1 HTB Child Class (2MBit/10MBit)
      |
      \--- 1:40 HTB Child Class (3MBit/10MBit) [Low priority stuff]
           |
           \--- 1:a2 HTB Child Class (1MBit/10MBit)
           \--- 1:b2 HTB Child Class (1MBit/10MBit)
           \--- 1:c2 HTB Child Class (1MBit/10MBit)

Make sure your child class rates add up to the parent class rate (7MBit = 
3+2+2MBit, 3MBit = 1+1+1MBit). Use smaller units than MBit if you want to 
divide more accurately.

That's about it. Use only one HTB Qdisc, and only one HTB Root Class, and 
divide rates properly, then things should start working the way you expect 
them to.

HTH
Andreas
_______________________________________________
LARTC mailing list
LARTC@xxxxxxxxxxxxxxx
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc

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