Show understanding of Ethernet and how collisions are detected and avoided
2.1 Networks – The Internet & Ethernet
What is Ethernet?
Ethernet is a family of wired networking technologies that let devices talk to each other over a shared cable. Think of it as a busy highway where cars (data packets) travel in both directions. 🚗🚗
How do devices share the same road?
Ethernet uses a protocol called Carrier Sense Multiple Access with Collision Detection (CSMA/CD). Before a device sends data it senses the cable to see if someone else is already driving. If the road is clear, it starts its journey. If two cars start at the same time, a collision occurs.
Collision Detection
While a car is driving, it keeps an eye out for another car. If it sees a collision, it stops immediately and sends a collision signal to all other cars so they know to stop. The cars then wait for a random time before trying again. This prevents traffic jams.
Collision Avoidance – The CSMA/CD Algorithm
- Carrier Sense: Check if the cable is idle.
- Multiple Access: Any device can send when the cable is free.
- Collision Detection: While sending, monitor the cable for a collision.
- Backoff: If a collision is detected, stop, wait for a random backoff time, then retry.
Backoff Timing – The Math
The backoff time is chosen from a range of $2^k$ slots, where $k$ is the number of collisions that have happened for that frame (capped at 10). Each slot is $t_{slot}$ microseconds long. The formula is: $$\text{backoff time} = \text{random}(0, 2^k - 1) \times t_{slot}$$ This randomness reduces the chance that the same two cars collide again.
Real‑World Analogy: The Classroom
- Students (devices) want to speak (send data).
- They listen to see if the teacher is talking (cable idle).
- If two students shout at once, the teacher stops the class (collision).
- Students then wait a random amount of time before speaking again.
Key Takeaways
| Concept | What It Means |
|---|---|
| Carrier Sense | Check if the cable is free before sending. |
| Collision Detection | Stop immediately if a collision is sensed. |
| Backoff | Wait a random time before retrying. |
Revision
Log in to practice.