<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE rfc [
  <!ENTITY nbsp    "&#160;">
  <!ENTITY zwsp   "&#8203;">
  <!ENTITY nbhy   "&#8209;">
  <!ENTITY wj     "&#8288;">
]>
<?xml-stylesheet type="text/xsl" href="rfc2629.xslt" ?>
<!-- generated by https://github.com/cabo/kramdown-rfc version 1.6.13 (Ruby 3.1.2) -->
<?rfc rfcedstyle="yes"?>
<?rfc tocindent="yes"?>
<?rfc strict="yes"?>
<?rfc comments="yes"?>
<?rfc inline="yes"?>
<?rfc text-list-symbols="o-*+"?>
<?rfc compact="yes"?>
<?rfc subcompact="yes"?>
<?rfc consensus="no"?>
<rfc xmlns:xi="http://www.w3.org/2001/XInclude" ipr="trust200902" docName="draft-tschofenig-core-early-data-option-00" category="std" consensus="true" submissionType="IETF" tocInclude="true" sortRefs="true" symRefs="true" version="3">
  <!-- xml2rfc v2v3 conversion 3.13.0 -->
  <front>
    <title abbrev="CoAP Early Data">Early Data Option for CoAP</title>
    <seriesInfo name="Internet-Draft" value="draft-tschofenig-core-early-data-option-00"/>
    <author initials="H." surname="Tschofenig" fullname="Hannes Tschofenig">
      <organization>Arm Limited</organization>
      <address>
        <email>Hannes.Tschofenig@gmx.net</email>
      </address>
    </author>
    <author initials="T." surname="Fossati" fullname="Thomas Fossati">
      <organization>Arm Limited</organization>
      <address>
        <email>Thomas.Fossati@arm.com</email>
      </address>
    </author>
    <date year="2022" month="July" day="06"/>
    <area>ART</area>
    <workgroup>CoRE Working Group</workgroup>
    <keyword>CoAP, Option, Early Data, TLS 1.3</keyword>
    <abstract>
      <t>This document defines mechanisms that allow clients to communicate with servers
about CoAP requests that are sent in early data.  Techniques are described that
use these mechanisms to mitigate the risk of replay.</t>
    </abstract>
    <note removeInRFC="true">
      <name>Discussion Venues</name>
      <t>Discussion of this document takes place on the
    Constrained RESTful Environments Working Group mailing list (core@ietf.org),
    which is archived at <eref target="https://mailarchive.ietf.org/arch/browse/core/"/>.</t>
      <t>Source for this draft and an issue tracker can be found at
    <eref target="https://github.com/thomas-fossati/draft-coap-early-data"/>.</t>
    </note>
  </front>
  <middle>
    <section anchor="introduction">
      <name>Introduction</name>
      <t>TLS and DTLS 1.3 provide a "zero round-trip time" (0-RTT) feature, the
mechanics of which are described in <xref section="2.3" sectionFormat="of" target="TLS13"/>.</t>
      <t>This feature provides a significant performance enhancement by enabling a
client to send data to a server whom it has already spoken to in the first TLS
handshake flight.  However, TLS does not provide inherent replay protections
for 0-RTT data, therefore the application running atop the TLS session has to
take care of that.  Specifically, <xref section="E.5" sectionFormat="of" target="TLS13"/> establishes that:</t>
      <ul empty="true">
        <li>
          <t>Application protocols <bcp14>MUST NOT</bcp14> use 0-RTT data without a profile that
defines its use.  That profile needs to identify which messages or
interactions are safe to use with 0-RTT and how to handle the
situation when the server rejects 0-RTT and falls back to 1-RTT.</t>
        </li>
      </ul>
      <t>This document defines the application profile for CoAP <xref target="CoAP"/> to allow
clients and servers to exchange CoAP requests that are sent in early data.  It
also describes how to mitigate the risk of replay.  The design is inspired by
<xref target="RFC8470"/>.</t>
      <section anchor="requirements-language">
        <name>Requirements Language</name>
        <t>The key words "<bcp14>MUST</bcp14>", "<bcp14>MUST NOT</bcp14>", "<bcp14>REQUIRED</bcp14>", "<bcp14>SHALL</bcp14>", "<bcp14>SHALL
NOT</bcp14>", "<bcp14>SHOULD</bcp14>", "<bcp14>SHOULD NOT</bcp14>", "<bcp14>RECOMMENDED</bcp14>", "<bcp14>NOT RECOMMENDED</bcp14>",
"<bcp14>MAY</bcp14>", and "<bcp14>OPTIONAL</bcp14>" in this document are to be interpreted as
described in BCP 14 <xref target="RFC2119"/> <xref target="RFC8174"/> when, and only when, they
appear in all capitals, as shown here.</t>
      </section>
    </section>
    <section anchor="rtt-data">
      <name>0-RTT Data</name>
      <t>For a given request, the level of tolerance to replay risk is specific to the
