Categories
WLAN general

What Does 802.11 Contention Look Like? (Part 1)

The IEEE 802.11 Wireless LAN protocol uses Carrier Sense Multiple Access with Collision Avoidance (CSMA/CA) with a fairly robust arbitration mechanism to allow WLAN Stations (STAs) to gain access to the wireless medium based on their traffic priority.

The central problem with CSMA/CA and the 802.11 arbitration mechanisms is that the chances of a collision occurring between two stations increases seemingly exponentially with the number of active stations contending for the wireless medium.  This means that as more and more stations use a given channel, the efficiency of the channel decreases quite dramatically.

Many engineers I have met have questioned this and have wondered why the IEEE Standards Body and 802.11 Working Group did not consider more “efficient” methods of medium access.  Why not TDMA, CDMA or OFDMA?  Now, I am not here to get into a discussion about which medium access method the IEEE or vendors should have chosen to develop way back when in 1990-whatever.  Maybe we can discuss channel access methods and their properties on another day after I have read more on the topic!   The truth is though, the IEEE 802.11 Working Group defined several methods of medium access. As it turns out, vendors only ever really developed their products to use the Distributed Co-ordination Function (DCF) and its 802.11e-defined successor, the Enhanced DCF Channel Access (EDCA) method also referred to as the Hybrid Co-ordination Function or HCF for short.

I have often wondered as a WLAN engineer what CSMA/CA actually LOOKS LIKE in the real world.  As designers of Wireless LANs we are often asked to perform capacity calculations and predict what performance level a given design will achieve for a specified application type.  We have the tools to perform a coverage analysis very well, but sadly the tools for capacity prediction fall short of expectation in my opinion.

I agree that there are some good tools out there that get us into the right ballpark and remove a fair amount of guesswork.  But I have yet to come across any tools that can accurately model the effects of WLAN contention and its effect on capacity from first principles.  Most capacity calculators and models I have ever used will cover for the effects of contention using a simple  “RF environment” setting that reduces the amount of airtime efficiency by a certain factor to account for higher collisions in noisier and busier environments.  While this gets us closer to an estimated value of capacity, it still does not give us a definitive answer.  It also IGNORES the underlying mechanics of what is truly going on, making our calculations susceptible to unforeseen errors.  Don’t get me wrong – errors are present in all calculations and can be worked around, but we need to know what they are or at least see where they may come from!  Oftentimes, if we get pushed to reveal the source of some values used in our current capacity calculators, we often have to admit that it is based largely on empirical evidence, or past experience.  Sometimes that will work, other times it might not.

There are also newer technologies like 802.11ax with OFDMA channel access methods that promise to introduce a new “High Efficiency” mode of operation to the 802.11 Standard.  It would be useful then to understand exactly why and under what circumstances the current standard and its amendments are inefficient!  We also need to build a model that can show the potential improvements brought forth by new amendments.

This is the source of  my motivations for starting this blog series.  And before you say it…

Yes, I know The Birthday Problem

When you mention the term 802.11 Contention or CSMA/CA most WLAN engineers will talk about THE BIRTHDAY PROBLEM, and we all understand that this calculates the overall chance of a collision given a certain number of clients.  But it still doesn’t really give us a clear picture of how it works.  It’s kind of like saying “There is a 15% chance of rain today”, which is useful to tell whether to walk outside with an umbrella, but it doesn’t give us any insight into how the clouds form, or when it will rain, or for how long, or if there will be a monkey’s wedding, or if it will involve a romantic couple kissing in a park.  Ok, maybe I took it too far, but you get my gist.  We want details! Details are important.  Details bring insight and understanding.

So what am I going to attempt?

In this blog series I intend to try and model the 802.11 arbitration process to show how certain factors can affect contention overhead in a Wireless LAN.

I will spend some time outlining the mechanics of what I am trying to model and some of the various approaches I have taken to visualize it.  I will also show how those methods are limited and why they are only an approximation of reality.

Let’s start (and end Part 1) by defining exactly what I am trying to visualize.

I want to explore what 802.11 contention LOOKS LIKE in the real world.  Given N active stations using a given WLAN channel:

  1. What is the likelihood overall of one (or more) collisions occurring given N active clients? (This is the answer given by The Birthday Problem).
  2. What is the likelihood of a specific station experiencing a collision at any given time?
  3. How many collisions should we expect a client to have before successfully transmitting a packet?
  4. Do the number of collisions fluctuate or settle into a relatively stable dynamic equilibrium?
  5. Can the number of collisions “snowball” into a state where the medium becomes unusable?
  6. What (really) is the maximum number of active clients that can be supported on a single WLAN channel before the system becomes unstable and the protocol breaks down?
  7. How do different 802.11 technologies (E.g. DSSS, HR-DSSS) affect the number of collisions?
  8. How does traffic volume affect the likelihood of a collision?
  9. What is the effect of an unequal split of upstream Vs. downstream traffic on the number of collisions?
  10. How does setting QoS values alter the number of collisions?
  11. How can we characterize and model application traffic streams?
  12. How does airtime efficiency and the negotiated PHY Data Rate affect the number of collisions?
  13. How does the effect of contention affect our WLAN capacity calculations?
  14. Most importantly, given this insight how can we minimize the number of collisions to get the best possible network capacity?

