The original problem was the TCP three-way handshake, but if you want to learn the three-way handshake, you have to understand what TCP is so I got to the bottom of what TCP is, and I want you to point out what’s wrong with it

Transmission Control Protocol (TCP), which translates as Transmission Control Protocol

TCP as a connection-oriented, reliable, byte stream based transport layer communication protocol

Next, let’s look at TCP based on this Baidu Encyclopedia explanation

First of all, what is connection-oriented?

Since there is connected communication, there is no connected communication. Connection-oriented communication means that the two parties of communication need to establish a communication line in advance and then communicate.

What is reliable

The first thing we need to know is that the Internet is unreliable because there are bandwidth and latency and so on and TCP can dynamically adapt to those characteristics to create a reliable channel protocol so how can it be reliable? Firstly, when establishing the connection, the reliability of the communication channel is guaranteed by the three-way handshake. Secondly, the reliability transmission is realized by the mechanism of checksum, serial number, confirmation reply, retransmission control, connection management and window control

What is the transport layer

Here we have to learn about network layering, the standard system for interconnecting computers or communication systems. The ISO model of OSI seven layers, each layer of which corresponds to a different network protocol, so many protocols make up the rules for how we communicate. So we call these network protocols the TCP/IP protocol family (see the importance of TCP/IP) but there is no network protocol stack that is completely based on the OSI model so we use the TCP/IP four-tier conceptual model to describe how the Internet is interconnected, right

So what kind of data is being encapsulated each time?
Application layer:

Network layer: IP protocol, what is the format of the packet you can see that the packet contains the source IP address and the destination IP address so IP protocol helps us find the correct destination IP address

The transport layer
Distinguish which process the packet belongs to

Differences between TCP and UDP

When it comes to TCP, UDP is inevitable. Let’s talk about the difference between the two

describe TCP UDP
Whether connection connection-oriented There is no connection
Transmission reliability reliable unreliable
applications A small amount of data A large amount of data
speed slow fast

Conclusion:

TCP is a connection-oriented, reliable, byte stream based transport layer communication protocol that sends data only when the peer is confirmed to exist, thus controlling the waste of communication traffic.

After analyzing TCP in this section, the next section looks at TCP’s three-way handshake and four-way wave