resource it operates upon (and therefore only known to the origin server).  In
general, if processing a request does not have state-changing side effects,
the consequences of replay are not significant. The server can choose whether
it will process early data before the TLS handshake completes.</t>
      <t>It is <bcp14>RECOMMENDED</bcp14> that origin servers allow resources to explicitly configure
whether early data is appropriate in requests.</t>
      <t>This document specifies the Early-Data option, which indicates that the
request has been conveyed in early data and that a client understands the 4.25
(Too Early) status code. The semantic follows <xref target="RFC8470"/>.</t>
      <table anchor="fig-early-data">
        <name>Early-Data Option</name>
        <thead>
          <tr>
            <th align="left">No.</th>
            <th align="left">C</th>
            <th align="left">U</th>
            <th align="left">N</th>
            <th align="left">R</th>
            <th align="left">Name</th>
            <th align="left">Format</th>
            <th align="left">Length</th>
            <th align="left">Default</th>
            <th align="left">E</th>
          </tr>
        </thead>
        <tbody>
          <tr>
            <td align="left">TBD</td>
            <td align="left">x</td>
            <td align="left"> </td>
            <td align="left"> </td>
            <td align="left"> </td>
            <td align="left">Early-Data</td>
            <td align="left">empty</td>
            <td align="left">0</td>
            <td align="left">(none)</td>
            <td align="left">x</td>
          </tr>
        </tbody>
      </table>
      <t><cref>Note that 4.25 is just the suggested CoAP response code, which has not
been registered yet.</cref></t>
    </section>
    <section anchor="open-issues">
      <name>Open Issues</name>
      <t>A list of open issues can be found at
https://github.com/thomas-fossati/draft-coap-early-data/issues</t>
    </section>
    <section anchor="security-considerations">
      <name>Security Considerations</name>
      <t>Background:</t>
      <ul spacing="compact">
        <li>
          <xref section="E.5" sectionFormat="of" target="TLS13"/></li>
        <li>
          <xref section="8" sectionFormat="of" target="TLS13"/></li>
        <li>
          <xref section="6" sectionFormat="of" target="RFC8470"/></li>
      </ul>
    </section>
    <section anchor="iana-considerations">
      <name>IANA Considerations</name>
      <section anchor="new-option">
        <name>New Option</name>
        <t>IANA is asked to add the Option defined in <xref target="tbl-early-data-option"/> to the
CoAP Option Numbers registry.</t>
        <table align="left" anchor="tbl-early-data-option">
          <name>Early-Data Option</name>
          <thead>
            <tr>
              <th align="left">Number</th>
              <th align="left">Name</th>
              <th align="left">Reference</th>
            </tr>
          </thead>
          <tbody>
            <tr>
              <td align="left">TBD</td>
              <td align="left">Early-Data</td>
              <td align="left">RFCthis</td>
            </tr>
          </tbody>
        </table>
      </section>
      <section anchor="new-response-code">
        <name>New Response Code</name>
        <t>IANA is asked to add the Response Code defined in <xref target="tbl-too-early-code"/> to
