SimuVedaSystem Design Lab Open in the lab

Foundations / Beginner / 6 min

Everything before the first byte

DNS, TCP, TLS and HTTP packet by packet. Compare HTTP/1.1, HTTP/2 and HTTP/3 across the world.

Start the simulation → Change the load, break a part, watch what happens. Free, no sign-up.

In short

What it is
Before any data moves, the browser does a DNS lookup, a TCP handshake and a TLS handshake, each costing round trips.
Why it matters
Round trips are limited by distance and the speed of light, so a far server is slow no matter how fast it is.
The trade-off
CDNs and edge servers cut the distance but add cost and make fresh data harder to serve; keep-alive and HTTP/2 reuse connections.
Say it in an interview
"Latency is mostly round trips times distance, so I would serve static content from a CDN close to the user."

Check yourself

Which protocol combination needs the fewest round trips before the first request can be sent on a new connection?

Answer: HTTP/3 over QUIC. QUIC combines the transport and TLS 1.3 handshakes into one round trip, and runs over UDP so there is no separate TCP handshake.

Why does a keep-alive connection make the second request much faster?

Answer: It skips the TCP and TLS handshakes. The connection is already open and encrypted, so only the request and response round trip remains.

A full DNS lookup walks which chain?

Answer: Resolver → root → TLD → authoritative name server. The resolver asks a root server for the TLD servers, the TLD for the domain’s name servers, then the authoritative server for the address.

See it happen in the simulation →

dnstcptlshttpquiclatency

More in foundations