Draft: draft-ietf-masque-h3-datagram

Commentary: This PR adds a new concept of context close codes which will allow applications that use contexts to indicate the reason for closing a context . This PR also makes the extensibility mechanism binary as that is easier to implement . 
 In , we introduce the CLOSEDATAGRAMCONTEXT capsule which allows endpoints to close a context . That message currently only contains the context ID to close . suggests that we may want to add more information there . Should we differentiate between " context close " and " context registration rejected " ? Should we add an error code ? In particular , do folks have use cases for these features ? 
 My first concern is with infinite loops . If the context was " garbage collected " by the recipient , the sender can simply re - create it if they still want it . However , if it was closed due to incompatibility ( i.e. rejected ) or hitting a resource limit ( e.g. max # of contexts ) , reopening it in response will produce a tight infinite loop . This could be maybe be avoided by some kind of heuristic , but an explicit indication of what 's going on seems better . 
 LGTM thanks
A string of comma-separated key-value pairs to enable
extensibility.  Keys are registered with IANA, see iana-keys.
Note that this close is unilateral and bidirectional: the sender of
the frame unilaterally informs its peer of the closure.  Endpoints
can use CLOSE_DATAGRAM_CONTEXT capsules to close a context that was
initially registered by either themselves, or by their peer.
Endpoints MAY use the CLOSE_DATAGRAM_CONTEXT capsule to immediately
reject a context that was just registered using a
REGISTER_DATAGRAM_CONTEXT capsule if they find its Extension String
to be unacceptable.
Note that this close is unilateral and bidirectional: the sender of
the frame unilaterally informs its peer of the closure.  Endpoints
can use CLOSE_DATAGRAM_CONTEXT capsules to close a context that was
initially registered by either themselves, or by their peer.
Endpoints MAY use the CLOSE_DATAGRAM_CONTEXT capsule to immediately
reject a context that was just registered using a
REGISTER_DATAGRAM_CONTEXT capsule if they find its Context Extensions
field to be unacceptable.
All CLOSE_DATAGRAM_CONTEXT capsules MUST contain a CLOSE_CODE context
extension, see close-code.  If an endpoint receives a
CLOSE_DATAGRAM_CONTEXT capsule without a CLOSE_CODE context
extension, the endpoint MUST abruptly terminate the corresponding
stream with a stream error of type H3_GENERAL_PROTOCOL_ERROR.
Context Extension Types are registered with IANA, see iana-ext-types.
The Context Extension Length field contains the length of the Context
Extension Value field in bytes.  The semantics of the Context
Extension Value field are defined by the corresponding Context
Extension Type.
This indicates that the registration was closed without any
additional information.
This indicates that the sender has rejected the context
registration based on its local policy.  The endpoint that had
originally registered this context MUST NOT try to register
another context with the same context extensions on this stream.
This indicates that the context was closed to save resources.  The
recipient SHOULD limit its future registration of resource-
incentive contexts.
Receipt of an unknown close code MUST be treated as if the NO_ERROR
code was present.  Close codes are registered with IANA, see iana-
close-codes.
The DETAILS context extension type (type=0x01) allows an endpoint to
provide additional details to context capsules.  It is meant for
debugging purposes.  Its Context Extension Value field consists of a
human-readable string encoded in UTF-8.
The key (see register-capsule).  Keys MUST be valid tokens as
defined in Section 3.2.6 of RFC7230.
A brief description of the key semantics, which MAY be a summary
if a specification reference is provided.
Registrations follow the "First Come First Served" policy (see
Section 4.4 of IANA-POLICY) where two registrations MUST NOT have the
same Key.  This registry is initially empty.
A name or label for the context extension type.
The value of the Context Extension Type field (see context-ext) is
a 62bit integer.
A name or label for the close code.
The value of the CLOSE_CODE Context Extension Value field (see
close-code) is a 62bit integer.