TCP connection management process

Source: Internet
Author: User

TCP connection management. This is the basic workflow of our agreement. The connection is established, including three handshakes. The three-way handshake is used to establish a connection in the TCP protocol. To establish a connection, one party, such as the server, passively waits for a connection request to arrive by executing the LISTEN and ACCEPT primitives.

The other party, such as the customer, executes the CONNECT primitive and specifies the IP address and port number it wants to CONNECT to, sets the maximum value of TCP datagram that it can accept, and some optional user data. The CONNECT primitive sends data with SYN = 1, ACK = 0 to the target end and waits for the response from the target end.

After the datagram arrives at the destination end, the TCP entity will check whether a process is listening to the port specified by the destination port field. If no, it will send a response with RST = 1 and refuse to establish the connection.

If a process is listening on the port, the TCP datagram is sent to the process, which can accept or reject the connection. If yes, a confirmation datagram is returned. Generally, the TCP connection is established.

To release the connection, each party can send a TCP datagram with FIN = 1, indicating that this party has no data to send. When the FIN datagram is confirmed, the connection in that direction is closed. When the connection is closed in both directions, the connection is completely released. In general, releasing a connection requires four TCP datagram packets: each direction has one FIN datagram and one ACK datagram.

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.