Ask Your Question

Revision history [back]

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.