Question

What is the difference between TCP and UDP?

Vault Verified
Curated Intelligence
Definitive Source
Answer

TCP guarantees delivery; UDP does not — and that single trade-off determines which one every internet application uses.

TCP (Transmission Control Protocol). A connection-oriented, reliable protocol:

Establishes a connection first, via a three-way handshake, before any data flows.

Numbers every segment and requires acknowledgement. Anything unacknowledged is retransmitted.

Delivers in order, buffering out-of-order arrivals until the gap is filled.

Controls flow and congestion, slowing down when the network or receiver cannot keep up — which is how the internet avoids collapsing under load.

The cost is latency and overhead: handshakes before data, retransmission delays, and head-of-line blocking, where one lost packet stalls everything behind it even if those packets already arrived.

UDP (User Datagram Protocol). Connectionless and minimal:

No handshake — send immediately.

No acknowledgement, no retransmission, no ordering guarantee. Packets may arrive out of order, duplicated, or not at all, and nothing tells you.

Almost no overhead, with a very small header.

Why lossy delivery is sometimes better. In a live voice or video call, a packet that arrives 200ms late is useless — the moment it represented has passed. Retransmitting it wastes bandwidth and delays everything after it. Dropping it and continuing produces a brief artefact and keeps the conversation real time. For real-time media, timeliness beats completeness.

What uses which:

TCP — web pages, email, file transfer, and anything where a missing byte corrupts the result.

UDP — voice and video calls, live streaming, online game state updates, DNS queries, and DHCP.

Applications build their own reliability on UDP where they need some. Game engines resend important state and discard stale position updates; media protocols use forward error correction.

QUIC is the significant modern development — a transport built on UDP that provides TCP-like reliability and encryption while eliminating head-of-line blocking between streams and reducing handshake round trips. It underpins HTTP/3, which means a large share of web traffic now travels over UDP.

Related Questions