802.11 Medium Contention



https://mrncciew.com/2014/10/12/cwap-802-11-medium-contention/

  • DCF
  • Distributed Coordination Function : Non-QoS WLAN
  • HCF with EDCA
  • Hybrid Coordination Function : QoS WLAN EDCA– Enhanced Distributed Channel Access
  • PCF
  • Point Coordination Function (not implemented practically)

Carrier sense:

  • Physical Carrier Sense
  • Physical carrier sense is performed constantly by all Wi-Fi radios that are not transmitting or receiving. Layer 1 – Clear Channel Assessment (CCA), 802.11 radios use two separate CCA thresholds when listening to the RF medium.
    • SD (Carrier Sense or Preamble detection)
    • The SD threshold is sometimes referred to as the preamble carrier sense threshold. The signal detect (SD) threshold is used to identify any 802.11 preamble transmissions from another transmitting 802.11 radio. The signal detect (SD) threshold is statistically around 4 dB signal-to-noise ratio (SNR) for most 802.11 radios to detect and decode an 802.11 preamble. In other words, an 802.11 radio can usually decode any incoming 802.11 preamble transmissions at a received signal at about 4 dB above the noise floor.
    • ED (Energy Detection)
    • The energy detect (ED) threshold is used to detect any other type of RF transmissions (non-WiFi signal) during the clear channel assessment (CCA). the ED threshold is 20 dB higher than the signal detect threshold.
    For example, if the noise floor of channel 36 were at –95 dBm, the SD threshold for detecting 802.11 transmissions would be around –91 dBm, and the ED threshold for detecting other RF transmissions would be –71 dBm. If the noise floor of channel 40 were at –100 dBm, the SD threshold for detecting 802.11 transmissions would be around –96 dBm, and the ED threshold for detecting other RF transmissions would be –76 dBm. Note, the interpretation of these thresholds by WLAN manufacturers of 802.11 clients and AP radios will often differ.
  • Virtual Carrier Sense
  • Layer 2 – Network Allocation Vector (NAV) Duration value set in each frame’s MAC header where other stations set their NAV to this if the sense medium is busy.

    Two basic rules apply to all transmissions using the DCF:
    • If the medium has been idle for longer than the DIFS, transmission can begin immediately.
    • If the medium is busy, the station must wait for the channel to become idle.
    • If access is deferred, the station waits for the medium to be idle for the DIFS and prepares for the exponential backoff procedure.
    These are the steps a station go through prior to transmit a frame to the wireless medium:


    1. STAs use a physical carrier sense (Clear Channel Assessment—CCA) to determine if the wireless medium is busy.
    2. STAs use virtual carrier sense (Network Allocation Vector—NAV) to detect if the medium is busy. When the virtual timer (NAV) reaches zero, STAs may proceed.
    3. If conditions 1 and 2 are met, STAs wait the necessary IFS interval, as prescribed by the protocol.
    4. If conditions 1 and 2 are met through the duration of condition 3, STAs generate a random backoff number in accordance with the range of allowed values.
    5. STAs begin decrementing the backoff timer by one for every slot time duration that the wireless medium is idle.
    6. After decrementing the backoff value to zero, with an idle medium, a STA may transmit the allotted frame exchange, in accordance with the parameters of the obtained transmission opportunity (TXOP).
    7. If another STA transmits before Step 6 is completed, STAs observe steps 1, 2, 3, and 5 until the backoff timer is equal to zero.
    8. After a successful transmission, repeat as needed. Below diagram show the flow of the above steps (source : 802.11 Arbitration CWNP white paper)

    Inter Frame Spaces

    After each frame transmission 802.11 protocol require an idle period on the medium called Inter Frame Space (IFS). The length of the IFS is depend on previous frame type, following frame type, access category, coordination function in use and PHY type as well. The purpose of an IFS is both to provide a buffer between frames to avoid interference as well as to add control and to prioritize frame transmissions.


    SIFS (Shortest Inter Frame Space)

    SIFS are used within all of the different coordination functions. For 802.11-2007, SIFS is the shortest of the IFSs and is used prior to ACK and CTS frames as well as the second or subsequent MPDUs of a fragment burst. However, with 802.11n, a shorter IFS (RIFS) was introduced.

    SIFS for 802.11b/g/n (2.4 GHz) = 10μS
    SIFS for 802.11a/n/ac (5 GHz) = 16μS


    RIFS (Reduced Inter Frame Space)

    RIFS were introduced with 802.11n to improve efficiency for transmissions to the same receiver in which a SIFS-separated response is not required, such as a transmission burst (CFB-Contention Free Burst)

    RIFS = 2μS

    802.11n standard use RIFS and Block Acknowledgement (mandatory in 802.11n). RIFS is used only when Block ACK is enabled. When Block ACK are used, data frames of a CFB may send consecutively without interruption by ACK. At the end of CFB, Tx Station will simply send BAR (BlockACKRequest) and receiving a single Block Acknowledgement (BA).

    Below shows the use of RIFS during a 802.11n frame transmission. (page 260 CWAP study guide). Note that AIFS used initially as of QoS Data frames.

    DIFS (Distributed Inter Frame Space)

    When a STA desires to transmit a data frame (MPDU) or management frame (MMPDU) for the first time within a DCF network, the duration of a DIFS must be observed after the previous frame’s completion. The duration of a DIFS is longer than both the SIFS and PIFS.

    DIFS = SIFS + 2x SlotTime

    SlotTime for 802.11a/n/ac (5 GHz) = 9μS
    SlotTime for 802.11g/n (2.4 GHz – HT or ERP) = 9μS with short preamble
    SlotTime for 802.11g/n (2.4 GHz – HT or ERP) = 20μS with long preamble
    SlotTime for 802.11b/g/n (2.4 GHz – DSS ) = 20μS


    EIFS (Extended Inter Frame Space)

    The EIFS value is used by STAs that have received a frame that contained errors. By using this longer IFS, the transmitting station will have enough time to recognize that the frame was not received properly before the receiving station commences transmission. If, during the EIFS duration, the STA receives a frame correctly (regardless of intended recipient), it will resume using DIFS or AIFS, as appropriate

    EIFS (in DCF) = SIFS + DIFS + ACK_Tx_Time

    EIFS 802.11b/g/n devices using DSS = 364μS
    EIFS 802.11g/n devices using OFDM = 160μS
    EIFS 802.11a/n devices (5GHz) = 160μS

    EIFS (in EDCA) = SIFS + AIFS[AC] + ACK_Tx_Time

    Below diagram show the arbitration process after receipt of a corrupted frame, where all other stations (except the transmitter) wait for EIFS.


    Near/Far Problem

    Due to side effect of EIFS, stations near to AP could cause problem to stations at Far(hence called Near/Far problem). When data send between AP and near by stations, they can use high data rates where far stations cannot be demodulate and interpret as corrupted frame. So far stations stay quiet for EIFS, while the near station will be allowed to use DIFS or AIFS. The use of DIFS will give nearby station higher priority and get more opportunity to transmit while far station remain quiet.


    PIFS (PCF Inter Frame Spaces)

    PIFS are used by STAs during the contention-free period (CFP) in PCF mode. Because PCF has not been implemented in 802.11 devices, you will not see PIFS used for this purpose. In order to gain priority over other STAs during contention, the AP can transmit a Channel Switch Announcement (802.11h) frame after observing a PIFS

    PIFS = SIFS + SlotTime


    AIFS (Arbitration Inter Frame Space)

    The AIFS shall be used by QoS STAs to transmit all data frames (MPDUs), all management frames (MMPDUs), and the following control frames: PS-Poll, RTS, CTS (when not transmitted as a response to the RTS), BlockAckReq, and BlockAck (when not transmitted as a response to the BlockAckReq).

    The number of slot times used in the AIFS is called the Arbitration Inter Frame Space Number (AIFSN). 802.11e specifies 4 access categories (AC_VO : Voice, AC_VI : Video, AC_BE : Best Effort & AC_BK : Background). Voice and Video category use 2 slot times by default. Best Effort category use 3 slot times where as Background traffic use 7 slot times by default.

    Below is the formula to calcluate AIFS for a given Access Category (AC)

    AIFS[AC] = AIFSN[AC] × SlotTime + SIFSTime


    Contention Window/Backoff Timer

    After a STA has observed an idle wireless medium with carrier sense (CS) for the appropriate IFS interval (DIFS, EIFS, or AIFS). To contend for medium access after the IFS, each station selects a backoff value called random backoff period and is selected at random by the STA from a window of possible values called a contention window (CW) calculated using the below formula where x is a value increments with each failed frame.

    CW = 2^x -1


    For DSS based networks x starts at 5 which resulting CW of 31, for OFDM based networks, x starts at 4 which result in a CW of 15. In both DSS & OFDM x values stops incrementing at 10 which result CW of 1023. Below table summarize these values for DCF network.


    TXOP- Transmit Opportunity

    EDCA introduce this TXOP which is a time period where one device, called TXOP holder has unfettered acccess to the channel for data transmission. The data frame transmissions within a TXOP are called a “contention free burst (CFB)” . During a TXOP, only the data that makes up a CFB and the ACK for that data may access the channel.

    802.11e standard defines default TXOP limit value for each AC, but values can be configured on AP. TXOP limit are set in intervals of 32µs (microseconds). Default TXOP is 47 for AC_VO (47×32=1504µs) for OFDM. It is 94 for AC_VI (94×32=3008µs) . Note that for AC_BE & AC_BK always TXOP set to 0, in other words those traffic category always has to send one frame at at time (no CFB).



    Carrier-sense multiple access with collision detection , CSMA/CD

    (CSMA/CD) is a media access control (MAC) method used most notably in early Ethernet technology.
    It uses carrier-sensing to defer transmissions until no other stations are transmitting.
    If a transmitting station detects collisions by sensing transmissions from other stations while it is transmitting a frame, the station stops transmitting that frame, transmits a jam signal, and then waits for a random time interval(based on number of collisions) before trying to resend the frame.

    留言

    熱門文章