[Webtransport] Layered or integrated protocols

Martin Thomson <mt@lowentropy.net> Wed, 21 July 2021 06:51 UTC

Return-Path: <mt@lowentropy.net>
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 BCAEF3A16C1; Tue, 20 Jul 2021 23:51:50 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.098
X-Spam-Level:
X-Spam-Status: No, score=-2.098 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, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=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=lowentropy.net header.b=XC2l7rPy; dkim=pass (2048-bit key) header.d=messagingengine.com header.b=QK/EXlQT
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 rO3Yinmy6lIx; Tue, 20 Jul 2021 23:51:45 -0700 (PDT)
Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id BD39A3A16C0; Tue, 20 Jul 2021 23:51:34 -0700 (PDT)
Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 727B05C00F2; Wed, 21 Jul 2021 02:51:33 -0400 (EDT)
Received: from imap41 ([10.202.2.91]) by compute5.internal (MEProxy); Wed, 21 Jul 2021 02:51:33 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lowentropy.net; h=mime-version:message-id:date:from:to:subject:content-type; s= fm2; bh=kxi4yZDrp6mT8x9IOUfNvglrLBLaLGr4rvwCpvZKlTE=; b=XC2l7rPy XMqfcE0E7RYYbEjL5tPWlSLqzNQ74TdprIWlg9NTJSBPShzXpTpoVv9O7J/VA9yz MAgt7233oXMb/9Vg7ZUFqv3+J4XYArCFlQPcA349wFdgFGWp0YDfQxRVYbEzQaFd sg8hIqvi39r9XeJbNDPk/KPJ4MFftitvQQZUWrRd6dJ50nhOnK23KwqYLn+0czM2 3PGR+AbsvWK91f0j54VwoIzMZizH3+mvOaCNmF7ehBPEYorDpmujnfbjXtwgDawK eylTXlSKACpcpGsEFdSz41r2fFyTnwegzIrLAtkY+iYmw7CZQSIhipyXpvXR1LFI fyT29nXhWcutUg==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:message-id :mime-version:subject:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; bh=kxi4yZDrp6mT8x9IOUfNvglrLBLaL Gr4rvwCpvZKlTE=; b=QK/EXlQTmBFoQ5F4hPUtG2JCCFSiwVUNL644TFHvjT31h g0VT6GAbml9Z3e1Dpvg4CtTyfr8IIEH/8FbQMt47hL6Xy6eaZi9jXEwyZZ1D7uJm RXiwyomAkl/AZg2pk9VwQm+kDXeAD1bLYWnNavVp5049esePePta4u6C2/GO8R68 Kln0391i+q1u8BtgEARKLso+RkEi0CAiQObQz/GVRr7mVAVTMok4iy42zanr0/PC CPrb2HjX4w1rLZHPwxkt8IosGMGj1UCQklkVsn0oWsq6e+F3o88UTNrlinAO9V0h O6xHO6vhA3xYTVd7Z37+am02lbqV+Q37NH7RYta7w==
X-ME-Sender: <xms:9cP3YOG8FtFCZykJUOdOLgRT0dTQ7HB0Eb-FCbbqXpmGa6SD3WSJ1w> <xme:9cP3YPWtwvmaqusTpsrueb39dkB1adB3dmcbiOPZbmxhmADuqHr1GA9cjYaXIefFQ LFrajWZmeTyl_bzEzE>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrfeefgddutddvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefofgggkfffhffvufgtsehttdertd erredtnecuhfhrohhmpedfofgrrhhtihhnucfvhhhomhhsohhnfdcuoehmtheslhhofigv nhhtrhhophihrdhnvghtqeenucggtffrrghtthgvrhhnpeegfeduvedtjeeugfetudegve efkeeftdevteeuffffgfejkeegiedugfefveetjeenucffohhmrghinhephhhtthhprdht ohdphhhtthhpihhtshhmohhrvghofhgrsghurhhrohifihhnthhordhinhdpihgvthhfrd horhhgpdhhthhtphdvihhmphhlvghmvghnthgrthhiohhnmhhighhhthhnohhtsggvrdgr nhenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehmth eslhhofigvnhhtrhhophihrdhnvght
X-ME-Proxy: <xmx:9cP3YIKHaguB72tGXx9l1Vylv-8yZf0AGGHNbicTlIuM6G3S_jI3ag> <xmx:9cP3YIHq1X7S18yPjP3JXseQP584OH6cdPa5cZ_SdsHh1IuFMM3GBQ> <xmx:9cP3YEWD9HrGTYcs3s5IZlbTrOJa4aZYKTVgw43OzWwzXCnAwWi5ag> <xmx:9cP3YHDKUNsvOuwwCm7xkkURFIJU4omoQeuy_YrqvyJm4vwpDm7Vfw>
Received: by mailuser.nyi.internal (Postfix, from userid 501) id 326303C0F5D; Wed, 21 Jul 2021 02:51:33 -0400 (EDT)
X-Mailer: MessagingEngine.com Webmail Interface
User-Agent: Cyrus-JMAP/3.5.0-alpha0-539-g8589ead45b-fm-20210721.001-g8589ead4
Mime-Version: 1.0
Message-Id: <7cd78e75-2fc2-483d-83d9-6930286378e2@www.fastmail.com>
Date: Wed, 21 Jul 2021 16:51:14 +1000
From: Martin Thomson <mt@lowentropy.net>
To: webtransport@ietf.org, masque@ietf.org
Content-Type: text/plain
Archived-At: <https://mailarchive.ietf.org/arch/msg/webtransport/NIiRl91X3151ppT0lQZvTY0wJ8w>
Subject: [Webtransport] Layered or integrated protocols
X-BeenThere: webtransport@ietf.org
X-Mailman-Version: 2.1.29
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: Wed, 21 Jul 2021 06:51:51 -0000

