<?xml version="1.0" encoding="us-ascii"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd"[
<!ENTITY RFC6256 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.6256.xml">
<!ENTITY RFC4838 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.4838.xml">
<!ENTITY RFC2119 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml">
<!ENTITY RFC5050 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.5050.xml">
<!ENTITY RFC6257 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.6257.xml">
]>
<?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>
<?rfc strict="yes" ?>
<?rfc toc="yes"?>
<?rfc tocdep"4"?>
<?rfc symrefs="yes"?>
<?rfc sortrefs="yes" ?>
<?rfc compact="no" ?>
<?rfc subcompact="no" ?>


   
 <rfc category="exp" ipr="trust200902" docName="draft-birrane-dtn-amp-03" obsoletes="" updates="" submissionType="IETF" xml:lang="en">

   <!-- ***** 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="AMP">Asynchronous Management Protocol</title>
      <author fullname="Edward J. Birrane" initials="E.B." surname="Birrane">
         <organization>
            Johns Hopkins Applied Physics Laboratory
         </organization>
         <address>
         <email>Edward.Birrane@jhuapl.edu</email>
         </address>
      </author>
      
      <author fullname="Jeremy Pierce-Mayer" initials="J.P." surname="Mayer">
         <organization>INSYEN AG</organization>

         <address>
           <postal>
             <street>M&uuml;nchner Str. 20</street>
             <city>Oberpfaffenhofen</city>
             <region>Bavaria</region>
             <code>DE</code>
             <country>Germany</country>
           </postal>
           <phone>+49 08153 28 2774</phone>
           <facsimile/>
           <email>jeremy.mayer@insyen.com</email>
           <uri/>
         </address>
      </author>

      <date year="2016" />

      <!-- Meta-data Declarations -->
      <area>General</area>
      <workgroup>Delay-Tolerant Networking</workgroup>
      <keyword>DTN</keyword>
      <keyword>Network Management</keyword>
      <keyword>Delay-Tolerant Network Management</keyword>
      <!-- Keywords will be incorporated into HTML output
           files in a meta tag but they have no effect on text or nroff
         output. If you submit your draft to the RFC Editor, the
         keywords will be used for the search engine. -->

      <abstract>
         <t>
            This document describes an Asynchronous Management Protocol (AMP)
            in conformance with the Asynchronous Management Architecture (AMA). The
            AMP provides monitoring and configuration services between managing 
            devices (Managers) and managed devices (Agents), some of which may 
            operate on the far side of high-delay or high-disruption links. The 
            AMP reduces the number of transmitted bytes, operates without 
            sessions or (concurrent) two-way links, and functions autonomously 
            when there is no timely contact with a network operator. The AMP
            accomplishes this without requiring mobile code. 
         </t>
      </abstract>
   </front>
  
   <middle>
      <section title="Introduction" toc="default">
         <t>
            This document specifies an Asynchronous Management Protocol (AMP)
            that provides application-layer network management service
            conformant to the Asynchronous Management Architecture  
            <xref target="AMA"/>. 
         </t>
      
      <section title="Overview" toc="default">
         <t>
            Network management protocols define the messages that implement
            management functions amongst managed and managing devices in a 
            network. These functions include the definition, production, and
            reporting of performance data, the application of administrative 
            policy, and the configuration of behavior based on 
            time and state measurements.
         </t>
         
         <t>
            Networks whose communication links are frequently challenged by
            physical or administrative effects cannot guarantee the low-latency, duplex data communications necessary
            to support sessions and other synchronous communication. For such
            networks, a new protocol is required which
            provides familiar network management services in the absence of
            sessions and operator-in-the-loop control.
         </t>
         
         <t>
            AMP accomplishes the network management function using open-loop,
            intelligent-push, asynchronous mechanisms that better scale as link
            challenges scale. The protocol is designed to support several
            desirable properties outlined in 
            <xref target="AMA" pageno="false" format="default" />
            and briefly listed below.           
           
            <list hangIndent="8" style="symbols">
               <t> 
                  Intelligent Push of Information - The intelligent push of 
                  information eliminates the need for round-trip data exchange. 
                  This is a necessary consequence of operating in an open-loop 
                  system. AMP is designed to operate even in networks of
                  solely unidirectional links.
               </t>
               <t>
                  Small Message Sizes - Smaller messages require smaller 
                  periods of viable transmission for communication,
                  incur less retransmission cost, and consume fewer resources when
                  persistently stored enroute in the network. AMP minimizes the
                  size of a message whenever practical, to include packing and
                  unpacking binary data, variable-length fields, and pre-configured
                  data definitions.
               </t>
               <t>
                  Absolute and Custom Data Identification - Fine-grained 
                  identification allows data in the system to be
                  explicitly addressed while flexible data identification allows
                  users to define their own customized, addressed data collections.
                  In both cases, the ability to define precisely the data required
                  removes the need to query and transmit large data sets only to
                  filter/downselect desired data at a receiving device.
               </t>
               <t> 
                  Autonomous, Stateless Operation - AMP does not rely
                  on session establishment or round-trip data exchange to perform
                  network management functions. Wherever possible, the AMP is 
                  designed to be stateless.  Where state is required, the AMP
                  provides mechanisms to support transactions and graceful degradation
                  when nodes in the network fail to synchronize on common definitions. 
               </t>
               <t> 
                  Compatibility with Low-Latency Network Management Protocols - 
                  AMP adopts an identifier approach compatible with the Managed
                  Information Base (MIB) format used by Internet management
                  protocols such as the Simple Network Management Protocol (SNMP),
                  thus enabling management interfaces between challenged 
                  networks and unchallenged networks (such as the Internet). 
               </t>
            </list>
         </t>
      </section>
      
      <section title="Technical Notes" toc="default" anchor="tech_notes">
         <t>
            <list style="symbols">
               <t>
                  Multi-byte values in this specification are expected to
                  be transmitted in network byte order (Big Endian).
               </t>
               <t>
                  Character encodings for all text-based data types will use UTF-8
                  encodings. 
               </t>
               <t>
                  All data types defined by the AMP are self-terminating. This means
                  that, given an indefinite-length octet stream, each data type can 
                  be unambiguously decoded from the stream without requiring additional
                  information such as a length field separate from the data type definition.
               </t>
               <t>
                  Bit-fields in this document are specified with bit position 0 holding 
                  the least-significant bit (LSB). When illustrated in this document, the LSB
                  appears on the right.
               </t>
               <t>
                  Illustrations of fields in this specification consist
                  of the name of the field, the type of the field between
                  []'s, and if the field is optional, the text "(opt)". An
                  example is shown in <xref target="ex_fig"/> below.
                  In this illustration two fields (Field 1 and Field 2) are shown,
                  with Field 1 of Type 1 and Field 2 of Type 2.  Field 2 is also
                  listed as being optional. Byte fields are shown in order of 
                  receipt, from left-to-right. Therefore, when transmitted on 
                  the wire, Field 1 will be received first, followed by Field 2 (if
                  present). 
                  
                  <figure anchor="ex_fig" title="Byte Field Formatting Example" suppress-title="false" alt="" width="" height="">
                     <artwork align="center">
+----------+----------+
| Field 1  | Field 2  |
| [TYPE 1] | [TYPE 2] |
|          |  (opt)   |                        
+----------+----------+                        
                     </artwork>
                  </figure>   
              </t>
           </list>
        </t>
      </section>
      
      <section title="Scope" toc="default">
         <section title="Protocol Scope" toc="default">
            <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 protocols used to carry AMP messages provide
               addressing, confidentiality, integrity, security, fragmentation support
               and other network/session layer functions. Therefore, these items are outside
               of the scope of this protocol. 
            </t>
         </section>
         <section title="Specification Scope" toc="default">
            <t>
               This document describes the format of the AMP messages exchanged
               amongst managing and managed devices in a challenged network.
               This document further describes the rationale behind key design
               decisions to the extent that such a description informs the
               operational deployment and configuration of an AMP implementation.
               This document does not address specific data configurations of
               AMP-enabled devices, nor does it discuss the interface between AMP
               and other management protocols, such as SNMP. 
            </t>
         </section>
      </section>
      
      <section title="Requirements Language" toc="default">
         <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 
            <xref target="RFC2119"/>.
         </t>
      </section>
   </section>
   
   <section title="Terminology" toc="default">
      <t>
         Note: The terms "Actor", "Agent", "Application Data Model", "Atomic Data",
         "Computed Data", "Control", "Literal", "Macro", "Manager", "Report Template", 
         "Report Entry", and "Rule" are used without modification from the definitions
         provided in <xref target="AMA"/>. 
      </t>
      <t>
         Additional terms critical to understanding the
         proper operation of the AMP are as follows.  
          
         <list hangIndent="8" style="symbols">
            <t>
               Managed Item Definition (MID) - A parameterized structure used 
               to uniquely identify all data and control definitions within the 
               AMP. MIDs are a super-set of Object Identifiers (OIDs) and the 
               mechanism by which the AMP maintains data compatibility with 
               other management protocols. MIDs are defined in <xref target="mid_chp"/>.
            </t>
            <t>
               Report (RPT) - An ordered collection of report entries gathered by an Agent 
               and provided to one or more Managers. Reports represent the fundamental unit
               of data exchange from an Agent to a Manager within the AMP. Report messages
            	are defined in <xref target="rpt_msg_def"/>. 
            </t>
            <t>
               State-Based Rule (SRL) - A rule in the AMP whose action is performed if a
               defined predicate evaluates to true. SRLs are defined in <xref target="srl_chp"/>.
            </t>
            <t>
               Time-Based Rule (TRL) - A rule in the AMP whose action is performed at regular
               intervals. SRLs are defined in <xref target="trl_chp"/>.
            </t>
         </list>
      </t>
   </section>

   <section title="Data Model" toc="default">
      <t>
         This section identifies the data types used to capture information
         within the AMP.
      </t>
   
      <section title="Primitive Types" toc="default">
         <t>
            Primitive types are those that are not comprised of any other set of
            types known to the AMP. 
         </t>
         
         <section title="Standard Numeric Types" toc="default">
            <t>
               The AMP supports types for unsigned bytes, 32/64-bit signed 
               and unsigned integers, 32/64-bit floating point values, and
               strings, as outlined in <xref target="std_types"/>.
            </t>
            
            <texttable anchor="std_types" title="Standard Numeric Types" suppress-title="false" align="center" style="full">
               <ttcol align="center" width="20%">AMP Type</ttcol>
               <ttcol align="center" width="20%">Bit Width</ttcol>
               <ttcol align="center" width="80%">Description</ttcol>
            
               <c>BYTE</c>
               <c>8</c>
               <c>unsigned byte value</c>
            
               <c>INT</c>
               <c>32</c>
               <c>Signed integer in 2's complement</c>

               <c>UINT</c>
               <c>32</c>
               <c>Unsigned integer in 2's complement</c>

               <c>VAST</c>
               <c>64</c>
               <c>Signed integer in 2's complement</c>

               <c>UVAST</c>
               <c>64</c>
               <c>Unsigned integer in 2's complement</c>

               <c>REAL32</c>
               <c>32</c>
               <c>Single-precision, 32-bit floating point value in IEEE-754 format.</c>

               <c>REAL64</c>
               <c>64</c>
               <c>Double-precision, 64-bit floating point value in IEEE-754 format.</c>

               <c>STR</c>
               <c>Varies</c>
               <c>NULL-terminated series of characters in UTF-8 format.</c>
               
            </texttable>            
         </section>
        
         <section title="Self-Delimiting Numeric Value (SDNV)" toc="default">
            <t> 
               The data type "SDNV" refers to a Self-Delimiting Numerical Value 
               (SDNV) described in <xref target="RFC6256"/>. 
               SDNVs are used in the AMP to capture any data items that are 
               expected to be 8 bytes or less in total length.  AMP Actors 
               MAY reject any value encoded in an SDNV that is greater than 8 
               bytes in length.
            </t>
            <t>
               One popular use of SDNVs in the AMP is to compress the 
               representation of 32/64-bit integer values. This simplifies the
               AMP by not having to additionally support 8/16-bit versions of
               integers without incurring significant transmission waste when
               encoding small numbers into 32/64-bit representations.
            </t>
         </section>
        
         <section title="Timestamp (TS)" toc="default">
            <t>
               A timestamp value can represent either a relative or absolute
               time within the AMP.  An AMP relative time is defined as the
               number of seconds between two AMP events (such as the receipt
               of a control by an agent and the execution of that control). 
               An AMP absolute time is defined as UTC time using the Unix/POSIX Epoch. 
            </t>
            <t>
               Since timestamps are a common component in AMP messages and controls,
               they should be made as small as possible. Therefore, timestamps in
               AMP do not add a special flag to determine whether the given time is
               an absolute or relative time. Instead, AMP defines a simple formula to 
               unambiguously determine the type of time represented without increasing
               the overall size of a timestamp.
            </t>
            <t>               
               AMP uses September 9th, 2012 as the timestamp epoch (UTC time 1347148800). 
               Times less than this value MUST be considered a relative time. 
               Values greater than or equal to this epoch MUST be considered as 
               absolute times. In all cases, the AMP timestamp is encoded as 
               an SDNV to avoid the 32-bit 2038 UTC rollover problem. 
            </t>
            <t>
               The absolute time associated with a timestamp can be calculated 
               unambiguously with the following pseudocode.
               <figure><artwork><![CDATA[  
        IF (timestamp < 1347148800) THEN 
           absolute_time = current_time + timestamp
        ELSE 
           absolute_time = timestamp              
]]>
               </artwork></figure>
            </t>            
         </section>
      </section>
        
      
      <section title="Compound Types" toc="default">
         <t>
            Compound types are data types defined as an aggregation of other data types.
         </t>
         <section title="Binary Large Object (BLOB)" toc="default">
            <t>
               A Binary Large Object (BLOB) is an ordered collection of bytes 
               prefaced by the number of bytes making up the BLOB. The format of 
               a BLOB is illustrated in <xref target="blob_fig"/>. 
               BLOBs are used in the AMP to capture variable data sets that are 
               too large to efficiently store in an SDNV. 
               
               <figure align="center" anchor="blob_fig" title="Binary Large Object Format">
                  <preamble>Binary Large Object Format</preamble>
                  <artwork align="center" xml:space="preserve">
