RE: Unidirectional streams PR

"Lubashev, Igor" <ilubashe@akamai.com> Sat, 01 July 2017 00:40 UTC

Return-Path: <ilubashe@akamai.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 BFB8C12EB0E for <quic@ietfa.amsl.com>; Fri, 30 Jun 2017 17:40:05 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.999
X-Spam-Level:
X-Spam-Status: No, score=-1.999 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, 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=akamai.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 1nhuD7bZOfpn for <quic@ietfa.amsl.com>; Fri, 30 Jun 2017 17:40:03 -0700 (PDT)
Received: from mx0b-00190b01.pphosted.com (mx0a-00190b01.pphosted.com [IPv6:2620:100:9001:583::1]) (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 1481E12EA5A for <quic@ietf.org>; Fri, 30 Jun 2017 17:40:03 -0700 (PDT)
Received: from pps.filterd (m0050093.ppops.net [127.0.0.1]) by m0050093.ppops.net-00190b01. (8.16.0.21/8.16.0.21) with SMTP id v610WF01029341; Sat, 1 Jul 2017 01:39:53 +0100
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=akamai.com; h=from : to : subject : date : message-id : references : in-reply-to : content-type : mime-version; s=jan2016.eng; bh=kPreFS1ABVHiPMaIp1g9NhXvwq5vOmitgRM/TqFMnp4=; b=aWUgn8bJ5wjOQ1tSz2ysPTd4EpU77Xh1Q1j7+gffcY1l++Rm1AMFS8pDG23EJBDnDM7x LIuIMzZ5fYRjcZSOPlCIiqEOzJDwR9KGjZPFpCtJnPwjxTAQe0c0zg2JnJQUaTjoEluH Zlx7OdT9l0LzW1Jq9M/lnImBcjuVvPMa2WGBTdq//eEIh48vk9VhUuJMw2gxrlKhPET/ lhVau+xWjCzecXPVWuy4AEg0N7C0F0W3HKIrL094IwVi/6X4+J4RRkhrsnrM34ISNbt6 IFAyWjcQVJ6pheG8aEzahKj5b7w2RYtQyG7mcSGSgMKrEkT6DFxMDDvZnnbRDFQxb7eR SQ==
Received: from prod-mail-ppoint2 (a184-51-33-19.deploy.static.akamaitechnologies.com [184.51.33.19] (may be forged)) by m0050093.ppops.net-00190b01. with ESMTP id 2bdcefvwue-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 01 Jul 2017 01:39:53 +0100
Received: from pps.filterd (prod-mail-ppoint2.akamai.com [127.0.0.1]) by prod-mail-ppoint2.akamai.com (8.16.0.17/8.16.0.17) with SMTP id v610a4Mh007778; Fri, 30 Jun 2017 20:39:51 -0400
Received: from email.msg.corp.akamai.com ([172.27.123.31]) by prod-mail-ppoint2.akamai.com with ESMTP id 2b9kdvdd3f-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Fri, 30 Jun 2017 20:39:51 -0400
Received: from USMA1EX-DAG1MB5.msg.corp.akamai.com (172.27.123.105) by usma1ex-dag1mb6.msg.corp.akamai.com (172.27.123.65) with Microsoft SMTP Server (TLS) id 15.0.1263.5; Fri, 30 Jun 2017 17:39:50 -0700
Received: from USMA1EX-DAG1MB5.msg.corp.akamai.com ([172.27.123.105]) by usma1ex-dag1mb5.msg.corp.akamai.com ([172.27.123.105]) with mapi id 15.00.1263.000; Fri, 30 Jun 2017 20:39:50 -0400
From: "Lubashev, Igor" <ilubashe@akamai.com>
To: "quic@ietf.org" <quic@ietf.org>, "mikkelfj@gmail.com" <mikkelfj@gmail.com>, "huitema@huitema.net" <huitema@huitema.net>, "subodh@fb.com" <subodh@fb.com>, "Michael.Bishop@microsoft.com" <Michael.Bishop@microsoft.com>
Subject: RE: Unidirectional streams PR
Thread-Topic: Unidirectional streams PR
Thread-Index: AQHS7K8qFJcNmOfPnkGlJjRXQ/9soKI0ttCAgATMZACAAP5zgIAAEIwAgAAHqgCAAA02gIAAfdKAgAARSAD//8GgUIAAXnCAgAD+vQCAAAZIgIAAHNIAgAAGBoCAAdi0AP//yFAxgABG5YD//8W33w==
Date: Sat, 01 Jul 2017 00:39:50 +0000
Message-ID: <e3d857f1a64148bd8c960052441d3caa@usma1ex-dag1mb5.msg.corp.akamai.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> <83e22460-8864-e6f7-546a-d0e77e4f8ae8@huitema.net> <MWHPR21MB0141DAB51088DE57504B12F087D20@MWHPR21MB0141.namprd21.prod.outlook.com> <176a76c7-bdcd-9007-1f26-e436f61076f3@huitema.net>, <CAN1APdcMn8ik_UFqBx7T7xPSrBpdYOD3oQgC_XRrdrz2ikFDFw@mail.gmail.com>, <DM5PR15MB14494D50B82F681CE0027483B6D30@DM5PR15MB1449.namprd15.prod.outlook.com>, <07d8c169e6a8405e9303d35b4e1f02e1@usma1ex-dag1mb5.msg.corp.akamai.com>, <MWHPR15MB1455819E649AFAF2748A836EB6D00@MWHPR15MB1455.namprd15.prod.outlook.com>
In-Reply-To: <MWHPR15MB1455819E649AFAF2748A836EB6D00@MWHPR15MB1455.namprd15.prod.outlook.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-ms-exchange-transport-fromentityheader: Hosted
Content-Type: multipart/alternative; boundary="_000_e3d857f1a64148bd8c960052441d3caausma1exdag1mb5msgcorpak_"
MIME-Version: 1.0
X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-06-30_16:, , signatures=0
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1703280000 definitions=main-1707010007
X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-06-30_16:, , signatures=0
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1703280000 definitions=main-1707010007
Archived-At: <https://mailarchive.ietf.org/arch/msg/quic/_TpRJubjkfeF0C-6D89t7x8qWTY>
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: Sat, 01 Jul 2017 00:40:06 -0000

> Why is it a layer violation, apps change state of the transport all the time

The key is the lack of explicit on-the-wire signaling of stream state transition. 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 (and get rid of its state). It has to keep the stream half-closed, ready for an endpoint to start sending data over that stream at any moment, till the end of the connection.

> PR

Thanks. I will take a look. (Three places for discussions: the list, issues, PRs...)

-----Original Message-----
From: Subodh Iyengar [subodh@fb.com]
Received: Friday, 30 Jun 2017, 8:08PM
To: Lubashev, Igor [ilubashe@akamai.com]; quic@ietf.org [quic@ietf.org]; huitema@huitema.net [huitema@huitema.net]; mikkelfj@gmail.com [mikkelfj@gmail.com]; Michael.Bishop@microsoft.com [Michael.Bishop@microsoft.com]
Subject: Re: Unidirectional streams PR


> I am worried about silent (app-directed) stream closing. This it a layering violation, since it introduces transport-layer semantics (stream state transition) that are not signaled on the wire.

Why is it a layer violation, apps change state of the transport all the time :) The way it would happen is that the transport would expose an API like closeWithoutFin() and close() which basically decide whether or not a stream is unidirectional.


