<?xml version='1.0' encoding='utf-8'?>
<?xml-stylesheet type="text/xsl" href="rfc2629.xslt" ?>
<!-- generated by https://github.com/cabo/kramdown-rfc2629 version 1.3.12 -->
<!DOCTYPE rfc SYSTEM "rfc2629-xhtml.ent">
<?rfc toc="yes"?>
<?rfc sortrefs="yes"?>
<?rfc symrefs="yes"?>
<rfc xmlns:xi="http://www.w3.org/2001/XInclude" ipr="trust200902" docName="draft-schinazi-masque-h3-datagram-00" category="std" obsoletes="" updates="" submissionType="IETF" xml:lang="en" tocInclude="true" sortRefs="true" symRefs="true" version="3">
  <!-- xml2rfc v2v3 conversion 3.1.1 -->
  <front>
    <title abbrev="HTTP/3 Datagrams">Using QUIC Datagrams with HTTP/3</title>
    <seriesInfo name="Internet-Draft" value="draft-schinazi-masque-h3-datagram-00"/>
    <author initials="D." surname="Schinazi" fullname="David Schinazi">
      <organization>Google LLC</organization>
      <address>
        <postal>
          <street>1600 Amphitheatre Parkway</street>
          <city>Mountain View, California 94043</city>
          <country>United States of America</country>
        </postal>
        <email>dschinazi.ietf@gmail.com</email>
      </address>
    </author>
    <date year="2020" month="December" day="12"/>
    <keyword>Internet-Draft</keyword>
    <abstract>
      <t>The QUIC DATAGRAM extension provides application protocols running over QUIC
with a mechanism to send unreliable data while leveraging the security and
congestion-control properties of QUIC. However, QUIC DATAGRAM frames do not
provide a means to demultiplex application contexts. This document defines how
to use QUIC DATAGRAM frames when the application protocol running over QUIC is
HTTP/3 by adding an identifier at the start of the frame payload.</t>
      <t>Discussion of this work is encouraged to happen on the MASQUE IETF mailing list
(<eref target="mailto:masque@ietf.org">masque@ietf.org</eref>) or on the GitHub repository which
contains the draft: <eref target="https://github.com/DavidSchinazi/draft-h3-datagram"/>.</t>
    </abstract>
  </front>
  <middle>
    <section anchor="intro" numbered="true" toc="default">
      <name>Introduction</name>
      <t>The QUIC DATAGRAM extension <xref target="DGRAM" format="default"/> provides
application protocols running over QUIC <xref target="QUIC" format="default"/> with
a mechanism to send unreliable data while leveraging the security and
congestion-control properties of QUIC. However, QUIC DATAGRAM frames do not
provide a means to demultiplex application contexts. This document defines how
to use QUIC DATAGRAM frames when the application protocol running over QUIC is
HTTP/3 <xref target="H3" format="default"/> by adding an identifier at the start of the
frame payload.</t>
      <t>This design mimics the use of Stream Types in HTTP/3, which provide a
demultiplexing identifier at the start of each unidirectional stream.</t>
      <t>Discussion of this work is encouraged to happen on the MASQUE IETF mailing list
(<eref target="mailto:masque@ietf.org">masque@ietf.org</eref>) or on the GitHub repository which
contains the draft: <eref target="https://github.com/DavidSchinazi/draft-h3-datagram"/>.</t>
      <section anchor="defs" numbered="true" toc="default">
        <name>Conventions and Definitions</name>
        <t>The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD",
"SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this
document are to be interpreted as described in BCP 14 <xref target="RFC2119" format="default"/> <xref target="RFC8174" format="default"/>
when, and only when, they appear in all capitals, as shown here.</t>
      </section>
    </section>
    <section anchor="format" numbered="true" toc="default">
      <name>HTTP/3 DATAGRAM Frame Format</name>
      <t>When used with HTTP/3, the Datagram Data field of QUIC DATAGRAM frames uses the
following format:</t>
      <figure anchor="h3-datagram-format">
        <name>HTTP/3 DATAGRAM Frame Format</name>
        <artwork name="" type="" align="left" alt=""><![CDATA[
 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                     Flow Identifier (i)                     ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                 HTTP/3 Datagram Payload (*)                 ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
]]></artwork>
      </figure>
      <dl newline="false" spacing="normal">
        <dt>Flow Identifier:</dt>
        <dd>
  A variable-length integer indicating the Flow Identifier of the datagram (see
<xref target="flow-id" format="default"/>).</dd>
        <dt>HTTP/3 Datagram Payload:</dt>
        <dd>
  The payload of the datagram, whose semantics are defined by individual
applications.</dd>
      </dl>
      <section anchor="flow-id" numbered="true" toc="default">
        <name>Flow Identifiers</name>
        <t>Flow identifiers represent bidirectional flows of datagrams within a single QUIC
