Chapters

10 MAC Protocols: Sharing the Channel

networking-core
fund
mac

10.1 Start With Who Gets to Talk

Choose the Sharing Rule From the Hard Moment

Picture twenty battery sensors trying to report through one receiver after power returns. A protocol is a shared set of rules for exchanging data. IEEE 802.15.4 is one low-power radio and channel-sharing standard. Its name alone does not say how the installed devices behave when they all want the channel.

Write the local traffic story. Name each message type, time need, device count, who can hear whom, sleep limit, reply rule, retry limit, receiver, missed-frame action, and owner.

Test one sender, all senders, two hidden from each other, a busy channel, a sleeping receiver, a lost reply, a low battery, and recovery after a long outage. Measure useful delivery, delay, retries, listen time, and stored energy. An idle channel at one sender is not proof that the receiver is free.

Keep urgent local action safe when the shared channel is busy. The network can retry and report, but the device needs a known rule for a missed deadline.

This opening does not say that one access method always wins. Practitioner compares random, listen-before-send, and scheduled choices. Under the Hood examines backoff, hidden senders, timing, replies, load, mixed strategies, and the proof needed at the final site.

Use a simple field drill. Trigger every sensor at once, then repeat with two sensors hidden from each other. Record who sends, who waits, what the receiver gets, and how much energy each retry uses. Keep missed and late frames in the result.

Run the drill after a node, shelf, antenna, channel, report rate, or retry rule changes. If the hard moment no longer fits the promise, change the rule or narrow the promise before release.

A shared channel is like a narrow doorway: if every device talks whenever it wants, useful messages collide or waste battery waiting. MAC protocols are the rules that decide who may transmit, who must listen, and how the network recovers when two devices choose the same moment.

For IoT design, the question is practical before it is theoretical. Decide whether the workload is periodic, alarm-driven, mobile, sleepy, or dense, then choose the channel-sharing rule that can survive that behavior.

10.2 MAC Rules Decide Who Transmits

Medium Access Control, or MAC, is the data-link responsibility that controls access to a shared medium. In an IoT network the medium might be a Wi-Fi channel, an IEEE 802.15.4 channel, a sub-GHz LPWAN channel, or a wired bus. The MAC decision is local and immediate: listen, wait, transmit, acknowledge, retry, or sleep.

A good MAC choice is not simply a protocol name. It is a fit between traffic timing, node density, radio reachability, power budget, and failure behavior. CSMA/CA shares a channel by listening and backing off. TDMA shares a channel by assigning time. ALOHA-style access transmits with minimal coordination and accepts collisions when traffic is sparse enough.

The review question is therefore operational: what does the device do when another device wants the medium at the same time? A door sensor sending a rare alarm can tolerate a different access rule from a motor controller that must report in a bounded time window. A battery node that wakes for a few milliseconds cannot afford long idle listening, while a powered gateway can coordinate schedules, acknowledgements, and retries.

MAC evidence is local but it shapes the whole system. Lost frames become transport retries, stale dashboard values, missed alarms, and unnecessary battery drain. A defensible design names the local access rule, the expected traffic shape, the devices that cannot hear one another, and the field evidence that will trigger retesting.

10.2.1 Three Ways to Handle a Collision

Every shared-medium MAC design answers the same question with one of three strategies: let transmissions collide and accept the loss, detect a collision while it happens and stop early, or avoid collisions before they start. Classic wired Ethernet could afford the middle option, carrier-sense multiple access with collision detection (CSMA/CD): a station listens to its own cable while transmitting, and because the transmitted and received signal levels are close enough on a shared copper segment, it can recognize an overlapping signal and abort immediately.

Wireless radios cannot do this cheaply. A transmitting radio's own outgoing signal is far louder at its antenna than any incoming signal it might be trying to hear, so most radios are functionally half-duplex: they cannot listen for a collision while they are the one causing it. Carrier sensing before transmission also only proves the channel looked clear to the sender, not that it will stay clear at the receiver—the hidden-terminal problem covered below. Given both limits, most wireless MAC protocols choose the third option, collision avoidance (CSMA/CA): listen first, back off if busy, and reduce the odds of an overlap instead of trying to detect one after it starts.

Use Figure 10.1 to prepare the decision in three ways to handle a collision. The diagram names Conceptual CSMA/CA loop from frame readiness and profile-specific waiting or random backoff, the two anchors needed to assess conceptual csma/ca loop; the exact cca order, backoff update, retry limit, and acknowledgement behaviour are defined by the selected mac profile..

