Sub topic 7
Sharing one channel: static versus dynamic allocation
This chapter assumes you know what the data link layer does in the layered model. It also assumes you know bandwidth, transmission delay and propagation delay, and that you have seen the Poisson distribution. The chapter sets up the medium access control (MAC) problem. Every later protocol in this tutorial, from ALOHA to CSMA/CD, is an answer to it.
The medium access control problem
Some links are point-to-point, with exactly one sender and one receiver. Others are broadcast links, where many stations share one channel and every transmission can be heard by all of them. Examples are a coax Ethernet segment, a Wi-Fi cell, and a satellite uplink.
On a broadcast link, two stations that transmit at overlapping times corrupt each other's signals. This event is a collision, and neither frame can be decoded. The MAC sublayer decides who may transmit and when. It sits at the bottom of the data link layer.
Any allocation scheme is judged on three things:
- Throughput: the fraction of channel time that carries successful frames.
- Delay: how long a frame waits before it is delivered.
- Fairness: whether each station gets a reasonable share.
Static allocation
Static allocation splits the channel into fixed pieces, one per station, in advance.
- Frequency division multiplexing (FDM) gives each station its own frequency band.
- Time division multiplexing (TDM) gives each station a recurring time slot.
Static allocation has no collisions and needs no coordination while the system runs. It works well when there are few stations and each has steady traffic, as with telephone trunks.
It works badly for bursty traffic, where a station sends a lot for a short time and is idle the rest of the time. An idle station's slice goes unused, and no other station can borrow it.
Why static allocation adds delay
Take a channel of capacity C bits/s and Poisson frame arrivals at rate λ frames/s. Let frame lengths be exponentially distributed with mean 1/μ bits, so the service rate is μC frames/s. For an M/M/1 queue, the mean delay is:
T = 1 / (μC − λ)
Now split the channel into N subchannels. Each has capacity C/N and receives arrivals at rate λ/N:
T_N = 1 / (μC/N − λ/N) = N / (μC − λ) = N · T
Splitting into N static pieces makes the mean delay N times worse than one shared channel, even though total capacity and total load are unchanged. The cause is that a frame can wait in one station's queue while other subchannels sit idle.
import math
def mean_delay(capacity_bps, mean_frame_bits, arrival_rate, n=1):
"""Mean M/M/1 delay in seconds when the channel is split into n equal parts.
arrival_rate is the total rate over all stations, in frames per second.
"""
service_rate = capacity_bps / mean_frame_bits # frames per second
if arrival_rate >= service_rate:
return math.inf
return n / (service_rate - arrival_rate)
C = 100_000_000 # 100 Mbps
L = 10_000 # mean frame length in bits
lam = 5_000 # total arrivals, frames per second
print(mean_delay(C, L, lam)) # 0.0002 s, one shared channel
print(mean_delay(C, L, lam, n=10)) # 0.002 s, ten static subchannelsUtilization under TDM
Suppose N stations share a TDM frame with one slot each, and only k of them have data. The channel carries useful data in only k of every N slots, so utilization is at most k/N. A single active station among 20 gets 5% of the channel while the other 95% goes to waste.
Dynamic allocation
Dynamic allocation assigns the channel on demand, so an idle station uses none of it. Dynamic schemes need rules that stations follow to avoid or resolve conflicts, and the rules have a cost in the form of collisions, waiting for a turn, or control overhead.
Analyses of dynamic schemes usually rest on these assumptions:
- Independent stations. N stations each generate frames. After generating one, a station is blocked until the frame is sent.
- Single channel. All stations use one channel, and all can send and receive on it. Stations are assumed equivalent, though protocols may give priorities.
- Collisions. If two frames overlap in time, the signal is garbled, and both frames must be retransmitted. Collisions are the only source of errors in the model.
- Time model. In continuous time, a frame can start at any instant. In slotted time, time is divided into intervals and frames start only at slot boundaries.
- Carrier sense. Stations either can tell whether the channel is in use before sending (carrier sense) or cannot.
Different combinations of these assumptions give different protocols. Pure ALOHA uses continuous time with no carrier sense. Slotted ALOHA uses slotted time with no carrier sense. CSMA variants use carrier sense.
A taxonomy of MAC protocols
| Family | Who decides who sends | Collisions | Behaves well when |
|---|---|---|---|
| Static (FDM, TDM) | Fixed assignment | None | Few stations, steady load |
| Random access | Each station, on its own | Yes, then retry | Load is light and bursty |
| Controlled access | A master or a token | None | Load is heavy, bounded delay needed |
GATE questions often ask which family a named protocol belongs to. Ethernet's CSMA/CD and Wi-Fi's CSMA/CA are random access. Token ring and polling are controlled access.
Trade-offs to remember
- At light load, random access gives low delay because a station sends at once. Static and controlled schemes make a station wait for its slot or turn even when nobody else is active.
- At heavy load, random access wastes time on collisions and retries. Static and controlled schemes keep the channel busy with useful frames.
- Static allocation wastes capacity when stations are idle, but the wasted share is predictable and each station always gets its share.
Common mistakes
- Treating slotted time as meaning that stations take turns. In slotted ALOHA a station sends at the next slot boundary without asking anyone, so two stations can still choose the same slot.
- Assuming a dynamic scheme always beats a static one. Under heavy load with steady traffic, TDM can have higher utilization than a random-access protocol that wastes slots on collisions.
- Mixing up the total arrival rate λ and the per-station rate λ/N when applying the delay formula.
Exercise
A 10 Mbps channel is shared by 20 stations using TDM with equal slots. Only one station has data to send, and it has plenty. What is the highest data rate that station can achieve, and what fraction of the channel is wasted?
Show answer
The station owns 1 of every 20 slots, so its rate is at most 10 Mbps / 20 = 0.5 Mbps. Utilization is 1/20 = 5%, so 95% of the channel capacity is wasted.
Exercise
A single shared channel has mean delay T = 0.4 ms for a given load. The same capacity is divided into 8 equal static subchannels, and the total load is unchanged. What is the mean delay of the divided system, and why is it larger?
Show answer
The delay is N · T = 8 × 0.4 ms = 3.2 ms. Each subchannel has 1/8 of the capacity and receives 1/8 of the arrivals, so its service time grows by a factor of 8 relative to the queueing capacity left over. A frame can wait in one station's queue while other subchannels are idle.