PRIO + filter problem

Linux Advanced Routing and Traffic Control

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



PROBLEM: My filtering rules don't seem to be working in the latest
incarnation of my shaping script. I've changed from using multiple HTB
classes to just one and a PRIO qdisc, and now my filters don't seem to have
any effect.

OVERVIEW: What I used to have is pretty much the same as the htb wondershaper
script (with some tweaks), which worked fine, but I noticed that my latency
for interactive traffic would fluctuate between 50ms and 250ms. After reading
around, it seems this is probably due to the restriction in accuracy of the
timers used for shaping combined with low throughput connections (adsl,
128kbit up, I think it has something to do with the Bursting of the HTB
classes)? Anyway, because of this I decided to just go with a plain PRIO
qdisc wrapped in a HTB for its rate limiting (will this help with the above
mentioned latency problem btw?). My packets seem to be traversing the "tree"
alright, but they don't seem to be filtered to the correct leafs so they
aren't being prioritised at all.

MY SCRIPT: This is the shaping part of my script, I'll annotate the lines, my
understating is still a bit hazy, so I have probably done something wrong.

***************************************
DEV=ppp0
UPLINK=80
# Install a HTB qdisc in the root, then add a class under the qdisc to rate
shape #
tc qdisc add dev $DEV root handle 1: htb default 1
tc class add dev $DEV parent 1: classid 1:1 htb rate ${UPLINK}kbit

# Under the HTB CLASS, add the prio qdisc, which will create 6 prio classes #
tc qdisc add dev $DEV parent 1:1 handle 10: prio bands 6
# add sfq qdiscs under each of the PRIO CLASSES #
tc qdisc add dev $DEV parent 10:1 handle 100: sfq perturb 10
tc qdisc add dev $DEV parent 10:2 handle 200: sfq perturb 10
tc qdisc add dev $DEV parent 10:3 handle 300: sfq perturb 10
tc qdisc add dev $DEV parent 10:4 handle 400: sfq perturb 10
tc qdisc add dev $DEV parent 10:5 handle 500: sfq perturb 10
tc qdisc add dev $DEV parent 10:6 handle 600: sfq perturb 10

# Filter the packets marked, put them into the PRIO CLASSES #
tc filter add dev $DEV parent 1: protocol ip prio 1 handle 1 fw flowid 10:1
tc filter add dev $DEV parent 1: protocol ip prio 2 handle 2 fw flowid 10:2
tc filter add dev $DEV parent 1: protocol ip prio 3 handle 3 fw flowid 10:3
tc filter add dev $DEV parent 1: protocol ip prio 4 handle 4 fw flowid 10:4
tc filter add dev $DEV parent 1: protocol ip prio 5 handle 5 fw flowid 10:5
tc filter add dev $DEV parent 1: protocol ip prio 6 handle 6 fw flowid 10:6

**************************************

That's the shaping bit. I know my packets are being marked (the last version
of the script (with HTB) worked, and I didn't change my iptables lines at
all. ATM, all traffic is being sent to the prio class 10:2 (handle 200: ),
even my ping packets, which I have marked as "1". I'm guessing there's
something wrong with that flowid part, but I'm not sure.

PS: Btw I have read the lartc howto (about 10 times by now), and searched the
mailing list, couldn't find a solution. Great work with the howto, but there
are some concepts in it that even now I'm not sure about, for example: what
the difference between handle and classid is, when to use them, when to use
flowid vs classid. Also, numbering conventions for classes/qdiscs, like if
you have a class numbered 10 with parent 1 (so 1:10), can you have a class
further down called 10 (or even 1) as well? Some examples and counter
examples might help clarify them. But yeah, all in all it's a nice in depth
read.



Find local movie times and trailers on Yahoo! Movies.
http://au.movies.yahoo.com
_______________________________________________
LARTC mailing list / LARTC@xxxxxxxxxxxxxxx
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

[Index of Archives]     [LARTC Home Page]     [Netfilter]     [Netfilter Development]     [Network Development]     [Bugtraq]     [GCC Help]     [Yosemite News]     [Linux Kernel]     [Fedora Users]
  Powered by Linux