The layered model
The TCP/IP stack layers responsibilities: link (Ethernet/Wi-Fi), internet (IP routing/addressing), transport (TCP/UDP), application (HTTP, DNS). Each layer adds/strips a header. Layering lets parts evolve independently.
TCP vs UDP
TCP is connection-oriented and reliable: a 3-way handshake, ordered delivery, retransmission, and congestion/flow control — at the cost of latency. UDP is connectionless and unreliable but fast and lightweight — good for DNS, video, gaming where speed beats perfect delivery.
Anatomy of a request
Typing a URL: DNS resolves the hostname to an IP → TCP connection (and TLS handshake for HTTPS) → HTTP request/response → the browser renders. DNS caching, keep-alive connections, and CDNs cut repeated latency. Status codes and headers carry metadata.