<?xml version="1.0" encoding="US-ASCII"?>
<!-- edited with XMLSPY v5 rel. 3 U (http://www.xmlspy.com)
     by Daniel M Kohn (private) -->
<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
<!ENTITY rfc2119 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml">
<!ENTITY RFC3775 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.3775.xml">
<!ENTITY RFC4225 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.4225.xml">
<!ENTITY RFC4866 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.4866.xml">
<!ENTITY RFC5213 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.5213.xml">
<!-- added by sjjeong: -->
<!ENTITY I-D.ietf-netlmm-pmip6-ipv4-support PUBLIC "" "http://xml.resource.org/public/rfc/bibxml3/reference.I-D.ietf-netlmm-pmip6-ipv4-support.xml">
<!ENTITY I-D.ietf-netlmm-grekey-option PUBLIC "" "http://xml.resource.org/public/rfc/bibxml3/reference.I-D.ietf-netlmm-grekey-option.xml">
]>
<rfc category="std"
     docName="draft-ietf-lime-yang-connectionless-oam-methods-09"
     ipr="trust200902">
  <?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>

  <?rfc toc="yes" ?>

  <?rfc symrefs="yes" ?>

  <?rfc sortrefs="yes"?>

  <?rfc iprnotified="no" ?>

  <?rfc strict="yes" ?>

  <front>
    <title abbrev="Retrieval Methods CL OAM YANG model">Retrieval Methods YANG
    Data Model for Connectionless Operations, Administration, and
    Maintenance(OAM) protocols</title>

    <author fullname="Deepak Kumar" initials="D." surname="Kumar">
      <organization abbrev="Cisco">CISCO Systems</organization>

      <address>
        <postal>
          <street>510 McCarthy Blvd</street>

          <street/>

          <city>Milpitas</city>

          <region>CA</region>

          <code>95035</code>

          <country>USA</country>
        </postal>

        <email>dekumar@cisco.com</email>
      </address>
    </author>

    <author fullname="Michael Wang" initials="M." surname="Wang">
      <organization abbrev="Huawei">Huawei Technologies,Co.,Ltd</organization>

      <address>
        <postal>
          <street>101 Software Avenue, Yuhua District</street>

          <street/>

          <city>Nanjing</city>

          <region/>

          <code>210012</code>

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

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

    <author fullname="Qin Wu" initials="Q." surname="Wu">
      <organization>Huawei</organization>

      <address>
        <postal>
          <street>101 Software Avenue, Yuhua District</street>

          <city>Nanjing</city>

          <region>Jiangsu</region>

          <code>210012</code>

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

        <email>bill.wu@huawei.com</email>
      </address>
    </author>

    <author fullname="Reshad Rahman" initials="R." surname="Rahman">
      <organization abbrev="Cisco">CISCO Systems</organization>

      <address>
        <postal>
          <street>2000 Innovation Drive</street>

          <street/>

          <city>Kanata</city>

          <region>Ontario</region>

          <code>K2K 3E8</code>

          <country>Canada</country>
        </postal>

        <email>rrahman@cisco.com</email>
      </address>
    </author>

    <author fullname="Srihari Raghavan" initials="S." surname="Raghavan">
      <organization abbrev="Cisco">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>

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

    <date year="2017"/>

    <area>OPS Area</area>

    <workgroup/>

    <abstract>
      <t>This document presents a retrieval method YANG Data model for
      connectionless OAM protocols. It provides technology-independent RPC
      operations for connectionless OAM protocols. The retrieval methods model
      presented here can be extended to include technology specific details.
      This is leading to uniformity between OAM protocols and support both
      nested OAM workflows (i.e., performing OAM functions at different levels
      through a unified interface) and interacting OAM workflows ( i.e.,
      performing OAM functions at same levels through a unified
      interface).</t>
    </abstract>
  </front>

  <middle>
    <section title="Introduction">
      <t>Operations, Administration, and Maintenance (OAM) are important
      networking functions that allow operators to: <list style="numbers">
          <t>Monitor reachability of destinations (Reachability Verification,
          Continuity Check).</t>

          <t>Troubleshoot failures (Fault verification and localization).</t>

          <t>Monitor Performance</t>
        </list></t>

      <t>An overview of OAM tools is presented at <xref
      target="RFC7276"/>.</t>

      <t>Ping and Traceroute <xref target="RFC792"/>, <xref target="RFC4443"/>
      and BFD <xref target="RFC5880"/> are well-known fault verification and
      isolation tools, respectively, for IP networks. Over the years,
      different technologies have developed similar tools for similar
      purposes.</t>

      <t>In this document, we present an on-demand retrieval method YANG Data
      model for connectionless OAM protocols. This model provides
      technology-independent RPC operations for connectionless OAM protocols.
      It is separated from the generic YANG model for connectionless OAM <xref
      target="I-D.ietf-lime-yang-connectionless-oam"/> and can avoid mixing
      the models for the retrieved-data from the retrieval procedures. It is
      expected that retrieval procedures would evolve faster than the data
      model <xref target="I-D.ietf-lime-yang-connectionless-oam"/> and will
      allow new procedures to be defined for retrieval of the same data
      defined by the base data model.</t>
    </section>

    <section title="Conventions used in this document">
      <t>The following terms are defined in <xref target="RFC6241"/> and are
      not redefined here: <list style="symbols">
          <t>client</t>

          <t>configuration data</t>

          <t>server</t>

          <t>state data</t>
        </list></t>

      <t>The following terms are defined in <xref target="RFC6020"/> and are
      not redefined here: <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="RFC6020"/>.</t>

      <section title="Terminology">
        <t>TP - Test Point</t>

        <t>MAC - Media Access Control</t>

        <t>RPC - A Remote Procedure Call</t>

        <t>RPC operation - A specific Remote Procedure Call</t>
      </section>

      <section title="Tree Diagrams">
        <t>A simplified graphical representation of the data model is used in
        this document. The meaning of the symbols in these diagrams is as
        follows:</t>

        <t>Each node is printed as:<figure>
            <artwork>
&lt;status&gt; &lt;flags&gt; &lt;name&gt; &lt;opts&gt; &lt;type&gt;

