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

AI and 5G synergy: Unleashing the full potential of the digital age

In the evolving technology landscape, two breakth...

Catch it all - Webpack project packaging 1

[[427986]] This article is reprinted from the WeC...

5G message is coming, please check!

What is 5G messaging? Is it an upgraded version o...

Linkerd 2.10 (Step by Step)—Ingress Traffic

[[406692]] The Linkerd 2.10 Chinese manual is bei...

Interview surprise: Why use HTTPS? What is it useful for?

Speaking of HTTPS, I believe most people are fami...

I found a mistake in the book!

I discussed some TCP issues with my friends over ...

Learn about routers, switches, and network hardware

Today we're taking a look at home network har...