Re: [tcpm] Possible deadlock scenario with retransmission on both sides at the same time

Yoshifumi Nishida <nishida@sfc.wide.ad.jp> Sun, 21 August 2016 17:25 UTC

Return-Path: <nishida@sfc.wide.ad.jp>
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 1DB3F12D13E for <tcpm@ietfa.amsl.com>; Sun, 21 Aug 2016 10:25:11 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.448
X-Spam-Level:
X-Spam-Status: No, score=-2.448 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, HTML_MESSAGE=0.001, 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 iC24ztKN_3Fn for <tcpm@ietfa.amsl.com>; Sun, 21 Aug 2016 10:25:09 -0700 (PDT)
Received: from mail.sfc.wide.ad.jp (shonan.sfc.wide.ad.jp [IPv6:2001:200:0:8803::53]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 397E912D08C for <tcpm@ietf.org>; Sun, 21 Aug 2016 10:25:08 -0700 (PDT)
Received: from mail-ua0-f172.google.com (mail-ua0-f172.google.com [209.85.217.172]) by mail.sfc.wide.ad.jp (Postfix) with ESMTPSA id C84512783D3 for <tcpm@ietf.org>; Mon, 22 Aug 2016 02:25:06 +0900 (JST)
Received: by mail-ua0-f172.google.com with SMTP id 74so154654049uau.0 for <tcpm@ietf.org>; Sun, 21 Aug 2016 10:25:06 -0700 (PDT)
X-Gm-Message-State: AEkoouv0V4uFJhWZ3OrP9jPUASxKvW01d5l6y7zoIpIWB05jMN4EoalrmYMXnio9Pqc9epZ3+3jJt+xayt50XA==
X-Received: by 10.176.80.19 with SMTP id b19mr9423371uaa.11.1471800305308; Sun, 21 Aug 2016 10:25:05 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.159.37.1 with HTTP; Sun, 21 Aug 2016 10:25:04 -0700 (PDT)
In-Reply-To: <CADVnQymeyst9De4F8Zqc6wGfLEdzmGsypSC-ZKZ7bXT6PO=J4g@mail.gmail.com>
References: <MWHPR11MB1374A50BC599B093EA09668984070@MWHPR11MB1374.namprd11.prod.outlook.com> <7070553C-65D1-46EE-95F4-DAE82E1F5A5E@weston.borman.com> <CY4PR11MB187848FCCEF4DB140F85913E841A0@CY4PR11MB1878.namprd11.prod.outlook.com> <2D524A8D-A5CA-45A6-B94D-FA1DA0CEE609@weston.borman.com> <CY4PR11MB1878E7E911194A1032E32428841E0@CY4PR11MB1878.namprd11.prod.outlook.com> <CAO249yeTNRFuFcWn5ga854g24GM_7DAjeKOSw3d7h=HQQYKX1Q@mail.gmail.com> <CADVnQymeyst9De4F8Zqc6wGfLEdzmGsypSC-ZKZ7bXT6PO=J4g@mail.gmail.com>
From: Yoshifumi Nishida <nishida@sfc.wide.ad.jp>
Date: Sun, 21 Aug 2016 10:25:04 -0700
X-Gmail-Original-Message-ID: <CAO249yeeEo3B9H3SyGqA8aiWOWjoHYji=JXEh1GHOHSsf+RszA@mail.gmail.com>
Message-ID: <CAO249yeeEo3B9H3SyGqA8aiWOWjoHYji=JXEh1GHOHSsf+RszA@mail.gmail.com>
To: Neal Cardwell <ncardwell@google.com>
Content-Type: multipart/alternative; boundary="94eb2c18f87860de54053a9836e4"
Archived-At: <https://mailarchive.ietf.org/arch/msg/tcpm/rLF03NeLN3-aPnrm1_0P6WPQ2Rk>
Cc: Kobby Carmona <kobby.Carmona@qlogic.com>, "tcpm@ietf.org" <tcpm@ietf.org>, David Borman <dab@weston.borman.com>
Subject: Re: [tcpm] Possible deadlock scenario with retransmission on both sides at the same time
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: Sun, 21 Aug 2016 17:25:11 -0000

Hi Neal,

Thanks for the info.
So, it seems to me that the linux code has the issue Kobby pointed out.
Or, am I missing something?
--
Yoshi


On Mon, Aug 15, 2016 at 6:18 PM, Neal Cardwell <ncardwell@google.com> wrote:

> On Mon, Aug 15, 2016 at 6:39 PM, Yoshifumi Nishida
> <nishida@sfc.wide.ad.jp> wrote:
> > Hello,
> > I personally think this is an interesting corner case for discussion.
> > It looks a minor one, but I'm not not very sure if we can leave it for
> each
> > implementation.
> > I also guess a question would be if the BSD's fix is the best way for the
> > issue.
>
> Yes, I agree this is an interesting case for discussion.
>
> FWIW, as a point of comparison for discussion, Linux's approach is a
> little different: in Linux, the sender does not rewind SND.NXT on
> retransmissions (RTO or Fast Recovery). Then the sender usually uses
> SND.NXT for the seq field of outgoing pure ACKs. I say "usually"
> because the Linux code has some code to deal with the case where the
> receiver has withdrawn the receive window, so that SND.NXT is now
> beyond the receive window. The code tcp_send_ack() uses to pick a seq
> for outgoing pure ACKs looks like:
>
> /* SND.NXT, if window was not shrunk.
>  * If window has been shrunk, what should we make? It is not clear at
> all.
>  * Using SND.UNA we will fail to open window, SND.NXT is out of
> window. :-(
>  * Anything in between SND.UNA...SND.UNA+SND.WND also can be already
>  * invalid. OK, let's make this for now:
>  */
> static inline __u32 tcp_acceptable_seq(const struct sock *sk)
> {
>         const struct tcp_sock *tp = tcp_sk(sk);
>
>         if (!before(tcp_wnd_end(tp), tp->snd_nxt))
>                 return tp->snd_nxt;
>         else
>                 return tcp_wnd_end(tp);
> }
>
> neal
>