The sequence number field in a TCP header identifies the position of transmitted data in the byte stream. TCP uses it to reorder segments that arrive out of order and support reliable communication. section 22.2.1
Key points:
- Each host selects a random initial sequence number during connection establishment and increments it as it sends data. section 22.2.1
- The acknowledgment number identifies the next sequence number the receiver expects, rather than repeating the segment just received. section 22.2.1
- Missing acknowledgments can cause TCP to retransmit a segment, while multiple segments may be acknowledged together. section 22.2.1
Simple sequence and acknowledgment exchange
If PC1 sends a segment with sequence number 10 and SRV1 receives it, SRV1 replies with acknowledgment number 11, indicating that it expects sequence number 11 next. In the same example, SRV1’s segment using sequence number 50 is acknowledged by PC1 with number 51. section 22.2.1
Figure 22.4 The format of the TCP header. Like the IPv4 header, it is a minimum of 20 bytes in size but can be up to 60 bytes if Options are included.
Use the TCP-header diagram to locate the sequence number field among TCP’s control and reliability fields. section 22.2.1
