<?xml version="1.0" encoding="US-ASCII"?>
<!-- This template is for creating an Internet Draft using xml2rfc,
     which is available here: http://xml.resource.org. -->
<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
<!-- One method to get references from the online citation libraries.
     There has to be one entity for each item to be referenced. 
     An alternate method (rfc include) is described in the references. -->
<!ENTITY RFC2119 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml">
<!ENTITY RFC2629 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2629.xml">
<!ENTITY RFC3552 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.3552.xml">
<!ENTITY I-D.narten-iana-considerations-rfc2434bis SYSTEM "http://xml.resource.org/public/rfc/bibxml3/reference.I-D.narten-iana-considerations-rfc2434bis.xml">
]>
<?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>
<!-- used by XSLT processors -->
<!-- For a complete list and description of processing instructions (PIs), 
     please see http://xml.resource.org/authoring/README.html. -->
<!-- Below are generally applicable Processing Instructions (PIs) that most I-Ds might want to use.
     (Here they are set differently than their defaults in xml2rfc v1.32) -->
<?rfc strict="yes" ?>
<!-- give errors regarding ID-nits and DTD validation -->
<!-- control the table of contents (ToC) -->
<?rfc toc="yes"?>
<!-- generate a ToC -->
<?rfc tocdepth="4"?>
<!-- the number of levels of subsections in ToC. default: 3 -->
<!-- control references -->
<?rfc symrefs="yes"?>
<!-- use symbolic references tags, i.e, [RFC2119] instead of [1] -->
<?rfc sortrefs="yes" ?>
<!-- sort the reference entries alphabetically -->
<!-- control vertical white space 
     (using these PIs as follows is recommended by the RFC Editor) -->
