Shaping bandwidth traffic has been a usual part of job function from any IT company infrastructure providing online services to the web. From small scale company to enterprise scale, bandwidth shaping needs to be implemented and applied properly and effectively.
Here's one lightweight linux traffic shaper that makes use of existing network traffic shaping that is part of current linux kernel version.
Trickle article says:
Trickle is a portable lightweight userspace bandwidth shaper. Trickle 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. Trickle 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.
Currently, I found no version of trickle rpm package for Fedora 5,6,7, and Fedora 8. I have been trying to recompile from the tar balls and rebuild from source but still failed. Trickle seems to be referencing library from an old version of libevent.so though my Fedora libevent version is already at Fedora 7. The only trickle version for Fedora is for Fedora Core 1,2,3 and Redhat Ent. 1,2,3 and EL 4.
Here's how I remember managing and installing trickle from my Fedora 8 box.
Trickle Installation on Fedora 8
1. Download the Fedora version here.
# wget -c http://apt.sw.be/fedora/3/en/i386/RPMS.dag/trickle-1.06-0.1.fc3.rf.i386.rpm
2. The above would download trickle version for Fedora 3. After successfully downloading trickle, we would then force install it on Fedora 8 like so:
# rpm -ivh --nodeps trickle-1.06-0.1.fc3.rf.i386.rpm
In Ubuntu:
# sudo apt-get install trickle
Should I be successful on my on my attempt to compile from source, I would be back to share it from here. If you've been successful under F8, do let me know.
Trickle Usage and Binary
Trickle needs not to be root for it to function properly. However, I would be showing trickle examples using my root access below.
# trickle -d 30 wget -c
http://download.fedoraproject.org/pub/fedora/linux/releases/8/Fedora/i386/iso/Fedora-8-i386-DVD.iso
The above downloads Fedora 8 using wget and trickle having a 30K download limit although you could have download limit alone with wget using --limit-rate parameter.
Setting trickle to have a global traffic limits,this can be done like so.
# trickled -d 100 -u 20 -s
The above limits download rate to 100Kbps and the upload limit to 20Kbps.
Trickle handle TCP stream connections only, so handling UDP protocols is not possible yet as of this time. Quite handy on sharing traffic with your office mates utilizing your limited small bandwidth around.
Trickle also has a freshmeat page and requires libevent version 0.6 or higher. Trickle can be found in OpenBSD ports (/usr/ports/net/trickle) and is in Debian Unstable. There is also a package for Debian stable (Woody) here. More rpm package can be found here.
Mae of Google has a nice coverage of trickle found here.
0 comments:
Post a Comment