the CoAP Response Code registry.</t>
        <table align="left" anchor="tbl-too-early-code">
          <name>Too Early Response Code</name>
          <thead>
            <tr>
              <th align="left">Code</th>
              <th align="left">Description</th>
              <th align="left">Reference</th>
            </tr>
          </thead>
          <tbody>
            <tr>
              <td align="left">4.25</td>
              <td align="left">Too Early</td>
              <td align="left">RFCthis</td>
            </tr>
          </tbody>
        </table>
      </section>
    </section>
  </middle>
  <back>
    <references>
      <name>Normative References</name>
      <reference anchor="DTLS13">
        <front>
          <title>The Datagram Transport Layer Security (DTLS) Protocol Version 1.3</title>
          <author fullname="E. Rescorla" initials="E." surname="Rescorla">
            <organization/>
          </author>
          <author fullname="H. Tschofenig" initials="H." surname="Tschofenig">
            <organization/>
          </author>
          <author fullname="N. Modadugu" initials="N." surname="Modadugu">
            <organization/>
          </author>
          <date month="April" year="2022"/>
          <abstract>
            <t>This document specifies version 1.3 of the Datagram Transport Layer Security (DTLS) protocol. DTLS 1.3 allows client/server applications to communicate over the Internet in a way that is designed to prevent eavesdropping, tampering, and message forgery.</t>
            <t>The DTLS 1.3 protocol is based on the Transport Layer Security (TLS) 1.3 protocol and provides equivalent security guarantees with the exception of order protection / non-replayability.  Datagram semantics of the underlying transport are preserved by the DTLS protocol.</t>
            <t>This document obsoletes RFC 6347.</t>
          </abstract>
        </front>
        <seriesInfo name="RFC" value="9147"/>
        <seriesInfo name="DOI" value="10.17487/RFC9147"/>
      </reference>
      <reference anchor="TLS13">
        <front>
          <title>The Transport Layer Security (TLS) Protocol Version 1.3</title>
          <author fullname="E. Rescorla" initials="E." surname="Rescorla">
            <organization/>
          </author>
          <date month="August" year="2018"/>
          <abstract>
            <t>This document specifies version 1.3 of the Transport Layer Security (TLS) protocol.  TLS allows client/server applications to communicate over the Internet in a way that is designed to prevent eavesdropping, tampering, and message forgery.</t>
            <t>This document updates RFCs 5705 and 6066, and obsoletes RFCs 5077, 5246, and 6961.  This document also specifies new requirements for TLS 1.2 implementations.</t>
          </abstract>
        </front>
        <seriesInfo name="RFC" value="8446"/>
        <seriesInfo name="DOI" value="10.17487/RFC8446"/>
      </reference>
      <reference anchor="CoAP">
        <front>
          <title>The Constrained Application Protocol (CoAP)</title>
          <author fullname="Z. Shelby" initials="Z." surname="Shelby">
            <organization/>
          </author>
          <author fullname="K. Hartke" initials="K." surname="Hartke">
            <organization/>
          </author>
          <author fullname="C. Bormann" initials="C." surname="Bormann">
            <organization/>
          </author>
          <date month="June" year="2014"/>
          <abstract>
            <t>The Constrained Application Protocol (CoAP) is a specialized web transfer protocol for use with constrained nodes and constrained (e.g., low-power, lossy) networks.  The nodes often have 8-bit microcontrollers with small amounts of ROM and RAM, while constrained networks such as IPv6 over Low-Power Wireless Personal Area Networks (6LoWPANs) often have high packet error rates and a typical throughput of 10s of kbit/s.  The protocol is designed for machine- to-machine (M2M) applications such as smart energy and building automation.</t>
            <t>CoAP provides a request/response interaction model between application endpoints, supports built-in discovery of services and resources, and includes key concepts of the Web such as URIs and Internet media types.  CoAP is designed to easily interface with HTTP for integration with the Web while meeting specialized requirements such as multicast support, very low overhead, and simplicity for constrained environments.</t>
          </abstract>
        </front>
        <seriesInfo name="RFC" value="7252"/>
        <seriesInfo name="DOI" value="10.17487/RFC7252"/>
      </reference>
      <reference anchor="RFC8470">
        <front>
          <title>Using Early Data in HTTP</title>
          <author fullname="M. Thomson" initials="M." surname="Thomson">
            <organization/>
          </author>
          <author fullname="M. Nottingham" initials="M." surname="Nottingham">
            <organization/>
          </author>
          <author fullname="W. Tarreau" initials="W." surname="Tarreau">
            <organization/>
          </author>
          <date month="September" year="2018"/>
          <abstract>
            <t>Using TLS early data creates an exposure to the possibility of a replay attack.  This document defines mechanisms that allow clients to communicate with servers about HTTP requests that are sent in early data.  Techniques are described that use these mechanisms to mitigate the risk of replay.</t>
          </abstract>
        </front>
        <seriesInfo name="RFC" value="8470"/>
        <seriesInfo name="DOI" value="10.17487/RFC8470"/>
      </reference>
      <reference anchor="RFC2119">
        <front>
          <title>Key words for use in RFCs to Indicate Requirement Levels</title>
          <author fullname="S. Bradner" initials="S." surname="Bradner">
            <organization/>
          </author>
          <date month="March" year="1997"/>
          <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">
        <front>
          <title>Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words</title>
          <author fullname="B. Leiba" initials="B." surname="Leiba">
            <organization/>
          </author>
          <date month="May" year="2017"/>
          <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>
  </back>
  <!-- ##markdown-source:
H4sIAAAAAAAAA5VX7W4buRX9z6e4lYEiST3yxzqbjZANVvFHY8CxU1tBsSiK
gprhSFyPyFmSY3vWzrv0WfpkPZccSSPbCVoY8sxcfl2ee+7hZZZlIuhQqREd
S1e1dCSDpIs6aGuotI4O7fizkNOpUzej+NHrJwqbG7nA2MLJMmTB53NbKqNn
WW6dyhT3zAr0zGycMdvdFbkMamZdOyIfCpFb45XxjR9RcI0SvpkutPfoG9oa
E58eT06E0LWL7T7s7+6+3d0X0ik5ovHlRNxadz1ztqnZu8tj+ju+tZnRX9km
rlWLDkXyfLvb13ZvC9s0ObuiveEPQvggTfEvWVmDdVv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