[LARTC] smallest rate

2006-08-15 Thread Kristiadi Himawan


Hi, anyone know the smallest rate for tc, is it possible using 0 bps ?


___
LARTC mailing list
LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc


[LARTC] howto reduce the ping?

2006-08-15 Thread Julius Junghans
Hi,

with the attached config my gaming ping is still +20ms, even if the line isn't  
saturated..can anybody give me a hint how to get a better response time? 
my line: 1024/128kbit

outbound:
one htb qdisc for gaming (7kbps) prio 0 ceil 14kbps- should get more traffic 
when needed. 
Htb again for irc and default.


inbound:
css, irc, p2p, default - same shema as before, give css enough bandwith and 
allocate the rest for the other classes.

Are packets in 1:10 (css) are transfered as fast as they arrive?


 

Same config without line breaks:
http://phpfi.com/140959

#!/bin/bash

OUTBOUND_DEV=ppp0
INBOUND_DEV=imq0

start_outbound()
{
echo Starting outbound

tc qdisc add dev ppp0 root handle 1: htb default 90
#max upload
tc class add dev ppp0 parent 1: classid 1:1 htb rate 14kbps

#css
tc class add dev ppp0 parent 1:1 classid 1:10 htb rate 9kbps ceil 14kbps 
prio 1
iptables -t mangle -A POSTROUTING -p tcp --dport 27020:27039 -j 
CLASSIFY --set-class 1:10
iptables -t mangle -A POSTROUTING -p udp --dport 27000:27015 -j 
CLASSIFY --set-class 1:10

#irc
tc class add dev ppp0 parent 1:1 classid 1:20 htb rate 1kbps ceil 1kbps 
prio 2
iptables -t mangle -A POSTROUTING -p tcp --dport 6667 -j 
CLASSIFY --set-class 1:20

#default
tc class add dev ppp0 parent 1:1 classid 1:90 htb rate 4kbps ceil 4kbps 
prio 3
}

stop_outbound_tc()
{
echo Stopping outbound tc
tc qdisc del dev ppp0 root2 /dev/null  /dev/null
tc qdisc del dev ppp0 ingress 2 /dev/null  /dev/null
}

stop_outbound_iptables()
{
echo Stopping outbound iptables

#css
iptables -t mangle -D POSTROUTING -p tcp --dport 27020:27039 -j 
CLASSIFY --set-class 1:10
iptables -t mangle -D POSTROUTING -p udp --dport 27000:27015 -j 
CLASSIFY --set-class 1:10

#irc
iptables -t mangle -D POSTROUTING -p tcp --dport 6667 -j 
CLASSIFY --set-class 1:20

#default
iptables -t mangle -D POSTROUTING -j CLASSIFY --set-class 1:90
}

start_inbound_device()
{
echo Starting inbound device
ip link set $INBOUND_DEV up
}

stop_inbound_device()
{
echo Stopping inbound device
ip link set $INBOUND_DEV down
}

start_inbound()
{
echo Starting inbound
tc qdisc add dev imq0 root handle 1: htb default 90

#max download rate
tc class add dev $INBOUND_DEV parent 1: classid 1:1 htb rate 110kbps


#css
tc class add dev $INBOUND_DEV parent 1:1 classid 1:10 htb rate 30kbps ceil 
110kbps prio 1
iptables -t mangle -A PREROUTING -i ppp0 -p udp --sport 27000:27015 -j 
MARK --set-mark 1
iptables -t mangle -A PREROUTING -i ppp0 -p tcp --sport 27020:27039 -j 
MARK --set-mark 1
tc filter add dev $INBOUND_DEV parent 1:0 protocol ip prio 1 handle 1 fw 
classid 1:10

#irc
tc class add dev $INBOUND_DEV parent 1:1 classid 1:20 htb rate 10kbps ceil 
10kbps prio 2
iptables -t mangle -A PREROUTING -i ppp0 -p tcp --sport 6667 -j 
MARK --set-mark 2
tc filter add dev $INBOUND_DEV parent 1:0 protocol ip prio 2 handle 2 fw 
classid 1:20

#p2p
tc class add dev $INBOUND_DEV parent 1:1 classid 1:30 htb rate 40kbps ceil 
40kbps prio 3
iptables -t mangle -A PREROUTING -p tcp --dport 6881:6999 -j 
MARK --set-mark 3
tc filter add dev $INBOUND_DEV parent 1:0 protocol ip prio 3 handle 3 fw 
classid 1:30

#default
tc class add dev $INBOUND_DEV parent 1:1 classid 1:90 htb rate 30kbps ceil 
30kbps prio 4
  
#fetch all incoming stuff and redirect it to imq0
iptables -t mangle -A PREROUTING -i ppp0 -j IMQ --todev 0
}

