Recently, when reviewing THE TCP connection, I had some questions, and finally decided to directly capture the packet for verification. The following is the whole process of verification:
- Question: After a TCP connection is established, is ACK =seq+1 or ACK =seq+data.length during TCP transmission?
If it is the first type, how to check the integrity of the single-pass data? Is it placed in the IP layer?Added: OSI network layering
If it is the second type, will the ACK code be repeated?
- Use Wireshark to capture and analyze packets
TCP three-way handshake Wireshark packet capture analysis
Last time the FIN data was discontinuous, but finally verified to be the same as left.
- Question: After a TCP connection is established, is ACK =seq+1 or ACK =seq+data.length during TCP transmission?
If it is the first type, how to check the integrity of the single-pass data? Is it placed in the IP layer? If it is the second type, will the ACK code be repeated?
- Through verification, it can be found that the second method is correct. In fact, the verification is determined by two sets of sequence codes, which are randomly generated and the possibility of repetition is very small
To understand the package structure, add knowledge:
TCP header information – see Wiki
Important status codes:
Sequence number: randomly generated Sequence number
A. This is the Acknowledgment number
SYN: Synchronize Indicates the synchronization head
PSH: Push represents the header of the Push data state
FIN: indicates the last transmission