From: Luciano Ruete Date: Thu, 23 Feb 2006 22:08:27 +0000 Subject: [LARTC] HTB: far unequal behaivor at a slight conf rate change Message-Id: <200602231908.27900.luciano@lugmen.org.ar> MIME-Version: 1 Content-Type: multipart/mixed; boundary="Boundary-00=_bJj/DI7el68MgY1" List-Id: To: lartc@vger.kernel.org --Boundary-00=_bJj/DI7el68MgY1 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi all! I'm working in a " _really_ end user simple", yet powerfull, flexible, scalable, GPL htb/htb-init front end, but now, in the "test fase" im facing an utlimate problem... Absoult minimalistic scenario: #Use a FIXEDFONT to read this #inet-ethx-|FIREWALL|-lan-ethx <-> |client_host_1| # #FIREWALL class(rate,ceil) at lan-ethx root->parent_all_host(256,256)->client_host_1(X,X)->host_1_prio(X*0.9,X) ->host_1_dfl(X*0.1,X) then i genrate equal traffic for the to leafs and: if X<=200 then "all works ok" the 'prio' class takes 90% of the rate the "dfl" class takes 10% of the rate if X>230 then "all works like no htb present at all" the 'prio' and 'dfl' class figth equaly for the rate Things that i have tried that don't help to solve the problem: -Play with several r2q/quantum convinations -Play with prio parameter for the leafs -Tray thiferent leaf's algo(sfq with quantum 1500,pfifo with limit 10) -change parent_all_hosts rate to a high value (ie:512,1024) I've attached simplified ad-hoc scripts that reproduce the scenarios: tc_at_200 (full tc/iptables commands to recreate the X<200 scenario) tc_at_230 (full tc/iptables commands to recreate the X>200 scenario) To test i run in the client_host_1 2 lftp instances ie: lftp -c "pget -n ftp://somehost/very.long.file" #4 tcp conns "stress" ;-) lftp -c "get http://samehost/very.long.file" note that first generates ftp traffic while second one is http traffic, the firewall marks will make that http goes in 'prio' class and ftp goes in 'dfl' class. I leave this traffic running... if i run ./tc_at_200 everithing goes to its place if i run ./tc_at_230 everithing goes wrong, the 4 ftp's 'dfl' traffic connection monopolice at lest 80% of the total rate. if i run ./tc_at_200 everithing goes to its place again and so on... Whell hope someone give me a hint on this! -- Luciano --Boundary-00=_bJj/DI7el68MgY1 Content-Type: application/x-shellscript; name="tc_at_200" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="tc_at_200" #!/bin/bash iface=${1}; host=${2?USAGE: $0 \$internal_iface \$client_ip} set -x tc qdisc del dev $iface root tc qdisc add dev $iface root handle 1 htb default 0 tc class add dev $iface parent 1: classid 1:7000 htb rate 200kbit ceil 200kbit burst 12k quantum 1500 tc class add dev $iface parent 1:7000 classid 1:7003 htb rate 200kbit ceil 200kbit burst 12k quantum 1500 tc class add dev $iface parent 1:7003 classid 1:7004 htb rate 180kbit ceil 200kbit burst 12k prio 1 quantum 1500 tc class add dev $iface parent 1:7003 classid 1:7005 htb rate 20kbit ceil 200kbit burst 12k prio 3 quantum 1500 tc qdisc add dev $iface parent 1:7004 handle 7004 sfq perturb 10 quantum 1600 tc qdisc add dev $iface parent 1:7005 handle 7005 sfq perturb 10 quantum 1600 tc filter add dev $iface parent 1:0 protocol ip prio 200 handle 7004 fw classid 1:7004 tc filter add dev $iface parent 1:0 protocol ip prio 200 handle 7005 fw classid 1:7005 iptables () { /sbin/iptables -t mangle -D FORWARD -o $iface $@ 2>/dev/null; } iptables -d $host -m mark --mark 0 -p tcp --sport 80 -j MARK --set-mark 7004 iptables -d $host -m mark --mark 0 -j MARK --set-mark 7005 iptables -d $host -j ACCEPT iptables () { /sbin/iptables -t mangle -A FORWARD -o $iface $@; } iptables -d $host -m mark --mark 0 -p tcp --sport 80 -j MARK --set-mark 7004 iptables -d $host -m mark --mark 0 -j MARK --set-mark 7005 iptables -d $host -j ACCEPT --Boundary-00=_bJj/DI7el68MgY1 Content-Type: application/x-shellscript; name="tc_at_230" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="tc_at_230" #!/bin/bash iface=${1}; host=${2?USAGE: $0 \$internal_iface \$client_ip} set -x tc qdisc del dev $iface root tc qdisc add dev $iface root handle 1 htb default 0 tc class add dev $iface parent 1: classid 1:7000 htb rate 256kbit ceil 256kbit burst 12k quantum 1500 tc class add dev $iface parent 1:7000 classid 1:7003 htb rate 230kbit ceil 230kbit burst 12k quantum 1500 tc class add dev $iface parent 1:7003 classid 1:7004 htb rate 207kbit ceil 230kbit burst 12k prio 1 quantum 1500 tc class add dev $iface parent 1:7003 classid 1:7005 htb rate 23kbit ceil 230kbit burst 12k prio 3 quantum 1500 tc qdisc add dev $iface parent 1:7004 handle 7004 sfq perturb 10 quantum 1600 tc qdisc add dev $iface parent 1:7005 handle 7005 sfq perturb 10 quantum 1600 tc filter add dev $iface parent 1:0 protocol ip prio 200 handle 7004 fw classid 1:7004 tc filter add dev $iface parent 1:0 protocol ip prio 200 handle 7005 fw classid 1:7005 iptables () { /sbin/iptables -t mangle -D FORWARD -o $iface $@ 2>/dev/null; } iptables -d $host -m mark --mark 0 -p tcp --sport 80 -j MARK --set-mark 7004 iptables -d $host -m mark --mark 0 -j MARK --set-mark 7005 iptables -d $host -j ACCEPT iptables () { /sbin/iptables -t mangle -A FORWARD -o $iface $@; } iptables -d $host -m mark --mark 0 -p tcp --sport 80 -j MARK --set-mark 7004 iptables -d $host -m mark --mark 0 -j MARK --set-mark 7005 iptables -d $host -j ACCEPT --Boundary-00=_bJj/DI7el68MgY1 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ LARTC mailing list LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc --Boundary-00=_bJj/DI7el68MgY1--