stop_inbound_tc()
{
echo Stopping inbound tc
tc qdisc del dev $INBOUND_DEV root2 /dev/null  /dev/null
tc qdisc del dev $INBOUND_DEV ingress 2 /dev/null  /dev/null
}

stop_inbound_iptables()
{
echo Stopping inbound iptables
#css
iptables -t mangle -D PREROUTING -i ppp0 -p udp --sport 27000:27015 -j 
MARK --set-mark 1
iptables -t mangle -D PREROUTING -i ppp0 -p tcp --sport 27020:27039 -j 
MARK --set-mark 1
 
#irc
iptables -t mangle -D PREROUTING -i ppp0 -p tcp --sport 6667 -j 
MARK --set-mark 2
   
#p2p
iptables -t mangle -D PREROUTING -p tcp --dport 6881:6999 -j 
MARK --set-mark 3
   
#default
iptables -t mangle -D PREROUTING -j MARK --set-mark 4

#fetch all incoming stuff and redirect it to imq0
iptables -t mangle -D PREROUTING -i ppp0 -j IMQ --todev 0
}

start()
{
start_outbound
start_inbound_device
start_inbound
}

stop()
{
stop_outbound_tc
stop_outbound_iptables
stop_inbound_tc
stop_inbound_device
stop_inbound_iptables
}

