Re: Unidirectional streams PR

Subodh Iyengar <subodh@fb.com> Thu, 06 July 2017 05:17 UTC

Return-Path: <prvs=83607bf038=subodh@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 E8763126BF7 for <quic@ietfa.amsl.com>; Wed, 5 Jul 2017 22:17:14 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.72
X-Spam-Level:
X-Spam-Status: No, score=-2.72 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, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-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=HKyKlY0y; dkim=pass (1024-bit key) header.d=fb.onmicrosoft.com header.b=iSTVSdiQ
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 1XSOFESqMeJk for <quic@ietfa.amsl.com>; Wed, 5 Jul 2017 22:17:10 -0700 (PDT)
Received: from mx0b-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 5BBA61200CF for <quic@ietf.org>; Wed, 5 Jul 2017 22:17:10 -0700 (PDT)
Received: from pps.filterd (m0109331.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v665Ddw3011124; Wed, 5 Jul 2017 22:17:01 -0700
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : mime-version; s=facebook; bh=nzpq1GPQVWxfRhD8q3A8ouMqouwUnjpro7Ddh9QgxpI=; b=HKyKlY0y2Ui0g1BXvwyDjL3hGvtcjfKZZhFga1GXyL1THswI6P8TPaSWsOYmnuhppfh8 vBVPryy+U4Y2nZ6V+u6hKv8YvEwP8KR17Jn1wqf6O6d1kXKAiEDovYqD9Mc8oVOo/9YB NLk3gbs2z0ldhiG+U6KntxXuazifgjuSQ54=
Received: from mail.thefacebook.com ([199.201.64.23]) by mx0a-00082601.pphosted.com with ESMTP id 2bhbg68jmb-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Wed, 05 Jul 2017 22:17:01 -0700
Received: from NAM01-BY2-obe.outbound.protection.outlook.com (192.168.54.28) by o365-in.thefacebook.com (192.168.16.18) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 5 Jul 2017 22:16:59 -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=nzpq1GPQVWxfRhD8q3A8ouMqouwUnjpro7Ddh9QgxpI=; b=iSTVSdiQgnYpH082WGUOiyZS5xd7D6qkQIvM3zpGBmSG+QyYFCpnxP4JVTpS+bIrGowlaU7GlsRxHUSz2X1aJoaHXQ49vPcwA5Zz/vtYkLKkGghwmQH/7WnA8amxgBA/dv7chxhUUC6P4SvAR8zQOK0m6HTY7rR0tZHPUbgd5vM=
Received: from MWHPR15MB1455.namprd15.prod.outlook.com (10.173.234.145) by MWHPR15MB1455.namprd15.prod.outlook.com (10.173.234.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1220.11; Thu, 6 Jul 2017 05:16:57 +0000
Received: from MWHPR15MB1455.namprd15.prod.outlook.com ([10.173.234.145]) by MWHPR15MB1455.namprd15.prod.outlook.com ([10.173.234.145]) with mapi id 15.01.1220.018; Thu, 6 Jul 2017 05:16:56 +0000
From: Subodh Iyengar <subodh@fb.com>
To: "Lubashev, Igor" <ilubashe@akamai.com>, Kazuho Oku <kazuhooku@gmail.com>, Ian Swett <ianswett@google.com>
CC: Mike Bishop <Michael.Bishop@microsoft.com>, Dmitri Tikhonov <dtikhonov@litespeedtech.com>, "Swindells, Thomas (Nokia - GB/Cambridge, UK)" <thomas.swindells@nokia.com>, Jo Kulik <jokulik@google.com>, Mikkel Fahnøe Jørgensen <mikkelfj@gmail.com>, QUIC WG <quic@ietf.org>, Martin Thomson <martin.thomson@gmail.com>
Subject: Re: Unidirectional streams PR
Thread-Topic: Unidirectional streams PR
Thread-Index: AQHS7K8qYA+OJNlgCk66zUVoUQGXHqI0Yv6AgATdKACAAP5zgIAAEIwAgAAHqgCAAA02gIAAfdKAgAARSACAAAzfAIAAEzGAgAm2IgCAAXM4gIAAEPcY
Date: Thu, 06 Jul 2017 05:16:56 +0000
Message-ID: <MWHPR15MB14552E4F7BB6BE5FB43A58FDB6D50@MWHPR15MB1455.namprd15.prod.outlook.com>
References: <CAN1APdc_ckZu39ZZTETv04iZieogoE_NQCBR-n0jHrC-9dM7Aw@mail.gmail.com> <5d69489d-8f46-ebbe-4e5c-fa6c02ffd8dd@huitema.net> <CAF4GZgBm7525i2GxiN-Pv66g0WqbDH==fRXN27=7ursNA70w1Q@mail.gmail.com> <20170628124221.GA15608@ubuntu-dmitri> <CAN1APdc3YO4-FEc6C--PzFGxzQiAUeBZ96HkjtjS1RR0qigrzw@mail.gmail.com> <CAE=ybzNtSZx9-bj9-n-ieLMB=YvJCjCExugvA3_JPVrdEEqK9A@mail.gmail.com> <DB5PR07MB123748F2AB7374DAC0CC9E1484DD0@DB5PR07MB1237.eurprd07.prod.outlook.com> <MWHPR21MB0141BD23011EB26F882C864787DD0@MWHPR21MB0141.namprd21.prod.outlook.com> <CABkgnnXEq9-jxedU_Rmi4XQ+t0SNUOAMbyWXcnhyLKz+OzP2CQ@mail.gmail.com> <2240c2a68910453e97fc50d42e8a1d4f@usma1ex-dag1mb5.msg.corp.akamai.com> <CAKcm_gMb9PkBKhTRF3ue2KGgwHgKN8rsanD8rqqr_wUFJ3GNZQ@mail.gmail.com> <CANatvzyKsi=+V1rYSjYwtkuGnui=V_1f0bbq1iCB36p2GJXDbQ@mail.gmail.com>, <ab4e5580e8c14a8a9f2eecc87e8c9976@usma1ex-dag1mb5.msg.corp.akamai.com>
In-Reply-To: <ab4e5580e8c14a8a9f2eecc87e8c9976@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=fb.com;
x-originating-ip: [2601:602:9801:6840:19e0:3a44:6a42:e831]
x-ms-publictraffictype: Email
x-microsoft-exchange-diagnostics: 1; MWHPR15MB1455; 20:7lmh/IOgghMe0qBnU6E0ILkuXwf5R9DGWFXVt7NxdeuA4ivfSfFr+OkkOF9Sl4Sw5GGVcRv8sL8eg/dw1zc/0bi9T8E3AzOrBk8jrzKH3ORk4mrjXXnNPbyUdPldPwOhPSwbWup6XCd+m0xTlgalD3cUOlMgaPorD/ninK3ibK0=
x-ms-office365-filtering-correlation-id: eaacea26-0fcc-4150-fa33-08d4c42e38ed
x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254075)(300000503095)(300135400095)(2017052603031)(201703131423075)(201703031133081)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:MWHPR15MB1455;
x-ms-traffictypediagnostic: MWHPR15MB1455:
x-microsoft-antispam-prvs: <MWHPR15MB1455D6DED93922C869BC30E6B6D50@MWHPR15MB1455.namprd15.prod.outlook.com>
x-exchange-antispam-report-test: UriScan:(158342451672863)(133145235818549)(278428928389397)(166708455590820)(26388249023172)(236129657087228)(192374486261705)(82608151540597)(48057245064654)(211936372134217);
x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(8121501046)(5005006)(2017060910042)(93006095)(93001095)(100000703101)(100105400095)(10201501046)(3002001)(6041248)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(20161123558100)(20161123555025)(20161123564025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:MWHPR15MB1455; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:MWHPR15MB1455;
x-forefront-prvs: 03607C04F0
x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(39410400002)(39850400002)(39400400002)(39840400002)(39450400003)(55674003)(377454003)(24454002)(51444003)(377424004)(13464003)(478600001)(7736002)(3660700001)(606006)(6436002)(966005)(68736007)(14454004)(53936002)(3280700002)(45080400002)(8676002)(25786009)(6246003)(54356999)(50986999)(53546010)(81166006)(39060400002)(102836003)(6116002)(38730400002)(76176999)(77096006)(54906002)(55016002)(9686003)(2906002)(229853002)(561944003)(99286003)(2950100002)(6306002)(54896002)(3480700004)(7416002)(189998001)(86362001)(5660300001)(236005)(33656002)(7116003)(7696004)(6506006)(4326008)(8666007)(74316002)(93886004)(53946003)(8936002)(2900100001); DIR:OUT; SFP:1102; SCL:1; SRVR:MWHPR15MB1455; H:MWHPR15MB1455.namprd15.prod.outlook.com; FPR:; SPF:None; MLV:ovrnspm; PTR:InfoNoRecords; LANG:en;
spamdiagnosticoutput: 1:99
spamdiagnosticmetadata: NSPM
Content-Type: multipart/alternative; boundary="_000_MWHPR15MB14552E4F7BB6BE5FB43A58FDB6D50MWHPR15MB1455namp_"
MIME-Version: 1.0
X-MS-Exchange-CrossTenant-originalarrivaltime: 06 Jul 2017 05:16:56.6867 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 8ae927fe-1255-47a7-a2af-5f3a069daaa2
X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR15MB1455
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-07-06_02:, , signatures=0
Archived-At: <https://mailarchive.ietf.org/arch/msg/quic/5hZzjClIBDEM39VZuXccHzt5Ul0>
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: Thu, 06 Jul 2017 05:17:15 -0000

> Without such a signal, a generic proxy that is not aware of your application internals is not able to know when to send the FIN

I see, this use case does make somewhat sense, however I'm curious if someone has a concrete use case for a generic QUIC proxy which is not aware of the application protocol at all. In TCP this was more common for middleboxes to do because there was no end to end encryption of the transport, however QUIC is encrypted. Even with cases when we tunneling protocols at our end, we usually have some knowledge of the app that we are running because we need to route them differently to different backends. I was mostly thinking that proxies would at least have some knowledge about HTTP/2 or app protocols.

Maybe it is possible to make #656 more palatable, at least to me. I had 2 things against it initially, which were:


  1.  We might need to add another state to the machine to the sender state, i.e. normally when sending a FIN, it is ok to keep receiving stream frames after, however in a uni directional stream it is illegal to get a stream frame.
  2.  In its current form it also has an implicit requirement to not open lower streams. I think opening lower streams have some desirable properties which I've commented on in https://github.com/quicwg/base-drafts/issues/662.

An implementation could probably implement 1. with not too much trouble by doing a special case in the stream state machine when it receives a stream frame in the half closed local state.

For 2. thinking about it a bit more I think the underlying question here is who enforces directionality, i.e. did I receive data I should not have. If it is the transport, then we need to answer that question with issue #662, however if it can be the application or a higher layer API between the application and transport that enforces directionality then we don't need to know whether a lower stream is bi-directional or not. I'm leaning towards an API between the transport and application enforcing directionality. The reason for that is that an application that needs to use unidirectionality needs to use a different API anyway. Given that we could leave lower streams to be opened as it is now, but leaving the exact semantics of enforcing bi-directionality or uni-directionality to a higher layer. That should suffice for even a generic proxy right?

I still prefer do nothing with app directed close though.

> But I do not think that we should require every application protocol built above QUIC to do its own framing.

Second Kazuho on this one.

Subodh

________________________________
From: QUIC <quic-bounces@ietf.org> on behalf of Lubashev, Igor <ilubashe@akamai.com>
Sent: Wednesday, July 5, 2017 8:50:05 PM
To: Kazuho Oku; Ian Swett
Cc: Mike Bishop; Dmitri Tikhonov; Swindells, Thomas (Nokia - GB/Cambridge, UK); Jo Kulik; Mikkel Fahnøe Jørgensen; QUIC WG; Martin Thomson
Subject: RE: Unidirectional streams PR

> If a client needs a way to reset the server's response before observing the first frame, it cannot use FIN as an indicator of the end of the request.

There is a DISINTEREST frame proposal (PR #171: https://github.com/quicwg/base-drafts/pull/171).  That's something that I believe is valuable independent of this Unidirectional streams PR.

- Igor


-----Original Message-----
From: Kazuho Oku [mailto:kazuhooku@gmail.com]
Sent: Wednesday, July 05, 2017 1:41 AM
To: Ian Swett <ianswett@google.com>
Cc: Lubashev, Igor <ilubashe@akamai.com>; Mike Bishop <Michael.Bishop@microsoft.com>; Dmitri Tikhonov <dtikhonov@litespeedtech.com>; Swindells, Thomas (Nokia - GB/Cambridge, UK) <thomas.swindells@nokia.com>; Jo Kulik <jokulik@google.com>; Mikkel Fahnøe Jørgensen <mikkelfj@gmail.com>; QUIC WG <quic@ietf.org>; Martin Thomson <martin.thomson@gmail.com>
Subject: Re: Unidirectional streams PR

2017-06-29 10:23 GMT+09:00 Ian Swett <ianswett@google.com>:
> I updated my PR(#656) today, sorry for the delay.  I attempted to
> address the issues identified with text.  Some may prefer more tweaks
> to the state diagram, which are also possible, so I'm open to suggestions.

After all, I think that the approach proposed here is the most well-balanced one.

As much as I think that having first-class support for unidirectional streams is preferable, I also think that we should keep the overall architecture (i.e. sum of the complexity in the transport layer and the application layer) as simple as possible.

IMO having support for bidirectional streams (along with support for unidirectional streams) aligns with such intention.

Most of the application protocols that will be deployed over the QUIC transport will be in request-response style, at least to some extent.
Hence it is preferable for the transport layer to provide a framework that fits such style.

Bidirectional streams provide the necessary features. FIN provides a way to indicate the end of the message. RST provides a way to cancel the exchange of the message in both directions.

IMO the biggest issue with the unidirectional-only approach is that you cannot have the two features together. If a client needs a way to reset the server's response before observing the first frame, it cannot use FIN as an indicator of the end of the request.

It is true that the issue can be evaded by doing one's own framing in the application layer. #643 does that by introducing a CANCEL_REQUEST frame.

But I do not think that we should require every application protocol built above QUIC to do its own framing. In addition to that, need to keep two uni-directional streams open would consume more resources than being able to close one direction of a bi-directional stream at an earlier moment.

> In the meantime, I've been considering other alternatives, including
> variations on Mike's direction and a variation of the "Do Nothing"
> option which involved the application signaling to the transport that
> streams of a certain sort(ie: server to client for server push) were
> unidirectional, as GQUIC does today.  Overall, I think the approach
> I've outlined does a good job of iterating on existing deployment
> experience and adding explicit signaling for unidirectional streams
> instead of implicit signaling at the application layer.  There are
> pros and cons to both explicit and implicit signaling, but I think
> explicit signaling is more complete and less prone to application error.
>
> Thanks, Ian
>
>
> On Wed, Jun 28, 2017 at 8:14 PM, Lubashev, Igor <ilubashe@akamai.com> wrote:
>>
>> > unless what the transport provides is a perfect fit for application
>> > semantics, you end up building those semantics into the application anyway.
>>
>> I agree with this. We should avoid adding complexity into transport
>> for rare use cases, since it goes against KISS principle.
>>
>> On the other hand, adding support for a by far the most common use
>> case makes a lot of sense.  This helps apps avoid screwing up
>> implementing that common case and lets us optimize that common case
>> in the lower layer. BiDi streams are such common cases. Uni streams
>> are likely to be the second-most-common cases (hence you offered this PR to optimize them).
>>
>>
>> The Associated Streams proposal offers extra semantic flexibility at
>> a cost of some semantic complexity (someone would need to verify that
>> the associated stream numbers make sense -- api? apps?) and a few extra bytes.
>>
>> I'd like to wait to see Ian's revised proposal.  The initial proposal
>> offered to do only one thing -- offer a choice of uni/bi-directional
>> streams
>> -- but it did it in a very simple way, which is nice.
>>
>> - Igor
>>
>>
>> -----Original Message-----
>> From: Martin Thomson [mailto:martin.thomson@gmail.com]
>> Sent: Wednesday, June 28, 2017 7:28 PM
>> To: Mike Bishop <Michael.Bishop@microsoft.com>
>> Cc: Swindells, Thomas (Nokia - GB/Cambridge, UK)
>> <thomas.swindells@nokia.com>; QUIC WG <quic@ietf.org>; Mikkel Fahnøe
>> Jørgensen <mikkelfj@gmail.com>; Dmitri Tikhonov
>> <dtikhonov@litespeedtech.com>; Jo Kulik <jokulik@google.com>
>> Subject: Re: Unidirectional streams PR
>>
>> There is probably a simpler approach here, take a bit (as Ian did)
>> and say that if that bit is set, then the stream is in response to
>> another and the stream ID of the stream to which this is responding
>> follows immediately after the stream ID of the stream itself.  You
>> could then include that only at the start of the stream, or in multiple frames (or as we decide).
>>
>> The problem with this, as with several of the other issues we're
>> discussing, is that unless what the transport provides is a perfect
>> fit for application semantics, you end up building those semantics
>> into the application anyway.  HTTP certainly can't survive without
>> its own association semantics for pushes.  That suggests to me that
>> having bidirectional semantics in the transport creates more
>> duplication than otherwise.  Hence my proposal.
>>
>> On 28 June 2017 at 15:26, Mike Bishop <Michael.Bishop@microsoft.com>
>> wrote:
>> > As promised, a PR for adding “associated streams” is at
>> > https://github.com/quicwg/base-drafts/pull/672.  This very
>> > deliberately builds on top of MT’s PR – it’s adding a primitive
>> > which can be used to construct various abstractions atop
>> > unidirectional streams, but the lifecycle is still fundamentally unidirectional.
>> >
>> >
>> >
>> > Copying my notes here for list discussion purposes.
>> >
>> > Major changes
>> >
>> > Leveraging @igorlord's insight that OO=00 only occurs on the first
>> > STREAM frame of a stream, I used that as the trigger for a Stream
>> > Properties byte.
>> > Two bits of that byte describe the directionality of the stream:
>> >
>> > Unidirectional (no response expected) Initial bidirectional (one
>> > response expected) Initial multi-response (one or more responses
>> > expected; needs a better name) Response
>> >
>> > If the type is Response, there's an Associated Stream ID field,
>> > length given by two more bits following the same pattern as the SS
>> > bits in the STREAM frame ID.
>> >
>> > Personal Opinion
>> >
>> > On the plus side, these stream types seem to cover the abstractions
>> > I can envision for most applications. You can unilaterally send
>> > something (unidirectional), do request/response (bidirectional), or
>> > pub/sub (single subscription stream, series of update streams).
>> >
>> > I don't care for the fact that I still need the stream type header
>> > in HTTP after putting this in the transport. That will be
>> > ameliorated if we go back to one stream per request, since all
>> > unidirectional streams will be push streams. (As a side-note, I
>> > considered using the multiple-response option in the HTTP mapping,
>> > but then I need a stream header again to indicate which is the
>> > response and which the pushes.)
>> >
>> > I particularly don't like that you now have to look at the frame
>> > type header to find out whether a field exists which tells you the
>> > length of something else in the header. I'd like to simplify that.
>> > I went with this model over a CREATE_STREAM frame because of
>> > @mikkelfj's use-case of very small messages
>> > -- this adds only one byte to the first frame on a stream in one
>> > direction and 2-5 bytes to the first frame of response streams. A
>> > separate frame type would be somewhat larger, but could be cleaner
>> > in that respect.
>> >
>> >
>> >
>> >
>> >
>> > From: QUIC [mailto:quic-bounces@ietf.org] On Behalf Of Swindells,
>> > Thomas (Nokia - GB/Cambridge, UK)
>> > Sent: Wednesday, June 28, 2017 7:56 AM
>> > To: Jo Kulik <jokulik@google.com>; Mikkel Fahnøe Jørgensen
>> > <mikkelfj@gmail.com>
>> > Cc: QUIC WG <quic@ietf.org>; Dmitri Tikhonov
>> > <dtikhonov@litespeedtech.com>
>> > Subject: RE: Unidirectional streams PR
>> >
>> >
>> >
>> > I agree that looking at the layers of abstraction is useful. In
>> > principle having the wire protocol just have constructs for
>> > unidirectional streams does not in itself limit creating
>> > bi-directional communication flows, supported at either the library
>> > or application layer.
>> >
>> >
>> >
>> > However, there need to be a standard way of doing bi-directional
>> > communication for migrating applications implemented using a socket
>> > style api. It needs to be easy to move an existing application from
>> > TCP to QUIC.
>> > This move may be attractive in many situations as QUIC gives
>> > improved security and may allow greater throughput due to the more
>> > modern (and
>> > customizable) congestion control algorithms compared to the OS TCP
>> > stack.
>> >
>> >
>> >
>> > For migrating standard socket api applications I don’t think it
>> > would be appropriate to leave the work to the application to do
>> > correlation, at least the library should be providing this service
>> > using the wire protocol as appropriate. Clearly we want a client
>> > written with one library to be able to communicate successfully
>> > with a server written using a different library.
>> > This needs some form of standardization of the signalling. This
>> > could either be a building block overlay on top of QUIC, or
>> > implemented at the wire protocol level.
>> >
>> >
>> >
>> > In terms of patterns I think the following may be some of the most
>> > common patterns (with potential to be provided at the library and
>> > or wire protocol level).
>> >
>> > I/O pattern  : Example
>> >
>> > 1/0   : An input only flow, perhaps a data logger like syslog with no
>> > confirmation/feedback
>> >
>> > 0/1  : an output only flow, perhaps a topic message bus service
>> > with no confirmation/feedback
>> >
>> > 1/1 : standard TCP applications with a single flow per connection
>> >
>> > 1/* : single input, many output, modelling STDIN/STDOUT+STDERR
>> >
>> > (1/1)* : multiplexed pairs of flows – supporting multiple sockets
>> > muxed onto a single QUIC connection
>> >
>> >
>> >
>> > Obviously, an application would always have the option to combine
>> > any single direction flows with application level correlators to
>> > construct more complex flows if desired.
>> >
>> >
>> >
>> > At the moment my gut says the 1/1 use-case is common enough that
>> > the wire protocol should provide a standard mechanism to support it
>> > as a standard overlay would probably end up being treated as part
>> > of the wire format anyway.
>> >
>> >
>> >
>> > Perhaps streams should be explicitly created with a CREATE_STREAM
>> > frame which would be capable of defining multiple related streams?
>> >
>> > There is the option of whether only (1/1) pairs can be created this
>> > way, or
>> > (1/n) combinations could be supported (with an application defined
>> > way to identify the use of each of the output streams). A step
>> > further may be that there is a transport parameter that defines
>> > whether the server is allowed to create additional streams, or if
>> > stream creation is purely client driven (like TCP). I don’t know if
>> > either of these would simplify how to handle stream accounting, and
>> > in particular only creating a flow when all parties have sufficient allowances left.
>> >
>> >
>> >
>> > Thomas
>> >
>> >
>> >
>> > From: QUIC [mailto:quic-bounces@ietf.org] On Behalf Of Jo Kulik
>> > Sent: 28 June 2017 15:09
>> > To: Mikkel Fahnøe Jørgensen <mikkelfj@gmail.com>
>> > Cc: QUIC WG <quic@ietf.org>; Dmitri Tikhonov
>> > <dtikhonov@litespeedtech.com>
>> > Subject: Re: Unidirectional streams PR
>> >
>> >
>> >
>> > I'd like to pop back up to a comment Igor made last week, because I
>> > find it helpful in thinking about the design space:
>> >
>> >
>> >
>> > 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)
>> >
>> > I think there is some argument to be made that Martin's original
>> > proposal did not take into account how we would achieve (2) for
>> > bi-directional streams.  (I don't think it strictly said "thou
>> > shalt not do (2)" either, but that is up to interpretation.)
>> >
>> >
>> >
>> > Several people have argued that we do not want every application to
>> > have to re-implement bi-directional streams (3) for every
>> > application, and this is not how g-quic (our largest deployment) works right now.
>> > These arguments make sense to me, but YMMV.
>> >
>> >
>> >
>> > Just because the particular *mechanism* that is being proposed has
>> > some issues, however, doesn't scream out to me, at least, that we
>> > should abandon this particular *design goal*.  The goal being a
>> > transport protocol that can elegantly fit with a uni/bi stream model.
>> > Now, if we conclude that there can never be an elegant model that
>> > achieves this goal, then so be it.  But I also feel like we haven't
>> > reached that point in the discussion yet.  (At the very least, this
>> > discussion has been fruitful to me in terms of mapping the design
>> > space and elucidating requirements).
>> >
>> >
>> >
>> > One of the reasons I still think this design goal is under
>> > consideration is that Ian and Igor/Mike have been talking about
>> > alternate solutions which have a similar flavor.  During the recent
>> > "quiet"ness on the thread, personally, I've been waiting to hear
>> > more from them.
>> >
>> >
>> >
>> > On Wed, Jun 28, 2017 at 9:41 AM, Mikkel Fahnøe Jørgensen
>> > <mikkelfj@gmail.com> wrote:
>> >
>> > In reply to Ranjeeth
>> >
>> >
>> >
>> > It is not only a matter of simplicity for the sake of simplicity:
>> >
>> >
>> >
>> > - A complex transport layer might end up being poorly implemented
>> > leading to reduced interoperability and ultimately adoption. This
>> > complexity is not only in implementation but also in understanding
>> > the exact semantics of stream lifetime. Even if the spec is
>> > sufficiently clear, it will still be open to misinterpretations.
>> >
>> >
>> >
>> > - Bi-directional state may have to be maintained longer and with
>> > more overhead than with uni-directional streams, especially under
>> > loss, potentially leading to poor performance and poor resource
>> > utilisation because the transport layer has insufficient information.
>> >
>> >
>> >
>> > - The extra complexity at the application layer may be overstated -
>> > it is significantly simpler to manage a map that associates to two
>> > streams than it is to maintain bi-directional state at the
>> > transport layer. It is even possible to implicitly link streams
>> > with same identifiers, e.g. in a RPC scenario. That said, I do see
>> > a potential benefit of a wrapper that implements the common bi-directional case.
>> >
>> >
>> >
>> > - Complexity at the application layer may be duplicated, but
>> > implementation errors are also isolated to that application.
>> > Specifically for HTTP I would assume that QUIC transport and QUIC
>> > HTTP implementers would be large the same for a long time to come,
>> > so I would not expect the tradeoff here to be particularly concerning.
>> >
>> >
>> >
>> > - Unix pipes are traditionally constructed as a pair of
>> > uni-directional file descriptors and that is a reasonably proven
>> > model. C’s standard library stdin, stdout and stderr is an example
>> > of an asymmetric model with implicit linkage between
>> > uni-directional file descriptors.
>> >
>> >
>> >
>> > - There are lots of use cases for non-HTTP like connectivity -
>> > Kafka high volume message queuing for example. The industry trend
>> > appears to move towards asynchronous processing and messaging. It
>> > depends on whether you look at QUIC as a TCP + TLS replacement, or
>> > as a HTTPS / REST RPC replacement.
>> >
>> >
>> >
>> > - Uni-directional streams may currently be unproven in the wild,
>> > but a proposal is needed before an implementation can be made and
>> > testet. I agree that it is easy to design into wrong assumptions
>> > without real world testing.
>> >
>> >
>> >
>> > - There will hopefully not be a large number of successors to QUIC
>> > - perhaps some purpose specific variants, e.g. for embedded use.
>> > Widespread adaptation and compatibility is very necessary so it
>> > makes sense to have QUIC being sufficiently simple and expressive
>> > to achieve this goal. A polymorf QUIC will not achieve that goal.
>> > On the other hand, a solid QUIC foundation can be used for a large
>> > number of application protocols.
>> >
>> >
>> >
>> > - Finally, it may turn out that uni-directional streams just is a
>> > bad idea - I doubt it, but I do believe real world tests are needed.
>> >
>> >
>> >
>> > Kind Regards,
>> >
>> > Mikkel Fahnøe Jørgensen
>> >
>> >
>> >
>> > On 28 June 2017 at 14.42.36, Dmitri Tikhonov
>> > (dtikhonov@litespeedtech.com)
>> > wrote:
>> >
>> > On Tue, Jun 27, 2017 at 02:31:38PM -0700, Ranjeeth Kumar Dasineni wrote:
>> >> 2. We are overplaying the simplicity of design. Even if we deem
>> >> deployment experience not a concern, if every application layer
>> >> protocol that needs support for bidirectional streams has to
>> >> implement some correlators and such above, that's a net negative
>> >> in terms of complexity.
>> >
>> > This is an important point: we want QUIC adoption to be made easy.
>> > A program that speaks HTTP today should be able to use an existing
>> > QUIC library without having to emulate bidirectional streams in
>> > order to fit it into HTTP usage pattern. Forcing every one of these
>> > programs to do this is certainly a hurdle.
>> >
>> > - Dmitri.
>> >
>> >
>>
>



--
Kazuho Oku