<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>
<?rfc strict="yes" ?>
<?rfc toc="yes"?>
<!-- generate a ToC -->
<?rfc symrefs="yes"?>
<!-- use symbolic references tags, i.e, [RFC2119] instead of [1] -->
<?rfc sortrefs="yes" ?>
<!-- sort the reference entries alphabetically -->
<?rfc compact="no" ?>
<!-- do not start each main section on a new page -->
<?rfc subcompact="no" ?>
<rfc xmlns:xi="http://www.w3.org/2001/XInclude" category="std" consensus="true" docName="draft-ietf-dtn-amp-01" ipr="trust200902" submissionType="IETF" version="3" xml:lang="en">
  <front>
    <title abbrev="DTNMA AMP">DTNMA Asynchronous Management Protocol (AMP)</title>
    <seriesInfo name="Internet-Draft" value="draft-ietf-dtn-amp-01"/>
    <author fullname="Edward J. Birrane, III" initials="E.J." surname="Birrane">
      <organization abbrev="JHU/APL">The Johns Hopkins University Applied Physics Laboratory</organization>
      <address>
        <postal>
          <street>11100 Johns Hopkins Rd.</street>
          <city>Laurel</city>
          <region>MD</region>
          <code>20723</code>
          <country>United States of America</country>
        </postal>
        <phone>+1 443 778 7423</phone>
        <email>Edward.Birrane@jhuapl.edu</email>
      </address>
    </author>
    <author fullname="Brian Sipos" initials="B." surname="Sipos">
      <organization abbrev="JHU/APL">The Johns Hopkins University Applied Physics Laboratory</organization>
      <address>
        <email>brian.sipos+ietf@gmail.com</email>
      </address>
    </author>
    <date/>
    <area>Transport</area>
    <workgroup>Delay-Tolerant Networking</workgroup>
    <keyword>DTN</keyword>
    <keyword>Network Management</keyword>
    <keyword>Autonomy</keyword>
    <abstract>
      <t>
This document defines a messaging protocol for the Delay-Tolerant Networking (DTN) Management Architecture (DTNMA) Asynchronous Management Model (AMM) and a transport mapping for exchanging those messages over a network.
This Asynchronous Management Protocol (AMP) does not require transport-layer sessions, operates over unidirectional links, and seeks to reduce the energy and compute power necessary for performing network management of resource constrained devices and over challenged networks.
      </t>
    </abstract>
  </front>
  <middle>
    <section>
      <name>Introduction</name>
      <t>
Network management in challenged and resource constrained networks must be accomplished differently than the network management methods in low-delay, high-rate, high-availability networks.
The Delay-Tolerant Networking (DTN) Management Architecture (DTNMA), as defined in <xref target="RFC9675"/>, provides an overview and justification of an alternative to "synchronous" management services such as those provided by SNMP <xref target="RFC3411"/> or NETCONF <xref target="RFC6241"/> (and its derivatives RESTCONF <xref target="RFC8040"/> and CORECONF <xref target="I-D.ietf-core-comi"/>).
In particular, the DTNMA defines the need for a flexible, robust, and efficient autonomy engine to handle decisions when operators cannot be active in the network.
      </t>
      <t>
The logical description of that DTNMA Application Management Model (AMM), and its realization in static Application Data Models (ADMs) and dynamic Operational Data Models (ODMs), is in <xref target="I-D.ietf-dtn-amm"/>.
The AMM presents an efficient and expressive model for the asynchronous management of a network node, but does not specify any particular message structure or encoding.
      </t>
      <t>
This document, the DTNMA Asynchronous Management Protocol (AMP), specifies an encoding of messages related to AMM objects using ARI values <xref target="I-D.ietf-dtn-ari"/> as protocol data units (PDUs) in <xref target="sec-msg"/> and a transport of these PDUs within Bundle Protocol version 7 (BPv7) <xref target="RFC9171"/> payloads in <xref target="sec-bp"/>.
      </t>
      <t>
This AMP specification provides an enveloping of ARIs necessary to support the AMM as described in <xref section="2.3" target="I-D.ietf-dtn-amm"/>.
As such, AMP defines very few structures of its own.
      </t>
      <section>
        <name>Scope</name>
        <t> 