+---------+--------+--------+     +--------+
| # Bytes | BYTE 1 | BYTE 2 | ... | BYTE N |
|  [SDNV] | [BYTE] | [BYTE] |     | [BYTE] |
+---------+--------+--------+     +--------+
                  </artwork>
               </figure>
            </t>
         </section>

         <section title="Data Collection (DC)" toc="default">
            <t>
               A Data Collection (DC) is an ordered set of BLOBs, prefaced by the
               number of BLOBs making up the collection. The format of a DC
               is illustrated in <xref target="dc_fig"/>. 
               
               <figure align="center" anchor="dc_fig" title="Data Collection Format">
                  <preamble>Data Collection</preamble>
                  <artwork align="center" xml:space="preserve">
+---------+--------+--------+     +--------+
| # BLOBs | BLOB 1 | BLOB 2 | ... | BLOB N |
|  [SDNV] | [BLOB] | [BLOB] |     | [BLOB] |
+---------+--------+--------+     +--------+
                  </artwork>
               </figure>
            </t>
         </section>
                  
                                    

         <section title="Typed Data Collection (TDC)" toc="default">
            <t>
               The Typed Data Collection (TDC) is a special kind of DC which encodes
               type information as the first BLOB in the collection. The TDC data type 
               is used to capture typical "TLV" (type, length, value) information in
               the AMP. 
            </t>
            
            <t>
               The TDC format is illustrated in <xref target="tdc_fig" pageno="false" format="default" />
               
               <figure align="center" anchor="tdc_fig" title="Typed Data Collection Format">
                  <preamble>Typed Data Collection</preamble>
                  <artwork align="center" xml:space="preserve">
+---------+-----------+-------------+     +-------------+
| # BLOBs | Type BLOB | Data BLOB 1 | ... | Data BLOB N |
|  [SDNV] |   [BLOB]  |   [BLOB]    |     |    [BLOB]   |
+---------+-----------+-------------+     +-------------+
                  </artwork>
               </figure>              
            </t>
        
            <t>
               The TDC fields are defined as follows.
            
               <list hangIndent="8" style="hanging">
                  <t hangText="# BLOBs"><vspace blankLines="0" /> 
                     This represents the number of BLOBS that comprise the TDC. Since the
                     TDC has one BLOB for each data item in the collection, plus one additional
                     BLOB for type information, the # BLOBs value MUST be equal to one more than the
                     number of data items in the collection. 
                  </t>
                  <t hangText="Type BLOB"><vspace blankLines="0" />
                    Each BYTE in the Type BLOB represents a type enumeration of a corresponding Data BLOB.
                     For example, the 3rd BYTE in the Type BLOB holds the type enumeration of the 3rd
                     Data BLOB in the TDC. Since there is exactly 1 byte per data item in the
                     Type BLOB, the overall size of this BLOB MUST be the total number of
                     data items in the TDC.
                  </t> 
                  <t hangText="Data BLOB"><vspace blankLines="0" />
                     The Nth Data BLOB holds the Nth data value in the collection.
                  </t> 
               </list>                                    
            </t>
                
            <t>
               For example, consider the following set of data values:
               {(UINT) 3, (REAL32) 3.14, (STR) "pi"}. The corresponding 
               TDC would have 4 BLOBs. BLOB 1 would have length 3 and contain
               the enumerations for UINT, REAL32, and STR - encoded in one
               BYTE each. BLOBs 2, 3, and 4 would hold the original data. This example 
               is illustrated in 
               <xref target="tdc_ex" pageno="false" format="default" />.
                  
               <figure align="center" anchor="tdc_ex" title="Typed Data Collection Example" suppress-title="false" >
                  <preamble>Typed Data Collection Example</preamble>
                  <artwork align="center" xml:space="preserve">

     Data Set                                       TDC
+---------------+           +---------------------------------+
| # Items = 3   |           | # BLOBs = {4}                   |
+---------------+           +---------------------------------+
| (UINT)   3    |--------+  | TYPE BLOB = {UINT, REAL32, STR} |
+---------------+        |  +---------------------------------+
| (REAL32) 3.14 |-----+  +-&gt;| DATA BLOB 1 = {3}               |
+---------------+     |     +---------------------------------+
| (STR)    "pi" |--+  +----&gt;| DATA BLOB 2 = {3.14}            |
+---------------+  |        +---------------------------------+
                   +-------&gt;| DATA BLOB 3 = {"pi"}            |
                            +---------------------------------+
                  </artwork>
               </figure>              
            </t> 
            <t>
               The rationale for extracting data type information into a Type BLOB
               and placing that BLOB at the beginning of the TDC is to enable
               faster performance for type validators. With the Type BLOB, a validator can inspect 
               one BLOB to ensure that the elements within the TDC match the expected type
               specifications. Without a Type BLOB, type information
               would need to be interspersed with data values throughout the TDC. In 
               that case, a type validator would need to scan through the entire set of
               bytes comprising the TDC looking for type information. This would significantly
               alter the speed of type checking in the AMP.
            </t>
            <t>
               The rationale for placing data values directly in a Data BLOB is to
               enable rapid navigation. As mentioned in <xref target="tech_notes"/>,
               every data type defined in the AMP is deterministic in length. However,
               this determination may require deep inspection of the data in cases
               of variable-length headers and optional fields. By placing the data value
               in a Data BLOB, the length of the value may be asserted to allow a
               data parser to rapidly calculate the position of data item N in the
               TDC. The redundancy of storing a pre-calculated length for each data
               value when the data value length can be calculated from the data itself
               is a processing tradeoff made by AMP given the relative frequency with
               which the TDC is used to communicate Report and Control parameters. 
            </t>
         </section>

         <section title="Table (TBL)" toc="default">
            <t>
               A TBL is a names, typed, collection of tabular data with each row 
               represented as a DC and each column defined by both a column name
               and a column type. Each row in the TBL MUST have the same length and
               the ith BLOB of each row DC MUST correspond to the ith column in the table.   
            </t>
            
            <t>
               The TBL format is illustrated in <xref target="table_fig" pageno="false" format="default" />
               
               <figure align="center" anchor="table_fig" title="Table Format">
                  <preamble>Table</preamble>
                  <artwork align="center" xml:space="preserve">
                     
+-----------+-----------+--------+-------+     +-------+
| Col Names | Col Types | # Rows | Row 1 |     | Row N |
|   [DC]    |  [BLOB]   | [SDNV] | [DC]  | ... |  [DC] |
+-----------+-----------+--------+-------+     +-------+
                                          
                  </artwork>
               </figure>              
            </t>
        
            <t>
               The TBL fields are defined as follows.
            
               <list hangIndent="8" style="hanging">
                  <t hangText="Col Names"><vspace blankLines="0" /> 
                     Column names are captured as a DC with the ith entry in the DC representing
                     the name of the ith column.  This DC MUST have a number of entries equal to the
                     number of columns in the table. Each entry in the DC is considered to be
                     of type STR. 
                  	<vspace/>
                  	NOTE: It is being considered to make this field a TDC instead of a DC to
                  	allow individual Col Names to be of different data types, instead of making
                  	them always be strings.                  	
                  </t>
                  <t hangText="Col Types"><vspace blankLines="0" />
                    Similar to the Type BLOB of the TDC, the Col Types BLOB contains one BYTE for
                     each column in the TBL and this BYTE holds the type enumeration for the column.
                     Therefore, the Col Types BLOB MUST have a length equal to the number of columns
                     in the table and each BYTE in the BLOB MUST contain a correct enumeration of an AMP
                     type. This field MUST contain one of the AMP data structure enumerations
                     identified in <xref target="type_enum"/>.
                  </t> 
                  <t hangText="# Rows"><vspace blankLines="0" />
                     This field captures the number of rows in the TBL.  If the number of rows in the
                     TBL is set to 0, that indicates there is no additional data after this
                     field.
                  </t> 
                  <t hangText="Row 1 .. Row N"><vspace blankLines="0" />
                     Each row in the TBL is represented by a DC, with the ith BLOB in the DC representing
                     the data in the ith column of the TBL. Each row DC MUST have a number of BLOBs equal
                     to the number of columns. 
                  </t> 
               </list>                                    
            </t>
                
            <t>
               The Figure below illustrates a table of data relating to months of the year on the left
               and the corresponding populated TBL structure for this table on the right.
               
               	<figure align="center" anchor="table_fig2" title="Table Example">
               	                  
                  <artwork align="center" xml:space="preserve">

                                 +--------------------------------------+                     
