802.15.4 CSMA-CA Channel Access

Trace NB, BE, CW, CCA, busy-channel retries, ACK feedback, and slotted versus unslotted channel access

animation
802.15.4
mac-layer
protocols
wsn
wireless
Interactive IEEE 802.15.4 CSMA-CA workbench showing random backoff, clear channel assessment, slotted contention windows, CAP fit checks, collision risk, and retry behavior with formula traces and mobile-safe reference material.

802.15.4 CSMA-CA Channel Access

IEEE 802.15.4 MAC Channel access Slotted + unslotted

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.

Slottedchannel access mode
0-7initial backoff periods
2 CCAschecks before transmit
Readycurrent outcome
1 Start with the variables

NB counts busy-channel backoffs, BE sets the random window, and CW is used only in slotted mode.

2 Watch the slot choice

The device draws from [0, 2^BE - 1]. At 2.4 GHz, one backoff period is 20 symbols, or 320 microseconds.

3 Separate CCA from ACK

A busy CCA changes NB and BE. A missing ACK is frame retry feedback after a transmission attempt.

4 Compare modes

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.

Current stage Initialize
Active device CCA window Busy or collision risk Transmit / ACK
When CCA is busy

NB increases, BE grows toward macMaxBE, and the next random window gets wider before another CCA.

When ACK is missing

The frame was already sent. The MAC frame retry process runs channel access again for the retransmission.

When CAP is short

In slotted mode, a transaction that cannot finish in the remaining CAP waits for the next superframe.

When BE is tuned higher

Dense networks get fewer repeated slot clashes, but the expected access delay increases.

Trace checklist

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.

1.63 ms Expected first-attempt access time

Average backoff plus CCA time before the data frame starts.

18% Contention pressure

Estimated chance that a learner should expect busy CCA or collision-like feedback.

25.0 ms Worst-case CSMA wait

Upper-bound backoff time before channel access failure is reported.

Fits CAP Slotted CAP check

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

Slotted CSMA-CA

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.
Unslotted CSMA-CA

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
NBNumber of backoffs

Incremented when CCA finds the channel busy. If NB exceeds macMaxCSMABackoffs, channel access fails.

BEBackoff exponent

Controls the random window. After a busy CCA, BE increases up to macMaxBE.

CWContention window

Used only in slotted CSMA-CA. It starts at 2 and decrements after each clear CCA.

Timing constants
Symbol16 us at 2.4 GHz

The 250 kbps O-QPSK PHY uses 16 microsecond symbols for these timing calculations.

Backoff20 symbols

aUnitBackoffPeriod = 20 symbols, so one backoff period is 320 microseconds.

CCA8 symbols

Clear channel assessment is modeled as 128 microseconds of receive/listen time.

Common learner traps
TrapBusy CCA is not ACK loss

CCA happens before transmission. ACK loss happens after a frame was sent and may trigger a frame retry.

TrapRaw bitrate is not capacity

Backoff, CCA, ACK, inter-frame spacing, and safe utilization margins reduce usable throughput.

TrapMore retries cost energy

Retries improve delivery probability but keep the radio awake longer and can worsen congestion.