Right, well that’s a pretty solid list of items to try and answer. I am not sure we will be able to get to all of them at once, but now that we’ve written down what we want to see, we can move on to Part 2!

Rob

Categories
WLAN general

Wi-Fi CSMA/CA – Going Deep

In my career as a Wireless Engineer I have read a whole bunch of articles on Wireless Arbitration and how it works and to be perfectly honest, I have not ever really looked deep enough to fully understand how the carrier medium is actually marked as busy by the PHY and MAC layers.

I learnt pretty early on that at the beginning of the transmission of a frame, there is a field somewhere that tells all the other stations to stop transmitting for a given period of time.  But I glossed over where exactly it was placed because, well, it just did not seem that important.  The medium gets marked as busy,  I send my frame at my chosen rate and then everyone waits politely until i get my ACK, and we all start again after a nice communal DIFS. Right? Simple!

Hah!  As they say: the devil is in the details.

I must admit that I never fully understood Andrew Von Nagy’s post Understanding Wi-Fi Carrier Sense until now.  It all finally came together for me whilst studying for my CWAP exam and reading the IEEE 802.11-2012 standard along wth it and his post suddenly brought it all together for me. So kudos to Andrew!

HERE IS THE THING.

The implementation of Wi-Fi carrier sense and how it works is actually very important. This is in my view, one of the MOST critical things to understand when designing a WLAN. It will affect your network in many ways including the size of the contention domain, the presence and effect of hidden nodes in your network, and the effects of minimum rate selection when you commence with your attempts to optimise your design.

I don’t want to re-hash what other people have written so much about (and I feel many have done a great job before me) but I do want to focus on the parts that I failed to fully grasp early on, in the hope that it will help someone else get the penny to drop.

So if you have done any reading on this topic (and you can read the articles above for free) you will know that a wireless station is not allowed to transmit until it has determined the Physical Medium to be Idle (Clear Channel Assessment is determined to be True) AND the Network Allocation Vector must be zero.  But how does all this actually work?!

Ok we are going to get into this, but first!

CCA – Energy Detect

802.11 is a polite protocol.  Stations in an 802.11 based WLAN are required to wait for other stations to finish their transmissions before sending their own. They are supposed to share.  But what about scenarios where someone else, who is not using Wi-Fi, is using the same medium?  What about a bluetooth radio? Or something using Zigbee? Or one of those dreaded 5GHz dect phones?  Brace yourselves friends, the IoT is coming…

(*cough* Please note my subtle joke about LTE-U and LAA/LWA *cough*) 

In the event that there is some signal that cannot be decoded by the station, the 802.11 standard provides for polite interoperation with the unknown entity in the form of Clear Channel Assessment  using Energy Detect.

If there is any signal above the specified Energy Detect (ED) threshold, 802.11 based or otherwise, the  affected station detecting the energy in the channel must mark the channel as busy and wait for it to stop.

The Energy Detect threshold is typically calculated as a number ABOVE the minimum required receive sensitivity of the radio.  In 802.11, the original requirement for receive sensitivity was to be able to receive 2Mbps (using DQPSK) at an RSSI of -80dBm with a given error rate (something tiny).  In 802.11a and beyond, the ED threshold was set to 20dB ABOVE the minimum receive sensitivity laid out in the standard.

In the original 802.11 standard the ED threshold was defined as:

  • -80dBm for stations using a transmit power of 100mW or more.
  • -76dBm for stations using a transmit power of more than 50 mW
  • -70dBm for stations using a transmit power of less than or equal to 50mW

In later amendments the threshold was changed as follows:

  • 802.11b (HR-DSSS): -76dBm, -73dBm and -70dBm respectively following the same pattern as defined for DSSS above
  • 802.11a /g/n/ac: -62 dBm  (using a 20MHz Channel)

Vendors will typically implement an ED threshold of just less than -62dBm to be compliant with the standard.  Using a metric of -65dBm in your designs for an ED threshold is quite reasonable.

So, in this scenario, any received signals above the ED threshold will cause the channel to be marked as busy and stations will defer access.   This is called CCA – Energy Detect.

CCA – Carrier Sense (CS)

Now that we know when to defer to very loud and/or non-802.11 radio activity, let’s see how 802.11 stations interact with each other.

If you were a receiving station, with nothing to say, you would be in IDLE mode and you would be listening to the communication medium on your chosen channel.

Let’s assume another station on your channel starts transmitting.

NOTE: This can be ANY station, not just another in your Basic Service Set or an STA sending something addressed to you.  It can literally be any station using the same channel as you and whose transmissions you can successfully decode.

The transmitting station starts by sending the appropriate PLCP preamble for the chosen PHY type (these are just wave forms and training sequences that help receivers sync up with the transmission and lets them know of the imminent arrival of an 802.11 transmission).

