Re: htb2 with link sharing - the bandwidth dividing question

Linux Advanced Routing and Traffic Control

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

 



> 1. Real measurement of bw (also in Calculation in previous mail)
(Sorry, missed that in the prevois mail)

> In my test the downstream bw was divided:
> class                          real bw
> ----------------------------------------
> class 1:10-RATE=4kbit....... 12   kbit/s
> class 1:40-RATE=4kbit....... 12   kbit/s
> class 1:80-RATE=15kbit...... 29.6 kbit/s
> ----------------------------------------
> Used bw .................... 53.6 kbit/s
So class 1:10 and 1:40 get's more bandwidth then they should.  
Actually, the remaining bandwidth is not divided proportional to the rate, 
but to quantum.  Quantum is calculated as rate / r2q with 2rq = 10.  But you 
can overrule r2q when you add the htb qdisc and you can overrule quantum per 
class.  I have more info on www.docum.org, under FAQ, HTB, quantum.

If rate = 4kbit/s and r2q = 10, then quantum = 4kbit/10 = 400 byte
If rate = 15kbit/s and r2q = 10, then quantum = 15kbit/10 = 1500 byte
Each class can send an amount of bytes equal to it's quantum.  But a packet 
is most of time bigger then 400 byte so for the 4kbit class, more bytes are 
sended then allowed and there is no payback
Solution : decrease quantum so the smallest quantum is big enough to send the 
bigest packet.  So setting r2q = 2 will give better results.
tc qdisc add dev eth0 root handle 1: htb default 100 r2q 2

You will also find some errors in the log file about htb that's complaining 
that the quantum is too small.  This is triggered because you want to send a 
packet that's bigger then the quantum.
After decreasing the r2q parameter, these errors should disappear.
The default r2q parameter is OK for classes with rates > 15kbit/s.

(thx to Devik to explain me this some time ago)

Stef

-- 

stef.coene@docum.org
 "Using Linux as bandwidth manager"
     http://www.docum.org/
     #lartc @ irc.openprojects.net
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

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