Wireshark network protocol analysis: interpreting the TCP protocol and understanding TCP three-way handshake and four-way handshake

Wireshark network protocol analysis: interpreting the TCP protocol and understanding TCP three-way handshake and four-way handshake

TCP Transmission Control Protocol is a connection-oriented, reliable, byte stream-based transport layer protocol that implements end-to-end connections for communication between applications.

1. TCP message header format

2. Analysis of TCP three-way handshake to establish a connection

Every TCP communication must go through a three-way handshake to establish a connection and a four-way handshake to disconnect the connection to ensure the reliability of communication.

The meaning of the flag bit:

  • SYN means to establish a connection
  • FIN means closing the connection
  • ACK means response
  • PSH indicates that there is DATA data transmission
  • RST means connection reset

1. The process of establishing a connection:

  • Client sends a request and waits for confirmation
  • After receiving the request, the server responds and asks for confirmation
  • After the client confirms, the connection is established

OK, handshake is successful, data transmission starts.

2. Interpretation of TCP's first handshake message (SYN)

3. Interpretation of TCP second handshake message (SYN/ACK)

4. Interpretation of TCP third handshake message (ACK)

3. TCP waved four times to disconnect

The data packet that waved four times to disconnect is shown in the figure below.

Waving process

The four waves are mainly for the interpretation of the FIN sign, and the rest are basically the same as above.

<<:  SD-WAN in 2019: A conundrum for service providers

>>:  Easy to understand: understanding the "weakness" and "slowness" of mobile networks

Recommend

Microsoft Build 2017: Officially released Visual Studio for Mac

On the evening of May 10th, Beijing time, Microso...

China Mobile has built more than 410,000 5G base stations

On April 25, China Mobile General Manager Dong Xi...

5G cannot enhance industry?

There are already more than 1,100 “5G+Industrial ...

Five disruptive features of 6G networks

The telecommunications industry is constantly pur...

The development of 5G will open up a new track for the Internet of Things

The Ministry of Industry and Information Technolo...

Interview: ZooKeeper 23 questions, see if you can answer them

1. What is ZooKeeper? ZooKeeper is a distributed,...

5G cybersecurity market to reach $16 billion by 2028

The 5G network security market is expected to gro...

Have you learned how to configure multiple public IP addresses?

background For some customers working on video an...