<?rfc compact="no"?>
<!-- do not start each main section on a new page -->
<?rfc subcompact="no" ?>
<!-- keep one blank line between list items -->
<!-- end of list of popular I-D processing instructions -->
<rfc category="std" docName="draft-ietf-core-coap-bp-02"
     ipr="trust200902">
  <!-- category values: std, bcp, info, exp, and historic
     ipr values: full3667, noModification3667, noDerivatives3667
     you can add the attributes updates="NNNN" and obsoletes="NNNN" 
     they will automatically be output with "(if approved)" -->

  <!-- ***** FRONT MATTER ***** -->

  <front>
    <!-- The abbreviated title is used in the page header - it is only necessary if the 
         full title is longer than 39 characters -->

    <title abbrev="CoAP over BP">
     Constrained Application Protocol (CoAP) over Bundle Protocol (BP)
    </title>

 
    <!-- add 'role="editor"' below for the editors if appropriate -->

    <!-- Another author who claims to be an editor -->
 
    <author fullname="Carles Gomez" initials="C." surname="Gomez">
      <organization>UPC</organization>

      <address>
        <postal>
          <street>C/Esteve Terradas, 7</street>

          <city>Castelldefels</city>

          <region/>

          <code>08860</code>

          <country>Spain</country>
        </postal>

        <phone/>

        <facsimile/>

        <email>carles.gomez@upc.edu</email>

        <uri/>
      </address>
    </author>

    <author fullname="Anna Calveras" initials="A." surname="Calveras">
      <organization>UPC</organization>

      <address>
        <postal>
          <street>C/Jordi Girona, 1-3</street>

          <city>Barcelona</city>

          <region/>

          <code>08034</code>

          <country>Spain</country>
        </postal>

        <phone/>

        <facsimile/>

        <email>anna.calveras@upc.edu</email>

        <uri/>
      </address>
    </author>


    <!-- uri and facsimile elements may also be added -->

    <date month="February" year="2026"/>

    <!-- If the month and year are both specified and are the current ones, xml2rfc will fill 
         in the current day for you. If only the current year is specified, xml2rfc will fill 
	 in the current day and month for you. If the year is not the current one, it is 
	 necessary to specify at least a month (xml2rfc assumes day="1" if not specified for the 
	 purpose of calculating the expiry date).  With drafts it is normally sufficient to 
	 specify just the year. -->

    <!-- Meta-data Declarations -->

    <area>INT</area>

    <workgroup>CoRE Working Group</workgroup>

    <!-- WG name at the upperleft corner of the doc,
         IETF is fine for individual submissions.  
	 If this element is not present, the default is "Network Working Group",
         which is used by the RFC Editor as a nod to the history of the IETF. -->

    <!---->

    <abstract>
      <t> The Bundle Protocol (BP) was designed to enable end-to-end communication in challenged networks.  The Constrained Application Protocol (CoAP), which was designed for constrained-node networks, may be a suitable application-layer protocol for the scenarios where BP is used.  This document specifies how CoAP is carried over BP.
      </t>
    </abstract>
  </front>

  <middle>
    <section title="Introduction ">

      <t>The Delay-Tolerant Networking (DTN) architecture has been designed to enable communication in challenged networks, which are characterized by long delays, intermittent connectivity, and high error rates, among other constraints <xref target="RFC4838"/><xref target="RFC7228"/>. DTN was mainly intended for deep space communication (e.g., to enable an Interplanetary Internet). However, it is also applicable to enable communication on Earth in environments exhibiting relatively similar features, such as sensor networks or temporarily disconnected areas.
      </t>

      <t>The Bundle Protocol (BP) is the fundamental component of DTN. BP is a message-oriented protocol that operates as a store-carry-forward overlay atop the transport-layer protocols of a number of constituent networks <xref target="RFC9171"/>. The protocol data unit of BP is called a bundle. Application-layer functionality runs atop BP.  
      </t>

      <t>The Constrained Application Protocol (CoAP) is an application-layer protocol that was specifically designed for constrained-node networks <xref target="RFC7252"/><xref target="RFC7228"/>, which are typical in Internet of Things (IoT) scenarios. Such environments are often characterized by significantly constrained node and network features, including low computational capacity, limited energy availability (which often leads to the use of duty-cycled links), low bandwidth, high latency, and high loss rates. Accordingly, CoAP offers several features, which are also suitable for DTN, including lightweight operation, asynchronous message exchanges, and a significant degree of flexibility, based on RESTful principles.
      </t>

      <t>The present document specifies how CoAP is carried over BP. 
      </t>
 

    </section>
 
      <section title="Terminology">
   
       <section title="Requirements language">
    
        <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
          BCP14 <xref target="RFC2119"/>, <xref target="RFC8174"/>, when, and only when,
          they appear in all capitals, as shown here.      
        </t>
       </section>

       <section title="Background on previous specifications"> 
       <t>The reader is expected to be familiar with the terms and concepts
          defined by the DTN main specifications (e.g., <xref target="RFC4838"/>, <xref target="RFC9171"/>, and <xref target="RFC9172"/>), 
          and the CoAP main specifications (e.g., <xref target="RFC7252"/>, <xref target="RFC7641"/>, <xref target="RFC7959"/>, <xref target="RFC8323"/>, 
          and <xref target="RFC9177"/>).
       </t>
       </section>

       <section title="New terms"> 
       <t> Single message: a CoAP message, as defined in RFC 7252. In CoAP over BP, a Single message is carried as the block-type-specific data field of the Bundle Payload Block of the encapsulating bundle.
       </t>

       <t> Aggregate message: a concatenation of Single messages that carry the Payload-length option (see Section 4.3). In CoAP over BP, an Aggregate message is carried as the block-type-specific data field of the Bundle Payload Block of the encapsulating bundle.
       </t>
       
       </section>
      </section>

  <section title="Architecture">
    
       <t>Figure 1 illustrates the protocol stack model for CoAP over BP. (Note: this figure is the same as Figure 1 of RFC 9171, except for the indication of CoAP's location in the protocol stack model.) In this model, CoAP entities exchange application-layer messages carried by BP over an end-to-end path composed of a number of constituent networks.
       </t>

        <t>
        <figure title="BP and CoAP in the protocol stack model"
                anchor="fig_BP_CoAP_stack">
        <artwork><![CDATA[    

   +-----------+                                         +-----------+
   |   CoAP    |                                         |    CoAP   |
   +---------v-|   +->>>>>>>>>>v-+     +->>>>>>>>>>v-+   +-^---------+
   |    BP   v |   | ^    BP   v |     | ^   BP    v |   | ^   BP    |
   +---------v-+   +-^---------v-+     +-^---------v-+   +-^---------+
   |    T1   v |   + ^  T1/T2  v |     + ^  T2/T3  v |   | ^   T3    |
   +---------v-+   +-^---------v-+     +-^---------v +   +-^---------+
   |    N1   v |   | ^  N1/N2  v |     | ^  N2/N3  v |   | ^   N3    |
   +---------v-+   +-^---------v +     +-^---------v-+   +-^---------+
   |         >>>>>>>>^         >>>>>>>>>>^         >>>>>>>>^         |
   +-----------+   +-------------+     +-------------+   +-----------+
   |                     |                     |                     |
   |<---- A network ---->|                     |<---- A network ---->|
   |                     |                     |                     |
 

        ]]></artwork></figure>

        </t>


  </section>

  <section title="Messages">

    <section title="Messaging model">

       <t>
          The CoAP base specification was produced assuming UDP as the underlying transport-layer protocol [RFC 7252]. Like UDP, BP
          is a message-oriented protocol. Furthermore, BP does not provide bundle retransmission. Therefore, when CoAP is used over BP, the same messaging 
          model defined for CoAP in RFC 7252 is used, and the CoAP signaling messages defined in RFC 8323 (which are intended for use over reliable 
          transports) MUST NOT be used.
       </t>

       <t>Figure 2 shows the two-sublayer structure of CoAP, when used over BP.
       </t>

        <t>
        <figure title="Abstract Layering of CoAP over BP"
                anchor="CoAP_over_BP_messaging">
        <artwork><![CDATA[   
                   +----------------------+
                   |      Application     |
                   +----------------------+
                   +----------------------+  \
                   |  Requests/Responses  |  |
                   |----------------------|  | CoAP
                   |       Messages       |  |
                   +----------------------+  /
                   +----------------------+
                   |          BP          |
                   +----------------------+
        ]]></artwork></figure>

        </t>

    <t>
    CoAP follows a client/server model, whereby a client may request an action on a resource on a server.  Upon receipt of a request, the server sends a response, including a response code, which may also include a resource representation. (Note that, if a request includes the "No-Response" option <xref target="RFC7967"/>, the server may suppress the response.) Requests and responses are encapsulated in messages. 
    </t>

    <t>CoAP defines four message types: Confirmable (CON), Non-confirmable (NON), Acknowledgment (ACK), and Reset (RST). CON messages elicit ACKs, whereas NON messages do not. For CON messages, CoAP uses stop-and-wait retransmission with exponential back-off. A RST message is sent by a CoAP endpoint that has received a message but is unable to process it.
    </t>

    <t>When CoAP is used over BP, a source bundle node MAY set the "request reporting of bundle delivery" flag in the bundle's status report request field  of a bundle that encapsulates a CoAP CON message. Upon receipt of a bundle that carries a CoAP CON message with the "request reporting of bundle delivery" flag set, the receiver MAY opt to only send the corresponding bundle delivery status report and omit sending a bundle encapsulating a CoAP ACK message, if and only if the CoAP ACK message does not carry a payload. In that case, if the CoAP CON message sender receives the status report sent in response to its bundle-encapsulated CON message, it MUST assume that the status report serves as CoAP ACK for the CON message.
    </t>

    <t>(Note: the assumption is that the status report size is shorter than the size of a bundle encapsulating a CoAP ACK message that does not carry a payload. To be further confirmed.)
    </t>


    </section>


    <section title="Single message format">
 
    
    <t>In CoAP over BP, the format of a Single message (Figure 4) is the same as the CoAP message format defined in RFC 7252 (Figure 3), except for the Message ID size, which is increased to 24 bits for CoAP over BP. The reason for this change is avoiding a severe limitation on the number of messages a sender can send per time unit, considering the latency values in the environments where CoAP over BP may be used, and that, as stated in RFC 7252, "the same Message ID MUST NOT be reused (in communicating with the same endpoint) within the EXCHANGE_LIFETIME". See Appendix B for further details.
    </t>

     <t>
        <figure title="CoAP Message Format as defined in RFC 7252"
                anchor="CoAP_message_7252">
        <artwork><![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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|Ver| T |  TKL  |      Code     |           Message ID          |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Token (if any, TKL bytes) ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Options (if any) ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|1 1 1 1 1 1 1 1|      Payload (if any) ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
        ]]></artwork></figure>

     </t>

     <t>
        <figure title="Single Message Format over BP"
                anchor="CoAP_message_BP">
        <artwork><![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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|Ver| T |  TKL  |      Code     |           Message ID   . . .  
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 ...Message ID  |      Token (if any, TKL bytes) ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Options (if any) ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|1 1 1 1 1 1 1 1|      Payload (if any) ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

        ]]></artwork></figure>

     </t>

    </section>


    <section title="Payload-length option">

     <t>CoAP messages destined to the same endpoint MAY be aggregated and
   carried as the payload of the underlying protocol data unit.
     </t>

     <t>
        An Aggregate message is a concatenation of Single messages that carry the Payload-length option. The Payload-length option defined in this subsection (see Figure 5, which extends "Table 4: Options" of [RFC7252]) indicates the size of the payload of a CoAP message.  The option value is an integer number of bytes. The Payload-length option is critical, Unsafe-to-forward, and not repeatable.
     </t>

     <t>
        <figure title="The Payload-length option"
                anchor="Payload-length_opt_def">
        <artwork><![CDATA[   
   +------+---+---+---+---+----------------+--------+---------+---------+
   | No.  | C | U | N | R | Name           | Format | Length  | Default |
   +------+---+---+---+---+----------------+--------+---------+---------+
   | TBD1 | x | x | - |   | Payload-length |  uint  |0 or more|  (none) |
   +------+---+---+---+---+----------------+--------+---------+---------+

       C = Critical,   U = Unsafe,   N = NoCacheKey,   R = Repeatable
       (*) See below.

        ]]></artwork></figure>
     </t>

     <t>When encapsulated in a bundle, a CoAP message is represented as a definite-length CBOR byte string (see Section 5 of this document and Section 4.3.2 of RFC 9171). Thus, the length of the CoAP message is unambiguously represented. For this reason, the Payload-length option MUST NOT be included in a Single message.
     </t>

    <section title="Payload-length option and OSCORE">
    
     <t>The Payload-length option is a "Class U" (i.e., "unprotected") option for Object Security for Constrained RESTful Environments (OSCORE) [RFC 8613]. 
     </t>

     <t>If a CoAP message is intended to carry the Payload-length option, while benefitting from OSCORE protection, first an OSCORE message is built using the CoAP message (without the Payload-length option) as an input, as described in RFC 8613. After that, the Payload-length option is inserted in the OSCORE message, where the payload size indicated by the Payload-length option corresponds to the OSCORE message payload size.
     </t>

     <t>Note that, in some cases, the Payload-length option that indicates the OSCORE message payload size may need to be subsequently updated. An example is when the EDHOC + OSCORE request is used, where the original OSCORE message payload is replaced by the concatenation of the EDHOC message_3 and the original OSCORE ciphertext in the CoAP payload (see Section 3.2.1 of RFC 9668).
     </t>

     <t>OSCORE messages carrying the Payload-length option and being destined to the same endpoint MAY be aggregated and carried as the payload of the underlying protocol data unit.
     </t>
     
    </section> 

    </section>

  </section>
  
  <section title="Encapsulating bundle">

    <t>
    In order to transmit a CoAP message (either a Single message or an Aggregate message) over BP, the CoAP message MUST be carried as the block-type-specific data field of the Bundle Payload Block (block type 1) of an encapsulating bundle.
    </t> 

    <t>
       The lifetime field of the bundle encapsulating a CON Single message MUST be set to EXCHANGE_LIFETIME (see Section 6). The lifetime field of the bundle    
       encapsulating a NON Single message MUST be set to NON_LIFETIME (see Section 6). 
    </t>

    <t>
       For Aggregate messages: 
    </t>
    <t>
- If an Aggregate message only comprises CON messages, the lifetime field of the encapsulating bundle is set to EXCHANGE_LIFETIME + MAX_AGGR_DELAY. (Note: MAX_AGGR_DELAY indicates the maximum time since the first Single message belonging to an Aggregate message is generated until the Aggregate message is passed to the BP layer.)  
    </t>
    <t>
- If an Aggregate message comprises only NON messages, the lifetime field of the encapsulating bundle is set to NON_LIFETIME + MAX_AGGR_DELAY. 
    </t>
    <t> 
- If an Aggregate message comprises at 
   least one CON message and one NON message, the lifetime field of the
   encapsulating bundle is set to the max(imum of EXCHANGE_LIFETIME, and
   NON_LIFETIME)+ MAX_AGGR_DELAY.
    </t>

    <t>
    In some cases, upon receipt of a CoAP message, the receiving endpoint needs to transmit a CoAP message in response to the sender. The Destination EID 
    and Source Node ID fields of the primary bundle block of the bundle encapsulating such a CoAP message sent as a response SHALL be set as follows:
    </t>

    <t>
    Destination EID: The Destination EID SHALL be identical to the Source
   Node ID of the bundle encapsulating the received CoAP message that
   produces the response.
    </t>

    <t>
