TCP status change process

Source: Internet
Author: User

Active TCP connection creation:

Passive Establishment of TCP connections

 

Active disconnection

Passive disconnection

In the time_wait stage, MSL must be twice the length of time, that is, maximum segment lifetime, which indicates the maximum time in the network before any packets are discarded: rfc793 indicates that MSL is 2 min, but the commonly used values in implementation are 30 s, 1 min or 2 min. The reason for this is: when the TCP line is closed and the last Ack is returned, the connection must stay in the time_wait status for 2 MSL, this allows TCP to send the last ack again to prevent the ACK from being lost (the other end times out and resends the final fin ).

 

Another result of MSL waiting for such 2 is that the socket used for connection (SIP: Sport: dip: dport) cannot be used during time_wait, it can only be used after 2msl. However, for the local IP Address: dport, you can set the so_reuseadr option of the socket to bypass this restriction. This is also the reason why the socket listened by the current server will usually set the so_reuseaddr option.

In the time_wait stage, any late message on the link will be discarded.

 

Related Article

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.