Re: Split error codes in two

Roberto Peon <fenix@fb.com> Wed, 13 September 2017 19:04 UTC

Return-Path: <prvs=04293a86c2=fenix@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 4F7EC132EDC for <quic@ietfa.amsl.com>; Wed, 13 Sep 2017 12:04:48 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.718
X-Spam-Level:
X-Spam-Status: No, score=-2.718 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, LOTS_OF_MONEY=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001, URIBL_BLOCKED=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=gw6ZaFi4; dkim=pass (1024-bit key) header.d=fb.onmicrosoft.com header.b=Ly80tTCA
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 tqhF2QCuZwCa for <quic@ietfa.amsl.com>; Wed, 13 Sep 2017 12:04:45 -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 55105132EBB for <quic@ietf.org>; Wed, 13 Sep 2017 12:04:45 -0700 (PDT)
Received: from pps.filterd (m0089730.ppops.net [127.0.0.1]) by m0089730.ppops.net (8.16.0.21/8.16.0.21) with SMTP id v8DJ3MR9009515; Wed, 13 Sep 2017 12:04:37 -0700
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.com; h=from : to : subject : date : message-id : references : in-reply-to : content-type : mime-version; s=facebook; bh=dgMvk2Nay9HObjBN4AlHIn+kIdSlQpJkuhqLkClO3CQ=; b=gw6ZaFi4NxLiJnpKiL/F4lyyzp0llxryxOwV83KIcFc0QfcV2CJES0ueWxT3bHcgfLys wyWnAT+1RDwRvIud3TnzYdN51qrUQVnNLcF6dhcbi1hE0ULnhrp4GAVXpix2C17APRdL xQbS6nWRry5xP6jTCGLusmmGrJt9yi7rE3o=
Received: from mail.thefacebook.com ([199.201.64.23]) by m0089730.ppops.net with ESMTP id 2cy4p2hfrk-11 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Wed, 13 Sep 2017 12:04:37 -0700
Received: from NAM02-CY1-obe.outbound.protection.outlook.com (192.168.54.28) by o365-in.thefacebook.com (192.168.16.22) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 13 Sep 2017 12:03:36 -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=dgMvk2Nay9HObjBN4AlHIn+kIdSlQpJkuhqLkClO3CQ=; b=Ly80tTCAxwfrX4vw45+MM0D6sqFzNlQb5zXZWXq4BHJjdzSQQNpJhYOCDOv2G6ri76VobB8NrLHj4d9wq7IhZALYXHY8NjiE9eahj544yzZHWR0T1z/yugabnUmmPZ2i/RfVKUH8yEQrxpYxpg+PZvnFvVbXn/wQr7KQMxG2J8U=
Received: from DM5PR15MB1883.namprd15.prod.outlook.com (10.174.247.135) by DM5PR15MB1900.namprd15.prod.outlook.com (10.174.247.140) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.35.12; Wed, 13 Sep 2017 19:03:34 +0000
Received: from DM5PR15MB1883.namprd15.prod.outlook.com ([10.174.247.135]) by DM5PR15MB1883.namprd15.prod.outlook.com ([10.174.247.135]) with mapi id 15.20.0035.021; Wed, 13 Sep 2017 19:03:34 +0000
From: Roberto Peon <fenix@fb.com>
To: Christian Huitema <huitema@huitema.net>, "quic@ietf.org" <quic@ietf.org>
Subject: Re: Split error codes in two
Thread-Topic: Split error codes in two
Thread-Index: AQHTJTn+M1kPnAYJVE6/jyIPUxXdX6KmFGeAgAASp4CAAAOOAIAA0yCAgAAOnACAAAMMAIAAAK4AgACHAwCAAJELAIABpR2AgABJmoCAAAS/AIAANHEAgAFsKoCABkENAIAASG+AgAAJOoCAAHdJgA==
Date: Wed, 13 Sep 2017 19:03:33 +0000
Message-ID: <E3F6F096-832D-4C4E-8BFA-5C1343F565E5@fb.com>
References: <CABkgnnWwGAyHzkST9o9ueVmBw3_TpJun=dv2X+HL2snXSZJgew@mail.gmail.com> <CACdeXiLS7W8cJbnT=orHkcd9reH=8QqhOzxWnUEpWZmfcdvd2g@mail.gmail.com> <CAGD1bZa-h0ZVh7kUYQtG3r93eH6TqRXnQ6YXAcscCrCQHk8LeA@mail.gmail.com> <CABkgnnXMFUP_c+2r6YeJouJXanHd8tFcqDKgU=C9UF0stPcXOw@mail.gmail.com> <CAGD1bZZZG9L0_d7Tmo8vfdAx+=LU+yi97N42vKFGo82K16Zycw@mail.gmail.com> <05505C10-8737-4C58-BC91-E401D2659AF0@in-panik.de> <MWHPR21MB0141F305CCE2B686F09549F887970@MWHPR21MB0141.namprd21.prod.outlook.com> <CAGD1bZY5xo5Krn=U3SBVUCPU4x2UAOcv2AnvzaRac9qJGM9KBg@mail.gmail.com> <DM5PR15MB14497BB2F1971C5965882875B6940@DM5PR15MB1449.namprd15.prod.outlook.com> <CAGD1bZbnpCxjdaEV_m_5XWEjtjmdxYTGh2VBoS8AgZdhxfsDhw@mail.gmail.com> <CABkgnnWRy17vuFRGhpvLBCKte3WeCdGa1M1feOBygQv+-AB2+A@mail.gmail.com> <CAGD1bZZL-4HzArTQfWrC+CbHYsyB6Wdx4cbz7+0X7YOiuc-+Qg@mail.gmail.com> <BN6PR21MB01302C7E8A43AF9DB7A63335876E0@BN6PR21MB0130.namprd21.prod.outlook.com> <bca00829d58049fb8a644f3787011fca@ustx2ex-dag1mb5.msg.corp.akamai.com> <d63880bf-7eaa-158b-a3f8-04142f288853@huitema.net>
In-Reply-To: <d63880bf-7eaa-158b-a3f8-04142f288853@huitema.net>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-originating-ip: [2620:10d:c090:200::5:1b3]
x-ms-publictraffictype: Email
x-microsoft-exchange-diagnostics: 1; DM5PR15MB1900; 20:33e7cg0IsK/oyN080xc+HCiIDIfjey29ndNh+GMGYov2Mux4ZMpmRsMNk3wtSP7T8gCWnerLyJk++W2Ubcci7niFtsatordwljG7tJC2UjspsYpkSuua44VeBf19zXKq5wH8yBXpqMElteRMfM3vSntVSxrbm6aTYgRNjZqltCw=
x-ms-exchange-antispam-srfa-diagnostics: SSOS;
x-ms-office365-filtering-correlation-id: 5aeed9fe-9688-486b-f156-08d4fada21a8
x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254152)(300000503095)(300135400095)(2017052603199)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:DM5PR15MB1900;
x-ms-traffictypediagnostic: DM5PR15MB1900:
x-exchange-antispam-report-test: UriScan:(89211679590171)(67672495146484)(211936372134217)(153496737603132)(21748063052155);
x-microsoft-antispam-prvs: <DM5PR15MB1900A0CB835C7C32AC03C88ECD6E0@DM5PR15MB1900.namprd15.prod.outlook.com>
x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(93006095)(93001095)(100000703101)(100105400095)(3002001)(10201501046)(920507026)(6041248)(20161123558100)(20161123555025)(20161123564025)(20161123562025)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:DM5PR15MB1900; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:DM5PR15MB1900;
x-forefront-prvs: 042957ACD7
x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(376002)(346002)(78114003)(51444003)(199003)(377454003)(189002)(24454002)(54356999)(50986999)(25786009)(2950100002)(76176999)(101416001)(105586002)(106356001)(236005)(99286003)(6306002)(6512007)(54896002)(53936002)(6246003)(82746002)(53546010)(36756003)(189998001)(3660700001)(6116002)(33656002)(102836003)(7736002)(86362001)(34040400001)(83716003)(3280700002)(8936002)(93886005)(8676002)(2906002)(81166006)(81156014)(229853002)(68736007)(2501003)(14454004)(6506006)(97736004)(6486002)(5660300001)(478600001)(316002)(77096006)(2900100001)(6436002)(45080400002)(42262002); DIR:OUT; SFP:1102; SCL:1; SRVR:DM5PR15MB1900; H:DM5PR15MB1883.namprd15.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en;
received-spf: None (protection.outlook.com: fb.com does not designate permitted sender hosts)
spamdiagnosticoutput: 1:99
spamdiagnosticmetadata: NSPM
Content-Type: multipart/alternative; boundary="_000_E3F6F096832D4C4E8BFA5C1343F565E5fbcom_"
MIME-Version: 1.0
X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Sep 2017 19:03:33.9367 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 8ae927fe-1255-47a7-a2af-5f3a069daaa2
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR15MB1900
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-09-13_06:, , signatures=0
Archived-At: <https://mailarchive.ietf.org/arch/msg/quic/t1q3co6RCBN6H0IaS9SzC2KG76s>
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, 13 Sep 2017 19:04:48 -0000

