🔒
Pro Content
Subscribe to access all 69 OCR H446 A Level lessons.
£7.99/month
or £59/year
Subscribe now →
🔒 Pro · Component 1 · 1.3.4 The Internet
1.3.4c Routing and Packet Switching
OCR H446 · A Level Computer Science · ~13 min read
Notes
Video
Slides
Worksheet
Quiz

Packet Switching

The internet uses packet switching to transmit data. Instead of sending a message as a single continuous stream (like a phone call on a dedicated circuit), data is broken into small chunks called packets.

Each packet travels independently across the network — possibly via different routes — and is reassembled at the destination.

What's in a Packet?

A packet has two parts:

  • Header: contains control information — source IP address, destination IP address, packet number (sequence number), total number of packets, time to live (TTL), protocol type.
  • Payload: the actual data being carried (a portion of the original file, message, etc.).

Some protocols also add a trailer containing error-checking data (e.g. a checksum or CRC — Cyclic Redundancy Check).

Advantages of Packet Switching

AdvantageExplanation
ResilientIf one route fails, packets can take alternative paths — no single point of failure brings the whole network down.
EfficientNo dedicated circuit needed — multiple users share the same physical links simultaneously. Bandwidth is used only when data is sent.
ScalableMore nodes and links can be added to the network without reconfiguring existing connections.
Error handlingIndividual packets can be resent if lost or corrupted, without retransmitting the whole message.

Routing

A router is a networking device that forwards packets between networks. It reads the destination IP address in each packet's header and decides the best path to forward it using its routing table.

Routing Tables

A routing table is a database stored in a router listing known network destinations and the best path to reach each one. Each entry typically contains:

  • Destination network — e.g. 192.168.2.0/24
  • Next hop — the IP address of the next router to send the packet to
  • Interface — which network interface to use
  • Metric — a cost value; lower is better (used to select the best route when multiple routes exist)

Static vs Dynamic Routing

Static RoutingDynamic Routing
How configuredRoutes manually set by a network adminRoutes learned automatically via routing protocols
Adapts to changes?No — fixed until manually changedYes — automatically reroutes around failures
OverheadNone at runtimeRouting protocol traffic uses bandwidth
Best forSmall, stable networksLarge, complex, changing networks (e.g. the internet)

Routing Protocols

Dynamic routing protocols allow routers to share information about network topology and automatically build routing tables:

  • RIP (Routing Information Protocol) — distance-vector; metric = hop count; max 15 hops; simple but slow to converge
  • OSPF (Open Shortest Path First) — link-state; uses Dijkstra's algorithm; considers bandwidth not just hops; fast convergence; used within organisations (IGP)
  • BGP (Border Gateway Protocol) — path-vector; used between autonomous systems (AS) on the internet; the "routing protocol of the internet"

Circuit Switching vs Packet Switching

Circuit SwitchingPacket Switching
ConnectionDedicated physical circuit established before communicationNo dedicated circuit — packets routed independently
BandwidthFixed bandwidth reserved for the durationShared — bandwidth used only when data sent
ReliabilityIf circuit fails, communication endsPackets rerouted if a link fails
LatencyLow, consistent (once circuit established)Variable — packets may queue or take different routes
Example useTraditional telephone network (PSTN)Internet

TTL — Time to Live

The TTL field in a packet header is a counter that decrements by 1 at each router hop. When TTL reaches 0, the packet is discarded and an ICMP "Time Exceeded" message is sent back to the source. This prevents packets from looping infinitely if there is a routing loop.

The traceroute / tracert command exploits TTL to map the path packets take — it sends packets with TTL=1, 2, 3... and collects the "Time Exceeded" responses from each router along the path.

Packet Reassembly

At the destination, packets are reassembled in the correct order using the sequence numbers in their headers. Packets may arrive out of order (since they can take different routes) or even fail to arrive at all. TCP (at the transport layer) handles acknowledgement and retransmission of missing packets.

Exam tip: Know the structure of a packet (header contains: source IP, destination IP, sequence number, TTL, protocol; payload = data). Know what a routing table is and what information it contains. Know the difference between static and dynamic routing.
Exam tip: For "advantages of packet switching over circuit switching" in the exam: resilience (rerouting), efficiency (shared bandwidth), error recovery (resend individual packets). The exam frequently tests this comparison.
⚠ Common Mistakes
  • Saying packets always take the same route — they don't; each packet is routed independently and may take a different path. They are reassembled in order at the destination.
  • Confusing the router with a switch — a switch operates at the data link layer (uses MAC addresses within a network); a router operates at the network layer (uses IP addresses to route between networks).
  • Saying TTL prevents loops by "checking for duplicate packets" — TTL simply counts down at each hop and drops the packet at 0. It prevents infinite looping but doesn't detect duplicates.
✓ Notes completed!
Video coming soon
Click to advance · Arrow keys also work
Click slide or press arrow keys to navigate

Worksheet — 1.3.4c Routing & Packet Switching

8 questions · 20 marks · instantly marked

Q1Explain what packet switching is and how it differs from circuit switching.[4 marks]
✓ Mark scheme
Packet switching: data is broken into small packets [1]; each packet travels independently across the network, potentially via different routes [1]; packets are reassembled in the correct order at the destination using sequence numbers [1]. Circuit switching: a dedicated physical circuit is established before communication begins; bandwidth is reserved for the entire duration of the connection — e.g. traditional telephone calls. In packet switching, bandwidth is shared and used only when data is sent; in circuit switching, it is dedicated regardless of whether data is flowing [1].
Q2Describe the contents of a packet header. Include at least four fields.[4 marks]
✓ Mark scheme
1 mark each for any four of: Source IP address — the IP address of the sending device [1]; Destination IP address — where the packet needs to be delivered [1]; Sequence number (packet number) — used to reassemble packets in the correct order at the destination [1]; TTL (Time to Live) — number of hops before packet is discarded, prevents routing loops [1]; Protocol type — indicates the protocol in the payload (e.g. TCP=6, UDP=17) [1]; Total packet size / payload size [1]; Checksum — error detection [1].
Q3Explain the purpose of a routing table and describe what information it contains.[4 marks]
✓ Mark scheme
Purpose: a routing table is a database in a router listing known network destinations and the best path to reach each one — used to decide which interface/next-hop to forward each incoming packet through [1]. Contents — 1 mark each for any three: Destination network — the IP address/subnet of the target network [1]; Next hop — the IP address of the next router to forward the packet to [1]; Interface — which physical port/interface to use [1]; Metric — a cost value to compare multiple routes; lower metric = better route [1].
Q4Compare static and dynamic routing. State when each would be preferred.[4 marks]
✓ Mark scheme
Static: routes are manually configured by a network administrator; do not change automatically if a link fails; no routing protocol overhead; preferred for small, stable networks where routes rarely change [2]. Dynamic: routes are learned and updated automatically via routing protocols (e.g. OSPF, BGP); adapts to failures and topology changes automatically; uses bandwidth for protocol messages; preferred for large, complex, frequently changing networks like the internet [2].
Q5Explain the purpose of the TTL (Time to Live) field in a packet header.[2 marks]
✓ Mark scheme
TTL is a counter in the packet header that is decremented by 1 at each router hop [1]; when TTL reaches 0, the packet is discarded and an ICMP "Time Exceeded" message is returned to the source — this prevents packets from looping indefinitely around the network in the event of a routing loop [1].
Q6Give two advantages of packet switching over circuit switching for data transmission over the internet.[2 marks]
✓ Mark scheme
Any two from: Resilience — if a link fails, packets can be rerouted via alternative paths; no single point of failure brings communication down [1]; Efficiency — no dedicated circuit; multiple users share bandwidth; bandwidth only used when actively sending data [1]; Error recovery — individual lost or corrupted packets can be resent without retransmitting the whole message [1]; Scalability — new nodes and routes can be added without reconfiguring existing connections [1].
Q7Explain what BGP is and why it is described as the "routing protocol of the internet".[2 marks]
✓ Mark scheme
BGP (Border Gateway Protocol) is a path-vector routing protocol used between autonomous systems (AS) — independently managed networks such as ISPs [1]. It is called the "routing protocol of the internet" because it handles routing between the thousands of ASes that make up the internet — determining the best paths for traffic to travel across organisational and national boundaries [1].
Q8A user downloads a 10 MB file. Explain why individual packets of the file might arrive at the destination in a different order to which they were sent, and how the correct order is restored.[2 marks]
✓ Mark scheme
Packets travel independently and may take different routes through the network — routes with different numbers of hops or varying congestion levels may deliver some packets faster than others, causing out-of-order arrival [1]. The correct order is restored using sequence numbers in each packet's header — the destination device buffers incoming packets and uses the sequence numbers to reassemble them in the correct order before passing the data to the application [1].
Topic Quiz
1 of 15
You scored
out of 15
🎯

Mini Test — 1.3.4c Routing

  • 10 questions · 10 marks · 10 minutes
  • 5 MCQ + 5 short answer
Card 1 of 15
Click to reveal
🎉
Complete!
TermDefinition
← 1.3.4b IP Addressing 1.3.4 The Internet Next: 1.3.4d Firewalls & Proxies →