Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 16 Sep 2010 12:44:19 +0200
From:      Andre Oppermann <andre@freebsd.org>
To:        John Baldwin <jhb@freebsd.org>
Cc:        svn-src-head@freebsd.org, Lawrence Stewart <lstewart@freebsd.org>, svn-src-all@freebsd.org, src-committers@freebsd.org
Subject:   Re: svn commit: r212653 - head/sys/netinet
Message-ID:  <4C91F503.4000303@freebsd.org>
In-Reply-To: <201009151212.52337.jhb@freebsd.org>
References:  <201009151039.o8FAdU4H030416@svn.freebsd.org> <4C90B326.4000208@freebsd.org> <4C90D27D.4070306@freebsd.org> <201009151212.52337.jhb@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On 15.09.2010 18:12, John Baldwin wrote:
> On Wednesday, September 15, 2010 10:04:45 am Andre Oppermann wrote:
>> Below is the wording proposed by Lawrence:
>> /*
>>    * The default Maximum Segment Size (MSS) to use when we do not have specific
>>    * knowledge (e.g. via path MTU discovery) that the destination host is prepared
>>    * to accept larger datagrams. The smallest allowable IP datagram MTU and
>>    * optionless IP/TCP header lengths are used for the calculation as per RFC879.
>>    * For IPv4 (RFC791): 576 - 20 - 20 = 536.
>>    * For IPv6 (RFC2460): 1280 - 40 - 20 = 1220.
>>    */
>> #define	TCP_MSS		536
>> #define	TCP6_MSS	1220
>
> I think the existing text is fine for this comment, with one nit:
>
>   * For IPv4 the MSS is 576 - sizeof(struct tcpiphdr)
>
> I would find it clearer if it was 'sizeof(struct ip) - sizeof(struct tcphdr)'
> instead.

I chose 'sizeof(struct tcpiphdr)' for consistency with other parts of
the TCP code where the MSS is calculated this way.  'struct tcpiphdr' predates
IPv6 and is commonly used in the BSD kernel code.

>>    * Limit the lowest MSS we accept for path MTU discovery and the TCP SYN MSS
>>    * option. Allowing low values of MSS can consume significant resources and be
>>    * used to mount a resource exhaustion attack. Connections requesting lower MSS
>>    * values will be rounded up to this value and the IP_DF flag will be cleared to
>>    * allow fragmentation along the path.
>>    *
>>    * See tcp_subr.c tcp_minmss SYSCTL declaration for more comments. Setting this
>>    * SYSCTL to "0" disables the minmss check.
>>    *
>>    * The default value is fine for TCP over IPv4 across the Internet's smallest
>>    * known link MTU (256 bytes for AX.25 packet radio). However, a connection is
>>    * very unlikely to come across such low MTU interfaces (anno domini 2003).
>>    */
>> #define	TCP_MINMSS 216
>
> I actually prefer the above text for this block.  The 'amounts of resources'
> phrase is certainly redundant and just 'resources' is clearer.

OK.  I'll update the comment with a small change to the third paragraph.

-- 
Andre



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4C91F503.4000303>