&lt;status&gt; is one of:
     +  for current


&lt;flags&gt; is one of:

    rw for configuration data 
    ro for non-configuration data
    -x for rpcs
    -n for notifications


&lt;name&gt; is the name of the node</artwork>
          </figure></t>

        <t>If the node is augmented into the tree from another module, its
        name is printed as &lt;prefix&gt;:&lt;name&gt;. <figure>
            <artwork>&lt;opts&gt; is one of:

     ?  for an optional leaf or choice
     !  for a presence container
     *  for a leaf-list or list
     [&lt;keys&gt;] for a list's keys

&lt;type&gt; is the name of the type for leafs and leaf-lists</artwork>
          </figure></t>
      </section>
    </section>

    <section title="Overview of the Connectionless OAM retrieval methods Model">
      <t>In this document, we present an on-demand retrieval method YANG Data
      model for connectionless OAM protocols. This model provides
      technology-independent retrieval procedures (RPC operations) for
      connectionless OAM protocols. It provides a flexible way to retrieve the
      data which defined by the "ietf-connectionless-oam.yang" <xref
      target="I-D.ietf-lime-yang-connectionless-oam"/>.</t>

      <section title="RPC operation definitions">
        <t>The RPC model facilitates issuing commands to a NETCONF server (in
        this case to the device that need to execute the OAM command) and
        obtaining a response.</t>

        <t>Under 'connectionless-oam-methods' module, we summarize common OAM
        functions and define two generic RPC operations: 'continuity-check'
        and 'path-discovery'. In practice, these RPC operations are activated
        on-demand and supported by corresponding technology-specific OAM tools
        <xref target="RFC7276"/>. For example, for the IP OAM model, the
        continuity-check RPC corresponds to the IP Ping <xref
        target="RFC792"/> <xref target="RFC4443"/>, while the path-discovery
        RPC operation corresponds to IP Traceroute <xref target="RFC792"/>
        <xref target="RFC4443"/>.</t>

        <t>Note that the RPC operation presented in this document is the base
        building block, which is used to derive a model for a
        technology-specific OAM (i.e., ICMP ping <xref target="RFC792"/> <xref
        target="RFC4443"/>, LSP ping <xref target="RFC8029"/>), the base
        building block should be extended with corresponding technology
        specific parameters. To facilitate this for future enhancements to
        data retrieval methods, the RPCs are captured under a separate
        module.</t>

        <t>The generic 'path-discovery-data' and 'continuity-check-data'
        groupings are used as data outputs from different RPCs described in
        this document. Similar methods including other RPCs can retrieve the
        data using the same data model.</t>

        <figure title="Snippet of data hierarchy related to RPC operations">
          <artwork>     rpc continuity-check {
      if-feature coam:continuity-check;
      description
        "Continuity-check RPC operation as per RFC7276.";
      input {
      uses rpc-input-parameters;
      ....
      }
    output {
      container error-code {
        leaf protocol-id {
          type identityref {
            base protocol-id;
          }
          mandatory true;
          description
            "Protocol used in CC. This could be a standard
             protocol (eg., TCP/IP protocols, MPLS etc.,) 
             or a proprietary protocol as identified by
             this field.";
        }
        leaf protocol-id-meta-data {
          type uint64;
          description
            "An optional meta-data related to the protocol ID.
             For eg., this could be the Internet Protocol number
             for standard Internet Protocols for help in protocol
             processing.";
        }
        leaf status-code {
          type identityref{
         base status-code;
       }
          mandatory true;
          description
            "Error code for CC.";
        }
        leaf status-sub-code {
          type identityref{
          base status-sub-code;
       }
          mandatory true;
          description
            "Sub code for CC.";
        }
        description
          "Error code and Sub Code for CC.";
      }
      uses coam:continuity-check-data;
    }
  }

    rpc path-discovery {
      description
        "path discovery RPC operation as per RFC7276.";
      input {
      uses rpc-input-parameters;
      .....
      }
    output {
      list response-list {
        key "response-index";
        description
          "Path discovery response list.";
        leaf response-index {
          type uint32;
          mandatory true;
          description
            "Response index.";
        }
        leaf protocol-id {
          type identityref {
            base protocol-id;
          }
          mandatory true;
          description
            "Protocol used in PD. This could be a standard
             protocol (eg., TCP/IP protocols, MPLS etc.,) 
             or a proprietary protocol as identified by
             this field.";
        }
        leaf protocol-id-meta-data {
          type uint64;
          description
            "An optional meta-data related to the protocol ID.
             For eg., this could be the Internet Protocol number
             for standard Internet Protocols for help in protocol
             processing.";
        }
        leaf status-code {
          type identityref{
          base status-code;
        }
          mandatory true;
          description
            "Error code for Path Discovery. ";
        }
        leaf status-sub-code {
          type identityref{
          base status-sub-code;
       }
          mandatory true;
          description
            "Sub code for Path Discovery. ";
        }
      }
      uses coam:path-discovery-data;
    }
  }</artwork>
        </figure>
      </section>

      <section title="OAM Retrieval Methods Hierarchy">
        <t>The complete data hierarchy related to the Connectionless OAM
        Retrieval Methods YANG model is presented below.</t>

        <figure title="data hierarchy of OAM Retrieval Methods">
          <artwork>
