ScouterWhy

Home · Tech in 60 Seconds

TCP Handshake in 60 Seconds — Why Three Messages?

· 45s

Watch on YouTube

AI Images and video in this clip are AI-generated and are not real footage. Facts were checked against the sources below before publishing.

Transcript

  1. Why does TCP trade three messages before sending any data?
  2. Like a phone call: 'Hello?' 'I hear you. You?' 'Yep, I hear you.'
  3. First, a SYN: 'Can we talk? Here's my starting number.'
  4. The server answers with a SYN-ACK: 'Got your number. Here's mine.'
  5. Last, an ACK: 'Got yours too.' Now data can flow.
  6. Why not just two? The server answers, so we're connected?
  7. Ghosts — old, delayed requests. With two, the server connects to a ghost.
  8. UDP just throws data. It starts at once, but delivery isn't guaranteed.
  9. The third message is for the server: 'Yes, it's really me.'
  10. SYN, SYN-ACK, ACK. Three lines to confirm each other's numbers.
  11. Every new connection costs a round trip. So we reuse them: keep-alive, pools.

Sources

  1. IETF, RFC 9293 "Transmission Control Protocol (TCP)" (2022-08)
  2. IETF, RFC 768 "User Datagram Protocol" (1980-08-28)
  3. IETF, RFC 7413 "TCP Fast Open" (2014-12)
  4. IETF, RFC 9112 "HTTP/1.1" (2022-06)
  5. MDN Web Docs, "Connection management in HTTP/1.x"
t