Packet Switching
When packets reach their destination, the receiving device turns them back into the original file or message. Because packets can take different routes, they may arrive out of order, so the device uses the sequence number in each packet to put them back into the correct order. This process is called reassembly.
For example, your phone might receive the five packets of a voice message in the order 3, 1, 5, 2, 4. It reads the sequence numbers and places them as 1, 2, 3, 4 and 5, so the whole message is rebuilt and can be played.
As each packet arrives, the receiving device carries out error checking. It uses any error-checking data in the packet to test whether any bits changed while the packet was travelling. A gap in the sequence numbers shows that a packet is missing. If a packet is corrupt or missing, the destination asks the source device to send that packet again. The other packets are kept, so only the faulty or missing one needs to travel again.
Reassembly and error checking happen at the destination device, such as your laptop or phone, not at the routers in between. Routers forward packets one at a time towards the destination IP address, but they do not wait for a whole set or put packets in order. This is efficient because different packets can take different routes and still be rebuilt correctly at the end.
Edexcel GCSE Computer Science · Packet Switching