Subject: Calculations of ISN for new TCP sessions

From: Satish Mynam <[email-masked]>
Date: Fri, 15 Sep 2000 17:17:17 -0700 (PDT)

Hi,

I was just wondering about many of the TCP implementations are using
a random number generator for the Initial Sequence Number(ISN)
generation for the new TCP connections.  Most of the implementations
(in the past) have been using the clock value in micro seconds to
generate the ISN.  I was looking at the NetBSD code at which was using
a random number generator function random() to generate the ISN.  Some
older implementations are still using the clock() value.

Does any of the RFCs specify which is the correct method to use for
ISN? I was going through some RFC but have'nt found much on this
subject.

Personally I feel, random number generation of the ISN is better (if
we choose a better random number generator) as it will be difficult to
predict the sequence numbers of the new TCP sessions.  This prevents
any intruder attacks (who is guessing the sequence number) difficult
to take over the TCP session(in case of ISN attacks).

Any comments?

Thank You,
Satish

---

From: Alan Cox <[email-masked]>
Date: Sat, 16 Sep 2000 09:58:01 +0100 (BST)

> ISN? I was going through some RFC but have'nt found much on this

RFC793 says it has to be a clock of some sort. RFC1122 allows the BSD
shortened time wait hack which pretty much needs a clock

> to take over the TCP session(in case of ISN attacks).

Its possible to construct an ip address dependant clock for each target

---

From: N Srikanth <[email-masked]>
Date: Mon, 18 Sep 2000 09:33:22 -0800

> ISN? I was going through some RFC but have'nt found much on this

RFC 793 specifies that the ISN should be viewed as a 32-bit counter that
increments by one every 4 microseconds.