CSMA/CA is made up of following three components (process). So if you have clear understanding of each of the component processes, you would understand what CSMA/CA is.
CS : Carrier-SensingMA : Multiple AccessCA : Collision Avoidance
Now let's think of each of these component process. The centrol component among this is 'MA', so I will start with MA.
After the three components, the last section puts them together as one procedure, with the timing that 802.11 actually uses.
What is MA ?
Every radio system has to answer one question first: how do many devices share one channel? The answer decides everything else on this page. WiFi answers it with contention, so the devices compete for the channel instead of receiving a schedule.
MA stands for Multiple Access. What does it mean ?
Simply put, Multiple Access is 'sharing (accessing) a single physical resource among 'Multiple' entities (e.g, multiple device, multiple persons etc).
For example in our daily life, I can say 'any road (or street) with a lot of cars running on it is a kind of Multiple Access. The road in front of your house is a physical resource and that physical resouce is shared (accessed) by many cars.
In similar logic, Ethernet (e.g, LAN system) can be Multiple Access system. In LAN (Wired LAN) system, many network cards are connected to a single LAN cable backbone. Even Wireless LAN can also be a Multiple Access system since multiple Wireless device is sharing same physical resource which is same RF frequency.
There are two broad ways to organize Multiple Access. In the first, a central controller divides the resource and hands out the pieces. Cellular systems work this way: the base station schedules time, frequency or codes, as in TDMA, FDMA, CDMA and OFDMA. In the second, there is no schedule, and each device decides for itself when to transmit. Classic Ethernet and WiFi work this way, which is why they need the rules for sensing and for avoiding collisions described in the next sections. Since 802.11ax, WiFi also has a scheduled mode. The AP sends a Trigger frame and assigns OFDMA resource units to several stations. But even then, the AP itself first wins the channel through contention.
Scheduled or contended : cellular hands out resources from the base station, while WiFi lets each device compete.Contention needs rules : CS and CA are those rules for WiFi.
What is CS ?
To make this kind of Multiple Access system work properly, all the device sharing the resource should have a certain techniques to avoid conflict among the multiple devices competing for the same resource. This 'conflict avoidance technology' (called 'collision avoidance system') used in ethernet is called 'CS' (Carrier Sensing).
CS (Carrier Sensing) may sound intimidating but the concept is simple. it is what you do every time you drive your car from your house into a big road in front of your house. When you drive into a road, you don't just drive into the road. If you do that, you may easily get hit by other cars driving along the road. Usually you take a look at the traffic on the road first. and if there is no cars passing by the road, then you drive into the road. and if there is a car passing in front, you just wait until it passes by. In other words, you are 'Sensing' the traffic and then drive into (or wait).
It is same logic in Ethernet System. Before a device send any data, first it checks if there is any other traffice sent by other device. In other word, it 'Sense' if there is any traffic sent by other device. If there is no traffic, it sends its own data. If there is traffic, it wait until the traffic passes by.
What is CA ?
In case of Wired Ethernet, they use CD (Collision Detection), but in case of Wireless case the device cannot detect the collision directly as in Wired case since Wireless LAN Device cannot detect any incoming signal while it is transmitting since it is half Duplex (TDD). It means that the device cannot detect (using reciever chain) anything while it is transmitting (using transmitter chain), thus the device cannot perform CD (collision dection) while it is transmitting.
In case of CD, the device is directly check the voltage level on wire, but in wireless case the device cannot check collision in this way.
Then how Wireless device can detect collision ?
In CA (Collision Avoidance) method, the device is waiting for ACK frame from the reciever. If it does not detect the ACK frame from the reciever within a certain time frame, the transmitter assumes that there is some collision happened and stop transmitting for a certain backoff time.
The problem of this mechanism is that it is creating a lot of overhead due to the collision detection and ACK waiting time, the overhead may take around 50 %.
So where does the avoidance itself happen? It happens before the transmission, in the random backoff. When the channel becomes free, several waiting devices would otherwise start at the same moment and collide. So each device draws a random number of slots between 0 and its contention window, CW, and counts it down while the channel stays idle. The device with the smallest number transmits first, and the others see its signal and freeze their counters. With the OFDM PHY, a slot is 9 microseconds, and CW starts at CWmin = 15. After every failed attempt, with no ACK, the device roughly doubles CW, up to CWmax = 1023. So repeated collisions spread the devices over a wider range of slots.
We can check the 50 % figure with one example. Let's send a 1500-byte IP packet at 54 Mbps in the 5 GHz band. With a 24-byte MAC header, 8 bytes of LLC/SNAP and a 4-byte FCS, the MPDU is 1536 bytes. That takes 248 microseconds on the air, including the 20 microsecond preamble. Before it come DIFS, 34 microseconds, and an average backoff of 7.5 slots, 67.5 microseconds. After it come SIFS, 16 microseconds, and an ACK at 24 Mbps, 28 microseconds. The total is 393.5 microseconds for 12000 bits, which is 30.5 Mbps, or 56 % of 54 Mbps. The same packet at 6 Mbps reaches 90 %, because the overhead is a fixed time and the data time is long. So the faster the PHY, the larger the share of the overhead. This is why 802.11n added frame aggregation, A-MPDU, with a single Block Ack for many frames.
Backoff is the avoidance : a random wait of 0 to CW slots separates devices that were waiting for the same idle moment.No ACK means a collision : the device doubles CW and tries again.Overhead grows with the rate : about 44 % at 54 Mbps for a 1500-byte packet, about 10 % at 6 Mbps.
Channel Sensing - Carrier Sensing - in Action
Now let's put sensing and backoff together in time. A WiFi device senses the channel in two ways. Physical carrier sensing, CCA, listens to the energy and the preambles on the air. Virtual carrier sensing reads the Duration field of frames sent by others and sets the NAV. The channel counts as busy if either one says so.
Overall procedure of Carrier Sensing and Data Transmission goes as follows.
- (A) : Before a device try to transmit any data, it start Carrier Sensing.
- (B) : If the device detect any carrier signal (i.e, some other device is using the channel), it just go back to 'Waiting' mode. It keeps sensing the carrier, and after the channel becomes free again, it waits DIFS plus a random BackOff Period before it transmits.
- (C) : Even if the carrier is not busy (i.e, even if nobody is using the channel), the device keep sensing the carrier for a certain duration (DIFS). If it detect any carrier signal during this period, it go back to 'Waiting' mode. It keeps sensing the carrier, and after the channel becomes free again, it waits DIFS plus a random BackOff Period before it transmits.
- (D) : If no carrier signal is detected for a certain period (DIFS), the device assume that the channel is clear (nobody is using the channel) and it transmit its own data.

Case A : the device starts carrier sensing, and a DIFS window opens.Case B : a carrier is detected at the start of DIFS, because another node is already using the channel. The device goes to the backoff.Case C : the carrier appears in the middle of DIFS. The result is the same as case B.Case D : no carrier until the end of DIFS, so the device transmits its Data.
The picture is a simplified view, so let's add two details from the real DCF procedure. First, the device does not stop sensing during the backoff. It counts the backoff slots down only while the channel is idle. When another device starts to transmit, the counter freezes, and it resumes after the channel has been idle for DIFS again. So a device that lost one round keeps its remaining count and gets a better chance in the next round. Second, DIFS is not a free number. It equals SIFS plus two slots. With the OFDM PHY in 5 GHz, that is 16 + 2 x 9 = 34 microseconds. With 802.11b DSSS in 2.4 GHz, it is 10 + 2 x 20 = 50 microseconds. An ACK waits only SIFS, which is shorter than DIFS, so the ACK always wins the channel over a new data frame.
Two kinds of sensing : CCA on the air and the NAV from Duration fields, and either one makes the channel busy.Backoff counts idle slots : the counter freezes while the channel is busy, and it does not restart from a new random number.DIFS = SIFS + 2 slots : 34 microseconds in 5 GHz OFDM, so SIFS-spaced responses such as ACK always go first.
Reference :
[2] 802.11n Tutorial