Module 2: Data Link Layer & MAC Sublayer
Discuss CSMA/CA with the help of a flowchart.
CSMA/CA with the Help of a Flowchart
Definition. Carrier Sense Multiple Access with Collision Avoidance is the MAC protocol of WLANs (IEEE 802.11 DCF). In wireless a station cannot detect a collision while transmitting, so instead of detecting collisions it avoids them: the station senses the channel, waits an inter-frame space, and — if others may also be waiting — picks a random backoff interval so that waiting stations do not start together. Every unicast frame is ACKed, because losses from fading/interference are as likely as collisions.
Flowchart
+----------------------------+
| Station has a frame to |
| transmit |
+-------------+--------------+
|
v
+----------------------------+
| Sense the medium |
| (physical carrier sense + |
| virtual sense via NAV) |
+-------------+--------------+
|
medium idle for DIFS ?
| |
YES NO
| |
v v
+----------------------+ +---------------------------+
| Transmit the frame | | Wait until medium is idle |
+----------+-----------+ | choose random backoff k |
| | in [0, CW]; start timer |
| +-------------+-------------+
| |
| v
| +--------------------------+
| | medium busy ? --YES--> freeze timer,
| | | resume later
| | NO |
| +----+---------------------+
| |
| timer = 0 ? --NO--> back to sensing
| YES
| v
| +--------------------------+
| | Transmit the frame |
| +------------+-------------+
| |
| wait SIFS
| v
| +--------------------------+ YES
| | ACK received within |----------> DONE
| | ACK timeout ? | (success,
| +------------+-------------+ clear CW)
| NO
| v
| +--------------------------+
| | CW = min(2*CW+1, CWmax); |
| | retry = retry + 1 |
+--------+--------------------------+
| |
retry <= retryLimit | retry > retryLimit
| v
| +------------------+
| | DROP the frame |
| | report failure |
| +------------------+
v
go back to SENSE THE MEDIUM
Explanation of the steps
- Carrier sense (physical + virtual). Before sending, the station checks the channel. 802.11 adds virtual carrier sense: the duration field of a received RTS/CTS/data frame lets every other station set its NAV (Network Allocation Vector) — a timer for how long the medium will stay busy. Transmission is allowed only when both the NAV and the physical sensing are idle.
- DIFS. If the medium has been idle for a DCF Inter-Frame Space (DIFS) the station may transmit immediately.
- Random backoff. If the medium is busy, or after a failed transmission, the station draws a random number of slot times from the contention window [0,CW] and decrements it only while the medium is idle; if the medium becomes busy the timer freezes. When it reaches zero the frame is transmitted. This randomisation is precisely what avoids the collision that would occur if all waiting stations started at the same instant.
- SIFS + ACK. After transmitting, the receiver waits a Short Inter-Frame Space (SIFS) — shorter than DIFS, so the ACK always wins the medium — and returns an ACK. If no ACK arrives within the ACK timeout, the frame is presumed lost: the contention window doubles (CW=min(2CW+1,CWmax)), a new random backoff is drawn and the frame retransmitted, until the retry limit is exceeded and the frame is dropped.
- Optional RTS/CTS. For large frames the sender first sends a short RTS; the receiver replies CTS after SIFS. Both are heard by neighbouring stations, which set their NAV and stay silent for the whole exchange (RTS → CTS → DATA → ACK). This reserves the medium and solves the hidden-terminal problem.
Summary of the timing order
SIFS<DIFS⇒ACK has priority over any new data transmission
Similar questions
Coursify Android App
Generate AI courses, take quick quizzes between classes, and master complex engineering concepts on the go.