1. OSI reference model and TCP/IP five-layer model It is sufficient for us to focus mainly on the application layer and the transport layer of the TCP/IP five-layer model. Application layer:
Transport layer:
UDP and TCP 1. UDP UDP is a connectionless protocol, which only transmits data to the receiving end, but does not care whether the receiving end has received the data correctly, so UDP is sometimes considered an unreliable datagram protocol. However, this feature is suitable for multicast, real-time video and audio transmission. advantage:
shortcoming:
2. TCP TCP is a connection-oriented protocol. Before using the TCP protocol to transmit data, a connection must be established between the sender and the receiver. To establish a connection, three handshakes are required. To disconnect, four handshakes are required. (1) TCP three-way handshake to establish a connection First handshake: The client sends a SYN (Seq=X) packet to the server, and the client enters the SYN-SENT state, waiting for the server's ACK (Ack=X+1) reply. ps:: Seq is the sequence number, Ack is the confirmation number. Second handshake: After receiving the SYN (Seq=X) packet sent by the client, the server returns an ACK (Ack=X+1) and SYN (Seq=Y) packet to the client. The server enters the SYN-RECIVED state and waits for the client's ACK (Ack=Y+1) reply. Third handshake: After receiving ACK(X+1), the client enters the ESTABLISHED state and returns an ACK(Y+1) packet to the server according to the SYN(Y) sent by the server. After receiving ACK(Y+1), the server enters the ESTABLISHED state. At this time, the connection is successfully established. This process can be vividly expressed in the following three sentences:
(2) TCP closes the connection four times This process can be vividly expressed in the following four sentences:
3. Differences between UDP and TCP
HTTP HTTP (HyperText Transfer Protocol) Hypertext Transfer Protocol is an application layer protocol based on TCP (transport layer) and is the standard for requests and responses between clients and servers. Key Features:
HTTP message: (1) Request line: GET https://www.baidu.com/ HTTP/1.1, consisting of request method, URL, and protocol version (2) Response line:
HTTP request method: There are many types of request methods, the most commonly used ones are GET and POST. Although there are many request methods, they are mostly for conveying semantics. For more semantic descriptions of methods, you can read the documentation. 4. The difference between GET and POST GET:
POST:
A detailed comparison between the two:
Status code: The status code indicates the status of the response, which allows us to know whether the request was successful or failed, and if it failed, what caused it. 2XX Success:
3XX Redirects:
4XX Client Error:
5XX Server Errors:
HTTPS More secure network transmission protocol:
HTTP/2
References:
|
<<: Enterprises need to prioritize mobile unified communications
2020 is a challenging year, and it has not been e...
While the pandemic delayed global 5G construction...
[51CTO.com original article] The Global Software ...
【51CTO.com Quick Translation】With the industry...
First of all, we must know what 5G is. In a nutsh...
Today, software-defined wide area network (SD-WAN...
RAKsmart has added a new Hong Kong high-bandwidth...
[51CTO.com original article] "I am neither a...
In the list of "Top 20 Technology Companies ...
iWebFusion (iWFHosting) was founded in 2001. It i...
Translator | Li Rui Review | Chonglou 51CTO Reade...
Behind the strategic choices of technology compan...
[[423701]] The large-scale deployment of IPv6 in ...
At the recent 2021 Alibaba Cloud Financial Data I...
5G is the fifth generation of mobile communicatio...