* [LARTC] Help with HTB rules (experiencing latency)
@ 2007-03-03 19:39 Edgar Merino
2007-03-03 19:48 ` Edgar Merino
2007-03-04 19:15 ` Edgar Merino
0 siblings, 2 replies; 3+ messages in thread
From: Edgar Merino @ 2007-03-03 19:39 UTC (permalink / raw)
To: lartc
[-- Attachment #1: Type: text/plain, Size: 580 bytes --]
Hello, I'm using these rules (attached) to control traffic going out
from ip 192.168.0.100 which is acting as a p2p server, but when I have
these rules on and mldonkey running I experience some latency in web
pages, which Iwould like to eliminate. I've read that this is where the
burst and cburst (even quantum) parameters are useful, but I still can't
understand crearly how to set them (there are few examples using up
rates of ~25kb/s), I hope you can check my rules and give me a hint on
what to do.
Soluciones en español también aceptadas.
Edgar Merino
[-- Attachment #2: layer7ru.sh --]
[-- Type: application/x-shellscript, Size: 2141 bytes --]
[-- Attachment #3: Type: text/plain, Size: 143 bytes --]
_______________________________________________
LARTC mailing list
LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc
^ permalink raw reply [flat|nested] 3+ messages in thread
* [LARTC] Help with HTB rules (experiencing latency)
2007-03-03 19:39 [LARTC] Help with HTB rules (experiencing latency) Edgar Merino
@ 2007-03-03 19:48 ` Edgar Merino
2007-03-04 19:15 ` Edgar Merino
1 sibling, 0 replies; 3+ messages in thread
From: Edgar Merino @ 2007-03-03 19:48 UTC (permalink / raw)
To: lartc
[-- Attachment #1: Type: text/plain, Size: 575 bytes --]
Hello, I'm using these rules (attached) to control traffic going out
from ip 192.168.0.100 which is acting as a p2p server, but when I have
these rules on and mldonkey running I experience some latency in web
pages, which Iwould like to eliminate. I've read that this is where the
burst and cburst (even quantum) parameters are useful, but I still can't
understand crearly how to set them (there are few examples using up
rates of ~25kb/s), I hope you can check my rules and give me a hint on
what to do.
Soluciones en español también aceptadas.
Edgar Merino
[-- Attachment #2: layer7ru.txt --]
[-- Type: text/plain, Size: 2141 bytes --]
#!/bin/sh
### Dispositivo de upload (externo) ###
DEV=eth0
### Bajar la cola the $DEV y el MTU###
ip link set dev $DEV qlen 30
ip link set dev $DEV mtu 1000
### BORRADO DE REGLAS Y CADENAS de la tabla mangle ###
iptables -t mangle -F
iptables -t mangle -X
## BORRADO DE ROOT QDISC EN $DEV
tc qdisc del dev $DEV root
### IPTABLES RULES ###
P2P_IP=192.168.0.100
SSH_PORT=9000
iptables -t mangle -A FORWARD -s $P2P_IP -o $DEV -j MARK --set-mark 1
iptables -t mangle -A OUTPUT -o $DEV -p tcp --sport $SSH_PORT -j MARK --set-mark 2
iptables -t mangle -A POSTROUTING -o $DEV -s ! $P2P_IP -m length --length :64 -j MARK --set-mark 3
### CLASES ###
SSH=1:10
P2P=1:20
ACK=1:40
DEF=1:30
## HERE I USE $PARENT_RATE TO LIMIT BORROWING FROM P2P CLASS FROM PARENT, AND I PUT $MAX_RATE FOR LOW PRIO CLASSES SO THEY ALWAYS GET THE RATE THEY NEED (THIS TRICK SEEMS TO HELP) ##
MAX_RATE=25kbps
PARENT_RATE=10kbps
P2P_UP=10kbps
tc qdisc add dev $DEV root handle 1: htb default 30
tc class add dev $DEV parent 1: classid 1:1 htb rate $PARENT_RATE burst 6k cburst 3k
tc class add dev $DEV parent 1:1 classid $P2P htb rate $P2P_UP ceil $P2P_UP burst 1k cburst 1k prio 2
tc class add dev $DEV parent 1:1 classid $SSH htb rate 5kbps ceil 10kbps burst 6k cburst 3k prio 0
## Is this really needed?
tc class add dev $DEV parent 1:1 classid $ACK htb rate $MAX_RATE ceil $MAX_RATE burst 6k cburst 3k prio 0
## DEFAULT CLASS
tc class add dev $DEV parent 1:1 classid $DEF htb rate $MAX_RATE ceil $MAX_RATE burst 6k cburst 3k prio 1
### Se agregan qdisc sfq para garantizar un manejo de ancho de banda justo ###
tc qdisc add dev $DEV parent $SSH handle 10: sfq perturb 10
tc qdisc add dev $DEV parent $DEF handle 30: sfq perturb 10
tc qdisc add dev $DEV parent $P2P handle 20: sfq perturb 10
### Filtros para controlar el trafico marcado (especificamente, P2P y SSH)
iptables -t mangle -A FORWARD -o $DEV -s $P2P_IP -m mark --mark 1 -j CLASSIFY --set-class $P2P
iptables -t mangle -A OUTPUT -o $DEV -s ! $P2P_IP -m mark --mark 2 -j CLASSIFY --set-class $SSH
iptables -t mangle -A POSTROUTING -o $DEV -s ! $P2P_IP -m mark --mark 3 -j CLASSIFY --set-class $ACK
[-- Attachment #3: Type: text/plain, Size: 143 bytes --]
_______________________________________________
LARTC mailing list
LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc
^ permalink raw reply [flat|nested] 3+ messages in thread
* [LARTC] Help with HTB rules (experiencing latency)
2007-03-03 19:39 [LARTC] Help with HTB rules (experiencing latency) Edgar Merino
2007-03-03 19:48 ` Edgar Merino
@ 2007-03-04 19:15 ` Edgar Merino
1 sibling, 0 replies; 3+ messages in thread
From: Edgar Merino @ 2007-03-04 19:15 UTC (permalink / raw)
To: lartc
[-- Attachment #1: Type: text/plain, Size: 577 bytes --]
Hello, I'm using these rules (attached) to control traffic going out
from ip 192.168.0.100 which is acting as a p2p server, but when I have
these rules on and mldonkey running I experience some latency in web
pages, which Iwould like to eliminate. I've read that this is where the
burst and cburst (even quantum) parameters are useful, but I still can't
understand crearly how to set them (there are few examples using up
rates of ~25kb/s), I hope you can check my rules and give me a hint on
what to do.
Soluciones en español también aceptadas.
Edgar Merino
[-- Attachment #2: layer7ru.txt --]
[-- Type: text/plain, Size: 2142 bytes --]
#!/bin/sh
### Dispositivo de upload (externo) ###
DEV=eth0
### Bajar la cola the $DEV y el MTU###
ip link set dev $DEV qlen 30
ip link set dev $DEV mtu 1000
### BORRADO DE REGLAS Y CADENAS de la tabla mangle ###
iptables -t mangle -F
iptables -t mangle -X
## BORRADO DE ROOT QDISC EN $DEV
tc qdisc del dev $DEV root
### IPTABLES RULES ###
P2P_IP=192.168.0.100
SSH_PORT=9000
iptables -t mangle -A FORWARD -s $P2P_IP -o $DEV -j MARK --set-mark 1
iptables -t mangle -A OUTPUT -o $DEV -p tcp --sport $SSH_PORT -j MARK --set-mark 2
iptables -t mangle -A POSTROUTING -o $DEV -s ! $P2P_IP -m length --length :64 -j MARK --set-mark 3
### CLASES ###
SSH=1:10
P2P=1:20
ACK=1:40
DEF=1:30
## HERE I USE $PARENT_RATE TO LIMIT BORROWING FROM P2P CLASS FROM PARENT, AND I PUT $MAX_RATE FOR LOW PRIO CLASSES SO THEY ALWAYS GET THE RATE THEY NEED (THIS TRICK SEEMS TO HELP) ##
MAX_RATE=25kbps
PARENT_RATE=10kbps
P2P_UP=10kbps
tc qdisc add dev $DEV root handle 1: htb default 30
tc class add dev $DEV parent 1: classid 1:1 htb rate $PARENT_RATE burst 6k cburst 3k
tc class add dev $DEV parent 1:1 classid $P2P htb rate $P2P_UP ceil $P2P_UP burst 1k cburst 1k prio 2
tc class add dev $DEV parent 1:1 classid $SSH htb rate 5kbps ceil 10kbps burst 6k cburst 3k prio 0
## Is this really needed?
tc class add dev $DEV parent 1:1 classid $ACK htb rate $MAX_RATE ceil $MAX_RATE burst 6k cburst 3k prio 0
## DEFAULT CLASS
tc class add dev $DEV parent 1:1 classid $DEF htb rate $MAX_RATE ceil $MAX_RATE burst 6k cburst 3k prio 1
### Se agregan qdisc sfq para garantizar un manejo de ancho de banda justo ###
tc qdisc add dev $DEV parent $SSH handle 10: sfq perturb 10
tc qdisc add dev $DEV parent $DEF handle 30: sfq perturb 10
tc qdisc add dev $DEV parent $P2P handle 20: sfq perturb 10
### Filtros para controlar el trafico marcado (especificamente, P2P y SSH)
iptables -t mangle -A FORWARD -o $DEV -s $P2P_IP -m mark --mark 1 -j CLASSIFY --set-class $P2P
iptables -t mangle -A OUTPUT -o $DEV -s ! $P2P_IP -m mark --mark 2 -j CLASSIFY --set-class $SSH
iptables -t mangle -A POSTROUTING -o $DEV -s ! $P2P_IP -m mark --mark 3 -j CLASSIFY --set-class $ACK
[-- Attachment #3: Type: text/plain, Size: 143 bytes --]
_______________________________________________
LARTC mailing list
LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2007-03-04 19:15 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-03-03 19:39 [LARTC] Help with HTB rules (experiencing latency) Edgar Merino
2007-03-03 19:48 ` Edgar Merino
2007-03-04 19:15 ` Edgar Merino
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.