Source Node ID: The Source Node ID SHOULD be the EID of the endpoint that produces the bundle encapsulating the CoAP message sent in response.
Note that, as described in RFC 9171, the Source Node ID MAY be the null endpoint ID in the event that the bundle's source chooses to remain anonymous.
    </t>   

  </section>


  
  <section title="CoAP parameter settings and related times">

      <t>
   This section discusses the main CoAP parameters and times that are
   relevant in the environments where BP may be used.  (Note that the complete set of parameters, assumptions, default values, and related times in CoAP can   
   be found in Section 4.8 of RFC 7252.)
      </t>

      <t>Most of these CoAP parameters and times are relevant for CON messages. 
   Note that, in some scenarios, the protocols operating below BP may support reliability and congestion control. In that case, using NON messages might suffice to achieve a reasonable degree of reliability. The congestion control considerations for NON message transmission would still apply, though
(see Sections 4.7 and 4.8 of RFC 7252).
      </t>

      <t>
   As a congestion control measure, the maximum number of outstanding
   interactions between a client and a given server is limited to
   NSTART, which is set to a default value of 1.  A greater value for
   NSTART can be used only when mechanisms that ensure congestion
   control safety are used [RFC 7252].
      </t>

      <t>
   The main parameters related with CON messages are indicated next.
      </t>

      <t>
   ACK_TIMEOUT and ACK_RANDOM_FACTOR.  These two parameters determine
   the duration of the initial retransmission timeout, which is set to a
   randomly chosen value between ACK_TIMEOUT and ACK_TIMEOUT *
   ACK_RANDOM_FACTOR.  The default values for ACK_TIMEOUT and
   ACK_RANDOM_FACTOR are 2 s and 1.5, respectively.  Therefore, the
   default initial retransmission timeout in CoAP is between 2 and 3 s.
      </t>

      <t>
   For CoAP over BP, ACK_TIMEOUT should be set to a value of at
   least the expected RTT, which may be of an order of
   magnitude several times greater than the default one (see Appendix A).
      </t>

      <t>
   ACK_RANDOM_FACTOR needs to be at least equal to or greater than 1.0.
   The default value of 1.5 is intended to avoid synchronization effects
   among different senders when RTTs are in the order of seconds.
   However, the greater latency in delay-tolerant environments may reduce the risk of 
   synchronization effects therein.  In such case, a lower
   ACK_RANDOM_FACTOR may help reduce total message delivery latency when
   retries are performed.
      </t>

      <t>
   MAX_RETRANSMIT.  This parameter defines the maximum number of retries
   for a given CON message.  The default value for this parameter is 4.
   Since there is an exponential back-off between retransmissions, and
   considering the delay values in environments where BP is used, it may be suitable to set
   this parameter to a value lower than the default one (see Appendix A).
      </t>

      <t>
   The following assumptions on the characteristics of the network and
   the nodes need to be considered:
      </t> 

      <t>
      MAX_LATENCY is the maximum time a datagram is expected to take from
   the start of its transmission to the completion of its reception.  In
   RFC 7252, this value is arbitrarily set to 100 s, which is close to
   the historic Maximum Segment Lifetime (MSL) of 120 s defined in the
   TCP specification [RFC9293].  However, such value assumes
   communication in non-challenged environments.  Therefore, in environments where BP is used,
   MAX_LATENCY may need to be increased by at least 2-3 orders of magnitude.
      </t>

      <t>
   PROCESSING_DELAY is the time since a node receives a CON message
   until it transmits an ACK in response.  In RFC 7252, this value is
   assumed to be of at most the default ACK_TIMEOUT value of 2 s.  For
   the sake of limiting latency, it is assumed that the same value can
   be used also in environments where BP is used.
      </t>

      <t>
   A relevant CON message derived time is EXCHANGE_LIFETIME.  This time
   indicates the maximum possible time since a CON message is sent for
   the first time, until ACK reception (which may potentially occur
   after several retries).  EXCHANGE_LIFETIME includes the following
   components: the total time since the first transmission attempt of a
   CON message until the last one (called MAX_TRANSMIT_SPAN in RFC
   7252), a MAX_LATENCY for the CON, PROCESSING_DELAY, and a MAX_LATENCY
   for the ACK.  The default value for EXCHANGE_LIFETIME is 247 s.
   However, in challenged environments (e.g., deep space), and considering the increased values for
   protocol parameters and network characteristics described above,
   EXCHANGE_LIFETIME will be at least 2 (and perhaps a greater number
   of) orders of magnitude greater than the default one (see Appendix A).
      </t>

      <t>
   The main time related with NON messages is NON_LIFETIME.  This is the
   time since a NON message is transmitted until its Message ID can be
   safely reused.  This time is actually equal to MAX_LATENCY, therefore
   its default value is 100 s.  However, as described earlier, in challenged environments (e.g, deep space) it may need to be increased by 2-3 orders of
   magnitude.
      </t>

      <t>In CoAP group communication, a client sends multicast CoAP request messages to a destination group. Each server in the target destination group sends a unicast response message back to the client, although a server can suppress its response for several reasons (see Section 3.1.2 of <xref target="I-D.ietf-core-groupcomm-bis"/>).
        </t>

        <t><xref target="I-D.ietf-core-groupcomm-bis"/> defines the minimum time between reuse of Token values for different group requests, MIN_TOKEN_REUSE_TIME, to be greater than:
        </t>

        <t>MIN_TOKEN_REUSE_TIME = (NON_LIFETIME + MAX_LATENCY + MAX_SERVER_RESPONSE_DELAY)
        </t>
     
        <t>where MAX_SERVER_RESPONSE_DELAY is the expected maximum response delay
   over all servers that the client can send a CoAP group request to.
  <xref target="I-D.ietf-core-groupcomm-bis"/> states that, "using the default CoAP parameters,
   the Token reuse time MUST be greater than 250 seconds plus MAX_SERVER_RESPONSE_DELAY".
        </t>

        <t> <xref target="I-D.ietf-core-groupcomm-bis"/> also adds that, while a possible approach is to generate a new unique Token for every new group request, if a client has to reuse Token values for some reason, MAX_SERVER_RESPONSE_DELAY = 250 seconds is a suitable value, therefore leading to a time between Token reuses greater than MIN_TOKEN_REUSE_TIME = 500 seconds (see Appendix A).
        </t>

      <t>
   Note that CoAP implementations may also need to be adapted if they have
   been designed to use 8-bit timers to handle CON or NON message
   lifetimes (e.g., to retire Message IDs) in seconds.
      </t>


  </section>


<section title="Observe">

    <t>
The CoAP Observe Option allows a server to send notifications carrying a representation of the current state of a resource to interested clients called observers [RFC7641].  The latter need to initially register at a specific server that they are interested in being notified whenever the resource state changes. There is also work in progress intended to allow a CoAP client to limit notifications to those where the state representation of a resource fulfills certain constraints (e.g., a minimum/maximum value) [draft-ietf-core-conditional-attributes].

    </t>

    <t>
