Medium Access Control (MAC)
What you'll learn: How multiple devices coordinate access to a shared network channel to avoid collisions and ensure fair communication.
The Shared Medium Problem
When multiple computers share the same physical network medium—like an Ethernet cable or wireless frequency—they need rules to decide who gets to transmit when. Without coordination, devices might talk over each other, corrupting data. Medium Access Control (MAC) protocols solve this problem by managing access to the shared channel.
Think of it like a dinner conversation: if everyone talks at once, nobody understands anything. You need either a moderator (controlled access) or polite turn-taking rules (contention-based access).
Two Main Approaches
CSMA/CD (Carrier Sense Multiple Access with Collision Detection)
Used in traditional wired Ethernet, this is a contention-based approach:
- Listen before speaking: A device checks if the channel is idle
- Transmit if clear: Start sending if nobody else is transmitting
- Detect collisions: If two devices transmit simultaneously, both detect the collision
- Back off and retry: Each device waits a random time before trying again
It's like checking if someone's talking before you jump into a conversation, and stopping immediately if you accidentally interrupt.
Token Passing
A controlled access method used in Token Ring networks:
- A special "token" frame circulates around the network
- Only the device holding the token can transmit
- After transmitting (or if it has nothing to send), it passes the token to the next device
This guarantees collision-free access and predictable performance, but requires more coordination overhead.
Why It Matters
MAC protocols directly determine network efficiency, fairness, and collision rates at the Data Link Layer.
Key Takeaway: MAC protocols coordinate shared medium access using either contention methods (like CSMA/CD—listen first, detect collisions) or controlled methods (like token passing—wait your turn), preventing transmission conflicts.