Hi, I am new to HTB and in the learning process I want to simulate a slower link on my server to see how qdisc works. I have a 100Mbit connection. I want to simulate a 100K connection and to divide traffic between FTP and SMB. (like in HTB user guide). The problem is that it doesn’t work. I can transfer files with FTP of SAMBA at the wire speed. (Just like when there was no HTB and qdisc). What do I do wrong? Here is my script: #!/bin/bash tc qdisc del dev eth0 root iptables -F iptables -F -t mangle # qdisc for delay simulation tc qdisc add dev eth0 root handle 100: htb tc class add dev eth0 parent 100: classid 100:1 htb rate 100kbps tc qdisc add dev eth0 parent 100:1 handle 1: htb tc class add dev eth0 parent 1: classid 1:1 htb rate 100kbps tc class add dev eth0 parent 1:1 classid 1:10 htb rate 50kbps ceil 100kbps prio 1 tc class add dev eth0 parent 1:1 classid 1:20 htb rate 50kbps ceil 100kbps prio 2 tc qdisc add dev eth0 parent 1:10 handle 22: sfq perturb 10 tc qdisc add dev eth0 parent 1:20 handle 23: sfq perturb 10 I''ve tried with u32 and with fw filter tc filter add dev eth0 parent 1: protocol ip u32 match ip sport 20 0xffff flowid 1:10 tc filter add dev eth0 parent 1: protocol ip u32 match ip sport 139 0xffff flowid 1:20 OR iptables -A OUTPUT -o eth0 -t mangle -p tcp --sport 20 -j MARK --set-mark 22 tc filter add dev eth0 parent 1: protocol ip handle 22 fw classid 1:10 iptables -A OUTPUT -o eth0 -t mangle -p tcp --sport 445 -j MARK --set-mark 33 tc filter add dev eth0 parent 1: protocol ip handle 33 fw classid 1:20 Best regards, ddaas _______________________________________________ LARTC mailing list LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc
On Friday 22 July 2005 14:59, ddaasd wrote:> What do I do wrong?Most likely, you do not want to use more than one HTB qdisc per device.> tc qdisc add dev eth0 root handle 100: htb > tc class add dev eth0 parent 100: classid 100:1 htb rate 100kbps > > tc qdisc add dev eth0 parent 100:1 handle 1: htbWhat do you need this qdisc for?> tc class add dev eth0 parent 1: classid 1:1 htb rate 100kbps > tc class add dev eth0 parent 1:1 classid 1:10 htb rate 50kbps ceil > 100kbps prio 1 tc class add dev eth0 parent 1:1 classid 1:20 htb rate > 50kbps ceil 100kbps prio 2Why not make these children of the first qdisc?> <br> > <br> > <font face="verdana, arial, helvetica" size="2">OR<br> > <br> > </font>Please don''t send HTML mails (or at least include a text-only version). Otherwise it is really awful to read. Thanks. HTH Andreas
On Friday 22 July 2005 14:59, ddaasd wrote: >> What do I do wrong? >> >> >>Most likely, you do not want to use more than one HTB qdisc per device. What about the example from the HTB User Guide?? Is it wrong? http://luxik.cdi.cz/~devik/qos/htb/manual/userg.htm#prio >>Please don''t send HTML mails (or at least include a text-only >>version). >>Otherwise it is really awful to read. Thanks. Sorry, I didn''t know..L :( >>HTH >>Andreas Thanks, ddaas
On Saturday 23 July 2005 13:07, ddaas wrote:> >>Most likely, you do not want to use more than one HTB qdisc per > >> device. > > What about the example from the HTB User Guide?? Is it wrong?Ah, you want to simulate a slow link. Didn''t realize that, sorry. :-) Have a look on the output of the tc -s -d class show dev $dev statistics. Also try qdisc show instead of class show, the direct_packets_stat should be zero. The packets should go into the class 100:1 (you may have to add "default 1" or a filter that puts them there). So far you only got one filter for the child qdisc, but for that the packets have to get there first. HTH Andreas