Observe generally provides significant performance benefits, since, after the registration, the client does not have to send a request to receive a notification.  This feature is particularly beneficial in environments where end-to-end latency is high, and energy and bandwidth resources may be constrained.
    </t>

    <t>As per the Observe specification, when the time between the two last
   notifications received by a CoAP client is greater than 128 seconds,
   it can be concluded that the last one received is also the latest
   sent by the server.  The duration of 128 seconds was chosen as a
   number greater than the default MAX_LATENCY value of the base CoAP
   specification.  When CoAP is used over BP, determining whether a notification was 
   sent by the server later than another notification MUST be
   performed based on the creation timestamps of the corresponding
   bundles encapsulating the two notifications.  The duration of 128
   seconds may be insufficient in many scenarios.  In such cases, the
   duration needs to be chosen as a value greater than the MAX_LATENCY
   of the scenario (see Appendix A).
    </t>

  </section>

  <section title="Block-wise transfers">

    <t>CoAP supports functionality that allows carrying large payloads by means of block-wise transfers [RFC7959], [RFC9177]. BP also supports fragmentation and reassembly functionality. RFC 7959 states, in the context of fragmentation and reassembly functionality being available at several protocol stack layers, that "the fragmentation/reassembly process burdens the lower layers with conversation state that is better managed in the application layer". However, an implicit assumption in RFC 7959 is that details on the data unit sizes that can be carried over the different links of an end-to-end path are known in advance by the sender.
    </t>

    <t>When CoAP is used over BP, CoAP block-wise transfers MAY be used if
   the source knows in advance the duration and type of expected
   contacts (e.g., scheduled or predicted) between the BP nodes that
   will forward the bundles from the source bundle node to the
   destination bundle node.  This does not preclude the use of BP
   fragmentation and reassembly when deemed necessary.
    </t>    

    <t>There exist two CoAP specifications that allow to perform block-wise transfers: [RFC7959] and [RFC9177].
    </t>

    <t>As per RFC 7959, a CoAP endpoint can only ask for (or send) the next block after the previous block has been transferred.  Furthermore, RFC 7959 recommends the use of CON messages.  Therefore, communication follows a stop-and-wait pattern, which is not suitable for environments with long delays.
    </t>

    <t>RFC 9177 is particularly suitable for DTN environments, as it enables block-wise transfers using NON messages.  Thus, blocks can be transmitted serially without having to wait for a response or next request from the remote CoAP peer.  Recovery of multiple missing blocks (which can be reported at once in a single CoAP message) is also supported.
    </t>

   <section title="Main CoAP block-wise transfer parameters">  

    <t> 
   The following new parameters are defined by RFC 9177, for use with
   NON messages and the Q-Block1 and Q-Block2 options: MAX_PAYLOADS,
   NON_TIMEOUT, NON_TIMEOUT_RANDOM, NON_RECEIVE_TIMEOUT,
   NON_MAX_RETRANSMIT, NON_PROBING_WAIT, and NON_PARTIAL_TIMEOUT.
    </t>

    <t>
   MAX_PAYLOADS indicates the number of consecutive blocks an endpoint
   can transmit without eliciting a message from the other endpoint.
   The default value defined in RFC 9177 for this parameter is 10, which is in line
   with the initial window size currently defined for TCP [RFC6928].
   The motivation for such value is that "Ten segments are likely to fit into queue space available at any broadband access link, even when there are a reasonable number of concurrent connections" [RFC6928].  However, the previous statement assumes typical Internet characteristics and TCP segment sizes. For CoAP over BP environments, the characteristics of BP paths and CoAP message sizes involved need to be considered when setting MAX_PAYLOADS.
   </t>

    <t>
   NON_TIMEOUT is the minimum time between sending two consecutive sets
   of MAX_PAYLOADS blocks that correspond to the same body.  The actual
   time between sending two consecutive sets of MAX_PAYLOADS blocks is
   called NON_TIMEOUT_RANDOM, which is calculated as NON_TIMEOUT *
   ACK_RANDOM_FACTOR.  In RFC 9177, NON_TIMEOUT is defined as having the
   same value as ACK_TIMEOUT.  ACK_RANDOM_FACTOR is set to 1.5,
   following RFC 7252.  As a result, by default, NON_TIMEOUT_RANDOM is
   equal to a randomly chosen value between 2 and 3 s.
    </t>

    <t>
   The NON_TIMEOUT_RANDOM inactivity interval described above is
   introduced to avoid causing congestion due to the transmission of
   MAX_PAYLOADS itself.  As discussed previously, in challenged networks,
   ACK_TIMEOUT should be set to a value greater than default.  When CoAP is used in deep space, NON_TIMEOUT, and thus
   NON_TIMEOUT_RANDOM, need to be adjusted considering the
   characteristics of the end-to-end path, independent of ACK_TIMEOUT.
    </t>

    <t>
   NON_RECEIVE_TIMEOUT is the initial time that a receiver will wait for
   a missing block within MAX_PAYLOADS before requesting retransmission
   for the first time.  Every time the missing payload is re-requested,
   the time to wait value doubles.  NON_RECEIVE_TIMEOUT has a default
   value of 2*NON_TIMEOUT.  As described earlier, in challenged networks, 
   NON_TIMEOUT needs to be adjusted considering the
   characteristics of the end-to-end path.
    </t>

    <t>
   NON_MAX_RETRANSMIT is the maximum number of times a request for the
   retransmission of missing payloads can occur without a response from
   the remote peer.  By default, NON_MAX_RETRANSMIT has the same value
   as MAX_RETRANSMIT (Section 4.8 of [RFC7252]).  Accordingly, when CoAP
   is used in deep space, the same considerations regarding
   MAX_RETRANSMIT in Section 5 apply to NON_MAX_RETRANSMIT as well.
   That is, when CoAP is used in space, while the default value for this
   parameter is 4, it may be suitable to set this parameter to a value
   lower than the default one.
    </t>

   </section>

  </section>

  <section title="Proxying">

      <t>
   RFC 7252 defines a "proxy" as "An intermediary that mainly is concerned with forwarding requests and relaying back responses, possibly performing caching, namespace translation, or protocol translation in the process". The same specification also states that "A proxy is a CoAP endpoint that can be tasked by CoAP clients to perform requests on their behalf." Among others, this can be useful "to service the response from a cache in order to reduce response time and network bandwidth or energy consumption". The latter are advantages that may be desirable as well in the environments where BP is used.
      </t>
      
   <section title="Proxying scenarios">  

      <t>
