Re: Unidirectional streams PR

Ian Swett <ianswett@google.com> Fri, 23 June 2017 02:10 UTC

Return-Path: <ianswett@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 C5555129BF6 for <quic@ietfa.amsl.com>; Thu, 22 Jun 2017 19:10:14 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.7
X-Spam-Level:
X-Spam-Status: No, score=-2.7 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, 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 idZxVIyoFaPg for <quic@ietfa.amsl.com>; Thu, 22 Jun 2017 19:10:12 -0700 (PDT)
Received: from mail-yw0-x22a.google.com (mail-yw0-x22a.google.com [IPv6:2607:f8b0:4002:c05::22a]) (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 A6945129329 for <quic@ietf.org>; Thu, 22 Jun 2017 19:10:11 -0700 (PDT)
Received: by mail-yw0-x22a.google.com with SMTP id t127so1615871ywc.3 for <quic@ietf.org>; Thu, 22 Jun 2017 19:10:11 -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=5By2yMelMee7oscWk9PTf/UlRcIi/JD/1J/KLPBhtuE=; b=BJ2UtFvgVjbsDBa0J96KAgbfJ+CIYX7dWQg5QQpcXU+WnCE+e85egt7UoP+CpPfGpq d67xtvBFTAZI2YbDWoluKpx+0OZ4Mo64TpY95x2O8zhSv4NxojTQ12D+g7mQdYzaSVDd Gyn7MpVpBdDSSfSmZ94oaG2RhtiK73FuGU/8mAck0kYqJ2YMsUmeXR46Y+314YnJeo7r zZ5mfolWoVbzifI+HZaMdYVrBZAKRXRHFGIABIl2FzhzDf+WIdR+v1zUeMsEst/4R1Vd RMwvh7DvaSE/wm14TTTIUimtZjpdDF/XHRXH7xV+hFG4GGZOJUz3QJfvKH/FOcIH34Rb +znQ==
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=5By2yMelMee7oscWk9PTf/UlRcIi/JD/1J/KLPBhtuE=; b=WV3ieSt6EKAYC/o7sQerVcilkqeyTL2Ux94+M8RHkHgOY43wAf2drEFcYv5MPUD9Wb fXY3HjGHPpnE230npO35evgpkDlE7SeRt/ndnUkoSgdPZkzhTfPqS+EsHEznYsNkKjm9 RiuReQP6rq+fWlo1nI56RcsrQZs/rO01nuuIKzyou0mOp5sVQFMgLGZ+Xi+isa1AUu4c +DvUAU6Yl8Xil9aQzJxd9mwyeXtmD1K6J1Oe7og4/yS4qLWL6ftKydTdNDxqONTralfF 8kcCwzWinB8i7D7cM0dCunt5iMmxd6KbYTILSPBjIuMZFrnms6nB++AzdIMmpqqWI5Ma SGGQ==
X-Gm-Message-State: AKS2vOwNLAlidip2TIK1f+qzdQtyxklzkMiXn1rKSJJqrN7RyTh8chWT TJ7N/hL3lZ4w7XXLkytNSIM/ol8lTGzq
X-Received: by 10.129.146.15 with SMTP id j15mr1508199ywg.283.1498183810752; Thu, 22 Jun 2017 19:10:10 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.37.208.3 with HTTP; Thu, 22 Jun 2017 19:09:49 -0700 (PDT)
In-Reply-To: <9bf0712b00e540eeafdd3e6f357c2845@usma1ex-dag1mb5.msg.corp.akamai.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> <CAGD1bZbX1gTOh=LpQqLre8qgfB91=JrTCpYExzWMuBPo=V5_eA@mail.gmail.com> <9bf0712b00e540eeafdd3e6f357c2845@usma1ex-dag1mb5.msg.corp.akamai.com>
From: Ian Swett <ianswett@google.com>
Date: Thu, 22 Jun 2017 22:09:49 -0400
Message-ID: <CAKcm_gMNc6ELTHdfjeoxwUiP-t+gAxduk3ZJ+6gw_=g4s_MLCA@mail.gmail.com>
Subject: Re: Unidirectional streams PR
To: "Lubashev, Igor" <ilubashe@akamai.com>
Cc: Jana Iyengar <jri@google.com>, Mike Bishop <Michael.Bishop@microsoft.com>, Ted Hardie <ted.ietf@gmail.com>, QUIC WG <quic@ietf.org>, Martin Thomson <martin.thomson@gmail.com>, Patrick McManus <pmcmanus@mozilla.com>
Content-Type: multipart/alternative; boundary="94eb2c094216d9b25f055297192f"
Archived-At: <https://mailarchive.ietf.org/arch/msg/quic/bMKQQC9AF8O6BsPB_hffP91BjdI>
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 02:10:15 -0000

On Thu, Jun 22, 2017 at 9:49 PM, Lubashev, Igor <ilubashe@akamai.com> wrote:

> I think of three layers of abstraction:
>
>
>
> 1.       QUIC Wire Protocol (the thing described by the QUIC Transport
> RFC)
>
> 2.       QUIC Library API (a library exposing some useful abstractions --
> such as blocking/non-blocking unidirectional streams and bidirectional
> “sockets” -- and implementing them using QUIC Wire Protocol)
>
> 3.       Application (something that uses QUIC Library APIs)
>
>
>
> What I am saying is that Martin’s unidirectional streams proposal does not
> have a way to implement generic bidirectional socket-like abstractions on
> the QUIC Library API layer.  However, if we follow Mike’s suggestion and
> allow an Associated Stream ID in OPEN_STREAM frames, this would make it
> easy for QUICK Libraries to provide generic bidirectional socket-like
> abstractions.
>
>
>
> So what I am suggesting is that we keep QUIC Wire Protocol state machine
> simple and unchanged.  However, with the OPEN_STREAM frame, we would allow
> QUIC Libraries to implement both unidirectional and bidirectional streams.
>
>
>
> -          Igor
>
> Igor, I think you and I are in agreement that we both want a relatively
easy way of doing both unidirectional streams as well as bidirectional
streams?  Given that, it comes down to what to standardize at the transport
layer and some framing.

In regards to the unidirectional only model:
 1) The QUIC stream state machine is really not that complex, and the
