Subject: kern/14806: Trivial: Default TCP MSS is wrong (patch included)
To: None <>
From: None <>
List: netbsd-bugs
Date: 12/02/2001 00:28:33
	Note: There was a bad value `not-critical' for the field `>Severity:'.
	It was set to the default value of `serious'.

>Number:         14806
>Category:       kern
>Synopsis:       NetBSD uses the wrong default TCP MSS
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Dec 01 21:29:00 PST 2001
>Originator:     Rick Byers
>Release:        NetBSD 1.5Y
System: NetBSD 1.5Y NetBSD 1.5Y (RICK) #0: Fri Nov 30 23:44:58 EST 2001 i386
Architecture: i386
Machine: i386
	When a TCP connection is established and the peer doesn't 
	advertise an MSS, NetBSD uses 512.  This is in violation
	of RFC 1122 Sec which says "If an MSS option is not 
	received at connection setup, TCP MUST assume a default send MSS 
	of 536".

	Most (all?) TCP stacks today send an MSS option, but regardless
	this behaviour is wrong.  Even though using a smaller send
	MSS than advertised is OK, there doesn't appear to be any
	advantage to doing so.

	The code says that "512 may be more convenient".  This may be
	legacy code from when the VAX would use 512 byte segments 
	so that the data block could be mapped directly into memory.

	Send a TCP syn packet without an MSS option and watch to see
	what the maximum return segment size is.
This patch corrects the default TCP MSS to 536, as defined by 
RFC 1122.

Index: tcp.h
RCS file: /cvsroot/syssrc/sys/netinet/tcp.h,v
retrieving revision 1.13
diff -c -r1.13 tcp.h
*** tcp.h	2001/05/26 21:40:55	1.13
--- tcp.h	2001/12/02 05:16:32
*** 90,100 ****
   * Default maximum segment size for TCP.
!  * With an IP MSS of 576, this is 536,
!  * but 512 is probably more convenient.
!  * This should be defined as min(512, IP_MSS - sizeof (struct tcpiphdr)).
! #define	TCP_MSS		512
  #define	TCP_MAXWIN	65535	/* largest value for (unscaled) window */
--- 90,98 ----
   * Default maximum segment size for TCP.
!  * This is defined by RFC 1112 Sec
! #define	TCP_MSS		536
  #define	TCP_MAXWIN	65535	/* largest value for (unscaled) window */