Subject: TCP/RFC 1323 bug
To: None <tech-net@netbsd.org>
From: Mark Allman <mallman@grc.nasa.gov>
List: tech-net
Date: 08/05/1999 14:10:03
 
Folks-

I have been hacking at NetBSD 1.3.3 TCP code looking for a bug in
some custom code we are playing with and stubbled across a bug in
the standard NetBSD code.  I just grabbed the -current version of
netinet/tcp_input.c and found the bug there, as well.

The problem occurs when the timestamp option (RFC 1323) is used for
RTT measurement.  RFC 1323 says that if the echoed timestamp is zero
it is invalid.  However, the NetBSD code does not check for this
condition.  This can lead to a big, bogus RTT.  Which, in turn,
yields a big, bogus RTO.  Which, in turn, leads to a big, bogus
reduction in performance.  My suggested fix is to change the if
statement at lines 1103 and 1651 of tcp_input.c (-current version
grabbed today) from:

		if (opti.ts_present)

to something like:

    		if (opti.ts_present && opti.ts_ecr)

to ensure that the timestamp is valid before using it to compute a
new RTO.  That seems to have cured my particular problem and seems
like it should be used in the general case, as well (at least thats
my reading of the RFC!).

allman


---
http://roland.grc.nasa.gov/~mallman/