Krill KitsKrill Kits// A swarm of small, sharp tools for letters, numbers, and units.
§ 01 / ARTICLE

TCP vs UDP. Two Transport Protocols.

CATEGORY NETWORKREAD 5 MINPUBLISHED APR 21, 2026

TCP sets up a session, numbers every packet, and retransmits anything that gets lost. UDP just throws packets and walks away. Both ride on top of IP. The choice between them is the choice between “guaranteed correct” and “fast no matter what.”

The core trade-off

  • TCP — connection-oriented. Three-way handshake to start a session, sequence numbers to order packets, ACKs to confirm delivery, retransmission for missing packets. Reliable but adds latency.
  • UDP — connectionless. Send a datagram, hope it arrives, move on. No setup, no ordering, no delivery guarantee. Fast and tiny but you handle reliability yourself if you need it.

What uses each

  • TCP: HTTP/HTTPS, SSH, FTP, SMTP/IMAP/POP3, anything where every byte matters.
  • UDP: DNS, NTP, DHCP, VoIP (SIP, RTP), online gaming, video streaming (RTP), QUIC.
  • Both: A few — DNS uses UDP normally, TCP for big responses or zone transfers. NFS, SIP, and a few others negotiate.

Why latency-sensitive things use UDP

Imagine a video call drops one packet. With TCP, the next packets queue while the lost one retransmits — adding 50–200ms of latency. With UDP, the next packets arrive on time and the application just shows a brief glitch. For real-time, glitchy is better than late.

// TRY THE TOOL
LOOK UP A PORT.

See whether a given port is TCP, UDP, or both — and what service runs on it.

OPEN →

QUIC — having it both ways

HTTP/3 runs on QUIC, which is built on UDP but adds reliability, ordering, encryption, and multiplexing in the application layer. Combines TCP’s guarantees with UDP’s setup speed (1-RTT or 0-RTT vs TCP’s 3-way handshake + TLS handshake). Most major web services have adopted it; some networks still block UDP, which means fallback to TCP/TLS/HTTP/2.

Picking one for your own app

Default to TCP. The reliability is free at the protocol level, and you don’t want to hand-roll retransmission unless you have a real reason. Reach for UDP when latency matters more than completeness, when you’re doing broadcast/multicast, or when you’re building on top of QUIC and don’t care about the underlying transport.

§ 02 / FAQ

Questions. Answered.

Which is faster?+
UDP is faster per packet — no handshake, no retransmission, no ordering overhead. But "faster" can be misleading. TCP’s reliability features pay off when you need every byte; UDP’s speed advantage only matters when you can tolerate loss (or handle reliability yourself at the application layer, like QUIC does).
Why does DNS use UDP?+
DNS queries are tiny — usually under 512 bytes — and frequent. The TCP handshake (~3 round trips) would dwarf the actual query. UDP fires the question and gets a response in one round trip. If a response is too big, DNS falls back to TCP. Modern DoH/DoT use TCP/HTTPS for security, accepting the latency cost for encryption.
What’s QUIC?+
A newer transport protocol used by HTTP/3. Built on UDP but adds reliability, ordering, and encryption at the application layer. Combines TCP’s guarantees with UDP’s connection setup speed. Now used by Google, YouTube, Facebook, and increasingly the rest of the web.
When does an app pick UDP?+
Three patterns: real-time media (voice, video, gaming) where stale data is useless and retransmission would just add lag; broadcast/multicast where there’s no one specific recipient; or anything that needs sub-millisecond latency and can build its own reliability on top.
§ 03 / TOOLS

Related calculators.

§ 04 / READING

Keep reading.