当前位置:网站首页>TCP three handshakes and four disconnects

TCP three handshakes and four disconnects

2022-07-27 02:31:00 less than _ ermi

TCP Three handshakes of 、 Disconnect the main focus four times TCP Serial number and confirmation number of the head and several marked parts . Three handshakes is to establish a TCP When the connection , Confirm the serial numbers of the client and server .

Three handshakes : At the very beginning , Both the client and server are closed , The server actively listens to a port , The client randomly generates serial numbers , Send the connection request to the server , After the server receives the connection request from the client , You can also initialize the corresponding serial number , Send to client , After receiving the message from the server, the client knows that the server already knows its serial number and that it also knows its serial number , At this point, the client only needs to tell the server that it has received the serial number it sent , When the server receives the message sent by the client ( I have received your serial number ) When , The connection between the client and the server is established . To sum up, both parties send their serial numbers to each other , See if the other party can receive , After three handshakes, you can see that both sides have the ability to receive and send .

Four disconnects : After establishing the connection , Both the client and the server are in the state of established connection , If the client wants to actively disconnect , Tell the server that I want to actively disconnect , After receiving the message, the server informs the client that the received message has been confirmed to be received correctly . Now , Wait for the server to confirm that there is no data returned to the client , Tell the client to disconnect , Enter the state of waiting for the connection to be disconnected , The client receives the disconnection information and tells the server to confirm the disconnection , Enter the end of connection state by yourself , After the server receives the confirmation of disconnection , The server enters the shutdown state , The client also enters the shutdown state after waiting for a while in the connection end state .

原网站

版权声明
本文为[less than _ ermi]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/208/202207262245099427.html