Depending on the protocol(s) supported at each side of the proxy, a proxy can be a "CoAP-to-CoAP proxy", which "maps from a CoAP request to a CoAP request", or a "cross-proxy", which "translates between different protocols, such as a CoAP-to-HTTP proxy or an HTTP-to-CoAP proxy" [RFC 7252].  Figure 6 and Figure 7 illustrate the upper-layer protocol stacks for a CoAP-to-CoAP proxy and an HTTP-to-CoAP cross-proxy, when CoAP or HTTP [draft-blanchet-dtn-http-over-bp] run over BP, respectively.
      </t>

      <t>
        <figure title="CoAP-to-CoAP proxy scenario. (*) There may be zero or more bundle nodes between the CoAP client and the CoAP-to-CoAP proxy, and zero or more bundle nodes between the CoAP-to-CoAP proxy and the CoAP origin server."
                anchor="CoAP-to-CoAP proxy">
        <artwork><![CDATA[    
   +------+                +------+-----+                 +------+
   | CoAP |                | CoAP Proxy |                 | CoAP |
   +------+                +------+-----+                 +------+  
   |  BP  |                |  BP  |  BP |                 |  BP  |
   +------+      (*)       +------+-----+       (*)       +------+
      |                       ^      |                       ^
      >>>>>>>>>>>>>>>>>>>>>>>>^      >>>>>>>>>>>>>>>>>>>>>>>>^  

     CoAP                   CoAP-to-CoAP                    CoAP 
    client                      proxy                   origin server
        ]]></artwork></figure>
     </t>


     <t>
        <figure title="HTTP-to-CoAP proxy scenario. (*) There may be zero or more bundle nodes between the HTTP client and the HTTP-to-CoAP cross-proxy, and zero or more bundle nodes between the cross-proxy and the CoAP origin server."
                anchor="HTTP-to-CoAP proxy">
        <artwork><![CDATA[    
   +------+                +------+------+                 +------+
   | HTTP |                | HTTP | CoAP |                 | CoAP |
   +------+                +------+------+                 +------+  
   |  BP  |                |  BP  |  BP  |                 |  BP  |
   +------+      (*)       +------+------+       (*)       +------+
      |                       ^       |                       ^
      >>>>>>>>>>>>>>>>>>>>>>>>^       >>>>>>>>>>>>>>>>>>>>>>>>^  

     HTTP                    HTTP-to-CoAP                    CoAP 
    client                   cross-proxy                 origin server
        ]]></artwork></figure>
     </t>

    </section>

    <section title="Proxying over BP">

     <t>RFC 7252 states that "When using a proxy, the URI of the resource to request is included in the request, while the destination IP address
   is set to the address of the proxy".  However, that statement assumes the original design of CoAP, where IP is used at the network layer. In CoAP over BP, the destination EID of the encapsulating bundle is set to the EID of the bundle node that implements the CoAP proxy.
     </t>

     <t>Also, RFC 7252 states, when describing forward-proxy operation: "For a CoAP-to-CoAP proxy, the origin server's IP address and port are determined by the authority component of the request URI". In CoAP over BP, the authority component of the request URI provides the origin server's EID.
     </t>

    </section>

    <section title="Proxy operation and message aggregation">

     <t>When a proxy that supports the Payload-length option receives an Aggregate message, it disaggregates the Single messages the Aggregate message is composed of. Then, the proxy operates normally (i.e., as described in [RFC 7252]) upon each Single message.
     </t>

     <t>A proxy MAY aggregate messages that are destined to the same endpoint, even if they are originally triggered by different endpoints.  However, there is also risk that a proxy aiming to aggregate messages eventually cannot do so within a reasonable amount of time, thus contributing delay.  The motivation for the aim to aggregate CoAP messages is illustrated by means of two examples provided next.
     </t>

     <t>Let us first assume the network shown in Figure 8, where the clients are on Earth, the proxy is in a Mars orbiter, and the origin servers are on Mars. Links on the left and on the right of the proxy do not necessarily exist simultaneously over time due to orbital dynamics. The proxy may want to aggregate CoAP messages from the origin servers while there is no connectivity on the left or it may want to aggregate CoAP messages from the clients while there is no connectivity on the right. The proxy may also want to aggregate messages to reduce protocol overhead at the BP layer and lower layers.
     </t>

     <t>
        <figure title="Example proxy-based scenario including several clients and origin servers."
                anchor="clients-proxy-servers">
        <artwork><![CDATA[    
       +--------+                                    +---------------+       
       |Client 1|  <---+                     +---->  |Origin server X|
       +--------+      |      +-------+      |       +---------------+             
                       +----> |       | <----+ 
       +--------+             |       |              +---------------+
       |Client 2|  <--------> | proxy | <--------->  |Origin server Y|
       +--------+             |       |              +---------------+ 
                       +----> |       | <----+
       +--------+      |      +-------+      |       +---------------+
       |Client 3|  <---+                     +---->  |Origin server Z|
       +--------+                                    +---------------+

         Earth               Mars orbiter                  Mars   
        ]]></artwork></figure>
     </t>

     <t>In a first example, in Figure 8, if Client 2 sends a request targetting a resource at Origin server X and it also sends another
   request targetting another resource at Origin server Y, the subsequent responses to Client 2 may be aggregated by the proxy.  Note that connectivity from the proxy to the clients may be unavailable during some time interval, which can be exploited by the proxy to aggregate the responses from the clients.
     </t>

     <t>In a second example, if Client 2 and Client 3 send requests targetting
   resources at Origin server Z, and the proxy cannot service those
   responses from a cache, the proxy may aggregate the requests that
   will be sent to Origin server Z. This may occur while there is no connectivity between the proxy and the origin servers.
     </t>

     <t>When a proxy aggregates CoAP messages, the proxy adds the Payload-length option to each Single message an Aggregate message is composed of. In consequence, the proxy MUST recompute the deltas of the outer CoAP options from each Single message accordingly.
     </t>

     <t>When a proxy needs to send a Single message that arrived at the proxy as part of an Aggregate message, the proxy MUST remove its Payload-length option prior to its transmission. In consequence, the proxy MUST recompute the deltas of the outer CoAP options accordingly.
     </t>

    </section>
  </section>

  <section title="URI Scheme">

      <t> The URI scheme for CoAP over BP is "coap" as per the recommendation of Section 6 of [draft-ietf-core-transport-indication]. The "coap" scheme is defined in Section 6 of [RFC7252].
      </t>

      <t>When the endpoint ID of the target resource is based on the "dtn" scheme, the authority component of the URI is formed as the reg-name of the endpoint ID, followed by .dtn.arpa.
      </t>

      <t>When the endpoint ID of the target resource is based on the "ipn" scheme, the authority component of the URI is formed as the service-nbr, followed by the nbr-delim (".") and the node-nbr of the endpoint ID, followed by .ipn.arpa.
      </t>

      <t>User information and port are always absent with the URI scheme used in CoAP over BP.
      </t>

      <t>For example, under the rules of Section 6 of [RFC7252], the URI of a request for the discovery resource of a CoAP over BP entity with endpoint ID dtn://JupiterSensor would be:
      </t>

      <t>coap://JupiterSensor.dtn.arpa/.well-known/core
      </t>

      <t>Similarly, the URI of a request for the discovery resource of a CoAP over BP entity with endpoint ID ipn:81.TBD2 would be:
      </t>

      <t>coap://TBD2.81.ipn.arpa/.well-known/core
      </t>

      <t>Note: this specification requests a Well-known Service Number for CoAP over BPv7 in the 'ipn' Scheme URI Well-known Service Numbers for BPv7       
         registry [RFC 9758] (see section 12.2). Such number is TBD2. 
      </t>

    </section>  


    <section title="Securing CoAP over BP">

     <section title="DTLS versus OSCORE">     

      <t>The base CoAP specification defines a binding to Datagram Transport Layer Security (DTLS) [RFC7252][RFC9147]. There are four possible DTLS security modes: NoSec, PreSharedKey, RawPublicKey, and Certificate. The NoSec and RawPublicKey modes are mandatory to implement.
      </t>

      <t>Subsequently, Object Security for Constrained RESTful Environments (OSCORE) was specified [RFC8613]. OSCORE is a security protocol for CoAP that
   allows to protect an application-layer data payload end-to-end, even in the presence of untrusted proxies in the path between two
   endpoints.  The Group OSCORE protocol [draft-ietf-core-oscore-groupcomm] is used to secure CoAP group communication [draft-ietf-core-groupcomm-bis].
      </t>

      <t>In OSCORE, the communicating endpoints require a shared security context. An interesting aspect of OSCORE for the environments where BP is used is that, if the materials used to establish such context are pre-shared, there is no initial handshake prior to actual communication, thus avoiding a significant latency penalty. In contrast, DTLS does require an initial handshake. For this reason, the use of DTLS to secure CoAP over BP is generally NOT RECOMMENDED, possible exceptions being environments where the latency penalty is considered acceptable.
      </t>

    </section>

    <section title="OSCORE and BPSec">

      <t>On the other hand, Bundle Protocol Security (BPSec) [RFC 9172] provides security services for BP bundles, allowing to protect (with integrity and/or confidentiality) one or more blocks of a bundle. BPSec may be used to provide end-to-end protection between the bundle source and the bundle destination.
      </t>

      <t> When CoAP is carried over BP, the CoAP message will be carried as the
   block-type-specific data field of the Bundle Payload Block (block
   type 1) of an encapsulating bundle.  If OSCORE is used to protect
   CoAP, only the CoAP message payload, one CoAP message header field,
   and some of the CoAP options are protected.  Currently, all CoAP
   message fields that are protected by OSCORE are provided with confidentiality
   and integrity protection. BPSec allows to protect all fields of the carried CoAP message. However, in the context of CoAP over BP, the scope of BPSec protection is delimited by a bundle node implementing a CoAP endpoint at the application layer, including a CoAP proxy. Therefore, when one or more CoAP proxies are present between a CoAP client and a CoAP origin server, BPSec cannot ensure the protection of application-layer data between those two CoAP endpoints. In that case, OSCORE SHOULD be used to protect application-layer data between the two CoAP endpoints. Nevertheless, use of BPSec is still useful to protect all fields of the carried CoAP message in each corresponding BP end-to-end path (i.e., from the origin CoAP source until the first CoAP proxy, between consecutive CoAP proxies, or from the last CoAP proxy until the final, end-to-end CoAP destination).  Such fields include the Payload-length option, when present, which is "Class U" for OSCORE (see Section 4.3.1 and Section 14).
      </t>

      <t>