The next field to follow straight after the preamble is the PLCP Header.  In the PLCP Header there is a SIGNAL field that contains two pieces of information:

  1. The length (in octets) of the coming 802.11 frame
  2. The data rate or modulation and coding scheme of the data to follow.

NOTE: For legacy DSSS (802.11) and HR-DSSS (802.11b) radios, the PLCP Header is preceded by a Start of Frame Delimiter of 16 bits.  The DSSS / HR-DSSS PLCP Header contains a Length Field defining the period of time in microseconds that the channel will be busy for.  The newer PHY types (802.11a/g/n/ac) simply provide the frame length in bytes and the PHY Rate and let the receiving stations figure out how long to be quiet for.

Any receiving station that can decode the PLCP Header and the SIGNAL field must maintain Physical Medium Busy Status for the duration specified by the two parameters above.  This is called Physical Carrier Sense.  The station heard a PLCP header it could decode, it establishes that the channel is busy, so it shuts up.

It is important to know:  The PLCP Preamble and the PLCP Header are sent AT THE LOWEST RATE using THE MOST ROBUST MODULATION SCHEME.  This basically ensures that ANY other station within range of the transmitting station will be silenced by the PLCP Preamble and Header.

A Common Misconception:

The IEEE 802.11 standard and its amendments (a/g/n/ac) define the minimum required signal level at which PLCP preambles and PLCP Headers must be decoded for 802.11a/g/n networks as -82dBm.

Many people misinterpret this to mean that below -82dBm, the CCA stops having any effect and I can ignore incoming transmissions even if I can decode them…  THIS IS A MISTAKE!

6 Mbps at a signal level of -82dBm is the minimum required receive sensitivity to meet the minimum required 802.11 standards.  Most if not ALL enterprise WLAN equipment has receive sensitivities that are vastly better than this required value.  Some even typically go lower than -95dBm!

In practical terms, this could mean that the signals from your APs are travelling four times further than you originally anticipated, and your contention domain is a whole LOT larger than you originally thought…

The point here is that if a station can detect a preamble and decode it at ANY signal level, the station is obligated to indicate that CCA is false and the medium is busy.

Duration / ID and the Network Allocation Vector

After the PLCP Header is received, the 802.11 frame itself actually starts arriving at the receiving stations.  The 802.11 frame is transmitted at the PHY rate specified in the PLCP Header.

The 802.11 frame contains the MAC Header in which we have a Duration/ID field.  This Duration/ID field is used to tell the wireless stations on the same channel about *future frames* that may follow as part of the MAC protocol in use with this frame transmission.   For example, we know that if we are using the good old DCF that any frame transmission will be followed by a SIFS and and ACK.  The Duration Field in this case provides a time value in microseconds equal to the time taken to wait for a SIFS and receive the ACK, keeping the medium open for the required frame exchange to be successfully completed.

ALL stations who heard the MAC Header in the transmission will now update something called the Network Allocation Vector to add in the extra time needed to remain silent for future frame exchanges. This is called Virtual Carrier Sense.  

 

In Summary:

Accessing the medium is made up of three parts:

  1. CCA – Energy Detect: Is anything currently occupying the channel above the specified Energy Detect threshold?
  2. CCA – Carrier Sense: Have I detected / decoded any 802.11 frames on my channel that are currently being transmitted?
  3. NAV:  Am I waiting for other frames to be sent as part of an exchange between other STAs on my channel?

Other STAs can only enter into contention to access the channel once all three conditions are met.

Some important notes to remember here:

  1. The PLCP Header is always sent at the lowest PHY rate defined in the IEEE 802.11 standard for that PHY Type regardless of what you set your minimum rate to (more on this later).
  2. The MAC Header containing the Duration Field is sent at the PHY Rate / MCS Index defined for the 802.11 frame in the PLCP header.
  3. The information contained in the PLCP Header and the MAC Header are processed by ALL stations on the same channel that are nearby enough to successfully decode the information.
  4. Channel overlap and contention due to CCA – Carrier Sense may be occurring over a MUCH bigger domain than you originally anticipated.  6Mbps at -82dBm receive sensitivity is THE MINIMUM requirement for 802.11a/g/n/ac.  Check your APs’ receive sensitivity tables to see just how far away a PLCP Header might be heard!
  5. Acknowledgement to Andrew Von Nagy over at Revolution Wi-Fi for the remark in his blog about the NAV being used for Future Frames. That was when the penny dropped!

Finally, I would like to acknowledge Keith R Parsons and Jared Griffith and the larger twitter Wi-Fi community for providing me with the discussions necessary to wrap my head around these concepts. Thanks all!

Hope this helped,

Rob

Categories
WLAN general

The Great WLAN Vendor Consolidation of 2015?

So.

One of the things I have been thinking about recently is the state of many Enterprise WLAN Vendors in the marketplace.

Before I go any further I should  state that any of the opinions I express here are purely my own and I am not speaking for anyone else apart from sharing my own personal musings on the topic. So don’t take this too seriously.