Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does a SYN or FIN bit in a TCP segment consume a byte in the sequence number space?

I am trying to understand the rationale behind such a design. I skimmed through a few RFCs but did not find anything obvious.

like image 391
sigjuice Avatar asked Feb 28 '10 20:02

sigjuice


People also ask

What is the purpose of sequence number in TCP segment?

The sequence number is a counter used to keep track of every byte sent outward by a host. If a TCP packet contains 1400 bytes of data, then the sequence number will be increased by 1400 after the packet is transmitted. At offset 64 is the acknowledgement number.

How many bytes is a TCP SYN packet?

In real world testing, it was observed that the first SYN-ACK will be 72 bytes, but the following 5-6 retransmission attempts will omit this TCP option and result in a 60 byte packet.

What does SYN mean in TCP?

Short for synchronize, SYN is a TCP packet sent to another computer requesting that a connection be established between them. If the SYN is received by the second machine, an SYN/ACK is sent back to the address requested by the SYN. Lastly, if the original computer receives the SYN/ACK, a final ACK is sent.

How many bytes are in a TCP segment?

A TCP segment consists of data bytes to be sent and a header that is added to the data by TCP as shown: The header of a TCP segment can range from 20-60 bytes. 40 bytes are for options. If there are no options, a header is 20 bytes else it can be of upmost 60 bytes.


1 Answers

It's not particularly subtle - it's so that the SYN and FIN bits themselves can be acknowledged (and therefore re-sent if they're lost).

For example, if the connection is closed without sending any more data, then if the FIN did not consume a sequence number the closing end couldn't tell the difference between an ACK for the FIN, and an ACK for the data that was sent prior to the FIN.

like image 123
caf Avatar answered Sep 28 '22 03:09

caf