HTTP/3
HTTP/3 is built on a newer transport protocol called QUIC (Quick UDP Internet Connections). It is built on top of UDP
Why Was HTTP/3 Needed?
HTTP/2 brought many improvements, but it still relied on TCP, which has some inherent problems:
- Head-of-Line Blocking at the Transport Level:
- In HTTP/2, if one packet is lost, TCP forces the client to wait for the lost packet before continuing. This slows everything down.
- Connection Setup Time:
- TCP connections require a "handshake" before data is sent, which adds delay.
- Inefficiency with Mobile Networks:
- When switching networks (e.g., from Wi-Fi to mobile), TCP connections break and have to be re-established.
Key Features of HTTP/3:
-
No Head-of-Line Blocking:
- In QUIC, if one packet is lost, only that packet is resent. Other data can keep flowing, improving speed and reliability.
-
Faster Connections:
- QUIC combines the handshake for both encryption (TLS) and transport into a single step. This reduces connection setup time.
-
Seamless Connection Migration:
- QUIC connections survive network changes (e.g., switching from Wi-Fi to mobile data), unlike TCP.
-
Built-in Encryption:
- QUIC has encryption (TLS 1.3) built into the protocol, making HTTP/3 more secure by default.
How HTTP/3 Works
HTTP/1.1 and HTTP/2:
- Both use TCP, which guarantees that packets arrive in order. However, this can lead to delays because of packet retransmission.
HTTP/3:
- Uses UDP with QUIC.
- QUIC manages retransmissions at the packet level but doesn't force all streams to wait if one packet is delayed. This avoids head-of-line blocking and makes data transfer faster.