Re: Closing on CONNECTION_CLOSE

Willy Tarreau <w@1wt.eu> Thu, 27 July 2017 14:20 UTC

Return-Path: <w@1wt.eu>
X-Original-To: quic@ietfa.amsl.com
Delivered-To: quic@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 08EA0132038 for <quic@ietfa.amsl.com>; Thu, 27 Jul 2017 07:20:17 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.902
X-Spam-Level:
X-Spam-Status: No, score=-1.902 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_PASS=-0.001, 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 NW-mnCafqwhq for <quic@ietfa.amsl.com>; Thu, 27 Jul 2017 07:20:15 -0700 (PDT)
Received: from 1wt.eu (wtarreau.pck.nerim.net [62.212.114.60]) by ietfa.amsl.com (Postfix) with ESMTP id DCC97129B5B for <quic@ietf.org>; Thu, 27 Jul 2017 07:20:14 -0700 (PDT)
Received: (from willy@localhost) by pcw.home.local (8.15.2/8.15.2/Submit) id v6REK2OU003825; Thu, 27 Jul 2017 16:20:02 +0200
Date: Thu, 27 Jul 2017 16:20:02 +0200
From: Willy Tarreau <w@1wt.eu>
To: Subodh Iyengar <subodh@fb.com>
Cc: Christian Huitema <huitema@huitema.net>, "quic@ietf.org" <quic@ietf.org>
Subject: Re: Closing on CONNECTION_CLOSE
Message-ID: <20170727142002.GD3401@1wt.eu>
References: <CABcZeBP_Xh1QC9Qxhy5HYiMiTfknPs7Yp7+X_KnQE1O-juxJ5g@mail.gmail.com> <cb7caadd-73bd-6505-7a57-4b0271fb66d2@huitema.net> <MWHPR15MB14558B64A6166EB2C3E66F03B6BE0@MWHPR15MB1455.namprd15.prod.outlook.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: inline
In-Reply-To: <MWHPR15MB14558B64A6166EB2C3E66F03B6BE0@MWHPR15MB1455.namprd15.prod.outlook.com>
User-Agent: Mutt/1.6.1 (2016-04-27)
Archived-At: <https://mailarchive.ietf.org/arch/msg/quic/_WUv742h8wJ4ztdtkzil3wC6bJE>
X-BeenThere: quic@ietf.org
X-Mailman-Version: 2.1.22
Precedence: list
List-Id: Main mailing list of the IETF QUIC working group <quic.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/quic>, <mailto:quic-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/quic/>
List-Post: <mailto:quic@ietf.org>
List-Help: <mailto:quic-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/quic>, <mailto:quic-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 27 Jul 2017 14:20:17 -0000

On Thu, Jul 27, 2017 at 02:08:33PM +0000, Subodh Iyengar wrote:
> I favor the RST model as well.
> You'll end up having to keep a loss timeout even in the FIN model because
> of ACKs being lost / the remote side shutting for unrelated reasons / silently closing
> their connection.

I prefer the RST model as well in general, but it's important to keep in
mind that it doesn't apply perfectly everywhere. In TCP, when the receiver
is waiting for data and has nothing to say and the sender suddenly sends
an RST which is lost, the sender definitely closes and the receiver stays
open forever. This is even more visible through firewalls because if the
RST is lost between the firewall and the receiver, the firewall will quickly
close its session and any receiver's packets will then be blocked. The usual
case is when a client/proxy has to close an idle connection going to a server
and cannot use the regular FIN model for TIME_WAIT accumulation reasons. In
this case using massive RSTs occasionally exhibits zombie connections on the
server.

I don't think it would be an issue with QUIC since the use cases are very
dynamic connections where timeouts could be expected to be reasonably low
(ie no need to have multi-days timeouts there as is sometimes done with
SSH connections).

> As an aside on the topic of TIME_WAIT itself:
> 
> The reason I'm aware that TIME_WAIT exists in TCP is to protect us from the local port
> being re-bound to another connection and the data from the old connection interfering with
> the new connection. With QUIC this seems less of an issue though because a
> combination of (connection id + packet type + packet encryption) can be used to determine whether or
> not the packet was valid to be received in the context of a new connection. Going with the
> philosophy of dropping packets on the floor that are malformed that martin proposed during
> the last WG meeting, do we even need a TIME_WAIT state in QUIC?

Agreed, TIME_WAIT is a protection against fast reuse of a scarce resource
which could cause confusion (source ports, sequence numbers). If we have
no risk of accidently mixing up connections, better get rid of it.

Willy