This is the 24th day of my participation in the August Text Challenge.More challenges in August

Introduction to the

Many friends may still be immersed in the world of HTTP1.1 cannot extricate themselves, but the current of The Times has led us to the world of HTTP3. Yes, you are looking at the view from the bridge, and someone from the house by the bridge is looking at you.

Not to be left behind by The Times, here are some new features of HTTP3.

Introduction to HTTP growth

HTTP, or Hypertext Transfer Protocol, is the application-layer transport protocol on which the World Wide Web is based. The original version, HTTP 0.9, was produced in the late 1980s and was later upgraded to 1.0 in 1996.

But HTTP1.0 fails to meet the growing material and cultural needs and aspirations for a better world. So HTTP1.1 came out in 1997, and it’s been updated all the way through 2014.

Then, in 2015, a new HTTP2 protocol was developed based on Google’s SPDY project to accommodate the needs of fast delivery Web applications and modern browsers.

Four years later, in 2019, Google developed a new protocol standard called QUIC, which is the cornerstone of HTTP3. The purpose is to improve the speed and security of users’ interactions with websites and apis.

Problems solved by different HTTP protocols

Different HTTP protocols solve different problems. What’s wrong with HTTP1.1?

  1. HTTP1.1 a connection is blocked as a result of sequential data transfer, so there is a head-to-line Blocking problem.

  2. HTTP1.1 cannot compress headers and cookies, so the transfer is inefficient.

  3. To ensure that buffers do not overflow, HTTP1.1 has a TCP slowstart feature. As a congestion control measure, the protocol repeatedly probes the network to calculate available capacity, but this can result in multiple data transfers, resulting in delayed messages.

For HTTP2, it uses binary message transmission and splits messages into streams containing multiple frames, allowing resources to be multiplexed and sent over the same connection, eliminating queue blocking, and supporting packet priority and server push.

But HTTP2’s server push can complicate applications, and TCP-level header blocking can still occur when packets are lost and must be re-sent in the correct order.

Note that HTTP/2 is an extension of HTTP/1.1, not a replacement for it. The application semantics remain the same, with the same HTTP methods, status codes, URIs, and header fields. So HTTP/2 can be used anywhere HTTP/1.1 is used.

HTTP/2 uses a single TCP connection between the client and server that remains open for the duration of the interaction.

Although HTTP/2 supports concurrency, too much concurrency can cause the HTTP/2 server to receive a large number of requests, resulting in request timeouts.

HTTP3 and QUIC

The goal of HTTP/3 is to provide fast, reliable, and secure Web connectivity on all forms of devices by addressing HTTP/2 transport-related issues. To do so, it uses a different transport-layer network protocol, called QUIC, originally developed by Google.

Sigh, although Recently China has made some progress in the application of the system, but look at these underlying agreements, are still made by foreigners.

The fundamental difference between HTTP/2 and HTTP/3 is that HTTP/2 uses TCP as the underlying protocol, while HTTP/3 uses QUIC as the underlying protocol, while QUIC uses UDP.

Let’s take a look at HTTP/2 versus HTTP/3 stacks:

TCP mainly guarantees the reliability and orderly delivery of services, but TCP requires a handshake to establish a connection to ensure that both clients and servers exist and are willing and able to exchange data. However, it also requires a full network roundtrip to complete before anything else can be done on the connection. If the client and server are far apart, it takes more time to connect.

We know that UDP is connectionless, so it’s much simpler than TCP. It doesn’t require TCP to establish multiple connections, just sending packets out.

The advantage of using QUIC is that it reduces latency and is suitable for situations where data loss can be tolerated, such as online games, AD bidding, online video, live streaming, etc.

In addition, because UDP supports broadcasting, HTTP3 is also suitable for broadcasting applications such as precise time protocol and routing information protocol.

HTTP3 can also be used for the Internet of Things, big data and VR.

Since HTTP3 uses the QUIC protocol, what exactly is QUIC?

Generally speaking, QUIC is a generic transport protocol, very similar to TCP. Why create a new protocol? This is because the existing TCP protocol is very difficult to extend, because there are so many different versions of TCP on so many devices that it is almost impossible to extend directly on the existing TCP protocol.

So QUIC chose to build on top of UDP. QUIC uses UDP primarily because it wants to make HTTP/3 easier to deploy because it is already known and implemented by all devices on the Internet.

In fact, QUIC rewrites the functions of TCP on the basis of UDP, but realizes the core functions of TCP more intelligently and efficiently than TCP.

Now let’s look at the specific characteristics of QUIC.

TLS1.3

TLS is used to ensure the security of the client and server during data transmission and can encrypt plaintext data. TLS1.3 is the latest version of TLS. In older versions such as TLS1.2, the handshake between the client and the server requires at least two network round-trips. In TLS1.3, however, the handshake is reduced to only one round-trip.

Although unencrypted transport mode is supported in HTTP/2, it is not supported by all modern browsers by default, so HTTP/2 must be used in conjunction with HTTPS. HTTPS is definitely the future in the long run, so in QUIC, TLS 1.3 is used directly. QUIC itself is packaged with TLS1.3.

The advantage of this is that QUIC can’t run plaintext, so it’s more secure. And QUIC has a built-in encryption protocol, which combines the transmission and encryption handshake into one, saving round-trip.

Because QUIC is fully encrypted, analysis and statistics on network data are no longer possible for some ISPs and intermediate networks, which may limit its use. And because QUIC encrypts each packet individually, it can cause performance problems in the case of high concurrency.

Resolve HoL blocking

The traditional HTTP1.1 and HTTP2 underlying protocol is TCP, although HTTP2 in the application layer can split the data of different files into a stream and put in the same connection for transmission. But TCP itself does not know that these streams belong to different files and treats them as the same file. So if a packet is lost, TCP resends all packets. This leads to HOL blocking problems.

QUIC is a bit more granular and can perform packet loss detection and recovery logic on a per-stream basis. Only the failed stream will be retransmitted, not the entire file.

Migration of connections

In TCP, if I want to establish a connection between the client and the server, I need to know these four elements: client IP address + client port + server IP address + server port.

If any of these four elements send a change, the TCP connection needs to be re-established. And you need to restart operations in the process according to the application level protocol.

For example, if you are downloading a large file and the network address suddenly changes, you may need to request the file again.

To solve this problem, QUIC introduced a concept called connection identifier (CID). Each connection is assigned an additional number in the above four elements to mark a unique connection between the client and server.

Because this CID is defined by QUIC, it does not change with network migration. This eliminates the need for a new handshake, a situation known as connection migration.

conclusion

So that’s it for HTTP/3 and QUIC today. Although we haven’t covered the details of the underlying protocol, I believe you can understand it. To sum up, QUIC actually builds a more advanced and effective TCP protocol on top of UDP.

This article is available at www.flydean.com/03-http3/

The most popular interpretation, the most profound dry goods, the most concise tutorial, many tips you didn’t know waiting for you to discover!

Welcome to pay attention to my public number: “procedures those things”, understand technology, more understand you!