My home page in the form of a blog.

Bandwidth Shaping for Linux...or "Why does my connection get slow when I download?!"

The following is a great article on how to add a simple traffic-shaping script to improve your home DSL/fiber connection. The set up that I have is one ethernet port dedicated to the ADSL modem and the other to my internal network.

Counterintuitive as it may sound, the solution to the queues is to limit the rate at which information reaches your computer, directly on your computer. By using a clever combination of bandwidth limiting and priorization of outbound packages, you can have almost-normal Web browsing speeds, combined with fast downloads.

In other words:

  • Anything your computer sends to the Internet will be given priorities, and important information will jump the queue. Sends of acknowledgements and interactive traffic (remote desktops, shells) will get priority.
  • If any computer attempts to send data to your computer too quickly, your computer will tell it to slow down. This will avoid the buildup in the queue at your ISP.

Basically, you'll be executing a tradeoff: decreasing latency at the expense of a bit (5% to 10%) of bandwidth, but the cost is certainly worth it.

He then posts a simple script using the Linux command "tc", which effectively shapes the traffic to and from. You can give high priority to certain ports (like SSH, for example) and it's almost like magic! Works really well for me since we were experiencing high latency at my home. Find the article here: http://rudd-o.com/en/linux-and-free-software/mola-my-internet-connection-slows-down-when-i-download-how-can-i-speed-it-up

Comments

I use that script and it

I use that script and it works great. 8-) I also check the current speed of my modem so the script uses the current speed and not some random expected speed. I use a telnet to get in, request the exact speed, and use the result in some of the tc commands.