HTTP2

HTTP2 uses binary transport to split requests and data into frames, http1.1 is based on text format, where frames are sequential identification multiplexing of data, with the same domain name can reach a TCP connection transmission all requests data requests are stream-based.


multiplexing

Multiplexing replaces the sequence and blocking mechanism of HTTP1.x, where all requests for the same domain name are completed concurrently over the same TCP connection. In HTTP1.x, multiple concurrent requests require multiple TCP connections, and browsers limit the number of TCP connections to 6-8 for resource control. If keep-alive is enabled, it can be used more than once, but only one HTTP request can be made at a time

The header compression head

Header first sends all, then sends differences.

Header compression requires maintaining an identical Static Table of common header names and particularly common header names and value combinations between HTTP/ 2-enabled browsers and servers. Maintain the same Dynamic Table for adding content on the fly; Support Huffman Coding based on static Huffman code table; Static dictionaries have two functions: 1) For header key-value pairs that match exactly, such as method: GET, they can be represented by a single character; 2) For key-value pairs whose header names match, such as Cookie: XXXXXXX, you can use a single character to represent the names. Reference: www.cnblogs.com/cangqinglan… Header Complete header key value pair httpwg.org/specs/rfc75…

HTTP2 shortcomings

TCP+TLS: TCP+TLS: TCP+TLS: TCP+TLS: TCP+TLS: TCP+TLS: TCP+TLS There is a “timeout retransmission” mechanism where lost packets must wait for retransmission confirmation. 3. The average number of requests is the same as usual, but there will be a short burst of requests, resulting in instantaneous QPS explosion. 4, Multiplexing is easy to Timeout a large number of requests sent at the same time. Even though they start shorter, they both run out of time.

http3

QUIC protocol is based on UDP

1, solve the http2 multiplexing existing packet loss problem, there is no blocking multiple streams before there is no dependency, based on ID to identify a link, not TCP based on IP and port 2, QUIC can keep more bytes in transit on the network. On a network with a high packet loss rate, the network recovery speed can be improved and the retransmission volume can be reduced. Reference, in road byte blog.csdn.net/u014023993/… 3, because the network delay processing data packet loss and the receiving end and sending end has a difference to the speed of sending data and receiving end may take multiple packages after unified responses Ack strategy, then the sender needs to be saved “has been sent but not yet received an Ack” list of data, when trigger retransmission, directly in the list to find corresponding need retransmission data, Retransmission to the receiver.

Continue to organize