三次握手簡(jiǎn)圖
TCP建立連接之前要進(jìn)行三次握手。
三次握手
三次握手的最終目的就是為了establish a reliable connection between two devices咐扭。
三次握手動(dòng)態(tài)圖
This connection is established by using what is known as the Three-way Hand Shake.
-
SYN
the device initiating the connection will transmit a SYN segment, this synchronises the sequence numbers and specifies what the Initial Sequence Number (ISN) will be, the ISN will be incremented by one for each transmitted segment. -
SYN-ACK
The receiver will then reply with a SYN-ACK segment, this acknowledges the request to establish a connection from the initiating device. -
ACK
The third segment that completes the Three-way Handshake process is sent from the initiator is an ACK or acknowledgment message.
三次握手詳圖
三次握手詳圖
Wireshark抓包
Wireshark抓包之三次握手
-
SYN
SYN
Sequence number (即x) = 0
-
SYN-ACK
SYN-ACK
Sequence number (即y) = 0
Acknowledgement number = x + 1 = 1
-
ACK
ACK
Acknowledgement number = y + 1 = 1