WhatsApp voice call
DKDK
Ringing…
WhatsApp voice call
DKDK
Ringing…
WhatsApp voice call
DKDK
Ringing…
DK calls Rajat on WhatsApp: their voices travel as small packets, fifty a second. Rajat picks up, walks into a lift, and DK sends a message mid-call. Illustrative times.
UDP when the newest packet matters more than a lost one: calls, games, live video. TCP when everything must arrive, in order: messages, payments, web pages. Most apps use both.
| Difference | TCP | UDP |
|---|---|---|
| Before the first byte | A handshake: SYN, SYN-ACK, ACK | Nothing: send at once |
| A lost packet | Sent again; everything behind it waits | Gone; the next one plays |
| Order | Always in order | As they arrive |
| On a call | Freezes, then plays late | A 20 ms blip, stays live |
| A busy network | Slows itself down, fairly | Keeps sending; the app decides |
| Used for | Messages, web pages, payments, files | Calls, games, live video, DNS |
DK calls Rajat on WhatsApp. Their voices travel as small packets, fifty every second. On the left, they go over TCP: every packet arrives, in order, or the connection waits until it does. On the right, over UDP: packets just fly, and a lost one stays lost. Let’s put both through three situations.
First, Rajat picks up. TCP shakes hands before anything flows: a SYN, a SYN-ACK and an ACK, one full round trip across the network. Only then can DK’s first word set off.
UDP doesn’t shake hands. DK’s first word leaves the moment Rajat picks up, a round trip sooner.
Next, Rajat steps into a lift, and packet forty-three is lost. TCP holds every packet behind it until forty-three is sent again, so the call freezes, then plays a burst of late audio, and the delay sticks.
With UDP, packet forty-three is simply skipped. The app fills the gap, twenty milliseconds of sound, and the call stays live.
Finally, DK types: running five minutes late. A message must arrive whole, and TCP makes sure of it: the lost piece is sent again, and Rajat reads every word, in order.
Over plain UDP, the same message loses a piece and arrives with a hole in it. That’s why WhatsApp sends messages over TCP, and keeps UDP for the call itself.
So which should you pick? UDP when the newest packet matters more than a lost one: calls, games, live video. TCP when everything must arrive, in order: messages, payments, web pages. Most apps use both.