I was originally just going to announce here that I've made a contribution to the discussion on how to map WebTransport semantics to HTTP.  To be honest this isn't a mapping to HTTP, it's more of a burrow into.

In case you want to read it, here it is: https://www.ietf.org/archive/id/draft-thomson-webtrans-hwtq-00.html

However, in discussing this with Alan Frindell and Eric Kinnear I realized that the designs we are all proposing are based on a bunch of assumptions.

The HTTP/2 integration in draft-ietf-webtrans-http2-00 assumes that the shortest path to expressing WebTransport semantics in HTTP/2 is to reuse HTTP/2 stream semantics as much as possible, adjusting where necessary.  That has a lot of merit, especially when you consider the potential reuse you get of multiplexing, priority, and whatnot.  It's not perfect, but you can make it work with a few precise tweaks.

Then I looked at where MASQUE is headed.  Despite a lot of similarities in what we are seeking to do, the differences there are nearly complete.  Extended CONNECT vs. CONNECT-UDP and capsules vs. frames mean that the two things might look similar, but they share very few design elements.  We are headed toward building one protocol for MASQUE and two completely different protocols for WebTransport.

I don't know what happened to the design of MASQUE that I originally saw, but to me that was a much cleaner layering.  That is, you establish a tunnel (using CONNECT-whatever) and then you use the resulting bidirectional stream to do whatever is necessary.  Then, if you have something better (as you do if you are using QUIC) you move things to their own streams or datagrams as the opportunity arises.

That basic design works for both WebTransport and MASQUE regardless of the HTTP version.  The cost is that a light integration with the underlying protocol forces the design to provide its own resource management and prioritization features.  Multiplexing without flow control is a good way to get bad outcomes, after all.  That might result in some duplication of effort, even bad interactions as you move from a two layer system (connection>stream) to a three layer system (connection>session>stream) in the extreme case.

What we have right now is deep integrations.  That has the aforementioned advantages, but it means that you need to own your stack before you can implement the extension.  That is, in their current form, you can't build WebTransport or MASQUE by taking an HTTP implementation and building *on* it, you have to build *in* the stack.

Deep integrations have a few advantages, particularly when it comes to reusing existing mechanisms.  The HTTP/{2,3} mapping can use HTTP/{2,3} stream flow control and prioritization (assuming that you have already replaced the RFC 7540 scheme for priority, that is).  But they are invasive and can be high maintenance.

Layering protocols avoids coupling at the cost of being constrained by the abstractions of the layers that are used.

One thing that I wanted to do by suggesting a layered design - aside from the architectural split - was to isolate the resource management for WebTransport sessions from the other resources consumed on the connection.  For instance, it would help if two sessions share a connection, then maybe they can each make progress if the other is determined to exhaust the stream limit.  Per session limits are a natural consequence of a layered design.  However, if we don't need that capability, it's not necessarily an advantage.  We should talk about whether we need per-session limits for WebTransport.  Same for MASQUE.

Eric mentioned one point that I hadn't considered.  A generic mapping of QUIC stream and datagram semantics to a stream transport might be more broadly useful.  If that has multiple uses, then that might be good motivation for a layered design.

I don't have a concrete example in mind, but I can offer is the fact that people want to use QUIC in other contexts and they probably do want a TCP fallback also.  If they can't just use WebTransport (which is possible), a generic mapping could be helpful where an HTTP/2 implementation might not be.  An HTTP/1.1 mapping would be the next best thing.  (From my perspective, however, I would never seek to make a purely generic mapping, but rather seek to make large parts of the design trivially reusable in a new mapping.  That's almost the same thing, but I've never seen a generic protocol mapping design that didn't end up full of weird stuff that handled irregularities in one substrate or other.  Or, for programming nerds: monomorphism > generics.)

Anyway, this is a long message to basically ask that we be deliberate about our choices.  I don't think that anyone has chosen the integrated path thoughtlessly, but I want to ask that we collectively step back and make sure that this is really what we want.  That might mean talking about the reasons that push toward integrated designs or more about our resource management requirements.

Cheers,
Martin

p.s., https://datatracker.ietf.org/doc/html/rfc1958#section-3 contains some wrongness (3.9) and some points that can be read any number of ways here (3.5), but I think that point 3.6 argues for layering.