Day 14b –TCP and UDP
Day 14b – TCP vs UDP Explained Like Real Systems
This is Part 2 of the Networking for DevOps series.
In the previous part, we understood https://90-days-devops-with-shubham.hashnode.dev/day-14a-networking-fundamentals
Now, let’s see how data is actually delivered using TCP and UDP.
What is TCP?
TCP (Transmission Control Protocol)
TCP is basically the “reliable delivery system” of the internet.
Let’s make it simple
Think of TCP like a Courier with tracking
When you send something (message, file, request), TCP makes sure:
✔ It reaches the destination
✔ It arrives in correct order
✔ Nothing is missing
✔ If something is lost → it is re-sent
TCP Internal Flow
Prepares delivery with tracking
Adds sequence numbers
Travels across network
Receiver rebuilds message
Missing parts are resent
Final message is correct
Example:
You send:
“Order pizza at 8 PM”
TCP does this behind the scenes
1. It prepares delivery with tracking system
TCP says:
“I will deliver this message safely”
“I will track everything properly”
2. It adds hidden order numbers (not visible to you)
Instead of breaking it like physical pieces, TCP:
tags data with sequence numbers
so receiver knows the exact order
Think:
like numbered pages in a notebook
3. Message travels through internet
Data moves across routers
May take different paths
Still tracked in background
4. Receiver rebuilds message
Receiver gets data like:
“Order”
“pizza”
“at”
“8 PM”
Even if it arrives mixed up, TCP:
- rearranges using sequence numbers ✔
So final message becomes:
“Order pizza at 8 PM”
5. If something is missing
If “8 PM” part is missing:
receiver says: “send that part again”
sender resends ONLY missing part
6. ✔ Final result
Message is complete, correct, and in order.
TCP = Reliable system
Send message → Label data → Transmit → Rearrange
→ Fix missing → Deliver correct message
TCP = “Even if data arrives messy, system fixes it and guarantees correct message”
TCP = “Safe delivery mode”
You → Internet → Friend
✔ No loss
✔ No corruption
✔ Correct order
✔ Guaranteed delivery
Real-world analogy (TCP)
| Real life | TCP meaning |
|---|---|
| Courier with tracking | TCP |
| Registered post | TCP |
| Call and confirm delivery | TCP |
| Throw and forget | ❌ NOT TCP |
TCP used in real world
✔ WhatsApp messages
✔ SSH (port 22)
✔ HTTPS websites (port 443)
✔ curl requests
✔ File downloads
What is UDP?
UDP is the “fast but no guarantee system”
Think of it like a Live Cricket Score update system
UDP (User Datagram Protocol)
👉 UDP = “send and forget”
You:
Send data
Don’t wait
Don’t confirm
Don’t resend
Live Cricket Score example (UDP)
Imagine watching IPL score:
6 runs update → shown instantly
Next ball update → comes next
If one update is missed → NO problem
👉 You don’t care about old missing updates
👉 You only care about latest score
That’s UDP
UDP flow (simple)
Server → sends updates → You watch
✔ Fast
❌ No guarantee all packets arrive
❌ No retry
❌ No order guarantee needed
Real-world analogy (UDP)
| Real life | UDP meaning |
|---|---|
| Live cricket score | UDP |
| Video call | UDP |
| Online gaming | UDP |
| Streaming video | UDP |
Why UDP is used
Because:
SPEED > PERFECT DELIVERY
Even if something is missing → system continues
TCP vs UDP (super simple)
| Feature | TCP | UDP |
|---|---|---|
| Delivery | Guaranteed | Not guaranteed |
| Order | Maintained | Not maintained |
| Speed | Slower | Faster |
| Retry | Yes | No |
TCP = Courier (safe, tracked, confirmed)
UDP = Live cricket score (fast, no guarantee)
TCP → “Make sure it arrives correctly”
UDP → “Send fast updates, don’t worry if something drops”
#90DaysOfDevOps #DevOpsKaJosh #TrainWithShubham