The AMP provides data monitoring, administration, and configuration for applications operating above the data link layer of the OSI networking model.
While the AMP may be configured to support the management of network layer protocols, it also uses these protocol stacks to encapsulate and communicate its own messages.
        </t>
        <t>
It is assumed that the transport(s) used to carry AMP messages provide addressing, confidentiality, integrity, security, fragmentation/reassembly, and other network functions.
Therefore, these items are outside of the scope of this document. 
        </t>
        <t>
This document describes the format of messages used to exchange data models between managing and managed devices in a network.
The rationale for this type of exchange is outside of the scope of this document and is covered in  <xref target="RFC9675"/>.
The description and explanation of the data models exchanged is also outside of the scope of this document and is covered in <xref target="I-D.ietf-dtn-amm"/>.
        </t>
        <t>
This document does not address specific configurations of AMP-enabled devices or any ADMs or ODMs available on such devices.
This also does not discuss the interface, if any, between AMP and other management protocols. 
        </t>
      </section>
      <section>
        <name>Use of CDDL</name>
        <t>
This document defines Concise Binary Object Representation (CBOR) structure using the Concise Data Definition Language (CDDL) of <xref target="RFC8610"/>.
The entire CDDL structure can be extracted from the XML version of this document using the XPath expression:
        </t>
        <sourcecode>'//sourcecode[@type="cddl"]'</sourcecode>
        <t>
The following initial fragment defines the top-level symbols of this document's CDDL, which includes the example CBOR content.
        </t>
        <sourcecode type="cddl">
start = amp-adu
        </sourcecode>
        <t>
From the document <xref target="I-D.ietf-dtn-ari"/> the definitions are taken for <tt>ari</tt>, <tt>lit-execset</tt>, and <tt>lit-rptset</tt>.
        </t>
      </section>
      <section>
        <name>Terminology</name>
        <t>
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 <xref target="RFC2119"/> <xref target="RFC8174"/> when, and only when, they appear in all capitals, as shown here.
        </t>
        <t>
The terms "Agent", "Application Data Model", "Externally Defined Data", "Variable", "Control", "Literal", "Macro", "Manager", "Report Template", "Report", "Table", "Constant", "Operator", "Time-Based Rule" and "State-Based Rule" are used without modification from the definitions provided in <xref target="I-D.ietf-dtn-amm"/>. 
      </t>
      </section>
    </section>
    <section>
      <name>Constraints and Assumptions</name>
      <t>
The desirable properties of an asynchronous management protocol, as specified in the DTNMA, are summarized here to represent design constraints on the AMP specification.
      </t>
      <dl>
        <dt>Intelligent Push of Information:</dt>
        <dd>
Nodes in a challenged network cannot guarantee concurrent, bi-directional communications.
Some links between nodes may be strictly unidirectional.
In the DTNMA, Agents "push" data to Managers rather than Managers "pulling" data from Agents. 
        </dd>
        <dt>Small Message Sizes:</dt>
        <dd>
Smaller messages require smaller periods of viable transmission for communication, incur less retransmission cost, and consume fewer resources when persistently stored en route in the network.
The AMP minimizes message size wherever practical, to include binary data  representations and predefined data definitions and templates.
        </dd>
        <dt>Static and Dynamic Identification:</dt>
        <dd>
All data in the system must be uniquely addressable, to include operator-specified information.
AMP provides a compact encoding for identifiers based on the Application Resource Identifier (ARI) of <xref target="I-D.ietf-dtn-ari"/>.
        </dd>
        <dt>Stateless Operation:</dt>
        <dd>
There is no reliable concept of session establishment or round-trip data exchange in challenged networks.
AMP is designed to be stateless and ADM controls are specified to be idempotent when executed.
Where helpful, AMP provides mechanisms for ordering of execution within a single AMP protocol data unit, but otherwise degrades gracefully when nodes in the network diverge in their configuration.
        </dd>
        <dt>Independence from ADMs:</dt>
        <dd>
Although some portions of the AMP structure share concepts and capabilities of AMM semantic types, the AMP operates independently from any specific ADMs or ODMs which would use the AMP for messaging between entities.
This avoids the need for an AMP processor to have information about those specific ADMs or ODMs, similarly to how the ARI syntax processing is independent from specific ADMs or ODMs.
The interpreting of ARIs, however, does require the use of specific referenced ADMs and ODMs.
        </dd>
      </dl>
      <t>
