Linux Netfilter discussions
 help / color / mirror / Atom feed
From: Julien Vehent <julien@linuxwall.info>
To: "Grégoire Leroy" <gregoire.leroy@hyperthese.net>
Cc: netfilter@vger.kernel.org
Subject: Re: Fair queuing with htb
Date: Thu, 23 Dec 2010 01:01:05 -0500	[thread overview]
Message-ID: <e9bfeb9388be8dfecf83abe056c3d8fc@localhost> (raw)
In-Reply-To: <201012230226.31297.gregoire.leroy@hyperthese.net>

On Thu, 23 Dec 2010 02:26:21 +0100, Grégoire Leroy <gregoire.leroy@hyperthese.net> wrote:
> Hello,
> 
> I try to make fair queuing with htb for the http protocol but my filters seem
> doesn't work.
> 
> The packets are marked by Squid (tcp_outgoing_mark, a feature of the latest 
> version of squid enables this).
> 
> I have verified in the iptables logs that the packet are really marked. Here 
> an example :
> 
> Dec 22 22:05:05 batman kernel: [1494086.818746] IN= OUT=eth0 SRC=172.17.0.8 
> DST=172.17.0.10 LEN=60 TOS=0x00 PREC=0x00 TTL=64 ID=65025 DF PROTO=TCP 
> SPT=40407 DPT=80 WINDOW=5840 RES=0x00 SYN URGP=0 MARK=0x1
> 
> It seems work inasmuch as we can see "MARK=0x1".
> 
> Below I paste my script. The relevant point is the filters : indeed, whatever
> the way I configure the class 1:20 and 1:10, it changes nothing.
> 
> Have I done a misconfiguration ?
> 
> I precise my server uses Debian Squeeze i386, and libnetfilter-conntrack3 is 
> installed.
> 
> #!/bin/bash
> INT="eth0"
> BAND="12000kbit"
> RATE="63kbit"
> 
> tc qdisc del dev $INT root
> tc qdisc add dev $INT root handle 1: htb default 30
> 
> tc class add dev $INT parent 1: classid 1:1 htb rate 100mbit burst 15k 
> tc class add dev $INT parent 1:1 classid 1:10 htb rate 63kbit ceil 1200kbit 
> burst 15k 
> tc class add dev $INT parent 1:1 classid 1:30 htb rate 88mbit burst 15k 
> tc class add dev $INT parent 1:1 classid 1:20 htb rate $RATE ceil $RATE burst
> 15k 
> 
> tc filter add dev $INT parent 1:0 protocol ip handle 0x1 fw flowid 1:10
> tc filter add dev $INT protocol ip handle 0x55 fw flowid 1:20
> 

Not sure about the handle 0x1. I usually only use the decimal value.

Try the following filters:

tc filter add dev $INT parent 1:0 protocol ip prio 1 handle 1 fw flowid 1:10
tc filter add dev $INT parent 1:0 protocol ip prio 2 handle 55 fw flowid 1:20


and check your filters and classes with the following commands:

# tc -s filter show dev eth0
# tc -s class show dev eth0

Julien

  reply	other threads:[~2010-12-23  6:01 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-23  1:26 Fair queuing with htb Grégoire Leroy
2010-12-23  6:01 ` Julien Vehent [this message]
2010-12-23 12:30   ` Grégoire Leroy
2010-12-25  0:09     ` Andrew Beverley
2010-12-25  1:08       ` Grégoire Leroy
2010-12-25  2:41         ` Antoine Souques
     [not found]         ` <4D155860.6090507@via.ecp.fr>
2010-12-25  3:51           ` Grégoire Leroy
2010-12-25 12:29             ` Amos Jeffries
2010-12-25 20:40               ` Grégoire Leroy
2010-12-25 22:46             ` Andrew Beverley
2011-01-10 11:55               ` Grégoire Leroy

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=e9bfeb9388be8dfecf83abe056c3d8fc@localhost \
    --to=julien@linuxwall.info \
    --cc=gregoire.leroy@hyperthese.net \
    --cc=netfilter@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