Skip to content
5 min read·Lesson 1 of 10

How the Internet Works

Understand the fundamental mechanics of the internet — packets, routing, the protocol stack, and what happens when you load a web page.

Every time you open a browser and type a URL, thousands of carefully coordinated operations happen in milliseconds. Understanding these mechanics makes you a better cloud engineer — you'll reason about latency, design more resilient systems, and troubleshoot connectivity issues faster.

The Internet is a Network of Networks

There is no single "internet" — it's a global collection of interconnected networks operated by Internet Service Providers (ISPs), universities, companies, and governments. They connect to each other through Internet Exchange Points (IXPs) — physical locations where networks peer with each other to exchange traffic.

When your laptop sends data to a server in another country, the data travels through:

  1. Your home router
  2. Your ISP's network (regional ISP)
  3. One or more backbone providers (Tier 1 ISPs)
  4. The destination's ISP
  5. The destination server

Packets

Data is not sent as one large stream. It's broken into small chunks called packets — typically up to 1500 bytes each (the Ethernet MTU). Each packet contains:

  • A header: source IP, destination IP, protocol, packet number, checksum
  • A payload: a fragment of the actual data

Packets from the same request can take different routes through the network and are reassembled at the destination. This makes the network resilient — if one path is congested or broken, packets route around it.

The TCP/IP Protocol Stack

LayerProtocolsHandles
4. ApplicationHTTP, HTTPS, DNS, SMTP, SSHWhat the data is for
3. TransportTCP, UDPEnd-to-end communication, ports
2. InternetIP (IPv4, IPv6), ICMPAddressing and routing between networks
1. LinkEthernet, Wi-Fi, FiberPhysical transmission on local network

Each layer wraps the layer above it (encapsulation): HTTP data is wrapped in a TCP segment, which is wrapped in an IP packet, which is wrapped in an Ethernet frame.

Routing

A router is a device that forwards packets between networks. Each router has a routing table — a set of rules mapping destination IP prefixes to the next hop (the next router to forward to).

When a packet arrives at a router:

  1. Router looks up the destination IP in its routing table
  2. Finds the longest matching prefix (most specific route)
  3. Forwards the packet out the appropriate interface toward the next hop

Routing protocols like BGP (Border Gateway Protocol) exchange routing information between ISPs, allowing routers to learn how to reach any destination on the internet.

What Happens When You Load a Web Page

  1. Browser checks cache for the page
  2. DNS lookup: browser resolves example.com to an IP address
  3. TCP connection: browser completes 3-way handshake with server (SYN → SYN-ACK → ACK)
  4. TLS handshake: browser and server negotiate encryption
  5. HTTP request: browser sends GET request
  6. Server processes and responds with HTML
  7. Browser parses HTML, discovers more resources (CSS, JS, images), fetches them in parallel
  8. Browser renders the page

Latency vs Bandwidth

  • Bandwidth: How much data can flow per second (highway width)
  • Latency: How long a packet takes to travel from source to destination (speed on the highway)

For web performance, latency is often more critical than bandwidth. A 100ms round-trip time on a fast connection is slower for interactive apps than a 10ms RTT on a slower connection. CDNs reduce latency by serving content from servers close to users.

Next: IP addressing and subnetting — how addresses are assigned, what CIDR notation means, and how private networks are structured.

Key Takeaways

  • The internet is a network of networks — data travels through ISPs and exchange points.
  • Data is broken into packets, routed independently, and reassembled at the destination.
  • The TCP/IP stack has four layers: Link, Internet, Transport, Application.
  • Routers forward packets based on destination IP using routing tables.
  • Latency is affected by physical distance, hops, congestion, and processing time.

Test your knowledge

Try exam-style practice questions to reinforce what you've learned.

Practice Questions →