app directed closing doesn't prevent a generic quic proxy from sending a FIN if it wants. The FIN will be completely consistent with the state machine. I see app directed closing as more of an optimization to not sending some extra bytes when not needed.

> As for Ian's Uni-bit proposal, the state machine is no more complicated than in the original spec. (You would probably want to add a Uni bit to RST_STREAM frame to keep stream directionality unambiguous at all times.)

See my comments on the PR. I suggested the same RST uni bit as well as there is another state transition that is missing as well, so I think it's definitely a change. Plus it makes it such that we cannot open lower streams which I think is undesirable.


Subodh

________________________________
From: Lubashev, Igor <ilubashe@akamai.com>
Sent: Friday, June 30, 2017 4:54:43 PM
To: quic@ietf.org; huitema@huitema.net; mikkelfj@gmail.com; Subodh Iyengar; Michael.Bishop@microsoft.com
Subject: RE: Unidirectional streams PR

I am worried about silent (app-directed) stream closing. This it a layering violation, since it introduces transport-layer semantics (stream state transition) that are not signaled on the wire.

Such silent stream closing would make it hard (impossible?) to write a generic QUIC proxy, for example. A generic proxy must be able to know when a stream is closed, so it can release resources. In fact, the proxy would provide a better experience, if it could also know stream priorities and other possible stream attributes explicitly.

 (The proxy may be a good idea, if you have limited devices attached to your low latency/high quality network, which is connected to the rest of the Net over high latency/low quality links. You’d deploy such a proxy, so it can maintain deep buffers, needed for communication over high latency/low quality links.)