module: ietf-connectionless-oam-methods
rpcs:
   +---x continuity-check {coam:continuity-check}?
   |  +---w input
   |  |  +---w destination-tp
   |  |  |  +---w tp-location-type    identityref
   |  |  |  +---w mac-address
   |  |  |  |  +---w mac-address    yang:mac-address
   |  |  |  +---w ipv4-address
   |  |  |  |  +---w ipv4-address    inet:ipv4-address
   |  |  |  +---w ipv6-address
   |  |  |  |  +---w ipv6-address    inet:ipv6-address
   |  |  |  +---w tp-attribute
   |  |  |  |  +---w tp-attribute-type?     address-attribute-type
   |  |  |  |  +---w (tp-attribute-value)?
   |  |  |  |     +--:(ip-prefix)
   |  |  |  |     |  +---w ip-prefix?             inet:ip-prefix
   |  |  |  |     +--:(bgp)
   |  |  |  |     |  +---w bgp?                   inet:ip-prefix
   |  |  |  |     +--:(tunnel)
   |  |  |  |     |  +---w tunnel-interface?      uint32
   |  |  |  |     +--:(pw)
   |  |  |  |     |  +---w remote-pe-address?     inet:ip-address
   |  |  |  |     |  +---w pw-id?                 uint32
   |  |  |  |     +--:(vpls)
   |  |  |  |     |  +---w route-distinguisher?   rt:route-distinguisher
   |  |  |  |     |  +---w sender-ve-id?          uint16
   |  |  |  |     |  +---w receiver-ve-id?        uint16
   |  |  |  |     +--:(mpls-mldp)
   |  |  |  |        +---w (root-address)?
   |  |  |  |           +--:(ip-address)
   |  |  |  |           |  +---w source-address?        inet:ip-address
   |  |  |  |           |  +---w group-ip-address?      inet:ip-address
   |  |  |  |           +--:(vpn)
   |  |  |  |           |  +---w as-number?             inet:as-number
   |  |  |  |           +--:(global-id)
   |  |  |  |              +---w lsp-id?                string
   |  |  |  +---w system-info
   |  |  |     +---w system-id?   rt:router-id
   |  |  +---w source-interface      if:interface-ref
   |  |  +---w outbound-interface    if:interface-ref
   |  |  +---w vrf?                  coam:routing-instance-ref
   |  |  +---w session-type?         enumeration
   |  |  +---w count?                uint32
   |  |  +---w ttl?                  uint8
   |  |  +---w packet-size?          uint32
   |  +--ro output
   |     +--ro error-code
   |     |  +--ro protocol-id        identityref
   |     |  +--ro protocol-id-meta-data	uint64
   |     |  +--ro status-code        identityref
   |     |  +--ro status-sub-code    identityref
   |     +--ro src-test-point
   |     |  +--ro ni?                 routing-instance-ref
   |     |  +--ro tp-location-type    identityref
   |     |  +--ro mac-address
   |     |  |  +--ro mac-address    yang:mac-address
   |     |  +--ro ipv4-address
   |     |  |  +--ro ipv4-address    inet:ipv4-address
   |     |  +--ro ipv6-address
   |     |  |  +--ro ipv6-address    inet:ipv6-address
   |     |  +--ro tp-attribute
   |     |  |  +--ro tp-attribute-type?     address-attribute-type
   |     |  |  +--ro (tp-attribute-value)?
   |     |  |     +--:(ip-prefix)
   |     |  |     |  +--ro ip-prefix?             inet:ip-prefix
   |     |  |     +--:(bgp)
   |     |  |     |  +--ro bgp?                   inet:ip-prefix
   |     |  |     +--:(tunnel)
   |     |  |     |  +--ro tunnel-interface?      uint32
   |     |  |     +--:(pw)
   |     |  |     |  +--ro remote-pe-address?     inet:ip-address
   |     |  |     |  +--ro pw-id?                 uint32
   |     |  |     +--:(vpls)
   |     |  |     |  +--ro route-distinguisher?   rt:route-distinguisher
   |     |  |     |  +--ro sender-ve-id?          uint16
   |     |  |     |  +--ro receiver-ve-id?        uint16
   |     |  |     +--:(mpls-mldp)
   |     |  |        +--ro (root-address)?
   |     |  |           +--:(ip-address)
   |     |  |           |  +--ro source-address?        inet:ip-address
   |     |  |           |  +--ro group-ip-address?      inet:ip-address
   |     |  |           +--:(vpn)
   |     |  |           |  +--ro as-number?             inet:as-number
   |     |  |           +--:(global-id)
   |     |  |              +--ro lsp-id?                string
   |     |  +--ro system-info
   |     |  |  +--ro system-id?   rt:router-id
   |     |  +--ro egress-intf-name?   if:interface-ref
   |     +--ro dest-test-point
   |     |  +--ro ni?                  routing-instance-ref
   |     |  +--ro tp-location-type     identityref
   |     |  +--ro mac-address
   |     |  |  +--ro mac-address    yang:mac-address
   |     |  +--ro ipv4-address
   |     |  |  +--ro ipv4-address    inet:ipv4-address
   |     |  +--ro ipv6-address
   |     |  |  +--ro ipv6-address    inet:ipv6-address
   |     |  +--ro tp-attribute
   |     |  |  +--ro tp-attribute-type?     address-attribute-type
   |     |  |  +--ro (tp-attribute-value)?
   |     |  |     +--:(ip-prefix)
   |     |  |     |  +--ro ip-prefix?             inet:ip-prefix
   |     |  |     +--:(bgp)
   |     |  |     |  +--ro bgp?                   inet:ip-prefix
   |     |  |     +--:(tunnel)
   |     |  |     |  +--ro tunnel-interface?      uint32
   |     |  |     +--:(pw)
   |     |  |     |  +--ro remote-pe-address?     inet:ip-address
   |     |  |     |  +--ro pw-id?                 uint32
   |     |  |     +--:(vpls)
   |     |  |     |  +--ro route-distinguisher?   rt:route-distinguisher
   |     |  |     |  +--ro sender-ve-id?          uint16
   |     |  |     |  +--ro receiver-ve-id?        uint16
   |     |  |     +--:(mpls-mldp)
   |     |  |        +--ro (root-address)?
   |     |  |           +--:(ip-address)
   |     |  |           |  +--ro source-address?        inet:ip-address
   |     |  |           |  +--ro group-ip-address?      inet:ip-address
   |     |  |           +--:(vpn)
   |     |  |           |  +--ro as-number?             inet:as-number
   |     |  |           +--:(global-id)
   |     |  |              +--ro lsp-id?                string
   |     |  +--ro system-info
   |     |  |  +--ro system-id?   rt:router-id
   |     |  +--ro ingress-intf-name?   if:interface-ref
   |     +--ro sequence-number?             uint64
   |     +--ro hop-cnt?                     uint8
   |     +--ro session-packet-statistics
   |     |  +--ro rx-packet-count?    uint32
   |     |  +--ro tx-packet-count?    uint32
   |     |  +--ro rx-bad-packet?      uint32
   |     |  +--ro tx-packet-failed?   uint32
   |     +--ro session-error-statistics
   |     |  +--ro packet-drops-count?         uint32
   |     |  +--ro packet-reorder-count?       uint32
   |     |  +--ro packets-out-of-seq-count?   uint32
   |     |  +--ro packets-dup-count?          uint32
   |     +--ro session-delay-statistics
   |     |  +--ro time-resolution-value?   identityref
   |     |  +--ro min-delay-value?         uint32
   |     |  +--ro max-delay-value?         uint32
   |     |  +--ro average-delay-value?     uint32
   |     +--ro session-jitter-statistics
   |        +--ro time-resolution-value?   identityref
   |        +--ro min-jitter-value?        uint32
   |        +--ro max-jitter-value?        uint32
   |        +--ro average-jitter-value?    uint32
   +---x path-discovery {coam:path-discovery}?
      +---w input
      |  +---w destination-tp
      |  |  +---w tp-location-type    identityref
      |  |  +---w mac-address
      |  |  |  +---w mac-address    yang:mac-address
      |  |  +---w ipv4-address
      |  |  |  +---w ipv4-address    inet:ipv4-address
      |  |  +---w ipv6-address
      |  |  |  +---w ipv6-address    inet:ipv6-address
      |  |  +---w tp-attribute
      |  |  |  +---w tp-attribute-type?     address-attribute-type
      |  |  |  +---w (tp-attribute-value)?
      |  |  |     +--:(ip-prefix)
      |  |  |     |  +---w ip-prefix?             inet:ip-prefix
      |  |  |     +--:(bgp)
      |  |  |     |  +---w bgp?                   inet:ip-prefix
      |  |  |     +--:(tunnel)
      |  |  |     |  +---w tunnel-interface?      uint32
      |  |  |     +--:(pw)
      |  |  |     |  +---w remote-pe-address?     inet:ip-address
      |  |  |     |  +---w pw-id?                 uint32
      |  |  |     +--:(vpls)
      |  |  |     |  +---w route-distinguisher?   rt:route-distinguisher
      |  |  |     |  +---w sender-ve-id?          uint16
      |  |  |     |  +---w receiver-ve-id?        uint16
      |  |  |     +--:(mpls-mldp)
      |  |  |        +---w (root-address)?
      |  |  |           +--:(ip-address)
      |  |  |           |  +---w source-address?        inet:ip-address
      |  |  |           |  +---w group-ip-address?      inet:ip-address
      |  |  |           +--:(vpn)
      |  |  |           |  +---w as-number?             inet:as-number
      |  |  |           +--:(global-id)
      |  |  |              +---w lsp-id?                string
      |  |  +---w system-info
      |  |     +---w system-id?   rt:router-id
      |  +---w source-interface      if:interface-ref
      |  +---w outbound-interface    if:interface-ref
      |  +---w vrf?                  coam:routing-instance-ref
      |  +---w session-type?         enumeration
      |  +---w max-ttl?              uint8
      +--ro output
         +--ro response-list* [response-index]
         |  +--ro response-index     uint32
         |  +--ro protocol-id        identityref
         |  +--ro protocol-id-meta-data	uint64
         |  +--ro status-code        identityref
         |  +--ro status-sub-code    identityref
         +--ro src-test-point
         |  +--ro ni?                 routing-instance-ref
         |  +--ro tp-location-type    identityref
         |  +--ro mac-address
         |  |  +--ro mac-address    yang:mac-address
         |  +--ro ipv4-address
         |  |  +--ro ipv4-address    inet:ipv4-address
         |  +--ro ipv6-address
         |  |  +--ro ipv6-address    inet:ipv6-address
         |  +--ro tp-attribute
         |  |  +--ro tp-attribute-type?     address-attribute-type
         |  |  +--ro (tp-attribute-value)?
         |  |     +--:(ip-prefix)
         |  |     |  +--ro ip-prefix?             inet:ip-prefix
         |  |     +--:(bgp)
         |  |     |  +--ro bgp?                   inet:ip-prefix
         |  |     +--:(tunnel)
         |  |     |  +--ro tunnel-interface?      uint32
         |  |     +--:(pw)
         |  |     |  +--ro remote-pe-address?     inet:ip-address
         |  |     |  +--ro pw-id?                 uint32
         |  |     +--:(vpls)
         |  |     |  +--ro route-distinguisher?   rt:route-distinguisher
         |  |     |  +--ro sender-ve-id?          uint16
         |  |     |  +--ro receiver-ve-id?        uint16
         |  |     +--:(mpls-mldp)
         |  |        +--ro (root-address)?
         |  |           +--:(ip-address)
         |  |           |  +--ro source-address?        inet:ip-address
         |  |           |  +--ro group-ip-address?      inet:ip-address
         |  |           +--:(vpn)
         |  |           |  +--ro as-number?             inet:as-number
         |  |           +--:(global-id)
         |  |              +--ro lsp-id?                string
         |  +--ro system-info
         |     +--ro system-id?   rt:router-id
         +--ro dest-test-point
         |  +--ro ni?                 routing-instance-ref
         |  +--ro tp-location-type    identityref
         |  +--ro mac-address
         |  |  +--ro mac-address    yang:mac-address
         |  +--ro ipv4-address
         |  |  +--ro ipv4-address    inet:ipv4-address
         |  +--ro ipv6-address
         |  |  +--ro ipv6-address    inet:ipv6-address
         |  +--ro tp-attribute
         |  |  +--ro tp-attribute-type?     address-attribute-type
         |  |  +--ro (tp-attribute-value)?
         |  |     +--:(ip-prefix)
         |  |     |  +--ro ip-prefix?             inet:ip-prefix
         |  |     +--:(bgp)
         |  |     |  +--ro bgp?                   inet:ip-prefix
         |  |     +--:(tunnel)
         |  |     |  +--ro tunnel-interface?      uint32
         |  |     +--:(pw)
         |  |     |  +--ro remote-pe-address?     inet:ip-address
         |  |     |  +--ro pw-id?                 uint32
         |  |     +--:(vpls)
         |  |     |  +--ro route-distinguisher?   rt:route-distinguisher
         |  |     |  +--ro sender-ve-id?          uint16
         |  |     |  +--ro receiver-ve-id?        uint16
         |  |     +--:(mpls-mldp)
         |  |        +--ro (root-address)?
         |  |           +--:(ip-address)
         |  |           |  +--ro source-address?        inet:ip-address
         |  |           |  +--ro group-ip-address?      inet:ip-address
         |  |           +--:(vpn)
         |  |           |  +--ro as-number?             inet:as-number
         |  |           +--:(global-id)
         |  |              +--ro lsp-id?                string
         |  +--ro system-info
         |     +--ro system-id?   rt:router-id
         +--ro sequence-number?             uint64
         +--ro hop-cnt?                     uint8
         +--ro session-packet-statistics
         |  +--ro rx-packet-count?    uint32
         |  +--ro tx-packet-count?    uint32
         |  +--ro rx-bad-packet?      uint32
         |  +--ro tx-packet-failed?   uint32
         +--ro session-error-statistics
         |  +--ro packet-drops-count?         uint32
         |  +--ro packet-reorder-count?       uint32
         |  +--ro packets-out-of-seq-count?   uint32
         |  +--ro packets-dup-count?          uint32
         +--ro session-delay-statistics
         |  +--ro time-resolution-value?   identityref
         |  +--ro min-delay-value?         uint32
         |  +--ro max-delay-value?         uint32
         |  +--ro average-delay-value?     uint32
         +--ro session-jitter-statistics
         |  +--ro time-resolution-value?   identityref
         |  +--ro min-jitter-value?        uint32
         |  +--ro max-jitter-value?        uint32
         |  +--ro average-jitter-value?    uint32
         +--ro path-verification
         |  +--ro flow-info?                              string
         |  +--ro session-path-verification-statistics
         |     +--ro verified-count?   uint32
         |     +--ro failed-count?     uint32
         +--ro path-trace-info
            +--ro path-trace-info-list* [index]
               +--ro index                uint32
               +--ro ni?                  routing-instance-ref
               +--ro tp-location-type     identityref
               +--ro mac-address
               |  +--ro mac-address    yang:mac-address
               +--ro ipv4-address
               |  +--ro ipv4-address    inet:ipv4-address
               +--ro ipv6-address
               |  +--ro ipv6-address    inet:ipv6-address
               +--ro tp-attribute
               |  +--ro tp-attribute-type?     address-attribute-type
               |  +--ro (tp-attribute-value)?
               |     +--:(ip-prefix)
               |     |  +--ro ip-prefix?             inet:ip-prefix
               |     +--:(bgp)
               |     |  +--ro bgp?                   inet:ip-prefix
               |     +--:(tunnel)
               |     |  +--ro tunnel-interface?      uint32
               |     +--:(pw)
               |     |  +--ro remote-pe-address?     inet:ip-address
               |     |  +--ro pw-id?                 uint32
               |     +--:(vpls)
               |     |  +--ro route-distinguisher?   rt:route-distinguisher
               |     |  +--ro sender-ve-id?          uint16
               |     |  +--ro receiver-ve-id?        uint16
               |     +--:(mpls-mldp)
               |        +--ro (root-address)?
               |           +--:(ip-address)
               |           |  +--ro source-address?        inet:ip-address
               |           |  +--ro group-ip-address?      inet:ip-address
               |           +--:(vpn)
               |           |  +--ro as-number?             inet:as-number
               |           +--:(global-id)
               |              +--ro lsp-id?                string
               +--ro system-info
               |  +--ro system-id?   rt:router-id
               +--ro timestamp-type?      uint32
               +--ro timestamp-sec?       uint32
               +--ro timestamp-nanosec?   uint32
               +--ro ingress-intf-name?   if:interface-ref
               +--ro egress-intf-name?    if:interface-ref
               +--ro queue-depth?         uint32
               +--ro transit-delay?       uint32
               +--ro app-meta-data?       uint64
</artwork>
        </figure>
      </section>
    </section>

    <section title="OAM Retrieval Methods YANG Module">
      <t>&lt;CODE BEGINS&gt; file "ietf-connectionless-oam-methods@2017-09-06.yang"</t>

      <figure>
        <artwork>module ietf-connectionless-oam-methods {
namespace "urn:ietf:params:xml:ns:yang:ietf-connectionless-oam-methods";
 prefix coam-methods;
 import ietf-interfaces {
  prefix if;
 }
 import ietf-connectionless-oam {
  prefix coam;
 }
  organization
    "IETF LIME Working Group";
  contact
    "Deepak Kumar dekumar@cisco.com
     Qin Wu bill.wu@huawei.com
     S Raghavan srihari@cisco.com
     Zitao Wang wangzitao@huawei.com
     R Rahman rrahman@cisco.com";
  description
    "This YANG module defines the RPC operations for
     connectionless OAM to be used within IETF
     in a protocol Independent manner.
     It is assumed that each protocol maps
     corresponding abstracts to its native format.
     Each protocol may extend the YANG model defined
     here to include protocol specific extensions";

  revision 2017-09-06{
    description
      "08 version";
    reference "draft-ietf-lime-yang-connectionless-oam-methods";
  }

  identity protocol-id {
    description
    "A generic protocol identifier.";
  }

  identity protocol-id-internet {
    base protocol-id;
    description
      "Internet Protocols.";
  }
  
  identity protocol-id-propreitary {
    base protocol-id;
    description
      "Propreitary protocol (eg.,IP SLA).";
  }
  
  identity protocol-id-sfc {
    base protocol-id;
    description
      "Service Function Chaining.";
  }
  
  identity protocol-id-mpls {
    base protocol-id;
    description
      "MPLS protocol.";
  }
  
  identity protocol-id-mpls-tp {
    base protocol-id;
    description
      "MPLS-TP protocol.";
  }
  
  identity protocol-id-twamp {
    base protocol-id;
    description
      "TWAMP protocol.";
  }
  
  identity protocol-id-bier {
    base protocol-id;
    description
      "BIER protocol.";
  }
  
  identity status-code{
   description
   "Base status code";
  }

  identity invalid-cc{
   base status-code;
   description
   "Indicates that the Continuity check message is invalid";
  }

  identity invalid-pd {
   base status-code;
   description
   "Indicates that the path discovery message is invalid";
  }

  identity status-sub-code {
   description
   "Base status sub code";
  }

  grouping rpc-input-parameters {
        container destination-tp {
        uses coam:tp-address;
        description
          "Destination test point.";
       }
       leaf source-interface {
        type if:interface-ref;
        mandatory true;
        description
          "Source interface.";
       }
      leaf outbound-interface {
        type if:interface-ref;
        mandatory true;
        description
          "Outbound interface.";
      }
      leaf vrf {
        type coam:routing-instance-ref;
        description
          "VRF instance.";
      }
    description
   "Grouping for RPC input parameters";
  }
  rpc continuity-check {
    if-feature "coam:continuity-check";
    description
      "Continuity-check RPC operation as per RFC7276.";
    input {
        uses rpc-input-parameters;
        uses coam:session-type {
        description "If session-type is specified, then session-type
        must be set to on-demand";
       }
        leaf count {
        type uint32 {
            range 1..4294967295 {
                    description
                    "The overall number of packet to be transmitted
                     by the sender. If the count is set to 4294967295,
                     it indicates that the session will be run forever"; 
            }
        }
        default "5";
        description
          "Specifies the number of
           packets that will be sent. By 
          default, the packet number is
          set to 5.";
       }
        leaf ttl {
        type uint8;
        default "255";
        description
          "Time to live (TTL) used to limit lifetime
          of data packet transmitted in the network
          and prevent looping. The TTL value is decremented
          for every hop which the packet traverses. If the 
         TTL is zero, the data packet will be discarded.";
      }
      leaf packet-size {
        type uint32 {
          range "64..10000";
        }
        default "64";
        description
          "Packet size of continuity-check message, in octets.
          By default, the packet size is set to 64 octets.";
      }
    }
    output {
      container error-code {
        leaf protocol-id {
          type identityref {
            base protocol-id;
          }
          mandatory true;
          description
            "Protocol used in CC. This could be a standard
             protocol (eg., TCP/IP protocols, MPLS etc.,) 
             or a proprietary protocol as identified by
             this field.";
        }
        leaf protocol-id-meta-data {
          type uint64;
          description
            "An optional meta-data related to the protocol ID.
             For eg., this could be the Internet Protocol number
             for standard Internet Protocols for help in protocol
             processing.";
        }
        leaf status-code {
          type identityref{
            base status-code;
          }
          mandatory true;
          description
           "Error code for continuity-check message, that is 
            relevant to the protocol under use for CC. 
            For example if ICMP is the protocol under use, the
            error codes are as defined in [RFC4443].";
        }
        leaf status-sub-code {
          type identityref{
            base status-sub-code;
          }
          mandatory true;
          description
          "Error sub code for continuity-check message, that is
           relevant to the error-code reported of the protocol
           that is used for CC.";
        }
        description
          "Error code and Sub Code for continuity-check message.";
      }
      uses coam:continuity-check-data;
    }
  }

  rpc path-discovery {
    if-feature "coam:path-discovery";
    description
      "Path discovery RPC operation as per RFC7276.";
    input {
      uses rpc-input-parameters;
        uses coam:session-type {
        description "If session-type is specified, then session-type
        must be set to on-demand";
    }
      leaf max-ttl {
        type uint8;
        default "255";
        description
          "Maximum TTL indicates the maixmum number of hops that 
          a packet is permitted to travel before being discarded
          by a router. By default, the maximimum TTL is set to 255.";
      }
    }
    output {
      list response-list {
        key "response-index";
        description
          "Path discovery response list.";
        leaf response-index {
          type uint32;
          mandatory true;
          description
            "Response index.";
        }
        leaf protocol-id {
          type identityref {
            base protocol-id;
          }
          mandatory true;
          description
            "Protocol used in PD. This could be a standard
             protocol (eg., TCP/IP protocols, MPLS etc.,) 
             or a proprietary protocol as identified by
             this field.";
        }
        leaf protocol-id-meta-data {
          type uint64;
          description
            "An optional meta-data related to the protocol ID.
             For eg., this could be the Internet Protocol number
             for standard Internet Protocols for help in protocol
             processing.";
        }
        leaf status-code {
          type identityref{
            base status-code;
          }
          mandatory true;
          description
           "Error code for path-discovery response message, that is 
            relevant to the protocol under use for PD. 
            For example if ICMP is the protocol under use, the
            error codes are as defined in [RFC4443].";
        }
        leaf status-sub-code {
          type identityref{
            base status-sub-code;
          }
          mandatory true;
          description
          "Error sub code for path-discovery message, that is
           relevant to the error-code reported of the protocol
           that is used for PD.";
        }
      }
      uses coam:path-discovery-data;
    }
  }
  }</artwork>
      </figure>

      <t>&lt;CODE ENDS&gt;</t>
    </section>

    <section title="Security Considerations">
      <t>The YANG module defined in this document is designed to be accessed
      via network management protocols such as NETCONF [RFC6241] or RESTCONF
      [RFC8040]. The lowest NETCONF layer is the secure transport layer, and
      the mandatory-to-implement secure transport is Secure Shell (SSH)
      [RFC6242]. The lowest RESTCONF layer is HTTPS, and the
      mandatory-to-implement secure transport is TLS [RFC5246].</t>

      <t>The NETCONF access control model [RFC6536] 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>Some of the RPC operations in this YANG module may be considered
      sensitive or vulnerable in some network environments. It is thus
      important to control access to these operations. These are the
      operations and their sensitivity/vulnerability: <list style="symbols">
          <t>continuity-check: Generates continuity check.</t>

          <t>path-discovery: Generates path discovery.</t>
        </list>which may lead to Denial-of-Service attack on both the local
      device and the network or unauthorized source access to some sensitive
      information.</t>
    </section>

    <section title="IANA Considerations">
      <t>This document registers a URI in the IETF XML registry <xref
      target="RFC3688"/>. Following the format in <xref target="RFC3688"/>,
      the following registration is requested to be made:</t>

      <t>URI: urn:ietf:params:xml:ns:yang:ietf-connectionless-oam-methods</t>

      <t>Registrant Contact: The IESG.</t>

      <t>XML: N/A, the requested URI is an XML namespace.</t>

      <t>This document registers a YANG module in the YANG Module Names
      registry <xref target="RFC6020"/>.</t>

      <t>name: ietf-connectionless-oam-methods</t>

      <t>namespace:
      urn:ietf:params:xml:ns:yang:ietf-connectionless-oam-methods</t>

      <t>prefix: coam-methods</t>

      <t>reference: RFC XXXX</t>
    </section>
  </middle>

  <back>
    <references title="Normative References">
      <reference anchor="RFC792">
        <front>
          <title>Internet Control Message Protocol</title>

          <author fullname="J.Postel" initials="J." surname="Postel">
            <organization/>
          </author>

          <date month="September" year="1981"/>
        </front>

        <seriesInfo name="RFC" value="792"/>
      </reference>

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

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

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

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

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

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

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

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

      <?rfc include="reference.I-D.ietf-lime-yang-connectionless-oam"?>
    </references>

    <references title="Informative References">
      <?rfc include='reference.RFC.5880'?>

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

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

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

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

      <?rfc include="reference.I-D.ietf-netconf-yang-push"?>
    </references>

    <section title="Appdendix A.1 Extending Connectionless OAM Method Module Example">
      <t>The following is an example of extensions possible to
      "ietf-connectionless-oam-methods" YANG model defined in this
      document.</t>

      <t>The snippet below depicts an example of augmenting the
      "ietf-connectionless-oam-methods" YANG model with ICMP ping
      attributes:</t>

      <figure>
        <artwork>augment "/coam-methods:continutiy-check"