+-----+------+------+     +-----&gt;| Col Names DC = {"Month","Ord","Days"}|
|Month| Ord  | Days |-----+      +--------------------------------------+ 
|(STR)|(UINT)|(UINT)|-----------&gt;| Col Types BLOB = {STR, UINT, UINT}   |
+-----+------+------+            +--------------------------------------+
|Jan  |   1  |  31  |--------+   | Num Rows = 3                         |
+-----+------+------+        |   +--------------------------------------+  
|Oct  |  10  |  31  |-----+  +--&gt;| Row 1 DC = {"Jan", 1, 31}            |              
+-----+------+------+     |      +--------------------------------------+
|June |  6   |  30  |--+  +-----&gt;| Row 2 DC = {"Oct", 10, 31}           |
+-----+------+------+  |         +--------------------------------------+
                       +--------&gt;| Row 3 DC = {"June", 6, 30}           |
                                 +--------------------------------------+
                  </artwork>
                  </figure>
           </t>                                    
         </section>
                  
      </section>

               
      <section title="Managed Identifiers (MIDs)" anchor="mid_chp" toc="default">
         <t>
            Structures defined and exchanged within
            the AMP must be uniquely identifiable both within a network and 
            (when AMP is used in an overlay) across networks. This section 
            describes the "Managed Identifier" (MID) used to provide unique naming for the AMP structures
            defined in <xref target="amp_struct"/>. The MID is a variable-length 
            structure with optional fields.
         </t>

         <t>
            The unique identifier at the core of a MID is based on the Object Identifier
            (OID) and its Basic Encoding Rules (BER) as identified in the 
            ITU-T X.690 standard. The use of OIDs in the MID structure allows
            Agents and Managers to interface with other management
            schemes (such as SNMP) at management boundaries between challenged
            and unchallenged networks. 
         </t>  
         
         <t>
            The MID consists of a mandatory flag BYTE, a mandatory OID, 
            and optional annotations to assist with filtering, access control, and parameterization. 
            The MID structure is illustrated in <xref target="mid_fig"/>.
           </t>
           
         <figure align="center" anchor="mid_fig" title="Managed Identifier Format">
            <preamble>MID format</preamble>
            <artwork align="center" xml:space="preserve">
+--------+--------+--------+--------+
| Flags  | Issuer |   OID  |  Tag   |
| [BYTE] | [SDNV] |[VARIED]| [SDNV] |
|        | (opt)  |        | (opt)  |
+--------+--------+--------+--------+
            </artwork>
         </figure>
         
         <t>
            The MID fields are defined as follows.
            
            <list hangIndent="8" style="hanging">
               <t hangText="Flags"><vspace blankLines="0" /> 
                  Flags are used to describe the type of structure identified 
                  by the MID, identify which optional fields in the MID are 
                  present, and the encoding used to capture the component's OID. 
                  The layout of the flag byte is illustrated in <xref target="mid_flag" pageno="false" format="default" />.
              
                  <figure align="center" anchor="mid_flag" title="" suppress-title="false">
                     <preamble>MID Flag Format</preamble>
                     <artwork align="center" xml:space="preserve">
+-----+---+---+------------+
| OID |TAG|ISS| STRUCT ID  |
+-----+---+---+------------+
| 7 6 | 5 | 4 | 3  2  1  0 |
+-----+---+---+------------+
 MSB                    LSB                       
                     </artwork>
                  </figure>
                  
                  <list hangIndent="8" style="hanging">
                     <t hangText="STRUCT ID"><vspace blankLines="0" /> 
                        The lower nibble of the MID flag identifies the kind of data structure being identified
                        by this identifier.  This field MUST contain one of the AMP data structure enumerations
                        identified in <xref target="type_enum"/>.
                     </t>
                     <t hangText="Issuer Present (ISS)"><vspace blankLines="0" /> 
                        Whether the issuer field is present (1) or not (0) for 
                        this MID. If this flag has a value of 1 then the issuer 
                        field MUST be present in the MID. Otherwise, the issuer 
                        field MUST NOT be present in the MID.
                     </t>
                     <t hangText="Tag Present (TAG)"><vspace blankLines="0" /> 
                        Whether the tag field is present (1) or not (0) for this 
                        MID. If this flag has a value of 1 then the tag field 
                        MUST be present in the MID. Otherwise, the tag field 
                        MUST NOT be present.
                     </t>
                     <t hangText="OID Type (OID)"><vspace blankLines="0" /> 
                        Whether the contained OID field represents a full OID 
                        (0), a parameterized OID (1), a compressed full OID (2), 
                        or a compressed, parameterized OID (3).  
                     </t>
                  </list>
               </t>
               
               <t hangText="Issuer"><vspace blankLines="0" /> 
                  This is a binary identifier representing a predetermined 
                  issuer name. The AMP protocol does not parse or validate this 
                  identifier, using it only as a distinguishing bit pattern to 
                  ensure MID uniqueness. This value, for example, may come from 
                  a global registry of organizations, an issuing node address, 
                  or some other network-unique marking. The issuer field MUST NOT
                  be present for any MID defined as part of an ADM.
               </t>
               
               <t hangText="OID"><vspace blankLines="0" /> 
                  The core of a MID is its encapsulated OID. Aside from the 
                  flag byte, this is the only other mandatory element within a 
                  MID. The AMP defines four types of OID references: Full OIDs,
                  Parameterized OIDs, Compressed Full OIDs, and Compressed
                  Parameterized OIDs, which are defined as follows. 
                  
                  <list hangIndent="8" style="hanging">
                     <t hangText="Full OID"><vspace blankLines="0" />
                        This is a binary representation of the full OID associated 
                        with the named value. The OID is encoded using a modified 
                        form of the ASN.1 Basic Encoding Rules (BER) for Object 
                        Identifiers (type value of 0x06). In the standard ASN.1 
                        encoding, four octet sets are defined: identifier octets, 
                        length octets, contents octets, and end-of-contents octets.  
                        An AMP Full OID does not use the identifier, length, or 
                        end-of-contents octets. Instead, an AMP Full OID is 
                        comprised of two fields: the length in bytes of the 
                        encoded OID followed by the OID contents octets. It
                        should be noted that this matches, exactly, the definition
                        of the BLOB type. The Full OID
                        format is illustrated in 
                        <xref target="full_oid_fmt" pageno="false" format="default" />.
                
                        <figure align="center" anchor="full_oid_fmt" title="Full OID Format" suppress-title="false">
                           <artwork align="center" xml:space="preserve">
                  +----------+
                  | Full OID |
                  | [BLOB]   |
                  +----++----+                              
                       ||
                       ||
 _____________________/  \_________________________
/                                                  \
 +------------+---------+---------+     +---------+
 | OID Length | Octet 1 | Octet 2 | ... | Octet N |
 |   [SDNV]   | [BYTE]  |  [BYTE] |     |  [BYTE] | 
 +------------+---------+---------+     +---------+
                           </artwork>
                        </figure>
                     </t>
                     
                     <t hangText="Parameterized OID"><vspace blankLines="0" />
                        The parameterized OID is represented as a Full OID 
                        followed by one or 
                        more parameters. Parameterized OIDs are used to 
                        templatize the specification of data items and
                        otherwise provide parameters to Controls without requiring
                        potentially unmanageable growth of a Full OID namespace. The
                        format of a parameterized OID is given in 
                        <xref target="parm_oid_fmt" pageno="false" format="default" />. 
                           
                        <figure align="center" anchor="parm_oid_fmt" title="Parameterized OID Format" suppress-title="false">
                           <artwork align="center" xml:space="preserve">
    +----------+------------+ 
    | FULL OID | Parameters | 
    |  [BLOB]  |   [TDC]    | 
    +----------+-----++-----+ 
                     ||
                     ||
  __________________/  \____________________________________                                                                                     
 /                                                          \
  +----------+------------+--------+--------+     +--------+ 
  | # Params | Parm Types | Parm 1 | Parm 2 |     | Parm N | 
  |  [SDNV]  |   [BLOB]   | [BLOB] | [BLOB] | ... | [BLOB] | 
  +----------+------------+--------+--------+     +--------+ 
                              
                           </artwork>
                        </figure>
                     </t>
                     
                     <t hangText="Compressed OID"><vspace blankLines="0" />
                        Since many related OIDs share a common and lengthy 
                        hierarchy there is opportunity for significant message 
                        size savings by defining a shorthand for commonly-used 
                        portions of the OID tree. A partial OID is a tuple 
                        consisting of a nickname for a pre-defined portion of
                        the OID tree, followed by a relative OID. Nicknames are
                     	defined in <xref target="nn_chp"/>. The format of a compressed OID is 
                        given in 
                        <xref target="comp_oid_fmt" pageno="false" format="default" />. 
                           
                        <figure align="center" anchor="comp_oid_fmt" title="Compressed OID Format" suppress-title="false">
                           <artwork align="center" xml:space="preserve">
+----------+--------------+ 
| Nickname | Relative OID | 
|  [SDNV]  |    [BLOB]    | 
+----------+--------------+ 
                           </artwork>
                        </figure>
                     </t>
                     
                     <t hangText="Compressed Parameterized OID"><vspace blankLines="0" />
                        A compressed, parameterized OID is similar to a compressed OID.
                        In this instance, the tuple contained in this field is the
                        nickname for the pre-defined portion of the OID tree (as an
                        SDNV) followed by a parameterized OID whose hierarchy begins
                        at the place identified by the nickname. The format of a 
                        compressed OID is given in 
                        <xref target="comp_parm_oid_fmt" pageno="false" format="default" />. 
                           
                        <figure align="center" anchor="comp_parm_oid_fmt" title="Compressed Parameterized OID Format" suppress-title="false">
                           <preamble>Compressed Parameterized OID Format</preamble>
                           <artwork align="center" xml:space="preserve">
