Re: Unidirectional streams PR

Ryan Hamilton <rch@google.com> Fri, 23 June 2017 03:46 UTC

Return-Path: <rch@google.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 2414B12947C for <quic@ietfa.amsl.com>; Thu, 22 Jun 2017 20:46:15 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2
X-Spam-Level:
X-Spam-Status: No, score=-2 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_NONE=-0.0001, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=google.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 StzNthF8GVVf for <quic@ietfa.amsl.com>; Thu, 22 Jun 2017 20:46:12 -0700 (PDT)
Received: from mail-wr0-x230.google.com (mail-wr0-x230.google.com [IPv6:2a00:1450:400c:c0c::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 2CF09129434 for <quic@ietf.org>; Thu, 22 Jun 2017 20:46:12 -0700 (PDT)
Received: by mail-wr0-x230.google.com with SMTP id 77so48095555wrb.1 for <quic@ietf.org>; Thu, 22 Jun 2017 20:46:12 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=D+izhsnyvEaOeS5SJTN+FwYhFeEpLfxl9H46ib4qLIA=; b=nmAZF/a6tI9oK85Z4ZMV5IqwbTWIE6E6fS69ihAokiAzhJK/Hzo74f/KuCSWOu0pZu E/CC8Hp2YiQNVzuw16nT2hluchCs1b1Zf2b5IZeQYGU6/29fyziZnnSvIECFyobby5YN 5nM4eIH4fFAClWtTt8etdDDURoXh/2dlnQLspji3fVwNpGw78IqBhYZUYdckjtuv9Rc9 X1SrqXfepK8IILZtEMvfB4qJwcCJ3mTw/V9AQa/n2g3wcH7zgSZtnGMhmY5ZjPvrEALa Yfr6g0aTUvtwiMaHE8a3Y4hJKbNEYizBnX3d+Q+YLP3tYzU7sCfWDedzFXmIQLi4A9HP 5MUQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=D+izhsnyvEaOeS5SJTN+FwYhFeEpLfxl9H46ib4qLIA=; b=P9DMIHzam8QelxAqj1mFRWo4fdh/B2QrYNyB4AXUUSokWlHbzLrMp0JuKSM9GJrfUf SM+u9jJ5Vq2GoTjIEFXIsHOw//uQoascQC80uUlBDApJpmCtRrScO8WgJ9fRgrAG9cer qFYFjJb12JxueYGbw1xEW3Hh1jZg8cSVdeIcqJLQ78PcCaH3JLLOmZmfOLPwYDYSUovW U6UunnN2x8UxK4lQ0D4jxG3yTHhHpb3lJAaGpeZmlToXJQagUBwc4yHrULOTkT6mfVEE wEUiAay+pSkirU9OgE+vKL93HOzrKXKGNfO57d27GFAE5Vl+VlpZYWlQz0cp6/vDo8GZ ltLg==
X-Gm-Message-State: AKS2vOyQfHDieOPiozMVhMWEm4PLrbnZ1Zpqd/qvbJqjt49NHi2MeFv/ K8UX5bZwBrDEMy7bjF3R5maRl7u/f4vU
X-Received: by 10.28.234.193 with SMTP id g62mr3815204wmi.24.1498189570216; Thu, 22 Jun 2017 20:46:10 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.28.217.10 with HTTP; Thu, 22 Jun 2017 20:46:09 -0700 (PDT)
In-Reply-To: <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> <MWHPR21MB0141CB6CEC804A17FFB1C75987D80@MWHPR21MB0141.namprd21.prod.outlook.com>
From: Ryan Hamilton <rch@google.com>
Date: Thu, 22 Jun 2017 20:46:09 -0700
Message-ID: <CAJ_4DfQsNvKkv+GJ5MwhqoOpT1P=2h-aHm8rxcZdS7vy_tw3QA@mail.gmail.com>
Subject: Re: Unidirectional streams PR
To: Mike Bishop <Michael.Bishop@microsoft.com>
Cc: "Lubashev, Igor" <ilubashe@akamai.com>, Martin Thomson <martin.thomson@gmail.com>, Ted Hardie <ted.ietf@gmail.com>, Jana Iyengar <jri@google.com>, QUIC WG <quic@ietf.org>, Patrick McManus <pmcmanus@mozilla.com>
Content-Type: multipart/alternative; boundary="001a114723fa23e42b05529871cd"
Archived-At: <https://mailarchive.ietf.org/arch/msg/quic/cHBTdP9rkJNDUDxlcLlwh4fe628>
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:46:15 -0000

On Thu, Jun 22, 2017 at 8:18 PM, Mike Bishop <Michael.Bishop@microsoft.com>
wrote:

> 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's a clever observation. I think there's one slight difference though,
as it applies to stream limits. In the bidi case, a peer can open a bidi
stream if it has not yet exceeded the peer's limit, and the peer is allowed
to respond, even if the peer could not otherwise open a new stream because
of stream limits. In addition, with the bidi steam case, the stream is
considered open until both halves are closed, which would not be the case
with uni streams. (Though with the changes to stream limits this might not
actually be a terribly important distinction)


> 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).
>
>