HTTP/2 uses TCP (Transmission Control Protocol), not UDP.
While QUIC (Quick UDP Internet Connections) exists and offers some similar benefits, HTTP/2 itself operates over TCP. It also often utilizes TLS (Transport Layer Security) for secure communication. The original design of HTTP/2 aimed to improve web performance compared to HTTP/1.1, focusing on multiplexing, header compression, and server push, all within the reliable TCP framework.
Key Features of HTTP/2 over TCP:
- Multiplexing: Allows multiple requests and responses to be sent over a single TCP connection, reducing latency.
- Header Compression (HPACK): Reduces the size of HTTP headers, minimizing bandwidth usage.
- Server Push: Enables the server to proactively send resources to the client that it anticipates the client will need.
- Binary Protocol: Uses a binary framing layer instead of text-based HTTP/1.1, improving parsing efficiency.
Why TCP was chosen:
TCP provides reliable, ordered delivery of data, which is crucial for HTTP applications. While UDP offers lower latency in some scenarios, it doesn't guarantee delivery or order, making it unsuitable for the core functionality of HTTP/2.
Relationship to QUIC:
It's important to note that QUIC, which does use UDP, is now the foundation for HTTP/3. QUIC aims to address some of the limitations of TCP, particularly head-of-line blocking.
In summary, HTTP/2 relies on TCP for reliable data transport. HTTP/3, the successor to HTTP/2, is built on QUIC, which uses UDP.