Re: Partially Reliable Message Stream

Jana Iyengar <jri.ietf@gmail.com> Thu, 31 May 2018 20:37 UTC

Return-Path: <jri.ietf@gmail.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 8CEEF131795 for <quic@ietfa.amsl.com>; Thu, 31 May 2018 13:37:31 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.698
X-Spam-Level:
X-Spam-Status: No, score=-2.698 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, 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=gmail.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 vHYzrW_aRrU9 for <quic@ietfa.amsl.com>; Thu, 31 May 2018 13:37:28 -0700 (PDT)
Received: from mail-it0-x230.google.com (mail-it0-x230.google.com [IPv6:2607:f8b0:4001:c0b::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 1F7C91320DD for <quic@ietf.org>; Thu, 31 May 2018 13:37:28 -0700 (PDT)
Received: by mail-it0-x230.google.com with SMTP id c3-v6so29701371itj.4 for <quic@ietf.org>; Thu, 31 May 2018 13:37:28 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=TtrcnQ6clRfd6Ws7fFc55SUWNKwc0obTiiEHnjxNf5U=; b=DG25G9Xj1Ck8P45jsoZHjzy0cdAsu5AEQ48w0l5HDIgk60JPQrywURRjgbXFQXy+LS p5ddgVRr4J8aJGiXugtX5aSqXegcXjKYO90yXEahFnz5qaNyCPQWjCeVBqbS65vtfdXP Eobr6j0eXpZLj44GN+AqN/I1lyfzqRuVn+6ob2avccKB1vhKa/OGbl+UsAiFSiLW1v0T IvDdIHT7j26YVqeHi+txe/zyIhiP633pd+/vm2MargaPTq/UT83dwoDeLLtq8zpqJtUe eV+2sCecInEV+XF38ER81gFBDXuVzeumAod6nc3Chtz1atHgSoB3IZmtbSN3jWn8LtTg DvFA==
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=TtrcnQ6clRfd6Ws7fFc55SUWNKwc0obTiiEHnjxNf5U=; b=N1ELxqZeHHQ737jALMChSQMM7OS/9HRQr3pVgNj700oU6emU47vCh1+JqNZaXwLGgU EQ3lFUV6McBNIrVafftkHuo9CLiBtpW4FB+xKtKKUIkR5dcvUwR/3VL0xPNVt8BlT1r0 4sLFnsIP04Xk/O3K6ty3ZYB0jh6l/3Nion2lU46SKM3XZoxhznEoJsCt7VZr5Kd4r935 bgfBaLSydfJngp2OVL4/MoEz6du3EcXhB7v5odA5hBZTKLj6+bFoJjB8/ETR1OblXkUA W+lHauO1ihtsDUdoD4+hPYkMdBTUMB0bq32eam2nMFCbvbTJHObJ0RR2EtiAcIb6d6TB Tbfg==
X-Gm-Message-State: ALKqPwezgndlQYQHpEKAJo7DU0I7XxHBkdsaUD1wb4plXhF3D0dvLxy5 UaDhVERG745QoGSAqN9pVn7CXeR9ZdgIFI2PkBA=
X-Google-Smtp-Source: ADUXVKJuaB5qCHLPilzoffaBl0wAibkD7QCwySZ5ujTy+uJ79b4Gy4GiGF4k+uRTMmU6zfloHYK4QMCVJpPhB7HHdDc=
X-Received: by 2002:a24:e306:: with SMTP id d6-v6mr1498985ith.103.1527799047142; Thu, 31 May 2018 13:37:27 -0700 (PDT)
MIME-Version: 1.0
Received: by 2002:a4f:2a46:0:0:0:0:0 with HTTP; Thu, 31 May 2018 13:37:26 -0700 (PDT)
In-Reply-To: <BYAPR15MB2312B11929B6DEC29AC67CA3CD630@BYAPR15MB2312.namprd15.prod.outlook.com>
References: <d263c36bc5264842a65f04fc3b017538@ustx2ex-dag1mb6.msg.corp.akamai.com> <SN1PR08MB18541BF8B27EA5484FA6A437DA6C0@SN1PR08MB1854.namprd08.prod.outlook.com> <CABkgnnWUpaFvz3d0SJJ99JkhdQfwdaxYosKwj3dK9BVZUtZ_yw@mail.gmail.com> <BYAPR15MB2312A20C0FFF67119059D2B3CD630@BYAPR15MB2312.namprd15.prod.outlook.com> <SN1PR08MB1854EB788295504BEE169A25DA630@SN1PR08MB1854.namprd08.prod.outlook.com> <BYAPR15MB2312B11929B6DEC29AC67CA3CD630@BYAPR15MB2312.namprd15.prod.outlook.com>
From: Jana Iyengar <jri.ietf@gmail.com>
Date: Thu, 31 May 2018 13:37:26 -0700
Message-ID: <CACpbDcdoc9T-4hSEEko+j5ihRaMQW8VR+pgdof7k-5E7stSk8Q@mail.gmail.com>
Subject: Re: Partially Reliable Message Stream
To: Roberto Peon <fenix@fb.com>
Cc: Mike Bishop <mbishop@evequefou.be>, Martin Thomson <martin.thomson@gmail.com>, QUIC WG <quic@ietf.org>, "Lubashev, Igor" <ilubashe=40akamai.com@dmarc.ietf.org>
Content-Type: multipart/alternative; boundary="0000000000007e41a7056d866f2b"
Archived-At: <https://mailarchive.ietf.org/arch/msg/quic/y72pYiMy3ssikJ2EztgVfkJ9zpA>
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, 31 May 2018 20:37:32 -0000

I'm not keen to get into the weeds of this discussion at this time (as you
say, it's for v2), but I understand the overall design. A few higher-order
points with this design direction:

1. There's clear demarcation of app messages, but they aren't really made
first class citizens. If you did that, I imagine that you might have a
simpler design. For instance, define a MSG_STREAM frame, which supports
message streams (instead of the current byte streams), and then you can
cancel messages easily without having to do stream offset shenanigans.

2. Your design has exactly one ordering capability, which is limiting.
Generally, apps that can drop messages and read subsequent ones are also
capable of handling messages out of sequence. You'll want to support
partial ordering as well and not constrain messages to be only delivered in
strictly linear order.

3. I'm keen to see what we can do with using streams as messages. We don't
need to punt everything to the app (as your text suggests), but we can
start with a grouping of streams (or messages) and building flow control
mechanisms for these groups. I suspect this might be cleaner, and it gives
you flexibility to consider various orderings of messages. When we're
closer to v2, I'm happy to spin up a draft exploring this direction.

On Thu, May 31, 2018 at 8:21 AM, Roberto Peon <fenix@fb.com> wrote:

> Yes. You may want a single resource for an output which you may be
> generating in parallel. Even if a single thread 'owns' the stream, you've
> lost the ability to coordinate the data it recieves by monotonically
> increasing offset.
>
> Renumbering the offsets breaks the file-like abstraction we've effectively
> used for http.
>
>
> -=R
>
>
>
> Sent via the Samsung Galaxy S7, an AT&T 4G LTE smartphone
>
>
> -------- Original message --------
> From: Mike Bishop <mbishop@evequefou.be>
> Date: 5/30/18 8:33 PM (GMT-08:00)
> To: Roberto Peon <fenix@fb.com>, Martin Thomson <martin.thomson@gmail.com>
>
> Cc: QUIC WG <quic@ietf.org>, "Lubashev, Igor" <ilubashe=
> 40akamai.com@dmarc.ietf.org>
> Subject: RE: Partially Reliable Message Stream
>
> Just to be clear….  You’re suggesting multiple threads that would be
> writing to a single stream in parallel, rather than a single thread
> “owning” the stream?
>
>
>
> *From:* Roberto Peon <fenix@fb.com>
> *Sent:* Wednesday, May 30, 2018 6:03 PM
> *To:* Mike Bishop <mbishop@evequefou.be>; Martin Thomson <
> martin.thomson@gmail.com>
> *Cc:* QUIC WG <quic@ietf.org>; Lubashev, Igor <ilubashe=
> 40akamai.com@dmarc.ietf.org>
> *Subject:* Re: Partially Reliable Message Stream
>
>
>
> I find it confusing as well.  I far prefer keeping the offsets
> monotonically increasing as it allows for real-world use of a partially
> reliable stream (where you may not recieve that data but you can at least
> figure out what you did get and interpret it).
>
> I dont know how one wohud resolve the race even within the sending
> application -- one thread sends, another thread sends while the first says
> to forget about stuff. I dont know what offset stuff ends up at in such
> cases, and so I cannot frame data in a way that is non-synchronous. That
> defeats some of the main reasons to do partial reliability (i.e. to reduce
> jitter).
>
> Draft 02 seemed to be going in a better direction w.r.t the usecases i can
> conceive of. I think rewinding to that and then potentially figuring out
> how to simplify it would be fun!
>
> I'm excited to have this being discussed, since there is pent up demand to
> use it already.
>
> -=R
>
> Get Outlook for Android
> <https://urldefense.proofpoint.com/v2/url?u=https-3A__aka.ms_ghei36&d=DwMFAg&c=5VD0RTtNlTh3ycd41b3MUw&r=C0sUo-LFNBaYfyoaCsf6TA&m=VOUj_MnwWf_PgdHvcGV1Se1o3k5jC8m8noKDixq8HqA&s=-xJb_JWOdL_DpDM43E06S54LPE-xkpYkSen4El-wkS4&e=>
>
>
> ------------------------------
>
> *From:* QUIC <quic-bounces@ietf.org> on behalf of Martin Thomson <
> martin.thomson@gmail.com>
> *Sent:* Wednesday, May 30, 2018 5:50:59 PM
> *To:* Mike Bishop
> *Cc:* QUIC WG; Lubashev, Igor
> *Subject:* Re: Partially Reliable Message Stream
>
>
>
> Like Mike, I find this gap thing confusing.  And Mike's message
> helped, but not a lot.
>
> It took a while to realize that forcing a gap creates a new starting
> point for the next message that forces the recipient to recognize and
> deal with.  However, the logic for identifying that is just hard and
> it's an unnecessary imposition in my view.
>
> Say I send a message with a length of 10 and only two octets make it
> onto the wire (as with your example), then it is immediately
> abandoned.  Your solution would have the EXPIRED_STREAM_DATA force a
> gap after the second octet, so that the next message could start at
> offset 3 rather than offset 10.  That saves the remaining 7 octets of
> flow control credit.  (Use bigger numbers and perhaps it seems more
> motivating).
>
> If the octets that cover the gap were sent, then you have a problem
> because now you have sent two versions of the same octets, so you can
> only do this if the octets were never sent.  It starts to get closer
> and closer to the point where a new stream is just easier.
>
> Worst, I think is that the receiver has to have complicated logic for
> identifying that a gap exists and dealing with it.  It has to read up
> to what it has, observe that the data has expired, then learn where
> the gap ends, then resynchronize based on 1+gap_end for the next
> message.
>
> Better to eat the flow control cost in my view.  Or send RST_STREAM
> and make another stream.
> On Thu, May 31, 2018 at 8:48 AM Mike Bishop <mbishop@evequefou.be> wrote:
> >
> > I find the one octet gap a bit confusing, but as I think about it, I see
> why you need it.  If all the stream data arrived successfully (but hadn’t
> been acknowledged yet due to loss of the ACK, delay, etc.) and the
> EXPIRED_STREAM_DATA gets lost, the receiver can only retroactively realize
> there was a jump.  Having an octet that is never transmitted ensures the
> receiver actually sees a gap, which means that an in-order API will not
> proceed until it has received either the missing octet or an
> EXPIRED_STREAM_DATA informing it the octet will never arrive.
> >
> >
> >
> > This simplification (versus -02) comes at a price:  If an API were
> exposing stream data out-of-order, then in your example, the receiver knows
> that a message always begins on a ten-byte boundary.  A receiver can no
> longer find ten-byte boundaries, because the offset on the read side
> doesn’t match the offset on the send side.  I agree with you that this
> seems like a reasonable trade-off for the simpler flow control.
> >
> >
> >
> > One conflict I see in the doc:
> >
> > ·         Section 3 says:  Receipt of an EXPIRED_STREAM_DATA does not
> advance the largest received offset for the stream.
> >
> > Section 5 says:  A receiver SHOULD discard any stream data received for
> an offset smaller than the new smallest receive offset, possibly advancing
> the largest received offset for the stream.
> >
> >
> >
> > Other minor nits are better done via PR.
> >
> > From: QUIC <quic-bounces@ietf.org> On Behalf Of Lubashev, Igor
> > Sent: Wednesday, May 30, 2018 9:45 AM
> > To: QUIC WG <quic@ietf.org>
> > Subject: Partially Reliable Message Stream
> >
> >
> >
> > I’ve just uploaded a new draft for partially reliable QUIC streams.
> Note: this feature is likely not in scope for V1, but it can be an
> extension for V1 and/or a part of V2.
> >
> >
> >
> > The new version 03 (https://urldefense..proofpoint.com/v2/url?u=https-
> 3A__tools.ietf.org_html_draft-2Dlubashev-2Dquic-2Dpartial-
> 2Dreliability-2D03&d=DwIFaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=
> C0sUo-LFNBaYfyoaCsf6TA&m=yyRpbe14kTYgY413gjVkOalWE_UC3xYerKpJqS8HiQo&s=
> XZ295xiZsN11yP8GLcdMs1jf7z0b2_WhiIxMLLorZXo&e=
> <https://urldefense.proofpoint.com/v2/url?u=https-3A__tools.ietf.org_html_draft-2Dlubashev-2Dquic-2Dpartial-2Dreliability-2D03&d=DwIFaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=C0sUo-LFNBaYfyoaCsf6TA&m=yyRpbe14kTYgY413gjVkOalWE_UC3xYerKpJqS8HiQo&s=XZ295xiZsN11yP8GLcdMs1jf7z0b2_WhiIxMLLorZXo&e=>)
> no longer needs complex flow control changes and removes the need to
> transmit multiple frames in the same packet.
> >
> >
> >
> > Igor
> >
> >
> >
> > P.S.
> >
> >   There is also a new version 02, which includes a more complex
> algorithm with more features and different trade-offs.  But I think version
> 03 is a better match for the needs so far.
>