NB counts busy-channel backoffs, BE sets the random window, and CW is used only in slotted mode.
802.15.4 CSMA-CA Channel Access
Trace NB, BE, CW, CCA, busy-channel retries, ACK feedback, and slotted versus unslotted channel access
802.15.4 CSMA-CA Channel Access
CSMA-CA is the queueing rule for shared 802.15.4 radio time
Step through how a constrained device chooses a random backoff, listens with clear channel assessment, transmits only when the medium is idle, and either succeeds, retries, or reports channel access failure.
The device draws from [0, 2^BE - 1]. At 2.4 GHz, one backoff period is 20 symbols, or 320 microseconds.
A busy CCA changes NB and BE. A missing ACK is frame retry feedback after a transmission attempt.
Beacon-enabled networks use slotted CSMA-CA in the CAP. Non-beacon networks use unslotted CSMA-CA asynchronously.
Initialize
Set NB=0, BE=macMinBE, CW=2 for slotted mode.
Random Backoff
Wait a random number of unit backoff periods.
CCA 1
Listen for 8 symbols and decide whether the channel is idle.
CCA 2 or TX
Slotted mode needs a second clear CCA; unslotted can transmit after one.
Data + ACK
Transmit the frame and wait for a MAC acknowledgement if requested.
Retry or Done
Increase BE after busy CCA, retry after missing ACK, or finish successfully.
Channel access timeline
Press Step or Play to trace the algorithm from initialization through backoff, CCA, transmission, and retry decisions.
NB increases, BE grows toward macMaxBE, and the next random window gets wider before another CCA.
The frame was already sent. The MAC frame retry process runs channel access again for the retransmission.
In slotted mode, a transaction that cannot finish in the remaining CAP waits for the next superframe.
Dense networks get fewer repeated slot clashes, but the expected access delay increases.
Use this sequence whenever you debug an 802.15.4 channel-access problem.
- Check whether the network is beacon-enabled or non-beacon.
- Calculate the current backoff window from BE before judging latency.
- Separate pre-transmit busy CCA from post-transmit ACK loss.
- For slotted mode, confirm that the transaction still fits in the CAP.
Controls
Change one thing at a time, then step through the sequence and watch the formulas update.
Average backoff plus CCA time before the data frame starts.
Estimated chance that a learner should expect busy CCA or collision-like feedback.
Upper-bound backoff time before channel access failure is reported.
Slotted devices must finish before the CAP ends; otherwise they defer.
Formula trace
Backoff range = [0, 2^3 - 1] = 0-7 periods
1 period = 20 symbols x 16 us = 320 us
CCA = 8 symbols = 128 us; slotted mode requires CW=2 clear CCAs
Mode comparison
Used in beacon-enabled 802.15.4 networks during the Contention Access Period.
- Backoff periods align to superframe boundaries.
- Initial CW is 2, so two consecutive clear CCAs are required.
- The transaction must fit in the remaining CAP.
Used in non-beacon networks where devices transmit asynchronously.
- No beacon synchronization or slot boundary alignment.
- One clear CCA is enough before transmission.
- Coordinator or receiver availability is handled by network design.
Reference material
Algorithm variables
Incremented when CCA finds the channel busy. If NB exceeds macMaxCSMABackoffs, channel access fails.
Controls the random window. After a busy CCA, BE increases up to macMaxBE.
Used only in slotted CSMA-CA. It starts at 2 and decrements after each clear CCA.
Timing constants
The 250 kbps O-QPSK PHY uses 16 microsecond symbols for these timing calculations.
aUnitBackoffPeriod = 20 symbols, so one backoff period is 320 microseconds.
Clear channel assessment is modeled as 128 microseconds of receive/listen time.
Common learner traps
CCA happens before transmission. ACK loss happens after a frame was sent and may trigger a frame retry.
Backoff, CCA, ACK, inter-frame spacing, and safe utilization margins reduce usable throughput.
Retries improve delivery probability but keep the radio awake longer and can worsen congestion.