Saturday, June 13, 2009

WiFi Performance

For sometime now, I've had really slow Internet access. Basically, I've been dealing with it ever since I moved to bay area from the east coast. Initially, I was infuriated. I'm in Silicon Valley, how can cable Internet access be so infuriatingly slow. I simply blamed Comcast and slowly forgot about the problem. I moved from Mountain View up to San Francisco and the problem persisted. By the time I moved, I was just used to sluggish Internet connectivity at home. But each time my brother visits, he never forgets to remind me about the poor connectivity.

Today, for some reason, I was sufficiently motivated to diagnose (and workaround) the problem. To start with, I had to be able to measure the performance. I wanted something objective to keep myself honest. While potentially not the most accurate system in the world, I chose to go the quick and easy route and benchmark my cable Internet connection using http://speakeasy.net/speedtest. I'm in San Francisco, so I clicked on the San Francisco server and launched the speed test.

Before reporting the numbers, let me quickly describe my setup. I'm using a MacBook Pro which has an Apple AirPort Exterme 802.11n WiFi card. I was connected over WiFi to a Linksys WRT160N (802.11n) wireless router running firmware version 1.02.2. The wireless router is then connected to the cable modem.

So here were the results from my initial speed test:
  • Download Speed: 1132 Kbps
  • Upload Speed: 11288 Kbps
My first reaction is that something very strange is happening. Why is my download speed sooooo very slow and how is my upload speed an order of magnitude faster?! The connection is supposed to be asymmetric, but its supposed to be the other way around! Being confused, I ran the test a few more times, and while the results varied by +/- 10%, the counter-intuitive performance persisted.

I decided to eliminate one variable from the equation. WiFi. I rummaged through my box of cables and dug up an Ethernet cable. I could have connected my laptop straight to the cable modem, but out of laziness, I connected it to one of the Ethernet ports on the back of the wireless router. I ran the speed test again.
  • Download Speed: 20929 Kbps
  • Upload Speed: 11278 Kbps
Looks like I owe Comcast an apology. It turns out that the bottleneck is not the Internet connection, but rather my WiFi connection! Since I live in an apartment building with several other access points visible, my first thought was to hop on to the configuration page for the WRT160N and start fiddling with channels and the like to see if I couldn't boost performance. While looking for the channel configuration options, I stumbled across a setting named "Network Mode" under the "Wireless" tab on the web configuration console. The options there were:
  1. Mixed
  2. BG Mixed
  3. Wireless-G Only
  4. Wireless-B Only
  5. Wireless-N Only
  6. Disabled
My current setting was "Mixed" and intrigued by being able to limit the network mode, I started by trying Wireless-G only.
  • Download Speed: 8865 Kbps
  • Upload Speed: 8701 Kbps
Not as good as the wired connection, but not too shabby either. I then tried BG Mixed. About the same results. Things are looking up.

Finally, out of curiousity, I tried Wireless-N Only. Here I get the same awful performance as when I started this whole exercise. In addition to these experiments, I tried doing the same thing from a Linux desktop that I have which only supports 802.11g. The machine is not too close to the wireless router and the signal strength isn't great. But the results from that machine follow the same trends as those collected from my MacBook Pro. So, it seems that the 802.11n mode on the WRT160N leads to bad performance.

I checked Linksys's website and it seems I have the latest firmware. A very cursory web search for this problem turns up nothing. I wonder if this is somehow unique to me or some other configuration option I have. Very odd... I'm just happy to have zippy Internet access again!

No comments:

Post a Comment