I
I
Ilya Kaznacheev2014-06-27 17:12:48
Computer networks
Ilya Kaznacheev, 2014-06-27 17:12:48

What is Sequence and Acknowledgment Number in TCP header?

RFC 793 states (translation):

Sequence Number: 32 bits
The sequence number of the first data octet in the segment if the SYN flag is not present. If the SYN bit is present in the segment, the number field contains the initial sequence number (ISN) value and the first data octet is ISN+1.
Acknowledgment Number - acknowledgment number: 32 bits
If the ACK bit is set, this field contains the value of the next sequence number that the sender of the segment expects to receive. After a connection is established, this value is always transmitted.

1. In the case of SYN, how is the first octet filled in? How to understand " the first octet of data has an ISN+1 number ". Just write down ISN+1, and then everything else?
2. In the case of a SYN-ACK, what is meant by the value of the next sequence number that the sender of the segment expects to receive ? How to calculate it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
J
jcmvbkbc, 2014-06-27
@Color

In the case of SYN, how is the first octet filled in? How to understand "the first octet of data has the number ISN+1". Just write down ISN+1, and then everything else?

No. The Sequence Number field contains the number corresponding to the first octet of the TCP segment. For the very first data octet, this will be ISN+1.
If you have successfully received all octets up to N, then you expect to receive N+1. So, for example, when you receive the first SYN and ISN along with it, you seem to have received everything up to and including this ISN, and now you are waiting for ISN+1, which is what the RFC says.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question