Better Broadband Bandwidth Utilization Using Wondershaper on a Linux Router to Limit the Uplink
To use Wondershaper, you'll have to use a Linux computer as your router. Afaik, most basic broadband routers don't provide traffic limiting features. Setting up a Linux router for your broadband is not a good first-time Linux project. For more info, perhaps look at http://en.wikipedia.org/wiki/List_of_router_or_firewall_distributions or http://www.stanford.edu/~fenn/linux/ . It's not terribly difficult to do with a standard Ubuntu Server distro, which is what I use.
For me www.speakeasy.net provides a nice testing service at http://www.speakeasy.net/speedtest/ . I can't say whether this will suffice for non-speakeasy users. However, after running this test several times, I settled on a 3621 kbits/sec downlink and a 630 kbits/sec uplink as a baseline.
Then, use whatever traffic shaping tool you have to experiment with throughput at and below those values. The easiest, admittedly blunt knife, tool that I've found is Wondershaper. Wondershaper is available in Ubuntu, i.e.
sudo apt-get install wondershaperAlso, in the Ubuntu docs, you may find http://ubuntuforums.org/archive/index.php/t-25911.html useful...I certainly did.
In my case, with the 3621/630 profile, I tried Wondershaper at 3500/650, 4000/650, 4000/625 and 4000/600. To stress the connection, I tried a series of tests with 1-2 downloads and 0-2 uploads. I used scp to a hosted server of mine that can reliably max out my connection. Scp is nice because it prints out its bandwidth when it's done, or ^C'd. Yes, scp introduces some overhead, and it doesn't measure true "line" bits. The Flash based Speakeasy test uses the Flash plugin, but this isn't rocket science, right? Suffice it to say, there are far bigger holes in my methodology...but time is money, as they say, and I declared "victory" without having to be more precise.
Without getting into details (you can back my inference out of the graphs below) I concluded that my connection is insensitive to downlink shaping, but terribly sensitive to uplink shaping. Without shaping, whenever an upload was going full-bore, I lost 80-90% of my download bandwidth. By throttling uplink to 90-95% of the max, I got a big chunk of that back. With the throttled uplink my downloads only lost 10-30% of their speed, quite an improvement.
No time or space for the rationale, but anyone familiar with the term "TCP Round Trip ACK" can quickly imagine why. See Wikipedia's TCP entry. Better yet, get the Steven's Book, it's one of the best technical books every written, IMHO.
So here's the pretty picture. Bandwidth on the Y axis. My 5 traffic scenarios on the X. And a differently colored line for each shaping scenario. Which would you rather have?

And, even if you don't want to shape your traffic, when your teenager's Youtube upload brings everyones browsing in the house to a crawl, at least you'll know why. Which begs the question: why aren't these features built into home broadband routers or, better yet, into the TCP framework of broadband service providers!?
Postscript: For those interested, a good bit of research has been done on this problem, particularly under the name of FastTCP. http://fastsoft.com is commercial spinoff of that project and has some pertinent white papers on the subject.
Related links
| Wonder Shaper Posted by Rod, on Aug. 6 2009 | |
| Speakeasy - Speed Test Posted by Rod, on Aug. 6 2009 | |
| Linux gateway/router - (another) HOWTO Posted by Rod, on Aug. 6 2009 | |
| Ubuntu Server Edition | Ubuntu - (32 clicks) Posted by Rod, on Aug. 6 2009 | |
| www.kohala.com/start/tcpipiv1.html - (33 clicks) Posted by Rod, on Aug. 6 2009 | |
| List of router or firewall distributions - Wikipedia, the free encyclopedia - (43 clicks) Posted by Rod, on Aug. 6 2009 |


