Is the TCP sequence number just the ACK number + bytes received? Is it different when doing the 3-way handshake?


From TCP Connection Establishment Sequence Number Synchronization and Parameter Exchange :

Once each device has chosen its ISN, it sends this value to the other device in the Sequence Number field in its initial SYN message. The device receiving the SYN responds with an ACK message acknowledging the SYN (which may also contain its own SYN, as in step #2 of the three-way handshake). In the ACK message, the Acknowledgment Number field is set to the value of the ISN received from the other device plus one. This represents the next sequence number the device expects to receive from its peer; the ISN actually thus represents the sequence number of the last byte received (fictitious in this case, since the connection is new and nothing yet has been received).

  • It only adds 1 when handshaking, but not during data transfer? – Wintermute Mar 18 '11 at 5:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.