Overview of TCP Reliability Transmission
When discussing TCP reliability transmission, what exactly does it entail? How does the protocol guarantee consistent and stable data flow across a network? The process relies on effective mechanisms built around sequence and acknowledgment numbers in the TCP header. These elements work together to manage communication, maintain data integrity, and close any potential gaps during transmission, ensuring a robust and reliable network experience.

That is, the communication between and Sequence Number, Acknowledgment Numberit is not a request corresponding to a response, in order to speed up the transmission efficiency (because one round trip is one ah), the communication mechanism allows multiple data packets to be sent at a time, and then multiple sent packets can correspond to one response packet, which is the so-called packet.TCPHTTPRTTTCPACK
So TCPhow do we ensure that the sent data is received? It depends on ackthe fields in the data packet returned by the receiver.
For example ack=1000, the receiver tells the sender: Hey, man, you just sent a lot of data. I tell you, 1000I have received all the data before byte , and I will 1000start from byte next time.
seqThat ack‘s how important sum is. Let’s learn TCPwhat quantitative relationships there may be between them at different stages of communication.
Understanding Sequence and Acknowledgment in TCP Headers
TCP Reliability During the Three-Way Handshake
During the three-way handshake and four-way handshake, there is no application layer data, that is, the payload is 0.
However, the flags in the three-way handshake SYNand the four-wave handshake FINflags are counted as: the payload is 1, that is, in fact Len=1.
Seeing is believing, take the three-way handshake as an example:

Let’s look at 30the number package: seq=0, the payload TCP Lenis also 0, but 31what does the number package say?
31The number packet ACK=1is like the data 30sent by the number packet 1 byte.
But 30I didn’t bring the bag.

1. TCP LenExplicit0
2. IPThe explicit length of the packet is 60. Length = IP Header + TCP Header + TCP Len, which TCP Headerincludes the fixed part and Optionthe part. The fixed part is 20bytes, Optionsthe part is 20bytes, and IP Headerthe part is 20bytes. Adding them together, we can get TCP Len = 0.
32The number package seq=1has confirmed SYNthis mark value 1 byte.
clientThe end SYNmark occupies 1 byte, and similarly, the serverend SYNmark also occupies 1 byte.
How do you know? Let’s look at 32the number package:

32Number package ACK=1!
Regarding this point, the following is said Stevensin the book :TCP/IP Illustrated,Volume 1
The sequence number of the first byte of data sent on this direction of the connection is the ISN plus 1 because the
SYN bit field
consumes one sequence number.As we shall see later, consuming a sequence number also implies reliable delivery using retransmission. Thus, SYNs and application bytes (and FINs, which we will see later) are reliably delivered. ACKs, which do not consume sequence numbers, are not.
Let’s take a look at the real network packets~
Data Transmission and Acknowledgment Mechanisms Explained
In the normal communication process, the other end Ack= the senderSeq+Len

This is a simple HTTP GETrequest.
We look at 33the number packet, which clientsends GETa request, and its seq=1payload TCP Len=106. The next data packet seqshould start from seq+tcp len = 107the beginning.
How do we know this? Please look at 34the packet, serverwhich indicates clientthat it has received the request sent by the packet, and 33it has confirmed it ack=107. As mentioned at the beginning, this is TCPthe essence of reliability.
Then, 36the packet clientwas sent again, and it seqturned out to be 107…bingo
TCP Keep-Alive: Ensuring Reliable Transmission
Sending end seqturtle method

If you observe carefully, you TCPwill find that the packets in the keep-alive mechanism will have a kind of seqfallback phenomenon .
25Number package
seq=1539, nextSeq=1578, indicating that the next packet seqshould be initiated from 1578the beginning.
But it didn’t!
27Number Package –keep-alive
seqIt turns out that there is one less 1577than at the beginning . Why is that?1578byte
Looking back, it turns out that 27the number package is TCP Keep-Alivea package, and seqrollback will occur.
28Number Package –keep-alive ack
As 27a response packet of the number packet, it is ack=1578. If it is followed by normal data transmission, the sender seqshould indeed seq=1578start transmission. But if the sender is still a keep-alive packet, that is keep-alive, seqit will still start from 1578-1=1577the beginning. If you don’t believe it, just look at 29the number packet!
Application Layer vs. TCP Keep-Alive Mechanisms
In essence, the application layer performs data transmission.

The above network packets represent the keep-alive mechanism implemented by the application layer itself. The request and response in the keep-alive packet carry 1 bytedata respectively, which can be seen from the figure TCP Payload Length.
So compared to TCPits own survival mechanism, there is nothing strange here.
Taking 250the number package as an example, seq=6190, len=1, then the confirmation 250number package ackshould be seq+len=6191.
Checking the fields 251in the number package ack, I found that it was indeed the case!
For us, this TCPis just an ordinary data transmission process.
Summary of TCP Reliability Transmission Techniques
Let’s summarize:
- Three handshakes, four waves:Â
ack = seq+1(Â1referring toÂSYNandÂFINsymbolizing that they are important) - Data transmission:
ack = seq + len TCPHeartbeat keep-alive:Âkeep-aliveThe packetsÂseqmay fall back or decreaseÂ1,Âkeep-alive-ackwhichÂackis normal.- Heartbeat keep-alive at the application layer:Â
ack = seq + lenIt is just a special data transmission process.



