Level 0: Orientation & prerequisites · L0.3 Networking: TCP/IP, TLS, HTTP/2/3, QUIC
TCP vs UDP
Compare reliability, ordering and latency of TCP and UDP.
12 min · Free
What you take away
- TCP gives you a connection: ordered bytes, retransmission of anything lost, and flow and congestion control.
- UDP gives you a datagram: it may arrive, may arrive twice, may arrive out of order — and it never waits.
- TCP's guarantees cost a handshake round trip up front and head-of-line blocking whenever a packet is lost.
- Choose UDP when late data is worthless (voice, video, games) or when you want to build your own reliability (QUIC).
How the class is laid out
- The problem
- The simple version
- What the connection costs you
- Who uses which
- Check your understanding