Documentation
[!NOTE] This module explores the core principles of Documentation, deriving solutions from first principles and hardware constraints to build world-class, production-ready expertise.
1. The Shared Medium Problem
In early Ethernet (Bus topology with hubs), all devices shared the same physical wire. If two devices transmitted at the same time, a Collision occurred, and the data was corrupted.
2. CSMA/CD Overview
Carrier Sense Multiple Access with Collision Detection.
- Carrier Sense: “Listen before you talk.” If someone else is transmitting, wait.
- Multiple Access: Everyone has equal right to use the wire.
- Collision Detection: While transmitting, “Listen to yourself.” If the signal detected on the wire is different from what you sent, a collision happened.
3. What happens after a Collision?
- Jam Signal: The detecting device sends a special 48-bit jam signal to ensure everyone knows a collision happened.
- Binary Exponential Backoff: Each device picks a random wait time before trying again.
- First collision: Wait 0 or 1 slot.
- Second collision: Wait 0, 1, 2, or 3 slots.
- The window doubles every time (up to 10 tries), reducing the chance of a second collision.
4. Interactive: Collision Simulation
Try to send from two nodes simultaneously.
💻 A
💻 B
💥
Wire is IDLE.
5. Why we don’t use it anymore
Switches. A Switch creates a dedicated point-to-point link between itself and the NIC.
- This is a Full-Duplex link (one pair for TX, one for RX).
- Collisions are physically impossible.
- CSMA/CD is now only kept in the standard for backward compatibility.
[!NOTE] Collision Domain: The set of devices where a collision can occur.
- Hub: 1 giant collision domain.
- Switch: Every port is its own collision domain.