All AMP encodings are self-terminating, based on Concise Binary Object Representation (CBOR).
This means that, given an indefinite-length octet stream, each encoding can be unambiguously decoded from the stream without requiring additional information such as a length field separate from the data type definition.
CBOR also provides a layer of well-formed data coding separate from valid AMP structure coding.
      </t>
    </section>
    <section anchor="sec-msg">
      <name>Message Structure and Sequencing</name>
      <t>
The function of the AMP is to deliver Execution-Set (EXECSET) and Reporting-Set (RPTSET) values to a DTNMA Agent and a Manager respectively.
Together these support the needs described in <xref section="2.3" target="I-D.ietf-dtn-amm"/>.
      </t>
      <t>
Each AMP message consists of a version number followed by any number of binary form ARI values, as defined in <xref section="5" target="I-D.ietf-dtn-ari"/>.
All AMP messages conforming to this specification <bcp14>SHALL</bcp14> contain version number 1.
Any AMP messages received with an unknown version number <bcp14>SHALL</bcp14> be ignored.
      </t>
      <t>
Each of the contained ARIs <bcp14>SHALL</bcp14> be either an EXECSET or a RPTSET.
The EXECSET is used to communicate from Manager to Agent and cause execution activities within the Agent as defined in <xref target="sec-msg-execset"/>.
The RPTSET is used to communicate from Agent to Manager, which includes reports and (specific) execution results from the Agent, as defined in <xref target="sec-msg-rptset"/>.
      </t>
      <t>
Each AMP message has the following CDDL definition.
      </t>
      <sourcecode type="cddl">
amp-msg = [
  version: 1,
  *amp-ari
]
amp-ari = (lit-execset / lit-rptset) .within ari
      </sourcecode>
      <section anchor="sec-msg-execset">
        <name>Execution-Set Values</name>
        <t>
When received by an Agent, an EXECSET value <bcp14>SHALL</bcp14> result in immediate execution activities based on the message contents.
Each item in the target list <bcp14>SHALL</bcp14> be executed independently (<em>i.e.</em>, failures on one item do not affect other items).
Each item in the target list <bcp14>MAY</bcp14> be executed in any order or concurrently.
This is not the same behavior as execution of a macro (see <xref section="6.6.3" target="I-D.ietf-dtn-amm"/>), where execution of items is ordered and a failure of any execution causes subsequent items to not be executed.
        </t>
        <t>
When possible, Managers <bcp14>SHOULD</bcp14> coalesce multiple execution targets into a single EXECSET value.
This avoids the overhead of processing multiple messages on an Agent to cause multiple executions, but it does require that all or none of the executions are associated with a nonce value.
        </t>
        <aside>
          <t>
Because execution targets are supposed to be idempotent (see <xref section="3.4.5" target="I-D.ietf-dtn-amm"/>) there is no need to differentiate multiple targets with the same object-identity-and-parameters when using the same nonce.
          </t>
        </aside>
      </section>
      <section anchor="sec-msg-rptset">
        <name>Reporting-Set Values</name>
        <t>
When received by a Manager, each report within a RPTSET value <bcp14>SHALL</bcp14> be correlated to its ADM or ODM object used to interpret its source-specific data.
Each report in the Report List <bcp14>SHALL</bcp14> be processed independently (<em>i.e.</em>, failures on one report do not affect other items).
Each report in the Report List <bcp14>MAY</bcp14> be processed in any order or concurrently.
        </t>
        <t>
When associated to the same nonce value, Agents <bcp14>SHOULD</bcp14> coalesce multiple reports into a single RPTSET value.
The coalescing <bcp14>MAY</bcp14> be based on a time interval or an event (e.g. power-saving wake-up).
This avoids the overhead of processing multiple RPTSET values on a Manager and improves timestamp compression in the items, but it does require that all or none of the items are associated with the same nonce value.
        </t>
      </section>
    </section>
    <section anchor="sec-bp">
      <name>Bundle Protocol Transport</name>
      <t>
