Roam
Roam

Reputation: 4949

TCP -- coinciding sequence numbers in multiple TCP connections

In TCP, Initial Sequence Numbers are set on a clock and are incremented every 4 microseconds.

Suppose (IP#1, port#1) and (IP#2, port#2) set up a TCP connection and with the respective Initial Sequence Number-s as ISN1=100, ISN2=500.

A millisecond after, (IP#1, port#1) and (IP#2, port#2) are setting up another TCP connection with the applying ISN numbers. In this case, the sequence numbers of the first and the second connections are likely to coincide.

How does TCP handle this? It can reset and thus re-synchronize a connection under certain circumstances along the way when the sequence numbers are odd (not synchronizing), but this may not cover every case.

How are the sequence numbers handled in such a case when these numbers of 2 different TCP connections may interfere with those of one another?

TIA.

Upvotes: 0

Views: 274

Answers (1)

Andy Brown
Andy Brown

Reputation: 12999

Each TCP connection is identified by a tuple of [ local address, remote address, local port, remote port]. The sequence number is part of the state associated with that key therefore it doesn't matter at all if sequence numbers overlap.

Your particular example is impossible. You cannot setup two different TCP connections with identical local and remote addresses and ports.

Upvotes: 1

Related Questions