Conceptual CSMA/CA loop from frame readiness through profile-specific waiting or random backoff, local channel sensing, transmission, optional acknowledgement, success, bounded retry, or final failure. A separate busy-channel path defers, sleeps, or continues bounded backoff, and a caveat notes that idle local carrier sensing cannot detect every hidden sender.
Figure 10.1: Conceptual CSMA/CA loop; the exact CCA order, backoff update, retry limit, and acknowledgement behaviour are defined by the selected MAC profile. Open the full-size loop.

Use profile-specific waiting or random backoff to test Conceptual CSMA/CA loop from frame readiness in the diagram at Figure 10.1. Then inspect local channel sensing as the final qualifier on conceptual csma/ca loop; the exact cca order, backoff update, retry limit, and acknowledgement behaviour are defined by the selected mac profile.. That sequence keeps three ways to handle a collision tied to what is visibly labelled.

The busy-channel branch returns to bounded backoff; the success branch closes only after the selected profile’s acknowledgement condition is satisfied.

Contention

Devices compete for the same medium. Carrier sensing, random backoff, acknowledgements, and bounded retries help them share moderate traffic without a central schedule.

Scheduling

A coordinator or network service assigns time, frequency, or link opportunities. Access can become predictable and idle listening can fall when synchronization and slot allocation are maintained.

Random Access

Devices transmit with little coordination. This is attractive for sparse long-range telemetry, but successful throughput falls quickly as competing attempts increase.

MAC Family
Best Fit
Failure Mode
IoT Examples
CSMA/CA
Bursty traffic with moderate contention and devices that can sense much of the local channel.
Hidden terminals, retry storms, and battery drain when many nodes compete.
Wi-Fi and IEEE 802.15.4 style networks.
TDMA or scheduled access
Predictable reporting, bounded latency, or duty-cycled devices that can follow a schedule.
Wasted slots, synchronization overhead, and coordinator dependency.
Cellular scheduling and industrial time-slotted networks.
ALOHA-style access
Very sparse, low-duty-cycle telemetry where coordination would cost more than occasional retransmission.
Collisions rise rapidly if many devices transmit at the same time.
LoRaWAN-style uplink behavior and simple event reporting.

10.2.2 A Concrete Example: IEEE 802.15.4

IEEE 802.15.4 is worth naming because it is a real, deployed protocol that does not sit neatly in one MAC family. It defines the low-rate physical and MAC layers that ZigBee, Thread, and other low-power WPAN stacks build on, and it targets infrequent, short, low-duty-cycle transmissions—typically under 1% duty cycle—so battery devices can sleep almost all the time.

Its default channel-access rule is CSMA/CA, the same family described above, but 802.15.4 offers it in two forms. A non-beacon-enabled network uses unslotted CSMA/CA: every device senses the channel and backs off independently, with no coordinator managing timing—pure contention. A beacon-enabled network instead has a PAN coordinator broadcast periodic beacons that define a superframe, a repeating time structure inside which devices use slotted CSMA/CA to contend for access. That second mode blends the Contention and Scheduling categories from the table above: devices still contend for the channel, but only inside coordinator-defined time boundaries, which bounds worst-case access delay in a way pure contention cannot.

The lesson for MAC selection is not that 802.15.4 is the answer. It is that real standards often combine access strategies rather than picking one purely, and that the beacon-enabled versus non-beacon choice is itself a design decision with the same traffic-pattern and energy tradeoffs described in the evidence table below.

10.3 Choose MAC Rules from Evidence

Start with the workload instead of the protocol. Record whether messages are periodic, event-driven, alarm-first, bulk, or interactive. Then test whether devices can hear one another, whether a gateway can coordinate them, how long a battery device may listen, and what happens when a frame is missed.

That record should be tied to a physical layout, because shelves, machinery, walls, and antenna height can change who hears whom even when every node reports the same configured channel.

To test choose mac rules from evidence, open the diagram in Figure 10.2. Hidden terminal problem supplies one named condition; A carrier-sense range supplies the necessary comparison for hidden terminals make carrier sensing look successful at the sender while the receiver sees a collision.

Hidden terminal collision where two sensors cannot hear each other but both can reach the same gateway, causing overlapping transmissions at the receiver.
Figure 10.2: Hidden terminals make carrier sensing look successful at the sender while the receiver sees a collision.

Locate Hidden terminal problem on Figure 10.2 before checking A carrier-sense range. The visual’s third anchor, C carrier-sense range, completes hidden terminals make carrier sensing look successful at the sender while the receiver sees a collision. Carry Hidden terminal problem into choose mac rules from evidence; use C carrier-sense range as its limiting condition.

Evidence
What to Measure
Design Implication
Common Mistake
Traffic pattern
Inter-arrival time, burst size, alarm priority, retry tolerance, and reporting windows.
Periodic traffic can use schedules; irregular traffic may need contention or event slots.
Using a fixed schedule with no event or shared capacity, which may waste slots or delay unpredictable alarms.
Reachability
Which nodes hear each other, which only hear the gateway, and where obstacles create radio shadows.
Hidden terminals may need RTS/CTS, placement changes, more gateways, or scheduled access.
Assuming low average utilization means collisions will be rare.
Latency
Worst-case wait, backoff distribution, retransmission time, and queueing under bursts.
Safety or control messages need bounded access, priority, or a separate path.
Reporting average latency while hiding peak delay during contention.
Energy
Listen time, retry count, wake windows, synchronization cost, and acknowledgement behavior.
Sleeping outside a scheduled slot can save power, but missed synchronization can be costly.
Counting transmit energy while ignoring idle listening and retries.

Minimum retest record: record the traffic pattern and physical layout used for the choice; measure delivery after the retry limit, tail latency, retry or CCA-busy behaviour, and radio-on energy; retest after placement, density, traffic, schedule, or firmware changes.

10.3.1 Practitioner: Compare Mitigations

A warehouse has periodic inventory sensors behind metal shelving. The average channel load is low, but sensors on opposite aisles cannot hear each other and both can reach the gateway. Basic CSMA/CA without receiver-coordinated reservation may still lose frames because each hidden sensor believes the channel is idle. There are three defensible responses.

Improve Visibility

Move gateways, add gateways, or adjust antennas so more nodes can hear each other and the coordinator has cleaner reception.

Add Handshakes

Use RTS/CTS when control-frame overhead costs less than hidden-terminal retransmissions.

Schedule Traffic

Use slots when reports are predictable and deterministic delivery matters more than immediate unscheduled access.

The next claim about practitioner: compare mitigations depends on Figure 10.3. Its diagram makes RTS/CTS: reserve airtime across a hidden terminal and Node A explicit within rts/cts helps when a receiver can warn nodes that the sender cannot hear directly.

RTS/CTS handshake where a gateway grants a transmission and a hidden node defers using the duration information.
Figure 10.3: RTS/CTS helps when a receiver can warn nodes that the sender cannot hear directly.

Figure 10.3 places RTS/CTS: reserve airtime across a hidden terminal alongside Node A. Treat Can reach Gateway B as the diagram qualifier for rts/cts helps when a receiver can warn nodes that the sender cannot hear directly. That labelled limit reconnects the visual to practitioner: compare mitigations.

In IEEE 802.11, an optional RTS/CTS exchange can reserve the medium before a unicast data frame. Stations that hear the reservation information defer for the advertised duration through virtual carrier sensing, represented by the Network Allocation Vector (NAV). This handshake descends from MACA (Multiple Access with Collision Avoidance) and its refinement MACAW, media-access designs built specifically for wireless links that cannot rely on wired-style collision detection.

RTS/CTS can reduce some hidden-terminal collisions, but control overhead, control-frame collisions, interference geometry, and the configured frame-size threshold mean that it is not a universal cure.

10.4 MAC Collision and Timing Bounds

Under the hood, a MAC protocol is a set of timing and state rules. A contender may sense the channel, choose a random backoff, reserve the medium with control frames, send a data frame, wait for an acknowledgement, expand a retry window, or sleep until a scheduled slot. Each rule affects latency, energy, and how failures appear in logs.

Do not treat theoretical utilization as production proof. Pure ALOHA has an ideal maximum near 18% channel throughput and slotted ALOHA near 37%. These analytical maxima assume fixed-duration frames, independent Poisson transmission attempts, no capture effect, and no external channel loss; they are reference points, not deployment targets. CSMA/CA can perform much better at moderate load, but hidden terminals, exposed terminals, capture effects, noisy receivers, and acknowledgement loss change the field result.