So many RPC models have failed utterly because they couldn’t handle receiving the data in a streaming fashion.

-=R



From: QUIC <quic-bounces@ietf.org> on behalf of Christian Huitema <huitema@huitema.net>
Date: Tuesday, September 12, 2017 at 9:57 PM
To: "quic@ietf.org" <quic@ietf.org>
Subject: Re: Split error codes in two


There is another abstraction -- streams as messages. Application pushes a message that is the entire content of the stream, and receives a message once the entire stream has been received. That's the model used by DNS over QUIC.

On 9/12/2017 9:23 PM, Lubashev, Igor wrote:
This is a very good idea to decide what we want to model streams on.  Starting with well-known, simple abstractions seems like the best path to adoption.

There are two such abstractions that come to mind:


  1.  “TCP Stream sockets”.  These only support signaling “orderly” closing of the write direction.  Closing of the read direction can only be done via close(), but that may leave the write direction in an undefined state (writing will complete, unless there was unread data in the read buffer or any data is received after close – see RFC 1122 4.2.2.13 $3).



I think the current spec allows for QUIC API to emulate TCP stream socket abstraction.  Current spec  also adds signaling “abort” closing of the write direction (RST_STREAM does not require an immediate RST_STREAM in the opposite direction), although there was some talk of removing this feature.


  1.  “A POSIX pipe pair”, as Mike is proposing (one pair in each direction).  Connected pipes are very clean (‘symmetric’) abstractions, and they communicate close events (you close the ‘write’ pipe, ‘read’ pipe get EOS; you close the ‘read’ pipe, ‘write’ pipe gets an exception).



With read-direction close signaling, however, it is important to not to cause often-unnecessary STOP_SENDING frames sent for every common-case stream.close(). I think that could be done via one of the following ways:

  1.  Unidirectional streams. Send STOP_SENDING on close() by the receiver (if the steam is open).
  2.  API convention: “only send STOP_SENDING on stream.inputStream().close()”. On stream.close(), only send STOP_SENDING if there is unread data or new data comes in later.
  3.  Actually signal that read direction is closed in stream.close() by defining STREAM-with-FIN frame as “close both write and read directions” (common case).  Have separate frame types for WRITE_CLOSE, WRITE_ABORT (aka RST_STREAM), and READ_ABORT (aka STOP_SENDING).


From: Mike Bishop [mailto:Michael.Bishop@microsoft.com]
Sent: Tuesday, September 12, 2017 8:04 PM
To: Jana Iyengar <jri@google.com><mailto:jri@google.com>; Martin Thomson <martin.thomson@gmail.com><mailto:martin.thomson@gmail.com>
Cc: Philipp S. Tiesel <phils@in-panik.de><mailto:phils@in-panik.de>; Subodh Iyengar <subodh@fb.com><mailto:subodh@fb.com>; Nick Harper <nharper@google.com><mailto:nharper@google.com>; QUIC WG <quic@ietf.org><mailto:quic@ietf.org>; Victor Vasiliev <vasilvv@google.com><mailto:vasilvv@google.com>
Subject: RE: Split error codes in two

Jana and I were discussing this today, and part of the difference comes down to how you conceive of the API a QUIC implementation will expose.  My mental model has been that a stream/stream-pair consists of an InputStream and an OutputStream; you can read on one, you can write on the other.  For the write stream, you can write your data to completion and close the stream, or you can decide to abort writing.  The wire expressions of these are FIN and RST_STREAM, respectively.  For the read stream, you can read the incoming data to the end or you can abort reading and discard the remainder of the stream; the wire expression of this would be flow control updates and STOP_SENDING, respectively.  On the other side, receipt of a RST_STREAM surfaces as a read error and receipt of a STOP_SENDING surfaces as a write error.  (Jana commented that in this mental model it might be clearer to call the frames WRITE_ABORT and READ_ABORT.)

If we take Martin’s proposition that streams only close by application action, there would never be a write error surfaced to the application unless the underlying transport went away entirely.  Instead, it’s the responsibility of the application protocol to communicate (on another stream, in this case) that you should abort writing, even if you’ve already written to completion, and then to do so.  That implies that the application needs the ability to return to streams on which it’s done writing, in case it’s later asked to go back and reset them.

Much of our discussions around unidirectional streams, stream state transitions, etc. including the question of whether STOP_SENDING belongs at the transport layer, stem from the fact that we all have different implicit mental models of the functional surface QUIC exposes.  Perhaps we should take a step back and agree on that first, as I believe Christian has suggested in the past?

From: Jana Iyengar [mailto:jri@google.com]
Sent: Friday, September 8, 2017 5:34 PM
To: Martin Thomson <martin.thomson@gmail.com<mailto:martin.thomson@gmail.com>>
Cc: Subodh Iyengar <subodh@fb.com<mailto:subodh@fb.com>>; Mike Bishop <Michael.Bishop@microsoft.com<mailto:Michael.Bishop@microsoft.com>>; Philipp S. Tiesel <phils@in-panik.de<mailto:phils@in-panik.de>>; QUIC WG <quic@ietf.org<mailto:quic@ietf.org>>; Nick Harper <nharper@google.com<mailto:nharper@google.com>>; Victor Vasiliev <vasilvv@google.com<mailto:vasilvv@google.com>>
Subject: Re: Split error codes in two

On Thu, Sep 7, 2017 at 7:50 PM, Martin Thomson <martin.thomson@gmail.com<mailto:martin.thomson@gmail.com>> wrote:
On Fri, Sep 8, 2017 at 9:42 AM, Jana Iyengar <jri@google.com<mailto:jri@google.com>> wrote:
> I don't think it makes sense to design an app protocol that doesn't send a
> RST in response to a RST.

I've been told not to invoke this particular demon, but you just
invoked the Unidirectional streams problem.  I think that we get there
because of this meme that says that data in the one direction is
somehow necessarily bound to data in the other direction.  That's an
entirely constructed notion.  A useful construct at times, certainly,
but that's not the point here.

I think that's the most common use of a RST -- to close both directions.

So I disagree.  There are many protocols in which you send messages
(== streams) in one direction but not another.  One of the ways you
get into a unidirectional state in the current draft is to end one
side.  A FIN is only one way to do that, a unidirectional RST can be
faster and even superior in other ways.  The HTTP use case clearly
illustrates that.

FIN is the primary way in which half-close is achieved, which is what you're talking about. The HTTP use case is a complete one-off -- STOP_SENDING is an odd enough use case that I'm always left wondering who actually uses it.

Also, as Igor observes, we don't require a reciprocal RST_STREAM in
the current draft.

Yes, we don't. Recall that the RST_STREAM was, prior to the change that doesn't require reciprocity, a bidirectional signal, which was simplified to a unidirectional one, with the general expectation that apps would close the other side when they receive this signal from QUIC. It's surely going to be true of HTTP. It's possible for an app to receive a RST and then keep sending, but that is a use case I haven't seen in practice.




--

Christian Huitema