loctvl842
;
NetworkingSystem Design

🌍 How the Internet Works — Explained in the Simplest Way I Could Understand

🌍 How the Internet Works — Explained in the Simplest Way I Could Understand

🌍 How the Internet Works — Explained in the Simplest Way I Could Understand

It all started with one interview question:

“When you type google.com in your browser and hit Enter, what happens?”

And I completely froze.
I realized I use the Internet every day, but I didn’t really understand what’s happening underneath.
So I went down the rabbit hole — and this is my summary of what I learned about how the Internet actually works.

I’ll try to keep it simple, the way I explained it to myself.


🧱 1. TCP/IP — The Foundation

Everything on the Internet follows a set of rules called protocols — ways for computers to talk to each other.
The two most fundamental are TCP and IP.

IP (Internet Protocol)

  • Every device on the Internet has an IP address — like 142.250.190.78.
  • IP is responsible for delivering packets (chunks of data) from one device to another.
  • It doesn’t care if the packet arrives or not — it just tries its best.

TCP (Transmission Control Protocol)

  • TCP sits on top of IP and makes communication reliable.
  • It ensures all packets arrive, in order, and without corruption.
  • It starts with a 3-way handshake to establish a connection:
SYN → SYN+ACK → ACK

After that, the two computers can send data safely.

So:

IP finds where the data should go.
TCP makes sure it gets there correctly.


🌐 2. DNS — The Internet’s Phonebook

Humans remember names like google.com, but computers only understand IP addresses.
DNS (Domain Name System) translates names into addresses.

When you visit a website:

  1. The browser checks if it already knows the IP (cached).
  2. If not, it asks a DNS resolver (like Google’s 8.8.8.8).
  3. The resolver finds the IP address by querying several DNS servers.
  4. Finally, it returns the IP (e.g., 142.250.190.78).

That’s how your browser knows which server to connect to.


🚦 3. BGP — The Internet’s Routing System

After DNS finds the IP, your packets have to travel across many networks to reach that server.

Each large network (like VNPT, Viettel, Cloudflare, Google, etc.) is called an Autonomous System (AS).
BGP (Border Gateway Protocol) is how these systems tell each other which IP ranges they can reach.

Example:

  • VNPT (AS45899) might tell neighbors: “I can deliver packets to 113.164.0.0/16.”
  • Cloudflare (AS13335) might say: “I can deliver to 104.16.0.0/12.”

Routers use BGP routes to forward packets hop by hop until they reach the destination network.

If you run:

traceroute google.com

you’ll see those hops — your packets might go through your ISP (like VNPT), then a regional hub (Singapore), then finally Google’s network.


📦 4. CDN — Bringing Content Closer

Data can’t move faster than light, so the farther the server, the slower the page loads.

That’s why websites use CDNs (Content Delivery Networks) like Cloudflare, Akamai, or Fastly.
A CDN caches content on edge servers around the world.

When you visit a site:

  1. DNS sends you to the nearest CDN node.
  2. If your content is cached there, you get it instantly.
  3. If not, that node fetches it from the origin server and keeps a copy.

So CDNs don’t change how the Internet works — they just make it faster by reducing distance.


🔒 5. TLS — Securing Everything

You’ve probably noticed most sites start with https://.
That’s HTTP + TLS (Transport Layer Security).

TLS encrypts data so no one in the middle (like routers or ISPs) can read or tamper with it.
It uses digital certificates to prove that the server is who it says it is.

The TLS handshake:

  1. The browser connects to the server.
  2. The server sends its certificate (e.g., “I’m google.com”).
  3. Both sides agree on encryption keys.
  4. From that point, everything is encrypted.

🧭 6. Putting It All Together

Here’s the big picture when you type a URL:

sequenceDiagram
User->>DNS: "What is google.com?"
DNS-->>User: "142.250.190.78"
User->>Server: TCP 3-way handshake
User->>Server: TLS handshake (secure channel)
User->>Server: HTTP request (GET /)
Server-->>User: HTTP response (HTML, JS, images)
  • DNS finds the server
  • BGP/IP decides how to reach it
  • TCP ensures the data arrives safely
  • TLS keeps it private
  • CDN makes it faster

All of that happens in milliseconds before your browser shows the page.


💬 Reflection

When I first got that interview question, I couldn’t answer.
Now, I realize it’s not one mysterious process — it’s five simple layers working together:

Layer Protocol Job
Application HTTP What users see
Transport TCP Reliable delivery
Internet IP, BGP Routing and addressing
Infrastructure DNS Name → address lookup
Performance/Security CDN, TLS Speed & privacy

Typing a URL might feel instant, but behind it are decades of engineering — systems built to make the whole world connected and fast.


🧠 What I Learned

  • The Internet is just machines forwarding packets, guided by shared protocols.
  • Routers don’t understand websites — they just follow IP routes.
  • DNS and BGP are the “maps” that make global communication possible.
  • TCP makes connections reliable, TLS makes them safe, and CDNs make them fast.
  • And that interview question? It’s basically the best summary of how the Internet works.