From: Andy Furniss <andy.furniss@dsl.pipex.com>
To: lartc@vger.kernel.org
Subject: Re: [LARTC] Htb queueing problem
Date: Wed, 01 Mar 2006 14:48:18 +0000 [thread overview]
Message-ID: <4405B432.10301@dsl.pipex.com> (raw)
In-Reply-To: <44043A85.6080302@gmail.com>
Diego Andrés Asenjo Gonzalez wrote:
> Hi everybody!
>
> 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 options:
>
> [*] 802.1d Ethernet Bridging
>
> [*] QoS and/or fair queueing
> <*> HTB packet scheduler
> <*> SFQ queue
>
> [*] QoS support
> <*> Firewall based classifier
> <*> U32 classifier
As I select everything I don't know if this is enough - also I think you
need to select classify in netfilter the section.
>
> I can mark packages with iptables, but I _can't_ make the packages get
> queued in an specific class. Please, take a look on this sample script
> that guarantees 64kbit (rate), 72kbit (ceil)
It's nicer with htb to give interactive more bandwidth and higher prio
than bulk. Also remember when setting rates that htb will see ip packets
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
> destination ports:
>
> # 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
>
> # 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
>
> # 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
>
> # Create default class (1:1000 2:1000) :
> /sbin/tc class add dev eth0 parent 1:1 classid 1:1000 htb rate 3350kbit
> ceil 3500kbit burst 0 prio 5
> /sbin/tc class add dev eth1 parent 2:1 classid 2:1000 htb rate 3350kbit
> ceil 3500kbit burst 0 prio 5
>
> # 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
>
> # Flushing iptables rules:
> /sbin/iptables -F -t mangle
>
> # iptables classify
> /sbin/iptables -A POSTROUTING -t mangle -p udp -s 172.16.0.185/32
> --sport 10000:10100 -d 172.16.1.0/24 -j CLASSIFY --set-class 2:44
>
> Now the statistics:
>
> bridge:~# iptables -L -t mangle -v
> 34302 2415K CLASSIFY udp -- any any 172.16.0.185
> 172.16.1.0/24 udp spts:10000:10100 CLASSIFY set 2:44
>
> 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
>
> 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
>
> class htb 2:1000 parent 2:1 prio 5 rate 3350Kbit ceil 3500Kbit burst
> 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
>
> As you can see, the packets are mraked by iptables but get queued
> 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.
>
> I'm using now -j CLASSIFY but I have used -j MARK and u32 tc filters
> with the same results.
I am not sure what else is wrong I don't use classify, maybe check that
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
next prev parent reply other threads:[~2006-03-01 14:48 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-02-28 11:56 [LARTC] Htb queueing problem Diego Andrés Asenjo Gonzalez
2006-03-01 14:48 ` Andy Furniss [this message]
2006-03-01 17:39 ` Diego Andrés Asenjo Gonzalez
2006-03-01 19:07 ` Andreas Hasenack
2006-03-01 19:56 ` Andy Furniss
2006-03-01 20:16 ` Andy Furniss
2006-03-02 3:56 ` Diego Andrés Asenjo Gonzalez
2006-03-02 15:59 ` Andy Furniss
2006-03-02 16:20 ` m.innocenti
2006-03-02 16:56 ` Luciano Ruete
2006-03-02 18:27 ` Diego Andrés Asenjo Gonzalez
2006-04-11 14:24 ` Edwin Whitelaw
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4405B432.10301@dsl.pipex.com \
--to=andy.furniss@dsl.pipex.com \
--cc=lartc@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.