In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/03 Report--
Today, I would like to talk to you about what is a three-message handshake. Many people may not know much about it. In order to make you understand better, the editor summed up the following contents for you. I hope you can get something from this article.
Three-message handshake refers to in order to track and negotiate the amount of data sent each time, to ensure that the sending and receiving of data segments are synchronized, to confirm when to cancel the contact after data transmission and reception, and to establish a virtual connection according to the amount of data received.
The so-called "three-way handshake": in order to track and negotiate the amount of data sent each time, and to ensure that the sending and receiving of data segments are synchronized, confirm when to cancel the contact after the data is sent and received according to the amount of data received, and establish a virtual connection.
To provide reliable delivery, TCP sends the sequence number of the packets in a specific order before sending new data, and requires an acknowledgement message after the packets are sent to the target. TCP is always used to send large quantities of data. TCP is also used when the application needs to make a confirmation after receiving the data.
In order to establish a connection TCP connection, both sides of the communication must learn the following information from each other:
Three-way handshake
1. The starting number of the message sent by the other party.
2. The buffer size of the data sent by the other party.
3. The maximum message segment length that can be received is MSS.
4. Supported TCP options.
In the TCP protocol, the two sides of the communication will understand the above information through three times of TCP message segment Peng, and establish a TCP connection on this basis, and the process of exchanging three times of TCP message segments between the two sides of the communication is commonly known as the three-way handshake (Three-Way Handshake) process of TCP connection establishment.
When the connection is established, then:
1. Both sides of the TCP connection can know the sequence number of the first byte that will be sent to the other side on the connection (send the confirmation number to the other party, and the confirmation number sent by A to B is the sequence number that B will send, and so is B)
2. Both parties can know the MSS that can be sent on the connection, so the smaller value of the MSS option in the SYN message and SYN+ACK message exchanged between the two parties during the handshake can be selected as the actual value.
3. Each side can know the size of the receiving buffer of the other.
4. Both sides can know whether the other can use SACK, window zooming and other options.
Based on this information, both parties can establish a TCP connection (XJY) and start the transmission of the message segment based on the connection.
If two hosts attempt to establish a connection between the same socket at the same time, only one connection will be established (the two connections are considered to be 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 (XMague y), and the second request also establishes a connection identified by (XMague y), then there will only be one TCP connection table entry (XMague y) within the TCP entity.
Process
For the first time
First handshake: when establishing a connection, the client sends a syn packet (seq=j) to the server and enters the SYN_SENT state, waiting for the server to confirm; SYN: synchronous sequence number (Synchronize Sequence Numbers).
The second time
Second handshake: when the server receives the syn packet, it must confirm the customer's SYN (ack=j+1). At the same time, it also sends a SYN packet (seq=k), that is, the SYN+ACK packet, when the server enters the SYN_RECV state.
The third time
The third handshake: the client receives the SYN+ACK packet of the server and sends the confirmation packet ACK (ack=k+1) to the server. After the packet is sent, the client and the server enter the state of ESTABLISHED (successful TCP connection) and complete the three-way handshake.
After completing the three-way handshake, the client and server begin to transfer data, and in the above process, there are some important concepts:
(1) unconnected queue
In the three-way handshake protocol, the server maintains an unconnected queue, which is listed as the SYN packet (seq=j) of each client and opens an entry that indicates that the server has received the SYN packet and sends an acknowledgement to the customer, waiting for the customer's confirmation packet. The connection identified by these entries is in the Syn_RECV state of the server. When the server receives the acknowledgement packet from the customer, the entry is deleted and the server enters the ESTABLISHED state.
(2) Backlog parameters
Represents the maximum number of connections queued by the kernel for the corresponding socket. Number of SYN-ACK retransmissions the server sends the SYN-ACK packet, if the server does not receive the customer confirmation packet, the server retransmits it for the first time, waits for a period of time, and carries out the second retransmission. If the number of retransmissions exceeds the maximum number of retransmissions specified by the system, the system removes the connection information from the semi-connection queue. Note that the waiting time for each retransmission is not necessarily the same.
(3) half-connection survival time
It refers to the maximum survival time of entries in the semi-connection queue, that is, the longest time from receiving the SYN packet to confirming that the message is invalid. This value is the sum of the longest waiting time of all retransmission request packets. Sometimes we also call semi-connection survival time as Timeout time, SYN_RECV survival time.
After reading the above, do you have any further understanding of what is a three-message handshake? If you want to know more knowledge or related content, please follow the industry information channel, thank you for your support.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.