Search This Blog

Thursday, September 3, 2009

TCP/IP, Sequence and Acknowledge Number

Usually: (not initially)
the expected acknowledge number = current sequence number + data length
the current sequence number = the previous acknowledge number

For example, in TCP,
data length = total size of the ip datagram (you can check it in the ip header) - 20 (ip header length) - 32 (tcp header length)

This way, when you get the next ack number, you know if the other side gets all the data or not. (or something else is wrong like packages are out of order, etc...)

Very good tutorial:

No comments: