RE: Unidirectional streams PR

Mike Bishop <Michael.Bishop@microsoft.com> Fri, 23 June 2017 03:18 UTC

Return-Path: <Michael.Bishop@microsoft.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 005891241FC for <quic@ietfa.amsl.com>; Thu, 22 Jun 2017 20:18:35 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -4.801
X-Spam-Level:
X-Spam-Status: No, score=-4.801 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-2.8, SPF_HELO_PASS=-0.001, 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=microsoft.com
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 0qPAv84v_XMm for <quic@ietfa.amsl.com>; Thu, 22 Jun 2017 20:18:32 -0700 (PDT)
Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0104.outbound.protection.outlook.com [104.47.36.104]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 7E407120046 for <quic@ietf.org>; Thu, 22 Jun 2017 20:18:32 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=q/R0ytPYEZJpqhd2HwDcYqnbhJYLX/rp0xoXmc7RZv8=; b=eb9ca3YqzWFXqyfm7vZdZmxh+r4T/ekKuw+BvYOH9NUed+vg56zrm/E1hpMEHPBr3Tawt9Bqd3ldeE8IcCgCoagZaSoRPMEaN4rkzTOt+MnkPz/cUCkgecinRnQJ5s7v9qPK5Og7ZeFhn6+1p98xhmG8tzlU3yiUF7S9EokT3Qw=
Received: from MWHPR21MB0141.namprd21.prod.outlook.com (10.173.52.11) by MWHPR21MB0141.namprd21.prod.outlook.com (10.173.52.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1220.1; Fri, 23 Jun 2017 03:18:30 +0000
Received: from MWHPR21MB0141.namprd21.prod.outlook.com ([10.173.52.11]) by MWHPR21MB0141.namprd21.prod.outlook.com ([10.173.52.11]) with mapi id 15.01.1220.005; Fri, 23 Jun 2017 03:18:30 +0000
From: Mike Bishop <Michael.Bishop@microsoft.com>
To: "Lubashev, Igor" <ilubashe@akamai.com>, Martin Thomson <martin.thomson@gmail.com>, Ted Hardie <ted.ietf@gmail.com>
CC: Jana Iyengar <jri@google.com>, QUIC WG <quic@ietf.org>, Patrick McManus <pmcmanus@mozilla.com>
Subject: RE: Unidirectional streams PR
Thread-Topic: Unidirectional streams PR
Thread-Index: AQHS6mHyIpxR/afFiUiHxd5TQx2M+qIvEnAAgADqdYCAACIZgIABI/4AgAA3F4CAAAIxEIAAKOgAgAAhMfA=
Date: Fri, 23 Jun 2017 03:18:29 +0000
Message-ID: <MWHPR21MB0141CB6CEC804A17FFB1C75987D80@MWHPR21MB0141.namprd21.prod.outlook.com>
References: <CABkgnnW+veDVq27v+wTz0cA=eGPRTLQ1A90A0ynHLPU88Pg77Q@mail.gmail.com> <CAOdDvNpORYBr7+Q8M_nnGOm4MsWqVbm6koOtQ+=An8t7AbccGg@mail.gmail.com> <CAGD1bZb9Na32z=Gg9JS+FzrGGN9Jhw=QDTMTYS=FVcNesoSMig@mail.gmail.com> <CABkgnnV2yPP-qgLKZYPsvawXc7FP4RM7CZDDa7aFaNy0KxLfag@mail.gmail.com> <CA+9kkMCF+wUPA452gYgdG65Y4zNctzGWd4HtZ2Ge70=S9k-_Qw@mail.gmail.com> <CABkgnnU6H+2AeY0n7-d+k0baM7UJ6fuN4PX7ez+KRN17eFg6Yg@mail.gmail.com> <MWHPR21MB0141A7116859D7955C92CC0987DB0@MWHPR21MB0141.namprd21.prod.outlook.com> <349d20e4f7d9458aaf7797d2025b2064@usma1ex-dag1mb5.msg.corp.akamai.com>
In-Reply-To: <349d20e4f7d9458aaf7797d2025b2064@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=microsoft.com;
x-originating-ip: [2601:600:8080:5a28:2d28:f631:f3c8:650e]
x-ms-publictraffictype: Email
x-microsoft-exchange-diagnostics: 1; MWHPR21MB0141; 7:KMH1uahYSdpLqM2e2IVZEMMjORTlY3Kxw+y49VorwQ4KAw96JxzkcS7AUkVUKU4uX+5Q/6T8/VDdMNm66BkgJP4j5+2vNS8X5gW6hYS9aGpQqv8CT5Y7v2AAITns+wPCpUJeb4i/nvm3016CYX/vsO1R7S1vzErwo9m+VmfSToTtGfDbpcUgNrC2f+9+tFKAT/UUtp3BE8GAS/PNxzxYukFg/kNqdv/fMa0nS5c9WFYEOiyddnuiNz7Jxl/5PMl2XWEMdWeDJ0CI2Ut5dKI9l2SaHz63FoGLiwDCBWmkEbtYeVJVZMvRVi7WtINm6+JnID+XmKXxRrZMOcT12Ulb/nZNVBQ8nGvOOsddTRrkYOmeu3gy8s7aq4RflcNolku8zYRFn8lEjAga1SYxisvkm8ptxGIp+pL5BcqrNRw1avDPwRHY4aSiZLTLwdf4SbLf5F2hgg/Wib78u8ZpjPWPp5+QhYXML41FauUHIzA4XBDE6HSK402qDemeEatT0z6om+M7xvpdIt2iGTgfK6+l1TlZWkiXteGq4v02KRGX2ea3tGsqP3IePFztKzaahyHyN3PWABvNA8T+mUGstmvKTReKkLeeky8+32bVM7tCyKaWVQWlVFYFcZAvujsYRxG6Y0Nt6ChgJsWiDIccqwPDyRE8GVNPLLYfumTJr6NO1UR3yEthaP2mpPxirUKKca7pnO+HJyHb3xjRJJcglsJhBdk3BIizB1/tB2V846bshHrIBLvnA1UtZvGGzUK4HnYGLhD59a0sktKkYGDXWW4Egg+gr1r5NHs9ntTkEc1rwQcFum7b7gsp/Hted2v8k4a5
x-ms-office365-filtering-correlation-id: be4b3d01-a01f-4212-b911-08d4b9e68599
x-ms-office365-filtering-ht: Tenant
x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500061)(300135000095)(300000501061)(300135300095)(22001)(300000502061)(300135100095)(2017030254075)(48565401081)(300000503061)(300135400095)(201703131423075)(201703031133081)(201702281549075)(300000504061)(300135200095)(300000505061)(300135600095)(300000506054)(300135500095); SRVR:MWHPR21MB0141;
x-ms-traffictypediagnostic: MWHPR21MB0141:
x-microsoft-antispam-prvs: <MWHPR21MB014115819C198498732CB64887D80@MWHPR21MB0141.namprd21.prod.outlook.com>
x-exchange-antispam-report-test: UriScan:(278428928389397)(35073007944872)(211936372134217)(155532106045638);
x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(61425038)(6040450)(601004)(2401047)(5005006)(8121501046)(93006095)(93001095)(100000703101)(100105400095)(3002001)(10201501046)(6055026)(61426038)(61427038)(6041248)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(20161123558100)(20161123560025)(20161123555025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:MWHPR21MB0141; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:MWHPR21MB0141;
x-forefront-prvs: 0347410860
x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(6009001)(39860400002)(39450400003)(39400400002)(39850400002)(39410400002)(39840400002)(51444003)(24454002)(377454003)(13464003)(561944003)(53546010)(53936002)(6246003)(5005710100001)(77096006)(38730400002)(74316002)(72206003)(229853002)(6506006)(6436002)(99286003)(55016002)(54906002)(305945005)(102836003)(86612001)(2900100001)(8676002)(7696004)(2950100002)(81166006)(8936002)(86362001)(478600001)(3480700004)(93886004)(5660300001)(6116002)(9686003)(7116003)(8990500004)(33656002)(7736002)(4326008)(3660700001)(122556002)(3280700002)(14454004)(189998001)(10290500003)(25786009)(50986999)(68736007)(39060400002)(10090500001)(2906002)(54356999)(76176999); DIR:OUT; SFP:1102; SCL:1; SRVR:MWHPR21MB0141; H:MWHPR21MB0141.namprd21.prod.outlook.com; FPR:; SPF:None; MLV:ovrnspm; PTR:InfoNoRecords; LANG:en;
spamdiagnosticoutput: 1:99
spamdiagnosticmetadata: NSPM
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-OriginatorOrg: microsoft.com
X-MS-Exchange-CrossTenant-originalarrivaltime: 23 Jun 2017 03:18:29.7590 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47
X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR21MB0141
Archived-At: <https://mailarchive.ietf.org/arch/msg/quic/RBPBsnDUQWgPC1krVv02N2WN0zs>
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: Fri, 23 Jun 2017 03:18:35 -0000

Interesting design.  I was trying to avoid doubling the number of frames consumed by the STREAM frame by consuming just one.  But it's a good insight that offset is only absent on the first STREAM frame, so we could leverage that if we wanted to.  Maybe OO=0 indicates the presence of some fixed-size params, and one of those bits is directionality?

I wasn't convinced this is simpler, because HTTP/QUIC would still need a stream header.  But if we used bidirectional streams for request/response, then all unidirectional streams are PUSH_PROMISE, and they're the only ones that need a stream header.

However, let me point out that this is fundamentally still unidirectional streams with the ability to declare (as metadata) that a particular stream is "affiliated" with a stream in the opposite direction.  (And perhaps the ability for the stream initiator to declare an expectation that there will be an affiliation coming.)  This does change the request on N / response on N model.  We're just talking about moving the correlator into the QUIC framing, so that each mapping doesn't have to reconstruct how to do correlations.

That means we get (or can get) the same state simplifications as in the PR by considering the streams to have independent lifecycles -- the correlator is simply made available to the application as information about the stream.  That also means that adding the correlator can be done in a separate PR, if we prefer.

-----Original Message-----
From: Lubashev, Igor [mailto:ilubashe@akamai.com] 
Sent: Thursday, June 22, 2017 6:07 PM
To: Mike Bishop <Michael.Bishop@microsoft.com>; Martin Thomson <martin.thomson@gmail.com>; Ted Hardie <ted.ietf@gmail.com>
Cc: Jana Iyengar <jri@google.com>; QUIC WG <quic@ietf.org>; Patrick McManus <pmcmanus@mozilla.com>
Subject: RE: Unidirectional streams PR

I like the idea of unidirectional streams, if they make life easier for apps -- both "traditional" apps like H2 as well as less usual apps like ssh (one stream in one direction, two associated streams in the opposite direction).

I also like Mike's idea of OPEN_STREAM frame.  The way I'd describe OPEN_STREAM frame is that it is implicitly a STREAM frame with 0-offset and a set of "per-stream properties".

An important point is that when Transport is aware of the association of two unidirectional streams, the Transport API would be able to implement a bidirectional socket-like abstraction for applications that desire one.


OPEN_STREAM frame
The type byte for a OPEN_STREAM frame contains embedded flags, and is formatted as 10FSSPPD. The F, SS, and D bits are parsed as per STREAM frame.
* The PP bits encode the size of the Params Bitmap field. The values 00, 01, 02, and 03 indicate lengths of 8, 16, 24, and 32 bits long respectively.

The two Least Significant bits of the Params Bitmap indicate the length of the Associated Stream ID. The LSB values 00, 01, 02, and 03 indicate lengths of 0 (none), 8, 16, and 32 bits long respectively.
We can define up to 30 additional bits to be meaningful to the transport.  (I can imagine Partial-Reliability bit, Flow-Control-Exempt bit, Priority-Delivery (aka "DontBuffer") bit, etc).

0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                    Stream ID (8/16/24/32)                   ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                Params Bitmap  (8/16/24/32)                   ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|            Associated Stream ID (0/8/16/32)                    ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|       [Data Length (16)]      |        Stream Data (*)      ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Note that if Params Bitmap is 0x0, this OPEN_STREAM frame is equivalent to STREAM frame with OO=0.



-----Original Message-----
From: Mike Bishop [mailto:Michael.Bishop@microsoft.com]
Sent: Thursday, June 22, 2017 6:48 PM
To: Martin Thomson <martin.thomson@gmail.com>; Ted Hardie <ted.ietf@gmail.com>
Cc: Jana Iyengar <jri@google.com>; QUIC WG <quic@ietf.org>; Patrick McManus <pmcmanus@mozilla.com>
Subject: RE: Unidirectional streams PR

I suppose you could drop the stream type header from HTTP into QUIC and make the types "bidirectional stream," "unidirectional stream," and "mate of bidirectional stream"; the last would further need to identify which peer stream it corresponded to.

But making them the first couple bytes of the stream data feels kind of kludgy if this is fundamentally built into the transport, which means they really belong in a dedicated frame.  Maybe a dedicated OPEN_STREAM frame, which blocks any data received on that stream until you know what type it is?

Actually, if we're planning on introducing other per-stream properties like partial reliability, there might be value in an OPEN_STREAM frame where we can describe a stream's desired properties before any data flows....

-----Original Message-----
From: QUIC [mailto:quic-bounces@ietf.org] On Behalf Of Martin Thomson
Sent: Thursday, June 22, 2017 3:32 PM
To: Ted Hardie <ted.ietf@gmail.com>
Cc: Jana Iyengar <jri@google.com>; QUIC WG <quic@ietf.org>; Patrick McManus <pmcmanus@mozilla.com>
Subject: Re: Unidirectional streams PR

On 23 June 2017 at 05:15, Ted Hardie <ted.ietf@gmail.com> wrote:
> My personal take on that right answer there is to support both, with 
> an explicit signal of when each model is in use,

I have heard this request now from several folks at Google.  I don't know how to make this work without increasing complexity considerably .  I'd be willing to be wrong about this, but would prefer to see a proposal.  I don't need a fully-worked proposal with text, just a sketch of how the pieces work in enough detail to understand how this might interact with other parts of the protocol.  I think that Jana offered to do this, so maybe I can wait for that (c.f., Mark's earlier statement about priority/urgency).