← IGCSE Computer Science Paper 1

A router controls each packet's route

A router reads each packet's destination address in its header and picks the next router to send it to, so every packet's route is decided one step at a time.

Understanding A router controls each packet's route in IGCSE Computer Science Paper 1

What it does: The loop handles every packet one at a time, so each packet gets its own routing decision. Forwarding to the next router shows one step at a time; the following router chooses the next step itself. The router reads the destination address in the header. It does not need to look at the payload to choose the next hop. Routing is decided packet by packet, so packets from the same message can be sent along different routes. Each packet is routed on its own. The router can pick a different next router for each packet, for example if one route is busy.

Common mistakes: The router must read the destination address from the header to choose a route. The packet number is only used to reorder packets at the end. It should be dest <- packet.destination. The next router is chosen using the destination address, not the originator's address. The line should be next <- PICK_ROUTE(dest).

Class: _____________________  ·  Name: _____________________  ·  Date: _________

Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.

This module's key terms are also in a printable crossword (Modules 110–120) and word search (Modules 86–120).

Take this worksheet further — free with Cloodit

Each concept is reinforced from every angle — learned, then applied, then tested.

Learning
Duo
What does a router read in a packet's header to decide where to send the packet next?
The destination addressThe payload data
Matches
router.read(packet.payload) # to find the route
↓
The router uses the payload to choose the route. The payload is just the data being carried. The router must read the header, which holds the destination address.
Applying
Meanings
Term
routing
Meaning
A router reads each packet's destination address in its header and picks the next router to send it to, so every packet's route is decided one step at a time.
Practice
WHILE packets are arriving
Testing
Gaps
address ← packet.header.
Check Answer
Spots
1dest <- packet.packet_number
2next <- LOOKUP(dest)

Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.

The 'Anglerfish' badge — Deep Diver, one of Cloodit's 106 collectible badges
Students earn collectable badges

Over 100 of them, across seven natural biomes.

Study Buddy
Students build a real study resource

Turns their work into revision material ready for Flash Cards and Exam study.

Diamond Dash — one of Cloodit's live, competitive Sprint games
Students lock in with Sprints

Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.

A Cloodit certificate of achievement, ready to personalise and print
Custom printable certificates

Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.

Quick Questions

1. What does a router read in a packet's header to decide where to send the packet next?
A. The destination address ✓
B. The payload data
The router reads the destination address in the header. It does not need to look at the payload to choose the next hop.
2. Which statement about routing is correct?
A. A router decides the route for each packet separately ✓
B. A router decides one route for the whole message before any packet is sent
Routing is decided packet by packet, so packets from the same message can be sent along different routes.
3. After a router reads a packet's header, what does it do with the packet?
A. Keeps it until all the other packets arrive
B. Forwards it to the next router on the way to the destination ✓
The router forwards the packet to the next router. This repeats at each router until the packet reaches its destination.
4. Which part of a packet does the router use to choose the next router?
A. Header ✓
B. Trailer
The header holds the destination address, the originator's address and the packet number. The router uses the header to route the packet.
5. Two packets from the same file reach a router. Which is true?
A. The router must send them to the same next router
B. The router can send them to different next routers ✓
Each packet is routed on its own. The router can pick a different next router for each packet, for example if one route is busy.

Match the Pairs

routing → A router reads each packet's destination address in its header and picks the next router to send it to, so every packet's route is decided one step at a time.
next_hop = router.read(packet.header.destination) → The router reads the destination address in the packet header to decide which router to forward the packet to next.
A router decides the route for each packet separately, so two packets from the same file can be sent different ways. → for packet in packets: route = router.choose(packet)
A router does not plan the whole journey. It only forwards the packet to the next router, which then makes its own decision. → router2.forward(packet, router3)
router.read(packet.payload) # to find the route → The router uses the payload to choose the route. The payload is just the data being carried. The router must read the header, which holds the destination address.
route = router.choose(all_packets) # one route for the whole message → A router does not pick one route for the whole message. It decides the route for each packet separately, so packets may take different routes.

Key Term

routing
A router reads each packet's destination address in its header and picks the next router to send it to, so every packet's route is decided one step at a time.

Fill in the Blanks

1. address ← packet.header.destination
Hint: Type the header field that tells the router where the packet is going.
2. address ← packet.header.destination next ← router.chooseRoute(address)
Hint: Type the router method that picks the next step of the route.
3. next ← router.chooseRoute(address) router.forward(packet, next)
Hint: Type the action the router does to pass the packet on to the next router.
4. FOR EACH packet IN message router.route(packet)
Hint: Type the keyword that makes the router decide for every packet separately.
5. address ← packet.header.destination next ← router.chooseRoute(address) router.forward(packet, next)
Hint: Type the variable holding the value the router reads from the header to make its decision.

Spot the Error

Question 1
A dest <- packet.packet_number
B next <- LOOKUP(dest)
C SEND packet TO next
Line A — The router must read the destination address from the header to choose a route. The packet number is only used to reorder packets at the end. It should be dest <- packet.destination.
Question 2
A FOR EACH packet IN arrived
B dest <- packet.destination
C next <- PICK_ROUTE(source)
D SEND packet TO next
Line C — The next router is chosen using the destination address, not the originator's address. The line should be next <- PICK_ROUTE(dest).
Question 3
A RECEIVE packet
B dest <- packet.trailer.dest
C next <- BEST_ROUTER(dest)
D FORWARD packet TO next
Line B — The destination address is stored in the packet header, not the trailer. The trailer only marks the end of the packet. It should be packet.header.dest.
Question 4
A packet <- RECEIVE()
B dest <- packet.destination
C next <- LOOKUP(dest)
D SEND payload TO next_router
Line D — The router must forward the whole packet, including its header. If only the payload is sent, the next router cannot read the destination address. It should be SEND packet TO next_router.
Question 5
A FOR EACH packet IN message
B dest <- packet.destination
C next <- LOOKUP(dest)
D SEND message TO next
Line D — Routing is decided packet by packet, so each packet is sent on its own route. The whole message must not be sent together. It should be SEND packet TO next.

Student with a class code? Join your class →