6.2 C
New York
Tuesday, February 25, 2025

Why do not tcp sequence quantity begin from 0?


RFC 793 states (emphasis mine):

Preliminary Sequence Quantity Choice

The protocol locations no restriction on a specific connection being
used time and again
. A connection is outlined by a pair of
sockets. New situations of a connection will probably be known as
incarnations of the connection. The issue that arises from that is
— “how does the TCP establish duplicate segments from earlier incarnations of the connection?” This downside turns into obvious if the
connection is being opened and closed in fast succession
, or if the
connection breaks with lack of reminiscence and is then reestablished.

To keep away from confusion we should forestall segments from one incarnation of
a connection from getting used whereas the identical sequence numbers could
nonetheless be current within the community from an earlier incarnation
. We
wish to guarantee this, even when a TCP crashes and loses all information
of the sequence numbers it has been utilizing. When new connections are
created, an preliminary sequence quantity (ISN) generator is employed
which selects a new 32 bit ISN. The generator is sure to a
(presumably fictitious) 32 bit clock whose low order bit is
incremented roughly each 4 microseconds. Thus, the ISN cycles
roughly each 4.55 hours. Since we assume that segments will
keep within the community not more than the Most Phase Lifetime (MSL)
and that the MSL is lower than 4.55 hours we are able to moderately assume
that ISN’s will probably be distinctive.

For every connection there’s a ship sequence quantity and a obtain
sequence quantity. The preliminary ship sequence quantity (ISS) is chosen by
the info sending TCP, and the preliminary obtain sequence quantity (IRS) is
discovered through the connection establishing process.

For a connection to be established or initialized, the 2 TCPs should
synchronize on one another’s preliminary sequence numbers. That is carried out in
an trade of connection establishing segments carrying a management bit
known as “SYN” (for synchronize) and the preliminary sequence numbers. As a
shorthand, segments carrying the SYN bit are additionally known as “SYNs”.
Therefore, the answer requires an appropriate mechanism for selecting an
preliminary sequence quantity and a barely concerned handshake to trade
the ISN’s.

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles