Re: [Webtransport] Flow Control for high-throughput Streams

Marten Seemann <martenseemann@gmail.com> Mon, 25 March 2024 01:03 UTC

Return-Path: <martenseemann@gmail.com>
X-Original-To: webtransport@ietfa.amsl.com
Delivered-To: webtransport@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 326E1C14F60D for <webtransport@ietfa.amsl.com>; Sun, 24 Mar 2024 18:03:31 -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_FONT_LOW_CONTRAST=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, 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 zbyFqCCW_Q6Y for <webtransport@ietfa.amsl.com>; Sun, 24 Mar 2024 18:03:26 -0700 (PDT)
Received: from mail-ed1-x52f.google.com (mail-ed1-x52f.google.com [IPv6:2a00:1450:4864:20::52f]) (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 8F49BC14F5F9 for <webtransport@ietf.org>; Sun, 24 Mar 2024 18:03:26 -0700 (PDT)
Received: by mail-ed1-x52f.google.com with SMTP id 4fb4d7f45d1cf-568c714a9c7so4383191a12.2 for <webtransport@ietf.org>; Sun, 24 Mar 2024 18:03:26 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1711328604; x=1711933404; darn=ietf.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=76wV//NYhOR1js49cX4dTPoiAXrwsqsHQODhTyfW9mU=; b=L5c7hIhRIWL0k58i7aBfIqVl861+GGO6uzBkYjz57rQXh5hccDsGYT7Nk+gUWorvXR kZ0Vd/RzWf962Z5ZAypUMaB6mVbN8ugSRcpsOqncqnuQWzOVpEQiCAiaV3Q6Tl6W8gsg crxQEB9+vHhylyunYZB/lr1fybPT0kNG4rnhz8dW4A+o/Hwq2rIGSWlVvz1Sm7F8FmAK le2wrKS8JVvqb2a5fFTiID2k8qnANesUJVHWhrQo5kWVlEx0udJyrHVCM+AOhXJj7Ln6 3o2utfqhIOKkbwnbKZcg3bZYvpZ9KiBKssd9ndCnQlFtBdaK6wYKj/u1h2ldaXJx3yU+ DCow==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711328604; x=1711933404; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=76wV//NYhOR1js49cX4dTPoiAXrwsqsHQODhTyfW9mU=; b=KzMsvzOQzlCeTE6Uazw19MIFjnV/soBG2sYjOO1HOxWlGZ4+dpCLMm4PPO/yuS19q8 8qbfjc8cLbTYLNaopgn9cgv1TiUEoz+M4PtHWULJXJWYGoB54jiGGK3IOUaGQVtYezXJ HAVgBeFwlWb2TLzJYCj+6PP19fb8izdJ/DUaMkEZOdJ/iIanq47zlVFhVjAZusSIyj6C gZa5C7Y7f62x/p61ST6t06oUaG1US2oNw8oW19/dvy01iPL7/JfqKCN7iz2qkCVrShAt Usw1RTTno/A/ONKIdNNigDZeVJ3p5cijQGkwOzx+JPSTWTOTTCUCunPyLnqOLDuH5w7d 2o/g==
X-Gm-Message-State: AOJu0YylUu+diURL1vnXtRntzdbPyKpkq0QX5xNKobmkl9WKAynseMRZ jYTfuLxZTbgvs7H45MeT8krmM/jKHoeMRbKuKrnfH3x274jBSf3ueCEUOlH6tJlLxMk+wj+wPwt gEHeZVts5nl4yWdykerwkArq8poQxp9trWPq39g==
X-Google-Smtp-Source: AGHT+IFhYpgaPDlWNOsGwlAFQ6cZYMkNSpOHxqq1bDLbcWtIqhdgNiPam+WGLJ+CTgZbA93MoY/dd4+lyYRzP3qL4Mc=
X-Received: by 2002:a17:906:4083:b0:a46:ee56:cef4 with SMTP id u3-20020a170906408300b00a46ee56cef4mr3602933ejj.76.1711328603895; Sun, 24 Mar 2024 18:03:23 -0700 (PDT)
MIME-Version: 1.0
References: <CAOYVs2qshgTP6SaB0KtwvMixQ_pHKYUajfHzDqf1eG04-hAk7w@mail.gmail.com> <CAPDSy+4aUh1_rELbhckWr6Vy8RcVT0REB+ybHok7gEpNJ+=Kbg@mail.gmail.com>
In-Reply-To: <CAPDSy+4aUh1_rELbhckWr6Vy8RcVT0REB+ybHok7gEpNJ+=Kbg@mail.gmail.com>
From: Marten Seemann <martenseemann@gmail.com>
Date: Mon, 25 Mar 2024 11:03:11 +1000
Message-ID: <CAOYVs2rB0Kz=aMBSBLX42s3ks5hi3EySA_VUz-K_8pec0B=iAA@mail.gmail.com>
To: David Schinazi <dschinazi.ietf@gmail.com>
Cc: WebTransport <webtransport@ietf.org>
Content-Type: multipart/alternative; boundary="000000000000877e0e061471bd8e"
Archived-At: <https://mailarchive.ietf.org/arch/msg/webtransport/HZYAbsvyuMVBrR8Dhyz4j_3Uvq0>
Subject: Re: [Webtransport] Flow Control for high-throughput Streams
X-BeenThere: webtransport@ietf.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: WebTransport WG <webtransport.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/webtransport>, <mailto:webtransport-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/webtransport/>
List-Post: <mailto:webtransport@ietf.org>
List-Help: <mailto:webtransport-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/webtransport>, <mailto:webtransport-request@ietf.org?subject=subscribe>
X-List-Received-Date: Mon, 25 Mar 2024 01:03:31 -0000

> This issue can be solved by having the QUIC stream layer retransmit all
of the unacked data on the WebTransport stream every time it tries to send
a subsequent flow control frame.

There are a number of things you can do at the QUIC layer. For example, you
could also do some kind of FEC for the control stream (in the simplest
case, you could retransmit every STREAM frame multiple times on a timer
less than 1 RTT). My QUIC implementation doesn't have any API to enable
this behavior, and I doubt many others do. In my stack, this would be far
from trivial to implement.

I'd argue that* if we need to change the (re)transmission logic of STREAM
frames at the QUIC layer for this one use case, then using a QUIC stream is
not the right abstraction* to begin with.

> I'd like to see data showing that this is a problem in practice.

To make things simple, let’s look at running HTTP on top of WebTransport
streams. I’m not saying that this is most common use case of WebTransport,
but it’s a protocol that we’re all familiar with, and that we actually
already have data for.

I’ll argue that the problem in WebTransport is roughly equivalent to the
experiment Alan ran back in the 2017 (
https://mailarchive.ietf.org/arch/msg/quic/S5p63SfjiKSaqObwUVO_fRGBOYA/).
Back then we discussed if the HoL blocking introduced by running HPACK on a
QUIC stream poses a problem.

The scenarios are comparable when:
* The client opens new streams to send new requests (same as in the
original experiment).
* At least some of the responses are not tiny, such that the session
utilizes a large fraction of the current session flow control limit.
* The client employs a flow control auto-tuning algorithm that aims to
match the size of the flow control window of the session to ~ the BDP of
the connection. As far as I know, this is what Chrome implements (
https://docs.google.com/document/d/1F2YfdDXKpy20WVKJueEf4abn_LVZHhMUMS5gX6Pgjl4/edit
).

The reason this scenario is roughly comparable to Alan’s experiment is:
* Loss of a session-level flow control frame means that the server will run
out of session-level flow control credit before the (1.x RTTs it takes
until the) retransmission arrives.
* Packet loss on the WebTransport control stream is the equivalent of the
losing data on the HPACK stream. Packet loss doesn’t need to affect a
MAX_DATA frame, any packet loss that blocks the server from consuming a
MAX_DATA frame sent on the stream is sufficient.
* Running out of session-level flow control means that no existing stream
can make progress in downstream direction. And while the client can open
new request streams, the server won’t be able to even send a single byte in
response. This is equivalent to waiting for the HPACK message to be able to
decode future requests.

The effect on the processing of new requests will be similar to what was
captured by the "Cumulative HOL Delay" metric.

Back then, our conclusion of the discussion was that we couldn't live with
the HoL blocking, and led to the design of QPACK:
> Head-of-line blocking is a very real problem for serialized HPACK that
gets predictably worse as RTT and loss increase. At a fairly modest 100ms
RTT + 2% loss, HOL blocking on headers added an average of 40ms / request.
At 200ms/5% loss, it’s almost 100ms/request, and the p100 (max) was
497ms/request.


On Sun, 24 Mar 2024 at 17:16, David Schinazi <dschinazi.ietf@gmail.com>
wrote:

> (I'm speaking as individual contributor)
>
> I'd like to see data showing that this is a problem in practice. If it
> appears to be an issue, I'm not sure that changing the wire format is the
> best solution. This issue can be solved by having the QUIC stream layer
> retransmit all of the unacked data on the WebTransport stream every time it
> tries to send a subsequent flow control frame. That would provide very
> similar performance properties without complicating flow control for
> everyone.
>
> David
>
> On Tue, Mar 19, 2024 at 7:47 PM Marten Seemann <martenseemann@gmail.com>
> wrote:
>
>> After the discussion we had in yesterday’s session, I’ve spent some more
>> time thinking about how and in which situations the HoL blocking introduced
>> by putting flow control capsules on a control stream might hurt
>> performance. Unfortunately, this is not an edge case, but a fairly common
>> scenario.
>>
>> Consider an application transferring a large amount of data on a single
>> stream. In QUIC, the receiver would select or auto-tune the stream receive
>> window to slightly exceed the connection's BDP, assuming it sends
>> MAX_STREAM_DATA frames multiple times per RTT. This ensures that
>> flow-control doesn’t block the transfer. If MAX_STREAM_DATA is sent less
>> frequently, a window slightly larger than the BDP is needed to be able to
>> fully utilize the available bandwidth.
>>
>> For connections not terminating at a CDN's edge, BDPs can be quite large
>> due to the longer RTTs. For instance, a 200ms RTT connection with a
>> bandwidth of 1 Gbps has a BDP of 25 MB.
>>
>> When packet loss occurs on the WebTransport control stream (in upstream
>> direction), no capsules can be read until this packet loss is repaired,
>> which takes at least (since loss detection might take some time as well) 1
>> RTT. This applies even if the control stream is given the highest priority
>> when sending. For a BDP-sized flow control window, this means that the
>> high-throughput stream (in downstream direction) is now blocked on flow
>> control until the retransmission arrives (i.e. for at least 1 RTT).
>>
>> The solution suggested in yesterday's session, "just use higher flow
>> control limits," would mean increasing the stream flow control window to
>> (at least!) 50 MB from 25 MB for our example. This approach seems
>> unappealing from a resource allocation standpoint.
>> --
>> Webtransport mailing list
>> Webtransport@ietf.org
>> https://www.ietf.org/mailman/listinfo/webtransport
>>
>