Detailed process of four TCP/IP disconnections:
650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M02/4D/3A/wKiom1RN-M-zcXtMAAFVqoFVPvI462.jpg "Title =" 4.jpg" alt = "wKiom1RN-M-zcXtMAAFVqoFVPvI462.jpg"/>
Definition of four disconnected terms:
Ack: the TCP protocol specifies that only ACK = 1 is valid. It also specifies that the ACK of all sent packets must be 1 after the connection is established.
Syn (synchronization): used to synchronize the serial number when the connection is established. When SYN = 1 and ACK = 0, it indicates that this is a connection request message. If the other party agrees to establish a connection, in the response message, SYN = 1 and ACK = 1. therefore, if SYN is set to 1, this indicates a connection request or connection to receive packets.
SEQ: sequence number, 4 bytes, range: 0 ^ 32-1 ^ 32, a total of 4284967296, when reached, re-start Calculation
Four disconnection processes:
1. The customer sends a request with a fin value of 1 to the server, indicating that the data transmission request is closed.
2. When the server receives a request from the client, the user's sending sequence number X is used as its seq sequence number, that is, its ACK = x + 1, use the confirmation serial number y of the client as its seq serial number, and add ACK = 1 to send it to the customer.
3. The server sets its sending sequence number to seq = Y + 1 and sends fin = 1, indicating that it agrees to disconnect
4. After receiving the message, the client sets the server validation number to its own seq serial number, that is, seq = x, and Adds 1 to the server seq serial number, that is, ACK = Y + 1, and sends it to the server, when the server receives the message, it confirms that the information is correct and closes the fault.
Syn (synchronous online) ack (acknowledgement confirmation)
Psh (push transfer) Fin (finish)
RST (reset) URG (Urgent urgent)
Sequence Number acknowledge number (confirmation number)
This article is from the "Linux learning" blog, please be sure to keep this source http://zhangshijie.blog.51cto.com/806066/1568490
TCP/IP is disconnected four times