A Simple Guide to TCP and UDP Protocols

Emer Kurbegovic
3 min readSep 15, 2023

The internet, with all its websites, videos, and apps, is like a massive highway for data. But how do computers ensure that data reaches the right place at the right time? That’s where TCP and UDP come in. Think of them as two different types of delivery services that make sure your data gets to its destination.

TCP

TCP, which stands for Transmission Control Protocol, is like the postal service of the internet. It’s super careful and reliable. When you send a message or download a file, TCP makes sure it arrives perfectly intact.

Imagine you’re sending a letter. TCP does a special handshake with the receiving computer before it sends your data. It’s like making sure the other side is ready to receive your letter. TCP makes sure that the data packets (like envelopes) arrive in the correct order. It’s like a storybook where the pages are always in the right sequence. If a packet goes missing or gets messed up during delivery, TCP asks for it to be sent again. It’s like getting a replacement for a lost piece of mail. TCP wants to be absolutely certain that your data made it, so it asks the receiving computer to confirm when it gets each packet. It’s like sending a message saying, “Did you get it?” and waiting for a “Yes” before sending the next part.

TCP is excellent for things like sending emails, browsing the web, or downloading files because it ensures that your data is delivered accurately and completely. It’s like having a postman who never loses a letter.

UDP

Now, let’s talk about UDP, which stands for User Datagram Protocol. UDP is like a super-fast delivery service. It’s all about speed, but it might not be as careful as TCP.

UDP doesn’t waste time with handshakes. It just starts sending your data right away. It’s like dropping a message in the mailbox without ringing the doorbell. Unlike TCP, UDP doesn’t care much about the order in which the data arrives. It’s like sending postcards — they may arrive out of order, but that’s okay. UDP doesn’t wait for a confirmation that your data arrived. It just sends and hopes for the best. If something gets lost, UDP won’t try to get it back.

UDP is great for things that need to happen quickly, like online gaming or video chats. It’s like a pizza delivery service — you get your pizza fast, but they won’t check if you received all the toppings you wanted.

--

--