Linux Advanced Routing and Traffic Control list
 help / color / mirror / Atom feed
From: Andy Furniss <lists@andyfurniss.entadsl.com>
To: lartc@vger.kernel.org
Subject: Re: [LARTC] simple tbf rate clamping issues
Date: Wed, 22 Aug 2007 23:13:12 +0000	[thread overview]
Message-ID: <46CCC308.10709@andyfurniss.entadsl.com> (raw)
In-Reply-To: <46CBD872.6060307@bloodwolf.org>

sting wrote:
> Hello,
> 
> I was attempting to throttle egress traffic to a specific rate using a 
> tbf.  As  a starting point I used an example from the LARTC howto, which 
> goes:
> 
> tc qdisc add dev eth1 root tbf rate 220kbit latency 50ms burst 1540

It's not the best example as latency is a way of setting buffer 
length(limit) and 50ms @ 220kbit is < 1500 bytes. If you set < 1514/1518 
explicitly with limit you would not pass bulk packets at all. I guess it 
rounds it up a bit if you use latency.
> 
> I then attempt a large fetch from another machine via wget (~40 megs) 
> and the rate was clamped down to about 12Kbytes/s.  As this seemed too 
> much, I gradually increased the latency up to 200ms which then gave me 
> the expected results (~34Kbytes/s).

I would expect that, tcp doesn't like one packet/short buffers, and it's 
even worse on a lan than a wan as (linux?)tcp behaves differently when 
it detects low latenccy.

> 
> I then applied this queuing discipline on a machine acting as a 
> gateway/router for a few VLANed subnets.  The tbf was applied on 
> interface eth1.615.  From another workstation I attempted a wget, and so 
> the traffic had to go through the gateway/router.  The download rate 
> went from 16 Mbytes/s down to about 1.6 Mbytes/s, but was much much 
> higher than what I'm trying to clamp it down to.

I just tested a tbf on a vlan and it seems OK - if you see 1.6 Mbytes 
and tbf is 220kbit maybe you are shaping in the wrong direction and just 
getting the acks? (OK I am just guessing here)

What does tc -s qdisc ls dev eth1.615 say?

> 
> Two questions:
> 1/ My main question. AFAIK, queuing disciplines affect egress traffic 
> whether that traffic originates from the host or is being forwarded. 
> Assuming that the fact the tbf is mostly meant to be applied to 
> forwarded traffic is not an issue, *is there anything else that could 
> cause the transfer rate not to be correctly clamped down?*  What 
> parameters should I be playing with?

One possible difference, though it's probably not your problem.

If you have a nic that does tcp segmentation offload, then locally 
generated traffic may go through as supersize "packets" which makes htb 
go over rate. I am not sure what tbf would do - maybe just drop them if 
the buffer is not long enough.

> 
> 2/ I'm assuming the first example I quoted must have worked as described 
> when the HOWTO was initially written a few years ago.  In any case, i am 
> assuming with 50ms max latency outgoing packets could not be held long 
> enough in the tbf and had to be droppd, correct?

Yep, also that example was on a ppp wan IIRC.

If you put anything on the root of eth/vlan you need to remember that 
you are going to be catching arp aswell as ip traffic.

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

      parent reply	other threads:[~2007-08-22 23:13 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-22  6:32 [LARTC] simple tbf rate clamping issues sting
2007-08-22 11:07 ` Bryan Schenker
2007-08-22 18:01 ` sting
2007-08-22 18:55 ` sting
2007-08-22 19:53 ` Bryan Schenker
2007-08-22 20:15 ` Bryan Schenker
2007-08-22 23:13 ` Andy Furniss [this message]

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=46CCC308.10709@andyfurniss.entadsl.com \
    --to=lists@andyfurniss.entadsl.com \
    --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