connection. These are conceptually similar to streams in the sense that they
allow multiplexing of application data.  Of course flows lack any of the ordering
or reliability guarantees of streams.</t>
        <t>Beyond this, a sender SHOULD ensure that DATAGRAM frames within a single flow
are transmitted in order relative to one another. If multiple DATAGRAM frames
can be packed into a single QUIC packet, the sender SHOULD group them by flow
identifier to promote fate-sharing within a specific flow and improve the
ability to process batches of datagram messages efficiently on the receiver.</t>
      </section>
    </section>
    <section anchor="flow-id-alloc" numbered="true" toc="default">
      <name>Flow Identifier Allocation</name>
      <t>Implementations of HTTP/3 that support the DATAGRAM extension MUST provide a
flow identifier allocation service. That service will allow applications
co-located with HTTP/3 to request a unique flow identifier that they can
subsequently use for their own purposes. The HTTP/3 implementation will then
parse the flow identifier of incoming DATAGRAM frames and use it to deliver the
frame to the appropriate application.</t>
      <t>Even flow identifiers are client-initiated, while odd flow identifiers are
server-initiated. This means that an HTTP/3 client implementation of the
flow identifier allocation service MUST only provide even identifiers, while
a server implementation MUST only provide odd identifiers. Note that, once
allocated, any flow identifier can be used by both client and server - only
allocation carries separate namespaces to avoid requiring synchronization.</t>
    </section>
    <section anchor="setting" numbered="true" toc="default">
      <name>The H3_DATAGRAM HTTP/3 SETTINGS Parameter</name>
      <t>Implementations of HTTP/3 that support this mechanism can indicate that to
their peer by sending the H3_DATAGRAM SETTINGS parameter with a value of 1.
The value of the H3_DATAGRAM SETTINGS parameter MUST be either 0 or 1. A value
of 0 indicates that this mechanism is not supported. An endpoint that receives
the H3_DATAGRAM SETTINGS parameter with a value that is neither 0 or 1 MUST
terminate the connection with error H3_SETTINGS_ERROR.</t>
      <t>And endpoint that sends the H3_DATAGRAM SETTINGS parameter with a value of 1
MUST send the max_datagram_frame_size QUIC Transport Parameter <xref target="DGRAM" format="default"/>.
An endpoint that receives the H3_DATAGRAM SETTINGS parameter with a value of 1
on a QUIC connection that did not also receive the max_datagram_frame_size
QUIC Transport Parameter MUST terminate the connection with error
H3_SETTINGS_ERROR.</t>
      <t>When clients use 0-RTT, they MAY store the value of the server's H3_DATAGRAM
SETTINGS parameter.  Doing so allows the client to use HTTP/3 datagrams in
0-RTT packets.  When servers decide to accept 0-RTT data, they MUST send a
H3_DATAGRAM SETTINGS parameter greater or equal to the value they sent to the
client in the connection where they sent them the NewSessionTicket
message.  If a client stores the value of the H3_DATAGRAM SETTINGS parameter
with their 0-RTT state, they MUST validate that the new value of the
H3_DATAGRAM SETTINGS parameter sent by the server in the handshake is greater
or equal to the stored value; if not, the client MUST terminate the connection
with error H3_SETTINGS_ERROR.</t>
    </section>
    <section anchor="security" numbered="true" toc="default">
      <name>Security Considerations</name>
      <t>This document currently does not have additional security considerations beyond
those defined in <xref target="QUIC" format="default"/> and <xref target="DGRAM" format="default"/>.</t>
    </section>
    <section anchor="iana" numbered="true" toc="default">
      <name>IANA Considerations</name>
      <t>This document will request IANA to register the following entry in the
