Linux Advanced Routing and Traffic Control list
 help / color / mirror / Atom feed
From: "Luciano" <luciano@elo.com.br>
To: lartc@vger.kernel.org
Subject: RES: [LARTC] Backlog with less rate than defined
Date: Tue, 25 Apr 2006 19:20:13 +0000	[thread overview]
Message-ID: <002001c6689d$49b439a0$0900fe0a@LucianoNotebook> (raw)

[-- 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

             reply	other threads:[~2006-04-25 19:20 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-25 19:20 Luciano [this message]
2006-04-25 23:16 ` RES: [LARTC] Backlog with less rate than defined Andy Furniss

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='002001c6689d$49b439a0$0900fe0a@LucianoNotebook' \
    --to=luciano@elo.com.br \
    --cc=lartc@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox