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?
- The router reads the destination address in the header.
- It looks up the best next hop in its routing table.
- It reduces the hop count by 1.
- 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.