Subject: Re: Partially Reliable Message Stream

From: Roberto Peon <[email-masked]>
Date: Fri, 1 Jun 2018 18:18:50 +0000

Many messages are less efficient from a caching perspective (caches prefer larger files that stream over lots of small scatter/gather).
If we had a non-HTTP mapping of the network data->disk, that isn’t an issue, but that wouldn’t leverage any of the learnings we’ve had from HTTP caching…
-=R

From: Jana Iyengar <[email-masked]>
Date: Thursday, May 31, 2018 at 1:38 PM
To: Roberto Peon <[email-masked]>
Cc: Mike Bishop <[email-masked]>, Martin Thomson <[email-masked]>, QUIC WG <[email-masked]>, "Lubashev, Igor" <ilubashe=[email-masked]>
Subject: Re: Partially Reliable Message Stream

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 <[email-masked]<mailto:[email-masked]>> 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 <[email-masked]<mailto:[email-masked]>>
Date: 5/30/18 8:33 PM (GMT-08:00)
To: Roberto Peon <[email-masked]<mailto:[email-masked]>>, Martin Thomson <[email-masked]<mailto:[email-masked]>>
Cc: QUIC WG <[email-masked]<mailto:[email-masked]>>, "Lubashev, Igor" <ilubashe=[email-masked]<mailto:[email-masked]>>
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 <[email-masked]<mailto:[email-masked]>>
Sent: Wednesday, May 30, 2018 6:03 PM
To: Mike Bishop <[email-masked]<mailto:[email-masked]>>; Martin Thomson <[email-masked]<mailto:[email-masked]>>
Cc: QUIC WG <[email-masked]<mailto:[email-masked]>>; Lubashev, Igor <ilubashe=[email-masked]<mailto:[email-masked]>>
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 <[email-masked]<mailto:[email-masked]>> on behalf of Martin Thomson <[email-masked]<mailto:[email-masked]>>
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 <[email-masked]<mailto:[email-masked]>> 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 <[email-masked]<mailto:[email-masked]>> On Behalf Of Lubashev, Igor
> Sent: Wednesday, May 30, 2018 9:45 AM
> To: QUIC WG <[email-masked]<mailto:[email-masked]>>
> 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.