What is the CSMA CD/CA protocol? – CSMA CD vs CSMA CA.
The CSMA stands for Carrier sense multiple access, a method for accessing underlying shared channels (e.g LAN ) for sending a frame. The protocol works at the data link layer of the OSI model. Within the data link, the MAC sublayer implements channel access.
With CSMA, a node states listening to the medium before sending a frame. The details are in CSMA Protocol.
CSMA CD and CA are another two improved versions of the protocol. In this tutorial, we will discuss both.
What is CSMA CD protocol?
- In CSMA CD, the CD stands for collision detection.
- Before sending a frame, a station makes sure that no other station transmitting. For that, it starts listening to the shared channel.
- Once a channel is free, the station starts transmitting frames.
- While transmitting, a transmitting station starts listening to the channel to detect if there is any collision.
- If detects the collision, the station stops transmitting and waits for a random time, and updates the retransmission timer.
- If the counter reaches the threshold, the frame is discarded.
Because of detecting collision earlier (while transmitting), the protocol provides faster transmission of frames.
What is the CSMA CA protocol?
The CA stands for collision avoidance. This means the protocol, tries to send packets in such a way that there are minimum chances of a collision. The CSMA-CA is for wireless networks. In a wireless network, a terminal only can see the Access Point (Wireless router). If a terminal starts transmission, it is very difficult for other nodes on the network to detect the activity. This is called the Hidden Node Problem. So chances to detect a collision are very less, collision avoidance is a better option for optimizing CSMA for wireless LAN.
The following are the steps for a transfer in wireless LAN.
- A station starts listening to the channel.
- If the channel is not free waits for a random time and starts again.
- Once the medium is free, send a Request To Send (RTS) message to the Access Point(AP) and wait for an answer.
- If Access Point can allow the transfer, it sends Clear to Send(CTS) with yes to the sender. At a single time, AP can say yes to only one station.
- If CTS is with no, the sender needs to wait and again try after a random time.
CSMA CA vs CSMA CD :
We have seen that each version of CSMA, has a different purpose. But still, we can compare both. Following is a list for CA vs CD for CSMA.
- CSMA CA is most suitable for wireless networks and CSMA/CD for a wired network.
- The CSMA CD gets active after a collision, while CSMA/CA is before the collision.
- In CSMA CA a transmitting station first takes permission from a central device (AP), while in CSMA/CD, the station starts sending data as the channel is free.
- CSMA/CA is less efficient than CSMA/CD.