Re: [Masque] Capsules

David Schinazi <dschinazi.ietf@gmail.com> Tue, 02 November 2021 17:28 UTC

Return-Path: <dschinazi.ietf@gmail.com>
X-Original-To: masque@ietfa.amsl.com
Delivered-To: masque@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 5812C3A08FE for <masque@ietfa.amsl.com>; Tue, 2 Nov 2021 10:28:01 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.097
X-Spam-Level:
X-Spam-Status: No, score=-2.097 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, SPF_HELO_NONE=0.001, 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 Nu80OgF2cOWf for <masque@ietfa.amsl.com>; Tue, 2 Nov 2021 10:27:56 -0700 (PDT)
Received: from mail-pl1-x635.google.com (mail-pl1-x635.google.com [IPv6:2607:f8b0:4864:20::635]) (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 9CD1C3A08FD for <masque@ietf.org>; Tue, 2 Nov 2021 10:27:56 -0700 (PDT)
Received: by mail-pl1-x635.google.com with SMTP id n8so6717047plf.4 for <masque@ietf.org>; Tue, 02 Nov 2021 10:27:56 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=askOU1f9Ia01QGj4BWNC9JqgtjnJL6L+hJdfbt8lPWc=; b=E9SKR1U740Uq/A8P4MnOXvUISDK8mKOkoV0FiM6Gt35WXq0Ps5UkqcsqovUV12gtFx A2u2fvcgr9qh/Ypibk8GWuzarBJjQhIZhri5T46f8IP9uabiU4xd/fAYL6HDABIv0VRP iqjCVQs3LaCgAY1zBPa9k6VIfBrM+ZmkWA/fICChiLhBFeofPLG9Ti+of5yWNcBneFHU zv7Rv7F24lCL0bgIbMqVYvotMwduZEo+L+A8AQMteamhpYWlLUtPQB8FeK1UlCQJLGdd oYpIDUNLFxTG8/3sn6j5G5A6NYYHLtde5BA/62z/9pUi8mPKPOWDcpo6wW9XggvXJ2LK BD0w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=askOU1f9Ia01QGj4BWNC9JqgtjnJL6L+hJdfbt8lPWc=; b=71EiyvYIOsle8jkN3rRHW7LH5b/aIj7TszvrnZ7JITCYi+ZGNSwn3TiCkuEPkE0aHK XxhS8TLRabY4EHPQZ6upG6xAbzaov3xUL6GhyvvTzCOBjGQBygZQfK6Yss7bvFbnacnh j7G91Dyms6I2rHF/qnrtiDp7l/5lDO/HFJ87yHV1UKSYX3bXZr6ueIE8CvzpCTZ79f9D jUo49Jq6o3jNvT1TbpeKBTwBQ10oMDNOGOaWHxQp/e880/klmkOAJHAQjQKBfor+WS7t MGQL2TZnFTrbVMAgOCLVktjkHIFv0TRzCm+z/rsj8VnxUm7zBqGGYACLoY1FzOMjUgtk ITFg==
X-Gm-Message-State: AOAM531HNPh1fAzgpVq6TKActieypfhCK1wFnarUOgMcp0qcPKNzCmWb yhDNut3hDyxssP8pzDbW5YS6GxzUrzXIPL5TrKKHGtdB3UI=
X-Google-Smtp-Source: ABdhPJy3eCSSameAdcBRakiSmyIqB67XC/+HmYgLKLOxSF1xl0eyWeU8WkhExyLYtUAjjEDmH3Fv4CxsMn6ib0aBr9E=
X-Received: by 2002:a17:90b:388a:: with SMTP id mu10mr8185590pjb.221.1635874074243; Tue, 02 Nov 2021 10:27:54 -0700 (PDT)
MIME-Version: 1.0
References: <85634900-dbbc-497a-aa97-cd6b29b4cc73@www.fastmail.com>
In-Reply-To: <85634900-dbbc-497a-aa97-cd6b29b4cc73@www.fastmail.com>
From: David Schinazi <dschinazi.ietf@gmail.com>
Date: Tue, 02 Nov 2021 10:27:42 -0700
Message-ID: <CAPDSy+4saBOqeyVVb9rWkiqpn0qmTSDmuXU3JRSZsjx6j4WVGQ@mail.gmail.com>
To: Martin Thomson <mt@lowentropy.net>
Cc: MASQUE <masque@ietf.org>
Content-Type: multipart/alternative; boundary="00000000000017b43405cfd19db3"
Archived-At: <https://mailarchive.ietf.org/arch/msg/masque/sLkFIoLQU0y8Zg4BeqqYnultlWc>
Subject: Re: [Masque] Capsules
X-BeenThere: masque@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Multiplexed Application Substrate over QUIC Encryption <masque.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/masque>, <mailto:masque-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/masque/>
List-Post: <mailto:masque@ietf.org>
List-Help: <mailto:masque-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/masque>, <mailto:masque-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 02 Nov 2021 17:28:01 -0000

Hi Martin, thanks for reading the latest draft. Responses inline.

David

On Mon, Nov 1, 2021 at 11:25 PM Martin Thomson <mt@lowentropy.net> wrote:

> I've just reacquainted myself with the ever-shifting content of
> draft-ietf-masque-h3-datagram (-05 specifically).
>
> My conclusion: this document is about 10x longer and more complex than it
> needs to be and maybe three or four times more complex than it could be if
> you accept some of the underlying assumptions.
>
> ---
> The source of this added complexity is a desire to construct an abstract
> framework that allows intermediaries to participate in the protocols that
> this document attempts to facilitate.
>

Speaking for myself as co-author of the draft, constructing an abstract
framework was never my desire. I care about the properties of the system
we're building, not about abstract concepts.

The key functional role for an intermediary here is for it to take
> datagrams and forward them in a way that best suits the HTTP version in
> use, allowing the same datagram to traverse different versions.  Forwarding
> in HTTP/3 wants to use native DATAGRAM frames, whereas fowarding elsewhere
> needs to use the stream established by extended CONNECT.  The goal in
> creating a generic framework was to enable some common handling between
> different protocols (UDP proxying, IP proxying, WebTransport).
>

Agreed. My implementation supports both WebTransport and CONNECT-UDP, and
there's definitely value in reusing the code that sends and parses
datagrams and capsules.

This is a bit of narrow use case.   An intermediary that understands that a
> capsule-based protocol can take datagrams from a stream of capsules and
> send them in DATAGRAM frames.  In the opposite direction, they can fold
> DATAGRAM frames into streams.
>
> This forwarding behaviour depends on the intermediary understanding that
> the protocol in use is a capsule-based protocol.  This is done by looking
> at the :protocol pseudo header field on the extended CONNECT and looking
> that up in a list of known capsule-based protocols.  This is necessary
> because not all protocols that use extended CONNECT use capsules.  After
> all, the only use of extended CONNECT that currently exists, websockets,
> doesn't.
>
> That's not so far removed from a system where the intermediary understands
> the contents of different CONNECT-based protocols that do not share a
> framework.  It is possible to have different protocols that use extended
> CONNECT with shared design elements that maximize code reuse at
> intermediaries WITHOUT a framework like this.  Those protocols can all use
> the same format, name, and registry if that helps maximize code reuse.  At
> that point that is functionally indistinguishable from the system that uses
> a framework.
>

I'm confused here. In order to reuse code, it makes sense for multiple
protocols to share the capsule TLV wire format and the IANA capsule type
registry. Since protocols will share the IANA registry, you need to define
it in this doc. At that point it makes sense to also define the capsule TLV
format here as well since we see value in reusing it. Copy-pasting the TLV
format in every protocol document doesn't help us. If you don't like the
word "framework", then don't use that word?
draft-ietf-masque-h3-datagram-05 doesn't contain the word framework,
because it doesn't attempt to create a framework. Only to define pieces
that can be reused.

>From this perspective, a framework like this becomes something of an
> academic exercise.  A lot of work is done to document the framework and
> describe its properties, but as the effect on deployed code is
> non-existent, it has no real effect on what people do.  And it comes with
> risks, like leading people who build intermediaries to start making bad
> assumptions about how extended CONNECT works generally.
>

I fully agree with you that we would get the exact same software if we took
some parts out of this document and copied them verbatim into every
protocol that uses datagrams. I don't see that as helpful though.

The editors of the WebTransport over HTTP/2 draft are currently debating
> whether to propose the use of capsules there.  There, we have some
> interesting design constraints that might be cause to use a different
> format.  One option that is being considered is reusing design elements
> from QUIC to make the protocol easier to implement.  I don't think that we
> should feel constrained to use capsules, except to the extent that it might
> be nice to make implementation in intermediaries easier.
>

You shouldn't feel constrained to use capsules, you should only use them if
they provide value. Out of curiosity: what are the design constraints that
would steer you to a different protocol?

---
> I'd like to propose a different approach:
>
> 1. When datagram support is negotiated at the QUIC transport layer, HTTP
> uses datagrams by associating them with request streams.  This uses the
> system described in the draft (prepending the stream id divided by four).
>
> 2. Different uses of datagrams need to be individually negotiated using
> settings.  (WebTransport negotiates use of both datagrams and extended
> CONNECT with a single setting.)
>

What does "different uses of datagrams" mean? If one of my backends
supports CONNECT-UDP, why do I need a SETTING on the client-frontend leg?

3. Each of the protocols we have describe the use of capsules.  Separately.
>

This is just moving rocks, and increases the total number of lines of spec
written. What's the benefit of copy-pasting something in multiple documents
if they all depend on a common draft?

That's it.  It's perhaps a shade minimal, but it is sufficient.
>
> I can see the advantage of a shared registry for capsule types.  That has
> some real advantages in terms of code reuse.  This document might be a good
> home for doing a little unification of the clerical stuff.  I'm OK with
> doing that (this is the 10x saving -> 3x saving I alluded to), but it does
> not need the supporting machinery in the current draft.  It just needs to
> make a registry, describe the generic capsule format and define the
> DATAGRAM capsule and forwarding rules for that capsule.  The rules that
> talk about opaque capsules and whatnot is unnecessary.
>

The introduction of opaque and transparent capsules was done as an
editorial clarification to help readers understand the concept of capsules.
We can remove those terms, but we still need the concept of injecting a
datagram into the stream when going from h3 to h2.

---
> This would mean losing all the text about datagram contexts with their
> format types.  I can't see any justification for a generic framework for
> those functions.  I can see protocols in which these might be useful
> constructs.  However, use of those constructs would benefits from closer
> tuning of the mechanisms to the problem domain, something that a framework
> cannot do.
>
> draft-schwartz-masque-h3-datagram-ping proposes using the format type to
> create a separation between that and "other" uses of datagrams.  It's
> important to note that identical treatment at intermediaries is a necessary
> feature for that draft, but I don't think that is necessary.  It also
> depends on datagram contexts being used, which is a big assumption as they
> are effectively pointless for many protocols.  WebTransport doesn't seem
> inclined to want them.  Should WebTransport want this, it has to pay a
> pretty high price (>=1 byte on every datagram sent), but that should be
> something that protocol decides.  Maybe that protocol can come up with a
> better means of distinguishing datagrams that results in less overhead.
>

I think the value here is the definition of extensions that work across
multiple protocols. draft-schwartz-masque-h3-datagram-ping is a perfect
example of that: there's been discussion in WebTransport of adding a
JavaScript API at some later date that would tell the JavaScript what the
datagram MTU is. Having this MTU information would also be useful for
CONNECT-UDP and CONNECT-IP. What you're suggesting is that every single
protocol redefines this. That's not reducing any complexity, just kicking
the can down the road.

Earlier, it was suggested that datagram contexts might be used for ECN
> signaling.  At the time, it seemed clever.  But now I realize that it is
> more like one-step forward, four-steps backwards compression.
>
> ---
> Sorry for the long missive.  I hope that I was able to capture the
> rationale so we can discuss this next week in more detail.
>

Can you clarify what your goal is? It sounds like you would prefer for this
document to be shorter. I agree with that goal, but it shouldn't be done in
a vacuum - we should look at the total length of the MASQUE/WebTransport
documents.

Regards,
> Martin
>
> --
> Masque mailing list
> Masque@ietf.org
> https://www.ietf.org/mailman/listinfo/masque
>