004
LVL 00 — CADET PILOT SESSION 004 DAY 4

HOW THE INTERNET WORKS

SYS.SCENARIO
🏢 A new colleague asks: "PixelCraft is a web app. But where does it actually live? When I type the URL, what happens? How does the code on the server end up on my screen?" The tech lead overhears: "Good question. Let me explain over lunch. Everyone should understand this."
CONCEPTS.UNLOCKED
🖥↔🗄
Client-Server
Your browser (client) requests. A server responds. Every web interaction is this pattern — a question and an answer across the network.
🌐
The URL Journey
DNS (URL → IP), TCP (connection), HTTP request (GET /index.html), response (files), render (HTML → DOM → CSS → JS → screen).
📨
HTTP Basics
Methods: GET, POST. Status codes: 200 (OK), 301 (redirect), 404 (not found), 500 (server error). Headers carry metadata.
🔢
IP & Ports
192.168.1.1:3000 — the IP is the building address, the port is the apartment number. A specific service on a specific machine.
📦
Packets
Data doesn't travel whole — it's split into small packets (~1.5 KB each) that can take different routes and reassemble at the destination.
🗄
Web Servers
Just a program that listens for requests and sends responses. Nothing magical — you'll build one in Session 56.
HANDS-ON.TASKS
01
Inspect the Network Tab

Open PixelCraft → DevTools (F12)Network tab → Refresh the page.

Watch every file download: HTML, CSS, JS, images, fonts.

ObserveWhat It Tells You
Number of requestsHow many files make up this page
Total data transferredHow much bandwidth this page uses
Load time (DOMContentLoaded)How fast the page becomes interactive
Largest resourceWhat's slowing the page down most

Click each request — examine headers, status code, response body.

02
Examine a Request in Detail

Click on the main HTML request and inspect:

FieldExample ValueMeaning
Request URLhttps://pixelcraft.app/Where the request went
MethodGETAsking for a resource
Status200 OKSuccess
Content-Typetext/htmlWhat type of data came back
Content-Length14,832Size in bytes
03
Offline Test

Enable airplane mode (or DevTools → Network → Offline). Reload PixelCraft.

What breaks? What still loads from cache? This shows the difference between network-dependent and cached resources.

You'll build offline support (PWA) in Session 93. For now, just observe what happens.
04
DNS & Ping from Terminal
# DNS lookup — see the IP behind a URL nslookup google.com # or dig google.com # Ping — measure latency to a server ping google.com # (Ctrl+C to stop) # HTTP headers from terminal curl -I https://www.google.com
ping shows round-trip time in milliseconds. Under 50ms is fast. Over 200ms feels slow. This is latency — the invisible enemy of web performance.
05
Draw the Journey

On paper or a whiteboard, draw the complete path from typing a URL to seeing a page:

Your Computer → Router → ISP → DNS Server → Web Server ↓ Screen ← Browser Renders ← Response (HTML/CSS/JS) ←

Label each step with what happens: DNS resolution, TCP handshake, HTTP request, response, parsing, rendering.

CS.DEEP-DIVE

Packet Switching.

Your image doesn't travel as one giant chunk — it's split into small packets (typically 1.5 KB each). Each packet can take a different route through the internet.

// A 1MB image sent over the internet:

Image size:    1,000,000 bytes
Packet size:   ~1,500 bytes
Total packets: ~700 packets

// 700 packets taking potentially 700 different paths
// all arriving and reassembling in milliseconds.

// This is how billions of simultaneous users
// share one internet without a central controller.
// One of the most elegant engineering designs
// in human history.
"Network Inspector Report"
[A] Compare the Network tab for 3 websites: PixelCraft, Google, and a news site.
[B] Document: number of requests, total size, load time, largest resource, number of different domains contacted.
[C] Which is most efficient? Why? Write your analysis.
REF.MATERIAL
VIDEO
Lesics
Stunning 3D animations explaining undersea cables, data centers, IP addressing, and packet routing.
INTERNETVISUAL
VIDEO
Aaron
Quick, high-level overview of the full request-response cycle. Good for cementing the mental model.
HTTPDNSQUICK
VIDEO
Computerphile
Deep dive into how DNS resolution works — recursive queries, caching, root servers, and TLDs.
DNSNETWORKING
ARTICLE
Mozilla Developer Network
The authoritative reference for HTTP — methods, status codes, headers. Bookmark this — you'll return to it constantly.
HTTPREFERENCEMDN
ARTICLE
Alex Gaynor (GitHub)
Insanely detailed answer to the classic interview question — from keyboard press to pixel rendering. Revisit after Session 10.
DEEP DIVEINTERVIEW
COURSE
Khan Academy
Free interactive course on internet fundamentals — IP, DNS, HTTP, encryption. Great visual learner supplement.
FREEINTERACTIVE
// LEAVE EXCITED BECAUSE
You can see the invisible traffic behind every website. You watched 40+ files download in 1.2 seconds to build one page. You pinged a server on the other side of the world and got a response in 15ms. The internet isn't magic — it's a protocol, and you now understand it.