<?xml version="1.0" encoding="US-ASCII"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
<?rfc toc="yes"?>
<?rfc tocompact="yes"?>
<?rfc tocdepth="3"?>
<?rfc tocindent="yes"?>
<?rfc symrefs="yes"?>
<?rfc sortrefs="yes"?>
<?rfc comments="yes"?>
<?rfc inline="yes"?>
<?rfc compact="yes"?>
<?rfc subcompact="no"?>
<rfc category="std" docName="draft-ietf-ippm-ioam-yang-04" ipr="trust200902">
  <front>
    <title abbrev="YANG Model for IOAM">A YANG Data Model for In-Situ
    OAM</title>

    <author fullname="Tianran Zhou" initials="T." surname="Zhou, Ed.">
      <organization>Huawei</organization>

      <address>
        <postal>
          <street>156 Beiqing Rd.</street>

          <city>Beijing</city>

          <code>100095</code>

          <region/>

          <country>China</country>
        </postal>

        <email>zhoutianran@huawei.com</email>
      </address>
    </author>

    <author fullname="Jim Guichard" initials="J." surname="Guichard">
      <organization>Futurewei</organization>

      <address>
        <postal>
          <street/>

          <city/>

          <code/>

          <region/>

          <country>United States of America</country>
        </postal>

        <email>james.n.guichard@futurewei.com</email>
      </address>
    </author>

    <author fullname="Frank Brockners" initials="F." surname="Brockners">
      <organization>Cisco Systems</organization>

      <address>
        <postal>
          <street>Hansaallee 249, 3rd Floor</street>

          <city>Duesseldorf</city>

          <region>Nordrhein-Westfalen</region>

          <code>40549</code>

          <country>Germany</country>
        </postal>

        <phone/>

        <facsimile/>

        <email>fbrockne@cisco.com</email>

        <uri/>
      </address>
    </author>

    <author fullname="Srihari Raghavan" initials="S." surname="Raghavan">
      <organization>Cisco Systems</organization>

      <address>
        <postal>
          <street>Tril Infopark Sez, Ramanujan IT City</street>

          <street>Neville Block, 2nd floor, Old Mahabalipuram Road</street>

          <city>Chennai</city>

          <region>Tamil Nadu</region>

          <code>600113</code>

          <country>India</country>
        </postal>

        <phone/>

        <facsimile/>

        <email>srihari@cisco.com</email>

        <uri/>
      </address>
    </author>

    <date day="07" month="July" year="2022"/>

    <workgroup>IPPM</workgroup>

    <abstract>
      <t>In-situ Operations, Administration, and Maintenance (IOAM) records
      operational and telemetry information in user packets while the packets
      traverse a path between two points in the network. This document defines
      a YANG module for the IOAM function.</t>
    </abstract>
  </front>

  <middle>
    <section title="Introduction">
      <t>In-situ Operations, Administration, and Maintenance (IOAM) <xref
      target="I-D.ietf-ippm-ioam-data"/> records OAM information within user
      packets while the packets traverse a network. The data types and data
      formats for IOAM data records have been defined in <xref
      target="I-D.ietf-ippm-ioam-data"/>. The IOAM data can be embedded in
      many protocol encapsulations such as Network Services Header (NSH) and
      IPv6.</t>

      <t>This document defines a data model for IOAM capabilities using the
      <xref target="RFC7950">YANG data modeling language</xref>. This YANG
      model supports five IOAM options, which are:</t>

      <t><list style="symbols">
          <t><xref target="I-D.ietf-ippm-ioam-data">Incremental Tracing Option
          </xref></t>

          <t><xref target="I-D.ietf-ippm-ioam-data">Pre-allocated Tracing
          Option</xref></t>

          <t><xref target="I-D.ietf-ippm-ioam-direct-export">Direct Export
          Option</xref></t>

          <t><xref target="I-D.ietf-ippm-ioam-data">Proof of Transit (PoT)
          Option</xref></t>

          <t><xref target="I-D.ietf-ippm-ioam-data">Edge-to-Edge
          Option</xref></t>
        </list></t>
    </section>

    <section title="Conventions used in this document">
      <t>The keywords "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
      "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and
      "OPTIONAL" in this document are to be interpreted as described in BCP14,
      <xref target="RFC2119"/>, <xref target="RFC8174"/> when, and only when,
      they appear in all capitals, as shown here.</t>

      <t>The following terms are defined in <xref target="RFC7950"/> and are
      used in this specification: <list style="symbols">
          <t>augment</t>

          <t>data model</t>

          <t>data node</t>
        </list>The terminology for describing YANG data models is found in
      <xref target="RFC7950"/>.</t>

      <section anchor="tree-diagrams" title="Tree Diagrams">
        <t>Tree diagrams used in this document follow the notation defined in
        <xref target="RFC8340"/>.</t>
      </section>
    </section>

    <section title="Design of the IOAM YANG Data Model">
      <t/>

      <section title="Overview">
        <t>The IOAM model is organized as list of profiles as shown in the
        following figure. Each profile associates with one flow and the
        corresponding IOAM information.</t>

        <t>The "ioam-info" is a container for all the read only assistant
        information, so that monitoring systems can interpret the IOAM
        data.</t>

        <t><figure>
            <artwork><![CDATA[module: ietf-ioam
   +--rw ioam
      +--ro ioam-info
      |  +--ro timestamp-type?        identityref
      |  +--ro available-interface* [if-name]
      |     +--ro if-name    if:interface-ref
      +--rw ioam-profiles
         +--rw admin-config
         |  +--rw enabled?   boolean
         +--rw ioam-profile* [profile-name]
            +--rw profile-name                    string
            +--rw filter
            |  +--rw filter-type?   ioam-filter-type
            |  +--rw ace-name?      -> /acl:acls/acl/aces/ace/name
            +--rw protocol-type?                  ioam-protocol-type
            +--rw incremental-tracing-profile {incremental-trace}?
            |  ...
            +--rw preallocated-tracing-profile {preallocated-trace}?
            |  ...
            +--rw direct-export-profile {direct-export}?
            |  ...
            +--rw pot-profile {proof-of-transit}?
            |  ...
            +--rw e2e-profile {edge-to-edge}?
               ...]]></artwork>
          </figure></t>

        <t>In the "ioam-profiles", the "enabled" is an administrative
        configuration. When it is set to true, IOAM configuration is enabled
        for the system. Meanwhile, the IOAM data-plane functionality is
        enabled.</t>

        <t>The "filter" is used to identify a flow, where the IOAM profile can
        apply. There may be multiple filter types. <xref
        target="RFC8519">ACL</xref> is a common way to specify a flow. Each
        IOAM profile can associate with an ACE(Access Control Entry). IOAM
        actions MUST be driven by the accepted packets, when the matched ACE
        "forwarding" action is "accept".</t>

        <t>The IOAM data can be encapsulated into multiple protocols, e.g.,
        <xref target="I-D.ietf-ippm-ioam-ipv6-options">IPv6</xref> and <xref
        target="I-D.ietf-sfc-ioam-nsh">NSH</xref>. The "protocol-type" is used
        to indicate where the IOAM is applied. For example, if the
        "protocol-type" is IPv6, the IOAM ingress node will encapsulate the
        associated flow with the <xref
        target="I-D.ietf-ippm-ioam-ipv6-options">IPv6-IOAM</xref> format.</t>

        <t>IOAM data includes five encapsulation types, i.e., incremental
        tracing data, preallocated tracing data, direct export data, proof of
        transit data and end to end data. In practice, multiple IOAM data
        types can be encapsulated into the same IOAM header. The
        "ioam-profile" contains a set of sub-profiles, each of which relates
        to one encapsulation type. The configured object may not support all
        the sub-profiles. The supported sub-profiles are indicated by 5
        defined features, i.e., "incremental-trace", "preallocated-trace",
        "direct export", "proof-of-transit", "edge-to-edge".</t>
      </section>

      <section title="Preallocated Tracing Profile">
        <t>The IOAM tracing data is expected to be collected at every node
        that a packet traverses to ensure visibility into the entire path a
        packet takes within an IOAM domain. The preallocated tracing option
        will create pre-allocated space for each node to populate its
        information . The "preallocated-tracing-profile" contains the detailed
        information for the preallocated tracing data. The information
        includes:</t>

        <t><list style="symbols">
            <t>enabled: indicates whether the preallocated tracing profile is
            enabled.</t>

            <t>node-action: indicates the operation (e.g., encapsulate IOAM
            header, transit the IOAM data, or decapsulate IOAM header) applied
            to the dedicated flow.</t>

            <t>use-namespace: indicate the namespace used for the trace
            types.</t>

            <t>trace-type: indicates the per-hop data to be captured by the
            IOAM enabled nodes and included in the node data list.</t>

            <t>Loopback mode is used to send a copy of a packet back towards
            the source.</t>

            <t>Active mode indicates that a packet is used for active
            measurement.</t>
          </list><figure align="center">
            <artwork><![CDATA[+--rw preallocated-tracing-profile {preallocated-trace}?
   +--rw enabled?                boolean
   +--rw node-action?            ioam-node-action
   +--rw trace-types
   |  +--rw use-namespace?   ioam-namespace
   |  +--rw trace-type*      ioam-trace-type
   +--rw enable-loopback-mode?   boolean
   +--rw enable-active-mode?   boolean]]></artwork>
          </figure></t>
      </section>

      <section title="Incremental Tracing Profile">
        <t>The incremental tracing option contains a variable node data fields
        where each node allocates and pushes its node data immediately
        following the option header. The "incremental-tracing-profile"
        contains the detailed information for the incremental tracing data.
        The detailed information is the same as the Preallocated Tracing
        Profile, but with one more variable, "max-length", which restricts the
        length of the IOAM header.</t>

        <t><figure align="center">
            <artwork><![CDATA[+--rw incremental-tracing-profile {incremental-trace}?
   +--rw enabled?                boolean
   +--rw node-action?            ioam-node-action
   +--rw trace-types
   |  +--rw use-namespace?   ioam-namespace
   |  +--rw trace-type*   ioam-trace-type
   +--rw enable-loopback-mode?   boolean
   +--rw enable-active-mode?   boolean
   +--rw max-length?             uint32]]></artwork>
          </figure></t>
      </section>

      <section title="Direct Export Profile">
        <t>The direct export option is used as a trigger for IOAM nodes to
        export IOAM data to a receiving entity (or entities). The
        "direct-export-profile" contains the detailed information for the
        direct export data. The detailed information is the same as the
        Preallocated Tracing Profile, but with one more optional variable,
        "flow-id", which is used to correlate the exported data of the same
        flow from multiple nodes and from multiple packets.</t>

        <t><figure align="center">
            <artwork><![CDATA[+--rw direct-export-profile {direct-export}?
   +--rw enabled?                boolean
   +--rw node-action?            ioam-node-action
   +--rw trace-types
   |  +--rw use-namespace?   ioam-namespace
   |  +--rw trace-type*      ioam-trace-type
   +--rw enable-loopback-mode?   boolean
   +--rw enable-active-mode?   boolean
   +--rw flow-id?             uint32]]></artwork>
          </figure></t>
      </section>

      <section title="Proof of Transit Profile">
        <t>The IOAM Proof of Transit data is to support the path or service
        function chain verification use cases. The "pot-profile" contains the
        detailed information for the proof of transit data. "pot-type"
        indicates a particular POT variant that specifies the POT data that is
        included. There may be several POT types, which have different
        configuration data. To align with <xref
        target="I-D.ietf-ippm-ioam-data"/>, this document only defines IOAM
        POT type 0. User need to augment this module for the configuration of
        a specifc POT type.</t>

        <t><figure align="center">
            <artwork><![CDATA[+--rw pot-profile {proof-of-transit}?
   +--rw enabled?    boolean
   +--rw pot-type?   ioam-pot-type]]></artwork>
          </figure></t>
      </section>

      <section title="Edge to Edge Profile">
        <t>The IOAM edge to edge option is to carry data that is added by the
        IOAM encapsulating node and interpreted by IOAM decapsulating node.
        The "e2e-profile" contains the detailed information for the edge to
        edge data. The detailed information includes:</t>

        <t><list style="symbols">
            <t>enabled: indicates whether the edge to edge profile is
            enabled.</t>

            <t>node-action is the same semantic as in Section 2.2.</t>

            <t>use-namespace: indicate the namespace used for the edge to edge
            types.</t>

            <t>e2e-type indicates data to be carried from the ingress IOAM
            node to the egress IOAM node.</t>
          </list><figure align="center">
            <artwork><![CDATA[+--rw e2e-profile {edge-to-edge}?
   +--rw enabled?       boolean
   +--rw node-action?   ioam-node-action
   +--rw e2e-types
      +--rw use-namespace?   ioam-namespace
      +--rw e2e-type*        ioam-e2e-type]]></artwork>
          </figure></t>
      </section>
    </section>

    <section title="IOAM YANG Module">
      <t/>

      <t><figure>
          <artwork><![CDATA[<CODE BEGINS> file "ietf-ioam@2022-07-07.yang"
module ietf-ioam {
  yang-version 1.1;
  namespace "urn:ietf:params:xml:ns:yang:ietf-ioam";
  prefix "ioam";
   
  import ietf-access-control-list {
    prefix "acl";
    reference
      "RFC 8519: YANG Data Model for Network Access Control
       Lists (ACLs)";
  }

  import ietf-interfaces {
    prefix "if";
    reference
      "RFC 8343: A YANG Data Model for Interface Management";
  }

  import ietf-lime-time-types {
    prefix "lime";
    reference
      "RFC 8532: Generic YANG Data Model for the Management of
       Operations, Administration, and Maintenance (OAM) Protocols
       That Use Connectionless Communications";
  }
  
  organization 
    "IETF IPPM (IP Performance Metrics) Working Group";
    
  contact
    "WG Web: <https://datatracker.ietf.org/wg/ippm>
     WG List: <ippm@ietf.org>
     Editor: zhoutianran@huawei.com
     Editor: james.n.guichard@futurewei.com
     Editor: fbrockne@cisco.com
     Editor: srihari@cisco.com";

  description
    "This YANG module specifies a vendor-independent data
     model for the In Situ OAM (IOAM).
      
    Copyright (c) 2021 IETF Trust and the persons identified as
    authors of the code.  All rights reserved.

    Redistribution and use in source and binary forms, with or
    without modification, is permitted pursuant to, and subject
    to the license terms contained in, the Simplified BSD License
    set forth in Section 4.c of the IETF Trust's Legal Provisions
    Relating to IETF Documents
    (http://trustee.ietf.org/license-info).

    This version of this YANG module is part of RFC XXXX; see the
    RFC itself for full legal notices.";    

  revision 2022-07-07 {
    description "First revision.";
    reference "RFC XXXX: A YANG Data Model for In-Situ OAM";
  }

 /*
  * FEATURES
  */
  
  feature incremental-trace
  {
    description 
      "This feature indicated that the incremental tracing option is 
       supported";
    reference "RFC 9197: Data Fields for In-situ OAM";
  }
  
  feature preallocated-trace
  {
    description 
      "This feature indicated that the preallocated tracing option is 
       supported";
    reference "RFC 9197: Data Fields for In-situ OAM";
  }

  feature direct-export
  {
    description 
      "This feature indicated that the direct export option is 
       supported";
    reference "RFC XXXX: In-situ OAM Direct Exporting";
  }

  feature proof-of-transit
  {
    description 
      "This feature indicated that the proof of transit option is 
       supported";
    reference "RFC 9197: Data Fields for In-situ OAM";
  }
  
  feature edge-to-edge
  {
    description 
      "This feature indicated that the edge to edge option is 
       supported";
    reference "RFC 9197: Data Fields for In-situ OAM";
  }

 /*
  * IDENTITIES
  */  
  identity filter {
    description
      "Base identity to represent a filter. A filter is used to
      specify the flow to apply the IOAM profile. ";
  }
  
  identity acl-filter {
    base filter;
    description
      "Apply ACL rules to specify the flow.";
  }
    
  identity protocol {
    description
      "Base identity to represent the carrier protocol. It's used to
       indicate what layer and protocol the IOAM data is embedded.";
  }
  
  identity ipv6 {
    base protocol;
    description
      "The described IOAM data is embedded in IPv6 protocol.";
    reference "RFC XXXX: In-situ OAM IPv6 Options";
  }

  identity nsh  {
    base protocol;
    description
      "The described IOAM data is embedded in NSH.";
    reference
      "RFC XXXX: Network Service Header (NSH) Encapsulation
       for In-situ OAM (IOAM) Data";
  }
  
  identity node-action {
    description
      "Base identity to represent the node actions. It's used to
       indicate what action the node will take.";
  }
  
  identity action-encapsulate {
    base node-action;
    description
      "It indicates the node is to encapsulate the IOAM packet";
  } 

  identity action-decapsulate {
    base node-action;
    description
      "It indicates the node is to decapsulate the IOAM packet";
  }

  identity trace-type {
    description
      "Base identity to represent trace types.";
  }
  
  identity trace-hop-lim-node-id {
    base trace-type;
    description
      "It indicates the presence of Hop_Lim and node_id in the
       node data.";
  }

  identity trace-if-id {
    base trace-type;
    description
      "It indicates presence of ingress_if_id and egress_if_id 
       (short format) in the node data.";
  }

  identity trace-timestamp-seconds {
    base trace-type;
    description
      "It indicates presence of timestamp seconds in the node data.";
  }
  
  identity trace-timestamp-fraction  {
    base trace-type;
    description
      "It indicates presence of timestamp fraction in the node data.";
  }

  identity trace-transit-delay {
    base trace-type;
    description
      "It indicates presence of transit delay in the node data.";
  }

  identity trace-namespace-data {
    base trace-type;
    description
      "It indicates presence of name space specific data (short format)
       in the node data.";
  }

  identity trace-queue-depth {
    base trace-type;
    description
      "It indicates presence of queue depth in the node data.";
  }

  identity trace-checksum-complement {
    base trace-type;
    description
      "It indicates presence of the Checksum Complement node data.";
  }

  identity trace-hop-lim-node-id-wide {
    base trace-type;
    description
      "It indicates presence of Hop_Lim and node_id in wide format 
       in the node data.";
  }

  identity trace-if-id-wide {
    base trace-type;
    description
      "It indicates presence of ingress_if_id and egress_if_id in
       wide format in the node data.";
  }

  identity trace-namespace-data-wide {
    base trace-type;
    description
      "It indicates presence of IOAM-Namespace specific data in wide
       format in the node data.";
  }

  identity trace-buffer-occupancy {
    base trace-type;
    description
      "It indicates presence of buffer occupancy in the node data.";
  }

  identity trace-opaque-state-snapshot {
    base trace-type;
    description
      "It indicates presence of variable length Opaque State Snapshot
       field.";
  }

  identity pot-type {
    description
      "Base identity to represent Proof of Transit (PoT) types.";
  }  

  identity pot-type-0 {
    base pot-type;
    description
      "The IOAM POT Type field value is 0, and POT data is a 16
       Octet field to carry data associated to POT procedures.";
  }

  identity e2e-type {
    description
      "Base identity to represent e2e types";
  }  

  identity e2e-seq-num-64 {
    base e2e-type;
    description
      "It indicates presence of a 64-bit sequence number.";
  }

  identity e2e-seq-num-32 {
    base e2e-type;
    description
      "It indicates the presence of a 32-bit sequence number.";
  }

  identity e2e-timestamp-seconds {
    base e2e-type;
    description
      "It indicates the presence of timestamp seconds representing
       the time at which the packet entered the IOAM-domain";
  }

  identity e2e-timestamp-fraction {
    base e2e-type;
    description
      "It indicates the presence of timestamp fraction representing
       the time at which the packet entered the IOAM-domain.";
  }

  identity namespace {
    description
      "Base identity to represent the Namespace-ID.";
  }  

  identity default-namespace {
    base namespace;
    description
      "The Namespace-ID value of 0x0000 is defined as the 
       Default-Namespace-ID and must be known to all the nodes
       implementing IOAM.";
  }
  
 /*
  * TYPE DEFINITIONS
  */
  typedef ioam-filter-type {
    type identityref {
      base filter;
    }
    description
      "It specifies a known type of filter.";
  }
  
  typedef ioam-protocol-type {
    type identityref {
      base protocol;
    }
    description
      "It specifies a known type of carrier protocol for the IOAM
       data.";
  }
  
  typedef ioam-node-action {
    type identityref {
      base node-action;
    }
    description
      "It specifies a known type of node action.";
  }

  typedef ioam-trace-type {
    type identityref {
      base trace-type;
    }
    description
      "It specifies a known trace type.";
  }

  typedef ioam-pot-type {
    type identityref {
      base pot-type;
    }
    description
      "It specifies a known pot type.";
  }

  typedef ioam-e2e-type {
    type identityref {
      base e2e-type;
    }
    description
      "It specifies a known e2e type.";
  }

  typedef ioam-namespace {
    type identityref {
      base namespace;
    }
    description
      "It specifies the supported namespace.";
  }
  
 /*
  * GROUP DEFINITIONS
  */
   
  grouping ioam-filter {
    description "A grouping for IOAM filter definition";
    
    leaf filter-type {
      type ioam-filter-type;
      description "filter type";
    }
    
    leaf ace-name {
      when "derived-from-or-self(../filter-type, 'ioam:acl-filter')";
      type leafref {
        path "/acl:acls/acl:acl/acl:aces/acl:ace/acl:name";
      }
      description "The Access Control Entry name is used to 
      refer to an ACL specification.";
    }
  }
  
  grouping encap-tracing {
    description
      "A grouping for the generic configuration for
       tracing profile.";

    container trace-types {
      description
        "It indicates the list of trace types for encapsulation";

      leaf use-namespace {
        type ioam-namespace;
        description
          "It indicates the name space used for encapsulation";
      }
  
      leaf-list trace-type {
        type ioam-trace-type;
        description
          "The trace type is only defined at the encapsulation node.";
      }
    }

    leaf enable-loopback-mode {
      type boolean;
      default false;
      description
        "Loopback mode is used to send a copy of a packet back towards
        the source. The loopback mode is only defined at the
        encapsulation node.";
    }

    leaf enable-active-mode {
      type boolean;
      default false;
      description
        "Active mode indicates that a packet is used for active
         measurement. An IOAM decapsulating node that receives a
         packet with the Active flag set in one of its Trace options
         must terminate the packet.";
    }  
  }
  
  grouping ioam-incremental-tracing-profile {   
    description
      "A grouping for incremental tracing profile.";

    leaf node-action {
      type ioam-node-action;
      description 
        "This object indicates the action the node need to
         take, e.g. encapsulation.";
    }

    uses encap-tracing {
      when "derived-from-or-self(node-action, 
           'ioam:action-encapsulate')";
    }
     
    leaf max-length {
      when "derived-from-or-self(../node-action, 
            'ioam:action-encapsulate')";
      type uint32;
      units bytes;
      description
        "This field specifies the maximum length of the node data list
        in octets. The max-length is only defined at the
        encapsulation node, and it's only used for the incremental 
        tracing mode.";
    }
  }

  grouping ioam-preallocated-tracing-profile {   
    description
      "A grouping for incremental tracing profile.";

    
    leaf node-action {
      type ioam-node-action;
      description "This indicates what action the node will take,
      e.g. encapsulation.";
    }

    uses encap-tracing {
      when "derived-from-or-self(node-action, 
           'ioam:action-encapsulate')";
    }
  }

  grouping ioam-direct-export-profile {   
    description
      "A grouping for direct export profile.";
    
    leaf node-action {
      type ioam-node-action;
      description "This indicates what action the node will take,
      e.g. encapsulation.";
    }

    uses encap-tracing {
      when "derived-from-or-self(node-action, 
           'ioam:action-encapsulate')";
    }

    leaf flow-id {
      when "derived-from-or-self(../node-action, 
           'ioam:action-encapsulate')";
      type uint32;
      description
        "A 32-bit flow identifier. The field is set at the
         encapsulating node. The Flow ID can be uniformly assigned
         by a central controller or algorithmically generated by the
         encapsulating node. The latter approach cannot guarantee
         the uniqueness of Flow ID, yet the conflict probability is
         small due to the large Flow ID space.flow-id is used to
         correlate the exported data of the same flow from multiple
         nodes and from multiple packets.";
    }
  }

  grouping ioam-e2e-profile {
    description
      "A grouping for edge-to-edge profile.";
    
    leaf node-action {
      type ioam-node-action;
      description
        "It indicates how the node acts for this profile";
    }
    
    container e2e-types {
      when "derived-from-or-self(../node-action, 
           'ioam:action-encapsulate')";

      description
        "It indicates the list of e2e types for encapsulation";

      leaf use-namespace {
        type ioam-namespace;
        description
          "It indicates the name space used for encapsulation";
      }

      leaf-list e2e-type {
        type ioam-e2e-type;
        description
          "The e2e type is only defined at the encapsulation node.";
      }
    }
  }

  grouping ioam-admin-config {
    description
      "IOAM top-level administrative configuration.";

    leaf enabled {
      type boolean;
      default false;
      description
        "This object is to control the availability of configuration.
         It must be true before anything in the 
         /ioam/ioam-profiles/ioam-profile subtree can be edited.
         If false, any configuration in place is not used.";
    }
  }

 /*
  * DATA NODES
  */
   
  container ioam {
    description "IOAM top level container";

    container ioam-info {
      config false;
      description
        "Describes assistant information such as units or timestamp 
         format. So that monitoring systems can interpret the IOAM
         data.";
      
      leaf timestamp-type {
        type identityref {
          base lime:timestamp-type;
        }
        description
          "Type of timestamp, such as Truncated PTP or NTP.";
      }

      list available-interface {
        key "if-name";
        description
          "A list of available interfaces that support IOAM.";
        leaf if-name {
          type if:interface-ref;
          description "This is a reference to the Interface name.";
        }
      }
    }

    container ioam-profiles {
      description
        "Contains a list of IOAM profiles.";

      container admin-config {
        description
          "Contains all the administrative configurations related to 
           the IOAM functionalities and all the IOAM profiles.";
       
        uses ioam-admin-config;
      }
        
      list ioam-profile {
        key "profile-name";
        description
          "A list of IOAM profiles that configured on the node. 
           There is no mandatory type of profile (e.g., 
           incremental-trace, preallocated-trace.) in the list. 
           But at least one profile should be added.";
        
        leaf profile-name {
          type string{
            length "1 .. max";
          }
          description
            "Unique identifier for each IOAM profile";
        }
        
        container filter {
          uses ioam-filter;
          description
            "The filter which is used to indicate the flow to apply
            IOAM.";
        }
          
        leaf protocol-type {
          type ioam-protocol-type;
          description
            "This item is used to indicate the carrier protocol where
            the IOAM is applied.";
        }

        container incremental-tracing-profile {
          if-feature incremental-trace;
          description
            "It describes the profile for incremental tracing option";

          leaf enabled {
            type boolean;
            default false;
            description
              "When true, apply incremental tracing option to the
               specified flow identified by the filter.";
          }

          uses ioam-incremental-tracing-profile;
        }

        container preallocated-tracing-profile {
          if-feature preallocated-trace;
          description
            "It describes the profile for preallocated tracing option";

          leaf enabled {
            type boolean;
            default false;
            description
              "When true, apply preallocated tracing option to the
               specified flow identified by the following filter.";
          }

          uses ioam-preallocated-tracing-profile;
        }

        container direct-export-profile {
          if-feature direct-export;
          description
            "It describes the profile for direct-export option";

          leaf enabled {
            type boolean;
            default false;
            description
              "When true, apply direct-export option to the
               specified flow identified by the following filter.";
          }

          uses ioam-direct-export-profile;
        }

        container pot-profile {
          if-feature proof-of-transit;
          description
            "It describes the profile for PoT option";

          leaf enabled {
            type boolean;
            default false;
            description
              "When true, apply Proof of Transit option to the
               specified flow identified by the following filter.";
          }
 
          leaf pot-type {
            type ioam-pot-type;
            description
              "The type of a particular POT variant that specifies
               the POT data that is included..";
          }
        }

        container e2e-profile {
          if-feature edge-to-edge;
          description
            "It describes the profile for e2e option";
          
          leaf enabled {
            type boolean;
            default false;
            description
              "When true, apply edge-to-edge option to the
               specified flow identified by the following filter.";
          }
         
          uses ioam-e2e-profile;
        }
      }
    }
  }    
}
<CODE ENDS>]]></artwork>
        </figure></t>

      <t/>
    </section>

    <section anchor="Security" title="Security Considerations">
      <t>The YANG module specified in this document defines a schema for data
      that is designed to be accessed via network management protocols such as
      <xref target="RFC6241">NETCONF</xref> or <xref
      target="RFC8040">RESTCONF</xref>. The lowest NETCONF layer is the secure
      transport layer, and the mandatory-to-implement secure transport is
      <xref target="RFC6242">Secure Shell (SSH)</xref>. The lowest RESTCONF
      layer is HTTPS, and the mandatory-to-implement secure transport is <xref
      target="RFC8446">TLS</xref>.</t>

      <t>The <xref target="RFC8341">Network Configuration Access Control Model
      (NACM)</xref> provides the means to restrict access for particular
      NETCONF or RESTCONF users to a preconfigured subset of all available
      NETCONF or RESTCONF protocol operations and content.</t>

      <t>There are a number of data nodes defined in this YANG module that are
      writable/creatable/deletable (i.e., config true, which is the default).
      These data nodes may be considered sensitive or vulnerable in some
      network environments. Write operations (e.g., edit-config) to these data
      nodes without proper protection can have a negative effect on network
      operations. These are the subtrees and data nodes and their
      sensitivity/vulnerability:</t>

      <t><list style="symbols">
          <t>/ioam/ioam-profiles/admin-config</t>
        </list></t>

      <t>The items in the container above include the top level administrative
      configurations related to the IOAM functionalities and all the IOAM
      profiles. Unexpected changes to these items could lead to the IOAM
      function disruption and/ or misbehavior of all the IOAM profiles.</t>

      <t><list style="symbols">
          <t>/ioam/ioam-profiles/ioam-profile</t>
        </list></t>

      <t>The entries in the list above include the whole IOAM profile
      configurations which indirectly create or modify the device
      configurations. Unexpected changes to these entries could lead to the
      mistake of the IOAM behavior for the corresponding flows.</t>
    </section>

    <section anchor="IANA" title="IANA Considerations">
      <t>RFC Ed.: In this section, replace all occurrences of 'XXXX' with the
      actual RFC number (and remove this note).</t>

      <t>IANA is requested to assign a new URI from the <xref
      target="RFC3688">IETF XML Registry</xref>. The following URI is
      suggested:</t>

      <t><figure>
          <artwork align="left"><![CDATA[        URI: urn:ietf:params:xml:ns:yang:ietf-ioam
        Registrant Contact: The IESG.
        XML: N/A; the requested URI is an XML namespace.]]></artwork>
        </figure></t>

      <t>This document also requests a new YANG module name in the <xref
      target="RFC7950">YANG Module Names registry</xref> with the following
      suggestion:</t>

      <t><figure>
          <artwork align="left"><![CDATA[        name: ietf-ioam
        namespace: urn:ietf:params:xml:ns:yang:ietf-ioam
        prefix: ioam
        reference: RFC XXXX]]></artwork>
        </figure></t>
    </section>

    <section anchor="Acknowledgements" title="Acknowledgements">
      <t>For their valuable comments, discussions, and feedback, we wish to
      acknowledge Greg Mirsky, Reshad Rahman, Tom Petch and Mickey
      Spiegel.</t>
    </section>
  </middle>

  <back>
    <references title="Normative References">
      <?rfc include='reference.RFC.2119'?>

      <?rfc include='reference.RFC.8174'?>

      <?rfc include='reference.RFC.7950'?>

      <?rfc include='reference.RFC.8340'?>

      <?rfc include='reference.RFC.3688'?>

      <?rfc include='reference.RFC.6241'?>

      <?rfc include='reference.RFC.8040'?>

      <?rfc include='reference.RFC.6242'?>

      <?rfc include='reference.RFC.8446'?>

      <?rfc include='reference.RFC.8341'?>

      <?rfc include='reference.RFC.8519'?>

      <?rfc include='reference.RFC.8532'?>

      <?rfc include='reference.I-D.ietf-ippm-ioam-data'?>

      <?rfc include='reference.I-D.ietf-ippm-ioam-direct-export'?>
    </references>

    <references title="Informative References">
      <?rfc include='reference.I-D.ietf-sfc-ioam-nsh'?>

      <?rfc include='reference.I-D.ietf-ippm-ioam-ipv6-options'?>
    </references>

    <section title="Examples">
      <t>This appendix is non-normative.</t>

      <t>tbd</t>
    </section>
  </back>
</rfc>
