Networking for Beginners · lesson 5 · 2026-11-22
Networking for Beginners (2026): TCP vs UDP (The Three-Way Handshake)
Before you start
- No IT experience needed. If ports, IP addresses or “envelopes inside envelopes” are new to you, watch Episode 4 first (The Layers: OSI and TCP/IP Explained).
- For the “try it yourself” part: any Windows, Mac or Linux computer.
netstat -an(Windows and Mac) orss -tuan(Linux) only reads your connections and changes nothing. - The handshake, retries and UDP message in the video are real captures from a sealed practice network with made-up lab addresses. The netstat clip is a real Windows 11 computer.
Every web page you open starts with a handshake: three tiny messages before a single byte of the page moves. Learn the TCP three-way handshake, how TCP numbers and receipts every piece, why UDP skips all of it on purpose, and see real captures from a practice lab.
Syn has a web page request to deliver, and he is in a hurry. He runs straight up to the far server, door eighty, and starts shoving his letter under the door.
The door opens just long enough to stamp him. R S T. Reset. Translation: I don’t know you. Then it shuts.
So why won’t a server take a letter from a packet it has never met? And why do some apps skip all that politeness and just throw their messages at you?
By the end, you’ll know the handshake that starts every web page, why it exists, and when the internet skips it on purpose. You’ll see a real one from our lab, three lines long. And yes, there’s a pop quiz.
Last time, the T C P envelope carried the door number. Today, meet the whole transport layer. Two delivery crews. T C P, the careful one. And U D P, the fast one.
T C P is the courier with a clipboard. Before it sends anything, it checks that the other side is there and ready. It numbers every piece. It waits for a receipt. And if a piece goes missing, it sends it again.
U D P is the crew with a firehose. No hello. No receipts. No second tries. It sprays the pieces at the address and is already on to the next job.
Syn, it’s your name. Syn is short for synchronize. It’s the very first message of every T C P conversation. He was named after a handshake, and he did not read his own name tag.
So here’s the handshake. Three messages. First, the laptop sends a Syn. Hello, I’d like to talk, and here’s the number I’ll start counting from.
Second, the server sends back a Syn ack. Ack is short for acknowledge. It means: I got your hello. Here’s mine, and here’s my starting number.
Third, the laptop sends an ack. Got yours too. Now both sides are listening, both know where the counting starts, and the letter can finally go.
Why bother? Because now it’s a conversation, not a letter thrown at a building. The server knows someone is really there, and both sides agree on the numbers.
Pause and guess. Remember the start? Syn skipped all three messages and went straight to the letter. What did the server do?
Reset. There was no conversation, so his letter made no sense. No handshake, no delivery. The rules exist because of packets like Syn.
Those starting numbers matter. Remember the toddler delivering laundry? All of it, eventually, in any order. T C P numbers every piece, so the far end can put them back in order.
And the far end sends receipts. Ack, I’ve got everything up to here. If the sender doesn’t get a receipt in time, it assumes the piece was lost, and sends it again.
Watch. Piece three falls off the road. No receipt comes back for it, so T C P sends piece three again. The web page arrives complete, just a little late. That’s the trade. Careful costs time.
It’s polite at the end, too. When they’re done, each side sends a fin, short for finish, and the other side acknowledges it. T C P says goodbye. Twice.
Now, here’s a real one. In our lab, the laptop asked the far server for its web page, and the router printed every packet going past. Look at the flags. S is a Syn. S dot is a Syn ack. A dot on its own is an ack. Three lines, one handshake.
And those long numbers are the starting numbers. They’re picked at random, every time, so they’re hard to guess. Hold that thought.
And here’s T C P refusing to give up. We knocked on door eighty eighty, which the lab’s firewall blocks. No answer. So the laptop knocked again. And again. Once a second, five times, and then it started waiting longer between knocks. That’s the bouncer from Episode two, saying nothing, while T C P politely keeps trying.
Now the other crew. U D P skips all of that. No handshake, no numbers to sort by, no receipts, no resending. Its envelope is tiny, too. Eight bytes of header, where T C P needs at least twenty.
So why would anyone hire the sloppy crew? Speed. Think of a video call. If a piece of your face from half a second ago goes missing, you don’t want it sent again. By the time it arrived, you’d have moved on. You want the next piece, right now.
So the call just skips it. Maybe the picture freezes for a moment, or your voice blips, and the call keeps going. That’s U D P working exactly as designed.
U D P carries video calls, voice chat, lots of fast online games, and one quick question your computer asks all day long, to turn a website’s name into its address. That one gets its own episode.
U D P is the friend who sends you forty voice notes and never checks whether you listened.
Here’s U D P in the lab. The laptop sent one short message to the computer next door. One line. No hello before it, no receipt after it. The laptop doesn’t even know if anyone heard.
One footnote, to be fair to U D P. Some newer web traffic, called quick, rides on U D P and adds its own careful rules on top. U D P got a responsible roommate. Story for another day.
Pop quiz. Two questions. You’re downloading a game installer. T C P or U D P? And you’re on a video call with your grandma. T C P or U D P?
The download is T C P. One missing piece and the installer is broken, so every piece has to arrive. The call is U D P. A missing piece is a blip, and waiting for it would freeze grandma mid-sentence. If you got both, put it on your job application.
Your turn. On Windows, open PowerShell and type net stat, dash, ay en. It only reads. It changes nothing.
You’ll see two kinds of rows. T C P rows, many of them saying established. Those are finished handshakes, conversations happening right now. And U D P rows, with no state at all, because U D P doesn’t do conversations. On a Mac, it’s the same command. On Linux, type ess ess, dash, tee you ay en.
Now, here’s why hackers care.
After the server sends its Syn ack, it saves a seat and waits for that final ack. Now imagine someone sends thousands of Syns and never answers, often from fake return addresses.
Every seat fills up with a guest who never arrives. When a real visitor shows up, there’s no seat left. That’s called a Syn flood, an old trick for knocking a website offline.
The defense is old, too. Many servers use something called Syn cookies. Instead of saving a seat, the server tucks the details into its own starting number, and only gives out the seat when a real ack comes back. Big websites also sit behind protection services that soak up floods.
And remember those random starting numbers? Someone faking a return address never sees the server’s number, so they can’t easily fake the rest of the conversation. Random numbers, doing security work.
One more. Scanners like Nmap, which we teach on this channel, often send just a Syn and watch who answers. A Syn ack means that door is open. That’s how you find which doors your own computer has open, before somebody else does. Only scan what you own.
At home, the job is simple. Turn off apps and services you don’t use, keep your router updated, and leave the flood fighting to the people who run the servers. They’re good at it.
So, let’s recap. T C P is the careful crew. A three-way handshake, Syn, Syn ack, ack. Numbered pieces, receipts, and second tries. U D P is the fast crew. No hello, no receipts, no second tries, perfect for anything live. Both use the same kind of door numbers.
Next time, Syn wants to visit a website, but he only knows its name, not its address. So before any handshake, somebody has to look it up. In a phone book. By U D P.
See you there.