WiFi protocol notes

I’ve been doing Wikipedia reading associated with my wireless experiments on how 802.11n works. Here’s some brutal summaries, note I’m totally ignorant of signals processing and believe taming the electromagnetic field is basically witchcraft. I’m sure I made a mistake somewhere.

802.11n notes

  • 802.11b and 802.11g are basically a single wireless signal on a single 20MHz wide channel. 802.11g uses orthogonal frequency division multiplexing to split that 20MHz up into 52 separate subcarriers. There’s 8 different modulation and coding rates possible in 802.11g, resulting in data rates of 6, 9, 12, 18, 24, 36, 48, or 54 Mbps.
  • 802.11n is based on 802.11g.
  • 802.11n’s main innovation is multiple antennas and MIMO.
  • 802.11n can optionally use a 40MHz channel. That’s a bit naughty at 2.4GHz; it means you overlap with pretty much every other 2.4GHz user around you. My iMac doesn’t appear to support 40MHz at 2.4GHz.
  • 802.11n can also run at 5GHz. (My router doesn’t.) I don’t think it runs any faster at that frequency, although the channel separation is nicer.
  • Max 802.11n datarate at 20Mhz channels is 288.8Mbps. At 40MHz it’s 600Mbps.
  • Multiple antennas also allow for MIMO, multiple-input and multiple-output. I don’t understand this at all but the Wikipedia page says this is about exploiting multipath effects to effectively get more useful signals out of the same bandwidth. This seems like complete magic to me.
  • A specific thing MIMO does is spatial division multiplexing. I think this is effectively a directional thing, ie: “I can talk to radios north of me and radios south of me independently”. Only I’m guessing this has more to do with orientation of the antenna, and may explain part of why simply rotating my antennas so they were not all parallel resulted in a better connection. (If the access point’s antennae are parallel then they are not spatially disjoint.) My iMac is currently enjoying two spatial channels to the router, which makes more sense if you think of rotational spatial division.
  • You get 1 spatial stream per antenna+radio (sort of), and 802.11n supports up to 4 antennas. My Asus RT-N16 is a 2×2 configuration so that’s effectively 2 transmit and 2 receive antennae. (There’s only 3 physical antennae, no idea how that works). That’s why it maxes at 300Mbps; only 2 spatial streams. With 20MHz bandwidth it maxes out at 144.4Mbps. My iMac gets 1 spatial stream sometimes and 2 most of the time.
  • 802.11n optionally supports a 400ns guard interval, half the space between separate data frames as the old 800ns. That seems to boost throughput about 10%. The Wi-Fi signal app on my iMac reports speeds that suggest I am using this, sometimes. (Ie right now: MCS index 7, but 73 Mbps).
  • 802.11n supports a bunch of different coding rates. The coding rate describes how much of the signal is reserved for redundant error correcting bits. My iMac is typically seeing a coding rate of 3/4 or 5/6.
  • 802.11n supports several different modulation schemes. That’s the digital to analog part of the radio, the way bits are turned into waves. My iMac is mostly using 16-QAM or 64-QAM, which corresponds to 4 or 6 bits per symbol. Neat visualization here
  • The coding rate, modulation, number of spatial streams, and maybe even the guard interval are varying frequently, at least once a second. Presumably the access point is picking which variant to use depending on the current error rate.
  • 802.11ac is the new hotness. It’s 5GHz, supports 80Mhz and 160MHz channels, 8 spatial streams, 256-QAM (with non-standard 1024), etc. If my arithmetic is right the spec could in theory go up to 8Gbps (compare 600Mbps for 802.11n). I think in reality you can actually get gigabit wireless speeds. But only if the spectrum is uncongested and the signal path is clear. My fancy ASUS RT-AC68U claims up to 1300Mbps at 5GHz. That seems to correspond to 2 streams at MCS index 7, which is 64-QAM 5/6 rate.

MCS Index

Most of the 802.11n options are summarized in a single number called the MCS Index. See also this table. MCS Index specifies the number of spatial streams, the modulation type, and the coding rate. Those together define how much data can be stuffed in a single subchannel. Combine that with your bandwidth (20Mhz or 40MHz) and your guard interval and you get a max data rate.

In practice my iMac mostly hangs out at MCS 7 or MCS 12. MCS 7 is a very dense modulation and coding, but only one spatial stream, and it’s reporting 73Mbps. MCS 12 is a less dense modulation but 2 spatial streams, and reports 78Mbps.

Misc other observations

The upstream bandwidth from my link is 12Mbps, so I don’t really care about any of these higher speeds. I’m much more interested in reliability.

I had my RT-N16 configured to use 40MHz but my Mac wasn’t using that. (From a quick search, Apple doesn’t support 40MHz at 2.4GHz.) So I knocked it down to 20MHz in the router and now I think I’m getting a stronger signal. -60dBm instead of -65dBm. I suppose that’s possible? I didn’t measure carefully.

I’ve got two wireless devices connected to the router; my iMac and an old WRT54GL running 802.11g. I tried making both of those wireless links busy, about 5Mbps each, and didn’t see any obvious contention. My iMac didn’t even drop down to 1 spatial stream which I was sort of naively expecting. That’s all as it should be: 802.11g promises 54Mbps bandwidth and I wasn’t getting near that. Nice that it really works.

Google’s new OnHub router does 802.11ac and 802.11n in a 3×3 configuration.

My 2013 iMac’s wifi antenna is behind the Apple logo in the case. Why? Because it’s the only part of the back that’s not made of aluminum.