Ch11.10.3: Modern Network Protocols
HTTP/1.1 vs HTTP/2 vs HTTP/3
| Feature | HTTP/1.1 | HTTP/2 | HTTP/3 |
|---|---|---|---|
| Year | 1997 | 2015 | 2022 |
| Transport | TCP | TCP | QUIC (over UDP) |
| Binary | Text | Binary | Binary |
| Multiplexing | No (head-of-line blocking) | Yes (streams over TCP) | Yes (streams over QUIC) |
| Header compression | No | HPACK | QPACK |
| Server push | No | Yes | Yes |
| Connection migration | No | No | Yes (switch networks seamlessly) |
| 0-RTT resume | No | No | Yes (faster connection setup) |
QUIC (Quick UDP Internet Connections)
QUIC is a transport layer protocol developed by Google and standardized by the IETF. It runs over UDP and provides:
- Lower latency — 0-RTT connection establishment (vs 3-way handshake in TCP)
- No head-of-line blocking — packet loss in one stream doesn’t block others
- Connection migration — can switch between Wi-Fi and cellular without dropping
- Built-in encryption — TLS 1.3 integrated at the transport layer
- Better congestion control — modern algorithms, easier to evolve than TCP (which is in the kernel)
HTTP/3 uses QUIC as its transport. QUIC is also used by other protocols like WebTransport.
WebSocket and Server-Sent Events
- WebSocket — Full-duplex communication over a single TCP connection. Starts with an HTTP upgrade request, then both sides can send data anytime. Used for chat, live updates, gaming.
- Server-Sent Events (SSE) — Server pushes updates to the client over HTTP. Simpler than WebSocket, but only server-to-client. Used for news feeds, notifications.