Subject: Re: TCP MSS not adhered to properly when options present
To: None <tech-net@netbsd.org>
From: Scott Barron <sb125499@oak.cats.ohiou.edu>
List: tech-net
Date: 11/30/2001 01:55:38
On Thu, Nov 29, 2001 at 01:10:58PM -0500, Rick Byers wrote:
> Hi,
>
> NetBSD doesn't appear to be handling the TCP MSS option properly.
> According to RFC 1122, the MSS sent by a host is the maximum IP packet
> size its willing to receive minus 40.  This correlates to the maximum
> tcp payload when no tcp or ip options are present.  However, NetBSD
> appears to use it as the maximum tcp payload even when options are
> present.
>

I am pretty much a novice when it comes to the networking code but the
way I understand it is the MSS options are exchanged when a connection
is created.  However the option length may not be constant during the
lifetime of the connection (a host that sends SACK blocks, something I'm
currently working on, is a good example of this).  So I see only two
things, set it to the size that is sent, which is what I think it
currently does (looking at tcp_input.c in 1.5.2) or set it to the size
advertised minus MAX_TCPOPTLEN and take and go for the "worst case" so
to speak.  Personally, I'm not sure which is a better idea and I don't
know how other systems handle it (I suspect the same way).  Maybe
somebody more experienced can chime in here (also please chime in if
I've gotten anything incorrect).


> I haven't had a chance to look into the source for either of theese
> problems, but I hope to have time this weekend if someone doesn't beat me
> to it.
>

The sent MSS is recorded in tcp_dooptions() in tcp_input.c (grep for
TCPOPT_MAXSEG, my file is too hacked up to give you a valid line
number), to give you a starting point.

Hopefully I've gotten what little information I can provide correct :)
-Scott