+----------+--------------+------------+
| Nickname | Relative OID | Parameters |
|  [SDNV]  |   [BLOB]     |   [TDC]    |   
+----------+--------------+------------+
                           </artwork>
                        </figure>
                     </t>
                     
                     
                  </list>
               </t>
               
               <t hangText="Tag"><vspace blankLines="0" /> 
                  A value used to disambiguate multiple MIDs with the same 
                  OID/Issuer combination. The definition of the tag is left to 
                  the discretion of the MID issuer. Options for tag values include 
                     an issuer-known
                  version number or a hashing of the data associated with the
                  MID. The tag field MUST NOT be present for any
                  MID defined as part of an ADM.
               </t>
            </list>
         </t>
      </section>

      <section title="Nicknames" anchor="nn_chp" toc="default">
         <t>
            There are several strategies for reducing the overall size of an
            OID in an operational system. The AMP method for OID size reduction
            is to publish global enumerations that represent strategic nodes in
            an OID tree. This published, global enumeration is called a Nickname. 
         </t>
         <t>
            As mentioned in the discussion of compressed OIDs above, a nickname
            is used in lieu of a portion of the OID tree. ADMs may define their own
            nicknames so long as their definitions do not conflict with the
            definitions of nicknames in other ADMs. AMP does not provide the ability to assign
            nicknames dynamically. 
         </t>
         <t>
            Like other numeric types, nicknames are encoded as SDNVs allowing them to
            be of arbitrary length. For example, 3 bytes of SDNV can 
            encode over 2 million nicknames. Assuming ADMs are allotted 10
            nicknames each, this approach can accommodate over 200,000 ADMs before
            requiring a 4th byte for nickname information.
         </t>
         <t>
            Additionally, since nicknames are globally unique, neither an
            AMP Agent or Manager is ever required to expand a compressed OID to
            assert uniqueness or perform other identification. It is recommended
            that compressed OIDs be used whenever possible. 
         </t>
      </section>
            
      <section title="Parameters" toc="default">
         <t>
            Parameterized OIDs provide a powerful mechanism for customizing
            behavior for certain AMP structures. Parameterized values in AMP are 
         	formally defined in ADMs with a well-known, static typing.          	
         	When an ADM specifies that
         	an identified AMP structure may be parameterized, the specification MUST
         	list the number of expected parameters and the type associated with each
         	parameter. When a particular instance of a parameterized AMP structure is
         	generated by an Agent or a Manager, the MID identifying that instance
         	MUST contain a parameterized OID and the parameters associated with the
         	OID MUST match in number and type the specification. 
		 </t>         	
		 
         <section title="Optional Parameters">
         	<t>
         		When parameterizing an AMP structure, some parameters may be optional with
         		default values defined if parameters are omitted.  The use of optional 
         		parameters helps keep MID values small when using default values for
         		parameters is a common case, rather than forcing all parameters to be
         		provided all the time.  
         	</t>
         	<t>
         		Since each individual parameter in a TDC is represented as a BLOB, a parameter
         		can be omitted by specifying a length of 0 BYTES for the Data BLOB holding
         		the parameter. If a parameter is omitted and is not considered optional by the
         		parameterized AMP structure, this MUST be considered an error.
         	</t>
         </section>   
         
         <section title="Parameter Evaluation">
            <t>
               The type value
               associated with the TDC in a parameter list is only used to provide type-checking
               safety to ensure that the given parameters match expected parameter types. It
               is important to understand that the types in the parameter TDC DO NOT define
               the parameterized interface - only the ADM defines the typed interface. 
		    </t>
		    <t>
               Parameters within the TDC may be represented in one of two ways: 
               the parameter itself (parameter by value), or an expression used to determine the 
               parameter (parameter by evaluation).
            </t>
            
            <section title="Parameter By Value">
               <t>
                  When specifying a parameter using a value, the BYTE representing the parameter
                  type MUST be set to the expected parameter type and the BLOB representing the
                  parameter contents MUST be the parameter value. 
               </t>
               <t>
                  For example, consider a parameterized OID that takes 1 parameter, which it
                  expects to be an unsigned integer (UINT). When populating this parameter by
                  value, the type of the populated parameter field MUST be UINT and 
                  the parameter value MUST be the unsigned integer.
               </t>
            </section>
         
            <section title="Parameter By Evaluation">
               <t>
                  When the value of a parameter is likely to change, an Expression  
                  (EXPR) may be substituted for the parameter value. When it comes 
                  time to interpret the parameter value, the current value of the Expression is calculated
                  and used as the parameter value. 
               </t>
               <t>
                  A parameter defined by evaluation MUST be of type EXPR, and the type of the
                  EXPR must be equal to the expected type of the parameter. Expressions and Expression types
               	  are discussed in <xref target="expr_chp"/>. 
               </t>
               <t>
                  NOTE: If the expected type of the parameter is already EXPR, and a parameter of type
                  EXPR is provided, then the system MUST treat the situation as if it were a parameter
                  by value.  AMP DOES NOT support an EXPR which references another EXPR
                  as doing so leads to significant confusion in implementations and the possibility of
                  circular reference.
               </t>
            </section>
         
            <section title="Identifying Parameter Approach">
               <t>
                  The determination of whether a parameter has been provided by value or by 
                  evaluation is made by comparing the given type of the parameter to the
                  expected type of the parameter. 
               </t>
               <t>
                  If the parameter type and the expected type match, then the parameter MUST
                  be considered by value. If the parameter type is an EXPR and the EXPR type matches the expected type, then
                  the parameter MUST be considered by evaluation of the EXPR. In any other case, 
               	  the parameter MUST be considered invalid as being from a
                  type mismatch.
               </t>
            </section>      	         	
         </section>
      </section>
      
      <section title="Special Types" toc="default">
         <t>
            In addition to the data types already mentioned, the following 
            special data types are also defined.
         </t>
          
         <section title="MID Collections (MC)" toc="default">
            <t>
               A MID collection is comprised of a value identifying the number
               of MIDs in the collection, followed by each MID, as illustrated in
               <xref target="mid_list" pageno="false" format="default" />. 
               
               <figure align="center" anchor="mid_list" title="MID Collection" suppress-title="false">
                  <artwork align="center" xml:space="preserve">
+--------+-------+     +-------+
| # MIDs | MID 1 | ... | MID N |
| [UINT] | [MID] |     | [MID] |
+--------+-------+     +-------+
                  </artwork>
               </figure>
            </t>
         </section>
         
         <section title="Expressions (EXPR)" anchor="expr_chp" toc="default">
            <t>
               Expressions apply mathematical operations to values to generate new values
               on an Agent. The EXPR type in AMP is a
               collection of MIDs that represent a postfix notation stack of data,
               Literal, and Operator types. For example, the infix expression A *
               (B * C) is represented as the sequence A B C * *. The format of an
               expression is illustrated in  
               <xref target="expr_fmt" pageno="false" format="default" />. 
               
               <figure align="center" anchor="expr_fmt" title="" suppress-title="false">               
                  <artwork align="center" xml:space="preserve">
+--------+------------+
|  Type  | Expression |
| [BYTE] |    [MC]    |
+--------+------------+
                  </artwork>
               </figure>
               
               <list hangIndent="8" style="hanging">
                  <t hangText="Type"><vspace blankLines="0" />
                     The enumeration representing the type of the result of the 
                     evaluated expression. 
                  </t>
                  
                  <t hangText="Expression"><vspace blankLines="0" />
                     An expression is represented in the AMP as a MID collection,
                     where each MID in the ordered collection represents the data,
                     Literals, and/or Operations that comprise the Expression. 
                  </t>
               </list>
            </t>
         </section>
         
         <section title="Predicate (PRED)" toc="default">
            <t>
               Predicates are Expressions whose values are interpreted as a
               Boolean. The value of zero MUST be considered "false" and all other
               values MUST be considered "true". 
            </t>
        </section>
                       
      </section>
   </section>
   
   <section title="AMP Structures" toc="default" anchor="amp_struct">
      <t>
         This section identifies the AMP structures that implement the AMA 
      	logical data model.
      </t>

      <section title="AMA Overview" toc="default">
         
         <t>
            The AMA defines a series of logical components that should be 
            included as part of an AMP. These
            components are summarized from the AMA in the following table.
         </t>
          
         <texttable title="AMP Logical Components" suppress-title="false" align="center" style="full">
            <ttcol align="left">AMA Component</ttcol>
            <ttcol align="left">Summary Description</ttcol>
       		<ttcol align="left">AMP Structure</ttcol>
            
       		<c>Atomic Data</c>
            <c>A typed, measured value whose definition and value determination occurs externally to the AMP.</c>
         	<c>Externally Defined Data</c>
         	
            <c>Computed Data</c>
            <c>A typed, computed value whose definition and value determination occurs within the AMP. </c>         
         	<c>Variable</c>
         	
            <c>Report Entry</c>
            <c>Collection of Atomic and/or Computed data and/or other Reports.</c>
            <c>Report Entry</c>
                              
            <c>Control</c>
            <c>Parameterized opcode for any action that can be taken by an Agent.</c>         
         	<c>Control</c>
         	
            <c>Rule</c>
            <c>A pre-configured response to a pre-defined time or state on an Agent.</c>
         	<c> State-Based Rule, Time-Based Rule</c>
         	
            <c>Macro</c>
            <c>An ordered collection of Controls.</c>
			<c>Macro</c>
			
            <c>Literal</c>
            <c>A constant used when evaluating Rules or determining the value of Computed Data.</c>
           	<c>Literal</c>
           	                                 
            <c>Operator</c>
            <c>An opcode representing a mathematical function known to an Agent.</c>
            <c>Operator</c>
         </texttable>
         
         <t> 
            The AMP implements these logical components in largely a one-to-one
            fashion with a few exceptions. This section describes 
            the format of these structures in the context of the
            aforementioned AMP data types. NOTE: The expression of these
            structures is only to describe how they appear in
            messages exchanged between and amongst Agents and Managers. 
         	Individual software applications may choose 
            their own internal representation of these
            structures.
         </t>
      </section>
      
      <section title="Externally Defined Data (EDD)" toc="default">
         <t>
            Externally defined data (EDD) are defined as part of ADMs for various
            applications and protocols. These represent values that are
            calculated outside of the context of Agents and Managers, such as those values
         	measured by firmware. As such, their value is defined external to the AMP system.  
         </t>
         
         <section title="Definition" toc="exclude">
            <t>
               The representation of these
               data is simply their identifying MIDs. The representation of an EDD
               is illustrated in <xref target="edd_fmt" pageno="false" format="default" />.
                   
               <figure align="center" anchor="edd_fmt" title="Externally Defined Data Format" suppress-title="false">               
                  <artwork align="center" xml:space="preserve">
+-------+
|  ID   |
| [MID] |
+-------+
                  </artwork>
               </figure>
               
               <list hangIndent="8" style="hanging">
                  <t hangText="ID"><vspace blankLines="0" /> 
                     This is the MID identifying the EDD. Since
                     EDDs are always defined solely in the context 
                     of an ADM, this MID MUST NOT have an ISSUER field 
                     and MUST NOT have a TAG field. 
                  </t>
               </list>  
            </t>
         </section>

         <section title="Processing" toc="exclude">
            <t>
               Managers
               <list style="symbols">
                  <t> Store the MID for each known EDD definition.</t>
                  <t> Associate a data type to each known EDD definition. </t>     
                  <t> Encode EDD MIDs in Controls to Agents, as appropriate.</t>                
               </list>
            </t>
            <t>
               Agents
               <list  style="symbols">
                  <t> Store the MID for each known EDD definition.</t>
                  <t> Associate a data type to each known EDD definition. </t>
                  <t> Calculate the value of an EDD definition when required,
                      such as when generating a Report Entry or evaluating an Expression. </t>                    
               </list>
            </t>           
         </section>
         
      </section>
         
      <section title="Variables (VAR)" toc="default" anchor="var_def">
         <t>
            Variables (VAR) are either statically defined in an ADM or 
            dynamically defined by a particular network. They differ from
            EDDs in that they are completely described by other known
            data in the system (either other Variables, or other EDDs). 
            For example, letting E# be a EDD item and V# be
            a VAR item, the following are examples of VAR definitions.   
         </t>
         <t>
            V1 = E1 * E2
         </t>
         <t>
            V2 = V1 + E3
         </t>
         <section title="Definition" toc="exclude">
            <t>
               VARs are defined
               by the triplet (ID, TYPE, EXPR) as illustrated in 
               <xref target="var_fmt" pageno="false" format="default" />. 

               <figure align="center" anchor="var_fmt" title="Variable Format" suppress-title="false">               
                  <artwork align="center" xml:space="preserve">
          +------------+
          |   Variable |
          |    [VAR]   |
          +-----++-----+                                                               
                ||              
                ||
 ______________/  \_____________             
