From: Andy Furniss <andy.furniss@dsl.pipex.com>
To: lartc@vger.kernel.org
Subject: Re: [LARTC] HTB + GRED (santa clauss plz help me out)
Date: Fri, 31 Dec 2004 16:33:13 +0000 [thread overview]
Message-ID: <41D57F49.2050201@dsl.pipex.com> (raw)
In-Reply-To: <200412301907.21005.alg0@iit.demokritos.gr>
Antonios Chalkiopoulos wrote:
> I 've been trynig for a long time now to make HTB and GRED to work togethen.
> The problem beeing that GRED doesn't use handles (instead it uses DP:1 DP:2
> etc) i can not preperly filter traffic to them.
>
> Tomas Graf suggested to use the tc_index index of u32 classifier
>
> so dear Sant .. i am currently with the following scripts that works!
Have you seen this
http://www.opalsoft.net/qos/DS-27.htm
Though if it works you don't need it :-)
>
> But when i try to add an HTB before the GRED, everything goes to hell.
You may need to repeat filters to get HTB to go from root to GRED (well
you do with PRIO) eg. from a usenet post.
> Hi Everyone
>
> I'm running Fedora Core 2 as a router and am having problems getting the
> PRIO qdisc to work.
>
> I'm using the Iperf utility to generate traffic flows between
computers on
> either side of the Fedora box. I want traffic destined to port 6001
to be
> in band 0, traffic for port 6002 in band 1 and traffic for port 6003 in
> band 2.
>
> I'm using HTB to restrict the overall bandwidth to 5000 kbit.
>
> So far I've developed the following scripts, based on info I've picked up
> from the LARTC mailing list archives, man pages and Google searches.
>
> SCRIPT ONE...
>
> tc qdisc del dev eth1 root
> tc qdisc add dev eth1 root handle 1: htb default 1
> tc class add dev eth1 parent 1: classid 1:1 htb rate 5000kbit
> tc qdisc add dev eth1 parent 1:1 handle 10: prio
> tc filter add dev eth1 parent 1:0 protocol ip handle 1 fw flowid 10:1
> tc filter add dev eth1 parent 1:0 protocol ip handle 2 fw flowid 10:2
> tc filter add dev eth1 parent 1:0 protocol ip handle 3 fw flowid 10:3
This is the bit that doesn't work as I expected.
Seems HTB doesn't forward direct to prio bands from root so you have to
repeat the filters.
Below is what just seemed to work for me - It works without the bfifos
aswell but you don't get per band stats with tc -s qdisc ls dev eth0 if you
don't have them.
Andy.
IPTABLES=/usr/local/sbin/iptables
MODPROBE=/sbin/modprobe
IP=/usr/sbin/ip
TC=/usr/sbin/tc
$IPTABLES -t mangle -D POSTROUTING --dst 192.168.0.1 -j MARK --set-mark 2
&>/dev/null
$IPTABLES -t mangle -D POSTROUTING --dst 192.168.0.2 -j MARK --set-mark 3
&>/dev/null
$IPTABLES -t mangle -D POSTROUTING -m length --length 0:64 -j MARK
--set-mark 1 &>/dev/null
$TC qdisc del dev eth0 root &>/dev/null
if [ "$1" = "stop" ]
then
echo "stopped"
exit
fi
$IPTABLES -t mangle -A POSTROUTING --dst 192.168.0.1 -j MARK --set-mark 2
$IPTABLES -t mangle -A POSTROUTING --dst 192.168.0.2 -j MARK --set-mark 3
$IPTABLES -t mangle -A POSTROUTING -m length --length 0:64 -j MARK
--set-mark 1
$TC qdisc add dev eth0 root handle 1:0 htb default 0
$TC class add dev eth0 parent 1:0 classid 1:1 htb rate 5mbit
$TC qdisc add dev eth0 parent 1:1 handle 2: prio
$TC qdisc add dev eth0 parent 2:1 handle 10:0 bfifo limit 64k
$TC qdisc add dev eth0 parent 2:2 handle 20:0 bfifo limit 64k
$TC qdisc add dev eth0 parent 2:3 handle 30:0 bfifo limit 64k
$TC filter add dev eth0 parent 1:0 prio 0 protocol ip handle 1 fw flowid 1:1
$TC filter add dev eth0 parent 1:0 prio 1 protocol ip handle 2 fw flowid 1:1
$TC filter add dev eth0 parent 1:0 prio 2 protocol ip handle 3 fw flowid 1:1
$TC filter add dev eth0 parent 2:0 prio 0 protocol ip handle 1 fw flowid 2:1
$TC filter add dev eth0 parent 2:0 prio 1 protocol ip handle 2 fw flowid 2:2
$TC filter add dev eth0 parent 2:0 prio 2 protocol ip handle 3 fw flowid 2:3
Andy.
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
next prev parent reply other threads:[~2004-12-31 16:33 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-12-30 17:07 [LARTC] HTB + GRED (santa clauss plz help me out) Antonios Chalkiopoulos
2004-12-31 16:33 ` Andy Furniss [this message]
2005-01-04 17:49 ` Antonios Chalkiopoulos
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=41D57F49.2050201@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.