How the internet worksExhibit 5

How does WhatsApp deliver a message in under a second?

Your message is locked on your phone (end-to-end encryption), sent down a connection to WhatsApp’s servers that’s already open, and pushed down your friend’s open connection the moment their phone can be reached. Light in fibre covers about 200,000 km a second, so the trip itself is a tiny fraction of a second. The ticks tell you which hop it has reached.

Try it: send a message and follow every hop

Where is your friend?
  1. 🔒Locked on your phone.
  2. ↗Up the open connection to WhatsApp’s server. No new connection to set up.
  3. ✓One grey tick: sent. The server has it, still locked.
  4. ↘Down your friend’s open connection.
  5. ✓✓Two grey ticks: delivered. Unlocked only on their device.
  6. ✓✓Two blue ticks: read.

Fibre times use the straight-line distance at about 200,000 km/s, one way. Real cables wind around and routers add delay, so real trips take longer, but still well under a second.

Watch: how WhatsApp delivers a message

Open connections, encryption, Erlang and the ticks, in under 5 minutes.

The video loads from YouTube only when you press play. Watch on YouTube

Why does a message need a server at all?

Phones are terrible at being found. They hop between Wi-Fi and mobile data, change internet addresses, sit behind carrier networks that block incoming connections, and spend hours switched off or asleep. So WhatsApp works like a post office that never closes: your phone hands the message to WhatsApp’s servers, and the servers get it to your friend whenever their phone can be reached.

Why is it so fast? The line is already open

While WhatsApp is running, it keeps a long-lived, encrypted connection to its servers, like a phone call that never hangs up. Setting up a fresh, secure connection takes a few round trips across the internet; reusing one that’s already open means your message goes out right away. When the app is closed, your phone’s operating system keeps its own always-on link to Apple or Google, and a push notification tells WhatsApp there’s something waiting.

How can WhatsApp’s servers carry messages they can’t read?

Since 2016, WhatsApp has encrypted chats end to end with the Signal Protocol. Each phone makes a pair of keys: a public one, shared through the servers, and a private one that never leaves the device. Your phone mixes its private key with your friend’s public key and gets a secret number; their phone, mixing their private key with your public key, gets exactly the same number. Anyone watching in between can’t work it out. From then on the keys keep changing as you chat, so what travels is scrambled bytes.

The switchboard

The server’s job is to find your friend’s open connection and push the message down it, for billions of people. WhatsApp built its chat servers in Erlang, a language Ericsson created in the 1980s for telephone exchanges, where each connection can live in its own tiny process. In January 2012, WhatsApp’s engineers posted that a single server could hold more than two million connections at the same time (2,277,845 in their test).

What the ticks really mean

  1. One grey tick: the server has your message. If your friend’s phone is off, it waits there, still encrypted, for up to 30 days.
  2. Two grey ticks: delivered to your friend’s phone or a linked device.
  3. Two blue ticks: read. With read receipts off they stay grey in one-to-one chats; in groups they turn blue once everyone has read it.

One more twist: if your friend also uses WhatsApp on a laptop, each device has its own identity key, so your phone locks the message separately for every one of their devices.

Frequently asked questions

What do the ticks on WhatsApp mean?

One grey tick: the message reached WhatsApp’s server. Two grey ticks: it was delivered to your friend’s phone or one of their linked devices. Two blue ticks: they have read it. If they switched read receipts off, the ticks stay grey in one-to-one chats; in groups, the ticks turn blue only once everyone has read the message.

Can WhatsApp read my messages?

WhatsApp has used end-to-end encryption by default since 2016, based on the Signal Protocol. Messages are locked on your phone and unlocked only on your friend’s devices. WhatsApp’s privacy policy says this protects your messages from third parties and from WhatsApp itself; the servers know who a message is for, but can’t open it.

Why does my WhatsApp message have only one tick?

One grey tick means the server has the message but your friend’s phone hasn’t received it yet, usually because it is off, asleep or offline. WhatsApp says undelivered messages are kept encrypted on its servers for up to 30 days and deleted after that.

How can a message cross the world in under a second?

Light in optical fibre covers about 200,000 km every second, so even New York to London (about 5,600 km in a straight line) takes under 30 milliseconds one way. Real cables wind around and routers add delay, but a measured round trip from London to Sydney averages about 268 ms, still well under a second. An already-open connection means no time is lost setting one up.

Why does WhatsApp use servers instead of sending phone to phone?

Phones are hard to reach directly: they hop between Wi-Fi and mobile data, change internet addresses, sit behind carrier networks that block incoming connections, and spend hours switched off or asleep. A server that’s always on can hold the message and deliver it as soon as the phone can be reached.

Sources

Last updated

Keep exploring