Internet vs Web
Packets, IPs, ports, and why your browser is basically a fancy phone.
Open a new tab. Type youtube.com. Hit enter. Eight things happened in the next 300 milliseconds, and almost nobody can name them in order. By the end of this lesson, you can.
The internet is not the web
These two words get used interchangeably and it's wrong. Here's the difference in one sentence:
The internet is the global network of computers. The web is one application that runs on it.
Email, video calls, Steam game downloads, Bluetooth speakers (sometimes), SSH sessions - they all use the internet but are notthe web. The web specifically means "documents and apps served over HTTP and viewed in browsers."
How computers find each other: IP addresses
Every device on the internet has at least one address called an IP address. There are two flavors you'll see:
- IPv4: four numbers, like
142.250.193.46. We've run out of these. - IPv6: longer, like
2607:f8b0:4005:80c::200e. The new format. Plenty of these.
Open your terminal and try this. It looks up the IP for google.com:
dig google.com +short
# 142.250.193.46
ping google.com
# replies from 142.250.193.46Ports: many doors on one building
A computer with one IP address can run many services. How does traffic know which one to reach? Ports. A port is a number from 0 to 65535. Common ones you should recognize on sight:
80- HTTP (insecure web)443- HTTPS (secure web)22- SSH (remote shell)5432- PostgreSQL3000- what every dev server defaults to (convention, not standard)
https://example.com, the browser is really connecting to example.com:443. The port is hidden because 443 is the HTTPS default.TCP vs UDP: two ways to send packets
Data travels in small chunks called packets. There are two main protocols for sending them:
- TCP - reliable. Packets arrive in order. Lost ones get re-sent. Used for: web pages, emails, file transfers. The boring, dependable choice.
- UDP- fire-and-forget. No re-sending. Faster but lossy. Used for: video calls, gaming, DNS. The fast, "close enough" choice.
HTTP/1 and HTTP/2 use TCP. HTTP/3 uses something called QUIC, which is built on UDP. That's why HTTP/3 is faster on patchy mobile connections.
The 8 steps when you visit a URL
Putting it together. You type youtube.com:
- Browser checks its cache: do I already have this?
- If not, it does a DNS lookup - turn
youtube.cominto an IP address. - Browser opens a TCP connection to that IP, on port 443.
- A TLS handshake negotiates encryption keys (this is the "S" in HTTPS).
- Browser sends an HTTP request:
GET / HTTP/2. - Server processes it, sends back HTML + headers + status code
200 OK. - Browser parses HTML, fires off more requests for CSS, JS, images, fonts.
- Browser renders pixels. You see the page.
Quick quiz
What's the difference between the internet and the web?
Recap
- Internet = network of networks. Web = one application on it.
- Devices have IP addresses (v4 short, v6 long).
- Ports let one IP host many services.
- TCP reliable, ordered. UDP fast, lossy.
- When you load a URL: cache → DNS → TCP → TLS → HTTP request → response → render.