Wi-Fi Channel Access

Note: This was prepared as part of the Ekahau Certified Survey Engineer (ECSE) training class, in effort to explain wireless channel access in ordinary language. Not sure if I succeeded, but hey I tried.

Have you ever used a walkie-talkie? You know, the little handheld radios where you push the button to talk and release to hear static and sometimes a weak noise that kinda sounds like a voice coming through on the other end?

Wireless communication is kind of like a walkie-talkie – you can only talk or listen, but not both at the same time. Sometimes the signal is so weak you can’t hear it, and the closer you get the clearer the sound.

This is what is called a half-duplex transmission – only one person can speak at a time, and everyone on the same channel can hear what you say.

Wi-Fi networking is the same, only at much higher frequencies. Everything is broadcasted through the air, so if any meaningful communication needs to occur it is imperative only one device transmits at a single time.

This is a tall order, considering anyone trying to use the wireless network wants it to work perfectly with no delays. After all, we all have very important work to do.

Generally, wireless does work pretty well. You can have Netflix on in the living room with Pandora playing in the kitchen while the kids are playing Xbox with their online friends, and nobody really experiences any interruptions.

So how does everything work together?

Channel Access Steps

The answer is all Wi-Fi devices follow the same set of rules so everything gets a fair share. Here are the basic concepts.

  1. Everything gets acknowledged.

Each time the transmission completes, the other side has to say “ok” so you know your message got through. If you don’t hear the “ok” back, you have to assume something went wrong and you have to try again.

In Wi-Fi lingo, this is called an ACK (acknowledgement). Once the message is over, there is a short pause, then the recipient sends the ACK.

  1. If you want to speak, first make sure nobody else is talking.

When you have a message to send, you have to wait to make sure nobody else is saying anything first. Pretty obvious.

The Wi-Fi term for this is physical carrier sense. The Wi-Fi radio sits and listens for quiet before continuing on.

  1. Once you’re sure nobody’s speaking, wait just a bit longer.

In Wi-Fi the waiting game is very structured, but chances are you do the same thing with walkie-talkies. When someone finishes talking, you wait just a little for the air to clear and make sure nobody else will say anything before you start.

After the previous device is done and the ACK is received, there is a set amount of time everyone waits. Sometimes if another message is super urgent, they can get priority by making this waiting time a bit shorter than everyone else, but for the most part it’s a courtesy period that is the same for everyone. (The technical term for this period is theĀ inter-frame space (IFS).)

Once everyone is done being courteous, there is another random backoff time chosen that counts down when the channel is idle. Any time nobody is transmitting, the countdown proceeds and only stops if you notice someone else start talking before you. If this happens, just wait again until it gets quiet, then keep counting down.

  1. When it’s your turn, tell everyone how long your speech is about to be.

Since the message is prepared ahead of time, the actual length of time it will take to transmit is easy to calculate. Right at the beginning of the message, this time is announced so other folks know how long they’re about to wait.

This is rather nice, since as long as the message isn’t for them, they can rest for a short while. ThisĀ saves battery life, and who can complain about that?

This duration calculation accounts for the full message to be sent, the short pause, and the ACK to be sent back. Once this expires, everyone, including you if you have more to say, can start again with the checking for signal and waiting for the backoff timer to count down.

  1. If there are problems, just start over and wait some more.

(Do you see the theme here?)

If for whatever reason you missed hearing the ACK for your message, there must have been a problem. Either your message wasn’t fully received, or someone else mistakenly started talking at the same time and jumbled up the signal, or maybe you ended up being too far away and it wasn’t understood over the static.

Regardless, the message has to be re-sent.

This time however, the random backoff timer needs to be a little longer to avoid another overlap. For Wi-Fi, each time this happens the maximum time on the timer gets doubled, making it less likely for there to be a conflict the next time.

Summary

In Wi-Fi, everyone takes turns, and everyone is very polite. If it wasn’t this way, the whole thing would break down, chaos, fires, etc. However, the system does work surprisingly well.

  1. Listen and wait for silence
  2. Wait a bit longer
  3. Transmit the message
  4. Wait for the “ok”
  5. If there was a problem, start over only wait even longer at step 2
  6. Profit