Computer Network
📂 Data Link Layer
· 2 of 2
59 min read
Medium Access Control Explained: ALOHA, CSMA/CD & CSMA/CA
From Norman Abramson's 1971 Hawaii radio experiment to modern WiFi and 800 GbE — this comprehensive tutorial walks through Pure ALOHA, Slotted ALOHA (with 4 worked numericals), CSMA/CD collision detection, CSMA/CA with the RTS/CTS handshake, animated timing diagrams, Ethernet standards evolution, MAC address anatomy, and how switches, bridges, and 802.1Q VLANs segment traffic in real-world LANs.
Section 01
The Story That Started It All — Norman Abramson & ALOHAnet
📖 Real Story — Hawaii, 1971
How a Radio Experiment on Four Hawaiian Islands Gave Birth to WiFi
In the late 1960s, University of Hawaii professor Norman Abramson had a problem.
His university was scattered across four islands. Leasing telephone lines between them for computer
data was slow, unreliable, and painfully expensive. Radio was cheap — but if two computers transmitted
at the same time on the same frequency, both messages became garbled noise. This is called a
collision.
Every engineer at the time believed you needed a strict schedule to share a radio channel.
Abramson's team asked a wild question: what if we just let stations transmit whenever they want,
accept that some packets will collide, and simply resend the losers?
In June 1971, ALOHAnet went live, connecting seven computers by UHF radio at 9,600 baud.
That "just transmit and retry" idea is called the ALOHA protocol. Every WiFi router,
every 4G/5G phone, every satellite modem, and every Ethernet card on the planet is a
descendant of that experiment. When you tap "Connect" on WiFi today, the very first packet your
phone sends still says, in effect, "aloha."
📡
Why This Matters for Every Network You Use
Any time multiple devices share one communication medium — a wire, a radio channel, a fiber
link — the network needs a rulebook to decide who talks when. That rulebook is called
Medium Access Control (MAC). The MAC layer sits between the physical layer and the
logical link layer (Layer 2 of the OSI model). Get MAC wrong and the network collapses under
collisions; get it right and thousands of devices coexist smoothly.
Section 02
The Core Problem — Who Gets to Talk?
Imagine ten people in a pitch-black room. Only one voice can be understood at a time. If two speak
simultaneously, their words scramble. There are three basic strategies humans (and networks) use.
🕑
Channel Partitioning
TDMA / FDMA / CDMA
Split the channel into fixed time-slots or frequency bands and give each station its own slice.
Predictable and collision-free — but wasteful when a station has nothing to say. Used in 2G/3G
cellular voice.
🎲
Random Access
ALOHA / CSMA family
Any station transmits whenever it has data. Handle collisions after they happen. Simple, fair,
and efficient at low load — the family that includes ALOHA, CSMA/CD (Ethernet), and CSMA/CA
(WiFi). This is our main topic.
🎟️
Taking Turns
Polling / Token Passing
Either a controller polls each device in order (Bluetooth), or a "token" circulates and only
the holder may transmit (legacy Token Ring). Collision-free but adds overhead and a single
point of failure.
💡
The Rest of This Tutorial
We focus on the random access family — the one that actually powers WiFi,
Ethernet, and cellular data channels. We'll go: ALOHA → Slotted ALOHA → CSMA →
CSMA/CD → CSMA/CA, then jump up to Ethernet standards, MAC addressing, switches, bridges,
and VLANs.
Section 03
Pure ALOHA — The Original "Just Transmit" Protocol
Pure (unslotted) ALOHA works like this: whenever a station has a frame to send, it sends it.
Nothing more. If two frames overlap in time — even by one bit — both are destroyed and each sender
waits a random amount of time before retrying.
🔄 Pure ALOHA — Station Algorithm
Step 1
Frame arrives from upper layer → transmit it immediately.
Step 2
Listen for an ACK from the receiver within a timeout window.
Step 3
ACK arrived → done. No ACK → assume collision.
Step 4
Wait a random backoff time, then retransmit. Repeat.
Animated Diagram — Why Pure ALOHA Suffers a Double Vulnerable Period
Any frame that begins within the 2T window around Frame A overlaps it — that is Pure ALOHA's "double vulnerable period."
⚠️
The Vulnerable Period is 2T, Not T
If a frame takes time T to transmit, then a competing frame that started
anywhere from T seconds before to T seconds after Frame A's
start will collide with it. That gives a vulnerable window of 2T — the reason Pure
ALOHA maxes out at just 18.4% channel utilisation.
Section 04
Slotted ALOHA — Half the Vulnerability, Double the Throughput
Roberts (1972) suggested a small tweak: divide time into slots exactly one frame
long, and force every station to wait until the start of a slot before transmitting. Suddenly two
frames either overlap completely (collision) or not at all (success). The vulnerable window shrinks
from 2T to just T.
Slotted ALOHA — transmissions align to slot boundaries. Two stations either share a slot exactly (collide) or take separate slots (both succeed).
📈
The Numbers Speak
Halving the vulnerable window doubles peak throughput. Pure ALOHA tops out at
1/(2e) ≈ 0.184 (18.4%). Slotted ALOHA reaches
1/e ≈ 0.368 (36.8%). One clock signal, twice the capacity — for free.
Section 05
ALOHA Throughput Formulas & Worked Numericals
Pure ALOHA
S = G · e−2G
Peak Smax = 1/(2e) ≈ 0.184 at G = 0.5
Slotted ALOHA
S = G · e−G
Peak Smax = 1/e ≈ 0.368 at G = 1.0
Here G is the average number of transmission attempts per frame time (offered
load), and S is the throughput — the average number of successful transmissions
per frame time. The exponential term is the probability that no other frame lands in the vulnerable
window.
Animated Throughput Curves
Throughput vs offered load — Slotted ALOHA doubles the peak of Pure ALOHA and reaches it at higher load.
Numerical 1 — Probability of Successful Transmission
🔢 Question
Given
A Pure ALOHA channel has an offered load of G = 0.5 frames per frame time.
Find the probability that a given frame is transmitted successfully (no collision).
Step 1
Probability of success in Pure ALOHA = e−2G.
Step 2
Substitute: e−2(0.5) = e−1 ≈ 0.368.
Answer
A single frame has about a 36.8% chance of getting through on its first try —
and the channel throughput S = G · 0.368 = 0.184, exactly the theoretical maximum for Pure ALOHA.
Numerical 2 — Slotted ALOHA Load Comparison
🔢 Question
Given
A slotted ALOHA network has offered load G = 2. Find the throughput and the fraction of slots that end in collision.
Step 1
Throughput S = G · e−G = 2 · e−2 = 2 × 0.135 = 0.271.
Step 2
Fraction of empty slots = e−G = 0.135 (13.5% idle).
At G = 2 the network is over-loaded — nearly 60% of slots are wasted on collisions.
This is why exponential-backoff schemes exist: they reduce effective G toward 1 (the optimum).
Numerical 3 — How Many Stations Can a Channel Carry?
🔢 Question
Given
A group of N stations shares a Slotted ALOHA channel. Each station transmits on average
once every 100 slots. Find the maximum N for which the channel operates at its throughput peak.
Step 1
Per-station load p = 1/100 = 0.01. Total offered load G = N · p.
Step 2
Peak throughput of Slotted ALOHA occurs at G = 1.
Step 3
Set N · 0.01 = 1 ⇒ N = 100 stations.
Answer
Beyond 100 stations, collisions dominate and throughput falls. This is exactly why
classic ALOHA doesn't scale — the more talkers you add, the worse it gets past G = 1.
Numerical 4 — Data Rate Given a 1 Mbps Link
🔢 Question
Given
A shared 1 Mbps channel uses Pure ALOHA. Frames are 1000 bits long.
What is the maximum effective data rate?
Step 1
Peak Smax for Pure ALOHA = 1/(2e) ≈ 0.184.
Step 2
Effective rate = 0.184 × 1 Mbps = 184 kbps.
Compare
Same link under Slotted ALOHA: 0.368 × 1 Mbps = 368 kbps —
exactly double. Under CSMA/CD Ethernet the same link would push past 900 kbps.
Section 06
CSMA — Listen Before You Talk
ALOHA's fatal flaw is that stations transmit blindly. Carrier Sense Multiple Access
(CSMA) introduces one commonsense rule borrowed from a polite conversation:
listen first, and only speak if the channel is quiet. This alone can push throughput
above 90% on a low-latency wire.
🔊
1-Persistent CSMA
Sense the channel. If busy, keep sensing. The moment it goes idle, transmit
with probability 1. Fast — but if multiple stations are all waiting, they'll all jump
in the instant it clears.
used by Ethernet
🎲
p-Persistent CSMA
When the channel goes idle, transmit with probability p; otherwise wait one
slot and try again. Tuning p avoids the "everybody jumps at once" pileup of 1-persistent.
tunable middle ground
🕑
Non-Persistent CSMA
If busy, wait a random time before checking again. Reduces collisions
at the cost of some idle time. Used where politeness matters more than throughput.
random backoff on busy
🔄
Why Collisions Still Happen With CSMA
Signals travel at the speed of light in copper (about 2/3 of c). If Station A begins
transmitting and Station B — 200 metres away — senses the channel before A's signal
arrives, B will believe the channel is idle and start too. This propagation delay window
is the only way collisions occur under CSMA, and the whole family of CSMA variants exists to
handle that window.
Section 07
CSMA/CD — Ethernet's Collision Detection
In 1973 Bob Metcalfe at Xerox PARC — inspired directly by ALOHAnet — added a killer feature:
while transmitting, the sender also listens. If it hears a voltage anomaly (its own signal
colliding with another), it stops immediately, sends a short "jam" signal so every other station
knows a collision occurred, and backs off. This is CSMA/CD (Collision Detection),
the foundation of classical Ethernet.
⚙️ CSMA/CD Algorithm — What Every Ethernet NIC Did For 30 Years
1
Sense the wire. If busy, wait until idle (1-persistent CSMA).
2
Start transmitting the frame.
3
Keep listening while transmitting. If received voltage ≠ transmitted voltage → collision detected.
4
On collision: send a 48-bit jam signal so every station notices.
5
Choose a random wait using Binary Exponential Backoff: after the nth
collision, pick k ∈ {0,1,...,2n−1}, wait k slot times. Cap at n = 10, give up at n = 16.
6
Go back to step 1.
Animated Diagram — Collision Detection on a Shared Bus
Two stations at opposite ends of a shared Ethernet segment both start transmitting because the signal from one hasn't reached the other yet. Collision detected mid-cable → jam signal → binary exponential backoff.
📑
Minimum Frame Size Comes from CSMA/CD
For collision detection to work, a station must still be transmitting when the collision reaches
it. That's why Ethernet has a minimum frame of 64 bytes (512 bits): on 10 Mbps,
512 bits take 51.2 μs, exactly twice the maximum round-trip propagation delay of the original
2,500 m segment. Frames smaller than 64 bytes are padded to reach this slot time.
Section 08
CSMA/CA — WiFi's Collision Avoidance
Wireless radios have a big physical problem: they cannot listen and transmit at the same time on
the same frequency (a strong outgoing signal drowns out any incoming one). CSMA/CD is
impossible on WiFi. Also there is the hidden node problem — Station A and
Station C can each see Access Point B but not each other, so neither's carrier sense will warn
the other. WiFi's answer is CSMA/CA (Collision Avoidance) using the RTS/CTS
handshake and inter-frame spacing.
📡 CSMA/CA — The 802.11 DCF Sequence
DIFS
Sense the channel. Wait for DIFS (DCF Inter-Frame Space, ~34 μs) of continuous idle time.
Backoff
Pick a random slot in a contention window (CW), count down while idle. Freeze
the counter if the channel goes busy; resume when idle again.
RTS
(Optional) Send a short Request-To-Send to reserve the medium and tackle hidden nodes.
CTS
AP responds with Clear-To-Send. Every station that hears the CTS backs off
for the duration named in the CTS. This solves the hidden-node problem.
DATA
Transmit the actual frame after SIFS (Short IFS, ~16 μs).
ACK
Receiver waits SIFS then sends an ACK. No ACK = assumed collision = double the CW and retry.
Animated Diagram — RTS/CTS Handshake with Hidden Nodes
RTS → CTS → DATA → ACK. The CTS broadcast is heard by every station in range of the AP — including hidden node C — telling everyone to keep quiet for the reserved duration.
📡
Why Your WiFi Feels Slow in a Crowded Airport
Every station's contention window doubles after each failed attempt. With hundreds of
phones competing at gate B12, CWs grow to 1024 slots. Devices spend more time counting down than
transmitting. Cloudflare Radar recorded one U.S. event with 78% concurrent Wi-Fi usage — over 54,000 devices connected simultaneously, exactly the load profile CSMA/CA was
designed to survive but never to feel snappy under.
Section 09
MAC Protocols — Side-by-Side Comparison
Property
Pure ALOHA
Slotted ALOHA
CSMA/CD
CSMA/CA
Listens before tx?
No
No
Yes
Yes
Detects collision mid-tx?
No
No
Yes
No (uses ACK timeout)
Time slots?
No
Yes
Slot time for backoff
Yes (CW slots)
Vulnerable period
2T
T
≈ 2τ (prop. delay)
≈ 2τ + IFS
Peak throughput
18.4%
36.8%
> 90%
~ 60-70% (with overhead)
Where used today
RFID, sensor networks
Cellular random-access channel
Wired half-duplex Ethernet (legacy)
Every WiFi (802.11)
💬
The Retirement of CSMA/CD
Modern switched, full-duplex Ethernet has no shared medium. Each device has its own
dedicated wire pair to the switch, and transmit and receive use separate wires. There are no
collisions to detect. CSMA/CD is still in the IEEE 802.3 standard for backward compatibility,
but a Gigabit Ethernet port has effectively never used it.
Section 10
Ethernet Standards — From 10BASE-5 to 800 Gigabit
Ethernet is a family, not a single standard. IEEE 802.3 has updated it roughly every four years for
fifty years — and every version has kept the same MAC frame format so an ancient NIC and a modern
400 GbE port still speak the same "language."
73
1973 — Original Ethernet (Xerox PARC)
Metcalfe's memo. 2.94 Mbps over thick coax. Direct descendant of ALOHAnet with added CSMA/CD.
83
1983 — 10BASE5 "Thicknet" (802.3)
10 Mbps over 500 m of thick coaxial cable. Vampire taps. AUI drop cables. Shared bus, half-duplex, CSMA/CD was mandatory.
90
1990 — 10BASE-T Twisted Pair
Star topology from every PC to a central hub over 100 m of Cat 3 twisted pair. Still shared bandwidth internally, but the wiring became sane.
95
1995 — Fast Ethernet 100BASE-TX
100 Mbps over Cat 5. Switches begin replacing hubs. Full-duplex mode arrives, silently killing CSMA/CD in practice.
99
1999 — Gigabit Ethernet 1000BASE-T
1 Gbps over Cat 5e using all four twisted pairs bidirectionally with PAM-5. The default port speed for two decades.
06
2006 — 10 Gigabit Ethernet
10 Gbps over Cat 6a (10GBASE-T) or fibre. Datacentre backbone default.
17
2017 — 200 & 400 Gigabit Ethernet
Datacentre spine links. Uses PAM-4 modulation and multiple fibre lanes.
24
2024+ — 800 GbE & 1.6 TbE
IEEE 802.3df ratified 800 Gbps for AI-cluster interconnects. 1.6 Tbps is on the roadmap.
📈
Decoding Ethernet Naming — "1000BASE-T" for example
Read left to right: 1000 = 1000 Mbps (1 Gbps); BASE = baseband
signalling (single carrier); T = twisted pair copper. Other suffixes: SR
= short-reach fibre, LR = long-reach, CX/CR = short copper cable,
KR = backplane. So 10GBASE-SR = 10 Gbps baseband short-reach multimode fibre.
Section 11
MAC Addressing — The 48-Bit Nametag Every Device Carries
Every Ethernet or WiFi interface on Earth carries a globally unique 48-bit (6-byte) hardware
address burned into the chip at manufacture. It's written as six hexadecimal pairs separated by
colons or hyphens, e.g. 00:1A:2B:3C:4D:5E. This is called the
MAC address — sometimes the "physical" or "hardware" address.
Animated Diagram — Inside a MAC Address
First 3 bytes (24 bits) = OUI, purchased by each vendor from IEEE. Last 3 bytes = NIC-specific serial. Two special flag bits in byte 0 mark unicast/multicast (I/G bit) and globally/locally-administered (U/L bit).
🌐 Unicast — bit 0 of byte 0 is 0
MAC
Meaning
00:1A:2B:3C:4D:5E
Send to exactly one NIC
3C:22:FB:xx:xx:xx
Apple-manufactured interface
B8:27:EB:xx:xx:xx
Raspberry Pi Foundation
📡 Multicast & Broadcast — bit 0 of byte 0 is 1
MAC
Meaning
FF:FF:FF:FF:FF:FF
Broadcast — all stations on LAN
01:00:5E:xx:xx:xx
IPv4 multicast (RFC 1112)
33:33:xx:xx:xx:xx
IPv6 multicast
Ethernet Frame — What Actually Goes on the Wire
The Ethernet II frame — unchanged since 1980. Every field between "Dest MAC" and "FCS" is what the switch actually processes.
Section 12
Bridges & Switches — Ending the Collision Domain
A hub was a dumb electrical repeater: any signal on one port went out every other
port. That meant all ports shared one collision domain and one CSMA/CD contest. A bridge
(1980s) and its modern high-port-count descendant the switch (1990s) changed
everything.
🔌 Hub (dumb repeater)
Layer
1 — Physical
Ports
One collision domain
Learning
None — broadcasts all bits
Duplex
Half only
CSMA/CD
Required on every port
Speed
Shared: 100 Mbps ÷ N devices
🗸️ Switch (smart forwarder)
Layer
2 — Data Link
Ports
One collision domain per port
Learning
Builds MAC address table by watching source MACs
Duplex
Full-duplex on every port
CSMA/CD
Never needed
Speed
Dedicated: 1 Gbps × N devices
How a Switch Learns
🧠 MAC Learning & Forwarding — the Two Rules That Run the LAN
Learn
Frame arrives on port P with source MAC = X. Add entry X → P to the MAC table (with a timeout, typically 300 s).
Forward
Look up destination MAC. If in table, send out that port only (unicast forwarding). If not in table, flood out every port except the one it arrived on (unknown-unicast flooding).
Filter
Destination is on the same port the frame arrived from → drop it (no need to send it back).
Broadcast
Destination FF:FF:FF:FF:FF:FF → always flood out every port. ARP requests use this.
💩
Broadcast Storms — When Learning Goes Wrong
Connect two switches with two cables (a loop) and a broadcast frame will flood forever, doubling
every hop. The whole LAN dies in seconds. The fix — Spanning Tree Protocol (STP,
IEEE 802.1D) — has switches elect a root bridge and disable redundant links to break loops
while retaining them as backup. Modern networks use RSTP/MSTP for sub-second convergence.
Section 13
VLANs — One Switch, Many Virtual Networks
A Virtual LAN (VLAN, IEEE 802.1Q) lets one physical switch behave as several
independent logical switches. Ports 1–4 might be "Finance" and ports 5–8 "Guest WiFi"
— traffic on one VLAN cannot reach the other even though they share the same hardware.
One switch, three isolated broadcast domains. The 802.1Q tag rides between the source MAC and the type field; the switch strips it before sending the frame out an access port.
🔑
Why VLANs Are Everywhere in 2026
VLANs give three enormous wins on one wire: security (guest devices can't sniff
payroll traffic), broadcast-domain scaling (a 1,000-user office can be sliced
into 20 VLANs of 50 users each), and flexibility (moving someone from Sales to
Marketing is a config change, not a cable run). Add Voice VLAN tagging and IP phones
auto-get QoS priority on the same cable as their attached PC.
Section 14
Real-World Cases from the News
🏇
Stadium WiFi Meltdowns
Reporting around FIFA World Cup 2026 host cities documents chronic connectivity crawl at
packed venues. When stadium WiFi slows, the cause is usually the same: too many people trying to use the same shared network at once.
This is CSMA/CA's exponential backoff at work — contention windows explode when tens of
thousands of phones fight for the same access point during a goal celebration.
CSMA/CA at scale
🏆
Olympic Airport WiFi Failures
Coverage of the Winter Olympics 2026 in Italy warned travellers that
airport Wi-Fi was designed for light, temporary usage — not for millions of people arriving for the same event, at the same time, all needing real-time access.
Under CSMA/CA the number of failed attempts grows super-linearly with contending stations.
contention scaling failure
📡
54,000 Devices, One Venue
Industry reporting on modern stadium networking notes that
one event in the USA saw 78% concurrent Wi-Fi usage — that's over 54,000 devices connected simultaneously.
Solutions like Wi-Fi 7, under-seat APs, and directional beam-forming exist precisely because
CSMA/CA collapses under this density without help.
Wi-Fi 7 deployments
🌐
SoFi Stadium Cellular Congestion
Security assessments for FIFA World Cup 26 flagged the same concern for cellular:
70,000+ attendees are expected to cause cellular congestion.
Even the "collision-free" random-access channel used to establish cellular calls degrades
catastrophically past its designed offered-load, mirroring Slotted ALOHA's throughput collapse.
cellular random-access
🔌
2025 Global Outage Surge
Cisco ThousandEyes' industry roundup reported
Notable 2025 outages include Asana's back-to-back configuration mishaps, Zoom's DNS disappearing act, and AWS DynamoDB's regional failure that impacted services globally.
Layer-2 misconfigurations — bridge loops, missing STP, VLAN mismatches — remain the silent
cause of many "everything is down" incidents that never make it into the headline.
L2 misconfig risk
🌴
ALOHA's IEEE Milestone
The University of Hawaii noted on ALOHAnet's 50th anniversary that
all wireless communications in Hawaiʻi and the world — including mobile, satellite, cellular and WiFi — utilize the protocol developed in the ALOHAnet system to establish an initial link.
Every LTE Random Access Channel and every 802.11 probe request is a direct ALOHA descendant.
IEEE Milestone 2020
Section 15
Golden Rules for MAC Layer Engineering
🏆 Non-Negotiable Rules for the Data Link Layer
1
Never build a modern LAN with hubs. A hub means one shared collision domain, half-duplex, and
resurrected CSMA/CD. A managed switch costs almost the same and gives you full-duplex
dedicated bandwidth per port.
2
Always enable Spanning Tree Protocol (STP/RSTP) before connecting redundant
links. A single accidental loop can bring down an entire office in seconds via broadcast
amplification.
3
Segment broadcast domains with VLANs whenever the LAN grows past ~200 hosts. ARP and DHCP
broadcasts scale linearly with hosts; large flat networks become invisibly slow long before
they visibly fail.
4
For dense WiFi deployments, drive up the number of APs and drop the transmit power on each.
More cells at lower power = less contention per cell. This directly reduces CSMA/CA backoff
penalties.
5
Treat the 802.1Q trunk to your router as a security boundary, not just a plumbing detail. A
misconfigured native VLAN or missing pruning list is how "VLAN hopping" attacks succeed.
6
For ALOHA-family exam problems, memorise the two peaks and where they occur:
Pure = 0.184 at G = 0.5 and Slotted = 0.368 at G = 1.0.
Everything else derives from S = G·e−2G or S = G·e−G.
7
The MAC address is a Layer-2 identifier and never crosses a router. IP addresses cross the
Internet; MAC addresses live only inside their local broadcast domain. Confusing the two is
the single biggest source of first-year networking exam mistakes.
🌈
The Full Picture in One Sentence
A shared medium needs a MAC protocol; ALOHA was the first family, CSMA/CD dominated wired
Ethernet until switching made it obsolete, CSMA/CA still rules wireless, and switches with
VLANs turned the "shared" medium into an illusion — every device gets its own private lane on
a virtual highway that once was a party line in Hawaii.