A-Level Computer Science / Unit 2: Networks, Connectivity and the Internet

2.1.6 Routing, Ethernet and Collision Management

🔒 Lesson slides are available to signed-in users. Sign in

2.1.6 Routing, Ethernet and Collision Management

A switch moves frames within a local network, while a router moves packets between networks. Ethernet defines how devices communicate across many wired LANs. Earlier shared Ethernet networks could suffer collisions, so they used CSMA/CD to manage access to the transmission medium.

This section first follows a packet through a router and then compares shared Ethernet with modern switched Ethernet.

By the end of this section, you should be able to:

  • describe the role of a router in connecting networks;
  • explain how a router uses a destination IP address and routing information;
  • distinguish the roles of a router and a switch;
  • describe Ethernet as a wired LAN technology;
  • explain why collisions occur on a shared transmission medium;
  • describe the sequence used by CSMA/CD;
  • explain how switched full-duplex Ethernet avoids collisions.

The role of a router

A router connects different networks and forwards packets between them. A home router may connect a private LAN to an Internet service provider, while an organisation may use routers to connect departments, buildings or remote sites.

Router: a network device that examines the destination IP address of a packet and forwards the packet towards another network.

What makes a router different?

  • It has interfaces connected to two or more networks.
  • It makes forwarding decisions using network-layer addresses, especially IP addresses.
  • It uses a routing table to identify a suitable next step towards the destination network.
  • It separates one network from another rather than treating all connected devices as one LAN.

Common mistake

A router does not normally deliver every packet directly to its final destination. It often sends the packet to the next router on the route.

How a router forwards a packet

A student computer on one LAN requests a page from a server on another network:

  1. The computer recognises that the destination is outside its own local network.
  2. It sends the packet towards its default gateway, which is a router interface.
  3. The router reads the packet's destination IP address.
  4. The router compares the destination with entries in its routing table.
  5. It selects an outgoing interface or next-hop router.
  6. The packet is forwarded towards the destination network.
  7. Other routers may repeat the process until the packet reaches the final network.
Routing table: stored routing information used to decide where packets for different destination networks should be sent.
Default gateway: the router interface to which a host sends packets destined for another network.
DestinationRouter decision
A device on the same LANNo router is required; the frame can be delivered within the LAN.
A server on another school subnetworkForward through the interface leading to that internal network.
An Internet destinationForward towards the organisation's upstream or Internet-facing router.
No more specific route is knownUse a default route, when one has been configured.

Exam tip

Use the sequence: read destination IP → consult routing table → choose next hop or interface → forward packet.

Switch and router: different responsibilities

ComparisonSwitchRouter
Main purposeConnect devices within a LANConnect different networks
Data unit consideredFramePacket
Address mainly usedMAC addressIP address
Stored forwarding informationMAC address tableRouting table
Typical decisionWhich switch port leads to the destination device?Which interface or next hop leads towards the destination network?

Common mistake

Both devices forward data, but they do so at different levels. A switch forwards frames inside a LAN; a router forwards packets between networks.

Ethernet foundations

Ethernet is a family of technologies used mainly for wired local area networks. Wired Ethernet is standardised under IEEE 802.3.

Ethernet: a family of standards for communication over wired LANs.
IEEE 802.3: the standards family associated with wired Ethernet.

The important contrast here is between:

  • shared Ethernet, where several devices compete for one transmission medium;
  • switched Ethernet, where each device normally has a dedicated link to a switch.

Common mistake

Ethernet is not another name for the Internet. Ethernet is commonly used inside LANs; the Internet connects many different networks using a wider set of technologies.

Shared Ethernet

Earlier Ethernet networks used a shared communication path. This could be a bus cable or a star-shaped physical layout using a hub. A hub repeated an incoming signal to the other ports, so the connected devices still shared the same logical medium.

  1. A device transmits onto the shared medium.
  2. The signal becomes available to the connected devices.
  3. Each device checks the destination MAC address in the frame.
  4. Only the intended destination accepts and processes the frame.

Common mistake

“Available to all devices” does not mean “intended for all devices”. A unicast frame still names one destination.

Why collisions occur

Because all devices share one medium, two devices may find it free and begin transmitting almost simultaneously. Their signals then overlap and the frames cannot be interpreted correctly.

Collision: interference and corruption caused when transmissions overlap on the same shared Ethernet medium.

Why listening first is not enough

Signals take a small amount of time to travel. Device A may start transmitting before Device B's signal has reached it, while Device B may do the same before A's signal arrives.

Common mistake

A collision is not a packet being delivered to the wrong computer. It is corruption produced when simultaneous signals overlap on a shared medium.

CSMA/CD

Shared half-duplex Ethernet used Carrier Sense Multiple Access with Collision Detection to coordinate access and recover after collisions.

Carrier sense: listen for activity before transmitting.
Multiple access: several devices share the same medium.
Collision detection: monitor the medium while transmitting to identify interference.
  1. Listen: check whether another transmission is present.
  2. Wait if busy: do not transmit while the medium is in use.
  3. Transmit if free: begin sending the frame.
  4. Monitor: continue checking for evidence of a collision.
  5. Stop after collision: abandon the corrupted transmission.
  6. Signal the collision: ensure other devices recognise that the attempt failed.
  7. Back off: wait for a randomly selected period.
  8. Retry: listen again and make another attempt.

The random delay matters because identical fixed delays could cause both devices to retransmit together and collide repeatedly.

Exam tip

listen → transmit when free → detect → stop → random backoff → retry

How modern switched Ethernet avoids collisions

In a modern Ethernet LAN, each device usually has its own link to a switch. The link can operate in full-duplex mode.

  • Devices do not compete for one shared cable.
  • Each device communicates through a dedicated switch link.
  • Full-duplex operation removes the shared half-duplex collision condition.
  • The switch forwards frames to the relevant output port.
  • If an output is temporarily busy, the switch can queue the frame in a buffer.
Buffer: temporary storage used while a frame waits for an outgoing link.
Full-duplex: communication in both directions at the same time.
FeatureShared EthernetSwitched Ethernet
Access to mediumMultiple devices share itEach device has a dedicated switch link
Duplex modeHalf-duplexNormally full-duplex
Collision possibilityPossibleNot expected on the dedicated link
CSMA/CDUsed to manage access and recoverNot needed
Traffic handlingSignal available across the shared mediumSwitch directs frames and may buffer them

Common mistake

Switched Ethernet is not collision-free merely because it is faster. Collisions are avoided because the shared half-duplex medium has been replaced by dedicated full-duplex links.

Interactive: Ethernet Explorer

Use the existing widget to compare one transmission with two simultaneous transmissions. First select shared legacy Ethernet, then repeat the demonstration using switched Ethernet.

Network type
Demonstration

Legacy Ethernet

What is happening?

  1. Select a demonstration to begin.
Sender Intended receiver Link / medium Collision

Practice

Routing

  1. Describe the role of a router in a network.
  2. Explain how a router decides where to forward a packet.
  3. Explain the purpose of a default gateway.
  4. Compare the forwarding decisions made by a switch and a router.
  5. Trace a packet from a school computer to a server on another network.

Ethernet and collisions

  1. Explain why collisions can occur on shared Ethernet.
  2. Explain why carrier sensing cannot guarantee that no collision occurs.
  3. Describe the CSMA/CD process in the correct order.
  4. Explain the purpose of the random backoff.
  5. Explain why modern switched Ethernet does not require CSMA/CD.

Review

ConceptCore idea
RouterForwards packets between networks using destination IP addresses and routing information.
Routing tableHelps select an outgoing interface or next hop.
EthernetA family of wired LAN technologies associated with IEEE 802.3.
CollisionOverlapping transmissions corrupt signals on a shared medium.
CSMA/CDListen, transmit, detect, stop, back off randomly and retry.
Switched EthernetDedicated full-duplex links avoid the collision condition.