Re: [LARTC] Gamest and QoS

2004-08-18 Thread Jonathan Soh
Without QoS, while uploading some files via ftp i have pings (in my
 favourite
game) 1000+. With my qos script my ping lower to 150 - 300, but is
very unstable.
  
Is there any way to configure htb, to have good, __STABLE__ pings ( 40
 - 100)
while other people exploring the internet.

I've had this problem for about a year now, I'm not sure what the cause is
exactly but I think it has to do with the minimum burst size that HTB must
have, which is something like 1.5kbytes (per class), combined with the
restricted timers that linux QoS uses. Anyway, what I ended up doing is using
the prio qdisc (which doesn't do rate limiting, only prioritises packets)
wrapped inside a TBF qdisc for its rate limiting. See my script below.

 One question I'd be wondering, is how to filter the game packets into
 the class.  I'm a UT2k4 fan, and it's not as easy as just filtering
 based on port as the server ports are all over the map.  Perhaps one
 would have to look at the packet size instead.  Hopefully it would be
 constant or small.

One way to filter this that might work, is to just put all the UDP traffic in
your interactive class, which I assume UT2k4 uses. Not very many programs
besides games use UDP traffic for its data transfer, so it should work
without putting too much unwanted packets into your interactive class. As
well, if your using ipp2p or port matching your p2p/ftp traffic, they won't
be put into the interactive class. It's quite important to put your packet
marking statements (iptables) in the right order also, if you do it in the
wrong order all your packets will end up in your interactive class (happened
to me in the beginning :) ). My script below should clarify things.

Download my script here:
http://quebeck.dyndns.org/temp/simple.htb

I haven't finished fine tuning it yet, but the basic traffic shaping works.

Jon

Find local movie times and trailers on Yahoo! Movies.
http://au.movies.yahoo.com
___
LARTC mailing list / [EMAIL PROTECTED]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/


[LARTC] PRIO + filter problem

2004-08-16 Thread Jonathan Soh
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 / [EMAIL PROTECTED]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/