As for Ian's Uni-bit proposal, the state machine is no more complicated than in the original spec. (You would probably want to add a Uni bit to RST_STREAM frame to keep stream directionality unambiguous at all times.)

- Igor



-----Original Message-----
From: Subodh Iyengar [subodh@fb.com]
Received: Friday, 30 Jun 2017, 7:14PM
To: Mikkel Fahnøe Jørgensen [mikkelfj@gmail.com]; quic@ietf.org [quic@ietf.org]; Christian Huitema [huitema@huitema.net]; Mike Bishop [Michael.Bishop@microsoft.com]
Subject: Re: Unidirectional streams PR

I've read through both approaches and commented on both PR with concrete issues. I would like to voice some high level thoughts as well.

I believe the purpose of the unidirectional streams exercise is two-fold: maybe reduce complexity of transport, enable applications to have easier mappings.

I have implemented the stream state machine specified in the current draft and I have to stress this very much that no matter what state diagram we specify in the draft, the implementation of the state machine will not match 1:1, there are always hidden states. One such concrete example is when you reset a stream you might want to discard any incoming data vs if you're in half closed you would want to process and buffer it. This creates a new hidden state which is not captured in the state machine.

To me personally, the initial draw for pure unidirectionality (@Martin's proposal) was to reduce the number of states in the transport to make the transport easier to implement and not so much the easier mappings of applications. We're chartered to work on HTTP/2 first and that's my primary interest as well. It seems though that in HTTP/2 the vast majority of transactions are actually bidirectional, and it only needs unidirectional support for pushes. I think unidirectional streams doesn't add new functionality to HTTP/2.

However after looking at the proposals and the feedback, as a transport implementor I'm rethinking my initial draw towards purely unidirectional streams such that I might as well take up the burden to implement bi-directionality once so that the apps can be simpler.

That being said we need some concept of unidirectionality in the transport to support the push use case for HTTP/2. It is kind of awkward right now that we need to send a FIN from the client to close a push stream.

I'm not in favor of #656 because it adds more complexity to the state machine, however I'm more of a fan of @Ian's do nothing + app dictates a manual transition, since that allows us to keep the same state machine flow and let the app get undirectionality by explicitly having the app transition the stream state machine as needed. There are some cool things in @Martin's proposal that I would actually like to see back in the HTTP mapping with bidi streams like stream headers for pushed streams, however I'd rather prefer the do nothing + manually transition states with application coordination.

Subodh
________________________________
From: QUIC <quic-bounces@ietf.org> on behalf of Mikkel Fahnøe Jørgensen <mikkelfj@gmail.com>
Sent: Thursday, June 29, 2017 12:02:09 PM
To: quic@ietf.org; Christian Huitema; Mike Bishop
Subject: Re: Unidirectional streams PR

On 29 June 2017 at 20.40.50, Christian Huitema (huitema@huitema.net<mailto:huitema@huitema.net>) wrote:

I am looking at the "mixed" scenario, in which the client would open an unidirectional stream with an associated "stream N" in the other direction. Will we say that doing so automatically pushes the server's maximum stream ID to some value greater than N?

I believe the streams need to operate independently: having endpoint A open a unidirectional stream A/N that can be responded to by endpoint B necessarily requires that B has granted A a limit of at least the value A/N. If the stream A/N permits association by one or more streams B/M initiated by B, each of those streams necessarily must be at or below the limit granted by A but only once those streams are in fact opened. Endpoint A might never grant sufficient streams to enable B to respond. The identifiers B/M chosen by B are unknown to A.

Note that there is a problem with enforcing how many streams that can be associated with A/N because A/N might be closed and gone. Keeping state is problematic. On the other hand it is trivial to reject associations with streams that have not yet been opened, especially if streams are opened in strict order. Implicit opening of lower valued streams will not work, and is not needed.