Packets & Protocols: The Love Language of the Internet

Nurul HasanNurul Hasan
5 min read

for: beginners

By: A Curious Learner Who Asked All the Right Questions


Introduction

When we browse the web, stream a video, or chat online, a lot happens under the hood. Protocols like TCP, HTTP, UDP, and WebSocket work together to move data back and forth — but it’s easy to get confused about what each one does, and how they relate to one another.

This article takes you through a real learner's journey — filled with smart questions, intuitive analogies, and careful corrections — to help you truly understand these protocols in a way that sticks.


Step 1: What Is TCP?

TCP (Transmission Control Protocol) is like a reliable delivery service for data over the Internet.

Analogy:

Imagine you’re sending a multi-part cake to a friend. TCP:

  • Cuts it into slices (packets)

  • Numbers each slice

  • Makes sure every slice arrives in the right order

  • Resends anything that goes missing

  • Gets confirmation that the whole cake was delivered safely

That’s TCP: reliable, ordered, and error-checked delivery of digital data.


Enter IP: The Addressing System

TCP needs to know where to send the data. That’s where IP (Internet Protocol) comes in. IP is like the address written on the envelope — it tells data where to go.

TCP + IP = TCP/IP

  • IP handles routing and addressing

  • TCP ensures safe and correct delivery


What Is HTTP Then?

HTTP (HyperText Transfer Protocol) is the language your browser uses to ask for web pages.

Analogy:

If TCP is the postal service, then HTTP is the letter inside the envelope:

"Dear Server, please send me the homepage in HTML."

So when you type https://www.example.com:

  1. DNS translates it to an IP address.

  2. Your browser opens a TCP connection to the server.

  3. Over this connection, it sends an HTTP request.

  4. The server responds, and the page is loaded.


Misconception 1: Is TCP One-Way?

Learner’s Thought:

“TCP is one-way and not persistent.”

Correction:

TCP is two-way and can be persistent.

  • It allows both the client and server to send/receive data.

  • It's used as a two-way pipe for all kinds of communication.

  • Persistence depends on how protocols like HTTP use it (e.g., Keep-Alive, WebSocket).


Clarifying the Role of HTTP vs TCP

Learner’s Realization:

“So HTTP is just a language over TCP... and TCP is the real channel.”

Exactly! Here's the breakdown:

LayerProtocolRole
Transport LayerTCPBuilds and manages the connection
Application LayerHTTP/HTTPSDefines what data to send and how to request it

HTTP is stateless, meaning:

  • Each request is independent.

  • The server doesn't remember you between requests unless you use cookies, tokens, or sessions.


What About UDP?

UDP (User Datagram Protocol) is the fast but unreliable sibling of TCP.

Analogy:

Imagine shouting instructions across a room — no guarantee it’s heard, but it’s fast.

Used for:

  • Live video streaming

  • Online gaming

  • Voice calls

UDP sacrifices reliability for speed, which is okay when missing a few packets doesn’t matter.


WebSockets: Making HTTP Stateful

Sometimes you need a persistent, two-way, real-time connection. That’s where WebSockets come in.

  • They start as an HTTP request, then upgrade to a WebSocket connection.

  • Underneath, they still use TCP.

  • WebSockets allow real-time chat, live updates, and continuous data flow.

Analogy:

HTTP is like writing and mailing letters.
WebSocket is like picking up the phone and talking nonstop without redialing.


Misconception 2: HTTP Closes TCP After Each Request?

Learner’s Thought:

“Two HTTP requests are independent, so TCP gets disconnected each time?”

Correction:

It depends on the HTTP version and settings.

  • HTTP/1.0: Closes TCP after each request.

  • HTTP/1.1: Uses Keep-Alive to reuse the connection.

  • HTTP/2: Allows multiple requests/responses at the same time over one TCP connection (multiplexing).

So TCP can be persistent — it’s up to how HTTP (or another protocol) uses it.


Recap: Real-World Website Visit

Let’s follow the process again with everything aligned:

You visit: https://www.example.com

  1. DNS: Resolves domain to IP address.

  2. TCP: Builds a two-way connection (3-way handshake).

  3. TLS (if HTTPS): Adds encryption layer.

  4. HTTP/HTTPS: Sends a request like:

    "Give me the homepage."

  5. Server: Responds with the HTML page.

  6. TCP: Ensures ordered, complete delivery of all packets.

  7. Browser: Renders the page.


Final Concept Map

ProtocolRolePersistent?Communication Style
TCPReliable transportYesTwo-way
IPAddress routingN/AOne-way (stateless)
HTTPWeb request languageNot by defaultOne request/response per call
HTTPSEncrypted HTTPUsually persistentSecure request/response
UDPFast, unreliable transportNoOne-way
WebSocketReal-time, bidirectionalYesFull-duplex chat-like

Conclusion

Understanding TCP, HTTP, and their related protocols isn’t just technical trivia — it’s the foundation of how the internet works. With the right analogies and a curious mindset, what seems abstract suddenly becomes crystal clear.

Key Takeaways:

  • TCP is the real, reliable connection; HTTP and WebSocket just decide how to use it.

  • HTTP is stateless, so each request is a new "conversation."

  • WebSockets use TCP too, but create a persistent, two-way connection.

  • UDP is faster but unreliable — perfect for real-time streaming or games


That’s the big picture — the way I’ve come to understand how these protocols fit together and talk to each other.

I’m still digging deeper into how it all works under the hood — things like how TCP handles lost packets, how HTTP/2 multiplexes requests, and how encryption fits into the flow.

I’ve started putting that together in Part 2, where I go into the technical details but still try to keep it clear and beginner-friendly.

Feel free to check it out if you're curious too.


It’s been a learning process for me too, and I’m just sharing as I go. If anything felt unclear, wrong, or could be improved, feel free to let me know.

Thank you for reading this article ❤️

0
Subscribe to my newsletter

Read articles from Nurul Hasan directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Nurul Hasan
Nurul Hasan