+"/coam-methods:output"{
  container session-rtt-statistics{
   leaf min-rtt{
    type uint32;
 description
 "This minimum ping round-trip-time(RTT) received.";
   }
   leaf max-rtt{
    type uint32;
 description
 "This maximum ping round-trip-time(RTT) received.";
   }
   leaf avg-rtt{
    type uint32;
 description
  "The current average ping round-trip-time(RTT)";
   }
   description
   "This container presents the ping round-trip-time statistics.";
  }
}</artwork>
      </figure>
    </section>

    <section title="Appendix A.2 Example of new retrieval procedures Model">
      <t>As discussed in introduction section of this document, the new
      retrieval procedures can be defined for retrieval of the same data
      defined by base YANG Data model for connectionless OAM protocols. This
      appendix demonstrates how the base connectionless OAM data model can be
      extended to support persistent data retrieval besides on demand
      retrieval procedures defined in section 3,i.e.,first retrieve
      persistent-id based on destination test point location information and
      then retrieve export details based on persistent-id. Internet Protocol
      Flow Information Export (IPFIX) <xref target="RFC7011"/> or YANG-push
      <xref target="I-D.ietf-netconf-yang-push"/>. are currently outlined here
      as data export options and more can be added in future.</t>

      <t>The YANG module "example-cl-oam-persistent-methods" shown below is
      intended as an illustration rather than a real definition of a RPC
      operation model for persistent data retrieval. For the sake of brevity,
      this module does not obey all the guidelines specified in <xref
      target="RFC6087"/>.</t>

      <figure>
        <artwork>  module example-cl-oam-persistent-methods {
  namespace "http://example.com/cl-oam-persistent-methods";
   prefix pcoam-methods;
   import ietf-interfaces {
    prefix if;
   }
   import ietf-connectionless-oam {
    prefix coam;
   }
   import ietf-yang-types {
    prefix yang;
   }
    identity export-method {
      description
        "Base identity to represent a conceptual export-method.";
    }
    identity ipfix-export {
      base export-method;
      description
        "IPFIX based export. Configuration provided separately.";
    }
    identity yang-push-export {
      base export-method;
      description
        "Yang-push from draft-ietf-netconf-yang-push";
    }
    identity protocol-id {
      description
      "A generic protocol identifier.";
    }
	identity status-code{
	description
	"Base status code";
	}

	identity invalid-cc{
	base status-code;
	description
	"Indicates that the Continuity check message is invalid";
	}

	identity invalid-pd {
	base status-code;
	description
	"Indicates that the path discovery message is invalid";
	}

	identity status-sub-code {
	description
	"Base status sub code";
	}
    typedef export-method {
      type identityref {
        base export-method;
      }
      description
        "Export method type.";
    }
    typedef change-type {
      type enumeration {
        enum "create" {
          description
            "Change due to a create.";
        }
        enum "delete" {
          description
            "Change due to a delete.";
        }
        enum "modify" {
          description
            "Change due to an update.";
        }
      }
      description
        "Different types of changes that may occur.";
    }

    rpc cc-get-persistent-id {
      if-feature "coam:continuity-check";
      description
        "Obtains continuity-check persistent identification given mapping
         parameters as input.";
      input {
        container destination-tp {
          uses coam:tp-address;
          description
            "Destination test point.";
        }
        uses coam:session-type;
        leaf source-interface {
          type if:interface-ref;
          description
            "Source interface.";
        }
        leaf outbound-interface {
          type if:interface-ref;
          description
            "Outbound interface.";
        }
        leaf vrf {
          type coam:routing-instance-ref;
          description
            "VRF instance.";
        }
      }
      output {
        container error-code {
          leaf protocol-id {
            type identityref {
              base protocol-id;
            }
            mandatory true;
            description
              "Protocol used. This could be a standard
               protocol (eg., TCP/IP protocols, MPLS etc.,) 
               or a proprietary protocol as identified by
               this field.";
          }
          leaf protocol-id-meta-data {
            type uint64;
            description
              "An optional meta-data related to the protocol ID.
               For eg., this could be the Internet Protocol number
               for standard Internet Protocols for help in protocol
               processing.";
          }
          leaf status-code {
            type identityref{
              base status-code;
            }
            mandatory true;
            description
              "Error code.";
          }
          leaf status-sub-code {
            type identityref{
              base status-sub-code;
            }
            mandatory true;
            description
              "Sub code for CC.";
          }
          description
            "Error code and Sub Code.";
        }

        leaf cc-persistent-id {
          type string;
          description
            "Id to act as a cookie.";
        }
      }
    }

    rpc cc-persistent-get-export-details {
      if-feature "coam:continuity-check";
      description
        "Given the persistent id, gets the configuration
         options, details related to the configured data
         export.";
      input {
        leaf cc-persistent-id {
          type string;
          description
            "Persistent Id for use as a key in search.";
        }
      }
      output {
        container error-code {
          leaf protocol-id {
            type identityref {
              base protocol-id;
            }
            mandatory true;
            description
              "Protocol used. This could be a standard
               protocol (eg., TCP/IP protocols, MPLS etc.,) 
               or a proprietary protocol as identified by
               this field.";
          }
          leaf protocol-id-meta-data {
            type uint64;
            description
              "An optional meta-data related to the protocol ID.
               For eg., this could be the Internet Protocol number
               for standard Internet Protocols for help in protocol
               processing.";
          }
          leaf status-code {
            type identityref{
              base status-code;
            }
            mandatory true;
            description
              "Error code.";
          }
          leaf status-sub-code {
            type identityref{
              base status-sub-code;
            }
            mandatory true;
            description
              "Sub code for CC.";
          }
          description
            "Error code and Sub Code.";
        }

        leaf data-export-method {
          type export-method;
          description
            "Type of export in use.";
        }

        choice cc-trigger {
          description
            "Necessary conditions for
             periodic or on-change trigger.";
          case periodic {
            description
              "Periodic reports.";
            leaf period {
              type yang:timeticks;
              description
                "Time interval between reports.";
            }
            leaf start-time {
              type yang:date-and-time;
              description
                "Timestamp from which reports were started.";
            }
          }
          case on-change {
            description
              "On-change trigger and not periodic.";
            leaf all-data-on-start {
              type boolean;
              description
                "Full update done on start or not.";
            }
            leaf-list excluded-change {
              type change-type;
              description
                "Changes that will not trigger an update.";
            }
          }
        }
      }
    }

   rpc pd-get-persistent-id {
      if-feature "coam:path-discovery";
      description
        "Obtains persistent path discovery identification.";

      input {
        container destination-tp {
          uses coam:tp-address;
          description
            "Destination test point.";
        }
        uses coam:session-type;
        leaf source-interface {
          type if:interface-ref;
          description
            "Source interface.";
        }
        leaf outbound-interface {
          type if:interface-ref;
          description
            "Outbound interface.";
        }
        leaf vrf {
          type coam:routing-instance-ref;
          description
            "VRF";
        }
      }
      output {
        list response-list {
          key "response-index";
          description
            "Path discovery response list.";
          leaf response-index {
            type uint32;
            mandatory true;
            description
              "Response index.";
          }
          leaf protocol-id {
            type identityref {
              base protocol-id;
            }
            mandatory true;
            description
              "Protocol used. This could be a standard
               protocol (eg., TCP/IP protocols, MPLS etc.,) 
               or a proprietary protocol as identified by
               this field.";
          }
          leaf protocol-id-meta-data {
            type uint64;
            description
              "An optional meta-data related to the protocol ID.
               For eg., this could be the Internet Protocol number
               for standard Internet Protocols for help in protocol
               processing.";
          }
          leaf status-code {
            type identityref {
              base status-code;
            }
            mandatory true;
            description
              "Error code for Persistent Path Discovery Information. ";
          }
          leaf status-sub-code {
            type identityref{
              base status-sub-code;
            }
            mandatory true;
            description
              "Sub code for Persistent Path Discovery Information. ";
          }
          leaf pd-persistent-id {
            type string;
            description
              "Id to act as a cookie.";
          }
        }
      }
   }

  rpc pd-persistent-get-export-details {
     if-feature "coam:path-discovery";
     description
       "Given the persistent id, gets the configuration
        options, details related to the configured data
        export.";
     input {
       leaf cc-persistent-id {
         type string;
         description
           "Persistent Id for use as a key in search.";
       }
     }

     output {
       list response-list {
         key "response-index";
         description
           "Path discovery response list.";
         leaf response-index {
           type uint32;
           mandatory true;
           description
             "Response index.";
         }
         leaf protocol-id {
           type identityref {
             base protocol-id;
           }
           mandatory true;
           description
             "Protocol used. This could be a standard
              protocol (eg., TCP/IP protocols, MPLS etc.,) 
              or a proprietary protocol as identified by
              this field.";
         }
         leaf protocol-id-meta-data {
            type uint64;
            description
              "An optional meta-data related to the protocol ID.
               For eg., this could be the Internet Protocol number
               for standard Internet Protocols for help in protocol
               processing.";
         }
         leaf status-code {
           type identityref{
             base status-code;
           }
           mandatory true;
           description
             "Error code for Persistent Path Discovery Creation. ";
         }
         leaf status-sub-code {
           type identityref{
             base status-sub-code;
           }
           mandatory true;
           description
             "Sub code for Persistent Path Discovery Creation. ";
         }
         leaf data-export-method {
           type export-method;
           description
             "Type of export.";
         }
         choice pd-trigger {
           description
             "Necessary conditions
              for periodic or on-change
              trigger.";
           case periodic {
             description
               "Periodic reports.";
             leaf period {
               type yang:timeticks;
               description
                 "Time interval between reports.";
             }
             leaf start-time {
               type yang:date-and-time;
               description
                 "Timestamp from which reports are started.";
             }
           }
           case on-change {
             description
               "On-change trigger and not periodic.";
             leaf all-data-on-start {
               type boolean;
               description
                 "Full update done on start or not.";
             }
             leaf-list excluded-change {
               type change-type;
               description
                 "Changes that will not trigger an update.";
             }
           }
         }
       }
     }
   }
 }
       </artwork>
      </figure>
    </section>
  </back>
</rfc>
