This is one of my test classes: class htb 1:10 parent 1:1 prio 0 quantum 2048 rate 160Kbit ceil 400Kbit burst 1803b/8 mpu 0b cburst 2111b/8 mpu 0b level 0 Q1: where does "level 0" stand for? Q2: where does this b/8 stand for? Q3: this is on a i386 platform, so timer resolution should be 10mS. According to the doc the minimal burst should be 10mS*160Kbit=1600. Why is it 1803? Q4: I want this class to be able to allow 400Kbit burst during 3 seconds. What value should I give to the burst parameter? Is this 400/160*1803=4507b? TIA, Richard. _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
On Thursday 18 November 2004 19:27, richard lucassen wrote:> This is one of my test classes: > > class htb 1:10 parent 1:1 prio 0 quantum 2048 rate 160Kbit ceil 400Kbit > burst 1803b/8 mpu 0b cburst 2111b/8 mpu 0b level 0 > > Q1: where does "level 0" stand for?From /usr/src/linux-2.6.8/net/sched/sch_htb.c Levels: Each class is assigned level. Leaf has ALWAYS level 0 and root classes have level TC_HTB_MAXDEPTH-1. Interior nodes has level one less than their parent.> Q2: where does this b/8 stand for?Don''t know.> Q3: this is on a i386 platform, so timer resolution should be 10mS. > According to the doc the minimal burst should be 10mS*160Kbit=1600. Why > is it 1803?From /usr/src/iproute2/tc/q_htb.c /* compute minimal allowed burst from rate; mtu is added here to make sute that buffer is larger than mtu and to have some safeguard space */> Q4: I want this class to be able to allow 400Kbit burst during 3 > seconds. What value should I give to the burst parameter? Is this > 400/160*1803=4507b?400kbit * 3s = 1200kbit. You can try this, but htb burst is not made for this. It is made for burst of a few k. Stef -- stef.coene@docum.org "Using Linux as bandwidth manager" http://www.docum.org/ _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
On Thu, 18 Nov 2004 22:50:17 +0100 Stef Coene <stef.coene@docum.org> wrote: [..]> > Q4: I want this class to be able to allow 400Kbit burst during 3 > > seconds. What value should I give to the burst parameter? Is this > > 400/160*1803=4507b? > 400kbit * 3s = 1200kbit. > You can try this, but htb burst is not made for this. It is made for > burst of a few k.So a burst of 20k means the next 20kbit waiting in the queue will be sent in one burst before switching to another queue. This also means that this block of 20kbit is sent full speed over the line and it is not limited by any ceiling or whatsoever. Right or wrong? R. -- ___________________________________________________________________ Recursion: see recursion +------------------------------------------------------------------+ | Richard Lucassen, Utrecht | | Public key and email address: | | http://www.lucassen.org/mail-pubkey.html | +------------------------------------------------------------------+ _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
On Monday 22 November 2004 00:17, richard lucassen wrote:> On Thu, 18 Nov 2004 22:50:17 +0100 > Stef Coene <stef.coene@docum.org> wrote: > > [..] > > > > Q4: I want this class to be able to allow 400Kbit burst during 3 > > > seconds. What value should I give to the burst parameter? Is this > > > 400/160*1803=4507b? > > > > 400kbit * 3s = 1200kbit. > > You can try this, but htb burst is not made for this. It is made for > > burst of a few k. > > So a burst of 20k means the next 20kbit waiting in the queue will be > sent in one burst before switching to another queue. This also means > that this block of 20kbit is sent full speed over the line and it is not > limited by any ceiling or whatsoever. > > Right or wrong?Wrong. There are 2 bursts: a burst for the rate and a cburst for the ceil. So if you have a burst, it''s still checked against the ceil. Check out http://www.docum.org/docum.org/tests/htb/burst/ for some tests. Stef -- stef.coene@docum.org "Using Linux as bandwidth manager" http://www.docum.org/ _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
On Tue, 23 Nov 2004 19:56:31 +0100 Stef Coene <stef.coene@docum.org> wrote:> > So a burst of 20k means the next 20kbit waiting in the queue will be > > sent in one burst before switching to another queue. This also means > > that this block of 20kbit is sent full speed over the line and it is > > not limited by any ceiling or whatsoever. > > > > Right or wrong? > Wrong. There are 2 bursts: a burst for the rate and a cburst for the > ceil. So if you have a burst, it''s still checked against the ceil. > Check out > http://www.docum.org/docum.org/tests/htb/burst/ > for some tests.Ok, of course it is checked against the ceiling over a longer period, but what I try to understand is the value that is given to the "burst" variable. What you show on your (very good) website is what happens during a longer time (seconds). I try to understand why in practice this "burst" value is for example 20k and not 500k (which is easier to understand btw ;-) Two very simplified queues, same rate, same ceiling, MTU 1500, queue1: burst 1500, queue2: burst 6000, each x represents a packet of 1500 bytes. As far as I understand it the packets are sent out this way (at maximum hardware speed): time || \/ Q1 xxxx <- Q1 can use its burst value and sends 4 packets Q2 x Q1 x <- burst is discharged, Q1 sends 1 packet at a time Q2 x Q1 x Q2 x <- Q1 stops sending packets, burst can recharge Q2 x Q2 x Q2 x <- burst of Q1 is now fully charged Q1 xxxx <- Q1 can use its burst value and sends 4 packets Q2 x Q1 x It is a very simplified (and maybe wrong) example, but I want to make clear for myself why this burst is for example 20k and not 500k, as in test2 on http://www.docum.org/docum.org/tests/htb/burst/ I can only explain this issue this way. From Devik''s doc: http://luxik.cdi.cz/~devik/qos/htb/manual/userg.htm ################################################################# Networking hardware can only send one packet at a time and only at a hardware dependent rate. Link sharing software can only use this ability to approximate the effects of multiple links running at different (lower) speeds. Therefore the rate and ceil are not really instantaneous measures but averages over the time that it takes to send many packets. What really happens is that the traffic from one class is sent a few packets at a time at the maximum speed and then other classes are served for a while. The burst and cburst parameters control the amount of data that can be sent at the maximum (hardware) speed without trying to serve another class. ################################################################# The last sentence makes this clear IMHO. But I can be terribly wrong of course, so please correct me if I''m still wrong... R. _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
On Tuesday 23 November 2004 21:08, richard lucassen wrote: <snip>> The last sentence makes this clear IMHO. But I can be terribly wrong of > course, so please correct me if I''m still wrong...I think you are right. I also know that this is not how htb works because this wil eat cpu cycles. There is some optimalization in the code so htb can "predict'' the class that has a lot of packets to send. One of the parameters that controls this, is HTB_HYSTERESIS. Stef -- stef.coene@docum.org "Using Linux as bandwidth manager" http://www.docum.org/ _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/