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
Digital transformation has had ripple effects on ...
DiyVM is a long-established Chinese hosting compa...
As 5G commercialization continues to advance, the...
When we deploy a WiFi network at home, there are ...
While we are worried about not being able to affo...
Over the years, we've dutifully upgraded our ...
[[331465]] The low-power wide-area network (LPWAN...
When interest in Hadoop began a few years ago, WA...
1. What is NB-IoT NB-IoT (Narrow Band Internet of...
In recent years, with the rapid growth of mobile ...
5G is currently the most eye-catching new technol...
It is 2019, and there is a serious problem that b...
In any organization, the network infrastructure h...
From October 14 to 16, the 2020 China Internation...
BandwagonHost has recently updated its discount c...