Group: comp.os.linux.networking
From: buck
Date: Wednesday, March 05, 2008 12:47 PM
Subject: Re: Rate limiting (old way and new)

On Mon, 3 Mar 2008 12:42:21 -0800, "D. Stussy"
wrote:

>Under the old way (using a "shaper#" pseudo-network-device), all one had to
>do was to attach it, set the desired speed/maximum bandwidth, then route the
>desired destination address(es) through it. The new way uses the "tc"
>program from the iproute2 package. I have searched for examples on how to
>do this with "tc" and have found some, but am still unclear. The manual
>page for "tc" doesn't seem to list all the permutations (or options) of the
>command, nor does it really explain what the different queueing disciplines
>are. I also don't fully follow what the "classes" are and why they're
>needed. The filter subsystem makes sense but also isn't fully explained. I
>would have liked to have found an example of the old, depreciated "shaper0"
>interface and its comparable "tc" setup but such has eluded me.
>
>Where's a GOOD resource that explains ALL the workings of "tc"?

My opinion: Where is good documentation for anything in Linux?
Programmers are poor authors and good authors usually have no clue
what a program really does.

>The resources I printed so far are:
>http://linux.die.net/man/8/tc-tbf
>http://www.linuxdocs.org/HOWTOs/Adv-Routing-HOWTO-14.html
>http://www.topwebhosts.org/tools/traffic-control.php
>http://www.linux.org/docs/ldp/howto/Adv-routing-HOWTO/lartc.ratelimit.single.html
>
>None of these explain why I need to state the bandwidth for the main device
>in the qdisc line. If the value is really used, I have an added
>complication of that I cannot necessarily determine the value that will be
>used for an ethernet interface (it's a 100Mbit, but the colocation provider
>sometimes attaches a slower ethernet segment (10Mbit or effective 20Mbit as
>10 full-duplex)). I could just follow the examples, but they're meaningless
>unless I understand what they're doing.

I think you're looking in the wrong place. For simple rate limiting,
check iptables.

TC has no decent docs. You have found what there is. Your situtation
prevents the use of a queueing discipline because these only work when
the available bitrate has an absolute maximum that never varies.
--
buck

Safety Articles | Usenet Groups | Usenet News | Bluegrass