Compare
Side-by-side on the decisions that recur: TCP vs UDP, HTTP/2 vs HTTP/3, flow vs congestion control, L4 vs L7, forward vs reverse proxy, IPv4 vs IPv6 — with when to choose each.
TCP vs UDPHTTP/2 vs HTTP/3Flow control vs Congestion controlSwitch vs RouterForward proxy vs Reverse proxyL4 load balancing vs L7 load balancingServer-Sent Events vs WebSocketsIPv4 vs IPv6ARP (IPv4) vs Neighbor Discovery (IPv6)Keep-alive (reuse) vs New connection per request
| TCP | UDP | |
|---|---|---|
| What you get | A reliable, ordered byte stream between two endpoints | Independent datagrams; each may be lost, duplicated or reordered |
| Setup | Three-way handshake (1 RTT) before the first byte | None — the first packet is data |
| Loss | Detected via ACKs and retransmitted; the stream stalls until recovered | Dropped silently; the application decides what to do |
| Ordering | Sequence numbers reassemble in order; a gap blocks everything behind it | No ordering; a late packet is just a late packet |
| Rate control | rwnd (receiver) and cwnd (network) throttle the sender | None built in — you can flood a link and hurt everyone |
| Header overhead | 20+ bytes, plus ACK traffic | 8 bytes |
| Used by | HTTP/1.1, HTTP/2, TLS, SSH, databases, email | DNS, QUIC/HTTP/3, VoIP, video, game state, NTP |
| Choose this when | Every byte must arrive, in order, and you would rather wait than lose data — APIs, files, database wire protocols. | A late packet is worthless, or you are building your own reliability on top (QUIC): media, telemetry, DNS, game state. |