Hi all, We have 2 class C networks that are connected by a Linux router with the internet. We want to apply traffic control (bandwidth control). For that we wrote the tcc script below. We have 2 problems: 1. To establish a 2 megagit download we must actually set the value to 2500kbps. Is there a possible reason for that? 2. If we enable the WAN device we get very hight ping times (they change from 21.1 ms to > 2000 ms) and erratic upload values that partly suffer from the problem above (we want to allow for an upload of 512kb and have to specify a upload of 712 to get that) but most of the time we have a far worse actual upload. Anyone any ideas? We use Debian 2.6.3-1-386 (Sarge) with tcng 9m. Any help is greatly appreciated. Groeten, Joost Kraaijeveld Askesis B.V. Molukkenstraat 14 6524NB Nijmegen tel: 024-3888063 / 06-51855277 fax: 024-3608416 e-mail: J.Kraaijeveld@Askesis.nl web: www.askesis.nl /////////////////////////////////////////////////////////////////////////// #include "fields.tc" #include "ports.tc" #define WAN eth0 #define LAN83 eth1 #define LAN84 eth2 /* The WAN section is about upload to the internet */ dev WAN { egress { class ( <$uploadRouter> ) if ip_src == 192.168.83.1 || ip_src == 192.168.84.1; class ( <$uploadGKS> ) if ip_src == 192.168.83.22 ; class ( <$upload83> ) if ip_src:24 == 192.168.83.0 ; class ( <$upload84> ) if ip_src:24 == 192.168.84.0 ; class ( <$others> ) if 1 ; htb () { class ( rate 18Mbps, ceil 18Mbps ) { $uploadRouter = class ( rate 18Mbps, ceil 18Mbps ); $uploadGKS = class ( rate 10Mbps, ceil 10Mbps ) ; $upload83 = class ( rate 5Mbps, ceil 5Mbps ) ; $upload84 = class ( rate 712kbps, ceil 712kbps ) ; $others = class ( rate 18Mbps , ceil 18Mbps ) ; } } } } /* This section is about downloading to the 83 network */ dev LAN83 { egress { class ( <$downloadRouter> ) if ip_dst == 192.168.83.1; class ( <$downloadGKS> ) if ip_dst == 192.168.83.22; class ( <$download> ) if ip_dst:24 == 192.168.83.0; class ( <$others> ) if 1 ; htb () { class ( rate 18Mbps, ceil 18Mbps ) { $downloadRouter = class ( rate 18Mbps, ceil 18Mbps ) ; $downloadGKS = class ( rate 10Mbps, ceil 10Mbps ) ; $download = class ( rate 5Mbps, ceil 5Mbps ) ; $others = class ( rate 18Mbps, ceil 18Mbps ) ; } } } } /* This section is about downloading to the 84 network */ dev LAN84 { egress { class ( <$download> ) if ip_dst:24 == 192.168.84.0; class ( <$others> ) if 1 ; htb () { class ( rate 18Mbps, ceil 18Mbps ) { $download = class ( rate 2500kbps,ceil 2500kbps ) ; $others = class ( rate 18Mbps, ceil 18Mbps ) ; } } } } _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
Hi Joost, I think that maybe you have run across an issue that I too had trouble with. A snip from a message from Martin BROWN explains:> You have not actually found a bug, but rather a historical strangeness > about the Linux traffic control system. For reasons of which I''m > ignorant, the syntax for the "tc" command uses bps for bytes/second.So,> 64000 bytes/second is actually 512 kilobits/second ("512 kbps" incommon> usage), but is 512 kbit to the "tc" tool. Here''s a brief chart: > > tc syntax tcng syntax > +----------------+----------------+ > bytes/second | bps | Bps | > bits/second | bit | bps | > kilobytes/second | kbps | kBps | > kilobits/second | kbit | kbps | > +----------------+----------------+ > > Note that the tcng syntax is exactly the same sort of syntax we use in > general when discussing speed of WAN links. "It''s a 512 kbps line"means> it''s 512 kilobits per second, but this would be 64000 bytes per secondif> we were writing a "tc" command line.Hope this helps! Cheers Chalres On Thu, 2004-08-05 at 09:53, Joost Kraaijeveld wrote:> Hi all, > > We have 2 class C networks that are connected by a Linux router with the internet. We want to apply traffic control (bandwidth control). For that we wrote the tcc script below. We have 2 problems: > > 1. To establish a 2 megagit download we must actually set the value to 2500kbps. Is there a possible reason for that? > 2. If we enable the WAN device we get very hight ping times (they change from 21.1 ms to > 2000 ms) and erratic upload values that partly suffer from the problem above (we want to allow for an upload of 512kb and have to specify a upload of 712 to get that) but most of the time we have a far worse actual upload. Anyone any ideas? > > We use Debian 2.6.3-1-386 (Sarge) with tcng 9m. > > Any help is greatly appreciated. > > Groeten, > > Joost Kraaijeveld > Askesis B.V. > Molukkenstraat 14 > 6524NB Nijmegen > tel: 024-3888063 / 06-51855277 > fax: 024-3608416 > e-mail: J.Kraaijeveld@Askesis.nl > web: www.askesis.nl > > /////////////////////////////////////////////////////////////////////////// > #include "fields.tc" > #include "ports.tc" > > #define WAN eth0 > #define LAN83 eth1 > #define LAN84 eth2 > > /* The WAN section is about upload to the internet */ > > dev WAN > { > egress > { > class ( <$uploadRouter> ) if ip_src == 192.168.83.1 || ip_src == 192.168.84.1; > class ( <$uploadGKS> ) if ip_src == 192.168.83.22 ; > class ( <$upload83> ) if ip_src:24 == 192.168.83.0 ; > class ( <$upload84> ) if ip_src:24 == 192.168.84.0 ; > class ( <$others> ) if 1 ; > > htb () > { > class ( rate 18Mbps, ceil 18Mbps ) > { > $uploadRouter = class ( rate 18Mbps, ceil 18Mbps ); > $uploadGKS = class ( rate 10Mbps, ceil 10Mbps ) ; > $upload83 = class ( rate 5Mbps, ceil 5Mbps ) ; > $upload84 = class ( rate 712kbps, ceil 712kbps ) ; > $others = class ( rate 18Mbps , ceil 18Mbps ) ; > } > } > } > } > > /* This section is about downloading to the 83 network */ > > dev LAN83 > { > egress > { > class ( <$downloadRouter> ) if ip_dst == 192.168.83.1; > class ( <$downloadGKS> ) if ip_dst == 192.168.83.22; > class ( <$download> ) if ip_dst:24 == 192.168.83.0; > class ( <$others> ) if 1 ; > > htb () > { > class ( rate 18Mbps, ceil 18Mbps ) > { > $downloadRouter = class ( rate 18Mbps, ceil 18Mbps ) ; > $downloadGKS = class ( rate 10Mbps, ceil 10Mbps ) ; > $download = class ( rate 5Mbps, ceil 5Mbps ) ; > $others = class ( rate 18Mbps, ceil 18Mbps ) ; > } > } > } > } > > /* This section is about downloading to the 84 network */ > > dev LAN84 > { > egress > { > class ( <$download> ) if ip_dst:24 == 192.168.84.0; > class ( <$others> ) if 1 ; > htb () > { > class ( rate 18Mbps, ceil 18Mbps ) > { > $download = class ( rate 2500kbps,ceil 2500kbps ) ; > $others = class ( rate 18Mbps, ceil 18Mbps ) ; > } > } > } > } > _______________________________________________ > LARTC mailing list / LARTC@mailman.ds9a.nl > http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/_______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
Hi Chalres, Thanks for the answer. I have also been bitten by the byte/bit bug in the past but in this case it must be something different. All my values are in in the correct amount of bits. The most important problem is actually problem 2: why does the tc toward internet (dev WAN) do what it does? Groeten, Joost Kraaijeveld Askesis B.V. Molukkenstraat 14 6524NB Nijmegen tel: 024-3888063 / 06-51855277 fax: 024-3608416 e-mail: J.Kraaijeveld@Askesis.nl web: www.askesis.nl _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
Hi Joost, OK -- on the units of measure -- you may to double check that your upstream provider is 2.000.000 bits/s and not 2 * 1024^1024. I think that your r2q is probably off -- please see: http://www.docum.org/stef.coene/qos/faq/cache/31.html Check your system log as well -- you may see an indication of the problem. You can try #define MYR2Q 20 and then in your htb declaration try htb ( r2q MYR2Q ) Also consider specifying a burst of 6kB and try someother values. Cheers Charles On Thu, 2004-08-05 at 10:26, Joost Kraaijeveld wrote:> Hi Chalres, > > Thanks for the answer. I have also been bitten by the byte/bit bug in the past but in this case it must be something different. All my values are in in the correct amount of bits. > > The most important problem is actually problem 2: why does the tc toward internet (dev WAN) do what it does? > > > Groeten, > > Joost Kraaijeveld > Askesis B.V. > Molukkenstraat 14 > 6524NB Nijmegen > tel: 024-3888063 / 06-51855277 > fax: 024-3608416 > e-mail: J.Kraaijeveld@Askesis.nl > web: www.askesis.nl > _______________________________________________ > LARTC mailing list / LARTC@mailman.ds9a.nl > http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/_______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
Hi Charles, lartc@manchotnetworks.net schreef:> I think that your r2q is probably off -- please see: > > http://www.docum.org/stef.coene/qos/faq/cache/31.htmlThis link does not work. All other numbers are there but one is not. But it''s true: in the logfiles I see r2q mentioned (jumping with joy in my office, hope at last). Thanks. Groeten, Joost Kraaijeveld Askesis B.V. Molukkenstraat 14 6524NB Nijmegen tel: 024-3888063 / 06-51855277 fax: 024-3608416 e-mail: J.Kraaijeveld@Askesis.nl web: www.askesis.nl _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
On Thursday 05 August 2004 12:36, Joost Kraaijeveld wrote:> Hi Charles, > > lartc@manchotnetworks.net schreef: > > I think that your r2q is probably off -- please see: > > > > http://www.docum.org/stef.coene/qos/faq/cache/31.html > > This link does not work.Correct link (I rehosted the site and the main path is changed): http://www.docum.org/docum.org/faq/cache/31.html 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/
Hi Joost, I hope you saw Steph''s message on the link ... On Thu, 2004-08-05 at 12:36, Joost Kraaijeveld wrote:> But it''s true: in the logfiles I see r2q mentioned > (jumping with joy in my office, hope at last).Careful not to jump too hard -- you might wake up the management :-) Cheers Charles _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/