<?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  (Ruby 3.0.4) -->
<rfc xmlns:xi="http://www.w3.org/2001/XInclude" ipr="trust200902" docName="draft-amsuess-core-coap-kitchensink-01" category="info" version="3">
  <!-- xml2rfc v2v3 conversion 3.12.4 -->
  <front>
    <title>Everything over CoAP</title>
    <seriesInfo name="Internet-Draft" value="draft-amsuess-core-coap-kitchensink-01"/>
    <author initials="C." surname="Amsüss" fullname="Christian Amsüss">
      <organization/>
      <address>
        <postal>
          <country>Austria</country>
        </postal>
        <email>christian@amsuess.com</email>
      </address>
    </author>
    <date year="2022" month="May" day="28"/>
    <workgroup>CoRE</workgroup>
    <keyword>CoAP, NTP</keyword>
    <abstract>
      <t>The Constrained Application Protocol (CoAP) has become the base of applications
both inside of the constrained devices space it originally aimed for
and outside.
This document gives an overview of applications that
are, can, may,
and would better not be implemented on top of CoAP.</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://gitlab.com/chrysn/coap-kitchensink"/>.</t>
    </note>
  </front>
  <middle>
    <section anchor="introduction">
      <name>Introduction</name>
      <t>[ See abstract for now ]</t>
    </section>
    <section anchor="applications">
      <name>Applications</name>
      <section anchor="publish-subscribe-services">
        <name>Publish-Subscribe services</name>
        <t>Publish-subscribe services (pubsub) are a widespread tool for the some of the fundamental use cases of Internet of Things (IoT) protocols:
acquiring sensor data and controlling actuators.</t>
        <t>A pubsub implementation has been in development since shorlty after the original CoAP publication
and is as of now still in draft status, as <xref target="I-D.ietf-core-coap-pubsub"/>.</t>
        <dl>
          <dt>Competing with</dt>
          <dd>
            <t>MQTT</t>
          </dd>
          <dt>Strong points</dt>
          <dd>
            <t>Once a topic is set up, data can be sent and received
by CoAP clients that are not even aware of pubsub,
as long as they can PUT or GET (possibly with observation) data to and from configured URIs.</t>
          </dd>
          <dt>Weak points</dt>
          <dd>
            <t>To implement a pubsub broker that supports arbitrarily many topics,
some (potentially difficult-to-implement) compromises have to be made.</t>
          </dd>
        </dl>
      </section>
      <section anchor="remote-configuration">
        <name>Remote configuration</name>
        <t>The OMA LwM2M protocol
(which caters for several applications at the granularity of this document)
includes provisions for configuring and monitoring devices over the network,
setting properties such as a time server
and reading properties such as a network interface's packet count.</t>
        <t>In parallel, the NETCONF protocol and its YANG modelling language
have been ported to the constrained ecosystem as CORECONF <xref target="I-D.ietf-core-comi"/>.
By using numeric identifiers with good compression properties,
it can efficiently express data both from shared and from bespoke models in single requests.</t>
        <dl>
          <dt>Competing with</dt>
          <dd>
            <t>SNMP [ ? ], Puppet [ ? ]</t>
          </dd>
        </dl>
        <section anchor="network-status-monitoring">
          <name>Network status monitoring</name>
          <t>Related to remote configuration,
CoAP is used as the signalling channel of DOTS (<xref target="RFC132"/>).</t>
          <dl>
            <dt>Strong points</dt>
            <dd>
              <t>CoAP over UDP/DTLS provides operational signalling on links under attack,
on which a TCP/TLS based connection would fail.</t>
            </dd>
            <dt/>
            <dd>
              <t>CoAP's consistency across transports
makes it easy to adjust to situations in which UDP is uanvailable,
sacrificing some properties but leaving the high-level protocol unmodified.</t>
            </dd>
            <dt>Weak points</dt>
            <dd>
              <t>CoAP's default parameters for flow control (such as <tt>PROBING_RATE</tt>) are unsuitable for this application