When embedded as block type-specific data (BTSD) within a BPv7 payload block in accordance with <xref target="RFC9171"/>, the application data unit (ADU) <bcp14>SHALL</bcp14> consist of an AMP message (see <xref target="sec-msg"/>) as a CBOR sequence.
The payload BTSD has the following CDDL definition.
      </t>
      <sourcecode type="cddl">
amp-adu = bstr .cborseq amp-msg
      </sourcecode>
      <t>
When Agents and Managers register endpoints on a BPA, they <bcp14>SHOULD</bcp14> use the well-known service numbers defined in <xref target="sec-iana-uri"/>.
Using well-known identifiers simplifies configuration and troubleshooting but is not necessary for correct AMP operation.
      </t>
      <t>
When BPv7 is used as transport for AMP, the primary and payload blocks <bcp14>SHALL</bcp14> be authenticated by a BPSec <xref target="RFC9172"/> mechanism traceable to the message source.
This can be either block integrity block (BIB) or block confidentiality block (BCB) using an authenticated encryption algorithm, either using an authenticated public key of the source directly or via some security association derived from an authenticated public key or from a security gateway and delegated for the bundle source.
It is an network policy and configuration issue to determine the correct use of BPSec for any particular Manager and Agent.
      </t>
      <t>
When processing an AMP ADU, the processing context <bcp14>SHALL</bcp14> include the following:
      </t>
      <ul>
        <li>The bundle Source Node ID</li>
        <li>An indication of the authenticity of the primary and payload blocks, along with the Security Source Node ID used to authenticate them</li>
      </ul>
    </section>
    <section anchor="sec-iana">
      <name>IANA Considerations</name>
      <t>
        This section provides guidance to the Internet Assigned Numbers Authority (IANA) regarding registration of schema and namespaces related to the Application Resource Identifier (ARI), in accordance with BCP 26 <xref target="RFC1155"/>.
      </t>
      <section anchor="sec-iana-uri">
        <name>URI Schemes</name>
        <t>
This document defines entries in the registry "'ipn' Scheme URI Well-known Service Numbers for BPv7" within the "URI Schemes" registry group <xref target="IANA-URI"/> containing the following.
        </t>
        <t>
          <cref>RFC Editor: The values for TBA1 and TBA2 below should be assigned from the range 128-255.</cref>
        </t>
        <table anchor="tab-iana-ipn-svc-num">
          <name>'ipn' Scheme URI Well-known Service Numbers for BPv7</name>
          <thead>
            <tr>
              <th>Value</th>
              <th>Description</th>
              <th>Reference</th>
            </tr>
          </thead>
          <tbody>
            <tr>
              <td>
                <cref>TBA1</cref>
              </td>
              <td>DTNMA Agent role</td>
              <td>[This document]</td>
            </tr>
            <tr>
              <td>
                <cref>TBA2</cref>
              </td>
              <td>DTNMA Manager role</td>
              <td>[This document]</td>
            </tr>
          </tbody>
        </table>
      </section>
    </section>
    <section anchor="sec-security">
      <name>Security Considerations</name>
      <t>
Security within the AMP exists in two distinct layers as follows:
      </t>
      <dl>
        <dt>Transport Security:</dt>
        <dd>
Transport security addresses the questions of authentication, integrity, and confidentiality associated with the transport of messages between Managers and Agents.
This security is applied before any particular entity in the system receives data and, therefore, its specifics are outside of the scope of this document.
The BP transport specified in <xref target="sec-bp"/> does require some authentication which covers the AMP payload, but details are network- and implementation-specific.
        </dd>
        <dt>Access Control:</dt>
        <dd>
Fine grained object-level security is provided and enforced by Agents via access control lists (ACLs) which are part of an Agent's configuration.
An Agent's ACLs could be managed via an ADM using AMP itself, but such details are also outside the scope of this document.
        </dd>
      </dl>
    </section>
  </middle>
  <back>
    <references>
      <name>References</name>
      <references>
        <name>Normative References</name>
        <reference anchor="IANA-URI" target="https://www.iana.org/assignments/uri-schemes/">
          <front>
            <title>Uniform Resource Identifier (URI) Schemes</title>
            <author>
              <organization>IANA</organization>
            </author>
            <date/>
          </front>
        </reference>
        <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml"/>
        <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.8174.xml"/>
        <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.9171.xml"/>
        <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.9172.xml"/>
        <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml3/reference.I-D.ietf-dtn-amm.xml"/>
        <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml3/reference.I-D.ietf-dtn-ari.xml"/>
      </references>
      <references>
        <name>Informative References</name>
        <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.1155.xml"/>
        <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.3411.xml"/>
        <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.6241.xml"/>
        <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.8040.xml"/>
        <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.8610.xml"/>
        <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.9675.xml"/>
        <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml3/reference.I-D.ietf-core-comi.xml"/>
      </references>
    </references>
    <section>
      <name>Example Messages</name>
      <t>
