Re: FIN + RST behavior

Subodh Iyengar <subodh@fb.com> Sun, 26 March 2017 20:27 UTC

Return-Path: <prvs=42588c5242=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 8909A127076 for <quic@ietfa.amsl.com>; Sun, 26 Mar 2017 13:27:30 -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=fToZ3vlq; dkim=pass (1024-bit key) header.d=fb.onmicrosoft.com header.b=dakZTqnN
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 THH_gX3pSLlq for <quic@ietfa.amsl.com>; Sun, 26 Mar 2017 13:27:28 -0700 (PDT)
Received: from mx0a-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 0D6B6127275 for <quic@ietf.org>; Sun, 26 Mar 2017 13:27:27 -0700 (PDT)
Received: from pps.filterd (m0001255.ppops.net [127.0.0.1]) by mx0b-00082601.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v2QKQww8030826; Sun, 26 Mar 2017 13:27:22 -0700
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : mime-version; s=facebook; bh=pZKGNi1IcaUVMhJrLXKke2rXFYdS2i0AErTZclT5AWw=; b=fToZ3vlqzwxpi5gx+yjbxXcFfHFcMevj90CnhrUOIur8JL40HVAY6qt1GO1m652qLAXl Jjebsn0Rr5ZZCUEQNvvQaSAHguBeUvMp1G1pyEBRWJUpqFxXz9xPciIJibYo22ux6bcg x6++YO5U6UqwmpZnDSQOTqiYLxKb6U4jhWg=
Received: from maileast.thefacebook.com ([199.201.65.23]) by mx0b-00082601.pphosted.com with ESMTP id 29dmc23cht-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Sun, 26 Mar 2017 13:27:22 -0700
Received: from NAM01-BY2-obe.outbound.protection.outlook.com (192.168.183.28) by o365-in.thefacebook.com (192.168.177.22) with Microsoft SMTP Server (TLS) id 14.3.319.2; Sun, 26 Mar 2017 16:27:21 -0400
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=pZKGNi1IcaUVMhJrLXKke2rXFYdS2i0AErTZclT5AWw=; b=dakZTqnNMqSmVd3jKjWK1RUxaTx99o1S5jWMTuIlk0jTERAzYYqsHaA7WBnigfRO8N6qiM/yTP7CdkAR9GjclV1t8o24zRZ+im6sK0yYkcRswedClrF0KcF3PZJ+gQLgJmC1a+XZJL1xpaauJlV+LUN3wyjNRof3k6SUIHqWfSo=
Received: from MWHPR15MB1455.namprd15.prod.outlook.com (10.173.234.145) by MWHPR15MB1455.namprd15.prod.outlook.com (10.173.234.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.991.14; Sun, 26 Mar 2017 20:27:19 +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.0991.018; Sun, 26 Mar 2017 20:27:19 +0000
From: Subodh Iyengar <subodh@fb.com>
To: "Lubashev, Igor" <ilubashe@akamai.com>, "martin.thomson@gmail.com" <martin.thomson@gmail.com>
CC: "quic@ietf.org" <quic@ietf.org>
Subject: Re: FIN + RST behavior
Thread-Topic: FIN + RST behavior
Thread-Index: AQHSo1zPcZTZN/tlZkuJR+NHZURtjKGhltKAgAAu7CCAAH4YAIAAZDLNgAAXgICAAAogc4ABK8iAgAOeKKc=
Date: Sun, 26 Mar 2017 20:27:19 +0000
Message-ID: <MWHPR15MB1455388350826978E960683DB6300@MWHPR15MB1455.namprd15.prod.outlook.com>
References: <MWHPR15MB1455B5E6D4F4FAC8411927E4B63C0@MWHPR15MB1455.namprd15.prod.outlook.com> <CABkgnnVRo_mT7sPO=xvmMdS-6wAJoSpARp+FG1R8i-RQWqE8Lg@mail.gmail.com> <MWHPR15MB145521D729498455F923679EB63F0@MWHPR15MB1455.namprd15.prod.outlook.com>, <CABkgnnVZCp8QBVPe81_9=JsrsAYLpy2KkWtfgY9pWcspoKBMSw@mail.gmail.com> <MWHPR15MB1455956FFF7AB6730C1E345CB63F0@MWHPR15MB1455.namprd15.prod.outlook.com>, <8dde9f5fac4440a8ac6c04e27efc042f@usma1ex-dag1mb5.msg.corp.akamai.com>, <MWHPR15MB14556C117E35F0F38E366125B63F0@MWHPR15MB1455.namprd15.prod.outlook.com>, <250e9b58e5294fca8e5a7e7a4c3643c8@usma1ex-dag1mb5.msg.corp.akamai.com>
In-Reply-To: <250e9b58e5294fca8e5a7e7a4c3643c8@usma1ex-dag1mb5.msg.corp.akamai.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
authentication-results: akamai.com; dkim=none (message not signed) header.d=none;akamai.com; dmarc=none action=none header.from=fb.com;
x-originating-ip: [2620:10d:c090:180::caa6]
x-microsoft-exchange-diagnostics: 1; MWHPR15MB1455; 7:ZJpUFE/bJATQfjZxbRMgnMWLlGjYl1pIfjyOEljSkdCf69fsAfdLZWfYXkMJX5VdCG1FgzSVoFKlx0OuHGy0wqnebtOuty70NOsJCGKh0iB+DtNoBnzlJGcAFMaU4DthWnA9fmyOhSmvyazZm7iW36I0YEIfdj1+z/5NIsgbES/g+0NvCR0+8oBJWbxkOrO3naSGnGCDkez0rUbnn/XUmhNyNRLUHcGaE474nL8NdwGkPYarq7v36wyDU9vxALmtYg6Fix0ectUuL6MVvtxXdv0IaoKEnSaDW061TvtqJNls2yP4y+QayrhWcY3anNw+hNXHtOFruitsj5uaNEQAag==; 20:MP5L+SviI/KnLJH9qc5Vwkx9OqCy9Jn17vGflTfbBvuKxFcjkuhagj2/D7unnVOPxnkyIV8D7RzQtRZXi74DTwtDcFA9TwgYKyX1yvCON54+WfFlas3QzqK/lcoJ532AJoaxxmk4uIH4K/9wAMUDqAxHSrihTOG47t2HYwJ+WHk=
x-ms-office365-filtering-correlation-id: 418725e3-4b43-4ed8-4e3e-08d474868080
x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254075); SRVR:MWHPR15MB1455;
x-microsoft-antispam-prvs: <MWHPR15MB145528152614614AB502B172B6300@MWHPR15MB1455.namprd15.prod.outlook.com>
x-exchange-antispam-report-test: UriScan:(158342451672863)(67672495146484);
x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040408)(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046)(6041248)(20161123555025)(20161123562025)(201703131423033)(201702281528033)(201703061421033)(201703061406033)(20161123560025)(20161123558025)(20161123564025)(6072148); SRVR:MWHPR15MB1455; BCL:0; PCL:0; RULEID:; SRVR:MWHPR15MB1455;
x-forefront-prvs: 0258E7CCD4
x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(39840400002)(39450400003)(39400400002)(39410400002)(51444003)(377454003)(24454002)(13464003)(93886004)(33656002)(561944003)(19627405001)(7696004)(2501003)(3660700001)(6116002)(102836003)(2950100002)(3280700002)(189998001)(7736002)(74316002)(8936002)(5660300001)(8676002)(236005)(25786009)(4326008)(39060400002)(38730400002)(53546009)(229853002)(55016002)(9686003)(54896002)(6436002)(6506006)(77096006)(2900100001)(6246003)(99286003)(81166006)(2906002)(53936002)(54356999)(50986999)(76176999)(86362001)(122556002); DIR:OUT; SFP:1102; SCL:1; SRVR:MWHPR15MB1455; H:MWHPR15MB1455.namprd15.prod.outlook.com; FPR:; SPF:None; MLV:ovrnspm; PTR:InfoNoRecords; LANG:en;
spamdiagnosticoutput: 1:99
spamdiagnosticmetadata: NSPM
Content-Type: multipart/alternative; boundary="_000_MWHPR15MB1455388350826978E960683DB6300MWHPR15MB1455namp_"
MIME-Version: 1.0
X-MS-Exchange-CrossTenant-originalarrivaltime: 26 Mar 2017 20:27:19.2631 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 8ae927fe-1255-47a7-a2af-5f3a069daaa2
X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR15MB1455
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-26_17:, , signatures=0
Archived-At: <https://mailarchive.ietf.org/arch/msg/quic/356AH1LWzIHqm_Oue22BUHkUuwA>
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: Sun, 26 Mar 2017 20:27:30 -0000

> We are only protecting reassembly buffers here
Isn't that what the connection flow control window and the stream flow control window is for?


> must count the stream toward his concurrency limit while there are any unacked sent bytes. (By peer, I mean "an endpoint".)

If this is the correct interpretation of how concurrency limit is accounted for in the current draft, then it seems like it provides is no better protection than the flow control window.

The real value of a stream concurrency limit would be to be able to protect the stream state table and to allow senders to protect their write buffers. Sure, senders can slow themselves down, however putting that local limit on yourself is another complexity in addition to the other sender side limits like congestion control, and a tradeoff between throughput and buffer build-up.

It seems like the draft could benefit from is explicit signaling of the available concurrent limit similar to the flow control window which is explicitly signaled. Then we can actually have the peer advertise a concurrent limit whenever it feels like it's ready to receive more streams, which would make this way easier to account for resource usage in the state table and allow the receiver to expand this limit in the future.


Subodh

________________________________
From: Lubashev, Igor <ilubashe@akamai.com>
Sent: Friday, March 24, 2017 5:56:41 AM
To: martin.thomson@gmail.com; Subodh Iyengar
Cc: quic@ietf.org
Subject: RE: FIN + RST behavior

I am not thinking about it from the perspective of the initiator of a stream. I am really thinking about a stream having two independent directions. It is the sender of the bytes (on a stream initiated by him or by the peer, does not matter) that must count the stream toward his concurrency limit while there are any unacked sent bytes. (By peer, I mean "an endpoint".)

The management of retransmit buffers is a local concern of the sender. If the buffers grow too large, the local app would not get a chance to write more into them. We are only protecting reassembly buffers here. If we also want to protect a table containing state for active streams, we would need to modify the definition for concurrent streams to "number of streams that this endpoint has sent any data on and still have unacked data or fin, or unacked rst".

- Igor

-----Original Message-----
From: Subodh Iyengar [subodh@fb.com]
Received: Friday, 24 Mar 2017, 12:28AM
To: Lubashev, Igor [ilubashe@akamai.com]; Martin Thomson [martin.thomson@gmail.com]
CC: quic@ietf.org [quic@ietf.org]
Subject: Re: FIN + RST behavior


@Lubashev, Igor<mailto:ilubashe@akamai.com>


<mailto:ilubashe@akamai.com>>Concurrency limit is about the amount of local resources a remote peer can consume.


Let's say that for every stream there is an initiator (who is subject to stream limit) and a peer.
Aren't the retransmission buffers which the peer has to hold onto until the initiator ACKs them also a part of the local resources here?


An initiator who doesn't ACK any bytes from the server forces a peer to keep state for it. However it could send it's own FIN which is ACKed normally.


My question generally here is that with the current state machine seems that it's difficult for both peers to get a consistent view of what each side thinks that the

open peer streams have. The peer should only release the retransmission buffers when it knows all of the data + FIN has been ACKed, and I think that's when it should release

the stream limit. However the initiator needs to know when this happens so it would need to keep track of the ACKs for the ACKs it sent. Unidirectional streams seem to make this simpler.

>To be put precisely, the concurrency limit can be defined as “the max number of streams with non-zero unACKed bytes sent by that peer”.

I'm not sure I understand your meaning here or maybe I'm confused by what you consider as the peer.
Can't the initiator just send a FIN and get an ACK for the FIN, however never ACK the peer's frames? In this case the initiator would have "zero UNACKed bytes" but the peer would not.


Subodh

________________________________
From: Lubashev, Igor <ilubashe@akamai.com>
Sent: Thursday, March 23, 2017 11:27:29 AM
To: Subodh Iyengar; Martin Thomson
Cc: quic@ietf.org
Subject: RE: FIN + RST behavior

Concurrency limit is about the amount of local resources a remote peer can consume.  It is not about how much local resources can be consumed by the local application – these limits can be enforced without any help from the protocol.

So concurrency limit is really the number of concurrent in-progress streams that a peer is willing to receive.  This maps well with unidirectional streams, but this is not a requirement.  To be put precisely, the concurrency limit can be defined as “the max number of streams with non-zero unACKed bytes sent by that peer”.  This means, peers can negotiate separate concurrency limits.


-          Igor

From: Subodh Iyengar [mailto:subodh@fb.com]
Sent: Thursday, March 23, 2017 1:09 PM
To: Martin Thomson <martin.thomson@gmail.com>
Cc: quic@ietf.org
Subject: Re: FIN + RST behavior


>  The client can consider its own resources to be available for use by
the server as soon as it receives the FIN and processes it.  If this
were a server resource, then you are right, it's not that simple
because the client can't assume that the server has released state
yet.

Ya in the case of the previous example, it is a server resource since it's a client initiated stream.
@Martin Thomson<mailto:martin.thomson@gmail.com> I'm starting to like your proposal of unidirectional streams more and more :)



Subodh



________________________________
From: QUIC <quic-bounces@ietf.org<mailto:quic-bounces@ietf.org>> on behalf of Martin Thomson <martin.thomson@gmail.com<mailto:martin.thomson@gmail.com>>
Sent: Thursday, March 23, 2017 4:04:46 AM
To: Subodh Iyengar
Cc: quic@ietf.org<mailto:quic@ietf.org>
Subject: Re: FIN + RST behavior

On 23 March 2017 at 15:10, Subodh Iyengar <subodh@fb.com<mailto:subodh@fb.com>> wrote:
> How does the client know when the server has released a slot in it's
> concurrency limit? The server can't immediately release this when it sends
> out the FIN because it still must keep state until it receives all the
> ACKs for the stream. I think the client need to keep track of the ACK of the
> ACKs of all the server sent bytes in the stream, which would be a bit sad.


The client can consider its own resources to be available for use by
the server as soon as it receives the FIN and processes it.  If this
were a server resource, then you are right, it's not that simple
because the client can't assume that the server has released state
yet.