TCP3 Handshake 4 times wave

Source: Internet
Author: User

TCP Connection Client state transition process


Closed-->syn_sent-->established--> fin_wait1-->fin_wait2-->time_wait-->closed


TCP connection Service side state transition process


Closed-->listen-->syn_recvd-->established-->close_wait-->lask_ack-->closed


Why is the TCP connection 3 handshake, disconnect to 4 times wave?

Because when the TCP disconnects, the client sends Fin=1 's disconnect request to the server (the first wave), itself enters the state (FIN_WAIT1), but the server may have no data sent and received, so the server will reply to the ACK (the second wave) to the client to receive the disconnection request. At this point the client state changes to Fin_wait2, and when the server is ready, the fin (Third wave) is sent to indicate that the disconnection is in the Lask_ack state at the same time that the client receives fin and sends an ACK (fourth wave) to the server itself into a time_wait state. Wait for the MSL time to go back to the closed state of the client server.

Why does TCP4 wave after waving not directly into the closed state, but wait for the MSL time to change after?

Because the computer thinks itself is not reliable, also has the 4th time to wave the ACK message service side not to receive the reason, therefore will wait for the MSL time past both sides to become closed state.

TCP3 Handshake 4 times wave

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.