Sub topic 2
Pure ALOHA and its throughput
This chapter assumes you know the layered network model, what bandwidth and propagation delay mean, and basic Poisson probability. Throughput here means the fraction of channel time that carries successful frames.
Pure ALOHA
In pure ALOHA, a station sends a frame as soon as it has one. If two frames overlap in time, both are destroyed. Let G be the offered load, the average number of frame attempts per frame time. A frame succeeds only if no other station starts within one frame time before or after it, a window of two frame times. With Poisson arrivals, the throughput is:
S = G × e^(−2G)
The maximum occurs at G = 0.5, giving S = 1/(2e) ≈ 0.184. Pure ALOHA therefore uses at most about 18.4% of the channel.
Slotted ALOHA
Slotted ALOHA divides time into slots of one frame length. Stations may start transmitting only at a slot boundary. The vulnerable window shrinks to one frame time:
S = G × e^(−G)
The maximum occurs at G = 1, giving S = 1/e ≈ 0.368. Slotting doubles the best-case throughput of pure ALOHA.
import math
def pure_aloha(G):
return G * math.exp(-2 * G)
def slotted_aloha(G):
return G * math.exp(-G)
print(round(pure_aloha(0.5), 3)) # 0.184
print(round(slotted_aloha(1.0), 3)) # 0.368Carrier sense and persistence
Carrier sensing means a station listens to the channel before sending. The persistence method decides what happens when the channel is busy:
- 1-persistent: keep sensing and send as soon as the channel is idle.
- Non-persistent: wait a random time, then sense again.
- p-persistent: on an idle slot, send with probability p. Otherwise wait one slot and repeat.
CSMA/CD: detecting collisions
CSMA/CD (Carrier Sense Multiple Access with Collision Detection) is used in wired Ethernet. A station keeps listening while it transmits. If it detects a collision, it stops, sends a short jam signal, and schedules a retransmission.
A collision must be detected while the sender is still transmitting. This sets a minimum frame length: the frame must last at least one round-trip time, so that the collision signal returns before the sender finishes. For 10 Mbps Ethernet with a 51.2 µs slot time, that is 512 bits, or 64 bytes.
flowchart TD
A[Sense channel] --> B{Channel idle?}
B -- No --> A
B -- Yes --> C[Transmit frame]
C --> D{Collision detected?}
D -- No --> E[Frame sent]
D -- Yes --> F[Send jam signal]
F --> G[Wait backoff time]
G --> Acaption: CSMA/CD sender loop alt: A flowchart showing a station that senses the channel, transmits when idle, and on collision sends a jam signal, waits, and senses again.
Binary exponential backoff
After the n-th collision, a station picks a random number of slot times K from 0 to 2^min(n,10) − 1, then waits K slots. The range doubles after each collision, up to 1023 slots. After 16 failed attempts, the frame is dropped.
import random
def backoff_slots(collision_count):
if collision_count >= 16:
return None # drop the frame
k = min(collision_count, 10)
return random.randrange(2 ** k)Exercise
Exercise
A pure ALOHA channel has offered load G = 0.5. What is its throughput, and what is the throughput if the same load is used with slotted ALOHA?
Show answer
Pure ALOHA gives S = 0.5 × e^(−1) ≈ 0.184. Slotted ALOHA gives S = 0.5 × e^(−0.5) ≈ 0.303.