Week 23 · Unit 9: Cellular networks and data packets · 3 lessons
2
Routes and reassembly
Computing 5: Unit 9, pp. 119–128
GoalExplain how routers pass packets along and how the receiver puts them back in order.
New words
router · a device that reads the address on a packet and sends the packet onroute · the path that a packet takes from the sender to the receiverreassemble · to put the pieces back together in the correct orderforward · to send a packet on to the next router
Explanation
A router is a device that passes packets on. When a packet arrives, the router reads the receiver’s IP address. It checks whether that address belongs to its own network. If it does, the router delivers the packet. If not, it forwards the packet to another router. After several routers, the packet reaches the router that is joined to the right device. Packets of the same message may use different routes, because each one takes the best way at that moment. At the end, the receiving computer uses the sequence numbers to reassemble the packets in the correct order.
Worked examples
This is what a router does with each packet that arrives.
Place in arrival order
1st
2nd
3rd
4th
5th
Packet number
2
1
4
5
3
After sorting
1
2
3
4
5
Packets may arrive in a different order from the order they were sent. Five packets were sent in the order 1 to 5 and arrived in the order shown. The receiver does not care about the arrival order. It sorts them by their numbers.
Moment
Top route
Bottom route
Packet takes
now
busy
quiet
the bottom route
a moment later
quiet
busy
the top route
The best route changes from moment to moment, because the busy and quiet places change. Two packets of one message can therefore take different ways.
Class activity
Router relay (6 players). One player is the sender, one the receiver and four are routers, standing in a diamond. The sender hands out 6 numbered paper packets, one at a time. Each router has a card marked ‘busy’ on one side and ‘quiet’ on the other, and turns it before each packet. A router passes the packet to the quiet neighbour. The receiver writes the order of arrival and then sorts the packets by their numbers. Did all the packets take the same route?
Practice
1
Six packets are sent in the order 1 to 6. They arrive in the order 3, 1, 2, 6, 4, 5. In which order does the receiver put them?
Arrival
1st
2nd
3rd
4th
5th
6th
Packet number
3
1
2
6
4
5
The receiver sorts them by their sequence numbers: 1, 2, 3, 4, 5, 6.
2
The router has two devices on its own network, 10.0.0.2 and 10.0.0.3. What does it do with a packet for 10.0.0.3, and what with a packet for 172.16.5.8?
It delivers the first packet to the device 10.0.0.3, because that device is on its own network. It forwards the second packet to another router, because 172.16.5.8 is not on its network.
3
Two packets of the same message take different routes. Does packet 2 always arrive after packet 1? Explain.
No. A packet on a quiet route can arrive before a packet that was sent earlier on a busy route. The receiver uses the numbers to put them in order.
4
Give two reasons why the internet sends messages as packets and not as one big piece.
A lost packet can be sent again alone. Packets can avoid busy routes. Many users can share the same wires.