Significance of TIME_WAIT status

Source: Internet
Author: User

The port connected to the server after the client establishes a TCP/IP connection with the server and closes the SOCKET
Status: TIME_WAIT
 
Is it true that all sockets that execute active shutdown will enter the TIME_WAIT status?
Is there any situation in which the socket that is automatically CLOSED directly enters the CLOSED state?
 
After the last ack is sent
It will enter the TIME_WAIT status and stay in the 2MSL (max segment lifetime) Time
This is essential for TCP/IP, that is, it cannot be solved.
That is, the TCP/IP designer was designed like this.
There are two main reasons:
1. Prevent the package in the last connection from appearing again after getting lost, affecting the New Connection
(After 2MSL, all repeated packets in the last connection will disappear)
2. Close TCP connection reliably
The last ack (fin) sent by the active shutdown party may be lost, and the passive party will resend the ack (fin ).
Fin. If the active Party is in the CLOSED state, it will respond to the rst instead of ack. So
The active party must be in the TIME_WAIT state, not the CLOSED state.
TIME_WAIT does not occupy a large amount of resources unless it is attacked.
Also, if one side sends or recv timeout, it will directly enter the CLOSED status

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.