/                               \
 +-------+--------+-------------+
 |  ID   |  Type  | Initializer |
 | [MID] | [BYTE] |   [EXPR]    |
 +-------+--------+-------------+
                  </artwork>
               </figure>
               
               <list hangIndent="8" style="hanging">
                  <t hangText="ID"><vspace blankLines="0" /> 
                     This is the MID identifying the VAR. When defined in 
                      an ADM this MID MUST NOT 
                     have an ISSUER field and MUST NOT have a TAG field. When defined 
                      outside of an ADM, the MID MUST have an
                     ISSUER field and MAY have a TAG field. This ID MUST NOT 
                     encapsulate a parameterized OID. 
                  </t>
                  <t hangText="Type"><vspace blankLines="0" />
                     This is the type of the VAR, and acts
                     as a static cast for the result of the initializing Expression. Note,
                     it is possible to specify a type different than the 
                     resultant type of the initializing Expression. For example, if an
                     Expression adds two single-precision floating point
                     numbers, the VAR MAY have an integer type
                     associated with it. This BYTE is populated with the 
                     enumeration of the associated type and MUST be defined
                     as one of the numeric data types outlined in
                     <xref target="type_enum" pageno="false" format="default" />.
                  </t>
                  <t hangText="Initializer"><vspace blankLines="0" />
                     The initial value of the VAR is given by an 
                     initializing Expression. In the case where the type of the VAR is an
                     EXPR, then the initializer is simply copied as the value of
                     the VAR.  In the case where the type of the VAR is anything
                     other than EXPR, then the initializer Expression is
                     evaluated and the resultant value is copied into the VAR
                     as its value. Once the initializer Expression
                     has been used to calculate an initial value for the VAR it
                     may be discarded.
                  </t>
               </list>  
            </t>
         </section>
         
         <section title="Processing" toc="exclude">
            <t>
               Managers
               <list style="symbols">
                  <t> Store the MID for each ADM-defined VAR definition.</t>
                  <t> Send requests to Agents to add, list, describe, and remove VAR definitions.</t>
                  <t> Remember custom VAR definitions. </t>   
                  <t> Encode VAR MIDs in Controls to Agents, as appropriate.</t>                  
               </list>
            </t>
            <t>
               Agents
               <list  style="symbols">
                  <t> Store the MID for each ADM-defined VAR definition.</t>
                  <t> Calculate the value of VARs when required, such as during Rule evaluation,
                      calculating other VAR values, and generating Reports. </t>
                  <t> Add, remove, list, and describe custom VAR definitions. </t>                    
               </list>
            </t>
                        
         </section>
         
      </section>

      <section title="Report Template (RPTT), Report Entry (RPTE)" toc="default">
         <t>
            A Report is an AMP message whose format is described in 
            <xref target="rpt_msg_def"/>. This message is populated
            with Report Entries that contain data formatted
            in accordance with Report Templates.              
         </t>
         <t>
            A Report Template is the ordered set of data descriptions that
         	describe how values will be represented in a corresponding
         	Report Entry. Templates can be viewed as a schema that describes
         	how to interpret a Report Entry, since these entries do not embed
         	schema or name information in them. Templates contain no values and 
         	are either defined in an ADM or configured between Managers and Agents. 
         </t>
         <t>
            A Report Entry is a set of data values populated using a given Report 
            Template. A Report Entry contains only data values and no template
            definitions. By removing definition information from a Report Entry,
            the volume of information sent from the Agent to the Manager is
            greatly reduced. When a Report Entry is generated as capturing the
            result of a Control, the Report Template for the Control is assumed
            to be known to both the generating Agent and all receiving Managers. 
         </t>
         <section title="Definition" toc="exclude">
            <t>
               A Report Template is modeled as a MC, as each data definition in
               the template is identified by a MID.   
            </t>
            <t>
               A Report Entry is a TDC identified by a MID and generated to capture 
               the return value of a Control. Generated Report Entries MUST be collected by an Agent
               periodically, placed in an AMP Report message, and sent to one
               or more Managers. 
            </t>
            <t>
               When a Report Entry is generated in accordance with a named
               Report Template, the entry identifier MUST be the same as the
               template defining the data in the entry. When a Report Entry is
               generated absent a defined Report Template, then the entry identifier
               MUST be the MID of the Control generating the report.
            </t>
            <t>
               The definition of a Report Entry is illustrated in 
               <xref target="rpte_fmt"/>.
                  
               <figure align="center" anchor="rpte_fmt" title="Report Entry Format" suppress-title="false">               
                  <artwork align="center" xml:space="preserve">
                  +-------+--------+
                  |  ID   | Values |
                  | [MID] |  [TDC] |
                  +-------+---++---+                                                               
                              ||              
                              ||
  ___________________________/  \__________________________________               
 /                                                                 \
   +----------+-------------+---------+---------+     +---------+ 
   | # Values | Value Types | Value 1 | Value 2 |     | Value N | 
   |  [SDNV]  |    [BLOB]   | [BLOB]  |  [BLOB] | ... | [BLOB]  | 
   +----------+-------------+---------+---------+     +---------+ 
 
                  </artwork>
               </figure>
               
               <list hangIndent="8" style="hanging">
                  <t hangText="ID"><vspace blankLines="0" /> 
                     This is the MID identifying the source used to build the entry.
                  	 If this field identifies a template, and the Report Template is 
                  	 defined in an ADM, this MID MUST NOT have an ISSUER field and MUST NOT
                     have a TAG field. If the Report Template is not defined in an ADM then
                  	 this MID MUST have an ISSUER field and MAY have a TAG field. If this
                  	 field identifies a Control then the MID MUST NOT have an ISSUER field and
                  	 MUST NOT have a TAG field.
                      <vspace blankLines="1"/>
                     A Report Template MID MAY be parameterized. If the Report Template MID is parameterized,
                     the parameters MUST be used (in the same number and order) to customize any
                     parameterized data in the report when generating values for the Report Entry.  
                  </t>
                  <t hangText="Values"><vspace blankLines="0" />
                     This is the TDC containing all of the
                     data values that comprise the Report Entry. It is important to
                     note that data values may be other Report Entries. 
                  </t>
               </list>  
            </t>
         </section>
         
         <section title="Processing" toc="exclude">
            <t>
               Managers
               <list style="symbols">
                  <t> Store the MID for each ADM-defined Report Templates.</t>
                  <t> Send requests to Agents to add, list, describe, and remove custom Report Templates.</t>
                  <t> Remember custom Report Templates when processing Report Entries received by Agents. </t>     
                  <t> Encode Report Template MIDs in Controls to Agents, as appropriate.</t>           
               </list>
            </t>
            <t>
               Agents
               <list  style="symbols">
                  <t> Store the MID for each ADM-defined Report Template.</t>
                  <t> Populate Report Entries for transmission to Managers when 
                       required by a Control.</t>                     
                  <t> Add, remove, list, and describe custom Report Templates. </t>
                  <t> Agents SHOULD collect multiple Report Entries into a single Report
                      AMP message for transmission to a Manager rather than sending multiple,
                      individual Report messages to a Manager with one Report Entry per Report message.</t>                    
               </list>
            </t>                        
         </section>
         
      </section>                  
      
      <section title="Control" toc="default">
         <t>
            A Control represents a pre-defined (possibly parameterized) opcode
            that can be run on an Agent. Controls in the AMP are always defined 
            in the context of an ADM. There is no concept of an operator-defined 
            Control. Since Controls are pre-configured in Agents and 
            Managers as part of ADM support, their representation is simply the MID
            that identifies them, similar to EDDs. 
         </t>
         <section title="Definition" toc="exclude">
            <t>
               The format of a Control is illustrated in <xref target="ctrl_fmt"/>.
                   
               <figure align="center" anchor="ctrl_fmt" title="Control Format" suppress-title="false">               
                  <artwork align="center" xml:space="preserve">
+-------+
|  ID   |
| [MID] |
+-------+
                  </artwork>
               </figure>
               
               <list hangIndent="8" style="hanging">
                  <t hangText="ID"><vspace blankLines="0" /> 
                     This is the MID identifying the Control. Since
                     Controls are always defined solely in the context 
                     of an ADM, this MID MUST NOT have an ISSUER field 
                     and MUST NOT have a TAG field. 
                  </t>
               </list>               
            </t>
         </section>
         
         <section title="Processing" toc="exclude">
            <t>
               Managers
               <list style="symbols">
                  <t> Store the MID for each ADM-defined Control definition.</t>
                  <t> Store the number of parameters and each parameter type for parameterized Controls.</t>                      
                  <t> Encode Control MIDs in other Controls to Agents, as appropriate.</t>            
               </list>
            </t>
            <t>
               Agents
               <list  style="symbols">
                  <t> Store the MID for each ADM-defined Control definition.</t>
                  <t> Implement Controls in firmware and run Controls with appropriate parameters when
                      necessary in the context of Manager direction and Rule execution.</t>
                  <t> Communicate "return" values from Controls back to Managers as Report Entries where
                  	  appropriate. 
                  </t>
               </list>
            </t>
                        
         </section>
         
      </section>
      
      <section title="Time-Based Rule (TRL)" anchor="trl_chp"  toc="default">
         <t>
            A Time-Based Rule (TRL) specifies that a particular action 
            should be taken by an Agent based on some time interval. A TRL
            specifies that starting at a particular START time, and for
            every PERIOD seconds thereafter, an ACTION should be run by the
            Agent until the ACTION has been run for COUNT times. When the
            TRL is no longer valid it MAY BE discarded by the Agent. 
         </t>
         <t>
            Examples of TRLs include:
            <list>
               <t>
                  Starting 2 hours from receipt, produce
                  a Report Entry for Report Template R1 every 10 hours ending after 20 times.                                    
               </t>
               <t>
                  Starting at the given absolute time, run Macro M1 every
                  24 hours ending after 365 times.
               </t>
            </list> 
         </t>
                  
         <section title="Definition" toc="exclude">
            <t>   
               The
               format of a TRL is illustrated in <xref target="trl_fmt"/>.
                   
               <figure align="center" anchor="trl_fmt" title="Time-Based Rule Format" suppress-title="false">               
                  <artwork align="center" xml:space="preserve">
