Pcornel
Technology Comparisons

TCP vs UDP

Compare the two main transport protocols and what each guarantees.

DimensionTCPUDPWhat it means in practice
ConnectionConnection-oriented with a three-way handshake.Connectionless; no handshake.Firewalls track TCP state precisely; UDP state is timer-based.
ReliabilityRetransmits lost segments and keeps order.No retransmission or ordering.Applications on UDP add their own reliability if needed (QUIC does).
Flow and congestion controlWindow-based flow control and congestion control.None in the protocol.UDP floods can starve TCP traffic on a congested link.
Header size20 bytes minimum.8 bytes.Small headers matter for voice and DNS.
Typical usesHTTP/1.1–2, SSH, SMTP, database protocols.DNS, DHCP, VoIP/RTP, syslog, QUIC/HTTP3.DNS falls back to TCP for large responses and zone transfers.
Verificationss -tan or show tcp brief; look for ESTABLISHED.ss -uan; test with an application-level request.A UDP port scan cannot prove a service is listening.

← All comparisons

Confirmation

Confirm action

Continue?