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

David Schinazi <dschinazi.ietf@gmail.com> Tue, 26 March 2024 00:42 UTC

Return-Path: <dschinazi.ietf@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 E4062C180B47 for <webtransport@ietfa.amsl.com>; Mon, 25 Mar 2024 17:42:19 -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 w6nQRULJPsdF for <webtransport@ietfa.amsl.com>; Mon, 25 Mar 2024 17:42:16 -0700 (PDT)
Received: from mail-ej1-x630.google.com (mail-ej1-x630.google.com [IPv6:2a00:1450:4864:20::630]) (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 15527C14F68C for <webtransport@ietf.org>; Mon, 25 Mar 2024 17:42:06 -0700 (PDT)
Received: by mail-ej1-x630.google.com with SMTP id a640c23a62f3a-a4a393b699fso217642366b.0 for <webtransport@ietf.org>; Mon, 25 Mar 2024 17:42:05 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1711413724; x=1712018524; 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=GWv6n+KYjA2jbjNkz6JAgyqt4PY8/K0lzAIHuxcJKq8=; b=gSjhT4tdpgp2nBlux3ffn91C83wMwgJTTS3aBjOvqNYCVIsqwTXkUvc6bB2lA7YzLx HEj9SjpUqakijCJ4qpAaDd7ydVq6DazhL6ZI2QVwIWpSVclfTyKgAJf1DvyvWR4sCett aFNgmf5th6n9BvPNGyL+pO7twdliYK0DvHVnWh9Ne72rFQvNbsrhclRoj1cCdkcC36F7 EauaZyvfIRaq+qIwiz1PjKt+cmrY/gseiL0Z7y+zWID1IttZSeGi0+UetkSTCbqy57el q+74nn2Nq25ZMapgoFPjh5BF1r0AxExCv4FpBbLoNYmjIDwO75RcZsHvYUpv8ucF1Cj8 trow==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711413724; x=1712018524; 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=GWv6n+KYjA2jbjNkz6JAgyqt4PY8/K0lzAIHuxcJKq8=; b=ZQthwu4TdbKRzE/YLM/2fqmUnaNGledb8axRBn8JdsmB8W22PL4lk6Uu8SAOmvC1LL ZQ7g3unLgcYlGALi1FroHfa2H18PEdCQ6+H8XGrZUY77WM5kvVnnZ7f+aSxkOAnWgBn6 kESPjQrodBOGwXn2LxGpv/e3Ba1osrGJv6+ZuQQOjGD2sq48wMwY59N3tzqHhvtLjJZk aj7QbVNQF5k1e2lNeZKKHHBm5GbKmPvsiAtdZmun3gsUS4iwz0zfoXLEtehXm5Aa1vzR cFY5Gnort9nn//3ewJjcl1g0nw1ZFDjbJRb4evWw24CWvVsW+6O0cq4JBMRNFb8OyQ3m Uc9A==
X-Gm-Message-State: AOJu0YxgC/PG9XGKF6ewkpO5aQE7K2oP0VPstdXPjEu6HYc7HJ7W2/+C 57wTjlqdnC9bN6BUATgxXULNRKI1beTTNZ5bAU8l+W3OjbFRJ2Q++gOqVT1WC1/mbkKsLzZBg0m ny/pynRCLA7/wzfYxJoXXb8dMuVg=
X-Google-Smtp-Source: AGHT+IEakvCXm2QWn8imLpMQw3F5UTGo8FRvs2WBQBGuV91v3VPekrz/7KDLwLmBZ7m5ucLBKpVvWJrsVPGvq2SEP8I=
X-Received: by 2002:a17:906:c001:b0:a47:2011:11c1 with SMTP id e1-20020a170906c00100b00a47201111c1mr6655041ejz.8.1711413723505; Mon, 25 Mar 2024 17:42:03 -0700 (PDT)
MIME-Version: 1.0
References: <CAOYVs2qshgTP6SaB0KtwvMixQ_pHKYUajfHzDqf1eG04-hAk7w@mail.gmail.com> <CAPDSy+4aUh1_rELbhckWr6Vy8RcVT0REB+ybHok7gEpNJ+=Kbg@mail.gmail.com> <CAOYVs2rB0Kz=aMBSBLX42s3ks5hi3EySA_VUz-K_8pec0B=iAA@mail.gmail.com>
In-Reply-To: <CAOYVs2rB0Kz=aMBSBLX42s3ks5hi3EySA_VUz-K_8pec0B=iAA@mail.gmail.com>
From: David Schinazi <dschinazi.ietf@gmail.com>
Date: Tue, 26 Mar 2024 11:41:51 +1100
Message-ID: <CAPDSy+6gkAQyjvGbko0tSYVRWxK=Dq7nqBCh8YmNTta8sxLSLg@mail.gmail.com>
To: Marten Seemann <martenseemann@gmail.com>
Cc: WebTransport <webtransport@ietf.org>
Content-Type: multipart/alternative; boundary="0000000000000dac270614858f23"
Archived-At: <https://mailarchive.ietf.org/arch/msg/webtransport/BwpEgBu_MzBoTMlpcZIcdyzddFo>
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: Tue, 26 Mar 2024 00:42:20 -0000

(I'm still speaking as individual contributor)

I think your analysis ignores the fact that every deployed implementation
of h2 and h3 lies about flow control - none of them actually plan to
allocate the amount of memory they allow the peer to theoretically use in
flow control. I expect that WebTransport implementations will do the same -
ours will.

We have to balance theoretical correctness with complexity (both
implementation complexity, and standards development complexity). I'm
personally inclined to defer this problem to an extension until it becomes
an issue in practice. To add a data point: Google QUIC put all the headers
on the control stream (and used HPACK instead of QPACK), and while that's
theoretically bad, in practice it was fine. I'm strongly opposed to adding
complexity without demonstrated impact, and extensions are well suited to
that kind of experimentation.

But again, this was me speaking as an individual contributor.
As chair, I'm interested to hear what others think about this topic.

David

On Mon, Mar 25, 2024 at 12:03 PM Marten Seemann <martenseemann@gmail.com>
wrote:

> > 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
>>>
>>