current documentation does a nice job of explaining it.  Changing to
unidirectional only streams only saves 2 states, from 5 to 3, and a small
bit of text.
 2) I'm very concerned that if we don't standardize a way to do
bidirectional streams, different 'QUIC Library API's will internally
standardize on different approaches for recreating bidirectional streams.
I fear this may create more work and interoperability challenges down the
road.

So if we think literally no one will have any use for the bidirectional
stream model, then I agree we should remove it.  But even today, the HTTP
mapping is simpler with the bidirectional stream model than with only
unidirectional streams, which means the total amount of work of
implementing HTTP + QUIC is about the same either way, and I believe if
bidirectional streams and unidirectional streams do exist in QUIC(as in my
PR above), then the HTTP would/should use both.


>
>
>
>
> *From:* Jana Iyengar [mailto:jri@google.com]
> *Sent:* Thursday, June 22, 2017 9:26 PM
> *To:* Lubashev, Igor <ilubashe@akamai.com>
> *Cc:* Mike Bishop <Michael.Bishop@microsoft.com>; Ted Hardie <
> ted.ietf@gmail.com>; QUIC WG <quic@ietf.org>; Martin Thomson <
> martin.thomson@gmail.com>; Patrick McManus <pmcmanus@mozilla.com>
>
> *Subject:* Re: Unidirectional streams PR
>
>
>
> On Thu, Jun 22, 2017 at 6:06 PM, Lubashev, Igor <ilubashe@akamai.com>
> wrote:
>
> 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.
>
>
>
> I'm not sure I follow your thinking here: are you suggesting that QUIC
> implement bidirectional streams in addition to unidirectional streams?
>
>
>
> - jana
>
>
>
>
> 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).
>
>
>