* RES: [LARTC] Backlog with less rate than defined
@ 2006-04-25 19:20 Luciano
2006-04-25 23:16 ` Andy Furniss
0 siblings, 1 reply; 2+ messages in thread
From: Luciano @ 2006-04-25 19:20 UTC (permalink / raw)
To: lartc
[-- Attachment #1: Type: text/plain, Size: 2089 bytes --]
Hi Andy,
I´m not sure if I understood what you told about arp packets.
I use htb default but the problem occurs even when the default queue
rate is low (it is almost always low in rate and pps).
The attached files are:
Rc.local - criation of the basic queues including default
Regras.inc - criation of each queue when the user login
Queues - statistics of the basic queues
Thanks for help,
Luciano
-----Mensagem original-----
De: Andy Furniss [mailto:andy.furniss@dsl.pipex.com]
Enviada em: segunda-feira, 24 de abril de 2006 20:33
Para: Luciano
Cc: lartc@mailman.ds9a.nl; Jader@elo.com.br
Assunto: Re: [LARTC] Backlog with less rate than defined
Luciano wrote:
> Hi all,
>
> I setup a Linux machine to act as Lan Authentication server. So, the
> same script that redirect the http connection to a login web page, it
> create some queues to limit traffic, login by login.
>
> The PC uses only 1 ethernet interface that receive the packets source
> routed to it and forward/nat to the external gateway using the same
> interface.
>
> For each login I create a queue like that:
>
> tc class add dev '.$if_externa.' parent 1:1 classid 1:'.$filaDown.'
htb
> rate '.$banda_down.'kbit ceil '.$banda_down.'kbit prio 1'
> tc filter add dev $if_externa protocol ip parent 1:0 prio 1 handle
> ::$filaDown u32 match ip dst $ipcliente/32 flowid 1:$filaDown
>
> My problem is that most of the queues created does NOT get full rate
as
> defined. I can see the packets entering backlog with much less rate
than
> defined, ex:
>
> class htb 1:b1 parent 1:1 prio 1 rate 256Kbit ceil 256Kbit burst 1926b
> cburst 1926b
> Sent 6644151 bytes 5435 pkts (dropped 0, overlimits 0)
> rate 669bps backlog 107p
Htb rate average can be quite long and misleading.
I would tcpdump and see whether the rate looks OK with that.
If not see what the dequeue behaviour is - you don't show all your
rules, if you are using htb default class on root and shaping eth
remember arp will get delayed there unless you filter it elsewhere.
Andy.
[-- Attachment #2: regras.inc --]
[-- Type: application/octet-stream, Size: 914 bytes --]
<?php
## Varíaveis da limitação de banda
# $banda_down
# $banda_up
# $ppp = porta do ip roteavel
# $ipcliente = endereco ip do cliente
$filaDown=dechex((2*$ppp)-1);
$filaUp=dechex(2*$ppp);
$ip_servidor='200.249.166.135';
$if_interna='eth0';
$if_externa='eth0';
// Criacao da fila de upload
$script[]='tc class add dev '.$if_externa.' parent 1:1 classid 1:'.$filaUp.' htb rate '.$banda_up.'kbit ceil '.$banda_up.'kbit prio 1';
$script[]="tc filter add dev $if_externa protocol ip parent 1:0 prio 1 handle ::$filaUp u32 match ip src $nat/32 flowid 1:$filaUp";
// Criacao da fila de download
$script[]='tc class add dev '.$if_externa.' parent 1:1 classid 1:'.$filaDown.' htb rate '.$banda_down.'kbit ceil '.$banda_down.'kbit prio 1';
$script[]="tc filter add dev $if_externa protocol ip parent 1:0 prio 1 handle ::$filaDown u32 match ip dst $ipcliente/32 flowid 1:$filaDown";
[-- Attachment #3: queues --]
[-- Type: application/octet-stream, Size: 1283 bytes --]
========================
Fila geral
class htb 1:1 root rate 100000Kbit ceil 100000Kbit burst 129587b cburst 129587b
Sent 16673062596 bytes 41581335 pkts (dropped 0, overlimits 0)
rate 396521bps 852pps
lended: 0 borrowed: 0 giants: 0
========================
Enderecos conectados
class htb 1:5 parent 1:1 leaf 5: prio 1 rate 1000Kbit ceil 1000Kbit burst 2879b cburst 2879b
Sent 777900 bytes 7679 pkts (dropped 0, overlimits 0)
rate 51bps
lended: 7679 borrowed: 0 giants: 0
========================
Nat
class htb 1:6 parent 1:1 leaf 6: prio 1 rate 5000Kbit ceil 5000Kbit burst 7999b cburst 7999b
Sent 132176418 bytes 1432427 pkts (dropped 0, overlimits 0)
rate 3616bps 15pps
lended: 1432427 borrowed: 0 giants: 0
========================
Maquinas internas
class htb 1:7 parent 1:1 leaf 7: prio 1 rate 1000Kbit ceil 1000Kbit burst 2879b cburst 2879b
Sent 0 bytes 0 pkts (dropped 0, overlimits 0)
lended: 0 borrowed: 0 giants: 0
tokens: 23040 ctokens: 23040
========================
Fila Padrao
class htb 1:efff parent 1:1 leaf efff: prio 1 rate 1Mbit ceil 1Mbit burst 2909b cburst 2909b
Sent 1113213839 bytes 9059857 pkts (dropped 61529, overlimits 0)
rate 1130bps 13pps
lended: 9059857 borrowed: 0 giants: 0
[-- Attachment #4: rc.local --]
[-- Type: application/octet-stream, Size: 1957 bytes --]
#!/bin/sh -x
tc qdisc del dev eth0 root handle 1: htb
tc qdisc del dev eth0 handle ffff: ingress
tc qdisc add dev eth0 root handle 1: htb default efff
tc qdisc add dev eth0 handle ffff: ingress
tc class add dev eth0 parent 1: classid 1:1 htb rate 100000kbit ceil 100000kbit
####
# Trafego do donald para clientes conectados
tc class add dev eth0 parent 1:1 classid 1:0005 htb rate 1000kbit ceil 1000kbit prio 1
tc qdisc add dev eth0 parent 1:5 handle 5: sfq perturb 10
tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32 match ip dst 200.241.84.8/32 flowid 1:5
tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32 match ip dst 200.241.84.2/32 flowid 1:5
tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32 match ip sport 80 0xffff match ip src 200.249.166.132/32 flowid 1:5
####
# Trafego de saida - ips do nat para fora e de retorno
tc class add dev eth0 parent 1:1 classid 1:0006 htb rate 5000kbit ceil 5000kbit prio 1
tc qdisc add dev eth0 parent 1:6 handle 6: sfq perturb 10
tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32 match ip src 200.249.86.128/27 flowid 1:6
tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32 match ip dst 200.249.86.128/27 flowid 1:6
####
# Trafego de saida - enderecos nao conectados
tc class add dev eth0 parent 1:1 classid 1:0007 htb rate 1000kbit ceil 1000kbit prio 1
tc qdisc add dev eth0 parent 1:7 handle 7: sfq perturb 10
tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32 \
match ip src 200.249.166.135/32
match ip sport 80 0xffff flowid 1:7
tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32 \
match ip src 200.249.166.135/32
match ip sport 443 0xffff flowid 1:7
tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32 match ip sport 22 0xffff flowid 1:7
####
# Fila padrao
tc class add dev eth0 parent 1:1 classid 1:efff htb rate 1024kbit ceil 1024kbit prio 1
tc qdisc add dev eth0 parent 1:efff handle efff: sfq perturb 10
[-- Attachment #5: 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] 2+ messages in thread
* Re: RES: [LARTC] Backlog with less rate than defined
2006-04-25 19:20 RES: [LARTC] Backlog with less rate than defined Luciano
@ 2006-04-25 23:16 ` Andy Furniss
0 siblings, 0 replies; 2+ messages in thread
From: Andy Furniss @ 2006-04-25 23:16 UTC (permalink / raw)
To: lartc
Luciano wrote:
> Hi Andy,
>
> I´m not sure if I understood what you told about arp packets.
> I use htb default but the problem occurs even when the default queue
> rate is low (it is almost always low in rate and pps).
It's still not ideal even if it's not the cause - sfq default length is
128 packets so if they were mtu size when it's full thats 1.5sec delay +
drops - and the stats show drops.
class htb 1:efff parent 1:1 leaf efff: prio 1 rate 1Mbit ceil 1Mbit
burst 2909b cburst 2909b
Sent 1113213839 bytes 9059857 pkts (dropped 61529, overlimits 0)
rate 1130bps 13pps
lended: 9059857 borrowed: 0 giants: 0
I would not use default on eth. Also 100mbit eth is not 100mbit at ip
level, which is almost what htb sees (ip+14), so 1:1 needs to be less -
but if children don't add up to that then it won't hurt.
You could just send all unmatched ip to 1:efff with a low prio filter -
tc filter add dev eth0 protocol ip parent 1:0 prio 99 u32 match u32 0 0
flowid 1:efff
then arp will not get shaped.
I notice you use handle on filters maybe OK but I usually only see it
with hashing or fw.
>
> The attached files are:
> Rc.local - criation of the basic queues including default
> Regras.inc - criation of each queue when the user login
> Queues - statistics of the basic queues
Have you measured the rate another way?
Andy.
_______________________________________________
LARTC mailing list
LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2006-04-25 23:16 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-04-25 19:20 RES: [LARTC] Backlog with less rate than defined Luciano
2006-04-25 23:16 ` Andy Furniss
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.