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!

Sunday, January 25, 2009

Industrial Design of the Apple MacBook Pro

For the past 6 months, I've been using an Apple MacBook Pro. As you may have guessed, I'm not using the new model with the frameless screen, all aluminum construction, and glass track pad, but rather the model immediately preceding that (as an aside, is any one else bothered by Apple not using unique model names/numbers making it next to impossible to be precise about which product you're actually using?). In a lot of ways, Apple has done an amazing job engineering the physical characteristics of the machine. And on newer models, they are making even more progress. For example, check out this video on the battery (that's right, their engineering the battery) on the new 17" MacBook Pro.

But this post is not on what they've done right, but rather, it has a few thoughts I've had on areas of improvment.
  1. Hard drive activity indicator - I know this seems silly, but I can't count how many times I've been wondering if something is making progress or not, and that blinking light can be a lot of solace.

  2. Power light - I know, this sounds even more silly. If the laptop's on, isn't it obvious? Why have another light stating the obvious. Well, believe it or not, sometimes things don't work as expected (that's right, my Mac hangs from time to time, especially when resuming from suspend). Its immensely useful to know if the machine thinks its on. I think it can be done elegantly (e.g., just illuminate the power switch), and I think it would be a great help.

  3. Add keys for begin/end or PgUp/PgDown. I have two unused spots for keys near the arrows (and even more wasted space on the 17" models), and having dedicated keys for this functionality would be useful. While we're at it, is there any reason why the arrow keys and function keys are half sized?

  4. No sharp corners. The front edge of the MacBook Pro is fairly sharp and when I rest my wrists on it (I know, I shouldn't be resting my wrists there), it digs in and hurts. A softer edge would be very much appreciated.

  5. Power port on the back of the machine. This is a tough one, since the design of the MacBook/MacBookPro have the screen sink below the surface of the keyboard when the screen is open. This obscures the back of the machine, making it unavailable for ports. Unfortunately, I find when the laptop is in my lap (once again, I know the manual says I should be doing this), the power cord on the side of the machine frequently comes unplugged. My gut says, if it were in the back, it wouldn't be as big of a problem. Maybe with the 8+ hour battery on the next generation model, I'll be able to ween myself off of having my laptop constantly plugged in.

  6. More mouse buttons. I know this is a common gripe that goes back through the ages. But, it's so frustrating know that I can run Unix apps on the Mac, but not having enough buttons to navigate them well. Others have suggested multi-finger clicks, etc., but the lack of tactile feedback makes me feel like I'm playing a Street Figher like game; when an action doesn't happen (especially infrequently used ones, like middle click), I don't know if I'm misremembering how to do the click, or if I just didn't execute it properly. Basically, I like tactile feedback telling me I'm doing things properly. As an aside, I very much like the design of the trackpad on the new MacBook Pro that replaces the button on the trackpad with more area to swipe. This is okay, because the whole trackpad still physically moves when I push on it to click.
One point that was going to make my list, no optical drive on the front of the machine, has been fixed in the latest generation of the hardware. Kudos to Apple for that. I'm sure there are other pet peeves I have about the MacBook/MacBook Pro hardware, but these are the ones that came to mind while writing this. Here's hoping to improvements in future designs!