Re: Unidirectional streams PR

Ian Swett <ianswett@google.com> Fri, 23 June 2017 20:00 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 1F9E4129418 for <quic@ietfa.amsl.com>; Fri, 23 Jun 2017 13:00:02 -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 gUvS_rx1y1MY for <quic@ietfa.amsl.com>; Fri, 23 Jun 2017 12:59:59 -0700 (PDT)
Received: from mail-yb0-x22f.google.com (mail-yb0-x22f.google.com [IPv6:2607:f8b0:4002:c09::22f]) (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 E7EBD128C81 for <quic@ietf.org>; Fri, 23 Jun 2017 12:59:58 -0700 (PDT)
Received: by mail-yb0-x22f.google.com with SMTP id s9so16115319ybe.3 for <quic@ietf.org>; Fri, 23 Jun 2017 12:59:58 -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=pAqFEr7ZMYuCiUxtCOm5xHGGHBaM/CJdgurHJUU1DWQ=; b=gf1JzoXeRHfeVmuXH0s7SFCd0BH3WBqUZ+r9yf8nG+VQuIDBu0B/3kH70tv4DM9Fc1 gg1gYu2IvasHwdbz9i6dnc5QN0BKCRoFgh5ERpIKYgFvJsAgG5LThnL3fy+zmlthRRB8 +DBJ+dHyU/undW6LYXmCWwwMD142TKdXcfOmOG/z7UVr3UwnsBMEBFaxi0zI+hwlnjhM NiQxS4f+22klJ/JxGQjBoJ2SSEGtUQB/NrkD1DcW6EwUoeebiQcP+mIHMFcvalabcF6/ qu+fy3WM5IUSuDqwrCv9tEHkFu5D6Y1iYDhus41WtdBztAlSXRSe9dXEwcY6Nf7aImlX 16Dw==
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=pAqFEr7ZMYuCiUxtCOm5xHGGHBaM/CJdgurHJUU1DWQ=; b=cOgcNpnUiT6irGU+MUCG97lmrLMQyG7wCnlMbX4rPY2wLJqAqV3U1OcJVWCIjaWadW FZ4OyAkS0j4CXnvi3Gx8J98B53R3pSrR6VB+6ca9l2z4MrR386AbQmqmLvdFCX5L5MhT pomiN36QeemSJXyz6CJF3C8PtPOVfJqymRgyFkDBDc4Gw2O/A36492bkQ0dgaAgp/cPZ 9nsMllFpzYqr3VaaNFZxu5D1hX5uintYGfbg6Vk+noseRi+AaqPSFQg1HSgLe9fdl1so czza3PS9iyKgKkGjcuLnjufa4LMN46B//meNpIBmRTYYfU+XMGSHmG4WP8GWHpUz1bjN MTcQ==
X-Gm-Message-State: AKS2vOwgU3hlZh5Na3frhvmdGKHa4fcdMxP1NxRzw5j7etEyJSe4THhm U007EN+vM4rEc/fL9qrtD7bCGowM6qYn
X-Received: by 10.37.211.81 with SMTP id e78mr6796409ybf.46.1498247998032; Fri, 23 Jun 2017 12:59:58 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.37.208.3 with HTTP; Fri, 23 Jun 2017 12:59:37 -0700 (PDT)
In-Reply-To: <33a1a7ffdfe74bd5ae30266b6b4ebe35@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> <CAKcm_gMNc6ELTHdfjeoxwUiP-t+gAxduk3ZJ+6gw_=g4s_MLCA@mail.gmail.com> <2260e852b904465a9f8c9488e7e76166@usma1ex-dag1mb5.msg.corp.akamai.com> <33a1a7ffdfe74bd5ae30266b6b4ebe35@usma1ex-dag1mb5.msg.corp.akamai.com>
From: Ian Swett <ianswett@google.com>
Date: Fri, 23 Jun 2017 15:59:37 -0400
Message-ID: <CAKcm_gPB24GNtqmKHEh6DiOdCKYeVCYGjTPhdREsqEirqWz7QA@mail.gmail.com>
Subject: Re: Unidirectional streams PR
To: "Lubashev, Igor" <ilubashe@akamai.com>
Cc: Mike Bishop <Michael.Bishop@microsoft.com>, Ted Hardie <ted.ietf@gmail.com>, Patrick McManus <pmcmanus@mozilla.com>, Jana Iyengar <jri@google.com>, QUIC WG <quic@ietf.org>, Martin Thomson <martin.thomson@gmail.com>
Content-Type: multipart/alternative; boundary="94eb2c147c3cb5b6160552a60b69"
Archived-At: <https://mailarchive.ietf.org/arch/msg/quic/CV3EdEAK8m7QNqcG4LlYOkySFY0>
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 20:00:02 -0000

Igor,

In terms of the extra state, I believe EKR's right that this either creates
a need to change some text or add another state, which I hadn't
anticipated, but also isn't the end of the world.  However, Buck Krasic
pointed out we can now get rid of implicitly opened streams, because we've
transitioned from stream limits to max stream ID, which fixes this problem
in a simple way.  See issue #662
<https://github.com/quicwg/base-drafts/issues/662>.

I attempted to add text to specify that if a STREAM frame specifies UNI on
one packet, it must do so on all of them, but the text wasn't written
correctly, so I'll fix that in the PR.  I did consider whether to mark all
STREAM frames or only the first.  In the end, I proposed to mark all of
them because it's more resilient to reordering and it's easy to document
and understand.  I'm certainly open to other framings.





On Fri, Jun 23, 2017 at 1:31 AM, Lubashev, Igor <ilubashe@akamai.com> wrote:

> Ian, I am not in love with a possibility of having UNI flag clear on some
> initial STREAM frames and then UNI set on subsequent STREAM frames.  The PR
> does not prohibit this.  I read the PR (state diagram) to require the
> stream to go immediately into “half-closed (local)” state on receipt of
> such STREAM+UNI frame.  This is a problem, since some packets from the
> receiver to the sender could be in flight, and absent a STREAM+FIN or
> RST_STREAM from the receiver, the sender cannot do flow control accounting.
>
>
>
> It seems best if a stream is UNI or BI from birth, and that’s indicated by
> the initial STREAM frame only.  If STREAM frames get reordered, until the
> receiver receives the initial STREAM frame (Offset=0), it should consider
> the stream to be in “implicit” state (do accounting for max stream count
> and flow control but cannot send data to it).
>
>
>
>
>
> *From:* Lubashev, Igor [mailto:ilubashe@akamai.com]
> *Sent:* Thursday, June 22, 2017 10:43 PM
> *To:* Ian Swett <ianswett@google.com>
> *Cc:* Mike Bishop <Michael.Bishop@microsoft.com>; Ted Hardie <
> ted.ietf@gmail.com>; Patrick McManus <pmcmanus@mozilla.com>; Jana Iyengar
> <jri@google.com>; QUIC WG <quic@ietf.org>; Martin Thomson <
> martin.thomson@gmail.com>
> *Subject:* RE: Unidirectional streams PR
>
>
>
> Yes, we are in an agreement that we want “QUIC Libraries” to provide an
> easy way of doing both unidirectional streams as well as bidirectional
> streams.
>
>
>
> I do not have a strong preference as to the details of framing. On one
> hand, I am not worried about libraries implementing bidirectional streams
> differently with OPEN_STREAM – there is really just one sane way of doing
> it, and the OPEN_STREAM model is more flexible.  On the other hand,
> OPEN_STREAM comes at a cost of a few extra bytes for a simple bidirectional
> stream implementation.
>
>
>
> The UNI does complicate the state machine a bit by adding an extra state,
> as ekr pointed out.  You need a special state for implicitly opened
> streams.  They are not “idle” (they count toward the max), and they are not
> “open” (you cannot write to them), and they are not “local half-closed”
> (they may transition to “open”).  I do not think this is a huge deal,
> though – TCP has a lot more states!
>
>
>
>
>
> *From:* Ian Swett [mailto:ianswett@google.com <ianswett@google.com>]
> *Sent:* Thursday, June 22, 2017 10:10 PM
> *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>
> *Subject:* Re: Unidirectional streams PR
>
>
>
> 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.
>
>
>