CSMA/CA protocol analysis

Source: Internet
Author: User

Overview of CSMA/CA protocol analysis the MAC protocol 802.11 of the wireless LAN standard is very similar to the MAC protocol 802.3 standard. In the 802.3 protocol, the MAC protocol uses a mechanism called CSMA/CD (Carrier Sense Multiple Access/Collision Detect), that is, the Carrier listens to Multiple Access/conflict detection mechanisms. This Protocol resolves how to detect and avoid network conflicts when two or more network devices need to transmit data simultaneously. The working principle can be summarized as follows: listen and listen; in case of conflict, stop talking immediately; wait for the time and then talk again. However, it is not suitable for wireless LAN. In a wireless LAN, the distance between radio waves is limited, and not all nodes can listen to signals. Moreover, the wireless Nic works in half-duplex mode, the device cannot send data signals while receiving data signals. On the other hand, wireless bandwidth is not high. In the event of a collision, re-transmission of data will reduce the throughput.
Therefore, CSMA/CD was modified in 802.11 using the new protocol CSMA/CA (Carrier Sense Multiple Access with Collision Avoidance), that is, the Multi-Channel Access/conflict avoidance mechanism of the carrier listener uses the ACK signal to avoid conflicts. That is to say, only when the STA receives the ACK signal returned by the network can it confirm that the data has arrived at the destination address correctly. CSMA/CA protocol in order to avoid collision as much as possible, the 802.11 standard stipulates that after all Stas complete frame transmission, they must wait for a short period of time before sending the next frame, this time is called the interframe interval IFS. The interval between frames depends on the type of frames to be sent by the station. A frame with a higher priority needs to wait for a short period of time, so the sending permission can be obtained first, but a frame with a lower priority must wait for a long time. If the low-priority frame has not been sent yet, and other high-priority frames have been sent to the media, the media becomes busy, so the low-priority frame can only be postponed. This reduces the chance of a collision. The specific length of the interval between frames depends on the physical layer features used. SIFS, that is, the interval between Short (Short) frames. SIFT is the shortest interval between frames, used to separate the frames belonging to a conversation. During this period, a STA should be able to switch from the sending Method to the receiving method. The SIFS frame types include: ACK frame, CTS frame, and frame after the too long MAC frame fragment, and all frames that reply to the AP query and any frames sent by the AP in the PCF mode. PIFS, that is, the interframe interval (longer than SIFS) of the point-to-point coordination function, is used to preferentially access the media when the PCF method is used (in the PCF mode, there is no contention. The length of PIFS is the length of SIPS plus a slot time. The length of the time slot is determined as follows: In a basic service set BSS, when a station accesses the channel at the beginning of a time slot, when the next time slot starts, other stations can detect the channel to change to a busy state. DIFS, that is, the maximum interframe interval (IFS) of the Distributed coordination function, is used to send data frames and manage frames in the DCF mode. DIFS has one more time slot length than PIFS. To minimize the chance of collision, the 802.11 standard adopted a mechanism called virtual carrier listening location, this allows the origin site to write the channel time (including the time required by the destination site to send a confirmation frame) to the sent data frame, (that is, writing in the "duration" field in the header takes up the channel time, in microseconds until the target site completes frame validation ), so that all other stations do not send data for this period of time. The "virtual carrier listener" means that other stations do not listen on the channel, but because these stations know that the source station is using the channel to not send data. It seems that other stations have listened to the channel. When the site detects the frame "duration" field being transmitted during communication, it adjusts its network allocation vector NAV. NAV indicates the duration of the busy channel. When the channel is busy, it indicates that the channel is busy either because the carrier listening on the physical layer detects that the channel is busy, or because the virtual carrier listening mechanism on the MAC layer indicates that the channel is busy. CSMA/CA working principle (1) first checks whether there is a STA in the channel. If the channel is detected to be idle, the data is sent only after the DIFS time. (2) If the target STA receives the frame correctly, a confirmation frame ACK is sent to the source STA after the SIFS interval. (3) The source STA receives an ACK frame and determines that the data is transmitted correctly. After the DIFS interval, a idle time window is displayed, which is called a contention window, it indicates that the STA contention channels may occur. If you find that the channel is in use when detecting the channel, STA uses the backoff algorithm of the CSMA/CA protocol. Freeze the backoff timer. As long as the channel is idle, the backoff timer countdown. When the backoff timer is reduced to zero, the STA sends the frame and waits for confirmation. If no ACK frame is received, the next frame must be retransmitted. The CSMA/CA protocol with the RTS/CTS handshake signal does not send data frames immediately after detecting that the channel is idle and waits for the DIFS interval. Instead, the CSMA/CA protocol sends the RTS packet to the target STA, after receiving the RTS packet, the destination STA sends the packet CTS packet to the source STA. After this handshake, the data frame can be sent. The RST/CTS handshake signal can effectively avoid hiding the terminal.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.