Looking at the image below, taken from the book of Ilya Grigorik – High Performance Browser Networking, I can understand that the SYN packet picks a random sequence number which is incremented in SYN ACK packet (N+1). Finally, in the ACK packet both sequence (N+1) and acknowledge (N+1) numbers are incremented.
When testing with Wireshark I got the ACK packet to have Acknowledgment number = N+1 but the Sequence number = N. Is this a mistake by the author when he says that in ACK packet both Sequence and Acknowledgment numbers are incremented?
Best Answer
RFC 793 states repeatedly that the acknowledgement number is the sequence number of the next packet that end expects to receive. Thus it will always be higher than the sequence number.
For instance, in section 2.6:
In section 3.1:
Section 3.3 explains in detail how the sequence numbers work, and why they work the way they do. You will probably find it much more enlightening than your book.