MAC Mechanism
What It Protects
What It Costs
Proof to Keep
Carrier sense
Avoids transmitting over a detectable local sender.
Idle listening and false confidence when senders are hidden.
Clear-channel assessment thresholds and receiver-side collision logs.
Random backoff
Reduces repeated collisions after a busy channel or failed ACK.
Variable latency and extra awake time under contention.
Retry counts, backoff windows, and tail-latency measurements.
RTS/CTS or reservation
Lets a receiver warn nearby nodes before a data frame.
Control-frame overhead, especially for tiny payloads.
Hidden-terminal map, data-frame size threshold, and before/after retry rates.
Scheduled slots
Reduces contention among correctly synchronized and correctly scheduled participants, and lets devices sleep predictably.
Synchronization, coordinator dependency, and unused capacity.
Clock drift, missed slots, guard time, and slot utilization records.

Failure mode: reporting only channel utilization. A network can show low utilization and still drop critical frames if the radio geometry creates hidden terminals or if sleeping nodes miss their receive window.

Review Checklist

Collision Boundary

Name which collisions the design prevents, which it merely retries, and which it cannot observe directly.

Timing Boundary

Record worst-case access delay, retry delay, sleep window, and any synchronization dependency.

Energy Boundary

Separate transmit time, receive listening, overhearing, control frames, retry behavior, and resynchronization cost.

Retest Trigger

Retest after gateway moves, density changes, firmware alters backoff, or field logs show rising retries.

10.5 Hidden and Exposed Terminals

Carrier sensing answers a sender-side question: “Can I detect activity here?” Delivery is decided at the receiver. In a hidden-terminal case, two senders cannot hear one another, both judge the channel idle, and their frames can overlap at the same receiver.

An idle CCA result is not proof that the receiver is clear. Treat rising retries or missing acknowledgements as symptoms, not proof of a collision. Confirm the geometry: the senders cannot hear one another, both can reach or interfere at the same receiver, and controlled overlap makes delivery worse.

Figure 10.4 makes hidden and exposed terminals inspectable through Exposed terminal problem and B’s carrier-sense range reaches C. Those diagram labels establish the scope of exposed terminals waste spatial reuse; hidden terminals lose frames. the mitigation priorities are different.

Exposed terminal scenario where a node defers because it hears a nearby transmission even though its intended receiver would not be interfered with.
Figure 10.4: Exposed terminals waste spatial reuse; hidden terminals lose frames. The mitigation priorities are different.

Begin Figure 10.4 with Exposed terminal problem, then distinguish B’s carrier-sense range reaches C and D is outside B’s interference area. The diagram separates Exposed terminal problem from B’s carrier-sense range reaches C within exposed terminals waste spatial reuse; hidden terminals lose frames. the mitigation priorities are different. Keep both distinctions explicit in hidden and exposed terminals.

The opposite pattern is an exposed terminal. A sender waits because it hears a nearby transmission even though its own receiver could have accepted a concurrent frame. The cost is unnecessary waiting and lost spatial reuse, not necessarily packet loss. The Practitioner workbench tests this case.

10.5.1 Practitioner: Explore Exposed-Terminal Over-Deferral

Change the receiver positions and interference relationship, not just the sender distance. Decide whether deferral protects a receiver or merely blocks a safe concurrent transmission.

Hidden terminals create receiver-side overlap; exposed terminals create unnecessary silence. Diagnose the first with topology plus loss and retry evidence, and the second with blocked concurrency and lower-than-possible channel use.

10.6 Summary

  • MAC protocols decide when a local device may use a shared medium.
  • CSMA/CA fits moderate contention when carrier sensing sees enough of the local channel.
  • TDMA or scheduled access fits predictable traffic, bounded timing, and duty-cycled devices that can follow a schedule.
  • ALOHA-style access can be acceptable for sparse telemetry but degrades quickly as offered load increases.
  • Hidden terminals cause receiver-side collisions; exposed terminals waste spatial reuse.
  • Production MAC decisions need evidence about traffic, reachability, timing, energy, retries, and retest triggers.

10.7 Key Takeaway

Choose a MAC protocol from measured channel behavior, not from a protocol label. The defensible design states what the channel-access rule prevents, what it retries, what it cannot see, and when operators must retest the assumption.

10.8 See Also