The examples in this section use the well-known organization "example" (65535) with a single model "adm-a" (1) for simplicity.
      </t>
      <t>
An example of an Execution-Set being sent to an Agent has the following ARI text representation (with newlines and spaces inserted for readability).
      </t>
      <sourcecode type="uri">
ari:/EXECSET/n=1234;(
    //example/adm-a/CTRL/dothing,
    //example/adm-a/CONST/amacro)
      </sourcecode>
      <t>
Assuming some enumeration values for the ADM and objects results in the following transformed ARI.
      </t>
      <sourcecode type="uri">
ari:/EXECSET/n=1234;(//65535/1/-3/18,//65535/1/-2/43)
      </sourcecode>
      <t>
This is embedded into an AMP message with the following CBOR sequence.
      </t>
      <sourcecode type="cborseq">
1,
[20, [1234, [65535, 1, -3, 18], [65535, 1, -2, 43]]]
      </sourcecode>
      <t>
Which is encoded to the following binary string.
      </t>
      <sourcecode type="cborhex">
0x018214831904D28419FFFF0122128419FFFF0121182B
      </sourcecode>
      <t>
An example of a corresponding Reporting-Set being sent to a Manager has the following ARI text representation (with newlines and spaces inserted for readability).
      </t>
      <sourcecode type="uri">
ari:/RPTSET/n=1234;r=/TP/20230102T030405Z;
    (t=/TD/PT0S;s=//example/adm-a/CTRL/dothing;(null))
    (t=/TD/PT5S;s=//example/adm-a/CTRL/other;(567))
      </sourcecode>
      <t>
Which results in the following transformed ARI (with newlines and spaces inserted for readability).
      </t>
      <sourcecode type="uri">
ari:/RPTSET/n=1234;r=/TP/725943845;
    (t=/TD/0;s=//65535/1/-3/18;(null))
    (t=/TD/5;s=//65535/1/-3/6;(567)))
      </sourcecode>
      <t>
This is embedded into an AMP message with the following CBOR sequence.
      </t>
      <sourcecode type="cborseq">
1,
[21, 1234, 725943845,
    [0, [65535, 1, -3, 18], null],
    [5, [65535, 1, -3, 6], 567]]
      </sourcecode>
      <t>
Which is encoded to the following binary string.
      </t>
      <sourcecode type="cborhex">
0x0185151904D21A2B45062583008419FFFF012212F683058419FFFF012206190237
      </sourcecode>
    </section>
    <section numbered="false" removeInRFC="true">
      <name>Implementation Notes</name>
      <t>
A reference implementation of an earlier revision of the AMP is available in the 3.6.2 release of the ION open source code base available from the <eref target="https://sourceforge.net/projects/ion-dtn/">ION-DTN</eref> Sourceforge project.
      </t>
      <t>
An extraction of the same AMP Agent and Manager from ION into a stand-alone project is available in the <eref target="https://github.com/JHUAPL/dtnma-tools">DTNMA Tools</eref> GitHub project.
This project also contains an updated Wireshark <eref target="https://github.com/JHUAPL/dtnma-tools/tree/main/wireshark">AMP dissector</eref> for the corresponding earlier revision of this draft.
      </t>
      <t/>
    </section>
    <section anchor="contr" numbered="false">
      <name>Acknowledgments</name>
      <t>
The following participants contributed technical material, use cases, and useful thoughts on the overall approach to this protocol specification: Jeremy Pierce-Mayer of INSYEN AG contributed the concept of the typed data collection and early type checking in the protocol. 
David Linko and Evana DiPietro of the Johns Hopkins University Applied Physics Laboratory contributed appreciated review and type checking of various elements of this specification.
      </t>
    </section>
  </back>
</rfc>
