Howto shape or restrict bandwidth under Linux / UNIX / BSD

by on April 13, 2007 · 2 comments· LAST UPDATED October 27, 2009

in , ,

There is a program called trickle. It is a portable lightweight userspace bandwidth shaper. It can run in collaborative mode (together with trickled) or in stand alone mode.

trickle works by taking advantage of the unix loader preloading. Essentially it provides, to the application, a new version of the functionality that is required to send and receive data through sockets. It then limits traffic based on delaying the sending and receiving of data over a socket. trickle runs entirely in userspace and does not require root privileges.

From the article:

Trickle is a lightweight userspace bandwidth shaper for users with low-speed Internet connections that lets you limit the bandwidth that a specific protocol is using so that you can maintain multiple simultaneous connections and not end up in a traffic jam.

Any user on the system can run Trickle without needing administrative privileges. The software can handle only TCP stream connections, so it cannot shape traffic for network services that uses UDP stream connections, such as DNS (Bind) and TFTP. Actually, it cannot work with all network services that use TCP streams; because trickle uses the dynamic linker and loader, it can handle only network services that uses dynamic libraries (glibc) and not any programs that are statically linked. You can check whether a network service or command uses dynamic libraries with help of the ldd command, which prints shared library dependencies, so that you can see exactly what libraries are used with the specific command. For example to check whether FTP uses dynamic libraries:

Read more: Shape your traffic with trickle [Linux.com]

TwitterFacebookGoogle+PDF versionFound an error/typo on this page? Help us!

{ 2 comments… read them below or add one }

1 Derek May 10, 2007 at 7:16 pm

Um. wget has a –limit option.

Reply

2 Ultra August 17, 2007 at 2:22 am

“Um. wget has a –limit option.”

If you just use the -limit option with wget, each wget will instance will suck up that much bandwidth. With trickle you can limit the total bandwidth of all the wget’s together…get it?

Reply

Leave a Comment

Tagged as: , , , , , , , , , , , , , , , , , ,

Previous post:

Next post: