Re: new draft: RELIABLE_RESET_STREAM

Matt Joras <matt.joras@gmail.com> Mon, 26 September 2022 18:44 UTC

Return-Path: <matt.joras@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 9E80EC14CF05 for <quic@ietfa.amsl.com>; Mon, 26 Sep 2022 11:44:54 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.104
X-Spam-Level:
X-Spam-Status: No, score=-2.104 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, URIBL_BLOCKED=0.001, URIBL_DBL_BLOCKED_OPENDNS=0.001, URIBL_ZEN_BLOCKED_OPENDNS=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 ([50.223.129.194]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 87QnoWI083Rl for <quic@ietfa.amsl.com>; Mon, 26 Sep 2022 11:44:50 -0700 (PDT)
Received: from mail-wr1-x436.google.com (mail-wr1-x436.google.com [IPv6:2a00:1450:4864:20::436]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id A68E6C14F72D for <quic@ietf.org>; Mon, 26 Sep 2022 11:44:50 -0700 (PDT)
Received: by mail-wr1-x436.google.com with SMTP id bk15so3859049wrb.13 for <quic@ietf.org>; Mon, 26 Sep 2022 11:44:50 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date; bh=sxR1aEQ2Y4SdfwfwrdB8lVBOZS+K3Ed6k9uONkpvJ2o=; b=EeaH8uqahPabkvZAAcPl1nSbdnCW+wHx0RQkGu2b/HcOJ9o+m8pFPYnquWfgSfoLY+ anB7RpafnoaYAtFiJQhp5GefA3skM6bfOP+X20+gvLP7+rAil7nKIXsHF8SK7bVnAiyZ zRNpt77s8jKvatEozen48TBp4J7PYgXlmohFUQbSso7ZjUoHk03at521j0xVAqHeBNEz 4IdLNy47n9SLWpX4GWimPHJkLEMx2bhDkQK4uNFeSte110Pb0mKPZrQ8ln3hfHprnWtG WyyXRjRUfEsXhpCymcyMQzU5pSZaPu+nghYUesbqp1VrvgLW3zL0uQlR9kMLqEhMna9W kb2w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=sxR1aEQ2Y4SdfwfwrdB8lVBOZS+K3Ed6k9uONkpvJ2o=; b=AdHVDg/BjmADz90iyflZ+ALkzjCaEfoD9tKnnML2MGUOQ37T8idvJZ29CLX1xGt38p HzK7vnRJNyoU803G8bzmA3l3Tp4JchnZ2Gxux1vKVYmb4T8eCEO8sRODj9kviEF07rmb nb+UCXehOA77xQ8GPNI8ZSgNvB5fThl6wEiIb5N/6O1HXyesErEh8NOgGW2aBt14rSFr v3WI+yfVXWHz8+3pfatcnYThMaJqDICFuCSseNAIhaVZk4b7oLhTaRJSpzkYaSdZ1K90 zIoXSZjOk+68bHS5eubwYvlEpLbi0AMYoilVaRaHgRDP9m1duHPQXh+PBmfaX3Dhx3pU Hyog==
X-Gm-Message-State: ACrzQf3HVH1YPDy2suXyyaryaLEjUFjoV+rUcnghu5wRxyOAtc9uWG/2 G5t8jtnq0xDhPLt46JLx/PrZ2ywiS+JIo4sEfLQ=
X-Google-Smtp-Source: AMsMyM5AAKl6+kHWcaKcFELgVKGHWyyfGMlaETDrGrZIeMLH8hg6FKSSVA2Jol038Y7qGgrFew3bXnFs0kr1lJhLTsE=
X-Received: by 2002:a05:6000:184e:b0:228:bc3a:8e35 with SMTP id c14-20020a056000184e00b00228bc3a8e35mr14388768wri.443.1664217888210; Mon, 26 Sep 2022 11:44:48 -0700 (PDT)
MIME-Version: 1.0
References: <CAOYVs2rQWUbd02jz7ywDi1xcx30wD1PSf-GRi3ZrPmGnXouy2A@mail.gmail.com> <CE1479D5-4B98-4B37-999A-E60B580E7F2E@ericsson.com> <CAOYVs2oeyS3eUgU+e_7QRukitD1Jga0hXCfbKRARTLU03WT4zg@mail.gmail.com> <565C27F0-513C-4F99-BCD3-593AAAEFD49A@ericsson.com> <CAOYVs2qJU9okQQ2QdkGrZoKEB4RG9ta2_003rdOh8m8mN9LXyA@mail.gmail.com>
In-Reply-To: <CAOYVs2qJU9okQQ2QdkGrZoKEB4RG9ta2_003rdOh8m8mN9LXyA@mail.gmail.com>
From: Matt Joras <matt.joras@gmail.com>
Date: Mon, 26 Sep 2022 11:44:36 -0700
Message-ID: <CADdTf+hz9ZMBma0GFxBO3Pn-a4mB8_fVURnPTyP97SxXAjBM-A@mail.gmail.com>
Subject: Re: new draft: RELIABLE_RESET_STREAM
To: Marten Seemann <martenseemann@gmail.com>
Cc: Mirja Kuehlewind <mirja.kuehlewind@ericsson.com>, QUIC WG <quic@ietf.org>
Content-Type: multipart/alternative; boundary="0000000000000e442505e998ecb4"
Archived-At: <https://mailarchive.ietf.org/arch/msg/quic/Be8loK_Tx7a24jZ_8v0JTJdUIVE>
X-BeenThere: quic@ietf.org
X-Mailman-Version: 2.1.39
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: Mon, 26 Sep 2022 18:44:54 -0000

Hi Marten,
(no hats worn)

The problem this is solving for WebTransport is real, and it's definitely
tricky. That being said, solving this by complicating the stream semantics
of a reset feels somewhat unpalatable to me. Today the semantics of the
reset are straightforward, whereas this introduces complexity for both the
sender and the receiver in juggling things in this "pending" state.

I am wondering if a simpler solution would be adding a new type of
RST_STREAM frame which carries auxiliary application information. For
example, if the application could encode the application stream type in
this auxiliary information then the reset itself (and its API communicating
with the application) would completely encode the necessary information for
the application, without having to make any changes to stream state.

Matt Joras

On Fri, Sep 23, 2022 at 6:21 AM Marten Seemann <martenseemann@gmail.com>
wrote:

> Hi Mirja,
>
> > I guess my question is more what would you do with this information then
> if the stream is already closed?
>
> This might sound pedantic, but the stream is not closed. The *send
> direction* of the stream is *reset* according to
> https://datatracker.ietf.org/doc/html/rfc9000#section-3.1. The *receive
> direction* of the stream is still open, and there are now many different
> ways how the peer might react to that situation.
> To stick to the canceled file upload example, the server may send a HTML
> page "The upload was canceled. Please try uploading again." on its side of
> the stream before closing it. Obviously, setting a HTTP payload doesn't
> make any sense on a WebTransport stream (there might be a WebTransport
> session using the same underlying QUIC connection!), so it's imperative to
> know where the stream belongs. The same reasoning applies when
> multiple WebTransport sessions share the same QUIC connection.
>
> > Also in your case of know the session ID, this seems like a complicated
> hack. Because if you anyway have to change something in the quick stack,
> wouldn’t it be sufficient to just create a new interface to expose the
> session ID given it should be known by the QUIC stack, no?
>
> This is exactly the problem that RELIABLE_RESET_STREAM solves: The QUIC
> stack doesn't necessarily know the Session ID. If the STREAM frame carrying
> the Session ID is declared lost after the stream was reset (using the
> regular QUIC RESET_STREAM frame), the sender's QUIC stack won't retransmit
> it. It's totally possible that all that the receiver receives regarding
> this stream is the RESET_STREAM frame, and no STREAM frames at all.
>
> Cheers,
> Marten
>
>
> On Fri, Sep 23, 2022 at 3:53 PM Mirja Kuehlewind <
> mirja.kuehlewind@ericsson.com> wrote:
>
>> Hi Martin,
>>
>>
>>
>> thanks for your reply. Please see below.
>>
>>
>>
>> *From: *Marten Seemann <martenseemann@gmail.com>
>> *Date: *Friday, 23. September 2022 at 12:24
>> *To: *Mirja Kuehlewind <mirja.kuehlewind@ericsson.com>
>> *Cc: *QUIC WG <quic@ietf.org>
>> *Subject: *Re: new draft: RELIABLE_RESET_STREAM
>>
>>
>>
>> Hi Mirja,
>>
>>
>>
>> > 1. How can you guarantee that any data can be delivered reliably if the
>> sender is indicating that it won’t retransmit?
>>
>>
>>
>> That's the new semantics of the RELIALBE_RESET_STREAM frame. Sending
>> one indicates that you'll reliably retransmit everything up to the
>> "Reliable Size" byte offset. You don't retransmit anything after that
>> offset.
>>
>>
>>
>> > 2. If the sender sends the reset before any stream data is ever
>> delivered to the application, why do you still need to deliver the session
>> id (given the stream will never be used)? Or maybe asked differently, why
>> is the sender sending a reset at all?
>>
>>
>>
>> I'm not sure I understand the question. In general, you send a
>> RESET_STREAM (or RELIABLE_RESET_STREAM) because you changed your mind after
>> you started transmitting data. A standard example from the HTTP world is
>> that the user starts the upload of a large file, and then cancels that
>> upload. For WebTransport it depends on your application protocol.
>>
>> The reason you want to associate the stream with the correct session is
>> that the semantics of a stream reset might differ depending on the
>> application protocol: The server might respond differently to a HTTP/3
>> stream being reset vs. a WebTransport stream being reset (or even: a
>> WebTransport stream being reset for Session ID 1 and Session ID 2). We have
>> this problem since a single QUIC connection can handle HTTP/3 streams and
>> WebTransport streams for multiple WebTransport sessions at the same time.
>>
>>
>>
>> I guess my question is more what would you do with this information then
>> if the stream is already closed?
>>
>>
>>
>> Also in your case of know the session ID, this seems like a complicated
>> hack. Because if you anyway have to change something in the quick stack,
>> wouldn’t it be sufficient to just create a new interface to expose the
>> session ID given it should be known by the QUIC stack, no?
>>
>>
>>
>> Mirja
>>
>>
>>
>>
>>
>> Does that answer your questions?
>>
>>
>>
>> Cheers,
>> Marten
>>
>>
>>
>>
>>
>> On Tue, Sep 20, 2022 at 7:16 PM Mirja Kuehlewind <
>> mirja.kuehlewind@ericsson.com> wrote:
>>
>> Hi Martin,
>>
>>
>>
>> just two quick questions because I’m not sure I fully understand the
>> proposal/scenario:
>>
>>
>>
>> 1.      How can you guarantee that any data can be delivered reliably if
>> the sender is indicating that it won’t retransmit?
>>
>> 2.      If the sender sends the reset before any stream data is ever
>> delivered to the application, why do you still need to deliver the session
>> id (given the stream will never be used)? Or maybe asked differently, why
>> is the sender sending a reset at all?
>>
>>
>>
>> Mirja
>>
>>
>>
>>
>>
>>
>>
>> *From: *QUIC <quic-bounces@ietf.org> on behalf of Marten Seemann <
>> martenseemann@gmail.com>
>> *Date: *Friday, 9. September 2022 at 10:35
>> *To: *QUIC WG <quic@ietf.org>
>> *Subject: *new draft: RELIABLE_RESET_STREAM
>>
>>
>>
>> In RFC 9000 we defined a RESET_STREAM frame. When a stream is reset, the
>> receiver may deliver the reset error to the application immediately. On the
>> sender side, lost STREAM frames won't be retransmitted.
>>
>> When building applications on top of QUIC, it is a common pattern to send
>> some kind of identifier (an ID or a string, for example) first, to allow
>> the application to route the stream to a subpart of that application. For
>> example, WebTransport sends the Session ID of the WebTransport Session.
>> Outside of the IETF, I've used something similar for layering various
>> applications on top of QUIC.
>>
>>
>>
>> When a stream is reset, the receiver might end up unable to associate the
>> stream with the respective subpart of the application. This is problematic,
>> since
>>
>> 1.       depending on the application protocol, a reset of a stream
>> might carry application-layer semantics, and
>>
>> 2.       the RESET_STREAM only closes one side of the stream, and it
>> might depend on the (sub-) application how the other direction of the
>> stream is handled
>>
>> This problem is not unique to WebTransport, but occurs for every
>> application using some kind of stream identifier. It might make sense to
>> design a solution at the QUIC layer.
>>
>>
>>
>> I've just submitted a draft that aims to solve this problem:
>> https://datatracker.ietf.org/doc/draft-seemann-quic-reliable-stream-reset/
>>
>> It defines a RELIABLE_RESET_STREAM frame, which is essentially
>> a RESET_STREAM frame with one additional field, the Reliable Size. The
>> sender of the RELIALBE_RESET_STREAM frame commits to (re-)transmitting
>> stream data up to the Reliable Size reliably, and the receiver delivers
>> data up to that offset to the application before surfacing the reset error.
>>
>> In WebTransport, you'd set the Reliable Size such that it covers
>> everything up the Session ID, thereby making sure that any stream can
>> always be routed to its WebTransport session.
>>
>>
>>
>> Obviously, there are use cases for this draft beyond the reliable
>> transmission of just a stream identifier. One could imagine an application
>> protocol that would benefit from being able to have the first part of an
>> actual application-layer message being delivered reliably. I'm happy about
>> enabling those use cases, but I've avoided making this draft more
>> complicated than necessary by accommodating the more general cases.
>>
>>
>>
>>