FIN + RST behavior

Subodh Iyengar <subodh@fb.com> Wed, 22 March 2017 22:37 UTC

Return-Path: <prvs=4254d9279a=subodh@fb.com>
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 104E0127342 for <quic@ietfa.amsl.com>; Wed, 22 Mar 2017 15:37:08 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.72
X-Spam-Level:
X-Spam-Status: No, score=-2.72 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=fb.com header.b=FY9CezJq; dkim=pass (1024-bit key) header.d=fb.onmicrosoft.com header.b=BcKmaNz/
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 MTSbE2UCVgwa for <quic@ietfa.amsl.com>; Wed, 22 Mar 2017 15:37:06 -0700 (PDT)
Received: from mx0b-00082601.pphosted.com (mx0b-00082601.pphosted.com [67.231.153.30]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 7B5E912709D for <quic@ietf.org>; Wed, 22 Mar 2017 15:37:06 -0700 (PDT)
Received: from pps.filterd (m0109331.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v2MMDjrG000585 for <quic@ietf.org>; Wed, 22 Mar 2017 15:37:05 -0700
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.com; h=from : to : subject : date : message-id : content-type : mime-version; s=facebook; bh=WEdW03UhNQYVrBgSguUNRI09VZZyauctET4hkMEYahs=; b=FY9CezJqIR0LLE1dF8HfEKWYp2EK3UvaLVioDbcE1wWEO9ZYTGOOlRMOlFgcR2c3OOeK 5lO/CX6qbUlWWXOijfazW5oCza2ERFAaZkQnDBMOoDldILYxMOuUgiZI8w8yGFyMlfea CW1lcG1tuFSFGoLqaWUJk/g1+k848WTTsVU=
Received: from mail.thefacebook.com ([199.201.64.23]) by mx0a-00082601.pphosted.com with ESMTP id 29bnhq3r6p-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT) for <quic@ietf.org>; Wed, 22 Mar 2017 15:37:05 -0700
Received: from NAM03-BY2-obe.outbound.protection.outlook.com (192.168.54.28) by o365-in.thefacebook.com (192.168.16.13) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 22 Mar 2017 15:37:04 -0700
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.onmicrosoft.com; s=selector1-fb-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=WEdW03UhNQYVrBgSguUNRI09VZZyauctET4hkMEYahs=; b=BcKmaNz/hn95tAiqJiRSkhlWRvt/pJ8akGkNdno/cTdeyRvMP+523M0zbFBoytUk2eRfC34I+QocSR+R+PU1IJ5k60NFfgwg5wZCi6AD6fCOpIAGxy4VdBS1VpxZHlYFFC15SROisuTLiUhRZBi+Y/f5a9XTs3jjfMJrnE1vbKw=
Received: from MWHPR15MB1455.namprd15.prod.outlook.com (10.173.234.145) by MWHPR15MB1454.namprd15.prod.outlook.com (10.173.234.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.977.11; Wed, 22 Mar 2017 22:37:02 +0000
Received: from MWHPR15MB1455.namprd15.prod.outlook.com ([10.173.234.145]) by MWHPR15MB1455.namprd15.prod.outlook.com ([10.173.234.145]) with mapi id 15.01.0977.020; Wed, 22 Mar 2017 22:37:02 +0000
From: Subodh Iyengar <subodh@fb.com>
To: "quic@ietf.org" <quic@ietf.org>
Subject: FIN + RST behavior
Thread-Topic: FIN + RST behavior
Thread-Index: AQHSo1zPcZTZN/tlZkuJR+NHZURtjA==
Date: Wed, 22 Mar 2017 22:37:02 +0000
Message-ID: <MWHPR15MB1455B5E6D4F4FAC8411927E4B63C0@MWHPR15MB1455.namprd15.prod.outlook.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
authentication-results: ietf.org; dkim=none (message not signed) header.d=none;ietf.org; dmarc=none action=none header.from=fb.com;
x-originating-ip: [2620:10d:c090:180::1:16c7]
x-microsoft-exchange-diagnostics: 1; MWHPR15MB1454; 7:2/H+uF5+WFFBE1/arRKxgSi+MzbruAKPyNo3ObLxjQgDjSb+nVancoAhtshj+6cYXzWgJ1TLxmRUbnc0NYKST7dBu/EWJ3uxg6pI4SnQ/hgOrpUq7y2NU+O6VCSRLGsxFBmPmyV1vK4nbMvsgZ7HhiOrt8AidS3LJ3Dhdnl+TJ42kA8GfYmOQ52Zkfj7s/7rw84tl2pghAo+yVMQWgJ5FqoWyS2LpwkU48H8WaT4AoMPADzs0HjCw2uuhE/i6cKlFBRScTQZ4BKB4hIJWDMsYKYEOZoOr/DXUjTOEWHCp27eLipiMJ4hnxyaymLA6bE8rHNeiNeH5EArRHNw/2372Q==; 20:igv2V2KaewPZ5vinh9f9EFqfQdKKqp9MmfTSUOM/d5JDTfglvtHCGAtMD/gcZPCsDtqh6aY2tOTc2AgN7wTOZdmo+RFeSJ9skJFj4W7mCp1SV4nLZQETcbDtbrBNflwesO/FmjM59/rBW0csr2C6PLujrJJrGaBQYpUjYnDUIwc=
x-ms-office365-filtering-correlation-id: 781f7a58-134f-46d0-50a2-08d47173f609
x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254075); SRVR:MWHPR15MB1454;
x-microsoft-antispam-prvs: <MWHPR15MB1454C8098C7801C1016319DBB63C0@MWHPR15MB1454.namprd15.prod.outlook.com>
x-exchange-antispam-report-test: UriScan:(158342451672863);
x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001)(6041248)(20161123562025)(20161123560025)(20161123558025)(20161123564025)(20161123555025)(6072148)(6042181); SRVR:MWHPR15MB1454; BCL:0; PCL:0; RULEID:; SRVR:MWHPR15MB1454;
x-forefront-prvs: 02543CD7CD
x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(6009001)(2351001)(122556002)(19627405001)(74316002)(7736002)(1730700003)(110136004)(8676002)(38730400002)(2900100001)(81166006)(189998001)(6606003)(86362001)(8936002)(3280700002)(6916009)(7696004)(33656002)(5660300001)(9686003)(50986999)(54896002)(2906002)(5640700003)(6436002)(102836003)(2501003)(77096006)(6506006)(99286003)(25786009)(53936002)(55016002)(54356999)(3660700001)(6116002); DIR:OUT; SFP:1102; SCL:1; SRVR:MWHPR15MB1454; H:MWHPR15MB1455.namprd15.prod.outlook.com; FPR:; SPF:None; MLV:sfv; LANG:en;
spamdiagnosticoutput: 1:99
spamdiagnosticmetadata: NSPM
Content-Type: multipart/alternative; boundary="_000_MWHPR15MB1455B5E6D4F4FAC8411927E4B63C0MWHPR15MB1455namp_"
MIME-Version: 1.0
X-MS-Exchange-CrossTenant-originalarrivaltime: 22 Mar 2017 22:37:02.6413 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 8ae927fe-1255-47a7-a2af-5f3a069daaa2
X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR15MB1454
X-OriginatorOrg: fb.com
X-Proofpoint-Spam-Reason: safe
X-FB-Internal: Safe
X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-03-22_19:, , signatures=0
Archived-At: <https://mailarchive.ietf.org/arch/msg/quic/AMRwl5gn9LImIetl3TXkuNZG6TY>
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: Wed, 22 Mar 2017 22:37:08 -0000

There might be some strange cases around RSTs and FINs which I would love more clarity on.

Let's say that the following actions happen:
1) Client initiates a stream to the server and sends some data
2) Server sends a FIN to the client which the client receives. The client and server are both half closed (remote and local respectively).
3) After some time the client sends a FIN to the server. So it's waiting for the FIN and the ack of all the data before closing the stream.
4) Server sends a RST which races with the client sending the FIN.
5) Client gets a RST

>From the draft I think it's ambiguous on what the client is supposed to do

"An endpoint that receives a RST_STREAM frame (and which has not sent a FIN or a RST_STREAM) MUST immediately respond with a RST_STREAM frame, and MUST NOT send any more data on the stream"

So clearly a client should not send a RST stream in response

However:
"When an endpoint sends a RST_STREAM frame, data outstanding on that stream SHOULD NOT be retransmitted, since subsequent data on this stream is expected to not be delivered by the receiver."

If the client decides to honor both of these requirements I believe it will not retransmit the FIN. So if the FIN gets lost the client will have no idea whether the server has seen the FIN and reduced its
number of streams counting towards the concurrency limit so that the client can open up a new stream. It would need to track the ACK of the ACK of the RST stream that the server sends back.

Am I missing another requirement that prevents this from being an issue or could "not sent a FIN" mean that "not sent a FIN that has been ACKed".

Subodh