Subject: [Masque] Spelling context registration

From: Ben Schwartz <[email-masked]>
Date: Thu, 15 Apr 2021 21:00:34 -0400

As David mentioned in today's meeting [1], we need to consider how to
convey a "context* registration" during a MASQUE session.  The registration
command is end-to-end (irrelevant to intermediaries) and has to be
reliable.  It would be nice if it could be followed by first-flight data
that will not be reordered ahead of the registration.

I propose that we solve this by defining a new HTTP Frame Type: CAPSULE**.
Like DATA, CAPSULE is reliable, ordered, and arrives on a Stream.  Like an
HTTP/3 Datagram, CAPSULE is end-to-end, atomic and does not contribute to
the Body.  That's all an intermediary needs to know.

For MASQUE, we define a registry of CAPSULE commands, identified by a
varint at the top of the payload:
CAPSULE:Datagram(byte[] payload) - Just like an HTTP/3 Datagram, but
delivered reliably and in-order.
CAPSULE:RegisterDatagramContext(ContextConfig) - Registers a new Datagram
Context with the next incrementing Context ID (ensuring no ID reuse).
CAPSULE:CloseDatagramContext(varint id) - Destroy a Datagram Context to
free up memory.  (IDs still cannot be reused.)
CAPSULE:DatagramContextRegistrationResult(varint id, bool success)*** -
Indicate whether a registration succeeded.

--Ben Schwartz

[1] Slides 13-15 of
https://github.com/ietf-wg-masque/wg-materials/blob/main/interim-21-04/masque-interim-2021-04-h3-dgram.pdf

* Borrowing Jana's term.  This is called a "flow" in David's slides.
** Placeholder name
*** I think we don't need this, and probably should not define it, but
that's a topic for a different thread.