[LARTC] TC with simple PRIO and TBF setup. Please help.

Linux Advanced Routing and Traffic Control

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

 



 I have a simple dream. That dream is to prioritize traffic on my outbound
cable modem link so that I can run a 24/7 webserver AND a 24/7
counter-strike server. The game server is seldom full, so I want unused
bandwidth to go to the web server, while the web server takes a huge dive
in speed when the game server fills up. Finally, a small slice must be
available to the two user machines with web browsers... assuming they're
not playing counter-strike.

 I created a simple three band prio/tbf setup to implement this, but the
game server still gets lagged to hell when it is moderately full and
someone starts a download from the web server. I've place the webserver in
band 2, lowest priority, which *I thought* would prevent this from ever
happenning.

 Will someone more gifted than I please look at the following script for
me and point out the error. The upstream on the cable modem is supposed to
be 384kbit, I'm using 320kbit to be conservative. Please tell me what I
need to do to get this to work.

   -=Chris (I can't tell you how happy this would make me)

### MY TC script
#!/bin/sh

#Add the root PRIO type qdisk, three priotiy bands, default band 1
tc qdisc add dev eth0 root handle 1: prio \
        bands 3 priomap 1 1 1 1 1 1 1 1 1 1 1 1 1 1

#1:1 is band 0 (highest priority). Give it most of the bandwidth if
#needed and tollerable game latency
tc qdisc add dev eth0 parent 1:1 handle 10: tbf rate 280kbit buffer 2500\
        latency 300ms

#1:2 is band 1 (mid priority, default band). This is mostly browser
#traffic, give it very little of the upstream pipe and good turnaround
tc qdisc add dev eth0 parent 1:2 handle 20: tbf rate 45kbit buffer 2500\
        latency 100ms

#1:3 is band 2 (lowest priority). This level should be given the entire
#pipe if the other two bands don't need it. This is large tranfers, high
#latency is fine
tc qdisc add dev eth0 parent 1:3 handle 30: tbf rate 320kbit buffer 2500 \
        latency 600ms

#Large transfers come from the web server, send it to band 2
tc filter add dev eth0 parent 1:0 protocol ip u32 match \
        ip sport 80 0xffff flowid 1:3

#The game server runs on udp port 27015, send it to band 0
tc filter add dev eth0 parent 1:0 protocol ip u32 match \
        ip sport 27015 0xffff flowid 1:1




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