Ask Your Question
0

TCP sequence numbers - beginners question

asked 2018-08-20 23:03:53 +0000

anepomn gravatar image

Apologies for the beginners question.

TCP basics (known to me :) ) - TCP sequence number is increasing for each byte of data send.

I have learned that SYN packet (len=0, no data are being send) also increases the sequence number. Is there a reason for that? I googled around for a good explanation or RFC document, but I can't find anything.

FIN appears to be the same way (also causes sequence number to go up by 1 although no data are being carried by the packet).

The best information I could find is here: http://packetlife.net/blog/2010/jun/7...

== quote == Notice that the acknowledgement number has been increased by 1 although no payload data has yet been sent by the client. This is because the presence of the SYN or FIN flag in a received packet triggers an increase of 1 in the sequence. (This does not interfere with the accounting of payload data, because packets with the SYN or FIN flag set do not carry a payload.) == end of quote ==

Thank you, Aleksandr

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2018-08-20 23:49:13 +0000

Jim Aragon gravatar image

I have learned that SYN packet (len=0, no data are being send) also increases the sequence number. Is there a reason for that? I googled around for a good explanation or RFC document, but I can't find anything.

It's done so that the TCP host sending the SYN or FIN can track that it was received. RFC 793 states, under "send sequence" in the Glossary, "This is the next sequence number the local (sending) TCP will use on the connection. It is initially selected from an initial sequence number curve (ISN) and is incremented for each octet of data or sequenced control transmitted.

The SYN bit and the FIN bit are both classified as control flags. So incrementing the sequence number allows the system to track both receipt of data and receipt of control messages.

edit flag offensive delete link more

Comments

Jim, Many thanks! This is a great explanation, makes sense.

Aleksandr

anepomn gravatar imageanepomn ( 2018-08-22 19:13:25 +0000 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2018-08-20 23:03:53 +0000

Seen: 1,594 times

Last updated: Aug 20 '18