๐ Short Intro (Why Iโm Writing This)
Iโm currently learning Networking for DevOps and decided to learn in public by documenting my journey.
This blog is part of my Networking 101 series, where Iโm learning Networking for DevOps step by step from scratch.
This series is not written by an expert โ itโs a beginner learning out loud, sharing:
- what I understand,
- what confuses me,
- and what I learn along the way.
The goal is to build consistency, clarity, and invite discussion.
๐ What This Blog Covers
In this post, Iโll cover:
- What is TCP
- Advantages of TCP
- What is UDP
- Advantages of UDP
- When to use TCP vs UDP
- Basic commands related to TCP & UDP
๐ GitHub Repository
All my notes, diagrams, and learning resources for this series live here:
๐ GitHub Repo:
https://github.com/dmz-v-x/networking-for-devops-101
This repo is updated as I continue learning.
๐ Learning Notes
1. First, the big question
When one computer sends data to another, how do we make sure:
- The data arrives?
- The data arrives in the correct order?
- Missing data is re-sent?
There are two different answers to this problem.
They are called:
- TCP
- UDP
2.Before we start: where TCP & UDP sit
From earlier blogs, our stack looks like this:
Application (HTTP, SSH, DB)
โ
Transport Layer (TCP or UDP)
โ
IP (IP Address)
โ
Network
TCP and UDP live in the transport layer.
They decide how data moves, not where it goes.
3. TCP โ Transmission Control Protocol
TCP is the most important protocol for DevOps engineers.
3.1 What TCP guarantees
TCP guarantees:
- Data arrives
- Data arrives in order
- Lost data is re-sent
- Duplicate data is removed
This makes TCP reliable.
4. What โconnection-basedโ actually means
Before sending data, TCP does something crucial.
It creates a connection.
Conceptually:
- Client: โCan we talk?โ
- Server: โYesโ
- Client: โGreatโ
This is called the TCP handshake.
If this handshake fails, nothing else happens.
5. Common DevOps errors caused by TCP failure
If TCP connection fails, youโll see errors like:
Connection refusedConnection timed outNo route to host
These errors mean:
- The app may be running
- But TCP cannot establish a connection
Usually due to:
- Firewall rules
- Closed ports
- App not listening
- Wrong IP or port
6. What uses TCP? (Very important list)
Almost everything you use daily:
| Protocol | Uses TCP? |
|---|---|
| HTTP | โ |
| HTTPS | โ |
| SSH | โ |
| FTP | โ |
| Databases | โ |
If reliability matters โ TCP is used.
7. UDP โ User Datagram Protocol
UDP solves a different problem.
7.1 What UDP does (and doesnโt do)
UDP:
- Sends data
- Does not guarantee delivery
- Does not guarantee order
- Does not create a connection
UDP is fast, but unreliable.
8. UDP analogy (simple)
TCP is like:
Making a phone call and talking step by step.
UDP is like:
Shouting messages across a room and hoping theyโre heard.
9. Why does UDP even exist?
Because sometimes:
- Speed matters more than perfection
- Losing some data is okay
Examples:
- DNS queries
- Video streaming
- Online gaming
- Metrics & monitoring systems
Retrying TCP connections would be too slow here.
10. What uses UDP? (DevOps-relevant)
| Use Case | Protocol |
|---|---|
| DNS (mostly) | UDP |
| Metrics | UDP |
| Service discovery | UDP |
| Streaming | UDP |
DNS often uses UDP first, and TCP only if needed.
11. Side-by-side comparison (important)
| Feature | TCP | UDP |
|---|---|---|
| Connection | Yes | No |
| Reliable | Yes | No |
| Ordered | Yes | No |
| Speed | Slower | Faster |
| DevOps usage | Very High | Medium |
12. How this affects DevOps debugging
When something breaks, ask:
- Is this TCP-based or UDP-based?
- Does it expect reliability?
Examples:
- HTTP API failing โ TCP issue
- DNS sometimes failing โ UDP + network issue
- Metrics missing โ UDP packet loss
Understanding this changes how you debug.
13. Commands mapped to TCP & UDP
13.1 TCP testing
Checks if TCP port 443 is open and reachable
nc -vz example.com 443
13.2 UDP testing
Sends a UDP packet to port 53 to see if itโs reachable (best-effort check)
nc -vu example.com 53
Notice:
- TCP checks for connection
- UDP just sends data
14. Real DevOps scenario
Problem:
Your app can resolve DNS, but sometimes fails to connect.
Why this happens:
- DNS uses UDP
- UDP packets can be dropped
- Retry logic may be missing
This is why DNS caching and retries matter (next blogs!).
โ Key takeaways
- TCP = reliable, connection-based
- UDP = fast, connectionless
- Most DevOps tools rely on TCP
- DNS and metrics often use UDP
- Error messages tell you which layer is failing
๐ฌ Feedback & Discussion
๐ก Iโd love your feedback!
If you notice:
- missing tool categories,
- incorrect assumptions,
- or better learning paths,
please comment below. Iโm here to learn.
โญ Support the Learning Journey
If you found this blog useful:
โญ Consider giving the GitHub repo a star โ
it really motivates me to keep learning and sharing publicly.
๐ฆ Stay Updated (Twitter / X)
I share learning updates, notes, and progress regularly.
๐ Follow me on Twitter/X:
https://x.com/_himanshubhatt1
๐ Whatโs Next
In the next post, Iโll be covering:
๐ DNS Explained
Iโll also continue updating the GitHub repo as I progress.
๐ Learning in public
๐ Repo: https://github.com/dmz-v-x/networking-for-devops-101
๐ฆ Twitter/X: https://x.com/_himanshubhatt1
๐ฌ Feedback welcome โ please comment if anything feels off
โญ Star the repo if you find it useful
Top comments (0)