Note that, in some scenarios, a CoAP client might not be aware that it is communicating with a reverse-proxy (instead of the origin CoAP server).
      </t>

      <t>In scenarios without CoAP proxies, both OSCORE or BPSec MAY be used to provide end-to-end application-layer data protection. As discussed above, BPSec allows to protect all fields of the carried CoAP message.
      </t>
     
      <t>In order to offer protection against replay attacks, OSCORE uses by default an anti-replay sliding window, with a window size of 32 [RFC 8613].  If a greater window size is deemed necessary (e.g., due to high latency in an intended scenario), that window size needs to be known by both sender and receiver at the moment of security context establishment. Note that the BP freshness feature, whereby a bundle includes a creation timestamp and a lifetime field, provides additional protection against replay attacks.  If the bundle is replayed outside of its lifetime, the bundle will be discarded and the replay attack will fail (see Section 8.2.4 of RFC 9172). Note that RFC 9171 offers provisions for nodes without accurate clocks (see Sections 4.2.7 and 4.3.1 of RFC 9171).
      </t>

      <t>The Echo option in CoAP [RFC 9175] allows a server to verify the freshness of a request. Two types of freshness verifications can be enabled by using the Echo option: time-based freshness and event-based freshness. When a request is required to be fresh, and its freshness cannot be verified, the server rejects the request and includes the Echo option in the response to the client. The latter usually resends the original request, echoing the Echo option value in the request, and also echoes the Echo option value in at least the next request after a received Echo option value from the server. However, the round trip incurred to check the freshness of the first request may incur significant delay penalty in BP environments.
      </t>

      <t>On the other hand, in a scenario with proxies, the freshness features provided by BP are limited to the scope of the path between the bundle source and the bundle destination. Thus, the Echo option would be needed to verify the end-to-end freshness of a CoAP request in such a scenario. 
      </t>

     </section>

     <section title="Security requirements of CoAP requests and responses over BP">

      <t>When CoAP is carried over BP, a CoAP response SHOULD be protected with at least the same level of security as its corresponding CoAP request.</t>
     
     </section>
 
    </section>

    <section title="IANA Considerations">

     <section title="Creation of two new reserved domains in the .arpa name space">

      <t>IANA is asked to create two new reserved domain names in the .arpa
   name space as described in [RFC6761]: the suffixes .dtn.arpa and .ipn.arpa.
      </t>

      <t>The expectation for application software is that no DNS resolution
   is attempted; instead, the prefix is processed into an endpoint ID,
   and any operation on that endpoint ID is pointed to the
   BP node(s) registered in that endpoint ID.
      </t>

         <section title="Domain Name Reservation Considerations">

            <t>The Domain Reservation Considerations from Section 5 of [RFC6761] for
   both domain names (.dtn.arpa and .ipn.arpa) are:
            </t>

            <t>*  Users: users are not expected to recognize those names as special.
            </t>

            <t>*  Application Software: application software is expected to pass those names on to their CoAP over BP implementation.  CoAP over BP
  	implementations are expected to recognize those names as BP endpoint IDs and MUST NOT pass them on to DNS-based resolvers (unless the name resolution API happens to explicitly support resolution into endpoint ID, see below).
            </t>

            <t>*  Name resolution APIs and libraries: name resolution APIs and
  	libraries MAY indicate that .dtn.arpa and .ipn.arpa names resolve to the endpoint ID encoded inside them (but no details for this are
     specified in known resolution APIs or libraries).  Otherwise, they SHOULD report them as NXDOMAIN.
            </t>

            <t> *  Caching DNS Servers: caching DNS servers MAY recognize the special
  	domains and report them as NXDOMAIN.  Otherwise, they will cache
  	the .arpa DNS servers' responses.
            </t>

            <t>*  Authoritative DNS Servers: authoritative DNS servers MAY recognize
  	the special domains and report them as NXDOMAIN.
            </t>

            <t> *  DNS Server Operators: No impact on DNS server operators is
  	expected.
            </t>

            <t> *  DNS Registries/Registrars: Any changes to .dtn.arpa or .ipn.arpa require updates to this document and the corresponding process through IANA.
            </t>


         </section>

      </section> 

      <section title="ipn URI Scheme Well-known Service Number for CoAP">

         <t>IANA is requested to assign a Well-known Service Number for CoAP in the 'ipn' Scheme URI Well-known Service Numbers for BPv7 registry [RFC9758].
         </t>

         <t>
         <figure title="Well-known service number for CoAP over BPv7."
                anchor="Well-known_numb">
        <artwork><![CDATA[    
             +--------+-----------------+-------------------+
             | Number | Name            | Reference         |
             +--------+-----------------+-------------------+
             |  TBD2  | CoAP            | [[this document]] |
             +--------+-----------------+-------------------+
        ]]></artwork></figure>
        </t>

      </section> 

      <section title="CoAP Option Numbers Registry">

         <t>IANA is kindly requested to add the Payload-length option to the CoAP Option Numbers registry:
         </t>

         <t>
         <figure title="CoAP option number assignment for the Payload-length option."
                anchor="CoAP_option_numb_assign">
        <artwork><![CDATA[    
             +--------+-----------------+-------------------+
             | Number | Name            | Reference         |
             +--------+-----------------+-------------------+
             |  TBD1  | Payload-length  | [[this document]] |
             +--------+-----------------+-------------------+
        ]]></artwork></figure>
     </t>

      </section>

    </section>


    <section title="Implementation Status">

      <t>(Note to the RFC Editor: please remove this entire section before 
     publication [RFC 7942].)
      </t> 

      <t>This section records the status of known implementations of the
     protocol defined by this specification at the time of posting of
     this Internet-Draft, and is based on a proposal described in
     RFC 7942.  The description of implementations in this section is
     intended to assist the IETF in its decision processes in
     progressing drafts to RFCs.  Please note that the listing of any
     individual implementation here does not imply endorsement by the
     IETF.  Furthermore, no effort has been spent to verify the
     information presented here that was supplied by IETF contributors.
     This is not intended as, and must not be construed to be, a
     catalog of available implementations or their features.  Readers
     are advised to note that other implementations may exist.
      </t>
    
      <t>According to RFC 7942, "this will allow reviewers and working
     groups to assign due consideration to documents that have the
     benefit of running code, which may serve as evidence of valuable
     experimentation and feedback that have made the implemented
     protocols more mature.  It is up to the individual working groups
     to use this information as they see fit".
      </t>

      <section title="Space CoAP">

        <t>- Organization responsible for the implementation: Universitat Politecnica de Catalunya (UPC).
        </t>

        <t>- Implementation name: Space CoAP. 
        </t>

        <t>- Links:
             https://github.com/ENTEL-WNG/CoAPoverBP-no-proxy-version
             https://github.com/ENTEL-WNG/CoAPoverBP-proxy-version
             https://github.com/ENTEL-WNG/CoAPoverBP-proxy-version-BP
        </t>

        <t>- Overview: three CoAP over BP scenarios are supported, based on modifications made on top of the aiocoap library (CoAP implementation) and the 
             uD3TN library (BP implementation):
        </t>

        <list>
        <t>o  CoAPoverBP-no-proxy-version: direct integration of CoAP over BP, where both the CoAP client and server run directly on bundle nodes. CoAP messages are buffered, optionally aggregated and then encapsulated in BP bundles. Persistent storage and scheduled contact plans manage delayed delivery. No CoAP proxying is used. Message creation, aggregation and parsing happen entirely within the bundle nodes.
        </t>

        <t>o  CoAPoverBP-proxy-version: CoAP-to-BP proxy nodes that bridge conventional CoAP-over-UDP clients and servers with a BP network. CoAP participants communicate via UDP with local proxy applications running on bundle nodes. These proxies are responsible for encapsulating CoAP messages into BP bundles for transmission across the DTN and vice versa. Each proxy preserves the CoAP Message ID and Token hop-based while adding a custom Payload-length
option to enable message aggregation and correct reassembly. Aggregate messages are stored, carried and forwarded through a uD3TN-based DTN topology
with scheduled contact plans and persistent storage.
        </t>

        <t>o  CoAPoverBP-proxy-version-BP: CoAP-over-BP proxy architecture where both CoAP client and server operate directly on bundle nodes and a dedicated proxy mediates CoAP over BP. The proxy performs forwarding of CoAP messages with hop-by-hop based Message ID and Token matching. CoAP messages are buffered and optionally aggregated, with each message tagged using a custom Payload-length option to allow for message disaggregation on the
