hi, i have a simple configuration: hostA(192.168.100.44) <-----> hostB(192.168.100.45). I want to shape the traffic from hostB to hostA to a maximum of 10kbps: hostB# tc qdisc add dev eth0 root handle 1:0 htb default 11 hostB# tc class add dev eth0 parent 1:0 classid 1:1 htb \ rate 200kbps ceil 200kbps hostB# tc class add dev eth0 parent 1:1 classid 1:10 htb \ rate 10kbps ceil 10kbps hostB# tc class add dev eth0 parent 1:1 classid 1:11 htb \ rate 100kbps ceil 100kbps bostB# tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32 \ match ip dst 192.168.100.44 flowid 1:10 With this setup, a wget run on hostA downloading from hostB has an average rate of 97.74 KB/s - it seems to be classified to the default classid 1:11, not classid 1:10. Also, the class statistics below show traffic accounted to class 1:11. tc details: hostB# tc -d -s qdisc ls dev eth0 qdisc htb 1: r2q 10 default 11 direct_packets_stat 0 ver 3.12 Sent 1137520 bytes 1714 pkts (dropped 0, overlimits 2010) hostB# tc -d -s class ls dev eth0 class htb 1:11 parent 1:1 prio 0 quantum 10240 rate 800Kbit ceil 800Kbit burst 2623b/8 mpu 0b cburst 2623b/8 mpu 0b level 0 Sent 1071226 bytes 711 pkts (dropped 0, overlimits 0) rate 33475bps 22pps lended: 711 borrowed: 0 giants: 0 tokens: 7557 ctokens: 7557 class htb 1:1 root rate 1600Kbit ceil 1600Kbit burst 3647b/8 mpu 0b cburst 3647b/8 mpu 0b level 7 Sent 1137520 bytes 1714 pkts (dropped 0, overlimits 0) rate 35547bps 53pps lended: 0 borrowed: 0 giants: 0 tokens: 14336 ctokens: 14336 class htb 1:10 parent 1:1 prio 0 quantum 1024 rate 80Kbit ceil 80Kbit burst 1701b/8 mpu 0b cburst 1701b/8 mpu 0b level 0 Sent 66294 bytes 1003 pkts (dropped 0, overlimits 0) rate 2071bps 31pps lended: 1003 borrowed: 0 giants: 0 tokens: 125919 ctokens: 125919 hostB# tc -d -s filter ls dev eth0 filter parent 1: protocol ip pref 49152 u32 filter parent 1: protocol ip pref 49152 u32 fh 800: ht divisor 1 filter parent 1: protocol ip pref 49152 u32 fh 800::800 order 2048 key ht 800 bkt 0 flowid 1:10 match c0a8642c/ffffffff at 16 tc binary downloaded from http://luxik.cdi.cz/~devik/qos/htb/v3/htb3.6-020525.tgz. hostB is a Slackware 9.1 running recompiled 2.4.22, cls_u32 and sch_htb loaded as modules. If instead of matching ip dst for hostA i match ip src for hostB, it works as expected - rate is 10Kb/s with the following: hostb# tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32 \ match ip src 192.168.100.45 flowid 1:10 _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
i''ve just compiled 2.4.23-rc1 and now it works. it seems the problem was indeed with 2.4.22. George Lefter wrote:> hi, > > i have a simple configuration: > hostA(192.168.100.44) <-----> hostB(192.168.100.45). > > I want to shape the traffic from hostB to hostA to a maximum of 10kbps: > hostB# tc qdisc add dev eth0 root handle 1:0 htb default 11 > hostB# tc class add dev eth0 parent 1:0 classid 1:1 htb \ > rate 200kbps ceil 200kbps > hostB# tc class add dev eth0 parent 1:1 classid 1:10 htb \ > rate 10kbps ceil 10kbps > hostB# tc class add dev eth0 parent 1:1 classid 1:11 htb \ > rate 100kbps ceil 100kbps > > bostB# tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32 \ > match ip dst 192.168.100.44 flowid 1:10 > > With this setup, a wget run on hostA downloading from hostB has an > average rate of 97.74 KB/s - it seems to be classified to the default > classid 1:11, not classid 1:10. Also, the class statistics below show > traffic accounted to class 1:11. > > > tc details: > hostB# tc -d -s qdisc ls dev eth0 > qdisc htb 1: r2q 10 default 11 direct_packets_stat 0 ver 3.12 > Sent 1137520 bytes 1714 pkts (dropped 0, overlimits 2010) > > hostB# tc -d -s class ls dev eth0 > class htb 1:11 parent 1:1 prio 0 quantum 10240 rate 800Kbit ceil 800Kbit > burst 2623b/8 mpu 0b cburst 2623b/8 mpu 0b level 0 > Sent 1071226 bytes 711 pkts (dropped 0, overlimits 0) > rate 33475bps 22pps > lended: 711 borrowed: 0 giants: 0 > tokens: 7557 ctokens: 7557 > > class htb 1:1 root rate 1600Kbit ceil 1600Kbit burst 3647b/8 mpu 0b > cburst 3647b/8 mpu 0b level 7 > Sent 1137520 bytes 1714 pkts (dropped 0, overlimits 0) > rate 35547bps 53pps > lended: 0 borrowed: 0 giants: 0 > tokens: 14336 ctokens: 14336 > > class htb 1:10 parent 1:1 prio 0 quantum 1024 rate 80Kbit ceil 80Kbit > burst 1701b/8 mpu 0b cburst 1701b/8 mpu 0b level 0 > Sent 66294 bytes 1003 pkts (dropped 0, overlimits 0) > rate 2071bps 31pps > lended: 1003 borrowed: 0 giants: 0 > tokens: 125919 ctokens: 125919 > > hostB# tc -d -s filter ls dev eth0 > filter parent 1: protocol ip pref 49152 u32 > filter parent 1: protocol ip pref 49152 u32 fh 800: ht divisor 1 > filter parent 1: protocol ip pref 49152 u32 fh 800::800 order 2048 key > ht 800 bkt 0 flowid 1:10 > match c0a8642c/ffffffff at 16 > > tc binary downloaded from > http://luxik.cdi.cz/~devik/qos/htb/v3/htb3.6-020525.tgz. > > hostB is a Slackware 9.1 running recompiled 2.4.22, > cls_u32 and sch_htb loaded as modules. > > > If instead of matching ip dst for hostA i match ip src for hostB, > it works as expected - rate is 10Kb/s with the following: > hostb# tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32 \ > match ip src 192.168.100.45 flowid 1:10 > _______________________________________________ > 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/