WLAN Medium Contention – #CWAP6
Accounts for 10% of the CWAP knowledge domain areas, approx. 6/60 questions
Medium Contention :Protocols that allow large number of devices to effectively share the wireless channel. All AP & STAs will contend with each other on a common transmission medium.
CSMA / CA – The AP/STAs (802.11) use carrier sense multiple access with collision avoidance as opposed to collision detection used by the Ethernet (802.3) realm.
802.11 devices must avoid multiple devices transmitting simultaneously over a shared medium which can cause failed transmissions. Wireless mediums cannot detect collision but find ways to avoid them. Collision handling is not straight forward and may be time consuming at times. Hence one of the reasons that 802.11(WLANs) have much lower throughput-to-data rate ratio than 802.3(Wired LANs).
CSMA/CA uses DCF (Distributed Coordination Function) for non-QoS WLANs & HCF (Hybrid Coordination Function) for QoS WLANs using EDCA (Enhanced Distributed Channel Access).
There are two carrier sense protocols used by the stations to indicate whether a channel is busy or idle.
- Physical Carrier Sense, also known as CCA (Clear Channel Assessment)
- Virtual Carrier Sense, also known as NAV (Network Allocation Vector)
Both QoS & non-QoS use either of the above protocols for transmitting data.
CCA (Layer 1) > Identify whether the channel is unused and available prior to the packet transmission.
- Channel Occupied = State of Busy ~ Energy Detection Levels.
- Channel Clear = State of Idle
Apply to 802.11 modulation, if the AP or STA is too far away to detect any transmission at requisite energy level, the CCA may go into the idle state even though the channel is still occupied.
NAV (Layer 2) > is a timer that counts down toward zero(0). When a device has a NAV value greater than zero, the device says quiet. Once the NAV = 0, the medium is considered clear.
As discussed earlier, CCA may fail to keep other devices on the channel quiet (Too far transmitting device, obstruction, interference), the design of the NAV keeps APs and stations quiet.
Duration value in the 802.11 header set the NAV values for AP and STAs.
It is vital for the AP and STA to stay with the RSSI data range in order to successfully demodulate a transmitted frame so that the Duration/ID field in the header can be accurately set.
When 2 or more STAs begin frame transmission at the same time in the idle environment, collisions are bound to happen. Hence we have additional medium contention protocols beyond CCA & NAV. These protocols must keeps AP and STAs quiet like CCA/NAV & also allow differentiated medium access.
IFS is the quiet period that AP & STA must wait before any 802.11 frame transmission.
TIPS to Remember!
- If the contention has been completed, then a reduced IFS (RIFS) or short IFS (SIFS) will be used. Most cases it is SIFS but RIFS is only used between consecutive frames transmitted by 802.11n device.
- If the contention/arbitration is not determined, then arbitration IFS (AIFS) or DCF IFS (DIFS) will be used. The AIFS is used for WLANs that support 802.11e QoS, and the DIFS is used for WLANs that do not support 802.11e QoS.
- If an AP or STA has received a corrupted frame as defined by having an incorrect FCS, then extended IFS will be used.
- PCF IFS (PIFS) is part of PCF and therefore not used in real world. (May be ignored for CWAP prep!)
- 802.11 FHSS network use 50ms slot time.
- Steps involved for a STA to go through before starting the frame transmission in the wireless medium (Source : 802.11 Arbitration CWNP White Paper)
- Foundation of all IFSs.
- 10ms for 802.11b/g/n (2.4GHz)
- 16ms for 802.11a/n (5GHz).
- It is used after contention/arbitration is completed. Exception being 802.11n device using MIMO to transmit frames then RIFS is used.
- Simplest IFS to understand.
- Length is always the same 2ms.
- Only for devices which use 802.11n/MIMO.
- It precedes for only “data” frame.
- Designed to force AP and STA with ordinary data in the queue to stay quiet for enough time to allow QoS frames to have access to the channel.
- It is used when arbitration process has not yet completed.
- DIFS is equal to length of SIFS + 2 slot times. Slot times are quiet periods, similar to IFS.
- They are equal to 9ms for 802.11a/n/ac operating in 5GHz and 802.11g/n with 2.4GHz.
- The 20ms slot is used if the HT or ERP is used with long preamble and 802.11b/g/n 2.4 GHz DSSS.
- The short preamble is default setting when HT or ERP is used.
- Designed to give AP and STA a chance to retransmit after a failed frame.
- This happens when AP/STA failed to receive ACK after transmission.
- EIFS = SIFS + DIFS plus the time taken acknowledge the frame to transmit.
- 802.11b/g/n(2.4GHz) using DSSS= 364ms, 802.11a/n(5GHz) & 802.11g/n (2.4GHz) = 160ms. EIFS is the longest of the IFS.
Near/Far Problem : STA closer to AP may cause problem to STA at far. When data is transmitted between AP and nearby STAs they can use higher data rate than far stations. (This is why STA dynamically switch their data rates downward when moving away from the AP). The frame therefore will appear to be corrupt even though it was successfully transmitted. The far STA have to stay quiet for an EIFS at the beginning of the arbitration process, while the near STA will be allowed to use the shorter DIFS.
PIFS > Equal to one slot time + 1 SIFS and it is designed to give AP the chance to send the beacon in order to begin the CFP (Contention Free Period). In real-world the PIFS is only used with Channel Switch Announcement frame, which is one of the Action frames from 802.11h.
The mechanism which prevents collision by differentiating 802.11 channel access is the Random Backoff. Unlike the IFS, the random backoff is not static. It is the period of time that changes based on a random number chosen by AP or STA.
AP and STA stay quiet during the random backoff by randomly choosing a number of slot times and then counting down until the number of slot times equal to zero. Transmission resumes after slot time equals zero.
- For the random backoff to work, there must be an upper and lower limit to the number of slot times that ca be chosen.
- The lower limit is always 0. The upper limit for the random backoff is equal to the contention window (CW).
- The CW is derived from the equation 2x – 1, where x is a value that increments with each failed frame. For DSSS-based networks, x starts at 5, which results in a CW of 31. For OFDM-based networks, x starts at 4, which results in a CW value of 15. For both DSSS and OFDM-based networks, the x value stops incrementing at 10, which results in a CW value of 1023.
- Failed frames cause the contention window to grow exponentially. More quiet time means a less efficient channel thus causing latency and throughput issues.
- Used by QoS enabled STA to transmit all data, management, PS-Poll, RTS, CTS (when not transmitted as response to RTS), Block Ack Req and Block Ack (when not transmitted as a response to Block Ack Req).
- Slot times in AIFS is called as AIFSN (slot number).
- 802.11e specifies Voice (AV_VO), Video (AV_VI), Background (AV_BK) & Best Effort (AV_BE).
- Video and Voice = 2 Slot times
- Best Effort = 3 Slot times
- Background = 7 Slot times
- Calculate AIFS for a given Access Category = AIFSN[AC] x Slot Time x SIFSTime
- Transmit Opportunity or TXOP is the amount of time a STA can send frames when it has won contention for the wireless medium. This is in relation to EDCA (Enhanced Distributed Channel Access).
- When a STA sends QoS data, it must first contend for the access to the wireless medium.
- STAs perform CCA and determine if the channel is idle. It must have its NAV set to 0. Then it must wait for the appropriate InterFrame Spacing.
- Then it would wait for the contention window to complete. CW has 4 categories as discussed in the previous section. Each category has different TXOP.
1 thought on “WLAN Medium Contention – #CWAP6”
[…] WLAN medium contention […]