In this section, Rui Ge will continue to show you how to use diagrams to explain the network and explore the principle behind TCP's four-wave disconnection. Let’s get straight to the point! A brief review of TCP three-way handshakeTCP is a full-duplex protocol. In order to establish a connection, a reliable link can be established through three handshakes:
TCP three-way handshake simple process TCP four times waveExamples from real lifeBoth ends of the connection can terminate the TCP connection, and even unilateral termination is possible, which is also called a half-open connection. Even if one party has disconnected, the other party can still transmit data. The four waves we mentioned refer to the disconnection of both parties. Let us first explain with examples from real life: Four Waves - Real Life Example: Breaking Up Xiaomei and Xiaoming are college classmates. When they first entered college, Xiaoming was tall, handsome, and could play basketball. Xiaomei admired him very much, and Xiaoming also liked Xiaomei very much. Just like that, on a dark and windy night, they became lovers. However, as time went by and the environment changed, the two gradually lost their passion, so Xiaomei proposed to break up with Xiaoming. The process of breaking up is similar to TCP's four waves:
Then a big red exclamation mark will appear on Xiao Ming’s WeChat! WeChat blacklist These are four waves. Isn’t it very vivid? Next time if you forget the TCP four-wave procedure, I think you can imagine yourself as a scumbag. Okay, let's get back to the topic and analyze the principle of TCP's four waves. Analysis of the principle of four-waveFour wave process As shown in the figure, the client wants to disconnect from the server:
This can be associated with the fact that when Xiaomei was sending the breakup message, her boyfriend Xiaoming had been sending messages to Xiaomei. The messages that Xiaomei did not read were put into the queue. Xiaomei would still read the messages in the queue, but would no longer actively reply to these messages.
At this point, the TCP connection is disconnected! TCP four times handshake - with sequence number As shown in the figure, M and N are both sequence numbers, representing the client and server respectively, and are also used to distinguish the server from the client. For example, when you see M, you think that the message comes from the client, and when you see N, you think that the message comes from the server. So the process becomes:
At this point, TCP has successfully disconnected. Maximum lifetime of a disconnectHere is another example. After Xiaomei sends the message "That's it, let's delete each other's WeChat, goodbye!", she will wait for up to four minutes to give Xiaoming a chance to retain her: Wait four minutes If Xiao Ming doesn't try to stop him within these four minutes, then I'm sorry, it's game over! Game Over! In the [Four-wave Principle Analysis] diagram, we noticed the TIME_WAIT state. After the client sends the last ACK segment, the connection will not be terminated immediately. Since there is no guarantee that the last data packet sent has indeed arrived, the client or server will initially remain in the time waiting state until the maximum life cycle (MSL, Maximum Segment Lifetime) of the ACK segment and any new FIN segment can completely enter the CLOSED state. This mechanism is mainly based on two considerations:
|
<<: Understanding Internet Protocol Security — IPSec
>>: Network virtualization market development status in 2022
[[398008]] I found that I haven't shared PC s...
edgeNAT is a Chinese hosting company established ...
The last time I shared information about Ramnode ...
With the emergence of ChatGPT, we have entered a ...
1. Brief description of background technology Reg...
RackNerd has launched a new promotion for the US ...
Friendhosting released a promotional email titled...
[[375297]] Recently, Wu Hequan, an academician of...
Operators have been fighting "pipelining&quo...
RAKsmart has launched a promotional event for the...
Today, the use of cloud computing services contin...
V5.NET has launched a new promotion, currently of...
F5 Networks (NASDAQ: FFIV) today announced that i...
OneTechCloud (Yikeyun) offers a 20% discount code...
Recently, China's three major operators have ...