Skip to content
IGCSE·Tuition
Computer Science · Lesson

Trace a packet through a simplified network

Packet questions feel vague until you follow one packet step by step and see what each device actually does.

On this page
  1. What is inside a packet?
  2. How does a router decide what to do?
  3. Worked example
  4. What mistake do students make?
  5. Check yourself
  6. Where this leads next

A message sent over a network is split into packets. Each packet carries a header with addressing and numbering information, a payload of data, and routers pass it from hop to hop until it reaches the destination. Exam questions ask you to describe this journey or fill in a table.

This lesson opens data transmission and checking. The checks in the later lessons make more sense once you know what is being sent.

What is inside a packet?

For IGCSE you can think of a packet as three parts:

  • Header: destination address, sender address, packet number, total number of packets and a hop count.
  • Payload: the slice of the message being carried.
  • Trailer or check data: extra information the receiver uses to test for errors.

The addresses below are invented examples from the range reserved for documentation, so they belong to no real device.

How does a router decide what to do?

  1. The router reads the destination address in the header.
  2. It looks up the best next hop in its routing table.
  3. It reduces the hop count by 1.
  4. If the hop count is now 0, it discards the packet. Otherwise it forwards the packet.

Routers do not read your message. They only use the header.

Worked example

A laptop (198.51.100.7) sends a 2,400-character message to a server (203.0.113.20). Each packet holds 800 characters of payload. The hop count starts at 5.

The path is Router A, Router B, Router C.

Step 1, split. 2,400 ÷ 800 = 3, so there are 3 packets, numbered 1 of 3, 2 of 3 and 3 of 3.

Step 2, headers. Each header shows destination 203.0.113.20, source 198.51.100.7, its packet number, the total (3) and hop count 5.

Step 3, hops for packet 1. At Router A the count becomes 4. At Router B it becomes 3. At Router C it becomes 2. The packet reaches the server with a count of 2, so it was not discarded.

Step 4, a different route for packet 2. Router A sees heavy traffic on the link to Router B and sends packet 2 through Router D instead. It then goes D, then C. The count falls 4, 3, 2 and it also arrives.

Step 5, arrival order. Packet 3 takes the short route and arrives first. The server receives 3, 1, 2.

Step 6, reassembly. The server uses the packet numbers to reorder them 1, 2, 3 and joins the payloads into the original 2,400 characters. If packet 2 never arrived, the server would ask for packet 2 only.

What mistake do students make?

A common answer is: “The router sends the whole message along the fastest path and the packets arrive in order.”

That is wrong in two ways.

The message is already split, and each packet can take its own route. The packets can arrive in any order, which is exactly why the packet number is in the header. The correction is to say that the receiving device reorders the packets using their numbers.

Check yourself

1. A 1,500-character message is sent in packets of 500 characters. How many packets are needed?

Show answer

1,500 ÷ 500 = 3. 3 packets.

2. A packet starts with a hop count of 3 and must pass through 4 routers. What happens, and where?

Show answer

Router 1 changes it to 2, Router 2 to 1, Router 3 to 0. Router 3 discards it. It is discarded at the third router and never reaches the fourth.

3. Which header item lets the receiver rebuild the message in the right order?

Show answer

The packet number (with the total number of packets).

Where this leads next

Next, look at how bits are physically sent in serial and parallel transfer. Then try the practice set. The restricted pseudocode trace trainer is a useful way to practise tracing a loop that counts hops.

If you can describe the steps but your written answers lose clarity, our teachers can help you structure them in online one-to-one Computer Science tuition.

Questions people ask

Why is data split into packets?

Small packets can take different routes, so one busy or broken link does not block the whole message. If a packet is damaged or lost, only that packet is sent again, not the entire file. Many packets from different users can also share the same links efficiently.

Do all packets take the same route?

Not necessarily. Each router decides the next hop for each packet, so packets from one message can arrive by different paths and in a different order. The packet number in the header lets the receiving device put them back in the correct order.

What happens when the hop count reaches zero?

The router discards the packet instead of passing it on. This stops a packet that is stuck in a loop from travelling forever. Check the exact terms your syllabus uses, because some sources say time to live and others say hop count.

Updated:

Your next step

If the network diagrams make sense in class but your written explanations come out muddled, a one-to-one teacher can rebuild your answer step by step with your own examples.

Paid one-hour trial at your assigned teacher’s confirmed rate, starting from RM80.

Tuition is arranged with a parent or guardian. Send them this page on WhatsApp and they can enquire for you.

Parents: enquire here

  • 9,000+ students helped through our service
  • 9+ years helping IGCSE students