Hi, I am doing some test to control outgoing traffic, and I want to see if everything is working, but when I configure Compuetr A, and make a download in Computer B from A (e.g. in Computer A Apache is installed), the download goes so fast(not as in the ceil or rate!), even when I make the rate & ceil too small, am I doing something wrong?? Example on Computer A: tc qdisc add dev eth0 root handle 1: htb default 19 tc class add dev eth0 parent 1: classid 1:1 htb rate 10bps ceil 10bps tc class add dev eth0 parent 1: classid 1:19 htb rate 15bps ceil 15bps tc filter add dev eth0 parent 1: protocol ip handle 1 fw classid 1:1 iptables -t mangle -A OUTPUT -d 192.168.0.11 -j MARK --set-mark 1 #Compter B has ip 192.168.0.11 Thanx _________________________________________________________________ Help STOP SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
On Wednesday 14 May 2003 11:25, sun reflex4 wrote:> Hi, > I am doing some test to control outgoing traffic, and I want to see if > everything is working, but when I configure Compuetr A, and make a download > in Computer B from A (e.g. in Computer A Apache is installed), the > download goes so fast(not as in the ceil or rate!), even when I make the > rate & ceil too small, am I doing something wrong?? > Example on Computer A: > tc qdisc add dev eth0 root handle 1: htb default 19 > > tc class add dev eth0 parent 1: classid 1:1 htb rate 10bps ceil 10bps > tc class add dev eth0 parent 1: classid 1:19 htb rate 15bps ceil 15bps > > tc filter add dev eth0 parent 1: protocol ip handle 1 fw classid 1:1 > > iptables -t mangle -A OUTPUT -d 192.168.0.11 -j MARK --set-mark 1 > #Compter B has ip 192.168.0.11Your setup is good, but you put all packets coming from computer A (and marked with 1) in class 1:1. The problem is that this is not a leaf class because it has a child class. And a non-leaf class can not transmit packets itself. So the packets are sended at link speed. Solution : only leaf classes can shape traffic so make sure all packets ends up in a leaf class. You can do this by removing the filter statement so all packets are placed in the default class. Or change your filter statement so all packets marked with a 1 are redireted to class 1:19. If you are interested, I did some tests myself. You can find the results on www.docum.org. 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/
Hi Stef, is class 1:1 really a non-leaf class? It doesn''t have any children. I know your site, and actually it is the place, where I lerned all this stuff :)> tc qdisc add dev eth0 root handle 1: htb default 19 > > tc class add dev eth0 parent 1: classid 1:1 htb rate 10bps ceil 10bps > tc class add dev eth0 parent 1: classid 1:19 htb rate 15bps ceil 15bps > > tc filter add dev eth0 parent 1: protocol ip handle 1 fw classid 1:1 > > iptables -t mangle -A OUTPUT -d 192.168.0.11 -j MARK --set-mark 1 >#Compter B has ip 192.168.0.11 >Your setup is good, but you put all packets coming from computer A (and >marked with 1) in class 1:1. The problem is that this is not a leaf class >because it has a child class. And a non-leaf class can not transmit >packets itself. So the packets are sended at link speed._________________________________________________________________ Help STOP SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
On Wednesday 14 May 2003 12:02, sun reflex4 wrote:> Hi Stef, > is class 1:1 really a non-leaf class? It doesn''t have any children.Oops. Indeed. But you better create 1 root class and add 1:1 and 1:19 to that root class.> I know your site, and actually it is the place, where I lerned all this > stuff :)Ok :)> > tc qdisc add dev eth0 root handle 1: htb default 19 > > > > tc class add dev eth0 parent 1: classid 1:1 htb rate 10bps ceil 10bps > > tc class add dev eth0 parent 1: classid 1:19 htb rate 15bps ceil 15bps > > > > tc filter add dev eth0 parent 1: protocol ip handle 1 fw classid 1:1 > > > > iptables -t mangle -A OUTPUT -d 192.168.0.11 -j MARK --set-mark 1 > >#Compter B has ip 192.168.0.11Can you check to see the tc counters to make sure the packets are ending in the class you want? 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/
Hi, corresponding to my previous, I''ve tested with it all the time, but it is not working. Although the packets go through the specified class, but the class does exceed the given ceil, see what the "tc -s -d class show dev eth0" shows: class htb 1:10 parent 1:1 prio 0 quantum 1000 rate 1bps ceil 1bps burst 1023b/8 mpu 0b cburst 1599b/8 0b level 0 Sent 11794081 bytes 7847 pkts (dropped 0, overlimits 0) rate 285518bps 189pps lended 7847 borrowed:0 giants:0 tokens: -59999999 ctokens: -59999999 When the rate & ceil for 1:10 are 1bps, how does it send with much higher rate? _________________________________________________________________ STOP MORE SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
On Wednesday 14 May 2003 20:03, sun reflex4 wrote:> Hi, > corresponding to my previous, I''ve tested with it all the time, but it is > not working. Although the packets go through the specified class, but the > class does exceed the given ceil, see what the "tc -s -d class show dev > eth0" shows: > > class htb 1:10 parent 1:1 prio 0 quantum 1000 rate 1bps ceil 1bps burst > 1023b/8 mpu 0b cburst 1599b/8 0b level 0 > Sent 11794081 bytes 7847 pkts (dropped 0, overlimits 0) > rate 285518bps 189pps > lended 7847 borrowed:0 giants:0 > tokens: -59999999 ctokens: -59999999 > > When the rate & ceil for 1:10 are 1bps, how does it send with much higher > rate?Argh. You have 10bps. That means 10bytes per second ! That''s way too low. No wonder htb can''t shape that. The minimium shapable rate is 4kbps or so. So plz, do your tests with a higher rate and ceil, 10kbps or so. 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/