॥ श्री ॥

TCP/IP Fundamentals

Networking 2026-08-28
Part of the Networking & Infrastructure series: See all networking docs

TCP/IP Fundamentals

The TCP Three-Way Handshake

Every TCP connection opens with a three-message exchange:

  1. SYN — client sends a segment with the SYN flag, picks an initial sequence number
  2. SYN-ACK — server acknowledges the client's SYN and sends its own SYN
  3. ACK — client acknowledges the server's SYN. Connection is now established.

This is why connection setup has a minimum latency of 1.5× the round-trip time (RTT) — three messages across two RTTs. TLS 1.3 reduces this further with 0-RTT resumption for known sessions.

TCP vs UDP

PropertyTCPUDP
ReliabilityGuaranteed delivery, retransmission on lossBest-effort, no retransmission
OrderOrdered deliveryOut-of-order delivery possible
ConnectionConnection-oriented (handshake)Connectionless
OverheadHigher (headers, ACKs, state)Lower
Use casesHTTP, PostgreSQL, SSH — anything correctness-criticalDNS, VoIP, video streaming, WireGuard

WireGuard uses UDP specifically because the VPN layer handles its own reliability, and UDP's stateless nature makes it more resilient to brief packet loss and network changes (roaming between WiFi and mobile data).



See Also