Collision detection classification
Carrier Sense Multiple Access/Collision Detection (CSMA/CD)
This solution requires the device to perform the channel detection while sending the frame. Listen to determine whether a collision occurs. If a collision is detected during data transmission, perform the following collision handling operations:
Send special blocking information and stop sending data immediately: Special The blocking information is an all-one signal of several consecutive bytes, which is intended to strengthen the collision so that other devices can detect the collision as soon as possible.
Wait for a random time within a fixed time (1 contention period times at the beginning) and send again.
If the collision still occurs, the truncated binary exponential avoidance algorithm will be used to send. That is, within ten times, stop sending randomly within twice the time of the previous “fixed time”, and after ten times, stop randomly sending again within the previous “fixed time”. If it fails after 16 attempts, it will give up sending.
This solution is applied to
Ethernet (DIX Ethernet V2) standard, IEEE 802.3 standard
li>
Carrier Sense Multiple Access/Collision Avoidance (CSMA/CA)
This solution uses active collision avoidance instead of passive detection to solve the collision problem. It can meet the needs of those who are not easy to accurately detect whether there is a collision, such as wireless domain names.
The CSMA/CA protocol mainly uses two methods to avoid collisions:
When the device wants to send a frame, and the frame hears that the channel is free , After maintaining for a period of time, wait for a random period of time when it is still free before submitting the data. Since the waiting time of each device is randomly generated, it is likely to be different, which can reduce the possibility of collision.
RTS-CTS three-way handshake (English: handshake): Before the device wants to send a frame, it first sends a small RTS (Request to Send) frame to the nearest The Access Point waits for the target to respond with a CTS (Clear to Send) frame before starting to send. This method can ensure that there will be no collision when sending data next. At the same time, because the RTS frame and the CTS frame are very small, the invalid overhead of sending is reduced.
This solution is applied to
IEEE 802.11 standards for wireless local area networks.
CSMA/BA
Carrier Sense Multiple Access with Bitwise Arbitration (English: Carrier Sense Multiple Access with Bitwise Arbitration, CSMA/BA)< /p>
CSMA/CP
Carrier Sense Multiple Access with Carrier Preemption (CSMA/CP)
Binary exponential backoff Algorithm
In the CSMA/CD protocol, once a conflict is detected, in order to reduce the probability of re-conflict, it is necessary to wait for a random time, and then use the CSMA method to try to transmit. In order to ensure that this backoff remains stable, a binary exponential backoff algorithm is used. The algorithm process is as follows:
1. Divide the time after the conflict into 2t time slots
< p>2. After the first collision, each station waits for 0 or 1 time slot to start retransmission3. After the second collision, each station randomly chooses to wait for 0, 1, 2 or 3 time slots at the beginning of retransmission
4. After the i-th collision, randomly select a waiting time slot number between 0 and 2 to the i-th power minus one, and start retransmission
5. After 10 collisions, the number of time slots to wait for is fixed between 0 and 1023 (2 to the 10th power minus one)
6. After 16 collisions, send If it fails, report to the upper level.