The opening of HTTP/2 notes

Source: Internet
Author: User

Objective

This series is based on the HTTP/2 17th draft document, the address is: HTTPS://TOOLS.IETF.ORG/HTML/DRAFT-IETF-HTTPBIS-HTTP2-17.

HTTP/2 specifications have been approved by the release, the following waiting to allocate a specific RFC number, there will be no significant changes.

This note is not a direct translation, recorded into notes convenient later study.

http/1.1 's Problem

A picture can be a very comprehensive summary of the existence of http/1.* defects:

The front-end is generally used:-CSS spriting, small image merged into a large map, CSS to split into small image display-inlining, using Dataurl way embedded BASE64 encoded format picture-JS concatenation, multiple JS files merged into one, The flaw is that once a file has been modified, it needs to be re-merged-sharding, deploying the resource/service to multiple machines, averaging/sharing the request pressure

Http/1.* does not take full advantage of TCP features, coupled with the opening of multiple connections at the same site, resulting in a low utilization of network resources.

HTTP/2 Improvement Point

The main differences compared to HTTP/1 include:

    1. HTTP/2 in binary format rather than text format
      • Efficient and compact transmission resolution
      • Less error prone, no so-called blank lines, caps, line breaks, empty joins, etc.
    2. HTTP/2 are fully multiplexed, rather than ordered and blocked
      • http/1.1 single-Request single connection by default
      • http/1.1 pipelined pipelining mode causes larger/slower responses to block successor tasks
      • http/1.1 does not solve the problem of thread blocking
      • Multiplexing can effectively avoid thread blocking and multiple request-response parallel processing within the same connection
    3. Parallel with just one connection
      • HTTP/1.* Request processing model causes the same site resource client to open if 4-8 connection requests
      • http/1.* multiple connections can consume excessive network resources, resulting in TCP congestion and data retransmission
      • HTTP/2 the parallel processing between multiple streams (request-response) within a single connection, reducing network resource consumption and avoiding TCP frequent opening and closing
    4. With header compression, HTTP/2 reduces overhead
      • Traditional browser network header typically at 80-1400 byte size
      • Compression head allows for more compact headers, faster transmission, and facilitates mobile network environments
      • Compression algorithm uses hpack, more efficient, more secure
    5. HTTP/2 allows the server to proactively "push" the response to the client
      • Traditional way: Client request, server response, the client resolves a subsequent request to the picture, style and other resources, again one by one send the resource request
      • The HTTP/2 server calculates the resources contained in the response content based on the client request and sends it to the client ahead of time before the client initiates the request.
      • Saves round-trip time for clients to initiate unsolicited requests

Here is a picture of the HTTP/2 that can be understood in general:

The interpretation of HTTP/2

All semantics of the http/1.1 are reserved/compatible, but the transfer syntax (or transmission) is changed to make the most of TCP more efficient, multiplexing is the implementation path, and low latency is the direction of improvement.

Notes outline

Above for a simple general introduction of the HTTP/2 protocol, in order to delve into its characteristics, the reader specification is required. Here is an outline of the various aspects surrounding the HTTP/2 specification, which makes it easy to fill back one by one.

    1. HTTP/2 Connection Establishment
    2. HTTP/2 multiplexing and streaming properties
    3. Frame definition for HTTP/2
    4. HTTP/2 's Message exchange
    5. HTTP/2 error handling and security matters
noun explanation

The following nouns appear in the current or later notes and are posted for easy comprehension.

    1. Intermediary (intermediation), which refers to Internet devices including agents, corporate firewalls, reverse proxies, and CDNs
    2. Alpn,application Layer Protocol Negotiation
    3. Header, message header, request message header, or response message header
Summary

Compared to http/1.1, HTTP/2 can make full use of TCP connections more efficiently, avoiding the repetitive creation of TCP connections (three handshake) and destroying (four waves).

Reference
    1. "Http/2 WebRTC all the things!"
    2. "Implementing HTTP/2 Client in minutes"

Original http://www.blogjava.net/yongboy/archive/2015/03/17/423531.html

The opening of HTTP/2 notes

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.