当前位置:网站首页>Tcp/ip FAQs

Tcp/ip FAQs

2022-06-21 13:59:00 Do not deceive the dark room__

1.TCP/IP What is the function of the seventh floor ?

2. Three handshakes , Four waves ?

Three handshakes :

3. Why three handshakes and four waves ?

    Because the server receives the connection request sent by the client for the first time during the handshake connection SYN After package , You can send it at the same time ACK Confirm the package and SYN Synchronization package , In the process of waving and releasing, the server receives the FIN After package , It is likely that it will not be closed immediately socket, Instead, you need to send ACK The confirmation package tells the client that I have received the request , It can only be sent after the server message is sent FIN End bag , disconnect , In this way, you can send one more time .

4. Why should the client wait while waving ?

According to the above two TCP Shake hands and wave hands ,TIME-WAIT The client receives the server FIN End packet sending ACK Wait time after confirming the package , So it can be launched to prevent the client's ACK Confirm that the package is lost and wait

             Reprinted from https://blog.csdn.net/sinat_35297665/article/details/80979181

1、 To ensure the last one sent by the client ACK The message segment can reach the server . Because of this ACK Possible loss , Which leads to being in LAST-ACK The server in state could not receive a pair of FIN-ACK Confirmation message of . The server will time out to retransmit this FIN-ACK, Then the client retransmits the confirmation , Restart time wait timer . Finally, both the client and the server can be shut down normally . Suppose the client doesn't wait 2MSL, It's sending out ACK Then release it directly and close it , One but this ACK Lost words , The server will not be able to enter the closed connection state normally .

2、 It can also prevent invalid message segments . The client is sending the last ACK after , And then through 2MSL, All message segments generated during the duration of this link will disappear from the network . From the guarantee that there will be no message segment remaining in the network to harass the server after the connection is closed .

原网站

版权声明
本文为[Do not deceive the dark room__]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202221430316740.html