* [LARTC] Games Priority HELP pls ...
@ 2003-04-17 9:49 lartc
2003-04-17 10:12 ` Stef Coene
0 siblings, 1 reply; 2+ messages in thread
From: lartc @ 2003-04-17 9:49 UTC (permalink / raw)
To: lartc
[-- Attachment #1.1: Type: text/plain, Size: 590 bytes --]
Hello! I have a problem with the priority of COutner Strike
packets in a LAN with an internet connection !(I have 1Mbps UP
(limited by me at 575(see below), 1Mbps DOWN) When a single
user download to FULL bandwidth the COutnerstrike works great,
but when other users join the LAN and start useing the
Bandwidth ....Counter Strike begins to have a very high
latency ....practically unplayable!! There is something wrong
in this scripts??
See the attach of this e-mail !I'm desperate to find
what is the problem....HOW CAN I MAKE GAMES like COUNTER
STRIKE, have full priority!!!
[-- Attachment #1.2: Type: text/html, Size: 988 bytes --]
[-- Attachment #2: eth0 --]
[-- Type: application/octet-stream, Size: 3977 bytes --]
#!/bin/sh
# last update 26.02.2003
TOTAL=575Kbit
echo "delete!"
tc qdisc del dev eth0 root 2> /dev/null > /dev/null
echo "qdisc..."
tc qdisc add dev eth0 root handle 1: htb default 99 r2q 1
#parent
tc class add dev eth0 parent 1: classid 1:1 htb rate $TOTAL ceil $TOTAL
#ssh
tc class add dev eth0 parent 1:1 classid 1:3 htb rate 32Kbit ceil $TOTAL prio 2
#vnc+rdc
#tc class add dev eth0 parent 1:1 classid 1:4 htb rate 16Kbit ceil $TOTAL prio 2
#www
tc class add dev eth0 parent 1:1 classid 1:5 htb rate 128Kbit ceil $TOTAL prio 1 burst 40k
#telnet
#tc class add dev eth0 parent 1:1 classid 1:6 htb rate 16Kbit ceil $TOTAL prio 2
#ACK+SYN+FIN+RST+ICMP+DNS
tc class add dev eth0 parent 1:1 classid 1:60 htb rate 64Kbit ceil 64kbit prio 0
#MSN&YM+IRC
tc class add dev eth0 parent 1:1 classid 1:8 htb rate 64Kbit ceil $TOTAL prio 1
#ICMP
#tc class add dev eth0 parent 1:1 classid 1:70 htb rate 32Kbit ceil 32Kbit # prio 1
#DNS
#tc class add dev eth0 parent 1:1 classid 1:71 htb rate 32Kbit ceil 32Kbit # prio 2
#Counter
tc class add dev eth0 parent 1:1 classid 1:72 htb rate 240Kbit ceil 240Kbit prio 0
#default
tc class add dev eth0 parent 1:1 classid 1:99 htb rate 32Kbit ceil $TOTAL prio 3
#tc qdisc add dev eth0 parent 1:99 handle 99: sfq perturb 1
tc qdisc add dev eth0 parent 1:5 handle 5: sfq perturb 3
#tc qdisc add dev eth0 parent 1:6 handle 6: sfq perturb 1
echo "filters..."
#rdc
tc filter add dev eth0 parent 1: protocol ip prio 2 u32 match ip sport \
3389 0xffff flowid 1:3
#vnc
#tc filter add dev eth0 parent 1: protocol ip prio 2 u32 match ip sport \
# 445 0xffff flowid 1:3
#telnet
tc filter add dev eth0 parent 1: protocol ip prio 2 u32 match ip sport \
23 0xffff flowid 1:3
#ssh sport
tc filter add dev eth0 parent 1: protocol ip prio 2 u32 match ip sport \
22 0xffff flowid 1:3
#ssh dport
tc filter add dev eth0 parent 1: protocol ip prio 2 u32 match ip dport \
22 0xffff flowid 1:3
#www
tc filter add dev eth0 parent 1: protocol ip prio 1 u32 match ip sport \
80 0xffff flowid 1:5
#HTTPS
tc filter add dev eth0 parent 1: protocol ip prio 1 u32 match ip sport \
443 0xffff flowid 1:5
#YM
tc filter add dev eth0 parent 1: protocol ip prio 1 u32 match ip dport \
5050 0xffff flowid 1:8
#MSN
tc filter add dev eth0 parent 1: protocol ip prio 1 u32 match ip dport \
1863 0xffff flowid 1:8
#IRC
tc filter add dev eth0 parent 1: protocol ip prio 1 u32 match ip dport \
6667 0xffff flowid 1:8
#MSN Transfer
tc filter add dev eth0 parent 1: protocol ip prio 1 u32 match ip dport \
6891 0xffff flowid 1:8
#DNS
tc filter add dev eth0 parent 1: protocol ip prio 0 u32 \
match ip dport 53 0xff \
flowid 1:60
#Counter
#tc filter add dev eth0 parent 1: protocol ip prio 0 u32 \
# match ip dport 27005 0xffff \
# flowid 1:72
#tc filter add dev eth0 parent 1: protocol ip prio 0 u32 \
# match ip dport 27015 0xffff \
# flowid 1:72
tc filter add dev eth0 parent 1:0 protocol ip prio 0 handle 1 fw classid 1:72
#ICMP
tc filter add dev eth0 parent 1: protocol ip prio 0 u32 \
match u8 0x01 0xff at 9 \
flowid 1:60
#ACK
tc filter add dev eth0 parent 1: protocol ip prio 0 u32 \
match ip protocol 6 0xff \
match u8 0x05 0x0f at 0 \
match u8 0x10 0x10 at 33 \
match u16 0x0000 0xffc0 at 2 \
flowid 1:60
#SYN
tc filter add dev eth0 parent 1: protocol ip prio 0 u32 \
match ip protocol 6 0xff \
match u8 0x05 0x0f at 0 \
match u8 0x02 0x02 at 33 \
match u16 0x0000 0xffc0 at 2 \
flowid 1:60
#FIN
tc filter add dev eth0 parent 1: protocol ip prio 0 u32 \
match ip protocol 6 0xff \
match u8 0x05 0x0f at 0 \
match u8 0x01 0x01 at 33 \
match u16 0x0000 0xffc0 at 2 \
flowid 1:60
#RST
tc filter add dev eth0 parent 1: protocol ip prio 0 u32 \
match ip protocol 6 0xff \
match u8 0x05 0x0f at 0 \
match u8 0x04 0x04 at 33 \
match u16 0x0000 0xffc0 at 2 \
flowid 1:60
[-- Attachment #3: eth1_new --]
[-- Type: application/octet-stream, Size: 11484 bytes --]
#!/bin/sh
TRATE=980Kbit
echo "delete!"
tc qdisc del dev eth1 root 2>/dev/null >/dev/null
echo "add qdisc..."
tc qdisc add dev eth1 root handle 1: htb default 99 r2q 1
#atentie!!! suma(rate copii) <= rate parinte !!!!
echo "add classes..."
tc class add dev eth1 parent 1: classid 1:1 htb rate $TRATE ceil $TRATE
#tc class add dev eth1 parent 1: classid 1:139 htb rate 4000Kbit ceil 4000Kbit
#ICMP class
tc class add dev eth1 parent 1:1 classid 1:111 htb rate 32Kbit ceil 32Kbit prio 0
#DNS class
tc class add dev eth1 parent 1:1 classid 1:112 htb rate 16Kbit ceil 32Kbit prio 0
#www class
tc class add dev eth1 parent 1:1 classid 1:3 htb rate 178Kbit ceil $TRATE prio 1 burst 100k
#rdc class
tc class add dev eth1 parent 1:1 classid 1:6 htb rate 32Kbit ceil $TRATE prio 2
#netbios
#tc class add dev eth1 parent 1:1 classid 1:7 htb rate 32Kbit ceil $TRATE prio 2
#ssh class
tc class add dev eth1 parent 1:1 classid 1:4 htb rate 16Kbit ceil $TRATE prio 2
#dhcpd
#tc class add dev eth1 parent 1:1 classid 1:5 htb rate 16Kbit ceil $TRATE prio 2
#Counter Strike
#tc class add dev eth1 parent 1: classid 1:8 htb rate 128Kbit ceil 128kbit prio 0
#others parent
DOWN=680
tc class add dev eth1 parent 1:1 classid 1:2 htb rate $[DOWN]Kbit ceil $TRATE prio 2
#badboys classes
N=24 #23 + 1(default) = 24
RATE=$[(8*$DOWN)/(10*$N)]
echo "$[RATE]Kbit / class"
tc class add dev eth1 parent 1:2 classid 1:226 htb rate $[RATE]Kbit ceil $TRATE prio 2 #226
tc class add dev eth1 parent 1:2 classid 1:227 htb rate $[RATE]Kbit ceil $TRATE prio 2 #227
tc class add dev eth1 parent 1:2 classid 1:228 htb rate $[RATE]Kbit ceil $TRATE prio 2 #228
tc class add dev eth1 parent 1:2 classid 1:229 htb rate $[RATE]Kbit ceil $TRATE prio 2 #229
tc class add dev eth1 parent 1:2 classid 1:230 htb rate $[RATE]Kbit ceil $TRATE prio 2 #230
tc class add dev eth1 parent 1:2 classid 1:231 htb rate $[RATE]Kbit ceil $TRATE prio 2 #231
tc class add dev eth1 parent 1:2 classid 1:232 htb rate $[RATE]Kbit ceil $TRATE prio 2 #232
tc class add dev eth1 parent 1:2 classid 1:233 htb rate $[RATE]Kbit ceil $TRATE prio 2 #233
tc class add dev eth1 parent 1:2 classid 1:234 htb rate $[RATE]Kbit ceil $TRATE prio 2 #234
#tc class add dev eth1 parent 1:2 classid 1:235 htb rate $[RATE]Kbit ceil $TRATE prio 2 #235
tc class add dev eth1 parent 1:2 classid 1:236 htb rate $[RATE]Kbit ceil $TRATE prio 2 #236
tc class add dev eth1 parent 1:2 classid 1:237 htb rate $[RATE]Kbit ceil $TRATE prio 2 #237
tc class add dev eth1 parent 1:2 classid 1:238 htb rate $[RATE]Kbit ceil $TRATE prio 2 #238
tc class add dev eth1 parent 1:2 classid 1:239 htb rate $[RATE]Kbit ceil $TRATE prio 2 #239
tc class add dev eth1 parent 1:2 classid 1:240 htb rate $[RATE]Kbit ceil $TRATE prio 2 #240
tc class add dev eth1 parent 1:2 classid 1:241 htb rate $[RATE]Kbit ceil $TRATE prio 2 #241
tc class add dev eth1 parent 1:2 classid 1:242 htb rate $[RATE]Kbit ceil $TRATE prio 2 #242
tc class add dev eth1 parent 1:2 classid 1:243 htb rate $[RATE]Kbit ceil $TRATE prio 2 #243
tc class add dev eth1 parent 1:2 classid 1:244 htb rate $[RATE]Kbit ceil $TRATE prio 2 #244
tc class add dev eth1 parent 1:2 classid 1:245 htb rate $[RATE]Kbit ceil $TRATE prio 2 #245
#tc class add dev eth1 parent 1:2 classid 1:246 htb rate $[RATE]Kbit ceil $TRATE prio 2 #246
#tc class add dev eth1 parent 1:2 classid 1:247 htb rate $[RATE]Kbit ceil $TRATE prio 2 #247
#tc class add dev eth1 parent 1:2 classid 1:248 htb rate $[RATE]Kbit ceil $TRATE prio 2 #248
tc class add dev eth1 parent 1:2 classid 1:249 htb rate $[RATE]Kbit ceil $TRATE prio 2 #249
tc class add dev eth1 parent 1:2 classid 1:250 htb rate $[RATE]Kbit ceil $TRATE prio 2 #250
#tc class add dev eth1 parent 1:2 classid 1:251 htb rate $[RATE]Kbit ceil $TRATE prio 2 #251
tc class add dev eth1 parent 1:2 classid 1:252 htb rate $[RATE]Kbit ceil $TRATE prio 2 #252
#tc class add dev eth1 parent 1:2 classid 1:253 htb rate $[RATE]Kbit ceil $TRATE prio 2 #253
tc class add dev eth1 parent 1:2 classid 1:254 htb rate $[RATE]Kbit ceil $TRATE prio 2 #254
#default class
tc class add dev eth1 parent 1:2 classid 1:99 htb rate $[RATE]Kbit ceil $TRATE prio 2 #0
echo "add filters..."
#icmp
tc filter add dev eth1 parent 1:0 protocol ip prio 0 u32 \
match u8 0x01 0xff at 9 \
flowid 1:111
#DNS
tc filter add dev eth1 parent 1:0 protocol ip prio 0 u32 \
match ip sport 53 0xff \
flowid 1:112
#samba
#tc filter add dev eth1 parent 1:0 protocol ip prio 1 u32 match ip sport \
# 139 0xffff match ip src 81.196.113.225 flowid 1:139
#tc filter add dev eth1 parent 1:0 protocol ip prio 1 u32 match ip sport \
# 138 0xffff match ip src 81.196.113.225 flowid 1:139
#tc filter add dev eth1 parent 1:0 protocol ip prio 1 u32 match ip sport \
# 137 0xffff match ip src 81.196.113.225 flowid 1:139
#www
tc filter add dev eth1 parent 1:0 protocol ip prio 1 u32 match ip sport \
80 0xffff match ip dst 81.196.113.224/27 flowid 1:3
#MSN
tc filter add dev eth1 parent 1:0 protocol ip prio 1 u32 match ip sport \
3783 0xffff match ip dst 81.196.113.224/27 flowid 1:3
#YM
tc filter add dev eth1 parent 1:0 protocol ip prio 1 u32 match ip sport \
1034 0xffff match ip dst 81.196.113.224/27 flowid 1:3
#HTTPS
tc filter add dev eth1 parent 1:0 protocol ip prio 1 u32 match ip dport \
443 0xffff match ip dst 81.196.113.224/27 flowid 1:3
#rdc
tc filter add dev eth1 parent 1:0 protocol ip prio 2 u32 match ip dport \
3389 0xffff match ip dst 81.196.113.224/27 flowid 1:6
#netbios
#tc filter add dev eth1 parent 1:0 protocol ip prio 2 u32 match ip dport \
# 445 0xffff match ip dst 81.196.113.224/27 flowid 1:7
#ssh
tc filter add dev eth1 parent 1:0 protocol ip prio 2 u32 match ip sport \
22 0xffff flowid 1:4
tc filter add dev eth1 parent 1:0 protocol ip prio 2 u32 match ip dport \
22 0xffff flowid 1:4
#dhcp
#tc filter add dev eth1 parent 1:0 protocol ip prio 2 u32 match ip sport \
# 67 0xffff flowid 1:5
#Counter Strike
#tc filter add dev eth1 parent 1:0 protocol ip prio 0 u32 match ip sport 27005 0xffff classid 1:8
#tc filter add dev eth1 parent 1:0 protocol ip prio 0 handle 1 fw classid 1:8
tc filter add dev eth1 parent 1:0 protocol ip prio 3 u32 match ip dst \
81.196.113.226 flowid 1:226
tc filter add dev eth1 parent 1:0 protocol ip prio 3 u32 match ip dst \
81.196.113.227 flowid 1:227
tc filter add dev eth1 parent 1:0 protocol ip prio 3 u32 match ip dst \
81.196.113.228 flowid 1:228
tc filter add dev eth1 parent 1:0 protocol ip prio 3 u32 match ip dst \
81.196.113.229 flowid 1:229
tc filter add dev eth1 parent 1:0 protocol ip prio 3 u32 match ip dst \
81.196.113.230 flowid 1:230
tc filter add dev eth1 parent 1:0 protocol ip prio 3 u32 match ip dst \
81.196.113.231 flowid 1:231
tc filter add dev eth1 parent 1:0 protocol ip prio 3 u32 match ip dst \
81.196.113.232 flowid 1:232
tc filter add dev eth1 parent 1:0 protocol ip prio 3 u32 match ip dst \
81.196.113.233 flowid 1:233
tc filter add dev eth1 parent 1:0 protocol ip prio 3 u32 match ip dst \
81.196.113.234 flowid 1:234
#tc filter add dev eth1 parent 1:0 protocol ip prio 3 u32 match ip dst \
# 81.196.113.235 flowid 1:235
tc filter add dev eth1 parent 1:0 protocol ip prio 3 u32 match ip dst \
81.196.113.236 flowid 1:236
tc filter add dev eth1 parent 1:0 protocol ip prio 3 u32 match ip dst \
81.196.113.237 flowid 1:237
tc filter add dev eth1 parent 1:0 protocol ip prio 3 u32 match ip dst \
81.196.113.238 flowid 1:238
tc filter add dev eth1 parent 1:0 protocol ip prio 3 u32 match ip dst \
81.196.113.239 flowid 1:239
tc filter add dev eth1 parent 1:0 protocol ip prio 3 u32 match ip dst \
81.196.113.240 flowid 1:240
tc filter add dev eth1 parent 1:0 protocol ip prio 3 u32 match ip dst \
81.196.113.241 flowid 1:241
tc filter add dev eth1 parent 1:0 protocol ip prio 3 u32 match ip dst \
81.196.113.242 flowid 1:242
#tc filter add dev eth1 parent 1:0 protocol ip prio 3 u32 match ip dst \
# 81.196.113.243 flowid 1:243
tc filter add dev eth1 parent 1:0 protocol ip prio 3 u32 match ip dst \
81.196.113.244 flowid 1:244
tc filter add dev eth1 parent 1:0 protocol ip prio 3 u32 match ip dst \
81.196.113.245 flowid 1:245
#tc filter add dev eth1 parent 1:0 protocol ip prio 3 u32 match ip dst \
# 81.196.113.246 flowid 1:246
#tc filter add dev eth1 parent 1:0 protocol ip prio 3 u32 match ip dst \
# 81.196.113.247 flowid 1:247
#tc filter add dev eth1 parent 1:0 protocol ip prio 3 u32 match ip dst \
# 81.196.113.248 flowid 1:248
tc filter add dev eth1 parent 1:0 protocol ip prio 3 u32 match ip dst \
81.196.113.249 flowid 1:249
tc filter add dev eth1 parent 1:0 protocol ip prio 3 u32 match ip dst \
81.196.113.250 flowid 1:250
#tc filter add dev eth1 parent 1:0 protocol ip prio 3 u32 match ip dst \
# 81.196.113.251 flowid 1:251
tc filter add dev eth1 parent 1:0 protocol ip prio 3 u32 match ip dst \
81.196.113.252 flowid 1:252
tc filter add dev eth1 parent 1:0 protocol ip prio 3 u32 match ip dst \
81.196.113.253 flowid 1:242
tc filter add dev eth1 parent 1:0 protocol ip prio 3 u32 match ip dst \
81.196.113.254 flowid 1:254
echo "add leaf qdisc..."
tc qdisc add dev eth1 parent 1:3 handle 3: sfq perturb 2
#tc qdisc add dev eth1 parent 1:4 handle 4: sfq perturb 2
#tc qdisc add dev eth1 parent 1:5 handle 5: sfq perturb 2
#tc qdisc add dev eth1 parent 1:6 handle 6: sfq perturb 2
#tc qdisc add dev eth1 parent 1:139 handle 139: sfq perturb 1
#tc qdisc add dev eth1 parent 1:226 handle 226: sfq perturb 2
#tc qdisc add dev eth1 parent 1:227 handle 227: sfq perturb 2
#tc qdisc add dev eth1 parent 1:228 handle 228: sfq perturb 2
#tc qdisc add dev eth1 parent 1:229 handle 229: sfq perturb 2
#tc qdisc add dev eth1 parent 1:230 handle 230: sfq perturb 2
#tc qdisc add dev eth1 parent 1:231 handle 231: sfq perturb 2
#tc qdisc add dev eth1 parent 1:232 handle 232: sfq perturb 2
#tc qdisc add dev eth1 parent 1:233 handle 233: sfq perturb 2
#tc qdisc add dev eth1 parent 1:234 handle 234: sfq perturb 2
#tc qdisc add dev eth1 parent 1:235 handle 235: sfq perturb 2
#tc qdisc add dev eth1 parent 1:236 handle 236: sfq perturb 2
#tc qdisc add dev eth1 parent 1:237 handle 237: sfq perturb 2
#tc qdisc add dev eth1 parent 1:238 handle 238: sfq perturb 2
#tc qdisc add dev eth1 parent 1:239 handle 239: sfq perturb 2
#tc qdisc add dev eth1 parent 1:240 handle 240: sfq perturb 2
#tc qdisc add dev eth1 parent 1:241 handle 241: sfq perturb 2
#tc qdisc add dev eth1 parent 1:242 handle 242: sfq perturb 2
#tc qdisc add dev eth1 parent 1:243 handle 243: sfq perturb 2
#tc qdisc add dev eth1 parent 1:244 handle 244: sfq perturb 2
#tc qdisc add dev eth1 parent 1:245 handle 245: sfq perturb 2
#tc qdisc add dev eth1 parent 1:246 handle 246: sfq perturb 2
#tc qdisc add dev eth1 parent 1:247 handle 247: sfq perturb 2
#tc qdisc add dev eth1 parent 1:248 handle 248: sfq perturb 2
#tc qdisc add dev eth1 parent 1:249 handle 249: sfq perturb 2
#tc qdisc add dev eth1 parent 1:250 handle 250: sfq perturb 2
#tc qdisc add dev eth1 parent 1:251 handle 251: sfq perturb 2
#tc qdisc add dev eth1 parent 1:252 handle 252: sfq perturb 2
#tc qdisc add dev eth1 parent 1:253 handle 253: sfq perturb 2
#tc qdisc add dev eth1 parent 1:254 handle 254: sfq perturb 2
tc qdisc add dev eth1 parent 1:99 handle 99: sfq perturb 1
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [LARTC] Games Priority HELP pls ...
2003-04-17 9:49 [LARTC] Games Priority HELP pls lartc
@ 2003-04-17 10:12 ` Stef Coene
0 siblings, 0 replies; 2+ messages in thread
From: Stef Coene @ 2003-04-17 10:12 UTC (permalink / raw)
To: lartc
On Thursday 17 April 2003 11:49, lartc@go.ro wrote:
> Hello! I have a problem with the priority of COutner Strike
> packets in a LAN with an internet connection !(I have 1Mbps UP
> (limited by me at 575(see below), 1Mbps DOWN) When a single
> user download to FULL bandwidth the COutnerstrike works great,
> but when other users join the LAN and start useing the
> Bandwidth ....Counter Strike begins to have a very high
> latency ....practically unplayable!! There is something wrong
> in this scripts??
>
> See the attach of this e-mail !I'm desperate to find
> what is the problem....HOW CAN I MAKE GAMES like COUNTER
> STRIKE, have full priority!!!
Some remarks.
- Do you see any errors about quantum if you execute dmesg? Something like
quantum too big? It's not something to worry about, but for some classes,
quantum is too big. If have more information on the faq page on
www.docum.org.
- Using different prio for classes is fine IF you know what can go wrong. If
you have a 10kbit class with low prio (so high priority) then that class will
have very low delays if that class is not overlimit (it's not sending more
then it's rate). If the class is overlimit, the delays will be huge. So to
be safe, give each class the same prio. Prio is also used to distribute
remaining bandwidth (so after all child classes are given the configured
rate) from the parent to his child classes. The class with the lowest prio
will get the remaining bandwidth.
- Adding a sfq qdisc to a leaf class is ok. But sometimes a small fifo qdisc
is better. A sfq is very good in giving each stream the same bandwidth. But
for low delay classes, a fifo qdisc can be better.
Can you also check with tc -s -d class show dev eth0 that each class is
receiving packets so you are sure that your filters are working ?
Stef
--
stef.coene@docum.org
"Using Linux as bandwidth manager"
http://www.docum.org/
#lartc @ irc.oftc.net
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2003-04-17 10:12 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-04-17 9:49 [LARTC] Games Priority HELP pls lartc
2003-04-17 10:12 ` Stef Coene
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.