Show understanding of Ethernet and how collisions are detected and avoided

Published by Patrick Mutisya · 14 days ago

Cambridge A-Level Computer Science 9618 – Networks: Ethernet and Collision Management

2.1 Networks – The Internet

Ethernet Overview

Ethernet is the most widely used LAN technology. It defines the physical and data‑link layers of the OSI model and uses a bus or star topology with twisted‑pair or fibre cabling.

Key Characteristics

  • Data rate: 10 Mbps, 100 Mbps, 1 Gbps, 10 Gbps (and higher).
  • Frame‑based transmission.
  • Medium access control based on Carrier Sense Multiple Access with Collision Detection (CSMA/CD) for half‑duplex links.
  • Supports both half‑duplex (shared medium) and full‑duplex (point‑to‑point) modes.

Ethernet Frame Structure

FieldSize (bytes)Description
Preamble + SFD8Synchronises receiver; Start Frame Delimiter marks start of frame.
Destination MAC6Address of the receiving NIC.
Source MAC6Address of the transmitting NIC.
Type/Length2Indicates protocol type or length of payload.
Payload (Data)46–1500Actual data being carried.
Frame Check Sequence (FCS)4CRC for error detection.

Collision Detection (CSMA/CD)

In a shared medium, multiple stations may attempt to transmit simultaneously, causing a collision. CSMA/CD provides a method to detect and recover from collisions.

  1. Carrier Sense: Before transmitting, a station listens to the medium. If it is idle, it proceeds; otherwise it waits.
  2. Multiple Access: All stations have equal access to the medium.
  3. Collision Detection:

    • The transmitting station monitors the signal on the cable while sending.
    • If the voltage level deviates from the expected pattern, a collision is detected.
    • Upon detection, the station stops transmitting the current frame.

  4. Jam Signal: The station that detects the collision sends a jam signal (32 bits) to ensure all other stations recognise the collision.
  5. Back‑off Algorithm: Each station waits for a random period before attempting to retransmit. The wait time is calculated using the binary exponential back‑off:

    \$\text{Wait time} = \text{Slot time} \times \text{Random}(0, 2^{k}-1)\$

    where \$k\$ is the number of collisions for that frame (capped at 10) and the slot time for 10 Mbps Ethernet is \$51.2\ \mu\text{s}\$.

  6. Retransmission: After the back‑off period, the station repeats the carrier‑sense step.

Why Collisions Occur – Propagation Delay

Even after a station begins transmitting, the signal takes time to travel to the farthest station on the cable. If another station, located far enough away, starts transmitting before it detects the first transmission, a collision occurs.

The maximum round‑trip propagation delay (\$\tau\$) must be less than half the time required to transmit the minimum Ethernet frame. This leads to the minimum frame size requirement:

\$\text{Minimum frame size} = 2 \times \tau \times \text{Data rate}\$

For 10 Mbps Ethernet with a maximum cable length of 500 m (propagation speed ≈ \$2 \times 10^8\ \text{m/s}\$):

\$\tau = \frac{500\ \text{m}}{2 \times 10^8\ \text{m/s}} = 2.5\ \mu\text{s}\$

\$\text{Minimum frame size} = 2 \times 2.5\ \mu\text{s} \times 10\ \text{Mbps} = 50\ \text{bits}\$

Ethernet adopts a larger practical minimum of 512 bits (64 bytes) to provide a safety margin.

Collision Avoidance – Full‑Duplex Ethernet

Full‑duplex links use separate transmit and receive pairs (or separate wavelengths on fibre), eliminating the shared medium. Consequently:

  • No collisions can occur.
  • CSMA/CD is disabled; stations transmit whenever they have data.
  • Throughput can approach the nominal link speed in both directions simultaneously.

Other MAC Protocols (Brief)

  • CSMA/CA (Collision Avoidance): Used in wireless LANs (Wi‑Fi). Stations use acknowledgements and optional RTS/CTS handshaking to reduce the chance of collisions.
  • Token Ring: A token circulates around the network; only the station holding the token may transmit, guaranteeing collision‑free operation.

Suggested diagram: Timeline of a CSMA/CD transmission showing carrier sense, transmission, collision detection, jam signal, back‑off, and retransmission.

Summary Checklist

  • Understand the Ethernet frame fields and minimum size requirement.
  • Explain the steps of CSMA/CD and why each is necessary.
  • Calculate propagation delay and relate it to the minimum frame size.
  • Distinguish between half‑duplex (collision‑prone) and full‑duplex (collision‑free) operation.
  • Identify alternative MAC strategies (CSMA/CA, Token Ring) and their contexts.