I''m moving my old HTB script over from my old slackware install (using older iproute2, version iproute2-ss991023) onto my brand-spanking-new Debian 3.0r0 (woody) machine, running newer version iproute2-ss010824. But in the new version of "tc", the very first command of the script gives "RTNETLINK answers: Invalid argument". However, if I use the OLD tc (991023), it works fine (and so does the rest of my script). Therefore it''s not my kernel etc; it must be some difference on the cmd-line between the two versions of iproute2. But no matter how hard i try, I can''t find out what the new syntax should be. Here''s the line that''s failing: tc qdisc add dev eth0 root handle 1: htb default 13 Any ideas how to make that work with the new version? Also, here''s my HTB/SFQ setup for my house, I wonder if one of you genii could have a look over it and tell me the crap parts and how to improve :) My setup is one cablemodem connection with 25k/sec max upstream, and about 100k/sec downstream. I have 3 main classes (if that''s the right word), one for SSH traffic, one for ACKs, and one for the personal PCs of the 3 guys that live in our house (including me). Here goes: ------------------------ #!/bin/sh tc qdisc del dev eth0 root handle 1: htb default 13 1>/dev/null 2>/dev/null tc qdisc add dev eth0 root handle 1: htb default 13 UPRATE="21" SINGLE_HUMAN_CEIL="19" NON_CRITICAL="14" SINGLE_HUMAN_UPRATE="4" CRIT_SSH="2" CRIT_NONSSH="5" # root tc class add dev eth0 parent 1: classid 1:1 htb rate ${UPRATE}kbps ceil ${UPRATE}kbps burst 2k # child 1 - PCs (tim/peter/brian/router PCs) - has leaves underneath tc class add dev eth0 parent 1:1 classid 1:2 htb rate ${NON_CRITICAL}kbps ceil ${UPRATE}kbps burst 2k prio 3 # child 2 - time critical traffic (interactive traffic, etc) - has no leaves! tc class add dev eth0 parent 1:1 classid 1:3 htb rate ${CRIT_SSH}kbps ceil ${UPRATE}kbps burst 2k prio 1 # child 3 - time critical traffic (interactive traffic, etc) - has no leaves! tc class add dev eth0 parent 1:1 classid 1:4 htb rate ${CRIT_NONSSH}kbps ceil ${UPRATE}kbps burst 2k prio 2 # 1:10 tim tc class add dev eth0 parent 1:2 classid 1:10 htb rate ${SINGLE_HUMAN_UPRATE}kbps ceil ${SINGLE_HUMAN_CEIL}kbps burst 2k prio 3 # 1:11 peter tc class add dev eth0 parent 1:2 classid 1:11 htb rate ${SINGLE_HUMAN_UPRATE}kbps ceil ${SINGLE_HUMAN_CEIL}kbps burst 2k prio 3 # 1:12 brian tc class add dev eth0 parent 1:2 classid 1:12 htb rate ${SINGLE_HUMAN_UPRATE}kbps ceil ${SINGLE_HUMAN_CEIL}kbps burst 2k prio 3 # 1:13 default - includes this router tc class add dev eth0 parent 1:2 classid 1:13 htb rate 2kbps ceil ${SINGLE_HUMAN_CEIL}kbps burst 2k prio 3 # use SFQ (stochastic fair queueing) for everything tc qdisc add dev eth0 parent 1:10 handle 10: sfq perturb 10 tc qdisc add dev eth0 parent 1:11 handle 11: sfq perturb 10 tc qdisc add dev eth0 parent 1:12 handle 12: sfq perturb 10 tc qdisc add dev eth0 parent 1:13 handle 13: sfq perturb 10 tc qdisc add dev eth0 parent 1:3 handle 3: sfq perturb 10 tc qdisc add dev eth0 parent 1:4 handle 4: sfq perturb 10 # matchings # match any ACK packets to interactive (critical traffic) tc filter add dev eth0 parent 1: protocol ip prio 5 u32 \ match ip protocol 6 0xff \ match u8 0x05 0x0f at 0 \ match u16 0x0000 0xffc0 at 2 \ match u8 0x10 0xff at 33 \ flowid 1:4 # match ping packets to critical traffic tc filter add dev eth0 parent 1: protocol ip prio 7 u32 \ match ip protocol 1 0xff flowid 1:4 # match SSH (not scp) to critical traffic tc filter add dev eth0 parent 1: protocol ip prio 6 u32 \ match ip tos 0x10 0xff flowid 1:3 # match packets MARKed by iptables for individual PCs tc filter add dev eth0 protocol ip parent 1:0 prio 10 handle 10 fw flowid 1:10 tc filter add dev eth0 protocol ip parent 1:0 prio 10 handle 11 fw flowid 1:11 tc filter add dev eth0 protocol ip parent 1:0 prio 10 handle 12 fw flowid 1:12 ------------------------- It works, but i''m not sure if it could be improved at all. I don''t know much about burst/prio settings for HTB, and even less about the SFQ stuff i''m using with perturb 10. Also, I get some warnings about HTB''s quantums in various log files, none of which I understand. All help welcome! many thanks, tim ----------------------------------- Tim Carr Co-op Student - Unix Group RIM Canada (519) 888-7465 x2561 WATERLOO HANDMADE EMAIL PROJECT: This email is made from natural Jute fibers by artisans working at the Handmade Email Project. Your correspondence revives a traditional craft and helps create employment for underpriviledged co-op students working the rural areas of Waterloo. _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
On Thursday 31 October 2002 20:59, Tim Carr wrote:> I''m moving my old HTB script over from my old slackware install (using > older iproute2, version iproute2-ss991023) onto my brand-spanking-new > Debian 3.0r0 (woody) machine, running newer version iproute2-ss010824. But > in the new version of "tc", the very first command of the script gives > "RTNETLINK answers: Invalid argument". However, if I use the OLD tc > (991023), it works fine (and so does the rest of my script). Therefore > it''s not my kernel etc; it must be some difference on the cmd-line between > the two versions of iproute2. But no matter how hard i try, I can''t find > out what the new syntax should be. Here''s the line that''s failing: > > tc qdisc add dev eth0 root handle 1: htb default 13 > > Any ideas how to make that work with the new version?You have to use the same htb version for tc and the kernel. Maybe that''s the problem.> Also, here''s my HTB/SFQ setup for my house, I wonder if one of you genii > could have a look over it and tell me the crap parts and how to improve :) > My setup is one cablemodem connection with 25k/sec max upstream, and about > 100k/sec downstream. I have 3 main classes (if that''s the right word), one > for SSH traffic, one for ACKs, and one for the personal PCs of the 3 guys > that live in our house (including me). Here goes:The setup seams ok to me.> It works, but i''m not sure if it could be improved at all. I don''t know > much about burst/prio settings for HTB,Burst is burst :) Burst 10k allows the class to burst 10000 bytes before other classes are served. But rate and ceil restrictions are still applied. This can be usefull if you have a class that contains http traffic so small pages are loaded very quick. The lates htb version will calculate the burst for you if you don''t specify it. Prio is more complicated. More info can be found on the htb homepage. and even less about the SFQ stuff> i''m using with perturb 10.SFQ creates a hash table to classify the traffic. This hash table is limited to a certain entry''s. To be sure that old streams don''t use too much hash keys, the hash is flushed from time to time. perturb 10 means the hash is flushed each 10 seconds.> Also, I get some warnings about HTB''s quantums > in various log files, none of which I understand.Quantum must be greater then 1500. You have a class with rate 2 so the quantum of that class is 2k / 10 (10 is default) = 200. This is smaller then 1500. Solution : ignore the warnings :) or overrule the r2q parameter (when you add the qdisc) or overrule the quantum parameter (when you add a class). More info on www.docum.org on the faq page.> > All help welcome!Stef -- stef.coene@docum.org "Using Linux as bandwidth manager" http://www.docum.org/ #lartc @ irc.oftc.net _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
> try, I can''t find > > out what the new syntax should be. Here''s the line that''s failing: > > > > tc qdisc add dev eth0 root handle 1: htb default 13 > > > > Any ideas how to make that work with the new version?> You have to use the same htb version for tc and the kernel. > Maybe that''s the > problem.Hmm. I''m using debian''s stock version of iproute2''s "tc" command, and i''m using the HTB that comes with kernel 2.4.20pre11. Does anyone know what version of HTB that is, and whether it''s the newest ?> Quantum must be greater then 1500. You have a class with > rate 2 so the > quantum of that class is 2k / 10 (10 is default) = 200. This > is smaller then > 1500. Solution : ignore the warnings :) or overrule the r2qOk, is it not "working" properly because my quantum is too low? What kind of ill-effects will this have? Many thanks, tim _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
Oops, pardon me for partially answering my own questions, but let me clarify: 1. I read the bit of the FAQ on docum.org that explains the quantum stuff. Nice site Stef. So it looks to me that in HTB3 if your quantum is less than the packet size, since it still sends the packet anyways, it''s not really limiting the packets at the rate you want? (!) .. How do I actually limit something to a cold/hard 2kbytes/sec ? If I manually set the quantum, it''ll still be lower than most packet sizes, and according to what I read in the FAQ it won''t actually limit it below the packet size. 2. In HTB, which is MORE important (and therefore gets more attention): a lower or higher prio? The faq leads me to believe a LOWER prio is MORE important. (Stef you could add this in b/w to the FAQ, it''s not clear). Thanks again, tim> -----Original Message----- > From: Tim Carr > Sent: November 1, 2002 10:29 AM > To: Stef Coene; lartc@mailman.ds9a.nl > Subject: RE: [LARTC] Anyone seen this? > > > > try, I can''t find > > > out what the new syntax should be. Here''s the line that''s failing: > > > > > > tc qdisc add dev eth0 root handle 1: htb default 13 > > > > > > Any ideas how to make that work with the new version? > > > You have to use the same htb version for tc and the kernel. > > Maybe that''s the > > problem. > > Hmm. I''m using debian''s stock version of iproute2''s "tc" > command, and i''m using the HTB that comes with kernel > 2.4.20pre11. Does anyone know what version of HTB that is, > and whether it''s the newest ? > > > Quantum must be greater then 1500. You have a class with > > rate 2 so the > > quantum of that class is 2k / 10 (10 is default) = 200. This > > is smaller then > > 1500. Solution : ignore the warnings :) or overrule the r2q > > Ok, is it not "working" properly because my quantum is too > low? What kind of ill-effects will this have? > > Many thanks, > > tim > _______________________________________________ > 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/
On Fri, Nov 01, 2002 at 10:29:19AM -0500, Tim Carr wrote:> > try, I can''t find > > > out what the new syntax should be. Here''s the line that''s failing:> > You have to use the same htb version for tc and the kernel. > > Maybe that''s the > > problem. > > Hmm. I''m using debian''s stock version of iproute2''s "tc" command, and i''m using the HTB that comes with kernel 2.4.20pre11. Does anyone know what version of HTB that is, and whether it''s the newest ?tc in debian is compiled with HTB 2 IIRC, and in kernel 2.4.20 this is HTB 3.7 and they are not compatible. Take tc from devik''s page Luc _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
On Friday 01 November 2002 16:43, Tim Carr wrote:> Oops, pardon me for partially answering my own questions, but let me > clarify: > > 1. I read the bit of the FAQ on docum.org that explains the quantum stuff. > Nice site Stef. So it looks to me that in HTB3 if your quantum is less > than the packet size, since it still sends the packet anyways, it''s not > really limiting the packets at the rate you want? (!) .. How do I actually > limit something to a cold/hard 2kbytes/sec ? If I manually set the > quantum, it''ll still be lower than most packet sizes, and according to what > I read in the FAQ it won''t actually limit it below the packet size.You have to compare the highes and the lowest rate you have. You have to choose r2q so the lowest-rate / r2q > 1500 and highest-rate / r2q < 60000. You can specify the r2q parameter if you add the htb qdisc. Shaping with a wrong quantum is not harmfull. But you will not get the results you wanted. I just did some small test with the quantum parameter. I have to make a link on the site, but you can find it for now on : http://home.docum.org/stef.coene/qos/tests/htb/quantum/> 2. In HTB, which is MORE important (and therefore gets more attention): a > lower or higher prio? The faq leads me to believe a LOWER prio is MORE > important. (Stef you could add this in b/w to the FAQ, it''s not clear).Done :) The lower the prio, the higher the priority Stef> Thanks again, > > tim > > > -----Original Message----- > > From: Tim Carr > > Sent: November 1, 2002 10:29 AM > > To: Stef Coene; lartc@mailman.ds9a.nl > > Subject: RE: [LARTC] Anyone seen this? > > > > > try, I can''t find > > > > > > > out what the new syntax should be. Here''s the line that''s failing: > > > > > > > > tc qdisc add dev eth0 root handle 1: htb default 13 > > > > > > > > Any ideas how to make that work with the new version? > > > > > > You have to use the same htb version for tc and the kernel. > > > Maybe that''s the > > > problem. > > > > Hmm. I''m using debian''s stock version of iproute2''s "tc" > > command, and i''m using the HTB that comes with kernel > > 2.4.20pre11. Does anyone know what version of HTB that is, > > and whether it''s the newest ? > > > > > Quantum must be greater then 1500. You have a class with > > > rate 2 so the > > > quantum of that class is 2k / 10 (10 is default) = 200. This > > > is smaller then > > > 1500. Solution : ignore the warnings :) or overrule the r2q > > > > Ok, is it not "working" properly because my quantum is too > > low? What kind of ill-effects will this have? > > > > Many thanks, > > > > tim > > _______________________________________________ > > LARTC mailing list / LARTC@mailman.ds9a.nl > > http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/-- stef.coene@docum.org "Using Linux as bandwidth manager" http://www.docum.org/ #lartc @ irc.oftc.net _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
> You have to compare the highes and the lowest rate you have. > You have to > choose r2q so the lowest-rate / r2q > 1500 and highest-rate / > r2q < 60000. > You can specify the r2q parameter if you add the htb qdisc.Ok, I specified the r2q as 2, and now here''s my HTB: ------------------------- ROOT class htb 1:1 root rate 168Kbit ceil 168Kbit burst 2Kb/8 mpu 0b cburst 1814b/8 mpu 0b level 7 Sent 27115 bytes 246 pkts (dropped 0, overlimits 0) rate 289bps 3pps lended: 10 borrowed: 0 giants: 0 tokens: 72229 ctokens: 63353 PCs'' upstreams class htb 1:2 parent 1:1 rate 112Kbit ceil 168Kbit burst 2Kb/8 mpu 0b cburst 1814b/8 mpu 0b level 6 Sent 1239 bytes 8 pkts (dropped 0, overlimits 0) rate 6bps lended: 0 borrowed: 0 giants: 0 tokens: 93716 ctokens: 53600 SSH packets class htb 1:3 parent 1:1 leaf 3: prio 1 quantum 2048 rate 16Kbit ceil 168Kbit burst 2Kb/8 mpu 0b cburst 1814b/8 mpu 0b level 0 Sent 18380 bytes 104 pkts (dropped 0, overlimits 0) rate 159bps 1pps lended: 94 borrowed: 10 giants: 0 tokens: 777601 ctokens: 65181 ACK packets class htb 1:4 parent 1:1 leaf 4: prio 2 quantum 5120 rate 40Kbit ceil 168Kbit burst 2Kb/8 mpu 0b cburst 1814b/8 mpu 0b level 0 Sent 7496 bytes 134 pkts (dropped 0, overlimits 0) rate 71bps 1pps lended: 134 borrowed: 0 giants: 0 tokens: 320000 ctokens: 67314 PC 1 class htb 1:10 parent 1:2 leaf 10: prio 3 quantum 4096 rate 32Kbit ceil 152Kbit burst 2Kb/8 mpu 0b cburst 1793b/8 mpu 0b level 0 Sent 0 bytes 0 pkts (dropped 0, overlimits 0) lended: 0 borrowed: 0 giants: 0 tokens: 409600 ctokens: 75536 PC 2 class htb 1:11 parent 1:2 leaf 11: prio 3 quantum 4096 rate 32Kbit ceil 152Kbit burst 2Kb/8 mpu 0b cburst 1793b/8 mpu 0b level 0 Sent 0 bytes 0 pkts (dropped 0, overlimits 0) lended: 0 borrowed: 0 giants: 0 tokens: 409600 ctokens: 75536 PC 3 class htb 1:12 parent 1:2 leaf 12: prio 3 quantum 4096 rate 32Kbit ceil 152Kbit burst 2Kb/8 mpu 0b cburst 1793b/8 mpu 0b level 0 Sent 0 bytes 0 pkts (dropped 0, overlimits 0) lended: 0 borrowed: 0 giants: 0 tokens: 409600 ctokens: 75536 ROUTER (this machine itself!) and default class htb 1:13 parent 1:2 leaf 13: prio 3 quantum 2048 rate 16Kbit ceil 152Kbit burst 2Kb/8 mpu 0b cburst 1793b/8 mpu 0b level 0 Sent 1239 bytes 8 pkts (dropped 0, overlimits 0) rate 6bps lended: 8 borrowed: 0 giants: 0 tokens: 656002 ctokens: 58359 -------------------- Note that all my quantums are now >1500 and < 60k. Does everything here look ok? Will the rates be more accurate now that quantum isn''t 1000? How do I make pretty graphical pictures like you guys did, to tell how well it is working?> results you wanted. I just did some small test with the > quantum parameter. > I have to make a link on the site, but you can find it for now on : > http://home.docum.org/stef.coene/qos/tests/htb/quantum/That link doesn''t work for me. Can you check it for me?> The lower the prio, the higher the priorityGreat, thanks. Thanks for all the help! tim _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
> Note that all my quantums are now >1500 and < 60k. Does everything here > look ok?Yes.> Will the rates be more accurate now that quantum isn''t 1000?>Yes and you will see no complains anymore in your logging.> How > do I make pretty graphical pictures like you guys did, to tell how well it > is working?I have some scripts on www.docum.org on the GUI page. They read the tc counters, and use rrd to create graphs. You can mail me if you have any problems with the scripts.> > results you wanted. I just did some small test with the > > quantum parameter. > > I have to make a link on the site, but you can find it for now on : > > http://home.docum.org/stef.coene/qos/tests/htb/quantum/ > > That link doesn''t work for me. Can you check it for me?I will upload it to www.docum.org and create a link on the test page under the htb chapter. Stef -- stef.coene@docum.org "Using Linux as bandwidth manager" http://www.docum.org/ #lartc @ irc.oftc.net _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/