Http, https, http/2 learning, httphttps2 Learning
Before learning about http, https, and http/2, sort out the OSI network model, TCP/IP protocol, TCP and UDP.
I. a brief review of the OSI Layer-7 Network Model
OSI is an open reference model for Communication System Interconnection. It is a protocol specification proposed by the International Organization for Standardization. The model goes from top to bottom:
Application Layer (OSI application layer protocols include file transmission, access and management protocols (FTAM), and file virtual terminal protocol (VIP) and public management system information (CMIP )) presentation Layer (the presentation layer provides multiple functions for data encoding and conversion at the application layer to ensure that information sent at the application layer of one system can be recognized by the application layer of another system) session Layer (the Session Layer establishes, manages, and terminates communication sessions between the presentation layer and the entity) Transport Layer (the transport layer provides a reliable end-to-end network data flow service to the high-level) network Layer (the network layer is responsible for establishing a connection between the source and the end) the data link layer (the data link layer is provided for data transmission through the physical network link. Different data link layers define different network and Protocol features, including physical addressing, network topology, error verification, data frame sequence, and traffic control) physical Layer (the physical layer is responsible for encoding information into current pulses or other signals for online transmission) II. TCP/IP protocol
The TCP/IP protocol integrates multiple protocols, such as TCP/IP, to process the transmission between the computer and the network. It references and integrates the OSI network model. Common TCP/IP protocols are divided into four layers, from top to bottom:
Application Layer (the application layer corresponds to the application layer and the presentation layer of the OSI Layer 7 Reference Model) transmission layer (the transport layer corresponds to the transport layer of the OSI Layer 7 Reference Model, which provides two end-to-end communication services) the inter-network layer (this layer includes IP Protocol and RIP Protocol), which is responsible for data packaging, addressing, and Routing. It also contains the inter-network Control Message Protocol (ICMP) for Network diagnosis information) network Interface Layer (the network interface layer includes the protocol used for the transmission of collaborative IP data on existing network media) 3. TCP and UDP
TCP (Transmission Control Protocol, Transmission Control Protocol)
It is a connection-oriented, reliable, and byte stream-based transport layer communication protocol. UDP is a simple Datagram-oriented transport layer Protocol. They are responsible for processing the transport layer in the OSI network model.
A simple comparison between TCP and UDP:
TCP |
UDP |
Connection orientation (three-way handshake and four-way handshake) |
No connection |
High resource usage |
Reduced resource usage |
Ensure Data Order |
No data order |
Slow transmission speed |
Fast transmission speed |
Ensure data correctness |
Easy packet loss |
Stream Mode |
Packet Mode |
Iv. HTTP
Http (Hypertext Transfer Protocol) is a protocol commonly used at the application layer. It is based on text transmission content.
Eight request methods
Get, post, head, put, delete, trace, options, and connect.
Http request information structure request line request header other message status codes 1xx message-the request has been received by the server, 2xx further processing succeeded -- the request has been successfully received, understood, and accepted by the server 3xx redirection -- The 4xx request error can be completed only after subsequent operations -- The request contains a lexical error or cannot be executed 5xx server Error -- an error occurs when the server processes a correct request.
Common status codes 200 (successful request), 302 (redirected to some URLs), 304 (read cache), 404 (no file or directory found), 405 (request specified method error), 500 (server error), 502 (server response is invalid)
V. HTTPS
Https can be called the http Security edition, mainly because SSL (Secure Sockets Layer) or TSL (Transport Layer Security) is added under http ), data is encrypted at the transport layer in SSL or TSL.
Https features: 1. Ensure transmission information security (encrypted). 2. Apply for a certificate. 3. This prevents hijacking by the carrier. 4. The security layer is added, therefore, the access speed is slowed down. 5. http websites can access https links. https websites cannot access http links (except some browsers that support mixed-content). 6. SPDY
Spdy is an open and open network transmission protocol for Google. It is located between the http and ssl layers and can accelerate access.
Spdy features: 1. reduce latency 2. Set Request priority 3. header Compression 4. Ensure Transmission Security Based on https 5. Support for server push 7 and HTTP/2
Http/2 (Hypertext Transfer Protocol version 2). He has made some improvements to http and also referred to the spdy-related content (which can be called the evolutionary version of spdy ).
Http/2 features: the new binary format multiplexing header Compression supports the difference between server pushhttp/2 and spdy: http/2 supports http transmission, spdy only supports https http/2, and spdy's header compression algorithm is different