TCP vs UDP: What Actually Differs, and Why Both Exist
The short answer
TCP is reliable and ordered; UDP is fast and fire-and-forget. TCP establishes a connection (the three-way handshake), acknowledges every segment, retransmits losses and delivers bytes in order — costing latency and 20+ bytes of header. UDP does none of that: 8 bytes of header, no handshake, no guarantees. That is not a weakness — for live audio, video and DNS lookups, late data is worse than lost data, and UDP is the correct choice.
Side by side
| TCP | UDP | |
|---|---|---|
| Connection | Yes — three-way handshake (SYN, SYN-ACK, ACK) | None |
| Reliability | ACKs + retransmission | None — lost is lost |
| Ordering | Guaranteed byte order | Datagrams may arrive in any order |
| Header size | 20–60 bytes | 8 bytes, fixed |
| Flow/congestion control | Yes (windowing) | No |
| Classic uses | Web (HTTP/1–2), email, SSH, FTP | DNS, VoIP, video calls, streaming, TFTP, DHCP |
The handshake, concretely
Before a single byte of your data moves, TCP does: SYN → “I want to talk, my sequence number is X.” ← SYN-ACK “Heard you; mine is Y.” ACK → “Confirmed.” One full round trip spent before payload — the price of every guarantee TCP makes. UDP’s equivalent is silence: the first packet is the data.
Real examples that make it stick
- A WhatsApp voice call is UDP (RTP over UDP). If a 20 ms slice of your voice is lost, retransmitting it would arrive too late to be speech — better a tiny glitch than growing delay.
- A bank transfer page is TCP. Every byte must arrive, exactly once, in order. Latency is annoying; a missing byte is a corrupted page.
- DNS uses UDP first (port 53) because a query fits one packet and speed wins — but falls back to TCP for large answers like zone transfers.
- The plot twist — HTTP/3 runs on UDP. The modern web’s newest protocol (QUIC) abandoned TCP and rebuilt reliability inside UDP to escape TCP’s handshake and head-of-line blocking. “Web = TCP” is a 2020 answer; knowing this marks you as current in an interview.
Interview questions this page answers
- Why does DNS use UDP? When does it use TCP?
- What problem does the three-way handshake solve, and what does it cost?
- A video call is lagging but not dropping — TCP or UDP symptoms?
- Which port numbers pair with which protocol — DHCP? TFTP? SSH?
Both protocols and their ports are core to the CCNA Network Fundamentals domain; our port reference covers every number the exam and interviews touch.
FAQ
Is UDP faster than TCP?
Yes, in latency terms: no handshake round-trip, no acknowledgements, no retransmission waits, and an 8-byte header versus TCP's 20+. The cost is that delivery, ordering and integrity beyond a basic checksum become the application's problem.
Why do video calls use UDP instead of TCP?
Because for live media, late data is worse than lost data. TCP would pause everything to retransmit a lost packet whose moment has already passed; UDP lets the call glide over the gap with a millisecond glitch instead of a growing delay.
Does the web use TCP or UDP?
Historically TCP (HTTP/1.1 and HTTP/2). But HTTP/3 - now serving a large share of web traffic - runs on QUIC, which is built on UDP with reliability re-implemented on top. The modern answer is: both, and increasingly UDP.
Why does DNS use UDP?
A typical DNS query and answer each fit in a single packet, so a connection is pure overhead. DNS switches to TCP for large responses and zone transfers. Both run on port 53.
Can one application use both TCP and UDP?
Yes, and many do: DNS uses both on port 53, and real-time apps commonly pair UDP media streams with a TCP control channel. The protocol is chosen per task, not per application.