All of lore.kernel.org
 help / color / mirror / Atom feed
From: John Default <default@advaita.sytes.net>
To: lartc@vger.kernel.org
Subject: Re: [LARTC] Unexpected results using HTB qdisc
Date: Mon, 19 Nov 2007 21:49:03 +0000	[thread overview]
Message-ID: <474204CF.60205@advaita.sytes.net> (raw)
In-Reply-To: <BAY134-W44308D4B1534E9481DF75DBC7E0@phx.gbl>

Hi

Stuart Clouston wrote:
> Hi All,
>
> I am using the script below to limit download rates and manage traffic for a certain IP address and testing the results using iperf.  The rate that iperf reports is much higher than the rate I have configured for the HTB qdisc.  It's probably just some newbie trap that's messing things up but I'm buggered if I can see it.
>
>  The following script is run on the server (192.168.10.30):  (I have simplified it and removed all of the ceil parameters during my troubleshooting process)
>   
it think you should have not removed ceiling parameters : )
> # Remove any existing qdisc
> tc qdisc del dev eth0 root handle 1:
>
> # Root queueing discipline
> tc qdisc add dev eth0 root handle 1: htb default 10
>
> # Root class
> tc class add dev eth0 parent 1: classid 1:1 htb rate 100mbit burst 1500 ceil 100mbit
>
> # Default class
> tc class add dev eth0 parent 1:1 classid 1:10 htb rate 30mbit ceil 100mbit burst 1500
>
> # Rate limited classes
> tc class add dev eth0 parent 1:1 classid 1:4 htb rate 300kbit
>   
> tc class add dev eth0 parent 1:4 classid 1:40 htb rate 50kbit
>   
You should use ceil here right after rate, otherwise the class can 
borrow from its parent class and therefore your overall traffic will be 
shaped in correct proportion but not absolutely (i.e to proper bandwidth)
Once you set ceil value, the class will not get any more throughput even 
if the link is free...

> tc class add dev eth0 parent 1:4 classid 1:41 htb rate 50kbit
> tc class add dev eth0 parent 1:4 classid 1:42 htb rate 200kbit
>
> tc qdisc add dev eth0 parent 1:40 handle 40: sfq perturb 10
> tc qdisc add dev eth0 parent 1:41 handle 41: sfq perturb 10
> tc qdisc add dev eth0 parent 1:42 handle 42: sfq perturb 10
>
> # Filters to direct traffic to the right classes:
>
> U32="tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32"
> $U32 match ip dst 192.168.10.85 match ip sport 3389 0xffff flowid 1:42
> $U32 match ip dst 192.168.10.85 match ip sport 1352 0xffff flowid 1:41
> $U32 match ip dst 192.168.10.85 flowid 1:40
>
>
>
> The client (192.168.10.85) then runs iperf to test the results:
>
> iperf -c 192.168.10.30 -p 1352 -P 5 -f k
> [SUM]  0.0-11.4 sec  3016 KBytes  2163 Kbits/sec
>
> iperf -c 192.168.10.30 -p 23 -P 5 -f k
> [SUM]  0.0-11.4 sec  2856 KBytes  2053 Kbits/sec
>
> iperf -c 192.168.10.30 -p 3389 -P 5 -f k
> [SUM]  0.0-10.3 sec  11264 KBytes  8956 Kbits/sec
>
>
> The traffic is being shaped proportially as I'd hoped but each class is well in excess of its configured limit.  
>
> I am getting similar results on two separate units:
> 1: Debian (testing), Kernel v2.6.16.19, iproute2 ss070313
> 2: Ubuntu (dapper), Kernel v2.6.23.1, iproute2 ss041019
>
> I'd be very grateful for any information that could help me out.
> Thanks,
> Stu  (newbie to HTB)
> _________________________________________________________________
>
>   
I am newbie too, so if i am wrong please someone correct me.

-- 
___________________________________
S pozdravom / Best regards

John Default


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

  reply	other threads:[~2007-11-19 21:49 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-19  7:26 [LARTC] Unexpected results using HTB qdisc Stuart Clouston
2007-11-19 21:49 ` John Default [this message]
2007-11-19 23:31 ` Stuart Clouston
2007-11-23  3:01 ` Stuart Clouston
2007-11-23 13:50 ` Mario Antonio Garcia
2007-11-28 13:40 ` Mario Antonio Garcia

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=474204CF.60205@advaita.sytes.net \
    --to=default@advaita.sytes.net \
    --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 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.