receiving side. All forwarding, storage and delay simulation is managed using uD3TN with persistent storage and scheduled contacts between nodes.
        </t>
        </list>
 
        <t>- Implementation level of maturity: research</t>

        <t>- Coverage: 
        </t>
 
        <list> 
           <t>o Two proxy and one non-proxy scenario </t>
           <t>o CoAP Client and Server with multiple Bundle Nodes </t>
           <t>o Contact plan scheduling for delay simulation </t>
           <t>o Persistent storage on bundle node with bundle decision maker </t>
           <t>o PUT, POST, GET, DELETE methods</t>
           <t>o NON and CON message handling</t>
           <t>o Hop-based token and MID matching. Round Trip is Piggybacked for simplicity </t>
           <t>o Extended Message ID to 24 bits and timers according to draft-gomez-core-coap-bp-03 </t>
           <t>o Message aggregation and payload_length option field </t>
           <t>o Space CoAP Lua dissector </t>
           <t>o CoAP over BP URI Scheme </t>
        </list>
          
        <t>- Licensing: This project incorporates code from several open source libraries and includes original code and modifications.
        </t>

        <t> The project code is licensed under the GNU Affero General Public License Version 3 (AGPLv3). See the LICENSE file in the root of this repository for the full text. The project includes modified files from the aiocoap library (https://github.com/chrysn/aiocoap), originally developed by Christian
Amsuess and contributors. Modifications were made to implement draft-gomez-core-coap-bp-03. All changes are clearly marked in the source files with inline comments "experimental for draft-gomez-core-coap-bp-03".
        </t>

        <t> aiocoap Library: This project includes code from the aiocoap library, which is licensed under the BSD 3-Clause License. The full text of this license can be found in the LICENSE folder in the aiocoap library.  
        </t>

        <t> uD3TN Library: This project includes code from the uD3TN library, which is licensed under the AGPLv3 License. The full text of this license can be found in the LICENSE file in the uD3TN library.
        </t>  

        <t>- Contact information: 
        </t>
        
        <list>   
          <t>o  Michael Karpov: michael.karpov@estudiantat.upc.edu - Main developer</t>
          <t>o  Anna Calveras: anna.calveras@upc.edu - Project supervisor</t>
        </list>

      </section>

      <section title="Other CoAP over BP implementations">
     
        <t>Other implementations of CoAP over BP have been reported over time <xref target="taracoap"/><xref target="boap"/>. However, please note that such implementations preceded the creation of the initial version of the present document, therefore they were not intended as implementations of this document.  
        </t>

      </section>


    </section>

    <section anchor="Security" title="Security Considerations">

      <t>The Payload-length option is "Class U" for OSCORE, therefore this option, which conveys the payload size of a CoAP message, cannot be
   protected by means of OSCORE.  A possible risk is that, even if an OSCORE message payload is protected, an attacker might try to infer
   some features of the communication between the involved endpoints based on the payload size of each message.  Note that exposing the individual sizes of the Single messages an Aggregate message is composed of provides additional information compared to knowing the Aggregate message size (assuming that the latter can be obtained by the attacker).
      </t>

      <t>One possible solution might be based on not using the Payload-length option, at the expense of the inability of benefitting from message
   aggregation.  A less radical approach, which allows to benefit from message aggregation, is based on using the Padding option [draft-ietf-core-cacheable-oscore].  In that case, a Single message may be padded before being protected with OSCORE.  Note that the Padding option is Class E for OSCORE.  On the other hand, lower-layer security (e.g., BPSec) may also help mitigate the risk.
      </t>

    </section>

    <!-- This PI places the pagebreak correctly (before the section title) in the text output. -->

    <!-- Possibly a 'Contributors' section ... -->
    
    <section anchor="ACKs" title="Acknowledgments">

      <t>The authors would like to thank (in alphabetical order) Christian Amsuess, Edward J. Birrane, Marc Blanchet, Carsten Bormann, Scott Burleigh, Joshua Deaton, Jaime Jimenez, Achim Kraus, Bilhanan Silverajan, Brian Sipos, Rick Taylor, Marco Tiloca, Laurent Toutain, Rodney Van Meter, and Magnus Westerlund for useful design considerations, reviews and comments.  The authors would also like to thank Michael Karpov as the main developer of
the "Space CoAP" research implementation of CoAP over BP.
      </t> 

      <t> Carles Gomez and Anna Calveras have been funded in part by MCIU/AEI/10.13039/501100011033/FEDER/UE through project PID2023-146378NB-I00, and by Secretaria d'Universitats i Recerca del Departament d'Empresa i Coneixement de
         la Generalitat de Catalunya with the grant number 2021 SGR 00330.
      </t>


    </section>
 

   </middle>

  <!--  *****BACK MATTER ***** -->

  <back>
    <!-- References split into informative and normative -->

    <!-- There are 2 ways to insert reference entries from the citation libraries:
     1. define an ENTITY at the top, and use "ampersand character"RFC2629; here (as shown)
     2. simply use a PI "less than character"?rfc include="reference.RFC.2119.xml"?> here
        (for I-Ds: include="reference.I-D.narten-iana-considerations-rfc2434bis.xml")

     Both are cited textually in the same manner: by using xref elements.
     If you use the PI option, xml2rfc will, by default, try to find included files in the same
     directory as the including file. You can also define the XML_LIBRARY environment variable
     with a value containing a set of directories to search.  These can be either in the local
     filing system or remote ones accessed by http (http://domain/dir/... ).-->


    <references title="Normative References">

      <?rfc include='reference.RFC.2119.xml'?>

      <?rfc include='reference.RFC.4838.xml'?>

      <?rfc include='reference.RFC.5234.xml'?>

      <?rfc include='reference.RFC.6761.xml'?>

      <?rfc include='reference.RFC.7252.xml'?>

      <?rfc include='reference.RFC.7959.xml'?>

      <?rfc include='reference.RFC.7641.xml'?>

      <?rfc include='reference.RFC.7595.xml'?>

      <?rfc include='reference.RFC.7967.xml'?>

      <?rfc include='reference.RFC.8174.xml'?>

      <?rfc include='reference.RFC.8323.xml'?>

      <?rfc include='reference.RFC.8613.xml'?>

      <?rfc include='reference.RFC.9147.xml'?>

      <?rfc include='reference.RFC.9171.xml'?>

      <?rfc include='reference.RFC.9172.xml'?>

      <?rfc include='reference.RFC.9175.xml'?>

      <?rfc include='reference.RFC.9177.xml'?>

      <?rfc include='reference.RFC.9758.xml'?>  

      <?rfc include='reference.I-D.ietf-core-transport-indication'?>

      <?rfc include='reference.I-D.ietf-core-cacheable-oscore'?>

    </references>

    <references title="Informative References">
      <!-- Here we use entities that we defined at the beginning. -->

      <?rfc include='reference.RFC.7228.xml'?>

      <?rfc include='reference.RFC.7942.xml'?>

      <?rfc include='reference.RFC.9668.xml'?>

      <?rfc include='reference.I-D.ietf-core-groupcomm-bis'?>

      <?rfc include='reference.I-D.ietf-core-oscore-groupcomm'?>

      <?rfc include='reference.I-D.ietf-core-conditional-attributes'?>

      <?rfc include='reference.I-D.blanchet-dtn-http-over-bp'?>        

      <!--?rfc include="http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml"?-->
     <reference anchor="Conf">
        <front>
            <title>Concept for continuous inter-planetary communications</title>
            <author>
            <organization>S.M. Davidovich, J. Whittington</organization>
            </author>
            <date year="1999" month="May"/>
        </front>
     </reference>

      <!--?rfc include="http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml"?-->
     <reference anchor="taracoap">
        <front>
            <title>Efficient and secure autonomous communications for deep space missions</title>
            <author>
            <organization>M. Adalier, A. Riffel, M. Galvan, B. Johnson, S. Burleigh</organization>
            </author>
            <date year="2020" month="March"/>
        </front>
     </reference>

      <!--?rfc include="http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml"?-->
     <reference anchor="boap">
        <front>
            <title>Coap over bp for a delay-tolerant internet of things</title>
            <author>
            <organization>M. Auzias, M. Yves, F. Raimbault</organization>
            </author>
            <date year="2015" month="August"/>
        </front>
     </reference>     

    </references>    

    <section title="Reference CoAP parameter values for interplanetary communication">

       <t>Figure 7 shows the Round-Trip Time (RTT) between two endpoints on (or close to) different celestial bodies of the Solar System, for the maximum      
          distances between such endpoints <xref target="Conf"/>, and in an idealized scenario where communication latency only comprises a propagation delay component. (Note that message storing until the next connectivity opportunity may significantly increase total communication latency.)
          The RTT also provides a lower bound on (and an approximation of) the ACK_TIMEOUT values required to avoid spurious retransmission timer 
          expiration. 
       </t>

       <t>Figure 9 provides approximate EXCHANGE_LIFETIME values that would stem from the use of ACK_TIMEOUT values such as those shown 
          in Figure 5, for MAX_RETRANSMIT=1. (Note that the values provided in Figure 5 are also approximately equal to EXCHANGE_LIFETIME, for
          MAX_RETRANSMIT=0, under the conditions considered.)
       </t>

       <t>For the sake of comparison, Figure 10 also provides the hypothetical, approximate EXCHANGE_LIFETIME values that would correspond to MAX_RETRANSMIT=
          1, but with a retransmission scheme using a constant RTO value for message retries.
       </t>

       <t>Finally, Figure 11 provides the one-way delay for communication between endpoints on (or close to) different celestial bodies of the Solar System, for the maximum distances between such endpoints, and assuming an idealized scenario where communication latency only comprises a propagation delay component. The values in this figure correspond approximately to MAX_LATENCY in the described scenarios.
       </t>

     <t>
        <figure title="ACK_TIMEOUT or EXCHANGE_LIFETIME (for MAX_RETRANSMIT=0), expressed in seconds."
                anchor="RTT">
        <artwork><![CDATA[   
------------------------------------------------------------------------
------------------------------------------------------------------------
| RTT, ACK_TIMEOUT (or EXCHANGE_LIFETIME, for MAX_RETRANSMIT=0)        |
------------------------------------------------------------------------
|       |Sun|Mercury|Venus|Earth| Mars|Jupiter|Saturn|Uranus|Neptune|
------------------------------------------------------------------------
|    Sun| - |    466|  727|1,014|1,661|  5,444|10,007|20,214| 30,288|
------------------------------------------------------------------------
|Mercury| - |   -   |1,181|1,448|1,968|  5,751|10,340|20,548| 30,554|
------------------------------------------------------------------------
|  Venus| - |   -   |  -  |1,735|2,382|  6,158|10,741|20,948| 30,955|
------------------------------------------------------------------------
|  Earth| - |   -   |  -  |  -  |2,642|  6,424|11,008|21,215| 31,222|
------------------------------------------------------------------------
|   Mars| - |   -   |  -  |  -  |  -  |  6,805|11,408|21,615| 31,622|
------------------------------------------------------------------------
|Jupiter| - |   -   |  -  |  -  |  -  |   -   |14,944|25,151| 35,425|
------------------------------------------------------------------------
| Saturn| - |   -   |  -  |  -  |  -  |   -   |   -  |29,220| 39,961|
------------------------------------------------------------------------
| Uranus| - |   -   |  -  |  -  |  -  |   -   |   -  |   -  | 50,168|
------------------------------------------------------------------------
|Neptune| - |   -   |  -  |  -  |  -  |   -   |   -  |   -  |   -   |
------------------------------------------------------------------------
        ]]></artwork></figure>

     </t>


     <t>
        <figure title="EXCHANGE_LIFETIME (for MAX_RETRANSMIT=1), expressed in seconds."
                anchor="3RTT">
        <artwork><![CDATA[   
------------------------------------------------------------------------
------------------------------------------------------------------------
| EXCHANGE_LIFETIME (for MAX_RETRANSMIT=1)                             |
------------------------------------------------------------------------
|       |Sun|Mercury|Venus|Earth| Mars|Jupiter|Saturn|Uranus|Neptune|
------------------------------------------------------------------------
|    Sun| - |  1,397|2,182|3,042|4,983| 16,331|30,021|60,642| 90,863|
------------------------------------------------------------------------
|Mercury| - |   -   |3,542|4,343|5,904| 17,252|31,021|61,643| 91,663|
------------------------------------------------------------------------
|  Venus| - |   -   |  -  |5,204|7,145| 18,473|32,222|62,843| 92,864|
------------------------------------------------------------------------
|  Earth| - |   -   |  -  |  -  |7,925| 19,273|33,023|63,644| 93,665|
------------------------------------------------------------------------
|   Mars| - |   -   |  -  |  -  |  -  | 20,414|34,224|64,845| 94,866|
------------------------------------------------------------------------
|Jupiter| - |   -   |  -  |  -  |  -  |   -   |44,831|75,452|106,274|
------------------------------------------------------------------------
| Saturn| - |   -   |  -  |  -  |  -  |   -   |   -  |87,661|119,883|
------------------------------------------------------------------------
| Uranus| - |   -   |  -  |  -  |  -  |   -   |   -  |   -  |150,504|
------------------------------------------------------------------------
|Neptune| - |   -   |  -  |  -  |  -  |   -   |   -  |   -  |   -   |
------------------------------------------------------------------------
        ]]></artwork></figure>
     </t>

     <t>
        <figure title="Hypothetical EXCHANGE_LIFETIME (for MAX_RETRANSMIT=1), assuming CoAP message retransmission without exponential backoff, 
                       expressed in seconds."
          anchor="jarls">
        <artwork><![CDATA[   
------------------------------------------------------------------------
------------------------------------------------------------------------
| EXCHANGE_LIFETIME (for MAX_RETRANSMIT=1 and no exponential backoff)  |
------------------------------------------------------------------------
|       |Sun|Mercury|Venus|Earth| Mars|Jupiter|Saturn|Uranus|Neptune|
------------------------------------------------------------------------
|    Sun| - |    931|1,454|2,028|3,322| 10,888|20,014|40,428| 60,575|
------------------------------------------------------------------------
|Mercury| - |   -   |2,362|2,895|3,936| 11,501|20,681|41,095| 61,109|
------------------------------------------------------------------------
|  Venus| - |   -   |  -  |3,469|4,763| 12,315|21,482|41,896| 61,909|
------------------------------------------------------------------------
|  Earth| - |   -   |  -  |  -  |5,284| 12,849|22,015|42,429| 62,443|
------------------------------------------------------------------------
|   Mars| - |   -   |  -  |  -  |  -  | 13,609|22,816|43,230| 63,244|
------------------------------------------------------------------------
|Jupiter| - |   -   |  -  |  -  |  -  |   -   |29,887|50,301| 70,849|
------------------------------------------------------------------------
| Saturn| - |   -   |  -  |  -  |  -  |   -   |   -  |58,440| 79,922|
------------------------------------------------------------------------
| Uranus| - |   -   |  -  |  -  |  -  |   -   |   -  |   -  |100,336|
------------------------------------------------------------------------
|Neptune| - |   -   |  -  |  -  |  -  |   -   |   -  |   -  |   -   |
------------------------------------------------------------------------
        ]]></artwork></figure>
     </t>


     <t>
        <figure title="Approximate MAX_LATENCY, expressed in seconds."
          anchor="jarls2">
        <artwork><![CDATA[   
------------------------------------------------------------------------
------------------------------------------------------------------------
| MAX_LATENCY                                                          |
------------------------------------------------------------------------
|       |Sun|Mercury|Venus|Earth| Mars|Jupiter|Saturn|Uranus|Neptune|
------------------------------------------------------------------------
|    Sun| - |    233|  364|  507|  831|  2,722| 5,003|10,107| 15,144|
------------------------------------------------------------------------
|Mercury| - |   -   |  590|  724|  984|  2,875| 5,170|10,274| 15,277|
------------------------------------------------------------------------
|  Venus| - |   -   |  -  |  867|1,191|  3,079| 5,370|10,474| 15,477|
------------------------------------------------------------------------
|  Earth| - |   -   |  -  |  -  |1,321|  3,212| 5,504|10,607| 15,611|
------------------------------------------------------------------------
|   Mars| - |   -   |  -  |  -  |  -  |  3,402| 5,704|10,807| 15,811|
------------------------------------------------------------------------
|Jupiter| - |   -   |  -  |  -  |  -  |   -   | 7,472|12,575| 17,712|
------------------------------------------------------------------------
| Saturn| - |   -   |  -  |  -  |  -  |   -   |   -  |14,610| 19,980|
------------------------------------------------------------------------
| Uranus| - |   -   |  -  |  -  |  -  |   -   |   -  |   -  | 25,084|
------------------------------------------------------------------------
|Neptune| - |   -   |  -  |  -  |  -  |   -   |   -  |   -  |   -   |
------------------------------------------------------------------------
        ]]></artwork></figure>
     </t>

    </section> 

    <section title="Message ID size, EXCHANGE_LIFETIME, and maximum CoAP message rate">

    <t>With default settings [RFC 7252], and a 16-bit message ID size, CoAP supports the transmission of up to 265 messages/s between a sender and its destination endpoint. If CoAP is used in scenarios involving much greater latencies (e.g., deep space), the greater EXCHANGE_LIFETIME would significantly
limit the CoAP message rate. Figure 9 provides the maximum possible message rates for message ID sizes of 16 and 24 bits, and a range of EXCHANGE_LIFETIME
values.
    </t>

    <t>
        <figure title="Maximum CoAP message rate imposed by the Message ID size and EXCHANGE_LIFETIME, expressed in messages/s."
          anchor="jarls3">
        <artwork><![CDATA[   
------------------------------------------------------------------------
------------------------------------------------------------------------		
|Message ID      		   16 bits	   24 bits             |
------------------------------------------------------------------------		
#Messages per EXCHANGE_LIFETIME	   65,536	16,777,216
------------------------------------------------------------------------

------------------------------------------------------------------------
------------------------------------------------------------------------
|Message rate (messages/second)                                        |
------------------------------------------------------------------------		
EXCHANGE_LIFETIME (s)	Message ID_16 bits	Message_ID 24 bits
247 (default)           265.3 (default)         67,924
500			131.1			33,554
1,000			65.5			16,777
1,500			43.7			11,184
2,000			32.8			8,388
2,500			26.2			6,710
3,000			21.8			5,592
3,500			18.7			4,793
4,000			16.4			4,194
4,500			14.6			3,728
5,000			13.1			3,355
5,500			11.9			3,050
6,000			10.9			2,796
6,500			10.1			2,581
7,000			 9.4			2,396
7,500			 8.7			2,237
10,000			 6.6			1,677
20,000			 3.3	                  838
30,000			 2.2			  559
40,000			 1.6			  419
50,000			 1.3			  335
60,000			 1.1			  279
70,000			 0.9			  239
80,000			 0.8			  209
90,000			 0.7			  186
100,000			 0.7			  167
110,000			 0.6			  152
120,000			 0.5			  139
130,000			 0.5			  129
140,000			 0.5			  119
150,000			 0.4			  111
------------------------------------------------------------------------------------------------------------------------------------------------
        ]]></artwork></figure>
     </t>


    </section>

    <!-- -->
  </back>
</rfc>