← Playground

TLS Handshake Lab

royhp.com

Securing a connection costs round trips, and every round trip costs one RTT. Watch the handshake flights cross the wire as a time-scaled sequence diagram — the further down a message sits, the later it happens. TLS 1.2 needs two round trips before any data flows; TLS 1.3 needs one; and 0-RTT resumption lets a returning client send its request inside the very first packet. Time-to-first-byte is just (round trips) × RTT.

Mode
Time to first byte
0 ms
TLS handshake
0 ms
TCP setup
0 ms
Round-trip time
0 ms
Time to first byte at 80 ms RTT including TCP setup
TLS 1.2
TLS 1.3
TLS 1.3 · 0-RTT
Speed

Handshake flights — the highlighted step is in flight

    Try this: start on TLS 1.2 and count the zig-zags — two full round trips of teal-and-blue arrows before the gold Application Data flight. Switch to TLS 1.3 and the diagram collapses to a single round trip; switch to 0-RTT and the request rides the very first ClientHello. Drag RTT up to a satellite-grade 400 ms and watch the comparison bars fan out — the round-trip count is fixed, so the slow link punishes the chattier handshake hardest. Toggle TCP handshake off to isolate the TLS cost alone (or imagine TCP Fast Open). The diagram's shape never changes with RTT — only the clock does, because time = round-trips × RTT.