"HTTP/3 Settings" registry:</t>
      <artwork name="" type="" align="left" alt=""><![CDATA[
  +--------------+-------+---------------+---------+
  | Setting Name | Value | Specification | Default |
  +==============+=======+===============+=========+
  | H3_DATAGRAM  | 0x276 | This Document |    0    |
  +--------------+-------+---------------+---------+
]]></artwork>
    </section>
  </middle>
  <back>
    <references>
      <name>Normative References</name>
      <reference anchor="DGRAM" target="http://www.ietf.org/internet-drafts/draft-ietf-quic-datagram-01.txt">
        <front>
          <title>An Unreliable Datagram Extension to QUIC</title>
          <author initials="T" surname="Pauly" fullname="Tommy Pauly">
            <organization/>
          </author>
          <author initials="E" surname="Kinnear" fullname="Eric Kinnear">
            <organization/>
          </author>
          <author initials="D" surname="Schinazi" fullname="David Schinazi">
            <organization/>
          </author>
          <date month="August" day="24" year="2020"/>
          <abstract>
            <t>This document defines an extension to the QUIC transport protocol to add support for sending and receiving unreliable datagrams over a QUIC connection.  Discussion of this work is encouraged to happen on the QUIC IETF mailing list quic@ietf.org (mailto:quic@ietf.org) or on the GitHub repository which contains the draft: https://github.com/quicwg/ datagram (https://github.com/quicwg/datagram).</t>
          </abstract>
        </front>
        <seriesInfo name="Internet-Draft" value="draft-ietf-quic-datagram-01"/>
      </reference>
      <reference anchor="QUIC" target="http://www.ietf.org/internet-drafts/draft-ietf-quic-transport-32.txt">
        <front>
          <title>QUIC: A UDP-Based Multiplexed and Secure Transport</title>
          <author initials="J" surname="Iyengar" fullname="Jana Iyengar">
            <organization/>
          </author>
          <author initials="M" surname="Thomson" fullname="Martin Thomson">
            <organization/>
          </author>
          <date month="October" day="20" year="2020"/>
          <abstract>
            <t>This document defines the core of the QUIC transport protocol. Accompanying documents describe QUIC's loss detection and congestion control and the use of TLS for key negotiation.  Note to Readers  Discussion of this draft takes place on the QUIC working group mailing list (quic@ietf.org (mailto:quic@ietf.org)), which is archived at https://mailarchive.ietf.org/arch/search/?email_list=quic  Working Group information can be found at https://github.com/quicwg; source code and issues list for this draft can be found at https://github.com/quicwg/base-drafts/labels/-transport.</t>
          </abstract>
        </front>
        <seriesInfo name="Internet-Draft" value="draft-ietf-quic-transport-32"/>
      </reference>
      <reference anchor="H3" target="http://www.ietf.org/internet-drafts/draft-ietf-quic-http-32.txt">
        <front>
          <title>Hypertext Transfer Protocol Version 3 (HTTP/3)</title>
          <author initials="M" surname="Bishop" fullname="Mike Bishop">
            <organization/>
          </author>
          <date month="October" day="20" year="2020"/>
          <abstract>
            <t>The QUIC transport protocol has several features that are desirable in a transport for HTTP, such as stream multiplexing, per-stream flow control, and low-latency connection establishment.  This document describes a mapping of HTTP semantics over QUIC.  This document also identifies HTTP/2 features that are subsumed by QUIC, and describes how HTTP/2 extensions can be ported to HTTP/3.</t>
          </abstract>
        </front>
        <seriesInfo name="Internet-Draft" value="draft-ietf-quic-http-32"/>
      </reference>
      <reference anchor="RFC2119" target="https://www.rfc-editor.org/info/rfc2119">
        <front>
          <title>Key words for use in RFCs to Indicate Requirement Levels</title>
          <author initials="S." surname="Bradner" fullname="S. Bradner">
            <organization/>
          </author>
          <date year="1997" month="March"/>
          <abstract>
            <t>In many standards track documents several words are used to signify the requirements in the specification.  These words are often capitalized. This document defines these words as they should be interpreted in IETF documents.  This document specifies an Internet Best Current Practices for the Internet Community, and requests discussion and suggestions for improvements.</t>
          </abstract>
        </front>
        <seriesInfo name="BCP" value="14"/>
        <seriesInfo name="RFC" value="2119"/>
        <seriesInfo name="DOI" value="10.17487/RFC2119"/>
      </reference>
      <reference anchor="RFC8174" target="https://www.rfc-editor.org/info/rfc8174">
        <front>
          <title>Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words</title>
          <author initials="B." surname="Leiba" fullname="B. Leiba">
            <organization/>
          </author>
          <date year="2017" month="May"/>
          <abstract>
            <t>RFC 2119 specifies common key words that may be used in protocol  specifications.  This document aims to reduce the ambiguity by clarifying that only UPPERCASE usage of the key words have the  defined special meanings.</t>
          </abstract>
        </front>
        <seriesInfo name="BCP" value="14"/>
        <seriesInfo name="RFC" value="8174"/>
        <seriesInfo name="DOI" value="10.17487/RFC8174"/>
      </reference>
    </references>
    <section numbered="false" anchor="acks" toc="default">
      <name>Acknowledgments</name>
      <t>The DATAGRAM frame identifier was previously part of the DATAGRAM frame
definition itself, the author would like to acknowledge the authors of
that document and the members of the IETF QUIC working group for their
suggestions. Additionally, the author would like to thank Martin Thomson
for suggesting the use of an HTTP/3 SETTINGS parameter.</t>
    </section>
  </back>
  <!-- ##markdown-source:
H4sIAM6I1V8AA+1ZXXMTORZ916/QOg8LQ9okhGUGb1E1niRAqkjCJGa2tqam
KLlbtlXpljySOsYE89v3XEnttNuZMLC7T7vhwd1q6X4c3Y8jkWUZ88qXcsDf
OaWn/Od3J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