* Re: [LARTC] wondershaper + htb prio + qdisc prio
2002-12-29 18:19 [LARTC] wondershaper + htb prio + qdisc prio lartc
@ 2002-12-29 18:28 ` AHM
2002-12-29 18:55 ` Andre Meij
` (5 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: AHM @ 2002-12-29 18:28 UTC (permalink / raw)
To: lartc
Hi,<BR><BR>I think that imcp is not the solution. I've tested with mohaa
and that game uses an own sort of ping on a udp port (so via tcp and not
imcp)<BR><BR>Maby u should check if counterstrike does that
too.<BR><BR>Regards,<BR>Andre<BR><BR><BR>> hello,<BR>> <BR>> a
friend of mine have this configuration:<BR>> <BR>> 10 x PC --
router/linux/rh8 -- ADSL Modem -- ISP<BR>> <BR>> let's say that the
bandwidth is: 5M and 800K<BR>> <BR>> he does dc++ and
counter-strike, so let's say the UP is full, and the<BR>> ping from the
counter server is 300ms, the server cut the connection,<BR>> and no
more game, the player is unhappy. The normal ping is 50ms.<BR>>
<BR>> so he thinks to put some prio on the ping-echo packets to make
the ping<BR>> be extra small, he try the wondershapper from the lartc,
don't work,<BR>> make a simplified script just for icmp with
is:<BR>> <BR>> $tc qdisc del $IF_EXT root<BR>> $tc qdisc add
$IF_EXT handle 1: root htb default 2<BR>> $tc class add $IF_EXT parent
1: classid 1:9 htb rate 500kbit burst 6k<BR>> $tc class add $IF_EXT
parent 1:9 classid 1:1 htb rate 500kbit ceil<BR>> 500kbit burst 6k prio
1<BR>> $tc class add $IF_EXT parent 1:9 classid 1:2 htb rate 64kbit
ceil<BR>> 500kbit burst 6k prio 2<BR>> <BR>> $tc filter add
$IF_EXT protocol ip prio 2 parent 1: u32 \<BR>> match ip protocol 1
0xff flowid 1:1<BR>> <BR>> first tryed it with ceil 800kbit, after
with a smaller value, the "real"<BR>> bandwidth was somewhere around
700kbit, at that moment.<BR>> <BR>> didn't work<BR>> <BR>> so
he tryed with just a prio qdisc and put the icmp packets in the 0<BR>>
band, the script:<BR>> <BR>> $iptables -t mangle -A POSTROUTING -p
icmp -j TOS --set-tos 0x10<BR>> $tc qdisc del $IF_EXT root<BR>> $tc
qdisc add $IF_EXT root handle 10: prio<BR>> <BR>> $tc qdisc add
$IF_EXT parent 10:1 handle 20: est 1sec 8sec bfifo<BR>> $tc qdisc add
$IF_EXT parent 10:2 handle 30: est 1sec 8sec bfifo<BR>> $tc qdisc add
$IF_EXT parent 10:3 handle 40: est 1sec 8sec bfifo<BR>> <BR>> $tc
filter add $IF_EXT parent 10: protocol ip prio 1 u32 match ip tos<BR>>
0x10 0xff flowid 10:1<BR>> $tc filter add $IF_EXT parent 10: protocol
ip prio 1 u32 match ip tos<BR>> 0x06 0xff flowid 10:2<BR>> $tc
filter add $IF_EXT parent 10: protocol ip prio 1 u32 match ip tos<BR>>
0x0c 0xff flowid 10:3<BR>> <BR>> <BR>> still with no result the
ping from the counter server is always 300ms,<BR>> what's
wrong????<BR>> <BR>> C<BR>> -- <BR>> Ciprian Niculescu<BR>>
<BR>> _______________________________________________<BR>> LARTC
mailing list / LARTC@mailman.ds9a.nl<BR>>
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/<BR>
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: [LARTC] wondershaper + htb prio + qdisc prio
2002-12-29 18:19 [LARTC] wondershaper + htb prio + qdisc prio lartc
2002-12-29 18:28 ` AHM
@ 2002-12-29 18:55 ` Andre Meij
2002-12-30 10:54 ` Tornado
` (4 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Andre Meij @ 2002-12-29 18:55 UTC (permalink / raw)
To: lartc
Hi,<BR><BR>(Sorry for the repost last post was screwed up by my
emailclient)<BR><BR>I think that imcp is not the solution. I've tested
with mohaa and that game uses an own sort of ping on a udp port (so via
tcp and not imcp)<BR><BR>Maby u should check if counterstrike does that
too.<BR><BR>Regards,<BR><BR>Andre<BR><BR>> hello,<BR>> <BR>> a
friend of mine have this configuration:<BR>> <BR>> 10 x PC --
router/linux/rh8 -- ADSL Modem -- ISP<BR>> <BR>> let's say that the
bandwidth is: 5M and 800K<BR>> <BR>> he does dc++ and
counter-strike, so let's say the UP is full, and the<BR>> ping from the
counter server is 300ms, the server cut the connection,<BR>> and no
more game, the player is unhappy. The normal ping is 50ms.<BR>>
<BR>> so he thinks to put some prio on the ping-echo packets to make
the ping<BR>> be extra small, he try the wondershapper from the lartc,
don't work,<BR>> make a simplified script just for icmp with
is:<BR>> <BR>> $tc qdisc del $IF_EXT root<BR>> $tc qdisc add
$IF_EXT handle 1: root htb default 2<BR>> $tc class add $IF_EXT parent
1: classid 1:9 htb rate 500kbit burst 6k<BR>> $tc class add $IF_EXT
parent 1:9 classid 1:1 htb rate 500kbit ceil<BR>> 500kbit burst 6k prio
1<BR>> $tc class add $IF_EXT parent 1:9 classid 1:2 htb rate 64kbit
ceil<BR>> 500kbit burst 6k prio 2<BR>> <BR>> $tc filter add
$IF_EXT protocol ip prio 2 parent 1: u32 \<BR>> match ip protocol 1
0xff flowid 1:1<BR>> <BR>> first tryed it with ceil 800kbit, after
with a smaller value, the "real"<BR>> bandwidth was somewhere around
700kbit, at that moment.<BR>> <BR>> didn't work<BR>> <BR>> so
he tryed with just a prio qdisc and put the icmp packets in the 0<BR>>
band, the script:<BR>> <BR>> $iptables -t mangle -A POSTROUTING -p
icmp -j TOS --set-tos 0x10<BR>> $tc qdisc del $IF_EXT root<BR>> $tc
qdisc add $IF_EXT root handle 10: prio<BR>> <BR>> $tc qdisc add
$IF_EXT parent 10:1 handle 20: est 1sec 8sec bfifo<BR>> $tc qdisc add
$IF_EXT parent 10:2 handle 30: est 1sec 8sec bfifo<BR>> $tc qdisc add
$IF_EXT parent 10:3 handle 40: est 1sec 8sec bfifo<BR>> <BR>> $tc
filter add $IF_EXT parent 10: protocol ip prio 1 u32 match ip tos<BR>>
0x10 0xff flowid 10:1<BR>> $tc filter add $IF_EXT parent 10: protocol
ip prio 1 u32 match ip tos<BR>> 0x06 0xff flowid 10:2<BR>> $tc
filter add $IF_EXT parent 10: protocol ip prio 1 u32 match ip tos<BR>>
0x0c 0xff flowid 10:3<BR>> <BR>> <BR>> still with no result the
ping from the counter server is always 300ms,<BR>> what's
wrong????<BR>> <BR>> C<BR>> -- <BR>> Ciprian Niculescu<BR>>
<BR>> _______________________________________________<BR>> LARTC
mailing list / LARTC@mailman.ds9a.nl<BR>>
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/<BR>
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: [LARTC] wondershaper + htb prio + qdisc prio
2002-12-29 18:19 [LARTC] wondershaper + htb prio + qdisc prio lartc
2002-12-29 18:28 ` AHM
2002-12-29 18:55 ` Andre Meij
@ 2002-12-30 10:54 ` Tornado
2002-12-30 11:21 ` Ciprian Niculescu
` (3 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Tornado @ 2002-12-30 10:54 UTC (permalink / raw)
To: lartc
Hey there,
> hello,
>
> a friend of mine have this configuration:
>
> 10 x PC -- router/linux/rh8 -- ADSL Modem -- ISP
>
> let's say that the bandwidth is: 5M and 800K
>
> he does dc++ and counter-strike, so let's say the UP is full, and the
> ping from the counter server is 300ms, the server cut the connection, and
> no more game, the player is unhappy. The normal ping is 50ms.
>
> so he thinks to put some prio on the ping-echo packets to make the ping
> be extra small, he try the wondershapper from the lartc, don't work, make
> a simplified script just for icmp with is:
>
> $tc qdisc del $IF_EXT root
> $tc qdisc add $IF_EXT handle 1: root htb default 2
> $tc class add $IF_EXT parent 1: classid 1:9 htb rate 500kbit burst 6k
> $tc class add $IF_EXT parent 1:9 classid 1:1 htb rate 500kbit ceil
> 500kbit burst 6k prio 1
> $tc class add $IF_EXT parent 1:9 classid 1:2 htb rate 64kbit ceil 500kbit
> burst 6k prio 2
>
> $tc filter add $IF_EXT protocol ip prio 2 parent 1: u32 \
> match ip protocol 1 0xff flowid 1:1
>
> first tryed it with ceil 800kbit, after with a smaller value, the "real"
> bandwidth was somewhere around 700kbit, at that moment.
>
> didn't work
>
[ -- SNIP --]
> still with no result the ping from the counter server is always 300ms,
> what's wrong????
Maybe I'm misunderstanding you, maybe not - but what exactly do you mean by
"the ping from the server is always 300ms"?
Is it the ICMP ping (generated by the 'ping' tool), or do you mean when you
play Counter-Strike, and you look at the players tab, that shows you're
lagged with 300ms?
Have you tried to ping the counter-strike server direct from the shell using
the 'ping' tool? If this results in very low ping replies, your tc setup is
correctly set up.
The only thing you're missing now, is to prioritize counter-strike specific
traffic. Usually the portnumbers used by Couter-Strike servers are 27015 and
some numbers up, so this is what you have to prioritize.
An example (class id is from your first script, using htb) - this will put
the packets leaving your $IF_EXT to port 27015, 27016 and 27017 to any hosts
in the class 1:1:
for cs_p in 27015 27016 27017; do
tc filter add dev $IF_EXT parent 1:0 protocol ip prio 10 u32 \
match ip dport $cs_p 0xffff flowid 1:1
done
You may need to modify the above example to fit your script.
--
Theepan
PS: I'm sorry if you receive this mail twice. I forgot to CC it the list the
first time.
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: [LARTC] wondershaper + htb prio + qdisc prio
2002-12-29 18:19 [LARTC] wondershaper + htb prio + qdisc prio lartc
` (2 preceding siblings ...)
2002-12-30 10:54 ` Tornado
@ 2002-12-30 11:21 ` Ciprian Niculescu
2002-12-30 21:22 ` Tornado
` (2 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Ciprian Niculescu @ 2002-12-30 11:21 UTC (permalink / raw)
To: lartc
On Mon, 30 Dec 2002 11:49:58 +0100, "Tornado"
<tornado@linuxfromscratch.org> said:
> Hey there,
>
> Maybe I'm misunderstanding you, maybe not - but what exactly do you mean
> by
> "the ping from the server is always 300ms"?
>
> Is it the ICMP ping (generated by the 'ping' tool), or do you mean when
> you
> play Counter-Strike, and you look at the players tab, that shows you're
> lagged with 300ms?
by ping i meen the real ping program with icmp, i see that i could not
specify counterstrike to don't create confusion.
and the ideea is not to priorize the counter game, but only the ping used
by the counter game
so another question is, the counter strike game use udp/270015 only for
ping probing or also for game packets
>
> Have you tried to ping the counter-strike server direct from the shell
> using
> the 'ping' tool? If this results in very low ping replies, your tc setup
> is
> correctly set up.
this is what i try, beacouse i dont realy play the game, i generate
trafic to saturate the link, and ping from shell from an externat host
C
>
> The only thing you're missing now, is to prioritize counter-strike
> specific
> traffic. Usually the portnumbers used by Couter-Strike servers are 27015
> and
> some numbers up, so this is what you have to prioritize.
>
> An example (class id is from your first script, using htb) - this will
> put
> the packets leaving your $IF_EXT to port 27015, 27016 and 27017 to any
> hosts
> in the class 1:1:
>
> for cs_p in 27015 27016 27017; do
> tc filter add dev $IF_EXT parent 1:0 protocol ip prio 10 u32 \
> match ip dport $cs_p 0xffff flowid 1:1
> done
>
> You may need to modify the above example to fit your script.
>
>
> --
> Theepan
>
>
>
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: [LARTC] wondershaper + htb prio + qdisc prio
2002-12-29 18:19 [LARTC] wondershaper + htb prio + qdisc prio lartc
` (3 preceding siblings ...)
2002-12-30 11:21 ` Ciprian Niculescu
@ 2002-12-30 21:22 ` Tornado
2002-12-30 23:23 ` Ciprian Niculescu
2002-12-31 10:49 ` sufcrusher
6 siblings, 0 replies; 8+ messages in thread
From: Tornado @ 2002-12-30 21:22 UTC (permalink / raw)
To: lartc
> >
> > Is it the ICMP ping (generated by the 'ping' tool), or do you mean when
> > you
> > play Counter-Strike, and you look at the players tab, that shows you're
> > lagged with 300ms?
>
> by ping i meen the real ping program with icmp, i see that i could not
> specify counterstrike to don't create confusion.
>
> and the ideea is not to priorize the counter game, but only the ping used
> by the counter game
>
> so another question is, the counter strike game use udp/270015 only for
> ping probing or also for game packets
The counter-strike server does not 'ping' you in a "normal" fashion. It's an
in-game feature, which doesn't use extra protocols to retrieve ping, hence
counter-trike server uses port 27015 to both game packets and
"ping-in-game"-packets.
And besides, it wouldn't make any difference to only prioritize the
"ping-in-game"-packets, even if you could - the game would still lag as
without traffic control.
> this is what i try, beacouse i dont realy play the game, i generate
> trafic to saturate the link, and ping from shell from an externat host
In which case, you should check if your downstream is not chocking. Even if
you shape outgoing packets, you can still get get bad pings, if your
downstream is running at max.
--
Theepan
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: [LARTC] wondershaper + htb prio + qdisc prio
2002-12-29 18:19 [LARTC] wondershaper + htb prio + qdisc prio lartc
` (4 preceding siblings ...)
2002-12-30 21:22 ` Tornado
@ 2002-12-30 23:23 ` Ciprian Niculescu
2002-12-31 10:49 ` sufcrusher
6 siblings, 0 replies; 8+ messages in thread
From: Ciprian Niculescu @ 2002-12-30 23:23 UTC (permalink / raw)
To: lartc
On Mon, 30 Dec 2002 22:22:28 +0100, "Tornado"
<tornado@linuxfromscratch.org> said:
> > >
> > this is what i try, beacouse i dont realy play the game, i generate
> > trafic to saturate the link, and ping from shell from an externat host
>
> In which case, you should check if your downstream is not chocking. Even
> if
> you shape outgoing packets, you can still get get bad pings, if your
> downstream is running at max.
no a 1Mbit trafic on a 5M no chocking :))))
C
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: [LARTC] wondershaper + htb prio + qdisc prio
2002-12-29 18:19 [LARTC] wondershaper + htb prio + qdisc prio lartc
` (5 preceding siblings ...)
2002-12-30 23:23 ` Ciprian Niculescu
@ 2002-12-31 10:49 ` sufcrusher
6 siblings, 0 replies; 8+ messages in thread
From: sufcrusher @ 2002-12-31 10:49 UTC (permalink / raw)
To: lartc
[-- Attachment #1: Type: text/plain, Size: 2359 bytes --]
But you are not listening to what I and others have been saying. Forget
about the ICMP pings! They don't mean nothing!
Use the script I attached (change a few settings, like your own speeds,
interface and executables, speeds are in kbit!). Then use the following
iptables rules:
(eth0=my internet-interface, eth2=my LAN interface, change if needed !)
# ICMP packets have an even higher priority (so you can test it with ping,
but this doesn't help CounterStrike at all!)
# Don't do massive pings/traceroutes because that would choke other traffic
(including CS)!
iptables -I PREROUTING -t mangle -i eth2 -j MARK --set-mark 1 -p ICMP
iptables -I OUTPUT -t mangle -o eth0 -j MARK --set-mark 1 -p ICMP
# And here's Counter Strike:
# if you want you could add: -m multiport --destination-port 27000:27050
iptables -I PREROUTING -t mangle -i eth2 -j MARK --set-mark 1 -p
DP --source-port 27005
# ACK Packets get higher priority than 'normal' packets
iptables -I PREROUTING -t mangle -i eth2 -j MARK --set-mark 2 -p TCP -m
length --length 0:100
iptables -I OUTPUT -t mangle -o eth0 -j MARK --set-mark 2 -p TCP -m
length --length 0:100
And add some more yourself, remember:
- All rules are tested for each packet: MARK does _not_ stop like ACCEPT and
RETURN do.
- Therefore the order in which you place these rules is important.
- Rules are inserted (-I) in the table, so eventually (use iptables -L -n)
the rules will be 'upside down' in the table.
- Thus higher priorities rules (lower MARK numbers) should go first in your
script, otherwise they might be overruled by later rules.
Jannes Faber
----- Original Message -----
From: "Ciprian Niculescu" <lartc@cnicules.4email.net>
To: "Tornado" <tornado@linuxfromscratch.org>; <lartc@mailman.ds9a.nl>
Sent: Tuesday, December 31, 2002 12:23 AM
Subject: Re: [LARTC] wondershaper + htb prio + qdisc prio
> On Mon, 30 Dec 2002 22:22:28 +0100, "Tornado"
> <tornado@linuxfromscratch.org> said:
> > > >
> > > this is what i try, beacouse i dont realy play the game, i generate
> > > trafic to saturate the link, and ping from shell from an externat host
> >
> > In which case, you should check if your downstream is not chocking. Even
> > if
> > you shape outgoing packets, you can still get get bad pings, if your
> > downstream is running at max.
>
> no a 1Mbit trafic on a 5M no chocking :))))
>
> C
>
[-- Attachment #2: tcstart.sh --]
[-- Type: application/octet-stream, Size: 1462 bytes --]
#!/bin/sh
INET_INTERFACE="eth0"
TC_UPLINK_RATE="100"
TC_RATE[0]=70
TC_CEIL[0]=$TC_UPLINK_RATE
TC_RATE[1]=10
TC_CEIL[1]=60
TC_RATE[2]=10
TC_CEIL[2]=60
TC_RATE[3]=10
TC_CEIL[3]=60
# Executables and stuff
IPTABLES="iptables"
TC="tc-htb"
IP="ip"
LOG="/dev/null"
# Comment out the following two lines after setting up all variables above
# and having checked them.
TC="echo tc-htb"
LOG="/dev/stdout"
#### No need to alter anything below here ####
PRIOS='0 1 2 3'
# Packet marks
MARK[0]="1"
MARK[1]="2"
MARK[2]="3"
MARK[3]="4"
# Find last prio, which will be the default
for PRIO in $PRIOS
do
LAST_PRIO=$PRIO
done
# The iptables part
iptables -F -t mangle
ezshaper -i start
# The TC part
$TC qdisc del dev $INET_INTERFACE root
$TC qdisc add dev $INET_INTERFACE root handle 1:0 htb default $[$LAST_PRIO+10]
$TC class add dev $INET_INTERFACE parent 1:0 classid 1:1 htb rate ${TC_UPLINK_RATE}kbit
for PRIO in $PRIOS
do
echo -e "\n***** Prio $PRIO *****" > $LOG
# Add leaf classes for PRIO traffic
$TC class add dev $INET_INTERFACE parent 1:1 \
classid 1:$[$PRIO+10] htb \
rate ${TC_RATE[$PRIO]}"kbit" \
ceil ${TC_CEIL[$PRIO]}"kbit" \
prio $PRIO
# Now filter PRIO traffic to this leaf
$TC filter add dev $INET_INTERFACE parent 1:0 \
protocol ip prio $PRIO handle ${MARK[$PRIO]} \
fw flowid 1:$[$PRIO+10]
done
^ permalink raw reply [flat|nested] 8+ messages in thread