show()
{
echo Outbound --- Outbound --- Outbound --- Outbound --- Outbound --- 
Outbound
echo qdisc: -
tc -s -d qdisc show dev $OUTBOUND_DEV
echo classes: ---
tc -s class show dev $OUTBOUND_DEV
echo filters: ---
tc filter show dev $OUTBOUND_DEV

echo Inbound --- Inbound --- Inbound 

RE: [LARTC] smallest rate

2006-08-15 Thread William Bohannan
So far the smallest rate I have been able to get is 1, why not use a
firewall if you want 0?

Kind Regards
William


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
On Behalf Of Kristiadi Himawan
Sent: 15 August 2006 07:17
To: lartc@mailman.ds9a.nl
Subject: [LARTC] smallest rate


Hi, anyone know the smallest rate for tc, is it possible using 0 bps ?


___
LARTC mailing list
LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc

___
LARTC mailing list
LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc


[LARTC] Accounting using ip addresses and ulogd

2006-08-15 Thread William Bohannan








Hi use traffic shaping on my local lan and it keeps all
drops packets by logging them to mysql via ulogd. Since there is windows and
apple users on the network I would like to have their computer names
instead of ip address to make for easy accounting. Does anyone know of a
script or tool to get the ip address of a drop packet and turn it into a
computer name (via wins or something like that?)?



Kind Regards



William 








___
LARTC mailing list
LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc


Re: [LARTC] howto reduce the ping?

2006-08-15 Thread Marek Kierdelewicz
 Hi,

Hi there

 
 with the attached config my gaming ping is still +20ms, even if the
 line isn't saturated..can anybody give me a hint how to get a better
 response time? my line: 1024/128kbit

Try using tc filters instead of CLASSIFY and see if that helps. I've
seen some strange shaping behavior with it...

Another thing is prioritizing some of the htb classes. You can
set priority 1 for class 1:10 (css) and priority 2 for 1:20, 1:90
(lower is better). This way you're sure that css is getting max upload
speed if any other traffic is fighting his way out of your coputer.

You can do the same thing for download, but with your connection I
think that upload will be the most likely bottleneck.

cheers
-- 
Marek Kierdelewicz
Kierownik Dzia?u Systemów Sieciowych, KoBa
Manager of Network Systems Department, KoBa
tel. (85) 7406466; fax. (85) 7406467
e-mail: [EMAIL PROTECTED]
___
LARTC mailing list
LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc


Re: [LARTC] howto reduce the ping?

2006-08-15 Thread Julius Junghans
Am Dienstag 15 August 2006 17:43 schrieb Marek Kierdelewicz:
  Hi,

 Hi there

  with the attached config my gaming ping is still +20ms, even if the
  line isn't saturated..can anybody give me a hint how to get a better
  response time? my line: 1024/128kbit

 Try using tc filters instead of CLASSIFY and see if that helps. I've
 seen some strange shaping behavior with it...
Ive found only one explanation for port ranges on the mailing list and the 
author wasn't sure if it was correct...so i ask here:

#port range 27020:27039, protocol tcp

#iptables -t mangle -A POSTROUTING -p tcp --dport 27020:27039 -j 
CLASSIFY --set-class 1:10
tc filter add dev ppp0 protocol ip parent 1: prio 1 u32 match ip dport 
27020 0x13 match ip protocol 6 0xff flowid 1:10

#port range 27000:27015, protocol udp

#iptables -t mangle -A POSTROUTING -p udp --dport 27000:27015 -j 
CLASSIFY --set-class 1:10
tc filter add dev ppp0 protocol ip parent 1: prio 1 u32 match ip dport 
27000 0x21 match ip protocol 17 0xff flowid 1:10

are the tc filters correct for the port ranges and the protocol?


 Another thing is prioritizing some of the htb classes. You can
 set priority 1 for class 1:10 (css) and priority 2 for 1:20, 1:90
 (lower is better). This way you're sure that css is getting max upload
 speed if any other traffic is fighting his way out of your coputer.

 You can do the same thing for download, but with your connection I
 think that upload will be the most likely bottleneck.

 cheers
___
LARTC mailing list
LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc


Re: [LARTC] howto reduce the ping?

2006-08-15 Thread Marek Kierdelewicz

 #port range 27020:27039, protocol tcp
 
 #iptables -t mangle -A POSTROUTING -p tcp --dport 27020:27039 -j 
 CLASSIFY --set-class 1:10
 tc filter add dev ppp0 protocol ip parent 1: prio 1 u32 match ip
 dport 27020 0x13 match ip protocol 6 0xff flowid 1:10
 

My choice would be fw filter:
iptables -t mangle -A POSTROUTING -p tcp --dport 27020:27039 -j MARK
--set-mark 0x10
tc filter add dev ppp0 protocol ip parent 1:0 prio 1 handle 0x10 fw
classid 1:10


 #port range 27000:27015, protocol udp
 
 #iptables -t mangle -A POSTROUTING -p udp --dport 27000:27015 -j 
 CLASSIFY --set-class 1:10
 tc filter add dev ppp0 protocol ip parent 1: prio 1 u32 match ip
 dport 27000 0x21 match ip protocol 17 0xff flowid 1:10

iptables -t mangle -A POSTROUTING -p udp --dport 27000:27015 -j MARK
--set-mark 0x10

(filter same as above...only one needed)
tc filter add dev ppp0 protocol ip parent 1:0 prio 1 handle 0x10 fw
classid 1:10

Hope that helps.

cheers
-- 
Marek Kierdelewicz
Kierownik Dzia?u Systemów Sieciowych, KoBa
Manager of Network Systems Department, KoBa
tel. (85) 7406466; fax. (85) 7406467
e-mail: [EMAIL PROTECTED]
___
LARTC mailing list
LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc


Re: [LARTC] howto reduce the ping?

2006-08-15 Thread Julius Junghans
Am Mittwoch 16 August 2006 00:09 schrieb Marek Kierdelewicz:
  #port range 27020:27039, protocol tcp
 
  #iptables -t mangle -A POSTROUTING -p tcp --dport 27020:27039 -j
  CLASSIFY --set-class 1:10
  tc filter add dev ppp0 protocol ip parent 1: prio 1 u32 match ip
  dport 27020 0x13 match ip protocol 6 0xff flowid 1:10

 My choice would be fw filter:
 iptables -t mangle -A POSTROUTING -p tcp --dport 27020:27039 -j MARK
 --set-mark 0x10
 tc filter add dev ppp0 protocol ip parent 1:0 prio 1 handle 0x10 fw
 classid 1:10
Ah, thats what you mean. Tried to avoid iptables at all...
Thx, will try that tomorrow.


  #port range 27000:27015, protocol udp
 
  #iptables -t mangle -A POSTROUTING -p udp --dport 27000:27015 -j
  CLASSIFY --set-class 1:10
  tc filter add dev ppp0 protocol ip parent 1: prio 1 u32 match ip
  dport 27000 0x21 match ip protocol 17 0xff flowid 1:10

 iptables -t mangle -A POSTROUTING -p udp --dport 27000:27015 -j MARK
 --set-mark 0x10

 (filter same as above...only one needed)
 tc filter add dev ppp0 protocol ip parent 1:0 prio 1 handle 0x10 fw
 classid 1:10

 Hope that helps.

 cheers

greets
Julius
___
LARTC mailing list
LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc