Re: HTB, strange capacity distribution

Linux Advanced Routing and Traffic Control

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

 



On Tue, Feb 21, 2006 at 12:49:59AM +0100, Boris Gereg wrote:
> (first of all, please, how to reply to some article in LARTC via mail
> to post it into right thread?)

Using 'reply all', or 'reply list' if your mail software offers it. 
If all else fails, just hit 'reply' and add the mailing list to CC.

> So, I am definitely shaping outgoing traffic (upstream)

Yes, outgoing traffic from router to your network, which actually 
contains the downstream traffic from the internet. Right?

> tc -d class show dev eth0
> 
> class htb 1:2 root rate 100000Kbit ceil 100000Kbit burst 51587b/8 mpu
> 0b overhead 0b cburst 51587b/8 mpu 0b overhead 0b level 7
> 
> class htb 1:2000 parent 1:2 leaf 2000: prio 0 quantum 200000 rate
> 50000Kbit ceil 100000Kbit burst 26593b/8 mpu 0b overhead 0b cburst
> 51587b/8 mpu 0b overhead 0b level 0
> 
> class htb 1:3010 parent 1:2 leaf 3010: prio 1 quantum 1000 rate
> 64000bit ceil 256000bit burst 1631b/8 mpu 0b overhead 0b cburst
> 1727b/8 mpu 0b overhead 0b level 0
> 
> class htb 1:3020 parent 1:2 leaf 3020: prio 2 quantum 1600 rate
> 128000bit ceil 768000bit burst 1663b/8 mpu 0b overhead 0b cburst
> 1983b/8 mpu 0b overhead 0b level 0
> 
> class htb 1:3030 parent 1:2 leaf 3030: prio 3 quantum 6400 rate
> 512000bit ceil 2048Kbit burst 1855b/8 mpu 0b overhead 0b cburst
> 2623b/8 mpu 0b overhead 0b level 0
> 
> class htb 1:5040 parent 1:2 leaf 5040: prio 4 quantum 4825 rate
> 386000bit ceil 386000bit burst 1792b/8 mpu 0b overhead 0b cburst
> 1792b/8 mpu 0b overhead 0b level 0

It's as I suspected, your current HTB tree looks like this:

1: HTB Qdisc
|
\--- 1:2 HTB root class (100000Kbit:100000kbit)
     |
     \--- 1:2000 HTB leaf class (50000Kbit:100000Kbit)
     \--- 1:3010 HTB leaf class (64000bit:256000bit)
     \--- 1:3020 HTB leaf class (128000bit:768000bit)
     \--- 1:3030 HTB leaf class (512000bit:2048Kbit)
     \--- 1:5040 HTB leaf class (386000bit:386000bit)

HTB classes borrow from their parent; in this setup, the parent class 
offers a whopping 100000Kbit for that purpose. Unless the 1:2000 class 
has got a very high priority and is maxing out the line all the time, 
there is no limit to borrowing at all, because the other classes will 
never reach the 100000Kbit from their parent.

So the classes above are actually not limited by their rate, but by 
their ceil; the only class that will respect its rate in this setup 
is 1:5040, because it's got the same rate and ceil.

Assuming that 1:5040 was your P2P class, if you set the ceil of this 
class to 2048Kbit, it will (try to) use 2048Kbit at all times, because 
the parent (thinks it) is able to offer it.

You need a class that knows of your total internet bandwidth somewhere. 
Assuming that it is 2048Kbit, your tree should maybe look more like this:

1: HTB Qdisc
|
\--- 1:2 HTB root class (100000Kbit:100000kbit)
     |
     \--- 1:2000 HTB leaf class (50000Kbit:100000Kbit)
     |
     \--- 1:3000 HTB parent class (2048Kbit:2048Kbit)
          |
          \--- 1:3010 HTB leaf class (64000bit:256000bit)
          \--- 1:3020 HTB leaf class (128000bit:768000bit)
          \--- 1:3030 HTB leaf class (512000bit:2048Kbit)
          \--- 1:5040 HTB leaf class (386000bit:386000bit)

In this setup, the 2048Kbit class is the limiting factor for the leaf 
classes, except for the 1:2000 class, which should be used for local 
LAN traffic only.

HTH
Andreas Klauer
_______________________________________________
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