NetBSD Problem Report #55788

From  Thu Nov  5 14:41:45 2020
Return-Path: <>
Received: from ( [])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "", Issuer " CA" (not verified))
	by (Postfix) with ESMTPS id 12EA41A9246
	for <>; Thu,  5 Nov 2020 14:41:45 +0000 (UTC)
Message-Id: <>
Date: Thu,  5 Nov 2020 14:41:43 +0000 (UTC)
Subject: tcp(4): TCP_MAXSEG documentation is out of date
X-Send-Pr-Version: www-1.0

>Number:         55788
>Category:       misc
>Synopsis:       tcp(4): TCP_MAXSEG documentation is out of date
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    misc-bug-people
>State:          open
>Class:          doc-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Nov 05 14:45:00 +0000 2020
>Originator:     Valery Ushakov
>Release:        NetBSD-current as of 2020-11-05
tcp(4) says:

TCP_MAXSEG     By default, a sender- and receiver-TCP will negotiate
               among themselves to determine the maximum segment size
               to be used for each connection.  The TCP_MAXSEG option
               allows the user to determine the result of this
               negotiation, and to reduce it if desired.

However Stevens begins discussion of this option with:

  Some texts refer to this as a "negotiated" option. It is not
  negotiated in any way. When a connection is established, each end
  has the option of announcing the MSS it expects to receive.

and  RFC879:

  The MSS can be used completely independently in each direction of
  data flow.

That was fixed with this initial commit by thorpej@ (plus some

Fix several annoyances related to MSS handling in BSD TCP:
- Don't overload t_maxseg.  Previous behavior was to set it to the min
  of the peer's advertised MSS, our advertised MSS, and tcp_mssdflt
  (for non-local networks).  This breaks PMTU discovery running on
  either host.  Instead, remember the MSS we advertise, and use it
  as appropriate (in silly window avoidance).
- Per last bullet, split tcp_mss() into several functions for handling
  MSS (ours and peer's), and performing various tasks when a connection
  becomes ESTABLISHED.
- Introduce a new function, tcp_segsize(), which computes the max size
  for every segment transmitted in tcp_output().  This will eventually
  be used to hook in PMTU discovery.

sys/netinet/tcp_var.h - revision 1.23
date: 1997-09-23 01:50:04 +0400;  author: thorpej;  state: Exp;  lines: +12 -3;

sys/netinet/tcp_subr.c - revision 1.28
date: 1997-09-23 01:50:02 +0400;  author: thorpej;  state: Exp;  lines: +176 -1;

sys/netinet/tcp_input.c - revision 1.32
date: 1997-09-23 01:49:55 +0400;  author: thorpej;  state: Exp;  lines: +17 -166;

sys/netinet/tcp_output.c - revision 1.17
date: 1997-09-23 01:49:59 +0400;  author: thorpej;  state: Exp;  lines: +44 -14;

PS: Documentation for TCP_MAXSEG never calls "MSS" by its name, which
is much more widely known than the option name, making it harder to

man tcp, search for MAXSEG

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.46 2020/01/03 16:35:01 leot Exp $
$NetBSD:,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2020 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.