In this lesson · topic 2 of 7
Topic 2
Handshakes and connection pools
4 min read
What a handshake buys
The TCP handshake makes both ends agree on starting sequence numbers, so each can tell lost or repeated segments apart. TLS 1.3, defined in RFC 8446, then authenticates the server and sets up encryption in one round trip. Resuming an earlier session can shorten this further, at the cost of some security properties, which the RFC covers.
A connection that stays open pays this once. Each later request goes straight out. That is why clients keep connections alive and reuse them.
QUIC, defined in RFC 9000, joins the transport handshake and the encryption handshake into one exchange. A new QUIC connection needs 50 msmeasured at a 50 ms round trip, against 100 msmeasured for TCP with TLS 1.3.
The pool
A pool holds a bounded number of open connections to one server. A request takes a free connection, uses it, and returns it. If none is free and the pool is below its limit, the pool opens a new one. At the limit, the request waits.
With reuse on, the lab opened 4 connectionsmeasured over 600 ticks. With a new connection per request, it opened 1200 connectionsmeasured. Each of those is a handshake on the client and work on the server.