What is the difference between HTTP 1.0 1.1 2.0 3.0?

2023.11.23

What is the difference between HTTP 1.0 1.1 2.0 3.0?

So far, all versions of the HTTP protocol can be divided into HTTP 0.9, 1.0, 1.1, 2.0, and 3.0. Among them, the commonly used version is HTTP 1.1, and the HTTP 2.0 version is being promoted, as well as the future HTTP 3.0 version.

HTTP protocol, also called Hypertext Transfer Protocol. Is an application layer protocol used to exchange data between web browsers and web servers.

So far, all versions of the HTTP protocol can be divided into HTTP 0.9, 1.0, 1.1, 2.0, and 3.0. Among them, the commonly used version is HTTP 1.1, and the HTTP 2.0 version is being promoted, as well as the future HTTP 3.0 version.

HTTP1.0 stipulates that the browser and the server maintain a short connection, and the browser needs to establish a TCP connection with the server for each request. HTTP1.0 also stipulates that the next request must be sent before the response to the previous request arrives. If the response to the previous request does not arrive, then the next request will not be sent, and subsequent requests will be blocked, so HTTP1.0 exists The request is blocked at the head of line. HTTP 1.0 does not yet support resumable transmission. All pages and data will be transmitted every time, which will waste excess bandwidth when only part of the data is needed.

HTTP 1.1 solves the problems existing in version 1.0. It can maintain long connections, avoid repeatedly establishing TCP connections for each request, and improve network utilization. HTTP 1.1 can use pipeline transmission and supports multiple requests to be sent at the same time. However, the server still responds to the previous request in order, and then responds to the subsequent request. If the previous response is particularly slow, there will be many requests waiting to be processed in the queue. Therefore, HTTP 1.1 still has the problem of response head-of-line blocking. In addition, HTTP 1.1 can already resume interrupted downloads.

HTTP 2.0 is the first major revision of the HTTP protocol, and it differs significantly from previous versions in the method used to deliver data.

HTTP 2.0 compresses headers. If there are multiple requests with the same or similar headers at the same time, the protocol will eliminate duplicate parts.

HTTP 2.0 encodes request and response messages into binary instead of using the previous plain text messages, increasing the efficiency of data transmission.

HTTP 2.0 can concurrently send multiple requests or responses in a TCP connection without having to correspond one to one in order, thus completely solving the problem of head-of-line blocking at the HTTP level and greatly improving the connection utilization.

HTTP 2.0 also improves the traditional request response working mode to a certain extent. The server no longer responds passively, but can actively send messages and push additional resources to the client.

Although HTTP 2.0 solves HTTP head-of-line blocking by reusing one TCP connection with multiple requests, once packet loss occurs, all HTTP requests will be blocked, which is TCP layer head-of-line blocking. In order to solve this problem, HTTP 3.0 directly abandoned the use of TCP and changed the transport layer protocol to UDP. However, because UDP is unreliable transmission, this requires QUIC to implement a reliable mechanism.

QUIC stands for "Quick UDP Internet Connection" and is a protocol proposed by Google that uses UDP for multi-channel concurrent transmission.

QUIC has its own set of mechanisms to ensure transmission reliability. When a packet loss occurs in a certain pair of request responses, only the current request response will be blocked, and other request responses will not be affected, so there is no head-of-line blocking problem at all.

HTTP 3.0 uses UDP as the transport layer protocol, which can reduce the time delay of the three-way handshake, thereby achieving the effect of quickly establishing a connection. In addition, the QUIC protocol can use the connection ID to mark the two endpoints of the communication. Even if the network transmission of the mobile device changes, causing the IP address to change, the original connection can be reused as long as there is context information such as the connection ID and TLS key. This enables connection migration.