Article
What can go wrong with packets
You type "see you at five" and send it. The message is cut into four packets. The receiver's phone gets packet 3, then packet 1, then packet 4, and packet 2 never comes. What does your friend read? Without any help, the answer is a mess. This article is about why that can happen.
Four things that can go wrong
Packets travel through many routers and cables, and the Internet makes no promise that every trip goes well. Four problems are common:
| Problem | What happens | A typical cause |
|---|---|---|
| Lost packet | The packet never arrives. | A router is too busy and throws the packet away, or a link breaks while the packet is on it. |
| Out-of-order packets | The packets arrive, but not in the order they were sent. | The packets took different routes. |
| Late packet | The packet arrives, but much later than the others. | It took a long or crowded route. |
| Damaged packet | The packet arrives, but some bits have changed. | Electrical noise or a poor connection flipped a 0 to a 1, or the other way round. |
None of these is a mistake by the sender or the receiver. They are normal on a network made of millions of shared parts.
Check your understanding
Packet 5 of a message arrives before packet 4. Which problem is this?
Best effort
IP, the protocol that addresses and routes packets, works on a best-effort basis. That means a router does its best to pass each packet on, but it does not promise that the packet will arrive, arrive once, arrive in order, or arrive undamaged.
This sounds bad, but it keeps the Internet simple and fast. Routers do not have to remember every packet or keep track of every conversation. They just forward.
So who deals with the problems? Another protocol, running on the two computers at the ends of the journey. Two such protocols are very common: UDP and TCP. The next two articles explain them. In short, one of them fixes problems and the other does not.
Worked example
The word HELLO is sent as five packets, one letter each:
| Packet number | 1 | 2 | 3 | 4 | 5 |
|---|---|---|---|---|---|
| Letter | H | E | L | L | O |
The packets arrive in this order: 2, 1, 5, 4. Packet 3 never arrives.
HELLO sent as five packets
- 1
Sender → Routers
Packets 1, 2, 3, 4, 5
- 2
Routers → Receiver✕ lost
Packet 3 (L)
- 3
Routers → Receiver
Packet 2 (E)
- 4
Routers → Receiver
Packet 1 (H)
- 5
Routers → Receiver
Packet 5 (O)
- 6
Routers → Receiver
Packet 4 (L)
- Sorted by number, the receiver has H, E, a gap, L, O.
- Out of order: the packets arrived as 2, 1, 5, 4. Sorting by packet number gives 1, 2, 4, 5.
- Lost packet: packet number 3 is missing.
- The receiver can rebuild this: H, E, (gap), L, O.
The text reads HE?LO, which is not the word that was sent. If the receiver just puts down letters as they come, it gets E, H, O, L, which is even worse. Packet numbers fix the order, but only a protocol that can ask for packet 3 again can fix the gap.
Check your understanding
IP works on a "best-effort" basis. What does that mean?
Common mistakes
- "If a packet is lost, the message is lost." Not necessarily. A protocol on top of IP can notice the gap and ask for the packet again.
- "Out of order means damaged." No. The packets are fine. They only arrived in a different sequence.
- "A late packet is the same as a lost packet." A late packet does arrive. For some uses, such as a live call, a very late packet is almost as useless as a lost one, but they are still different problems.
- "Best effort means the Internet is unreliable, so it is a bad design." It is a deliberate choice that keeps the network simple. Reliability is added at the ends when it is needed.
On the exam
Know the four problems and be able to name each from a short description. Remember that IP does not promise delivery, and that the choice between fixing problems (TCP) and ignoring them for speed (UDP) is made by the protocols at the ends.
Key words
Lost packet: a packet that never reaches its destination.
Out-of-order packets: packets that arrive in a different order from the one they were sent in.
Damaged packet: a packet that arrives with some of its bits changed.
Best effort: trying to deliver every packet, but promising nothing.