[tcpm] question about if a recent Linux patch is compliant with RFC7323 on window scaling

"Cui, Cheng" <Cheng.Cui@netapp.com> Wed, 24 August 2016 21:06 UTC

Return-Path: <Cheng.Cui@netapp.com>
X-Original-To: tcpm@ietfa.amsl.com
Delivered-To: tcpm@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 41EC412D66B; Wed, 24 Aug 2016 14:06:30 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -7.469
X-Spam-Level:
X-Spam-Status: No, score=-7.469 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-0.548, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 2FXrabv7sKiy; Wed, 24 Aug 2016 14:06:28 -0700 (PDT)
Received: from mx142.netapp.com (mx142.netapp.com [216.240.21.19]) (using TLSv1.2 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 7D8C212D124; Wed, 24 Aug 2016 14:06:27 -0700 (PDT)
X-IronPort-AV: E=Sophos;i="5.28,572,1464678000"; d="scan'208";a="133202750"
Received: from hioexcmbx07-prd.hq.netapp.com ([10.122.105.40]) by mx142-out.netapp.com with ESMTP; 24 Aug 2016 14:06:12 -0700
Received: from HIOEXCMBX03-PRD.hq.netapp.com (10.122.105.36) by hioexcmbx07-prd.hq.netapp.com (10.122.105.40) with Microsoft SMTP Server (TLS) id 15.0.1210.3; Wed, 24 Aug 2016 14:06:11 -0700
Received: from HIOEXCMBX03-PRD.hq.netapp.com ([::1]) by hioexcmbx03-prd.hq.netapp.com ([fe80::a009:cb7a:e519:7347%21]) with mapi id 15.00.1210.000; Wed, 24 Aug 2016 14:06:10 -0700
From: "Cui, Cheng" <Cheng.Cui@netapp.com>
To: "david.borman@windriver.com" <david.borman@windriver.com>, "dab@weston.borman.com" <dab@weston.borman.com>, "david.borman@quantum.com" <david.borman@quantum.com>
Thread-Topic: question about if a recent Linux patch is compliant with RFC7323 on window scaling
Thread-Index: AQHR/ktWq33ah5ClWE2yMFWt4EpCvg==
Date: Wed, 24 Aug 2016 21:06:09 +0000
Message-ID: <D3E38481.146B4%Cheng.Cui@netapp.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-ms-exchange-messagesentrepresentingtype: 1
x-ms-exchange-transport-fromentityheader: Hosted
x-originating-ip: [10.122.56.79]
Content-Type: text/plain; charset="iso-8859-1"
Content-ID: <E4C834FEAB095B4AB96A1C256A5AE15E@hq.netapp.com>
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
Archived-At: <https://mailarchive.ietf.org/arch/msg/tcpm/pPO7cYxtky27Qto9b30eaHB_RQI>
X-Mailman-Approved-At: Thu, 25 Aug 2016 08:34:57 -0700
Cc: "tcpm@ietf.org" <tcpm@ietf.org>, "tsvwg@ietf.org" <tsvwg@ietf.org>
Subject: [tcpm] question about if a recent Linux patch is compliant with RFC7323 on window scaling
X-BeenThere: tcpm@ietf.org
X-Mailman-Version: 2.1.17
Precedence: list
List-Id: TCP Maintenance and Minor Extensions Working Group <tcpm.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/tcpm>, <mailto:tcpm-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/tcpm/>
List-Post: <mailto:tcpm@ietf.org>
List-Help: <mailto:tcpm-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/tcpm>, <mailto:tcpm-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 24 Aug 2016 23:26:20 -0000

Hello David,

I hope this email could reach you well, because I found related
discussions about this topic on window scaling and the case of window
shrinking (or retraction or loss of precision). And I try to make this
question simple.

There is a recent Linux patch at receiver side to round-up advertised
window due to precision loss of window scaling. It reaches my attention
because the same problem could also happen between a pair of Linux and
FreeBSD nodes, and I am not aware of any similar patch in FreeBSD yet.

The Linux patch is this:
http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=6
07bfbf2d55dd1cfe5368b41c2a81a8c9ccf4723

And I quote some description of the Linux patch below:
> If the sender uses up the entire window before it is shrunk, this can
>have
> chaotic effects on the connection. When sending ACKs,
>tcp_acceptable_seq()
> will notice that the window has been shrunk since tcp_wnd_end() is before
> tp->snd_nxt, which makes it choose tcp_wnd_end() as sequence number.
> This will fail the receivers checks in tcp_sequence() however since it
> is before it's tp->rcv_wup, making it respond with a dupack.


If the Linux sender¹s behavior is right ("ACK-only packets should be sent
with the largest in-window sequence number that has ever been sent." ref:
https://www.ietf.org/mail-archive/web/tcpm/current/msg10512.html) it
actually chooses "tp->snd_una+tp->snd_wnd" (tcp_wnd_end()) instead of
tp->snd_nxt, as it thought tp->snd_nxt is out of window, in case of
precision loss which made the receiver¹s advertise-window smaller.
However, the RFC7323 explicitly specifies the receiver should right shift
the exact scale factor, without mentioning any further round-up:

https://tools.ietf.org/html/rfc7323#page-9
>    o  The window field (SEG.WND) of every outgoing segment, with the
>       exception of <SYN> segments, MUST be right-shifted by
>       Rcv.Wind.Shift bits:
> 
>                     SEG.WND = RCV.WND >> Rcv.Wind.Shift

And also if I am understanding correctly, RFC7323 page 10 (2.4. Addressing
Window Retraction) specifies it is the sender¹s responsibility to handle
the sequence number out of window:
https://tools.ietf.org/html/rfc7323#page-10
>    4)  On first retransmission, or if the sequence number is out of
>        window by less than 2^Rcv.Wind.Shift, then do normal
>        retransmission(s) without regard to the receiver window as long
>        as the original segment was in window when it was sent.
> 
>    5)  Subsequent retransmissions MAY only be sent if they are within
>        the window announced by the most recent <ACK>.

In your discussion of the link below, if I am understanding correctly, you
were also in favor of "Yes. It is ok to have more receive buffer space
available than you advertise in the window, but not ok to advertise a
larger window than you are willing to accept." So I think you were not in
favor of rounding-up the advertise-window.

https://www.ietf.org/mail-archive/web/tsvwg/current/msg06475.html


So my question is: Is the Linux patch (on receiver side to round-up the
advertise-window) RFC compliant? Or is it just the right thing (vendor
specific) and other systems like FreeBSD have to follow up, so that their
talks can have no problem?

Thanks and apologize in advance if I did not do enough research,
--Cheng Cui