TCP Three-time handshake (three-way handshake)

Source: Internet
Author: User
Tags ack

http://blog.csdn.net/zuyi532/article/details/7599766



1, TCP three times the role of shaking hands:

The purpose of the three handshake is to connect the server to the specified port, establish a TCP connection, and synchronize the serial number and confirmation number of both sides of the connection and exchange the TCP window size information. In socket programming, when the client executes connect (), the handshake is triggered three times.

2, TCP three times handshake process:

The first step: The client sends a SYN-bit TCP message to the server that contains the initial serial number x of the connection and a window size (representing the size of the buffer on the client to store incoming segments sent from the server). --syn Message Segment


Second step: The server receives the client sends the SYN message, takes out the Tcp_syn message segment, assigns the TCP cache and the variable for this TCP connection, and sends to the client a SYN and the ACK to place the TCP message, which contains its choice initial serial number Y, to the client's serial number confirmation x+ 1 and a window size (representing the size of the buffer on the server that is used to store incoming segments sent from the client). --synack Message Segment


The third step: after receiving the Synack message segment, the client assigns the cache and variable to the connection, and returns a confirmation number Y+1 ACK message to the server side, the SYN bit in the message is placed 0, a standard TCP connection completes. (will be set to 0 in future message segments)

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.