Channel allocation and multiple access: ALOHA, CSMA, CSMA/CD
When many nodes share a single broadcast channel, who talks when? The flaw of static allocation, pure and slotted ALOHA efficiency, CSMA/CD, minimum frame size, and binary exponential backoff.
The original Ethernet, Wi-Fi and satellite links share a common problem: many nodes share a single broadcast channel. If two nodes send at the same time, the signals overlap and both are corrupted. This is called a collision. A multiple access protocol is a set of rules that decides who sends when, without a central authority.
On the exam this topic hits in two places: ALOHA efficiency calculation and the minimum frame size in CSMA/CD. Golden rules:
- Slotted ALOHA is , pure ALOHA is . In pure ALOHA the vulnerable period is two frame times.
- N nodes, probability : success .
- . You must hear the collision before the transmission ends.
- The backoff range doubles with every collision.
The channel allocation problem
An ideal shared channel (rate ) should provide:
- If only one node is sending, it can use the whole .
- If nodes are sending, each gets on average.
- There is no central coordinator (no single point of failure).
- It is simple and cheap.
Why is static allocation bad?
The simplest solution is to divide the channel into fixed parts: FDMA (frequency) or TDMA (time). Each node uses its own slice. The problem: when a node is silent its slice is wasted, and a node that is talking gets only . A simple model from queueing theory gives the mean delay:
Here is the channel capacity (bps), is the mean frame length (bits), and is the arrival rate (frames/s).
C = 100 Mbps, frame 10,000 bit, lambda = 5000 frames/s
mu C = 10^8 / 10^4 = 10,000 frames/s
Single channel : T = 1 / (10,000 - 5,000) = 0.2 ms
10 subchannels : each has C/10 and lambda/10
T = 1 / (1,000 - 500) = 2 ms (10 times)
With static division the delay is multiplied by . Because computer traffic is bursty, dynamic sharing is needed.
Protocol families
| Family | Idea | Example |
|---|---|---|
| Channel partitioning | Fixed slices | TDMA, FDMA, CDMA |
| Random access | Everyone sends at full rate, waits a random time after a collision | ALOHA, CSMA, CSMA/CD |
| Taking turns | Nodes talk in turn | Polling, token passing |
ALOHA
It was developed at the University of Hawaii for a radio network between the islands. It is the ancestor of random access.
Pure ALOHA
When a node has a frame it sends it immediately. If it collides, the node waits a random time and tries again. Let the duration of a frame be and let our frame start at .
t0 - T t0 t0 + T
|--------------|---------------|
a frame starting a frame starting
in this interval in this interval
collides collides
vulnerable period = 2T
Let be the average number of attempts (new + retransmissions) per frame time. If the attempts are assumed to follow a Poisson distribution, the probability that there is no other attempt in the interval is :
Slotted ALOHA
Time is divided into slots the length of one frame time. Nodes can send only at the start of a slot. A collision happens only among nodes that choose the same slot, and the vulnerable period drops to :
The other model in textbooks has nodes, each sending in every slot with probability :
The best is . As this converges to .
Worked example
, :
success : 5 x 0.2 x 0.8^4 = 0.4096
idle slot : 0.8^5 = 0.32768
collision : 1 - 0.32768 - 0.4096 = 0.26272
pure ALOHA same N, p : N p (1-p)^(2(N-1)) = 0.8^8 = 0.1678
On a 1 Mbps slotted ALOHA channel, the useful throughput in the best case is kbps.
PITFALL · versus . is the attempted load (including collided frames), is the fraction of successful frames. can exceed 1, never can. If is very large, almost every slot collides and .
CSMA: listen before you send
ALOHA is crude: it sends even when the channel is busy. CSMA (carrier sense multiple access) listens to the channel first.
- 1-persistent: if the channel is idle, send immediately; if busy, wait for it to become idle and send immediately. Two nodes that were waiting will certainly collide when it frees up.
- Non-persistent: if the channel is busy, wait a random time, then listen again.
- p-persistent: (slotted) if the channel is idle, send with probability , and with probability defer by one slot.
Listening does not eliminate collisions. Because of propagation delay, B may think the channel is idle and send, since A’s signal has not reached it yet. The longer the propagation (the longer the cable), the more likely a collision.
CSMA/CD: listen while sending too
This is the protocol of classic Ethernet. CD (collision detection): the node keeps listening to the channel while it sends. If it hears something different from its own signal:
- It stops sending immediately (there is no point in sending the corrupted frame to the end).
- It sends a 48-bit jam signal so that everyone notices.
- It waits a random time with binary exponential backoff, then starts over.
Minimum frame size
Worst case: A and B are at the two ends of the cable. A starts to send. Just before its signal reaches B, B starts too. News of the collision returns to A after . A must still be sending at that moment, otherwise it cannot attribute the collision to its own frame:
R = 10 Mbps, cable 2500 m, s = 2 x 10^8 m/s
dprop = 2500 / 2e8 = 12.5 us
Lmin = 2 x 12.5e-6 x 1e7 = 250 bit
Real Ethernet also accounted for repeater delays and chose 512 bits (64 bytes). When the speed is multiplied by 10, the allowed distance for the same 512 bits shrinks 10 times: 5120 m at 10 Mbps, 512 m at 100 Mbps (with the propagation calculation alone).
Binary exponential backoff
After the -th consecutive collision, the node chooses at random:
| Collision | range | Longest wait at 10 Mbps | Probability the two nodes collide again |
|---|---|---|---|
| 1 | 0, 1 | 51.2 µs | 1/2 |
| 2 | 0..3 | 153.6 µs | 1/4 |
| 3 | 0..7 | 358.4 µs | 1/8 |
| 10 and later | 0..1023 | 52.4 ms | 1/1024 |
After 16 attempts the frame is dropped and an error is reported to the upper layer. The idea: collisions mean heavy load; by enlarging the range you spread everyone out more as the load grows.
Ethernet efficiency
When many nodes always have a frame to send, approximately:
dprop = 12.5 us
1500-byte frame @10 Mbps : dtrans = 1200 us -> 1/(1 + 0.052) = 0.950
64-byte frame @10 Mbps : dtrans = 51.2 us -> 1/(1 + 1.22) = 0.450
When the frame is long and the cable short, the efficiency approaches 1.
Taking-turns protocols
- Polling: a master node asks each node in turn “do you have anything to send?”. There are no collisions, but there is polling delay, and if the master crashes the network stops. Bluetooth works this way.
- Token passing: a special token frame circulates from node to node; only the node holding the token sends. There are no collisions, but there is trouble if the token is lost or a node does not release it.
Wireless: why no CD?
In Wi-Fi, a sending node’s own strong signal drowns out the weak signal coming from afar; it cannot hear the collision. There is also the hidden terminal problem: A and C cannot hear each other but both send to B. So 802.11 tries to avoid collisions rather than detect them (CSMA/CA): a random countdown, an ACK for every frame, and optional RTS/CTS reservation.
TIP · the security connection. On a shared medium every node sees every frame; the card passes only what is addressed to it to the upper layer. Someone who puts the card in “promiscuous mode” can read all the traffic. On shared and wireless networks, what provides confidentiality is not the medium but encryption.
Common mistakes
| Wrong idea | Correct |
|---|---|
| Slotted ALOHA max 0.184 | Slotted is , pure is . |
| The pure ALOHA vulnerable period is | It is : before and after. |
| Success probability is | That is for a specific node. For any node, multiply by . |
| : the news must come back. | |
| CSMA completely prevents collisions | Collisions still happen because of propagation. |
| In backoff | The upper bound is , and is at most 10. |
| When speed rises the network diameter stays the same | For the same the diameter shrinks in inverse proportion to the speed. |
| Wi-Fi uses CSMA/CD | CSMA/CA; collision detection is not practical on wireless. |
Test yourself
Exam-style questions. Solve them on paper first, then reveal the answer.
What is the maximum efficiency of slotted ALOHA as the number of nodes grows large?
Show answer
Slotted ALOHA: , with the maximum at .
In pure ALOHA the vulnerable period is twice as long, so it is .
In slotted ALOHA, 5 active nodes each transmit in a slot with probability . What is the probability that a given slot is a success (exactly one transmission)?
Show answer
.
Because was chosen, this is the best value for N = 5. As N grows it falls toward .
Same setting (5 nodes, ). What fraction of slots are idle, and what fraction contain a collision?
Show answer
Idle slot: nobody transmits, .
Collision: the remainder, .
The three probabilities must add up to 1.
In pure ALOHA, the offered load is frames per frame time. What is the throughput ?
Show answer
Pure ALOHA: .
This is also the maximum of pure ALOHA, reached at .
In slotted ALOHA the same load would give .
Why is the vulnerable period of pure ALOHA twice the frame time?
- Because frames are twice as long as in slotted ALOHA
- Because a frame collides with any other frame that starts within one frame time before or after it
- Because the sender transmits each frame twice
- Because acknowledgements take one frame time
Show answer
Our frame starts at and lasts . The tail of a frame that starts in hits the beginning of ours, and a frame that starts in hits the tail of ours. The total is .
Slotting aligns the starts, which cuts the vulnerable period to and doubles the efficiency.
A CSMA/CD network runs at 10 Mbps over a 2500 m cable with propagation speed m/s. What is the minimum frame size (in bits) so that a collision is always detected while still transmitting?
Show answer
.
In the worst case, news of the collision arrives after . The sender must still be transmitting during that time: bits.
A 100 Mbps CSMA/CD segment has propagation speed m/s and minimum frame size 512 bits. What is the maximum distance between two stations?
Show answer
.
Distance m.
When the speed goes up 10 times (it would be 5120 m at 10 Mbps), the network diameter shrinks 10 times for the same minimum frame.
In Ethernet's binary exponential backoff at 10 Mbps, after the 3rd consecutive collision a node picks at random. What is the range of , and what is the longest possible wait?
Show answer
After the -th collision, . For : .
The wait is bit times. At 10 Mbps, 512 bits .
Longest: .
Two nodes have just collided for the 2nd time and both run binary exponential backoff. What is the probability that they collide again on their next attempt (they collide if they pick the same )?
Show answer
After the 2nd collision, each picks independently from .
The probability of picking the same value is .
After the 1st collision this is 1/2, after the 3rd it is 1/8: each collision halves the risk.
Using the approximation , what is Ethernet's efficiency when and frames are 1500 bytes at 10 Mbps?
Show answer
ms ... Long frames and a short cable push the efficiency toward 1.
A link of capacity 100 Mbps carries frames with mean length 10,000 bits arriving at 5000 frames/s. Using the static-allocation queueing formula , what is the mean delay on the full channel, and what is it if the channel is split statically into 10 equal FDM subchannels each receiving 1/10 of the traffic?
Show answer
frames/s. ms.
Split into 10, each subchannel has and traffic : ms, that is .
Static division multiplies the delay by N. This is the reason for dynamic sharing with bursty traffic.
Which multiple access protocol is used by classic shared Ethernet, and which by Wi-Fi?
- Ethernet: CSMA/CA; Wi-Fi: CSMA/CD
- Ethernet: CSMA/CD; Wi-Fi: CSMA/CA
- Both use token passing
- Ethernet: slotted ALOHA; Wi-Fi: polling
Show answer
On a wired medium it is possible to listen while sending and notice a collision: CSMA/CD.
On wireless, your own strong signal drowns out the weak incoming signal, and there is the hidden terminal problem, so collisions cannot be detected. That is why Wi-Fi tries to avoid collisions (CSMA/CA, ACK, optional RTS/CTS).
Verification: ALOHA efficiencies, success probabilities for N nodes, static allocation delay, CSMA/CD minimum frame size, the Ethernet efficiency formula and backoff times were computed with node (verify/SEN2008/04.mjs).