+-------+-------+--------+--------+--------+
|  ID   | START | PERIOD | COUNT  | ACTION |
| [MID] | [TS]  | [UINT] | [UINT] |  [MC]  |
+-------+-------+--------+--------+--------+
                  </artwork>
               </figure>
               
               <list hangIndent="8" style="hanging">
                  <t hangText="ID"><vspace blankLines="0" /> 
                     This is the MID identifying the TRL. When a 
                     TRL is defined in an ADM this MID MUST NOT 
                     have an ISSUER field and MUST NOT have a TAG field. When the TRL
                     is defined outside of an ADM, the MID MUST have an
                     ISSUER field and MAY have a TAG field. This ID MUST NOT 
                     encapsulate a parameterized OID.
                  </t>
                  <t hangText="START"><vspace blankLines="0" />
                     The time at which the TRL should start to be evaluated. This
                     will mark the first running of the action associated with
                     the TRL.  
                  </t>
                  <t hangText="PERIOD"><vspace blankLines="0" />
                     The number of seconds to wait between running the action
                     associated with the TRL.
                  </t>
                  <t hangText="COUNT"><vspace blankLines="0" />
                     The number of times the TRL action may be run.  
                     The special value of 0 indicates the TRL should continue 
                     running the action indefinitely.
                  </t>
                  <t hangText="ACTION"><vspace blankLines="0" />
                     The collection of Controls and/or Macros to
                     run by the TRL. This is captured as a MC
                     with the constraint that every MID within the MC
                     represent a Control or Macro.
                  </t>
               </list>               
            </t>
         </section>
         
         <section title="Processing" toc="exclude">
            <t>
               Managers
               <list style="symbols">
                  <t> Send requests to Agents to add, list, describe, and remove custom TRL definitions.</t>
                  <t> Remember custom TRL definitions when processing Reports received by Agents. </t>
                  <t> Send requests to Agents to suspend/resume the evaluation of TRLs. </t>     
                  <t> Encode TRL MIDs in Controls to Agents, as appropriate.</t>           
               </list>
            </t>
            <t>
               Agents
               <list  style="symbols">
                  <t> Run the actions associated with TRLs in accordance with their 
                      start time and period. </t>
                  <t> Add, remove, list, and describe custom TRL definitions. </t>
                  <t> Suspend and resume the evaluation of a TRL when directed by a Manager or another Rule.</t>
                  <t> Report on the status of TRLs.</t>
               </list>
            </t>                        
         </section>        
      </section>
      
      <section title="State-Based Rule (SRL)" anchor="srl_chp" toc="default">
         <t>
            A State-Based Rule (SRL) specifies that a particular action 
            should be taken by an Agent based on some evaluation of the
            internal state of the Agent. A SRL
            specifies that starting at a particular START time an ACTION should be run by the
            agent if some CONDITION evaluates to true, until the ACTION has 
            been run COUNT times. When the
            SRL is no longer valid it MAY be discarded by the agent.                         
         </t>
         <t>
            Examples of SRLs include:
            <list>
               <t>
                  Starting 2 hours from receipt, whenever V1 > 10, produce
                  a Report Entry for Report Template R1 no more than 20 times.                                    
               </t>
               <t>
                  Starting at some future absolute time, whenever V2 != V4, 
                  run Macro M1 no more than 36 times.
               </t>
            </list> 
         </t>
         
         <section title="Definition" toc="exclude">
            <t>   
               The
               format of a SRL is illustrated in <xref target="srl_fmt" pageno="false" format="default" />.
                   
               <figure align="center" anchor="srl_fmt" title="State-Based Rule Format" suppress-title="false">               
                  <artwork align="center" xml:space="preserve">
+-------+-------+--------+--------+--------+
|  ID   | START |  COND  | COUNT  | ACTION |
| [MID] | [TS]  | [PRED] | [UINT] |  [MC]  |
|       |       |        |        |        |                      
+-------+-------+--------+--------+--------+
                     
                                       </artwork>
               </figure>
               
               <list hangIndent="8" style="hanging">
                  <t hangText="ID"><vspace blankLines="0" /> 
                     This is the MID identifying the SRL. When a 
                     report is defined in an ADM this MID MUST NOT 
                     have an ISSUER field and MUST NOT have a TAG field. When the SRL
                     is defined outside of an ADM, the MID MUST have an
                     ISSUER field and MAY have a TAG field. This ID MUST NOT 
                     encapsulate a parameterized OID. 
                  </t>
                  <t hangText="START"><vspace blankLines="0" />
                     The time at which the SRL condition should start to be evaluated. This
                     will mark the first evaluation of the condition associated with
                     the SRL.  
                  </t>
                  <t hangText="CONDITION"><vspace blankLines="0" />
                     The Predicate which, if true, results in the SRL running the associated 
                     action. 
                  </t>
                  <t hangText="COUNT"><vspace blankLines="0" />
                     The number of times the SRL action can be run.  
                     The special value of 0 indicates there is no limit
                  	on how many times the action can be run.
                  </t>
                  <t hangText="ACTION"><vspace blankLines="0" />
                     The collection of Controls and/or Macros to
                     run as part of the action. This is captured as a MC
                     data type with the constraint that every MID within the MC
                     represent a Control or Macro.
                  </t>
               </list>               
            </t>
         </section>
         
         <section title="Processing" toc="exclude">
            <t>
               Managers
               <list style="symbols">
                  <t> Send requests to Agents to add, list, describe, suspend, resume, and remove custom SRL definitions.</t>
                  <t> Remember custom SRL definitions when processing Report Entries received by Agents. </t>     
                  <t> Encode SRL MIDs in Controls to Agents, as appropriate.</t>           
               </list>
            </t>
            <t>
               Agents
               <list  style="symbols">
                  <t> Run the actions associated with SRLs in accordance with their 
                      start time and evaluation of their predicate. </t>
                  <t> Add, remove, list, and describe custom SRL definitions. </t>
                  <t> Suspend and resume SRL evaluation when commanded by a Manager or another Rule.</t>
               </list>
            </t>                        
                        
         </section>
         
      </section> 
                       
      <section title="Macro" toc="default">
         <t>
            Macros in the AMP are ordered collections of MIDs (an MC) that
            contain Controls or other Macros. When run by an Agent, each
            MID in the MC is run in order. 
         </t>
         <t>
         	Any AMP implementation MUST allow at least 4 levels of Macro nesting.
         	Implementations MUST provide some mechanism to prevent recursive 
         	nesting of Macros. 
         </t>
         <t>
            While the MIDs representing any given Control may be parameterized,
            the MID associated with a Macro MAY NOT be parameterized.
         </t>
         <section title="Definition" toc="exclude">            
            <t>
               The format of a Macro is illustrated in <xref target="macro_fmt" pageno="false" format="default" />.
                   
               <figure align="center" anchor="macro_fmt" title="Macro Format" suppress-title="false">               
                  <artwork align="center" xml:space="preserve">
 +-------+------------+
 |  ID   | Definition |
 | [MID] |    [MC]    |
 +-------+------------+
                  </artwork>
               </figure>
               
               <list hangIndent="8" style="hanging">
                  <t hangText="ID"><vspace blankLines="0" /> 
                     This is the MID identifying the Macro. When a 
                     Macro is defined in an ADM this MID MUST NOT 
                     have an ISSUER field and MUST NOT have a TAG field. When the 
                     Macro is defined outside of an ADM, the MID MUST have an
                     ISSUER field and MAY have a TAG field. This ID MUST NOT 
                     encapsulate a parameterized OID. 
                  </t>
                  <t hangText="Definition"><vspace blankLines="0" />
                     This is the ordered collection of MIDs that identify the
                     Controls and other Macros that should be run as part of
                     running this Macro.
                  </t>               
               </list>               
            </t>
         </section>
         
         <section title="Processing" toc="exclude">
            <t>
               Managers
               <list style="symbols">
                  <t> Store the MID for each ADM-defined Macro definition.</t>                  
                  <t> Send requests to Agents to add, list, describe, and remove custom Macro definitions.</t>
                  <t> Encode macro MIDs in Controls to Agents, as appropriate.</t>           
               </list>
            </t>
            <t>
               Agents
               <list  style="symbols">
                  <t> Store the MID for each ADM-defined Macro definition.</t>                  
                  <t> Remember custom Macro definitions and run Macros when appropriate, such 
                     as when responding to a run-Macro Control or when executing the action of a TRL or SRL.</t>     
                  <t> Add, remove, list, and describe custom Macro definitions. </t>
               </list>
            </t>                                                
         </section>
         
      </section>
      
      <section title="Literal" toc="default">
         <t>
            Literals in the AMP represent constants defined in an
            ADM. Examples of constants that could
            be defined in an ADM include common mathematical values such as
            PI or well-known Epochs such as the UNIX Epoch.
         </t>
         <t>
            The ADM definition of a Literal MUST include the type of the
            Literal value. Since ADM definitions are preconfigured on
            Agents and Managers in an AMA the type information for a given
            Literal is therefore known by all actors in the system. 
         </t>
         <t>
            If the MID identifying the Literal encapsulates a non-parameterized
            OID, then the value is given in the ADM and Agents and Managers
            can lookup this value in their set of pre-configured data. 
         </t>
         <t>
            If the MID identifying the Literal encapsulates a parameterized
            OID, then the parameters to the OID define the value of the 
            Literal. Users wishing to create a new Literal will create a MID
            with whatever parameters are necessary to create the value. The
            documentation of the ADM defining the Literal MUST describe how
            parameters result in the calculation of the Literal value. 
         </t> 
                  
         <section title="Definition" toc="exclude">
            <t>
               The format of a Literal is illustrated in <xref target="lit_fmt" pageno="false" format="default" />.
                   
               <figure align="center" anchor="lit_fmt" title="Control Format" suppress-title="false">               
                  <artwork align="center" xml:space="preserve">
+-------+   
|  ID   |
| [MID] |
+-------+
                  </artwork>
               </figure>
               
               <list hangIndent="8" style="hanging">
                  <t hangText="ID"><vspace blankLines="0" /> 
                     This is the MID identifying the Literal. Since Literal definitions are
                  	 always provided in an ADM, this MID MUST NOT have an ISSUER field and
                  	MUST NOT have a TAG field.  
                  </t>
               </list>               
            </t>
         </section>
        
         <section title="Processing" toc="exclude">
            <t>
               Managers
               <list style="symbols">
                  <t> Store the MID for each ADM-defined Literal definition.</t>                  
                  <t> Encode Literal MIDs in controls to Agents, as appropriate.</t>           
               </list>
            </t>
            <t>
               Agents
               <list  style="symbols">
                  <t> Store the MID for each ADM-defined Literal definition.</t>     
                  <t> Calculate the value of Literals where appropriate, such as when
                     generating a Report Entry or when evaluating an Expression.</t>     
               </list>
            </t>                                                
         </section>
         
      </section>
      
      <section title="Operator" toc="default">
         <t>
            Operators in the AMP are always defined in the context of an ADM.
            There is no concept of a user-defined operator, as operators
            represent mathematical functions implemented by the firmware on
            an Agent. Since Operators are pre-configured in Agents and Managers as 
            part of ADM support, their representation is simply the MID
            that identifies them. 
         </t>
         <t>
            The ADM definition of an Operator MUST specify how many parameters
            are expected and the expected type of each parameter. For example, the unary NOT Operator ("!") would
            accept one parameter. The binary PLUS Operator ("+") would accept
            two parameters. A custom function to calculate the average of the
            last 10 samples of a data item would accept 10 parameters.                                
         </t>
                  
         <section title="Definition" toc="exclude">
            <t>
               Operators are always evaluated in the context of an Expression.
               The format of an Operator is illustrated in <xref target="op_fmt" pageno="false" format="default" />.
                   
               <figure align="center" anchor="op_fmt" title="Operator Format" suppress-title="false">               
                  <artwork align="center" xml:space="preserve">