and need to be customized.</t>
            </dd>
          </dl>
        </section>
      </section>
      <section anchor="software-updates">
        <name>Software updates</name>
        <t>The SUIT manifest format <xref target="I-D.ietf-suit-manifest"/> can be used to describe firmware updates
that can be performed over CoAP or any other protocol that is expressible in terms of URIs.</t>
        <t>The OMA LwM2M protocol also contains provisions for firmware updates over CoAP.</t>
      </section>
      <section anchor="network-file-system">
        <name>Network file system</name>
        <t>Using CoAP as a backend for a no-frills file service
is a simple composition and is provided as a demo by the aiocoap library and a module in the RIOT operating system.</t>
        <t>It has never been specified and described;
that gap is closed in <xref target="coap-filesystem"/>.</t>
        <dl>
          <dt>Competing with</dt>
          <dd>
            <t>WebDAV, NFS, FTP</t>
          </dd>
          <dt>Strong points</dt>
          <dd>
            <t>CoAP protocol already provides random read access (through the Block2 option),
optimistic locking and cache (through the ETag and If-Match options)
and change notification (through the Observe option).</t>
          </dd>
          <dt/>
          <dd>
            <t>Files can be used in other CoAP protocols without the client's awareness (e.g. for SUIT)</t>
          </dd>
          <dt>Weak points</dt>
          <dd>
            <t>Transfer of large files is inefficient due to the repetition of file names in block-wise requests
(mitigated when using CoAP-over-TCP and BERT).</t>
          </dd>
          <dt/>
          <dd>
            <t>Advanced file system functionality (file metadata, server-to-server copies, renaming, locking)
would need additional specifications.</t>
          </dd>
        </dl>
      </section>
      <section anchor="network-address-resolution">
        <name>Network address resolution</name>
        <t>The Domain Name System (DNS) can be utilized from CoAP using the mechanisms described in <xref target="I-D.draft-lenders-dns-over-coap"/>.</t>
        <dl>
          <dt>Strong points</dt>
          <dd>
            <t>Savings in firmware complexity by using infrastructure shared with other applications.</t>
          </dd>
          <dt/>
          <dd>
            <t>Potential for traffic (and thus energy) reduction by using request-response binding.</t>
          </dd>
          <dt>Weak points</dt>
          <dd>
            <t>Not deployed in existing networks.</t>
          </dd>
        </dl>
      </section>
      <section anchor="time-service">
        <name>Time service</name>
        <t>Whereas no attempt has been made yet to specify a time service over CoAP,
a primitive time service can be assembled by creating a CoAP resource that returns the server's current time,
e.g., in a UNIX time stamp represented in decimal ASCII, or in CBOR using any of timestamp tags (0, 1 or 1001).</t>
        <t>Such services have been in use since at least 2013,
and are easy to operate and scale.</t>
        <dl>
          <dt>Competing with</dt>
          <dd>
            <t>SNTP, NTP</t>
          </dd>
          <dt>Strong points</dt>
          <dd>
            <t>Savings in firmware complexity by using infrastructure shared with other applications.</t>
          </dd>
          <dt/>
          <dd>
            <t>Compact messages.</t>
          </dd>
          <dt/>
          <dd>
            <t>Reuse of existing security associations.</t>
          </dd>
          <dt>Weak points</dt>
          <dd>
            <t>None of the advanced features of (S)NTP, such as distinction between receive and transmit timestamps.
Not even leap seconds are advertised
(but that can be mitigated by using a time scale that is not affected by them, such as TAI).</t>
          </dd>
          <dt/>
          <dd>
            <t>Generally only suitable for the last hop in time synchronization.</t>
          </dd>
        </dl>
      </section>
      <section anchor="terminal-access">
        <name>Terminal access</name>
        <t>Virtual terminal access was one of the first network applications described in an RFC (<xref target="RFC15"/>),
and popular to date.</t>
        <t>There is no full specification yet as to how to express the data streams
