CSMA/CA (Carrier Sense Multiple Access/Collision Avoidance)
What is carrier sense multiple access/collision avoidance (CSMA/CA)?
Carrier sense multiple access/collision avoidance (CSMA/CA) is a protocol for carrier transmission in 802.11 networks. It was developed to minimize the potential of a collision occurring when two or more stations send their signals over a data link layer.
In this scenario, CSMA requires each station to first check the state of the medium before initiating a transmission. This helps to avert potential collisions by listening to the broadcasting nodes and then informing devices to transmit when the channel is free.
For example, as soon as a node receives a packet to transmit across the network, it will check to ensure the channel is clear and no other node is transmitting at the same time. If the network channel is idle, the packet is sent.
If the channel is not clear, the node waits for a randomly chosen period of time -- in microseconds -- and then checks again to see if the channel is clear. This is called the backoff factor and is counted down using a backoff counter.
If the channel is idle when the backoff counter reaches zero, the node transmits the packet. If the channel is not clear when the backoff counter reaches zero, the backoff factor will reset itself and repeat the process.
When the receiver gets the packet frame intact, it transmits an acknowledgment (ACK) to the sender.
What is CSMA/CA on a network?
On a MAC layer protocol, CSMA/CA leverages a three-step carrier sense and transmission sequence. This approach helps to minimize the potential for collisions.
To better understand CSMA/CA, let's examine each component individually.
Carrier sense (CS). Represents the idea that all participants may only send data over the network whenever the transmission medium is idle. CS detection will continue to check the channel, and the data will not be sent until the medium is available.
Multiple access (MA). Because numerous stations share a transmission medium, it is vital that all of them adhere to a binding protocol to ensure communication.
Collision avoidance (CA). A complex schedule that attempts to prevent potential collisions by ensuring that two or more participants do not initiate a transmission at the same time. Whenever overlapping does occur, it will be detected and the process will be repeated.
CSMA/CA wired vs. CSMA/CA wireless networks
All network participants in a local area network (LAN) share a transmission medium such as a cable or a bus network. Even wireless networks -- that do not use cables -- and WLAN can only send and receive a transmission over a specific radio range.
As such, communications in 802.11 are similar to early half-duplex Ethernet networks. This made it necessary to establish a protocol for a wireless network to regulate the use of the medium.
Like any form of communication, only one party can send information at a time. If every device starts communicating at the same time, the network will run into trouble. The primary objective is to avert potential collisions and overlaps within the network when data packets meet so they do not alienate their contents.
CSMA/CA reduces the frequency of collisions and comes with a plan to continue if a collision does occur. However, CSMA/CA is more important for wireless communication than cable transmissions. Wireless networks cannot run in the same order because of the various technologies involved.
The CSMA/CA protocol creates a decentralized network where all participants follow a predefined set of rules and organize transmissions accordingly. However, sometimes they will encounter a hidden station issue because of the technical differences between both technologies.
For example, wireless network stations have a limited range. This means network participants will not recognize each other if their respective wireless network station is out of range from the another.
While it is unlikely the two stations will not recognize each other, it is highly likely that they will reach the station located near them simultaneously. Thus, transmission overlaps at the receiving node leads to data loss.
If both transmitters do not detect the collision, they will not attempt to repeat the process. As a result, CSMA/CA has its limitations. It is also the reason why an optional extension called Request to Send/Clear to Send (RTS/CTS) was created.
What is the difference between CSMA/CA and CSMA/CD?
Unlike CSMA/CA, which acts to prevent collisions before they happen, carrier sense multiple access/collision detect (CSMA/CD) deals with transmissions after a collision has occurred.
Half-duplex Ethernet networks have CSMA/CD built-in to deal with the challenges that come with wireless networks. Instead of trying to avoid collisions, CSMA/CD instructs network participants on how they should proceed when a collision does occur.
The primary objective of CSMA/CD is to ensure that a collision does not happen on the next attempt.