Bandwidth throttling

Ben Scott dragonhawk at gmail.com
Mon May 7 13:29:59 EDT 2007


On 5/7/07, Michael ODonnell <michael.odonnell at comcast.net> wrote:
> I guess we could use a managed switch that allows us to
> throttle connections (traffic shaping?)  on a per-port basis ...

  I'd suggest a Linux box between the destination server and the
clients, running traffic shaping, and configured to rate-limit the
number of packets coming in from the clients.  I'd do this because
it's what I've played with before, not because it's necessarily the
best thing.  "When all you have is a hammer..."

  More info, including detailed HOWTO, at the "Linux Advanced Routing
& Traffic Control" site:

http://lartc.org/

  A word of warning: This can be a surprising tricky thing.  On
routers/forwarders, you can only do two things to control the flow of
packets: Queue them up and/or discard them.  On the originating host,
you can also block the send() socket call.  But once a packet is in
existence, your can only queue or discard.  Also: Never forget that IP
is stateless and one-way-only.  (TCP keeps state, but the IP layer
cares not about it.)  So receiving is the same process as sending,
just from a different POV.

> For example, I see some Debian packages that look interesting:
>
>  shapecfg     - Bandwidth limiter for virtual network interfaces

  I believe the above is the package which contains the actual utility
used to configure the kernel traffic-shaping support (analogous to
ifconfig for basic IP configuration).

>  shaper       - Traffic shaper init script (cbq.init) for Linux
>  shaperd      - A user-mode traffic shaper for tcp-ip networks
>  swh-plugins  - Steve Harris's LADSPA plugins
>  trickle      - user-space bandwidth shaper
>  wondershaper - Easy to use traffic shaping script

  The above would appear to be either front-ends and configuration
automation for the kernel shaper, or something completely unrelated
(e.g., I'd guess shaperd is a TCP port forwarding proxy which does
rate limiting).

-- Ben


More information about the gnhlug-discuss mailing list