Subject: Low TCP segment size by default on -current
To: None <>
From: Rick Byers <>
List: tech-net
Date: 12/06/2001 23:23:08
In tcp_segsize (tcp_output.c), there are 4 conditions for inet 4 which
cause a segment size greater than mss_dflt to be used.  They are:
- there is an mtu set on the route
- the interface is a loopback interface
- mtu discovery is enabled
- the destination address is local.

It seems that in NetBSD-current, the per-route MTU is left unset by
default.  This means that, out of the box, NetBSD allways uses a max of
512-byte TCP segments to remote hosts, even when the peer advertises a
higher MSS.  This seems horribly wastefull (9% of the datagram is used for
TCP/IP headers instead of 3% for 1500 byte packets).  So using the default
network settings, NetBSD will typically have lower TCP efficiency than
other OSes.

Interestingly enough, NetBSD 1.5.3_ALPHA seems to set the MTU on a route
to the MTU of the interface by default.  This is the same behaviour as
FreeBSD 4.4.  However, under -current (and apparently NetBSD-1.4), the
route mtu is left at 0 unless specified otherwise.

Is this a bug, or a feature?  I haven't had a chance to look at the
relevant code yet.  Was there a reason for changing the behaviour from
1.5.3 to -current?  If the routes should really default to mtu=0, then
couldn't tcp_segsize fall back to using the MTU on the interface if there
is no per-route mtu?