
The logic of a digital handshake between devices
Before your phone swaps a single cat photo, it performs a ritual more tedious than setting up a deckchair on a windy beach. It’s called a three-way handshake—a polite shouting match to ensure nobody is talking to a brick wall.
Your device sends a "Hello, can you hear me?" signal. The server catches it and shouts back, "Yes! Can you hear me?" Finally, your device confirms, "Loud and clear, let’s get on with it."
It’s a lot of faff just to check the plumbing, but without this triple-check, the internet would be a chaotic mess of half-finished sentences lost in the digital breeze.
If you only had two steps, you’d end up in a right muddle. Imagine shouting "Fancy a tea?" to your neighbor. They shout back "Yes please!", but you've already wandered off to the garden because you didn't hear them.
The third step is the confirmation that the confirmation was actually heard. Without it, the server might be sat there waiting forever with a tray of biscuits while you’ve already closed the door.
It’s about mutual agreement. Both sides need to be absolutely certain the other is ready to listen, otherwise, you’re just shouting into the void and wasting perfectly good electricity.
Not literally forever, darling, but long enough to be a nuisance. It’s like waiting for a guest who promised to show up for Sunday roast. The server keeps a chair empty and the gravy warm, clutching that 'half-open' connection like a hopeful romantic.
Eventually, it realizes it’s been stood up and bins the biscuits. But if thousands of people do this at once—often on purpose—it’s called a SYN flood. The poor server gets so overwhelmed by imaginary guests that it hasn't got room for anyone who actually wants tea.
That’s why we have timers. After a few seconds of silence, the server sighs, puts the kettle away, and clears the table to make space for someone who isn't quite so flaky.
If you show up after the gravy’s gone cold, you’re out of luck. The server sends a sharp 'Reset' signal—the digital equivalent of pointing at its watch and slamming the door.
Your device receives this 'RST' message and realizes it missed the party. It must start the whole three-way handshake from scratch, right back at the 'Hello' stage.
It’s a bit brutal, but there’s no room for dawdling. If you aren't on time for tea, you don't get a biscuit—you get a fresh start.
It’s all about the flags, dear. Think of the digital packet as a little envelope with checkboxes on the front. Usually, we tick the 'Hello' box, but the Reset is a big, red 'Stop' stamp.
If the server is just slow, your phone gets nothing but silence. It sits there twiddling its thumbs, waiting for a reply that never comes. But a Reset is an active 'No'—the difference between a friend ignoring your text and them sending a 'Stop' reply.
One is a mystery that leads to wasted time; the other is a clear instruction to bin the attempt. It saves everyone’s energy by ending the awkward silence immediately.
Related topics
How a computer uses 'queues' to handle information in order
The logic of 'database indexing' for finding information quickly
The way a computer screen uses pixels to display images
The way 'responsive design' makes a website fit any screen size
The logic of 'pathfinding algorithms' for navigating digital maps
The way a computer uses 'encryption' to keep messages private