+-------+
|  ID   |
| [MID] |
+-------+
                  </artwork>
               </figure>
               
               <list hangIndent="8" style="hanging">
                  <t hangText="ID"><vspace blankLines="0" /> 
                     This is the MID identifying the Operator. Since
                     Operators are always defined solely in the context 
                     of an ADM, this MID MUST NOT have an ISSUER field and MUST NOT have 
                     a TAG field. 
                  </t>
               </list>               
            </t>
         </section>
         
         <section title="Processing" toc="exclude">
            <t>
               Managers
               <list style="symbols">
                  <t> Store the MID for each ADM-defined Operator definition.</t>                  
                  <t> Encode Operator MIDs in Controls to Agents, as appropriate.</t>           
               </list>
            </t>
            <t>
               Agents
               <list  style="symbols">
                  <t> Store the MID for each ADM-defined Operator definition.</t>
                  <t> Store the number of parameters expected for each Operator.</t>     
                  <t> Calculate the value of applying an Operator to a given set of
                     parameters, such as when evaluating an Expression.</t>     
               </list>
            </t>                            
         </section>
         
      </section>
   </section>
      
   <section title="Data Type IDs and Enumerations" anchor="type_enum" toc="default">
      <t>
         This section lists the IDs and enumerations
         for data types outlined in this section. IDs are the text
         abbreviations used in this specification and in ADMs to identify
         data types. Enumerations associate data types with a numeric value. 
      	 These enumerations MUST be used whenever a data type
         is represented as a numerical representation.
      </t>
      <t>
         NOTE: Type enumerations are always represented as a BYTE in the AMP.
      </t>
      <t>
         IDs and enumerations are grouped by the kind of data they represent, as follows.
         AMP structure identifiers occupy enumerations 0 - 8 and
         represent AMP data structures that are formally identified by a MID. Basic
         data types occupy enumerations 9-18 and represent primitive data types in the
         AMP specification.  Compound and special types occupy enumerations 19-25 and
         represent other data types known to the AMP specification.
      </t>
         
      
      <texttable title="" suppress-title="true" align="center" style="headers">
      <ttcol width="50%" align="left">AMP Structure</ttcol>
      <ttcol width="20%" align="left">ID</ttcol>
      <ttcol width="15%" align="left">Enumeration</ttcol>
      <ttcol width="15%" align="left">Numeric</ttcol>
            
      <c>Externally Defined Data</c>
      <c>EDD</c>
      <c>0</c>
      <c>No</c>
   
      <c>Variable</c>
      <c>VAR</c>
      <c>1</c>
      <c>No</c>
            
      <c>Report</c>
      <c>RPT</c>
      <c>2</c>
      <c>No</c>
            
      <c>Control</c>
      <c>CTRL</c>
      <c>3</c>
      <c>No</c>

      <c>State-Based Rule</c>
      <c>SRL</c>
      <c>4</c>
      <c>No</c>
      
      <c>Time-Based Rule</c>
      <c>TRL</c>
      <c>5</c>
      <c>No</c>
            
      <c>Macro</c>
      <c>MACRO</c>
      <c>6</c>
      <c>No</c>
        
      <c>Literal</c>
      <c>LIT</c>
      <c>7</c>
      <c>No</c>
      
      <c>Operator</c>
      <c>OP</c>
      <c>8</c>
      <c>No</c>
         
      </texttable>
      
      <texttable title="" suppress-title="true" align="center" style="headers">
      <ttcol width="50%" align="left">Basic Data Type</ttcol>
      <ttcol width="20%" align="left">ID</ttcol>
      <ttcol width="15%" align="left">Enumeration</ttcol>
      <ttcol width="15%" align="left">Numeric</ttcol>
         
      <c>BYTE</c>
      <c>BYTE</c>
      <c>9</c>
      <c>No</c>
         
      <c>Signed 32-bit Integer</c>
      <c>INT</c>
      <c>10</c>
      <c>Yes</c>
         
      <c>Unsigned 32-bit Integer</c>
      <c>UINT</c>
      <c>11</c>
      <c>Yes</c>
                  
      <c>Signed 64-bit Integer</c>
      <c>VAST</c>
      <c>12</c>
      <c>Yes</c>
         
      <c>Unsigned 64-bit Integer</c>
      <c>UVAST</c>
      <c>13</c>
      <c>Yes</c>
              
      <c>Single-Precision Floating Point</c>
      <c>REAL32</c>
      <c>14</c>
      <c>Yes</c>
         
      <c>Double-Precision Floating Point</c>
      <c>REAL64</c>
      <c>15</c>
      <c>Yes</c>
         
      <c>Self-Delineating Numerical Value</c>
      <c>SDNV</c>
      <c>16</c>
      <c>No</c>

      <c>Timestamp</c>
      <c>TS</c>
      <c>17</c>
      <c>No</c>

      <c>Character String</c>
      <c>STR</c>
      <c>18</c>
      <c>No</c>
                        
      </texttable>

      <texttable title="" suppress-title="true" align="center" style="headers">
      <ttcol width="50%" align="left">Compound/Special Data Type</ttcol>
      <ttcol width="20%" align="left">ID</ttcol>
      <ttcol width="15%" align="left">Enumeration</ttcol>
      <ttcol width="15%" align="left">Numeric</ttcol>
                              
      <c>Binary Large Object</c>
      <c>BLOB</c>
      <c>19</c>
      <c>No</c>                                        
                                                                                                      
      <c>Managed Identifier</c>
      <c>MID</c>
      <c>20</c>
      <c>No</c>
                                             
      <c>MID Collection</c>
      <c>MC</c>
      <c>21</c>
      <c>No</c>

      <c>Expression</c>
      <c>EXPR</c>
      <c>22</c>
      <c>No</c>
                                             
      <c>Data Collection</c>
      <c>DC</c>
      <c>23</c>
      <c>No</c>
      
      <c>Typed Data Collection</c>
      <c>TDC</c>
      <c>24</c>
      <c>No</c>
      
      <c>Table</c>
      <c>TBL</c>
      <c>25</c>
      <c>No</c>
                  
      </texttable>
   
      <section title="Numeric Promotions" toc="default">
      
         <t>
            When 
      	    attempting to evaluate operators of different types, wherever possible, an Agent
      	    MAY need to promote operands until they are of the correct type. For example, if
      	    an Operator is given both an INT and a REAL32, the INT SHOULD be promoted to a
      	    REAL32 before the Operator is applied.   
         </t>
      
         <t>
      	   The listing of legal promotions in the AMP are listed in <xref target="num_promo"/>. In
      	   this Figure, operands are listed across the top row and down the first column. The
      	   resultant type of the promotion is listed in the table at their intersection. 
      

	       <figure align="center" anchor="num_promo" title="AMP Numeric Promotions" suppress-title="false">               
              <artwork align="center" xml:space="preserve">

            INT     UINT	   VAST    UVAST     REAL32   REAL64
          +--------+--------+--------+--------+--------+--------+
   INT	  | INT    | INT    | VAST   | UNK    | REAL32 | REAL64 |
   UINT   | INT    | UINT   | VAST   | UVAST  | REAL32 | REAL64 |
   VAST   | VAST   | VAST   | VAST   | VAST   | REAL32 | REAL64 |
   UVAST  | UNK    | UVAST  | VAST   | UVAST  | REAL32 | REAL64 |
   REAL32 | REAL32 | REAL32 | REAL32 | REAL32 | REAL32 | REAL64 |
   REAL64 | REAL64 | REAL64 | REAL64 | REAL64 | REAL64 | REAL64 |
          +--------+--------+--------+--------+--------+--------+
           	
              </artwork>
           </figure>
        </t>
        <t>
      	   AMP does not permit promotions between non-numeric types, and numeric
         	promotions not listed in this section are not allowed in the AMP. Any attempt
         	to perform an illegal promotion in the AMP SHOULD result in an error.
        </t>                      
     </section>
         
     <section title="Numeric Conversions" toc="default">
        <t>
     	   Variables, Expressions, and Predicates in the AMP are typed values.  When attempting to 
           assign a value of a different type, a numeric conversion must be performed. Any numeric 
           type may be converted to any other numeric type in accordance with the  C rules for arithmetic 
        	type conversions.
        </t>	
     </section>
     
   </section>
    
   <section anchor="AGENT_TMPL" title="Application Data Model Template" toc="default">
      
      <section anchor="ADM_OVERVIEW" title="Overview" toc="default">
         <t>
            An application data model (ADM) specifies the set of AMP components associated with
            a particular application or protocol. The purpose of the
            ADM is to provide a guaranteed interface for the management of an application or protocol
            over AMP that is independent of the nuances of its software implementation. In this 
            respect, the ADM is conceptually similar to the Managed Information Base (MIB) used by SNMP, 
            but contains additional information relating to command opcodes and more expressive syntax for
            automated behavior.
         </t>  
         <t>
            Any
            implementation claiming compliance with a given ADM must collect all identified EDDs, compute all identified Variables, 
            perform identified Controls and Macros, generate Report Entries to defined Report Templates, and understand identified Literals and Operators. 
         </t>
         
      </section>

      <section anchor="ADM_TMPL_DEF" title="Template" toc="default">
         <t>
            Each ADM specifies the globally unique identifiers and descriptions for all EDDs, Variables, Controls,
            Literals, Macros, Report Templates, and Operators associated with the application or protocol managed by the ADM. 
         </t>
                  
         <section title="ADM Metadata">
            <t>
               ADM metadata consist of the items necessary to uniquely identify the ADM itself. The
               required metadata items include the following.
            </t>
            
             <texttable anchor="adm_metadata" title="ADM Terminology" suppress-title="false" align="center" style="full">
                  <ttcol align="center" width="20%">Item</ttcol>
                  <ttcol align="center" width="10%">Type</ttcol>
                  <ttcol align="center" width="65%">Description</ttcol>
                  <ttcol align="center" width="5%">Req.</ttcol>
                  

                  <c>Name</c>
                  <c>STR</c>
                  <c>The human-readable name of the ADM. </c>
               <c>Y</c>

               <c>Version</c>
                  <c>STR</c>
                  <c>Version of the ADM encoded as a string. </c>
               <c>Y</c>

               <c>OID Nickname N</c>
                  <c>OID</c>
                  <c> ADMs provide an ordered list of nicknames that can be used by other MIDs in the ADM definition
                     to defined compressed OIDs. There can an arbitrary number of nicknames defined for an ADM. </c>
               <c>N</c>
               </texttable>
          
         </section>
         
         <section title="ADM Information Capture">
            <t>
               The ADM Data Section consist of all components in the "data" category associated with the
               managed application or protocol. The information that must be provided for each of these
               items is as follows.
               
               <list style="hanging">
                  <t hangText="Name"><vspace blankLines="0" /> 
                     Every component in an ADM MUST be given
                     a human-readable, consistent name that uniquely identifies the component in the
                     context of the application or protocol. These names will be used by human-computer
                     interfaces for manipulating components.
                  </t>
                     
                  <t hangText="MID"><vspace blankLines="0" /> 
                     The managed identifier that describes this
                     data item. MIDs in components identified by an ADM MUST NOT contain an ISSUER field and MUST NOT contain
                     a TAG field. In cases where the OID is parameterized, the parameter values are not included
                     in the ADM MID definition as parameters are provided at runtime.
                  </t>

                  <t hangText="OID"><vspace blankLines="0" /> 
                     A human-readable version of the OID encapsulated
                     in the MID for the component (e.g., 1.2.3.4). When a nickname is used to represent an 
                     compressed OID, the nickname enumeration is included in this field enclosed by square brackets.
                     For example, if OID nickname 0 refers to the OID prefix 1.2.3.4.5, then the OID 1.2.3.4.5.6 may be
                     listed more compactly as [0].6
                  </t>
                     
                  <t hangText="Description"><vspace blankLines="0" /> 
                     Every component in an ADM MUST be given a
                     human-readable, consistent description that provides a potential user with a compact, 
                     effective summary of the item.
                  </t>

                  <t hangText="Type"><vspace blankLines="0" /> 
                     For components that evaluate to a data value, the
                     data type for that value must be represented.
                  </t>
                     
                  <t hangText="# Parameters"><vspace blankLines="0" /> 
                     For components with a parameterized OID, the
                     ADM MUST provide the expected number of parameters. A value of 0 indicates that the OID has no
                     parameters and MUST NOT be used for any MID which has a parameterized OID. When omitted,
                     the number of parameters is considered 0.
                  </t>
                     
                  <t hangText="Parameter N Name"><vspace blankLines="0" /> 
                     Each parameter of a parameterized component
                     must be given a name.
                  </t>
                     
                  <t hangText="Parameter N Description"><vspace blankLines="0" /> 
                     Each parameter of a parameterized 
                     component must be given a summary that describes how the parameter will be used by the 
                     application or protocol. This description MUST note if the
                  	 parameter is optional. 
                  </t>
                                          
                  <t hangText="Parameter N Type"><vspace blankLines="0" /> 
                     Each parameter of a parameterized component
                     must be given a type that describes the structure capturing the parameter value.
                  </t>                                                                                      
               </list>
            </t>           
         </section>
      </section>
        
      <section title="The Agent ADM" toc="default">
         <t>
            The full set of EDDs, Variables, Report Templates, Controls,
            Rules, Macros, Literals, and Operators that can be understood by
            an AMP Agent have been separated into an AMP Agent ADM. Just as the
            AMP uses ADMs to manage applications and protocols, the ADM model
            is also used to implement the functionality of the Agent.       	
        </t>
      </section>              
   </section>
   
   
   <section title="Functional Specification" anchor="func_spec" toc="default">
      <t>
         This section describes the format of the messages that comprise the
         AMP protocol. The AMP message specification is limited to three basic communications:         
         <list>
            <t> - Adding an Agent to the list of managed devices known to a Manager.</t>
            <t> - Sending a Macro of one or more Controls to an Agent.</t>
            <t> - Receiving a Report of one or more Report Entries from an Agent.</t>
         </list>
         The entire management of a network can be performed using these three
         messages and the configurations from associated ADMs.         
      </t>
      	            
      <section title="Message Group Format" toc="default">
         <t>
            Individual messages within the AMP are combined into a single 
            group for communication with another AMP Actor. Messages within
            a group MUST be received and applied as an atomic unit. The format
            of a message group is illustrated in <xref target="msg_grp" pageno="false" format="default" />. 
        
            These message groups are
            assumed communicated amongst Agents and Managers as the payloads of
            encapsulating protocols which MAY provide additional security and 
            data integrity features.

            <figure align="center" anchor="msg_grp" title="AMP Message Group Format" suppress-title="false" alt="" width="" height="">
               <artwork align="center" xml:space="preserve" name="" type="" alt="" width="" height="">
