From: zytek Date: Mon, 09 Aug 2004 15:57:00 +0000 Subject: [LARTC] cbq dosen't shape on MARK for one host.. strange! Message-Id: <200408091757.00440.zytek-lists@ostrow-wlkp.net> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: quoted-printable To: lartc@vger.kernel.org Hello all, this is my first post here. Sorry for my english. Gentoo LAN router, 2.4.26-hardened-r2 There are 2 WAN links, one LAN link. I am doing some iptables/routing/tc ma= gic=20 in my scripts. What's interesting is marking packets traveling from all IP'= s=20 in LAN. Interesting commands are: ------------- for ip in `seq 50`; do $IPTABLES -t mangle -A FORWARD -o eth2 -d 10.0.1.$ip -j MARK=20 --set-mark 50${ip}1 $IPTABLES -t mangle -A FORWARD -i eth2 -s 10.0.1.$ip -j MARK=20 --set-mark 50${ip}2 done ------------- So now I am able to make statistics per IP (lstat.sourceforge.net) and of=20 course - do some traffic shaping. i have used cbq.init and then i wrote thi= s: ------------- for ipek in `seq 50`; do $TC class add dev eth2 parent 1: classid 1:10$ipek cbq bandwidth 100Mbit ra= te=20 ${USERDOWNLOAD}Kbit weight `echo ${USERDOWNLOAD} / 10 | bc`Kbit prio 5 allot 1514 cell 8 maxburst 20 avpkt = 1000 bounded $TC qdisc add dev eth2 parent 1:10$ipek handle 10$ipek tbf rate=20 ${USERDOWNLOAD}Kbit buffer 1Kb/8 limit 15Kb mt u 1500 $TC filter add dev eth2 parent 1:0 protocol ip prio 200 handle 50${ipek}1 f= w=20 classid 1:10${ipek} done ------------- everything works fine. users can download at rate max180Kbit or whatever ra= te=20 want. but one user, as I see on graph and iptraf with filter on his ip -=20 downloads at rates >180Kbit (he gets even >40 Kbytes/s !) i have made some tests. his packets are marked correctly because graphs wor= k=20 fine. my scripts are written correctly too because other hosts cannot excee= d=20 180Kbit bandwith when dowloading. i have tested it on my computer. but why one host downloads faster? i have shutted off my tc script and used= =20 cbq.init with sth like this: DEVICE=3Deth2,100Mbit,10Mbit RATE=80Kbit WEIGHT=3D8Kbit MARKP91 PEAK=80Kbit #RULE=10.0.1.9 and it doesn't work. packets are marked correctly: azazel mfw # iptables -t mangle -L FORWARD -vnx | grep 10.0.1.8 299 110603 MARK all -- * eth2 0.0.0.0/0 =20 10.0.1.8 MARK set 0x13d9 436 411375 MARK all -- eth2 * 10.0.1.8 =20 0.0.0.0/0 MARK set 0x13da cbq stats looks like this: azazel mfw # cbq stats ### eth0: queueing disciplines qdisc pfifo_fast 0: [Unknown qdisc, optlen ] Sent 1034932 bytes 3090 pkts (dropped 0, overlimits 0) ### eth1: queueing disciplines qdisc pfifo_fast 0: [Unknown qdisc, optlen ] Sent 44005 bytes 335 pkts (dropped 0, overlimits 0) ### eth2: queueing disciplines qdisc cbq 1: rate 100Mbit (bounded,isolated) prio no-transmit Sent 2869896 bytes 3850 pkts (dropped 0, overlimits 0) borrowed 0 overactions 0 avgidle 62 undertime 0 ### eth2: traffic classes class cbq 1:1001 parent 1: rate 80Kbit (bounded) prio 5 Sent 0 bytes 0 pkts (dropped 0, overlimits 0) borrowed 0 overactions 0 avgidle 2.26888e+06 undertime 0 class cbq 1: root rate 100Mbit (bounded,isolated) prio no-transmit Sent 2872596 bytes 3862 pkts (dropped 0, overlimits 0) borrowed 0 overactions 0 avgidle 54 undertime 0 ### eth2: filtering rules filter parent 1: protocol ip pref 200 fw filter parent 1: protocol ip pref 200 fw handle 0x13e3 classid 1:1001 look at this!! class cbq 1:1001 parent 1: rate 80Kbit (bounded) prio 5 Sent 0 bytes 0 pkts (dropped 0, overlimits 0) iptraf show rate 51.6 kbytes/sec .. and now when i comment MARK and uncomment RULE=10.0.1.9 all works GREAT! traffic to host is shaped and iptraf shows rate 10 kbytes/sec=20 so.. WTF ?! cbq works with MARK on other hosts... but not on this one. he u= ses=20 flashget or some p2p tool, iptraf shows about 300 connections and the numve= r=20 increases slowly. now im am trying hardener-r5 kernel and then i will try htb.init with MARK,= =20 maybe this will help. and i can recompile iproute2. --=20 .: Jakub G=B3azik (zytek) .: email:zytek@ostrow-wlkp.net .: JID:zytek@azazel.ostrow-wlkp.net .: http://www.misiaj.sie.pl [obsolete] _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/