How a Request Crosses the Internet
Networking basics on one page: the four TCP/IP layers, what happens when you open a URL, the TCP three-way handshake, DNS resolution, TCP vs UDP, well-known ports, private IP ranges and subnets, and the commands to debug a slow or dead connection.
Cheat sheet · Offered as a template
In this diagram
- How a Request Crosses the Internet
- From a URL in the address bar to bytes on the wire: the layers, the handshakes and the names involved.
- ① The four layers
- Application HTTP · DNS · TLS
- Transport TCP · UDP · QUIC
- Internet IP · ICMP
- Link Ethernet · Wi-Fi
- Each layer wraps the one above in its own header. That is encapsulation.
- ② What happens when you open a URL
- Browser
- DNS lookup
- Resolve
- TCP handshake
- Connect
- TLS handshake
- Encrypt
- HTTP request
- Ask
- Render
- Show
- ③ TCP three-way handshake
- Client
- Server
- connection open
- Three packets before any data moves. TLS 1.3 adds one more round trip; QUIC folds both into one.
- ④ DNS resolution
- Browser and OS caches
- Recursive resolver: your ISP, Cloudflare or Google
- Root server: “ask the .com servers”
- TLD server: “ask example.com’s nameserver”
- The authoritative server returns the A / AAAA record
- Everyone caches the answer for its TTL
- ⑤ TCP or UDP?
- ⑥ Ports worth knowing
- Well-known ports
- ⑦ Addresses and subnets
- IPv4
- ⑧ HTTP verbs
- A resource
- ⑨ Debug it
- shell
- ⑩ Round-trip times
- Same datacentre
- US ↔ Europe
- Every handshake costs round trips. Far-away users feel each one.
- ⑪ When it is slow or down
- Does the name resolve? (dig)
- Is the port reachable? (nc -vz)