A Little Off Code, Computers, Photography and Guns

23Jun/100

Coping with a puny outbound bandwidth limit.

If you were unaware I recently moved to Laramie, WY. Which is a significantly smaller town//city//something-or-other than Tucson, AZ is by quite a lot. Anyway if you didn't know Wyoming existed there are a few basic facts about Wyoming I should explain so you'll know what I'm dealing with here.

Wyoming is very very spacious and very sparse. Everything here is incredibly spread out. As such laying cable for connecting cities is generally expensive and still in the early stages of deployment. It is still possible to get broadband cable in the cities but if you don't live in the city and want broadband you're stuck with WiMax[1] like wireless broadband which is pretty wide-spread here and effective since the terrain in most areas of the state permit line-of-sight wireless connections.

I went the broadband cable route since all of the experience I've had with Wifi stuff has been unreliable and I'm just a big fan of having a cable from one point to the next, there is a lot less downtime and possibility for interference.

Unfortunately having chosen broadband cable left me with two providers, Qwest and Bresnan. Qwest limits me to 3Mbps down and what i'm guessing is no more than 384Kbps up. Bresnan on the other hand provides 8Mbps/500Kbps which is better.

I'm consistently getting more and more frustrated with the emphasis broadband cable providers put on download speeds, upload speeds are getting to be just as important if not more important than inbound bandwidth. People are starting to learn that it's much much easier to share media and personal data online instead of the alternatives. By comparison I moved from Tucson where we had 20Mbps/3Mbps.

Now you can see where my problem is. 50KB/s up is pretty miserable compared to what I used to have. And you can imagine where my congestion comes in. If I saturate my outbound bandwidth Bresnan essentially ruins my inbound bandwidth. I recently discovered that Tomato the firmware I've installed on my router comes with TCP Vegas[2] integrated.

Initially I couldn't find any proper documentation on what alpha, beta and gamma meant and how to tune them properly to help control my congestion problem. After several hours of searching and research I found only two configurations that seemed to provide people with some measure of congestion prevention: 3,3,2 and 2,6,2[3]

So I switched TCP Vegas on while downloading the first Pioneer One episode[4] and reset all the connections since TCP Vegas only affects connections created since enabled. And immediately i noticed the saw-tooth that TCP Reno[5] causes a saw-tooth wave in throughput of outbound traffic which is very bad for maintaining throughput. TCP Vegas immediately smoothed out the connection and allowed for a sustained outbound rate with an oscillating inbound rate around the maximum throughput achievable while maintaining sustained outbound traffic. I've read that tuning TCP Vegas properly can eliminate the oscillation of inbound traffic but I haven't had much luck with actually getting this done.

Once TCP Vegas began to smooth things out I figured out that in order to optimize inbound throughput I could simply limit the outbound rate now that the congestion was eliminated. This increased the inbound rate significantly and everything has been running smoothly since then. I wish I knew more about the algorithm used and how to tune it but there doesn't seem to be much in the way of documentation anywhere.

  1. WiMax: Worldwide Interoperability for Microwave Access []
  2. TCP Vegas: a TCP congestion control, or network congestion avoidance, algorithm that emphasizes packet delay, rather than packet loss, as a signal to help determine the rate at which to send packets. It was developed at the University of Arizona by Lawrence Brakmo and Larry L. Peterson. []
  3. Alpha, Beta and Gamma respectively. []
  4. A free TV Series designed specifically for P2P distribution. []
  5. TCP Reno: a TCP Congestion Avoidance Algorithm []
5Jan/105

Multi-tracker Problems

I can't even begin to describe how annoying it is to download a torrent and to discover that the person that compiled it added a bunch of trackers to it but didn't bother to take into consideration that not all torrent clients (at least one) handle multi-trackers properly if you don't put blank lines in between each tracker.

Like so:

1
2
3
4
5
http://tracker.openbittorrent.com/announce
udp://tracker.openbittorrent.com:80/announce

http://tracker.publicbt.com:80/announce
udp://tracker.publicbt.com:80/announce

Now I know for a fact that μtorrent requires this but I'm not sure about any other torrent clients. But the above list of trackers won't work properly. In fact only the http based trackers will register because of the blank line. For all of the trackers to be used each tracker must have a blank line following it.

Like so:

1
2
3
4
5
6
7
http://tracker.openbittorrent.com/announce

udp://tracker.openbittorrent.com:80/announce

http://tracker.publicbt.com:80/announce

udp://tracker.publicbt.com:80/announce

So please if you're going to post create a multi-tracker torrent at least list all of the trackers properly because it will only do any good if every peer in the swarm has all of the trackers listed in the torrent. Unfortunately most people treat bittorrent like a "set and forget" sort of file sharing protocol but if you setup one small part like that wrong everyone suffers and most people simply won't notice.

2Dec/090

Comcast’s Data Usage Meter

It looks like Comcast is starting to roll out a data usage meter to customers in the Portland, OR area so they can gauge how far along they are in their 250GB per year limit. According to Gizmodo, Comcast says their median data usage is 2-4GB per month. I thought this was hilarious so I decided to do a little calculating of my own.

I've got a Linksys WRT-something-or-other router which I've installed DD-WRT on. Recent versions of the firmware have a section that keeps track of overall traffic through WAN that your router handles. It also makes it pretty easy to do a little calculation of your own with it since you can download the data in text format. It logs in terms of total data in and out per day of each month. November was my first full month of data excluding the the first of the month (something broke that day I guess), so I downloaded the log and looked at November's data.

On average we downloaded 1917MB per day and uploaded 562MB per day. This is the total traffic between 3 people. Grand total we downloaded 54GB and uploaded 16GB. If we take a look at the ratio between the two I can approximate what our actual bandwidth is. We're supposed to have a 20Mb down connection and the ratio suggests that our up bandwidth is ~5.86Mb which means our maximum upload rate is 750KB/s which we've never achieved before. When I use bittorrent to download Linux ISO's I assume that in order to not choke our router with ACK's I need to throttle the upload rate to about 70% of the maximum which hovers around about 120-130KB/s which is ~1Mb/s even and that's only 70% of the max.

Basically I wouldn't survive if I had Comcast and a 250GB limit per year.