of character based user input
and character based text responses in CoAP.
Necessary components,
as well as optional future extensions,
have been sketched for the RIOT operating system at <eref target="https://forum.riot-os.org/t/coap-remote-shell/3340/5">https://forum.riot-os.org/t/coap-remote-shell/3340/5</eref>.
Unlike SSH,
that sketch assumes the presence of a single virtual terminal
(as opposed to one created per connection).
On platforms with dynamic resources and per-process output capture,
an SSH-like muliplexing can be created based on the resource collection pattern described in <xref target="I-D.ietf-core-interfaces"/>.</t>
        <dl>
          <dt>Competing with</dt>
          <dd>
            <t>SSH</t>
          </dd>
          <dt>Strong points</dt>
          <dd>
            <t>The head-of-line blocking that occasionally plagues TCP based connections is eliminiated
in favor of on-demand recovery
(i.e., observing the last output will produce the latest chunk of output,
and the terminal may recover skipped data later if it is still in the device's back-scroll buffer).</t>
          </dd>
          <dt>Weak points</dt>
          <dd>
            <t>The default retransmission characteristics of CoAP make operations painfully slow when encountering packet loss.
Tuning of parameters or the implementation of advanced flow control as described in <xref target="I-D.ietf-core-fasor"/> are necessary for smooth operation.</t>
          </dd>
          <dt/>
          <dd>
            <t>On-demand recovery is incompatible with regular terminals,
and requires either fully managed terminals (where the full output is reprinted when lost fragments are recovered)
or accepting the loss of data where printed exceeding the network speed.
(Data is still lost gracefully, as the loss is detected and can be indicated visually).</t>
          </dd>
        </dl>
      </section>
      <section anchor="chat-services">
        <name>Chat services</name>
        <t>The CoMatrix project <eref target="https://comatrix.eu/">https://comatrix.eu/</eref> has demonstrated that the Matrix chat protocol
can be simplified to the point where it becomes usable transparently with constrained devices.</t>
      </section>
      <section anchor="e-mail">
        <name>E-Mail</name>
        <t>While E-Mail was part of the considerations that led to the definition of the Proxy-Uri option
(which would technically allow a cross-proxy to accept POST requests to, say, <tt>mailto:office@example.com?subject=Sensor%20failure</tt>),
no attempts are known to send or receive E-Mail over CoAP.</t>
      </section>
      <section anchor="video-streaming">
        <name>Video streaming</name>
        <t>The use of CoAP for real time video streaming and telemetry from Unmanned Aerial Vehicles (UAVs)
has been explored in <xref target="I-D.bhattacharyya-core-a-realist"/>.</t>
        <t>It is unclear whether CoAP could actually outperform unconstrained streaming protocols such as WebRTC,
or whether devices that produce and consume video benefit from the constraints of CoAP.</t>
      </section>
    </section>
  </middle>
  <back>
    <references>
      <name>References</name>
      <references>
        <name>Normative References</name>
        <reference anchor="RFC7252">
          <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>
      </references>
      <references>
        <name>Informative References</name>
        <reference anchor="I-D.ietf-core-coap-pubsub">
          <front>
            <title>Publish-Subscribe Broker for the Constrained Application Protocol (CoAP)</title>
            <author fullname="Michael Koster">
              <organization>SmartThings</organization>
            </author>
            <author fullname="Ari Keranen">
              <organization>Ericsson</organization>
            </author>
            <author fullname="Jaime Jimenez">
              <organization>Ericsson</organization>
            </author>
            <date day="4" month="May" year="2022"/>
            <abstract>
              <t>   The Constrained Application Protocol (CoAP), and related extensions
   are intended to support machine-to-machine communication in systems
   where one or more nodes are resource constrained, in particular for
   low power wireless sensor networks.  This document defines a publish-
   subscribe Broker for CoAP that extends the capabilities of CoAP for
   supporting nodes with long breaks in connectivity and/or up-time.

              </t>
            </abstract>
          </front>
          <seriesInfo name="Internet-Draft" value="draft-ietf-core-coap-pubsub-10"/>
        </reference>
        <reference anchor="I-D.ietf-core-comi">
          <front>
            <title>CoAP Management Interface (CORECONF)</title>
            <author fullname="Michel Veillette">
              <organization>Trilliant Networks Inc.</organization>
            </author>
            <author fullname="Peter van der Stok">
              <organization>consultant</organization>
            </author>
            <author fullname="Alexander Pelov">
              <organization>Acklio</organization>
            </author>
            <author fullname="Andy Bierman">
              <organization>YumaWorks</organization>
            </author>
            <author fullname="Ivaylo Petrov">
              <organization>Acklio</organization>
            </author>
            <date day="17" month="January" year="2021"/>
            <abstract>
              <t>   This document describes a network management interface for
   constrained devices and networks, called CoAP Management Interface
   (CORECONF).  The Constrained Application Protocol (CoAP) is used to
   access datastore and data node resources specified in YANG, or SMIv2
   converted to YANG.  CORECONF uses the YANG to CBOR mapping and
   converts YANG identifier strings to numeric identifiers for payload
   size reduction.  CORECONF extends the set of YANG based protocols,
   NETCONF and RESTCONF, with the capability to manage constrained
   devices and networks.

              </t>
            </abstract>
          </front>
          <seriesInfo name="Internet-Draft" value="draft-ietf-core-comi-11"/>
        </reference>
        <reference anchor="RFC132">
          <front>
            <title>Typographical Error in RFC 107</title>
            <author fullname="J.E. White" initials="J.E." surname="White">
              <organization/>
            </author>
            <date month="April" year="1971"/>
          </front>
          <seriesInfo name="RFC" value="132"/>
          <seriesInfo name="DOI" value="10.17487/RFC0132"/>
        </reference>
        <reference anchor="I-D.ietf-suit-manifest">
          <front>
            <title>A Concise Binary Object Representation (CBOR)-based Serialization Format for the Software Updates for Internet of Things (SUIT) Manifest</title>
            <author fullname="Brendan Moran">
              <organization>Arm Limited</organization>
            </author>
            <author fullname="Hannes Tschofenig">
              <organization>Arm Limited</organization>
            </author>
            <author fullname="Henk Birkholz">
              <organization>Fraunhofer SIT</organization>
            </author>
            <author fullname="Koen Zandberg">
              <organization>Inria</organization>
            </author>
            <date day="28" month="April" year="2022"/>
            <abstract>
              <t>   This specification describes the format of a manifest.  A manifest is
   a bundle of metadata about code/data obtained by a recipient (chiefly
   the firmware for an IoT device), where to find the that code/data,
   the devices to which it applies, and cryptographic information
   protecting the manifest.  Software updates and Trusted Invocation
   both tend to use sequences of common operations, so the manifest
   encodes those sequences of operations, rather than declaring the
   metadata.

              </t>
            </abstract>
          </front>
          <seriesInfo name="Internet-Draft" value="draft-ietf-suit-manifest-17"/>
        </reference>
        <reference anchor="I-D.draft-lenders-dns-over-coap">
          <front>
            <title>DNS Queries over CoAP (DoC)</title>
            <author fullname="Martine Sophie Lenders">
              <organization>Freie Universität Berlin</organization>
            </author>
            <author fullname="Christian Amsüss">
	 </author>
            <author fullname="Cenk Gündoğan">
              <organization>HAW Hamburg</organization>
            </author>
            <author fullname="Thomas C. Schmidt">
              <organization>HAW Hamburg</organization>
            </author>
            <author fullname="Matthias Wählisch">
              <organization>Freie Universität Berlin</organization>
            </author>
            <date day="7" month="March" year="2022"/>
            <abstract>
              <t>   This document defines a protocol for sending DNS messages over the
   Constrained Application Protocol (CoAP).  These CoAP messages are
   protected by DTLS-Secured CoAP (CoAPS) or Object Security for
   Constrained RESTful Environments (OSCORE) to provide encrypted DNS
   message exchange for constrained devices in the Internet of Things
   (IoT).

              </t>
            </abstract>
          </front>
          <seriesInfo name="Internet-Draft" value="draft-lenders-dns-over-coap-03"/>
        </reference>
        <reference anchor="RFC15">
          <front>
            <title>Network subsystem for time sharing hosts</title>
            <author fullname="C.S. Carr" initials="C.S." surname="Carr">
              <organization/>
            </author>
            <date month="September" year="1969"/>
          </front>
          <seriesInfo name="RFC" value="15"/>
          <seriesInfo name="DOI" value="10.17487/RFC0015"/>
        </reference>
        <reference anchor="I-D.ietf-core-interfaces">
          <front>
            <title>Reusable Interface Definitions for Constrained RESTful Environments</title>
            <author fullname="Zach Shelby">
              <organization>ARM</organization>
            </author>
            <author fullname="Michael Koster">
              <organization>SmartThings</organization>
            </author>
            <author fullname="Christian Groves">
	 </author>
            <author fullname="Jintao Zhu">
              <organization>Huawei</organization>
            </author>
            <author fullname="Bilhanan Silverajan">
              <organization>Tampere University</organization>
            </author>
            <date day="11" month="March" year="2019"/>
            <abstract>
              <t>   This document defines a set of Constrained RESTful Environments
   (CoRE) Link Format Interface Descriptions [RFC6690] applicable for
   use in constrained environments.  These include the: Actuator,
   Parameter, Read-only parameter, Sensor, Batch, Linked Batch and Link
   List interfaces.

   The Batch, Linked Batch and Link List interfaces make use of resource
   collections.  This document further describes how collections relate
   to interfaces.

   Many applications require a set of interface descriptions in order
   provide the required functionality.  This document defines an
   Interface Description attribute value to describe resources
   conforming to a particular interface.

   Editor's notes:

   o  The git repository for the draft is found at https://github.com/
              </t>
            </abstract>
          </front>
          <seriesInfo name="Internet-Draft" value="draft-ietf-core-interfaces-14"/>
        </reference>
        <reference anchor="I-D.ietf-core-fasor">
          <front>
            <title>Fast-Slow Retransmission Timeout and Congestion Control Algorithm for CoAP</title>
            <author fullname="Ilpo Jarvinen">
              <organization>University of Helsinki</organization>
            </author>
            <author fullname="Markku Kojo">
              <organization>University of Helsinki</organization>
            </author>
            <author fullname="Iivo Raitahila">
              <organization>University of Helsinki</organization>
            </author>
            <author fullname="Zhen Cao">
              <organization>Huawei</organization>
            </author>
            <date day="19" month="October" year="2020"/>
            <abstract>
              <t>   This document specifies an alternative retransmission timeout and
   congestion control back off algorithm for the CoAP protocol, called
   Fast-Slow RTO (FASOR).

   The algorithm specified in this document employs an appropriate and
   large enough back off of Retransmission Timeout (RTO) as the major
   congestion control mechanism to allow acquiring unambiguous RTT
   samples with high probability and to prevent building a persistent
   queue when retransmitting.  The algorithm also aims to retransmit
   quickly using an accurately managed retransmission timeout when link-
   errors are occuring, basing RTO calculation on unambiguous round-trip
   time (RTT) samples.

              </t>
            </abstract>
          </front>
          <seriesInfo name="Internet-Draft" value="draft-ietf-core-fasor-01"/>
        </reference>
        <reference anchor="I-D.bhattacharyya-core-a-realist">
          <front>
            <title>Adaptive RESTful Real-time Live Streaming for Things (A-REaLiST)</title>
            <author fullname="Abhijan Bhattacharyya">
              <organization>TATA CONSULTANCY SERVICES LTD.</organization>
            </author>
            <author fullname="Suvrat Agrawal">
              <organization>TATA CONSULTANCY SERVICES LTD.</organization>
            </author>
            <author fullname="Hemant Rath">
              <organization>TATA CONSULTANCY SERVICES LTD.</organization>
            </author>
            <author fullname="Arpan Pal">
              <organization>TATA CONSULTANCY SERVICES LTD.</organization>
            </author>
            <author fullname="Balamurali Purushothaman">
              <organization>TATA CONSULTANCY SERVICES LTD.</organization>
            </author>
            <date day="5" month="February" year="2019"/>
            <abstract>
              <t>   This draft presents extensions to Constrained Application Protocol
   (CoAP) to enable RESTful Real-time Live Streaming for improving the
   Quality of Experience (QoE) for delay-sensitive Internet of Things
   (IoT) applications. The overall architecture is termed "Adaptive
   RESTful Real-time Live Streaming for Things (A-REaLiST)". It is
   particularly designed for applications which rely on real-time
   augmented vision through live First Person View (FPV) feed from
   constrained remote agents like Unmanned Aerial Vehicle (UAV), etc.
   These extensions provide the necessary hooks to help solution
   designers ensure low-latency transfer of streams and, for contents
   like video, a quick recovery from freeze and corruption without
   incurring undue lag. A-REaLiST is an attempt to provide an
   integrated approach to maintain the balance amongst QoE, resource-
   efficiency and loss resilience. It provides the necessary hooks to
   optimize system performance by leveraging contextual intelligence
   inferred from instantaneous information segments in flight. These
   extensions equip CoAP with a standard for efficient RESTful
   streaming for Internet of Things (IoT) contrary to HTTP-streaming in
   conventional Internet.

              </t>
            </abstract>
          </front>
          <seriesInfo name="Internet-Draft" value="draft-bhattacharyya-core-a-realist-02"/>
        </reference>
      </references>
    </references>
    <section anchor="coap-filesystem">
      <name>CoAP File Service</name>
      <t>This sketches [ TBD: describes ] a file transfer protocol / remote file system built on top of CoAP.</t>
      <t>A file server works similar to a WebDAV server, and follows these rules
(which are sometimes expressed from the point of view of the server,
but apply when a client maps them back into a file system in such a way that operations can round-trip):</t>
      <ul spacing="normal">
        <li>
          <t>Directories are unconditionally represented by URIs with a trailing slash; files by those without one.  </t>
          <t>
The GET operation is used to list them (for there is no PROPFIND operation in CoAP).
Different media types migth be used depending on the capabilities of the parties,
with application/link-format as a base line.  </t>
          <t>
(Note that application/link-format is not particularly efficient for this purpose,
as the directory listing needs to repeat the requested resource's full path for each entry).  </t>
          <t>
Clients need to be prepared for links that do not follow the regular pattern of a directory advertising its children,
but (as with all unknown links) may ignore them.</t>
        </li>
        <li>Paths are constructed by placing directory names and either an empty string (for the trailing slash) or the unescaped file name in Uri-Path options.</li>
        <li>Clients may attempt to treat any URI composed of the file server entry URI and additional path segments as files on the file server.
Consequently, any additional services the file server may provide
(e.g., as resources specified in extensions)
are necessarily assigned URIs with a query,
for these can not be inadvertedly constructed in an attempt to access a file.</li>
        <li>
          <t>For lack of a HEAD option,
file metadata can only be obtained by performing a GET on the directory containing the file,
or a FETCH for efficiency if suitable media types are defined.  </t>
          <t>
All metadata is provided on a best-effort basis,
and the supported directory formats limit what can be expressed.
Typical supported metadata are the media type (expressed as <tt>ct</tt> in link format)
and the size (<tt>sz</tt>).</t>
        </li>
        <li>
          <t>If write support is available and permissions allow,
a client can create files by performing a PUT operation on a previously nonexistent resource.  </t>
          <t>
Files can be overwritten by PUTting a new representation.
Files sent with block-wise transfer should be processed atomically by the server
unless explicitly negotiated otherwise.
(On POSIX file systems,
this can be implemented without additional state by storing the blocks in a temporary file
whose name contains the original file name and the block key of the request,
and renaming it to the target name when receiving the last block).  </t>
          <t>
Directories can be created with PUT as well
(it is clear from their path that they are directories);
these would typically be empty and not have a content format,
but may use a content format that already describes directory metadata.
(It is up to the client to fall back to plain directory creation,
if that is a viable option for it -- it would be if it's just about unimportant metadata, but might not if the initial metadata indicates an ACL).</t>
        </li>
        <li>
          <t>Files and directories can be removed using the DELETE operation,
subject ot the same conditions as writing to resources.  </t>
          <t>
Deleting directories is recursive;
client that desire POSIX semantics need to check whether the directory is empty
and use the If-Match option with the empty directory's ETag to avoid race conditions.</t>
        </li>
        <li>
          <t>Regular CoAP extensions apply if the parties support them, for example:  </t>
          <ul spacing="normal">
            <li>Observation can be used to watch files or directories for changes.</li>
            <li>ETags (e.g. derived from the file's stats) can be used to ensure that large files are assembled correctly by the client,
and to perform file updates with optimistic locking by using the If-Match option.</li>
          </ul>
        </li>
        <li>
          <t>Additional features can be specified and advertised separately,
either per resoource or by a named specification that provides templates for further operations.  </t>
          <t>
For example,
a specification might say that when a file system is advertised with a given interface (<tt>if</tt> parameter of link format),
for each file and directory there is an associated resource at <tt>?acl</tt> that describes access control applicable to that file,
and can be used with GET and PUT as per the ACL's policies.  </t>
          <t>
Additional operations can use their custom media types and methods,
and possibly create more resources.
For example,
a server-to-server copy (again, advertised by a suitable interface parameter)
could provide a <tt>?copy</tt> resource under any directory,
to which a CBOR list containing two CRIs (source and destination) would be posted.
That specification might describe that if copies are not completed instantly,
the response might indicate a new location using Uri-Path and Uri-Query options
(the latter might be necessary to not conflict with existing files)
which tracks the status of the operation.</t>
        </li>
        <li>
          <t>File service is compatible with "index.html" style directory indices provided statically in the file system.
It is recommended to not serve index files of typical directory listing formats (such as application/link-format)
as these might mislead the client about the file system's content,
and prevent clients that access the server as a file server from even seeing the providing file's name.  </t>
          <t>
These files still need to be written to or deleted in their file version (e.g. as "index.html");
the file server may use yet to be specified link relations to point out which files are being served as the index files.</t>
        </li>
      </ul>
      <t>Some implementation guidance should be provided around the interaction between idempotent requests that have no actual effect and preconditions:
If a DELETE with If-Match is transmitted again on a new token (by a proxy relying on its idempotence),
should the server respond Deleted rather than Not Found?
(In this case, the client could at least know what to do with it, but)
If a PUT with If-Match is transmitted again after it has been acted on,
should the server respond Changed rather than Precondition Failed?
(Probably "No" to both, as the former is easily recognizable by the client,
and the latter would delay faulting by long,
but still needs further thought.)</t>
    </section>
    <section anchor="change-log">
      <name>Change log</name>
      <t>From -00 to -01:</t>
      <ul spacing="normal">
        <li>Added details to file service</li>
      </ul>
    </section>
  </back>
  <!-- ##markdown-source:
H4sIAAAAAAAAA71bXXPjRnZ9x69AjSu1oovUaMZxpaJN1itLGltVtqSVOPam
sls7TaBJ9gpEc9GANPTU/LO85Y/lnHu7AZDSpPKUF1skge7b9+Pcc+/tmc1m
Wevayp7mry4fbbNr165e5R5/5uf+7PZVVvqiNhv8XjZm2c7MJnQ2hFnhG4v/
mO3swbXF2tbB1Q+zkzeZ2zanedt0oX17cvKvJ2+z0Jq6/JupfG3lB5sVpj3N
Xb302dPqFNvcXWYPT6ey3zS/nt9mpmvXvjnNZngq4Ifj/GwT/vu/QsjyXIU5
XzcutM7Uo18K39VtszvNz7B54wy+shvjqtO8SE//MYp/XPhNVvtmY1r3aE/x
5N278395++3b04xy9d9n2Ww2y80C65mizbL52kLMmh9dbcv8bLutHI7jfJ3f
Nr71ha/yIx5kkq9NyBcWG9m8xWsLE2zul7kZXgnZwrdrntGV8hufK0bLl/bR
FTbkYWsKm7s2941budpU1S43boMnIGsG9ea+a7nIMSR0IYfNuo2t23yFU4Qc
WqJBH519OpQAW5o2M42d5oWpp/nG7Kay4JPvqhLyty08ofYt/szdZltZrouN
ceDWb7kcT3usitq4sqxsln2VX8ESvuwK0cynr9zo4+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