Three-message handshake refers to tracking and negotiating the amount of data sent each time, ensuring the synchronization of sending and receiving data segments, and confirming data transmission and reception based on the amount of data received. The contact is withdrawn and a virtual connection is established.
The so-called "three-way handshake": In order to track and negotiate the amount of data sent each time and ensure that the sending and receiving of data segments are synchronized, according to the received When the data is sent and received, the contact is canceled and a virtual connection is established.
In order to provide reliable delivery, TCP sequence numbers the data packets in a specific order before sending new data, and requires confirmation messages after these packets are delivered to the target machine. TCP is always used to send large amounts of data. TCP is also used when an application needs to confirm after receiving data.
In order to establish a TCP connection, both communicating parties must know the following information from the other party:
Three-way handshake
1. The starting sequence number of the other party's message sending .
2. The buffer size of the data sent by the other party.
3. The maximum message segment length that can be received, MSS.
4. Supported TCP options.
In the TCP protocol, the communicating parties will understand the above information through three TCP message segments, and establish a TCP connection on this basis. The exchange process of the three TCP message segments between the communicating parties, This is what is commonly known as the Three-Way Handshake process of establishing a TCP connection.
When the connection is established, then:
1. Both communicating parties of the TCP connection can know the sequence number of the first byte that will be sent by the other party on the connection (sent to the other party) Confirmation number, the confirmation number sent by A to B is the sequence number that B will send, and the same is true for B);
2. Both parties can know the MSS that can be sent on the connection, so they can choose to exchange it during the handshake phase. The smaller value of the MSS option in the SYN message and SYN ACK message is used as the actual value;
3. Both parties can know the other party’s receive buffer size;
4. Both parties can You can know whether the other party can use SACK, window scaling and other options.
Based on this information, both parties can establish a TCP connection (x, y) and start the transmission of message segments based on this connection.
The three-way handshake method is used to establish a TCP connection. If two hosts attempt to establish a connection between the same sockets at the same time, only one connection will be established (these two connections are regarded as identical, that is, the same connection), because all connections are identified by their endpoints. If the first request results in the establishment of a connection identified by (x, y), and the second request also establishes a connection identified by (X, y), then there will only be one TCP connection table inside the TCP entity. term(x,y).
Process
First time
First handshake: When establishing a connection, the client sends a syn packet (seq=j) to the server, And enter the SYN_SENT state, waiting for server confirmation; SYN: Synchronize Sequence Numbers.
Second handshake: The server receives the syn packet, must confirm the client's SYN (ack=j 1), and also sends a SYN packet (seq=k) , that is, SYN ACK packet, at this time the server enters the SYN_RECV state.
The third time
The third handshake: The client receives the SYN ACK packet from the server and sends a confirmation packet ACK (ack=k 1) to the server. After the packet is sent, the client Enter the ESTABLISHED (TCP connection successful) state with the server and complete the three-way handshake.
Complete the three-way handshake, the client and the server begin to transmit data. In the above process, there are some important concepts:
(1) Unconnected queue
After three times In the handshake protocol, the server maintains an unconnected queue, which opens an entry for each client's SYN packet (seq=j). This entry indicates that the server has received the SYN packet and sent a confirmation to the client, and is waiting for the client's confirmation. Bag. The connection identified by these entries is in the Syn_RECV state on the server. When the server receives the client's confirmation packet, the entry is deleted and the server enters the ESTABLISHED state.
(2) Backlog parameter
indicates the maximum number of connections queued by the kernel for the corresponding socket. The number of SYN-ACK retransmissions. After the server has sent the SYN-ACK packet, if it does not receive the client confirmation packet, the server will perform the first retransmission. After waiting for a period of time and still not receiving the client confirmation packet, it will perform the second retransmission. If the number of retransmissions If the maximum number of retransmissions specified by the system is exceeded, the system will delete the connection information from the semi-connection queue. Note that the waiting time for each retransmission is not necessarily the same.
(3) Semi-connection survival time
refers to the longest time for the entry of the semi-connection queue to survive, that is, the longest time from the server receiving the SYN packet to confirming that the message is invalid. , this time value is the sum of the longest waiting times of all retransmission request packets. Sometimes we also call the semi-connection survival time as Timeout time and SYN_RECV survival time.
The above is the detailed content of What do you mean by holding your fingers in three messages?. For more information, please follow other related articles on the PHP Chinese website!

The domestic AI dark horse DeepSeek has risen strongly, shocking the global AI industry! This Chinese artificial intelligence company, which has only been established for a year and a half, has won wide praise from global users for its free and open source mockups, DeepSeek-V3 and DeepSeek-R1. DeepSeek-R1 is now fully launched, with performance comparable to the official version of OpenAIo1! You can experience its powerful functions on the web page, APP and API interface. Download method: Supports iOS and Android systems, users can download it through the app store; the web version has also been officially opened! DeepSeek web version official entrance: ht

At the beginning of 2025, domestic AI "deepseek" made a stunning debut! This free and open source AI model has a performance comparable to the official version of OpenAI's o1, and has been fully launched on the web side, APP and API, supporting multi-terminal use of iOS, Android and web versions. In-depth search of deepseek official website and usage guide: official website address: https://www.deepseek.com/Using steps for web version: Click the link above to enter deepseek official website. Click the "Start Conversation" button on the homepage. For the first use, you need to log in with your mobile phone verification code. After logging in, you can enter the dialogue interface. deepseek is powerful, can write code, read file, and create code

DeepSeek: How to deal with the popular AI that is congested with servers? As a hot AI in 2025, DeepSeek is free and open source and has a performance comparable to the official version of OpenAIo1, which shows its popularity. However, high concurrency also brings the problem of server busyness. This article will analyze the reasons and provide coping strategies. DeepSeek web version entrance: https://www.deepseek.com/DeepSeek server busy reason: High concurrent access: DeepSeek's free and powerful features attract a large number of users to use at the same time, resulting in excessive server load. Cyber Attack: It is reported that DeepSeek has an impact on the US financial industry.

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Dreamweaver Mac version
Visual web development tools

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.
