Historical review:

Network HTTP + Communication encryption + Authentication + Packet integrity protection = HTTPS

How about the TCP three-way handshake?

Me: Can we fall in love? She: Yes. Me: That we fall in love.

HTTP query set

1. Does the server decide which version of THE HTTP protocol to use?

CLICK ME

The details are negotiated by both parties and ultimately decided by the server

2. How to check which version of HTTP is used by a website?

CLICK ME

In the Protocol table in network, modern web sites may use multiple HTTP versions.

3. What are the other drawbacks of HTTP /1.1?

CLICK ME
  • 1. The end of the queue is blocked
  • 2. The transmission efficiency of small files is low
  • 3. Plaintext transmission is insecure
  • 4. Each header has a transport header
  • 5. The server cannot actively push data to the client

As long as the transport layer is TCP protocol, it will not be fundamentally solved, HTTP /2 using the flow mechanism to a large extent to alleviate this problem, HTTP /3 transport layer for UDP to completely solve this problem.

4. Major weaknesses of HTTP /1.1?

CLICK ME
  • Slow start
  • Multiple TCP connections compete for bandwidth
  • Of the block

5. What is multiplexing and how does HTTP/2 implement it?

CLICK ME

Establish a TCP connection to transfer multiple files without limiting the number of files. The parallel transmission of resources is realized.

HTTP/2 adds a binary framing layer to the protocol layer for multiplexing. The binary frame splitting layer divides the file into frames, transfers the numbered frames, and assembles them on the server. The server decides what to return first.

6. What functions are realized based on the binary frame layer?

CLICK ME
  • multiplexing
  • You can set the priority of requests
  • Server push
  • The head of compression

7. Queue head blocking – HTTP request blocking?

CLICK ME

A TCP connection can be used to process multiple HTTP requests. The current request is blocked, and subsequent requests have to wait. This is HTTP request blocking.

8. Queue head blocking – TCP packet blocking?

CLICK ME

One requests index.html, and it’s a big file, and it sends back one, two, three, four, five times, and if it’s two, three, four, five, and the packet comes back, and the packet doesn’t come back, then TCP doesn’t send that data to the upper layer, and it has to wait for the one to come back, and then it can be spliced and uploaded to the upper layer, This is TCP packet blocking.

9. Do all resource requests under HTTP/2 go through the “binary framing layer”?

CLICK ME

Yes, because the binary framing layer was added to the HTTP /2 protocol.

10. Why is HTTP /2 no longer necessary to merge Sprite images with resource files?

CLICK ME

The slow start of HTTP /2 has little impact on transfer efficiency, which is mainly affected by file size. The combined size of multiple images is not larger than a single Sprite image, which makes the transmission slower. The same is true for resource file merges.

11. Slow start times problem?

CLICK ME

HTTP /2 A domain name, ideally using a TCP long connection, slow start only need to start once; Http1.1 A domain name to establish multiple TCP connections, establish several TCP will have several slow start.

12. What is TLS and what is the difference with TCP?

CLICK ME

TLS protocol, used to create negotiation and authentication for encrypted channels. Data transmitted at the application layer (HTTP and FTP) is encrypted through TSL to ensure privacy of communication.

TCP is a transport layer protocol, and TLS is a transport layer security protocol. The TLS protocol is not required for HTTP but HTTPS.

13. RTT?

CLICK ME

Round trip time, which includes only the time it takes for a request to go back and forth, is called network latency.

RTT = Propagation delay (round trip) + queuing delay (router and switch) + data processing delay (application)

14. Cache to Cache local files?

CLICK ME

The caching mechanism in HTTP requests, resource caching. Cookies are usually used to maintain login status and cache information.

15. What is the relationship between encoding format and byte stream of file transfer?

CLICK ME

During HTTP transmission, request headers and response headers are transmitted as ASCII text, but the transmitted Content (response body) may be in various forms. The receiving side processes data according to the Type specified by content-Type. The transfer-encoding field in the response header specifies the compression method for the Encoding conversion of the transmitted data. Without this field, there is no encoding compression.

16. Transport priority in HTTP /2?

CLICK ME

There is a default PRIORITY and the PRIORITY of the stream can be changed through the PRIORITY frame. What are the default priority rules and how do you change the priority of a stream through frames? Leave a comment in the comments section.

17. Why is TCP reliable?

CLICK ME

TCP has gone through three handshakes, four breakups, and more secure network communications.

18. Describe the TCP three-way handshake.

CLICK ME

Me: Can we fall in love? He: Yes. Me: That we fall in love.

19. Implementation principle of HTTP/2 header compression

CLICK ME

HTTP 2.0 uses header compression, and the compression algorithm uses HPACK. Can make the header more compact, faster transmission. HPACK protocol, where the principle is Huffman encoding and index table (data structure content).

20. Is HTTPS a new protocol?

CLICK ME

HTTPS is not a new protocol. Generally, HTTP communicates with TCP directly. HTTPS communicates with the security layer first, and then the security layer communicates with the TCP layer. That is, all of HTTPS’s security core is at the security layer. It doesn’t affect the upper and lower floors.

21. How does HTTPS’s security layer work?

CLICK ME

Encrypts the data that initiates HTTP requests and decrypts the received HTTP content.

22. What are the advantages of HTTPS asymmetric encryption?

CLICK ME

Ensures that data sent by the browser to the server is secure

23. Problems with HTTPS asymmetric encryption?

CLICK ME
  • Low efficiency
  • Data sent by the server to the browser cannot be secured

The above reflections mainly come from geek time’s “How Browsers Work” on the Web.

The last

How did you upgrade your site to HTTP /2, and what pitfalls did you encounter? See a lot of websites that are multi-protocol, which resource requests go through HTTP /1.1, and which ones go through HTTP /2? Have you upgraded your website to HTTP /3? Please tell me in the comments section.