HTTP Request Flow
Runs in browserVisualize network request lifecycle
Request
Quick URLs (CORS-friendly):
Simulated Latencies
How to Use
Enter a URL and send a request.
You will see:
- DNS Resolution Steps
- TCP/TLS Handshake Timing
- Server Processing & Response
Enter a URL and press Enter or click Send
Visualize DNS resolution, TCP/TLS handshakes, and server response
The Engineering of a Network Request
When you type a URL into your browser, it triggers a remarkably complex sequence of distributed systems operations. Before a single byte of HTML is rendered, your machine must navigate global DNS hierarchies, negotiate cryptographic secrets, and establish reliable byte-streams over an unreliable internet. This lifecycle defines Web Performance.
1. DNS Resolution (The Phonebook)
Computers route traffic using IP addresses (like 203.0.113.42), not
human-readable domain names. The Domain Name System (DNS) acts as the internet's
phonebook.
- Local Cache: Check browser → OS cache. (0ms)
- ISP Resolver: Query your local ISP's recursive resolver. (~15ms)
- Root Server (.): Queries the global root servers, which point to the TLD servers.
- TLD Server (.com): Queries the Top-Level Domain servers, which know who manages the root domain.
- Authoritative Name Server: The final server (e.g., Cloudflare, Route53) returns the exact A Record (IPv4) or AAAA Record (IPv6). (~40-100ms total)
2. The TCP 3-Way Handshake
Before HTTP data can flow, a reliable Transmission Control Protocol (TCP) connection must be formed. This ensures packets are delivered in order, without loss.
SYN Client asks to synchronize sequence numbers.
SYN-ACK Server acknowledges and synchronizes its own sequence.
ACK Client acknowledges. The socket is now established.
This handshake inherently takes exactly 1.5 Round Trip Times (RTT), bounded by the speed of light in fiber optic cables.
3. The TLS Handshake (HTTPS)
If connecting via HTTPS on port 443, a Transport Layer Security (TLS) handshake happens immediately after the TCP connection to encrypt the impending HTTP payload.
ClientHello: "I want to connect securely. I support these cipher suites."
ServerHello & Certificate: "Let's use AES-GCM. Here is my public key certificate proving I am the real website."
Key Exchange: The client encrypts a 'pre-master secret' using the server's public key. Both sides mathematically derive the same symmetric session key. The tunnel is now encrypted. (TLS 1.3 optimizes this to 1 RTT).
4. Server Processing & TTFB
The client finally sends the actual HTTP Request (e.g., GET /api/data HTTP/1.1). The server ingests it, queries databases, renders templates, and serializes a
response.
Time To First Byte (TTFB)
This is a critical performance metric. TTFB is the total time from the user initiating the request to the browser receiving the very first byte of the HTTP response. High TTFB usually indicates slow database queries, struggling application servers, or network congestion. Optimal TTFB is heavily dependent on caching or deploying Content Delivery Networks (CDNs) near the end-user.
Further Reading
- High Performance Browser Networking - Ilya Grigorik's legendary O'Reilly book on web performance.
- How DNS Works - A brilliant visual comic explaining the global DNS hierarchy.