+--------+-----------+-----------+     +-----------+
| # Msgs | Timestamp | Message 1 | ... | Message N |
| [SDNV] |    [TS]   | [VARIES]  |     |  [VARIES] |
+--------+-----------+-----------+     +-----------+
               </artwork>
            </figure>
            
            <list hangIndent="8" style="hanging">
               <t hangText="# Msgs"><vspace blankLines="0" /> 
                  The number of messages that are together in this message group.
               </t>
               <t hangText="Timestamp"><vspace blankLines="0" />
                  The creation time for this
                  messaging group.  This timestamp MUST be an absolute time. 
                  Individual messages may have their own creation timestamps
                  based on their type, but the group timestamp also serves
                  as the default creation timestamp for every message in the
                  group. 
               </t>
               <t hangText="Message N"><vspace blankLines="0" /> 
                  The Nth message in the group.
               </t>
            </list>
         </t>
      </section>
      
      <section title="Message Format" toc="default">
         <t> 
            Each message identified in the AMP specification adheres to a
            common message format, illustrated in <xref target="msg_fmt" pageno="false" format="default" />, 
            consisting of a message header, a message body, and an optional trailer.
               
            <figure align="center" anchor="msg_fmt" title="AMP Message Format" suppress-title="false" alt="" width="" height="">
               <artwork align="center" xml:space="preserve" name="" type="" alt="" width="" height="">
+--------+----------+----------+
| Header |   Body   | Trailer  |
| [BYTE] | [VARIES] | [VARIES] |
|        |          |  (opt.)  |
+--------+----------+----------+
               </artwork>
            </figure>

            <list hangIndent="8" style="hanging">
               <t hangText="Header"><vspace blankLines="0" /> 
                  The message header BYTE is shown in <xref target="cmn_hdr" pageno="false" format="default" />. 
                  The header identifies a message context and opcode as well as 
                  flags that control whether a Report Entry should be generated on 
                  message success (Ack) and whether a Report Entry should be generated 
                  on message failure (Nack).
                     
                  <figure align="center" anchor="cmn_hdr" title="AMP Common Message Header" suppress-title="false" alt="" width="" height="">
                     <artwork align="center" xml:space="preserve" name="" type="" alt="" width="" height="">                     
+--------+----+---+-----------+
|ACL Used|Nack|Ack|  Opcode   |
+--------+----+---+-----------+
|    7   |  6 | 5 | 4 3 2 1 0 |
+--------+----+---+-----------+
 MSB                             LSB
                     </artwork>
                  </figure>
                  
                  <list hangIndent="8" style="hanging">
                     <t hangText="Opcode"><vspace blankLines="0" /> 
                        The opcode field identifies the opcode of the message.
                     </t>
                     <t hangText="ACK Flag"><vspace blankLines="0" /> 
                        The ACK flag describes whether successful application 
                        of the message must generate an acknowledgement back to 
                        the message sender. If this flag is set (1) then the 
                        receiving actor MUST generate a Report Entry communicating this
                        status. Otherwise, the actor MAY generate such a Report Entry 
                        based on other criteria.
                     </t>
                     <t hangText="NACK Flag"><vspace blankLines="0" /> 
                        The NACK flag describes whether a failure applying the 
                        message must generate an error notice back to the 
                        message sender. If this flag is set (1) then the receiving
                        Actor MUST generate a Report Entry communicating this status. 
                        Otherwise, the Actor MAY generate such a Report Entry based 
                        on other criteria.
                     </t>
                     <t hangText="ACL Used Flag"><vspace blankLines="0" /> 
                        The ACL used flag indicates whether the message has a 
                        trailer associated with it that specifies the list of 
                        AMP actors that may participate in the Actions or 
                        definitions associated with the message. This area is
                        still under development.
                     </t>
                  </list>
               </t>
               
               <t hangText="Body"> <vspace blankLines="0" />
                  The message body contains the information associated with the given
                  message. 
               </t>
               
               <t hangText="Trailer"> <vspace blankLines="0" /> 
                  An OPTIONAL access control list (ACL) may be appended as a 
                  trailer to a message. When present, the ACL for a
                  message identifiers the agents and managers that can be affected by
                  the definitions and actions contained within the message. The explicit
                  impact of an ACL is described in the context of each message below.
                  When an ACL trailer is not present, the message results may be visible
                  to any AMP Actor in the network, pursuant to other security protocol
                  implementations.
               </t>
            </list>
         </t>
      </section>
      
      <section title="Register Agent (0x00)" toc="default">
         <t>
            The Register Agent message is used to inform an AMP Manager of
            the presence of another Agent in the network.  
            <figure align="center" anchor="register_agent_msg" title="Register Agent Message Body" suppress-title="false" alt="" width="" height="">
               <artwork align="center" xml:space="preserve" name="" type="" alt="" width="" height="">
+----------+
| Agent ID | 
|  [BLOB]  |
+----------+
               </artwork>
            </figure>
            
            <list hangIndent="8" style="hanging">
               <t hangText="Agent ID"><vspace blankLines="0" /> 
                  The Agent ID MUST represent the unique address of the Agent 
                  in whatever protocol is used to communicate with the Agent. 
               </t>
            </list>
         </t>
      </section>
        
        
      <section title="Data Report (0x12)" toc="default" anchor="rpt_msg_def">
        <t>
        	Reports capture information 
            generated by Agents and transmitted to
            Managers in the AMP. Since the AMP is an asynchronous protocol 
            there is no explicit association between the contents of a Report 
            and a generating action by either a Manager or an Agent.
        </t> 
      	<t>
            Reports are an ordered collection of Report Entries
            collected from a managed device. 
             
            <figure align="center" anchor="data_rpt_msg" title="Data Report Message Body" suppress-title="false">
              <artwork align="center" xml:space="preserve">
+------+---------+-----------+---------+   +---------+
| Time | RX Name | # Entries | ENTRY 1 |   | ENTRY N |
| [TS] |  [BLOB] |   [SDNV]  | [RPTE]  |...| [RPTE]  |
+------+---------+-----------+---------+   +---------+                
              </artwork>
             </figure>

            <list hangIndent="8" style="hanging">
              <t hangText="Time"><vspace blankLines="0" /> 
                 The time at which the Report was generated by the AMP Actor.
              </t>
              <t hangText="RX Name"><vspace blankLines="0" /> 
                 The identifier of the Manager meant to receive this report. 
              </t>
              <t hangText="# Entries"> <vspace blankLines="0" /> 
                 The number of Report Entries in the Report.
              </t>
              <t hangText="ENTRY N"> <vspace blankLines="0" /> 
                 The Nth Report Entry.
              </t>
            </list>
         </t>
      </section>

        
      <section title="Perform Control (0x1A)" toc="default">
         <t>
            The perform control message causes the receiving AMP Actor to
            run one or more pre-configured Controls provided in the message.
          
            <figure align="center" anchor="run_ctlr_msg" title="Perform Control Message Body" suppress-title="false">
               <artwork align="center" xml:space="preserve">
+-------+-----------+
| Start |  Controls |
|  [TS] |    [MC]   |
+-------+-----------+
               </artwork>
            </figure>
          
            <list hangIndent="8" style="hanging">
               <t hangText="Start"> <vspace blankLines="0" /> 
                  The time at which the Controls/Macros should be run.
               </t>
               <t hangText="Controls"> <vspace blankLines="0" /> 
                  The collection of MIDs that represent the Controls and/or Macros to be run by the AMP Actor.  
               </t>
            </list>
         </t>
      </section>    
   </section>
    

    
   <section anchor="IANA" title="IANA Considerations" toc="default">
      <t>
         At this time, this protocol has no fields registered by IANA. However,
         such a registry MUST be established to capture certain data elements
         provided in ADMs, such as nicknames and root OIDs.
      </t>
   </section>
   
   <section anchor="Security" title="Security Considerations" toc="default">
      <t>
         Security within the AMP exists in two layers: transport layer
         security and access control.
      </t>
      
      <t>
         Transport-layer security addresses the questions of authentication,
         integrity, and confidentiality associated with the transport of
         messages between and amongst Managers and Agents. This 
         security is applied before any particular Actor in the system 
         receives data and, therefore, is outside of the scope of this document.
      </t>
      
      <t>
         Finer grain application security is done via ACLs provided in the
         AMP message headers.
      </t>
   </section>
   
</middle>

  <!--  *****BACK MATTER ***** -->
  <back>
    <references title="Informative References">
      <reference anchor="AMA">
        <front>
          <title>Asynchronous Management Architecture</title>
          <author initials="E." surname="Birrane" fullname="E. Birrane">
            <organization />
          </author>
          <date year="2015" month="August" />
          <abstract>
            <t></t>
          </abstract>
         </front>  
         <seriesInfo name="Internet-Draft" value="draft-birrane-dtn-ama-00" />                
      </reference>
      
      <?rfc include="reference.I-D.draft-irtf-dtnrg-dtnmp-01"?>
      
              
    </references>
    <references title="Normative References">
&RFC6256;
&RFC2119;
     
    </references>
    
    <section anchor="contr" title="Acknowledgements" toc="default">
      <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 and has agreed
         to document the access control list and error reporting portion of the 
         specification. 
      </t>
    </section>
    
  </back>
</rfc>