linux network traffic shaping/prioritization

Replies:

Parents:

  • None.
I just saw this interesting diary entry on traffic shaping: how to
prioritize your network traffic to make interactive sessions more
responsive, etc. I have been wondering how to do this for years
(well, not wondering enough to actually look into it.)

http://www.advogato.org/person/walken/diary.html?start=27

> 10 Dec 2001
>
> Played a bit with traffic shaping over the weekend. I'm on a cable
> modem, and without shaping frames go out of my computer at 10Mbit/s
> and get buffered into the cable modem before they get to the
> 128Kbit/s uplink, which results in very bad lag whenever I upload
> anything.
>
> I had never played with this before, and I was amazed how much it
> helps. Now my telnets never get lagged at all, and the reduced
> latency also seems to help when I do some downloads. If people are
> interested, I would recommand them to use:
>
> "tbf" for the basic shaping - making sure we do not overfill the
> modem's internal buffers. I did that with "tc qdisc add dev eth0
> root handle 1: tbf rate 120kbit burst 2000 mpu 128 limit 100000".
> I would recommend people to use the tbf patch from
> http://luxik.cdi.cz/~devik/qos/qos.htm - it allows you to put
> additional shaping disciplines "inside" of the tbf shaper. (I dont
> know if its still required if you run 2.4 - I'm still running a 2.2
> kernel)
>
> "prio" works good enough to do the prioritization, based on the
> Type Of Service field of the IP headers. Most linux applications
> set it correctly, so you dont have to scratch your head too hard to
> prioritize your packets. If I was doing a gateway for windows
> machines I guess my life would be harder though. For now, I just
> did "tc qdisc add dev eth0 parent 1:1 handle 2: prio". interactive
> traffic (telnet, ssh) is prioritized over control traffic (dns,
> ping, netscape apparently ends up there too), and the lowest
> priority is bulk data (wget, scp, ftp, fetchmail, ...)

hmm... how about when I back up my computer using rsync over ssh?
I want that to have the lowest possible priority; I wonder how
much trouble that would be.

> "sfq" tries to make the shaping more fair - so that if in the same
> priority band you transfer files to different places at the same
> time, they will get roughly equivalent amounts of bandwidth, even
> if one is far away with more ping delay and stuff. [...]
:

(I haven't tried any of this yet.)

--
Gerald Oskoboiny <[email protected]>
http://impressive.net/people/gerald/

Re: linux network traffic shaping/prioritization

Replies:

  • None.

Parents:

On Tue, Jul 16, 2002 at 02:07:44AM -0400, Gerald Oskoboiny wrote:
> I just saw this interesting diary entry on traffic shaping: how to
> prioritize your network traffic to make interactive sessions more
> responsive, etc. I have been wondering how to do this for years
> (well, not wondering enough to actually look into it.)
>
> http://www.advogato.org/person/walken/diary.html?start=27

Here's some related stuff on slashdot:

http://ask.slashdot.org/article.pl?sid=02/07/18/2249211&mode=thread&tid=109&threshold=3

> Traffic Shaping on DSL?
> Posted by Cliff on Thursday July 18, @09:46PM
>
> jackla asks: "I'm now looking for software to do traffic-control
> on my Windows XP box.
>
> I read alot about the Linux shaping solution (wondershaper or
> something) which sounds exactly right, except I need something
> that works for Windows. [...]

wondershaper? hmm...

http://www.google.com/search?q=wondershaper
-> http://lartc.org/wondershaper/

| The Wonder Shaper
| bert hubert <[email protected]>
| (c) Copyright 2002
| Licensed under the GPL
| Originally part of the Linux Advanced Routing & Shaping HOWTO
|
| Before, without wondershaper, while uploading:
| round-trip min/avg/max = 2041.4/2332.1/2427.6 ms
|
| After, with wondershaper, during 220kbit/s upload:
| round-trip min/avg/max = 15.7/51.8/79.9 ms
|
| * Download version 1.1a, released 16th of April 2002.
| * Download version 1.0, released 5th of March 2002.
|
| Works on Linux 2.4 & higher.
:
| Goals
| I attempted to create the holy grail:
|
| * Maintain low latency for interfactive traffic at all times
|
| This means that downloading or uploading files should not disturb
| SSH or even telnet. These are the most important things, even
| 200ms latency is sluggish to work over.
|
| * Allow 'surfing' at reasonable speeds while up or downloading
|
| Even though http is 'bulk' traffic, other traffic should not
| drown it out too much.
|
| * Make sure uploads don't harm downloads, and the other way around
|
| This is a much observed phenomenon where upstream traffic simply
| destroys download speed. It turns out that all this is possible,
| at the cost of a tiny bit of bandwidth. The reason that uploads,
| downloads and ssh hurt eachother is the presence of large queues
| in many domestic access devices like cable or DSL modems.

nifty... will have to try it sometime.

--
Gerald Oskoboiny <[email protected]>
http://impressive.net/people/gerald/

HURL: fogo mailing list archives, maintained by Gerald Oskoboiny