Hello everyone, I am Xiaolin. I saw an old man asked a question on the website. To put it simply, why during the TCP three-way handshake, if the confirmation number of the SYN-ACK message received by the client does not meet the expectation, why does it return RST instead of discarding it? If I say return to RST, does it mean return to RST? Of course not, I also confirmed it by reading the RFC standard. Let me describe the scene first:
The above process is the process of TCP three-way handshake to prevent the establishment of historical connections. The reason why TCP needs three-way handshake is firstly to prevent confusion caused by old repeated connection initialization, and secondly to reliably synchronize the sequence numbers of both parties. Why is it designed that when the client receives a SYN-ACK message that does not meet its expectations, it returns RST instead of discarding it? Now let's assume it is discarded and see what happens? It can be seen that when a client connected in the SYN_SENT state receives a SYN-ACK message that does not meet expectations, if the selected processing is "discard", both parties will trigger a timeout retransmission until the maximum number of retransmissions is reached before entering the CLOSE state. This process takes 10-20 seconds. From the client's perspective, it is difficult to establish a connection with the server because an old connection with the same four-tuple already exists on the server. If the server connection is not terminated, the client's new connection (SEQ=100) cannot be confirmed. This is because in the non-LISTEN state, if a SYN is received, a challenge ack is returned. This ack does not confirm the receipt of the SYN message, but continues to reply to the last ACK sent. Does it feel like the old connection (SEQ=90) on the server is just sitting there doing nothing? Therefore, the task of killing the old connection on the server is left to the client. When a client connected in the SYN_SENT state receives a SYN-ACK message that does not meet its expectations, it directly sends RST to the server, killing the server's old connection so that the client's new connection can be established quickly. What do you think? TCP is full of details! |
<<: HTTP caching is enough to read this article
>>: What is the function of each layer in the computer network layered model?
Now everyone is talking about 5G, just like when ...
[51CTO.com original article] In 2016, Gartner cha...
2021 is a good time for IT startups. In the past ...
"Smart Park" is not a new concept. In t...
As early as this year's "Two Sessions&qu...
The Ministry of Industry and Information Technolo...
[51CTO.com original article] The early winter of ...
When users open Taobao, Baidu, Zhihu and other ma...
In September, when students of the University of ...
In the past 2022, DiyVM has made a series of chan...
Today, RackNerd offers three hot-selling packages...
PacificRack has recently released some unusual pa...
[[386743]] The Modbus protocol adopts master-slav...
SDN controller features include modularity, API, ...