From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andy Furniss Date: Wed, 01 Mar 2006 14:48:18 +0000 Subject: Re: [LARTC] Htb queueing problem Message-Id: <4405B432.10301@dsl.pipex.com> List-Id: References: <44043A85.6080302@gmail.com> In-Reply-To: <44043A85.6080302@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable To: lartc@vger.kernel.org Diego Andr=E9s Asenjo Gonzalez wrote: > Hi everybody! >=20 > I'm using an edge bridge box with two ethernet cards to shape traffic in = > a WAN link. I'm running Debian 3.1 stable with kernel 2.6.8 and iproute = > from packages. I recompiled the kernel with the following built-in option= s: >=20 > [*] 802.1d Ethernet Bridging >=20 > [*] QoS and/or fair queueing > <*> HTB packet scheduler > <*> SFQ queue >=20 > [*] QoS support > <*> Firewall based classifier > <*> U32 classifier As I select everything I don't know if this is enough - also I think you=20 need to select classify in netfilter the section. >=20 > I can mark packages with iptables, but I _can't_ make the packages get=20 > queued in an specific class. Please, take a look on this sample script=20 > that guarantees 64kbit (rate), 72kbit (ceil) It's nicer with htb to give interactive more bandwidth and higher prio=20 than bulk. Also remember when setting rates that htb will see ip packets=20 as ip length + 14 when used on ethX to the packets coming from > the host 172.16.0.185 to the 172.16.1.0/24 network with 10000-10100=20 > destination ports: >=20 > # Flush tc qdiscs: > /sbin/tc qdisc del dev eth0 root >/dev/null 2>&1 > /sbin/tc qdisc del dev eth1 root >/dev/null 2>&1 >=20 > # Create root qdiscs: > /sbin/tc qdisc add dev eth0 root handle 1: htb default 1000 > /sbin/tc qdisc add dev eth1 root handle 2: htb default 1000 >=20 > # Create root class (1:1 2:1) : > /sbin/tc class add dev eth0 parent 1: classid 1:1 htb rate 3456kbit ceil = > 3456kbit burst 0 prio 1 > /sbin/tc class add dev eth1 parent 2: classid 2:1 htb rate 3584kbit ceil = > 3584kbit burst 0 prio 1 >=20 > # Create default class (1:1000 2:1000) : > /sbin/tc class add dev eth0 parent 1:1 classid 1:1000 htb rate 3350kbit=20 > ceil 3500kbit burst 0 prio 5 > /sbin/tc class add dev eth1 parent 2:1 classid 2:1000 htb rate 3350kbit=20 > ceil 3500kbit burst 0 prio 5 >=20 > # Create classes (1:44 2:44) : > /sbin/tc class add dev eth0 parent 1:1 classid 1:44 htb rate 64kbit ceil = > 72kbit burst 8kbit prio 1 quantum 1536 > /sbin/tc class add dev eth1 parent 2:1 classid 2:44 htb rate 64kbit ceil = > 72kbit burst 8kbit prio 1 quantum 1536 >=20 > # Flushing iptables rules: > /sbin/iptables -F -t mangle >=20 > # iptables classify > /sbin/iptables -A POSTROUTING -t mangle -p udp -s 172.16.0.185/32=20 > --sport 10000:10100 -d 172.16.1.0/24 -j CLASSIFY --set-class 2:44 >=20 > Now the statistics: >=20 > bridge:~# iptables -L -t mangle -v > 34302 2415K CLASSIFY udp -- any any 172.16.0.185=20 > 172.16.1.0/24 udp spts:10000:10100 CLASSIFY set 2:44 >=20 > bridge:~# tc -s cl sh dev eth1 > class htb 2:44 parent 2:1 prio 1 rate 64000bit ceil 72000bit burst 1023b = > cburst 1608b > Sent 0 bytes 0 pkts (dropped 0, overlimits 0) > lended: 0 borrowed: 0 giants: 0 > tokens: 131070 ctokens: 183067 >=20 > class htb 2:1 root rate 3584Kbit ceil 3584Kbit burst 2Kb cburst 2Kb > Sent 4686617538 bytes 6922322 pkts (dropped 0, overlimits 0) > rate 1936bit 2pps > lended: 3691 borrowed: 0 giants: 0 > tokens: 4461 ctokens: 4461 >=20 > class htb 2:1000 parent 2:1 prio 5 rate 3350Kbit ceil 3500Kbit burst=20 > 2017b cburst 2Kb > Sent 4686617538 bytes 6922322 pkts (dropped 0, overlimits 0) > rate 1936bit 2pps > lended: 6918631 borrowed: 3691 giants: 0 > tokens: 4700 ctokens: 4543 >=20 > As you can see, the packets are mraked by iptables but get queued=20 > through the default class. You need an -o eth1 in the iptables rule for a proper count. I'm getting frustated and I will appreciate > all suggestions and comments. >=20 > I'm using now -j CLASSIFY but I have used -j MARK and u32 tc filters=20 > with the same results. I am not sure what else is wrong I don't use classify, maybe check that=20 there isn't any decimal/hex mismatch ie. try 0x44. Andy. _______________________________________________ LARTC mailing list LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc