Reordering packets at the destination
After the last packet arrives, the receiving device uses the packet numbers in the headers to put the packets in the right order and joins the payloads to rebuild the message.
Understanding Reordering packets at the destination in IGCSE Computer Science Paper 1
What it does: Reordering only happens after the last packet arrives, which the condition checks before calling the reorder step. Joining the payloads in packet-number order recreates the whole message, which is what the plus signs show. Arrival order does not matter. The packets are sorted by their packet numbers once all of them have arrived. The packet number is stored in the header. The header also holds the destination address and the originator's address.
Common mistakes: The packets are only put in order after the last packet has arrived, not as each one arrives. Line 1 should wait until the last packet arrives. The loop should keep storing packets while the last packet has NOT yet arrived. Without NOT, it would not collect the packets properly.
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 121–130) and word search (Modules 121–141).
Take this worksheet further — free with Cloodit
Each concept is reinforced from every angle — learned, then applied, then tested.
Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.
Over 100 of them, across seven natural biomes.
Turns their work into revision material ready for Flash Cards and Exam study.
Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.
Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.
Quick Questions
Match the Pairs
Key Term
reordering packetsFill in the Blanks
Spot the Error
Student with a class code? Join your class →