<?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-wang-lime-yang-pm-01" 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="Gen OAM PM Model">Generic YANG Data Model for Operations,
    Administration, and Maintenance (OAM) Performance Management</title>

    <author fullname="Zitao Wang" initials="Z." 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="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="Tom Taylor " initials="T." surname="Taylor">
      <organization>PT Taylor Consulting </organization>

      <address>
        <postal>
          <street/>

          <street/>

          <city>Ottawa</city>

          <region/>

          <code/>

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

        <email>tom.taylor.stds@gmail.com </email>
      </address>
    </author>

    <date year="2015"/>

    <area>OPS Area</area>

    <workgroup/>

    <abstract>
      <t>This document presents a YANG Data model for OAM Performance
      management support. The YANG Model presented in this document extends
      the Generic YANG Data Model for OAM with Loss Measurement and Delay
      measurement to support OAM Performance management.</t>
    </abstract>
  </front>

  <middle>
    <section title="Introduction">
      <t>Generic OAM Yang model [GENYANGGOAM] presents Generic Yang data model
      for all OAM technologies.</t>

      <t>In this document we extend the YANG model defined in [GENYANGGOAM]
      with Loss Measurement and Delay measurement to support OAM Performance
      management. Details are provided in section 4 below.</t>
    </section>

    <section title="Conventions and Terminology">
      <t>The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
      "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
      document are to be interpreted as described in <xref
      target="RFC2119"/>.</t>

      <t>The following terms are defined in [RFC6241] and are not redefined
      here:</t>

      <t><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 [RFC6020] and are not redefined
      here:</t>

      <t><list style="symbols">
          <t>augment</t>

          <t>data model</t>

          <t>data node</t>
        </list></t>

      <t>The terminology for describing YANG data models is found in
      [RFC6020].</t>

      <section title="Terminology">
        <t><list>
            <t>MP - Maintenance Point [8021.Q]</t>

            <t>MEP - Maintenance End Point [RFC7174] [8021Q] [RFC6371]</t>

            <t>MIP - Maintenance Intermediate Point [RFC7174] [8021.Q]
            [RFC6371]</t>

            <t>MA - Maintenance Association [8021.Q] [RFC7174]</t>

            <t>MD - Maintenance Domain [8021.Q]</t>

            <t>OAM - Operations, Administration, and Maintenance [RFC6291]</t>

            <t>DMM - Delay Measurement Message</t>

            <t>1SL - One-way Synthetic Loss Measurement message</t>

            <t>1DM - One-way Delay Measurement message</t>

            <t>DMR - Delay Measurement Reply</t>

            <t>PM - Performance Monitoring</t>

            <t>SLM - Synthetic Loss Measurement Message</t>

            <t>SLR - Synthetic Loss Measurement Reply</t>
          </list></t>
      </section>
    </section>

    <section title="YANG Extension">
      <t>MEP Addressing is defined in Generic YANG OAM model[GENYANGGOAM]. In
      this draft we augment MEP Configuration with Performance Management
      configuration and statistics for Delay Measurement and Performance
      Measurement. In addtion, we define new rpcs for performance measurement.
      </t>

      <section title="MEP Configuration Extension">
        <section anchor="lmm" title="Loss Measurement Configuration">
          <t>This section describes a set of data definitions for Loss
          Measurement configuration. This set of data defintions augment the
          MEP configuration defined in the Generic YANG OAM model with
          parameters related to Loss Measurement and define the role of MEP
          and measurement method of the loss measurement.</t>

          <t><figure>
              <artwork>   module: ietf-gen-oam-pm

/*This set of data definitions defines the role of MEP.*/
   augment /goam:domains/goam:domain/goam:MAs/goam:MA/goam:MEP:
      +--rw loss-responder?   Boolean
/*This set of data definitions defines loss measurement configuration*/
   augment /goam:domains/goam:domain/goam:MAs/goam:MA/goam:MEP:
      +--rw loss-measurements?
         +--ro loss-measurements* [session-cookie]
         |  +--ro session-cookie    uint32
         |  +--ro id?               string
         |  +--ro status?           Boolean
         +--rw measurement-type
         |  +--rw slm?              boolean
         |  +--rw pm_1sl?              boolean
         +--rw enabled-counters
         |  +--rw availability-forward-high-loss?             boolean
         |  +--rw availability-forward-availables?            boolean
         |  +--rw availability-forward-unavailable?           boolean
         |  +--rw availability-backward-high-loss?            boolean
         |  +--rw availability-backward-consecutive-high-loss? boolean
         |  +--rw availability-backward-available?            boolean
         |  +--rw available-backward-unavailable?             boolean
         +--rw message-period?             uint32
         +--rw data-pattern?               enumeration
         +--rw measurement-interval?       uint32
         +--rw number-intervals-stored?    uint32           
         +--rw availability-measurement-interval? uint32
         +--rw availability-consecutive-intervals-number? unit32
         +--rw session-type?               enumeration
         +--rw thresholds* [id]
         |  +--rw id                       uint32
         |  +--rw enabled-threshold
         |  |  +--rw forward-unavailable-count?  boolean
         |  |  +--rw backward-unavailable-count? boolean
         |  |  +--rw forward-available-ratio?    boolean
         |  |  +--rw forward-available-ratio?    boolean
         |  +--rw forward-unavailable-count uint32
         |  +--rw backward-unavailable-count uint32
         |  +--rw forward-available-ratio?   uint32
         |  +--rw backward-available-ratio?   uint32
         +--rw start-time
         |  +--rw (start-time)?
         |     +--:(immediate)
         |     |  +--rw immediate!
         |     +--:(absolute)
         |        +--rw absolute?    yang:date-and-time
         +--rw stop-time
         |  +--rw (stop-time)?
         |     +--:(none)
         |     |  +--rw none!
         |     +--:(absolute)
         |        +--rw absolute?   yang:date-and-time
         +--rw availability-forward-status      enumeration
         +--rw availability-backward-status     enumeration
         +--rw current-stats
         |  +--rw start-time?                 yang:date-and-time
         |  +--rw elapsed-time?                         uint32
         |  +--rw suspect-status?                       boolean
         |  +--rw forward-available?          yang:gauge32
         |  +--rw backward-available?         yang:gauge32
         |  +--rw forward-unavailable?        yang:gauge32
         |  +--rw backward-unavailable?       yang:gauge32
         +--rw history-stats* [id]
            +--rw id                                    uint32
            +--rw start-time?               yang:date-and-time
            +--rw elapsed-time?                         uint32
            +--rw suspect-status?                       Boolean
            +--rw forward-available?          yang:gauge32
            +--rw backward-available?         yang:gauge32
            +--rw forward-unavailable?        yang:gauge32
            +--rw backward-unavailable?       yang:gauge32
</artwork>
            </figure></t>
        </section>
      </section>

      <section anchor="dmm" title="Delay Measurement Configuration">
        <t>This section describes data definition for Delay Measurement
        configuration. This data defintion augments the MEP configuration
        defined in the Generic YANG OAM model with parameters related to Delay
        Measurement and defines the role of MEP and measurement method of the
        delay measurement.</t>

        <figure>
          <artwork>   module: ietf-gen-oam-pm

/*This set of data definitions defines the role of MEP.*/
      augment /goam:domains/goam:domain/goam:MAs/goam:MA/goam:MEP:
         +--rw delay-responder?   Boolean

/*This set of data definitions defines delay measurement configuration*/
      augment /goam:domains/goam:domain/goam:MAs/goam:MA/goam:MEP:
      +--rw delay-measurements?
         +--ro delay-measurements* [session-cookie]
         |  +--ro session-cookie    uint32
         |  +--ro id?               string
         |  +--ro status?           boolean
         +--rw measurement-type
         |  +--rw dmm?              boolean
         |  +--rw dm1-transmitted?  boolean
         |  +--rw dm1-received?     boolean
         +--rw measurement-enable
         +--rw message-period?                         uint32
         +--rw data-pattern?                           enumeration
         +--rw measurement-interval?                   uint32
         +--rw number-intervals-stored?                uint32
         +--rw session-type?                           Enumeration
         +--rw thresholds* [id]
         |  +--rw id                                   uint32
         |  +--rw enabled-thresholds?                  bits
         +--rw start-time
         |  +--rw (start-time)?
         |     +--:(immediate)
         |     |  +--rw immediate!
         |     +--:(absolute)
         |        +--rw absolute?    yang:date-and-time
         +--rw stop-time
         |  +--rw (stop-time)?
         |     +--:(none)
         |     |  +--rw none!
         |     +--:(absolute)
         |        +--rw absolute?   yang:date-and-time
         +--rw current-stats
         |  +--rw start-time?                   yang:date-and-time
         |  +--rw elapsed-time?                             uint32
         |  +--rw suspect-status?                           boolean
         +--rw history-stats* [id]
            +--rw id                                        uint32
            +--rw start-time?                   yang:date-and-time
            +--rw elapsed-time?                             uint32
            +--rw suspect-status?                           boolean</artwork>
        </figure>
      </section>

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

        <t>Configuration data in the <xref target="dmm"/> and <xref
        target="lmm"/> provides input extension for Delay and Loss measurement
        RPCs. </t>

        <section title="create-loss-measurement">
          <t>RPC allows scheduling of one-way or two-way on-demand or
          proactive performance monitoring loss measurement session. </t>
        </section>

        <section title="abort-loss-measurement">
          <t>RPC allow aborting of currently running or scheduled loss
          measurement session. </t>
        </section>

        <section title="create-delay-measurement">
          <t>RPC allow scheduling of one-way or two-way on-demand or proactive
          performance monitoring delay measurement session. </t>
        </section>

        <section title="abort-delay-measurement">
          <t>RPC allow aborting of currently running or scheduled delay
          measurement session. </t>
        </section>
      </section>
    </section>

    <section title="PM data hierarchy">
      <t>The complete data hierarchy related to the OAM PM YANG is presented
      below. The following notations are used within the tree and carry the
      meaning as noted below.</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
     x  for deprecated
     o  for obsolete


&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>

      <figure title="data hierarchy of PM">
        <artwork>   module: ietf-gen-oam-pm
   augment /goam:domains/goam:domain/goam:MAs/goam:MA/goam:MEP:
      +--rw delay-responder?   Boolean
      +--rw loss-responder?    Boolean

  augment /goam:domains/goam:domain/goam:MAs/goam:MA/goam:MEP:
    +--rw delay-measurements?
       +--ro delay-measurements* [session-cookie]
       |  +--ro session-cookie    uint32
       |  +--ro id?               string
       |  +--ro status?           boolean
       +--rw measurement-type 
       |  +--rw dmm?              boolean
       |  +--rw dm1-transmitted?  boolean
       |  +--rw dm1-received?     boolean                      
       +--rw measurement-enable                    
       +--rw message-period?                         uint32
       +--rw data-pattern?                           enumeration
       +--rw measurement-interval?                   uint32
       +--rw number-intervals-stored?                uint32
       +--rw session-type?                           enumeration
       +--rw start-time
       |  +--rw (start-time)?
       |     +--:(immediate)
       |     |  +--rw immediate!
       |     +--:(absolute)
       |        +--rw absolute?    yang:date-and-time
       +--rw stop-time
       |  +--rw (stop-time)?
       |     +--:(none)
       |     |  +--rw none!
       |     +--:(absolute)
       |        +--rw absolute?   yang:date-and-time
       +--rw current-stats
       |  +--rw start-time?                   yang:date-and-time
       |  +--rw elapsed-time?                             uint32
       |  +--rw suspect-status?                           Boolean
       +--rw history-stats* [id]
          +--rw id                                        uint32
          +--rw start-time?                   yang:date-and-time
          +--rw elapsed-time?                             uint32
          +--rw suspect-status?                          boolean

   augment /goam:domains/goam:domain/goam:MAs/goam:MA/goam:MEP:
      +--rw loss-measurements?
         +--ro loss-measurements* [session-cookie]
         |  +--ro session-cookie    uint32
         |  +--ro id?               string
         |  +--ro status?           boolean
         +--rw measurement-type
         |  +--rw slm?              boolean
         |  +--rw pm_1sl?              boolean
         +--rw enabled-counters
         |  +--rw availability-forward-high-loss?             boolean
         |  +--rw availability-forward-availables?            boolean
         |  +--rw availability-forward-unavailable?           boolean
         |  +--rw availability-backward-high-loss?            Boolean
         |  +--rw availability-backward-consecutive-high-loss? boolean
         |  +--rw availability-backward-available?            boolean
         |  +--rw available-backward-unavailable?             boolean
         +--rw message-period?             uint32
         +--rw data-pattern?               enumeration
         +--rw measurement-interval?       uint32
         +--rw number-intervals-stored?    uint32
         +--rw availability-measurement-interval? uint32
         +--rw availability-consecutive-intervals-number? unit32
         +--rw session-type?               enumeration
         +--rw thresholds* [id]
         |  +--rw id                       uint32
         |  +--rw enabled-threshold
         |  |  +--rw forward-unavailable-count?  boolean
         |  |  +--rw backward-unavailable-count? boolean
         |  |  +--rw forward-available-ratio?    boolean
         |  |  +--rw forward-available-ratio?    boolean
         |  +--rw forward-unavailable-count uint32
         |  +--rw backward-unavailable-count uint32
         |  +--rw forward-available-ratio?   uint32
         |  +--rw backward-available-ratio?   uint32
         +--rw start-time
         |  +--rw (start-time)?
         |     +--:(immediate)
         |     |  +--rw immediate!
         |     +--:(absolute)
         |        +--rw absolute?    yang:date-and-time
         +--rw stop-time
         |  +--rw (stop-time)?
         |     +--:(none)
         |     |  +--rw none!
         |     +--:(absolute)
         |        +--rw absolute?   yang:date-and-time
         +--rw current-stats
         |  +--rw start-time?               yang:date-and-time
         |  +--rw elapsed-time?                         uint32
         |  +--rw suspect-status?                       Boolean
         |  +--rw forward-available?          yang:gauge32
         |  +--rw backward-available?         yang:gauge32
         |  +--rw forward-unavailable?        yang:gauge32
         |  +--rw backward-unavailable?       yang:gauge32
         +--rw history-stats* [id]
            +--rw id                                    uint32
            +--rw start-time?               yang:date-and-time
            +--rw elapsed-time?                         uint32
            +--rw suspect-status?                       boolean
            +--rw forward-available?          yang:gauge32
            +--rw backward-available?         yang:gauge32
            +--rw forward-unavailable?        yang:gauge32
            +--rw backward-unavailable?       yang:gauge32
rpcs:
      +---x create-loss-measurement     
      |  +--ro input     
      |  |  +--rw measurement-type
      |  |  |  +--rw slm?              boolean
      |  |  |  +--rw pm_1sl?              boolean
      |  |  +--rw enabled-counters
      |  |  |  +--rw availability-forward-high-loss?             boolean
      |  |  |  +--rw availability-forward-availables?            boolean
      |  |  |  +--rw availability-forward-unavailable?           boolean
      |  |  |  +--rw availability-backward-high-loss?            boolean
      |  |  |  +--rw availability-backward-consecutive-high-loss? boolean
      |  |  |  +--rw availability-backward-available?            boolean
      |  |  |  +--rw available-backward-unavailable?             boolean
      |  |  +--ro message-period?            uint32
      |  |  +--ro data-pattern?              enumeration
      |  |  +--ro measurement-interval?      uint32
      |  |  +--ro number-intervals-stored?   uint32
      |  |  +--ro session-type?              enumeration
      |  |  +--ro start-time
      |  |  |  +--ro (start-time)?
      |  |  |     +--:(immediate)
      |  |  |     |  +--ro immediate!
      |  |  |     +--:(absolute)
      |  |  |        +--ro absolute?    yang:date-and-time
      |  |  +--ro stop-time
      |  |  |  +--ro (stop-time)?
      |  |  |     +--:(none)
      |  |  |     |  +--ro none!
      |  |  |     +--:(absolute)
      |  |  |        +--ro absolute?   yang:date-and-time
      |  |  +--ro destination-mep
      |  |     +--ro (mp-address)?
      |  |     |  +--:(mac-address)
      |  |     |  |  +--ro mac-address?    yang:mac-address
      |  |     |  +--:(ipv4-address)
      |  |     |  |  +--ro ipv4-address?   inet:ipv4-address
      |  |     |  +--:(ipv6-address)
      |  |     |     +--ro ipv6-address?   inet:ipv6-address
      |  |     +--ro (MEP-ID)? 
      |  |     |  +--:(MEP-ID-int)
      |  |     |     +--ro MEP-ID-int?      int32
      |  |     +--ro MEP-ID-format?         identityref
      |  +--ro output    
      |     +--ro session-id    uint32
      +---x abort-loss-measurement      
      |  +--ro input     
      |     +--ro technology         identityref
      |     +--ro MD-name-string     MD-name-string
      |     +--ro MA-name-string?    MA-name-string
      |     +--ro destination-mep
      |     |  +--ro (mp-address)?
      |     |  |  +--:(mac-address)
      |     |  |  |  +--ro mac-address?    yang:mac-address
      |     |  |  +--:(ipv4-address)
      |     |  |  |  +--ro ipv4-address?   inet:ipv4-address
      |     |  |  +--:(ipv6-address)
      |     |  |     +--ro ipv6-address?   inet:ipv6-address
      |     |  +--ro (MEP-ID)? 
      |     |  |  +--:(MEP-ID-int)
      |     |  |     +--ro MEP-ID-int?      int32
      |     |  +--ro MEP-ID-format?         identityref
      |     +--ro session-id         uint32
      +---x create-delay-measurement    
      |  +--ro input     
      |  |  +--ro measurement-type
      |  |  |  +--ro dmm?                    boolean
      |  |  |  +--ro dm1-transmitted?        boolean
      |  |  |  +--ro dm1-received?           boolean
      |  |  +--ro measurement-enable     
      |  |  +--ro message-period?            uint32
      |  |  +--ro data-pattern?              enumeration
      |  |  +--ro measurement-interval?      uint32
      |  |  +--ro number-intervals-stored?   uint32
      |  |  +--ro session-type?              enumeration
      |  |  +--ro start-time
      |  |  |  +--ro (start-time)?
      |  |  |     +--:(immediate)
      |  |  |     |  +--ro immediate!
      |  |  |     +--:(absolute)
      |  |  |        +--ro absolute?    yang:date-and-time
      |  |  +--ro stop-time
      |  |  |  +--ro (stop-time)?
      |  |  |     +--:(none)
      |  |  |     |  +--ro none!
      |  |  |     +--:(absolute)
      |  |  |        +--ro absolute?   yang:date-and-time
      |  |  +--ro destination-mep
      |  |  |  +--ro (mp-address)?
      |  |  |  |  +--:(mac-address)
      |  |  |  |  |  +--ro mac-address?    yang:mac-address
      |  |  |  |  +--:(ipv4-address)
      |  |  |  |  |  +--ro ipv4-address?   inet:ipv4-address
      |  |  |  |  +--:(ipv6-address)
      |  |  |  |     +--ro ipv6-address?   inet:ipv6-address
      |  |  |  +--ro (MEP-ID)? 
      |  |  |  |  +--:(MEP-ID-int)
      |  |  |  |     +--ro MEP-ID-int?      int32
      |  |  |  +--ro MEP-ID-format?         identityref
      |  |  +--ro (flow-entropy)?
      |  |     +--:(flow-entropy-null)
      |  |        +--ro flow-entropy-null   empty
      |  +--ro output    
      |     +--ro session-id    uint32
      +---x abort-delay-measurement     
         +--ro input     
            +--ro technology         identityref
            +--ro MD-name-string     MD-name-string
            +--ro MA-name-string?    MA-name-string
            +--ro destination-mep
            |  +--ro (mp-address)?
            |  |  +--:(mac-address)
            |  |  |  +--ro mac-address?    yang:mac-address
            |  |  +--:(ipv4-address)
            |  |  |  +--ro ipv4-address?   inet:ipv4-address
            |  |  +--:(ipv6-address)
            |  |     +--ro ipv6-address?   inet:ipv6-address
            |  +--ro (MEP-ID)? 
            |  |  +--:(MEP-ID-int)
            |  |     +--ro MEP-ID-int?      int32
            |  +--ro MEP-ID-format?         identityref
            +--ro session-id         uint32
</artwork>
      </figure>
    </section>

    <section title="PM YANG Module">
      <figure>
        <artwork>&lt;CODE BEGINS&gt; file "ietf-gen-oam-pm.yang"
		
module ietf-gen-oam-pm {
    namespace "urn:ietf:params:xml:ns:yang:ietf-gen-oam-pm";
    prefix goampm;

    import ietf-gen-oam {
        prefix goam;
      }
    import ietf-yang-types {
        prefix yang;
      }

    organization
      "IETF LIME (Layer Independent OAM Management in Multi-Layer
       Environment) Working Group";

    contact
      "zitao wang: wangzitao@huawei.com";

    description

      "This YANG module defines generic loss measurement and
       delay measurement configuration for multi-layer OAM
       management to be used within IETF in a protocol independent
       manner.";

    revision 2015-01-07 {
        description
          "Initial revision.";
        reference "draft-wang-lime-yang-pm";
      }

       /* features */
    feature loss-measurements {
      description
        "This feature indicates that the server supports
         configuration of loss measurement that is used by some OAM
         protocols.

         Servers that do not advertise this feature will not
         configure loss measurement";
    }

    feature delay-measurements {
      description
        "This feature indicates that the server supports
         configuration of delay measurement that is used by some OAM
         protocols.

         Servers that do not advertise this feature will not
         configure delay measurement";
    }

    feature create-loss-measurement{
      description
        "This feature indicates that the server supports executing
         the create-loss-measurement OAM command and returning a
         response. Servers that do not advertise this feature will
         not support execution of the create-loss-measurement command
         or the RPC model for the create-loss-measurement command.";
    }

    feature abort-loss-measurement{
      description
        "This feature indicates that the server supports executing
         the abort-loss-measurement OAM command and returning a
         response. Servers that do not advertise this feature will
         not support execution of the abort-loss-measurement command
         or the RPC model for the abort-loss-measurement command.";

    }

    feature create-delay-measurement{
      description
        "This feature indicates that the server supports executing
         the create-delay-measurement OAM command and returning a
         response. Servers that do not advertise this feature will
         not support execution of the create-delay-measurement
         command or the RPC model for the create-delay-measurement
         command.";
    }

    feature abort-delay-measurement{
      description
        "This feature indicates that the server supports executing
         the abort-delay-measurement OAM command and returning a
         response. Servers that do not advertise this feature will
         not support execution of the abort-delay-measurement
         command or the RPC model for the abort-delay-measurement
         command.";
    }

    grouping loss-measurement-configuration-group {
      description
        "This grouping includes configuration objects for the loss
         measurement function defined in GEN-PM.";
      reference
        "draft-wang-lime-yang-pm";

      container measurement-type {
        leaf slm   {
          type boolean;
          description
            "If true, generate PM SLM Messages and correlate with
             received SLR responses.";
        }
        leaf pm_1sl{
          type boolean;
          description
            "If true, generate PM 1SL Messages.";
        }
        description
          "This object specifies what type of loss measurement
           will be performed.";
      }

      container enabled-counters {
        leaf availability-forward-high-loss {

          type boolean;
          default "false";
          description
            "Enable (true) or disable availability-forward-high-loss
             counters found in the current-stats and history-stats.";
        }
        leaf availability-forward-available {
          type boolean;
          default "false";
          description
            "Enable (true) or disable availability-forward-available
             counters found in the current-stats and history-stats ";
        }
        leaf availability-forward-unavailable {
          type boolean;
          default "false";
          description
            "Enable (true) or disable
             availability-forward-unavailable counters found in the
             current-stats and history-stats ";
        }
        leaf availability-backward-high-loss {
          type boolean;
          default "false";
          description
            "Enable (true) or disable availability-backward-high-loss
             counters found in the current-stats and history-stats ";
        }
        leaf availability-backward-consecutive-high-loss {
          type boolean;
          default "false";
          description
            "Enable (true) or disable
             availability-backward-consecutive-high-loss counters
             found in the current-stats and history-stats ";
        }
        leaf availability-backward-available {
          type boolean;
          default "false";
          description
            "Enable (true) or disable availability-backward-available
             counters found in the current-stats and history-stats ";
        }
        leaf availability-backward-unavailable {
          type boolean;
          default "false";
          description
            "Enable (true) or disable available-backward-unavailable

             counters found in the current-stats and history-stats ";
        }
        description
          "Indicates the types of PM loss measurement counters found
           in the current-stats and history-stats that are enabled.

           Not all counters are supported for all PM Loss Measurement
           types.";
      }
      /* This terminates the enabled-counters clause */

      leaf message-period {
        type uint32;
        units "ms";
        default 1000;
        description
          "This object specifies the interval between loss
           measurement OAM message transmissions.";
      }

      leaf data-pattern {
        type enumeration {
          enum zeroes {
            description "Indicates the Data TLV contains all 0s.";
          }
          enum ones {
            description "Indicates the Data TLV contains all 1s.";
          }
        }
        default zeroes;
        description
          "This object specifies the loss measurement data pattern
           included in the OAM Message.";
      }

      leaf measurement-interval {
        type uint32;
        units "minutes";
        default 15;

        description
          "This object specifies a measurement interval in
           minutes. Measurements are accumulated in the current-stats
           counters for the duration of this interval, and then
           transferred to the history-stats counters.";
      }

      leaf number-intervals-stored {

        type uint32 {
          range "2..10";
        }
        default 10;
        description
          "This object specifies the number of completed
           measurement intervals to store in the history statistics
           table.";
      }

      leaf availability-measurement-interval {
        type uint32 {
          range "1..525600";
        }
        units minutes;
        default 15;
        description
          "This object specifies the availability measurement
           interval in minutes. Measurement interval of 15 minutes
           MUST be supported, other intervals can be supported.";
      }

      leaf availability-consecutive-intervals-number {
        type uint32 {
          range "1..1000";
        }
        default 10;
        description
          "This object specifies a configurable number of
           consecutive availability indicators to be used to
           determine a change in the availability status as
           indicated by MEF 10.2.1.

           This parameter is equivalent to the Availability
           parameter 'n' as specified by MEF 10.2.1. The number
           range of 1 through 10 MUST be supported. The number
           range of 1 through 1000 may be supported, but is not
           mandatory.";
      }

      leaf session-type {
        type enumeration {
          enum proactive {
            description
              "The current session is 'proactive'.";
          }
          enum on-demand {
            description

              "The current session is on-demand.";
          }
        }
        description
          "This object indicates whether the current session is
           defined to be proactive or on-demand.";
      }

      list thresholds {
        key "id";
        description
          "This list contains the list of Loss Measurement
           configuration threshold values for LM Performance
           Monitoring. The main purpose of the threshold
           configuration list is to configure threshold alarm
           notifications indicating that a specific performance
           metric is not being met.";

        leaf id {
          type uint32;
          description
            "The index of the threshold number for the specific LM
             threshold entry. An index value of '1' MUST be
             supported. Other index values can also be supported.";
        }

        container enabled-thresholds {
          leaf forward-unavailable-count {
            type boolean;
            description
              "If true, indicates that the forward-unavailable-count
                is available.";
          }
          leaf forward-available-ratio {
            type boolean;
            description
              "If true, indicates that the forward-available-ratio
               is available.";
          }
          leaf backward-unavailable-count {
            type boolean;
            description
              "If true, indicates that the backward-unavailable-count
               is available.";
          }
          leaf backward-available-ratio {
            type boolean;
            description

              "If true, indicates that the backward-available-ratio
               is available.";
          }
          description
            "A container that indicates the type of OAM loss
             measurement threshold notifications that are enabled.";
        }
        /* Terminates container enabled-thresholds */

        leaf forward-unavailable-count {
          type uint32;
          description
            "This object is used to set the forward unavailability
             threshold value that will be used to determine if a
             threshold notification is generated.";
        }
        leaf backward-unavailable-count {
          type uint32;
          description
            "This object is used to set the backward unavailability
             threshold value that will be used to determine if a
             threshold notification is generated.";
        }
        leaf forward-available-ratio {
          type uint32 {
            range "0..100000";
          }
          units milli-percent;
          default 0;

          description
            "This object is used to set the forward
             availability/total time ratio threshold value that will
             be used to determine if a threshold notification is
             generated if the ratio drops below the configured value.
             The ratio value is expressed as a percent with a value
             of 0 (ratio 0.00) through 100000 (ratio 1.00) Units are
             in milli-percent, where 1 indicates 0.001 percent.";
        }
        leaf backward-available-ratio {
          type uint32 {
            range "0..100000";
          }
          units milli-percent;
          default 0;
          description
            "This object is used to set the backward
             availability/total time ratio threshold value that will

             be used to determine if a thresh-old notification is
             generated if the ratio drops below the configured value.
             The ratio value is expressed as a percent with a value
             of 0 (ratio 0.00) through 100000 (ratio 1.00) Units are
             in milli-percent, where 1 indicates 0.001 percent.";
        }
      }
      /* This terminates list thresholds */
    }
    /* This terminates loss-measurement-configuration-group */

    grouping loss-stats-group {
      description
        "This grouping includes statistics objects for a loss
         measurement session.";
      leaf suspect-status {
        type boolean;
        description
            "true means statistics for this measurement interval are
             not valid.";
      }
    }

    grouping measurement-timing-group {
      description
        "This grouping includes objects used for proactive and
         on-demand scheduling of PM measurement sessions.";

      container start-time {
        description
          "This container defines the session start time.";

        choice start-time {
          description
            "Measurement session start time can be immediate,
             relative, or absolute.";

          container immediate {
            description
              "Start the measurement session immediately.";
          }

          leaf relative {
         type yang:timeticks;
          description
         "This object specifies the relative start time.";
         }
          leaf absolute {

            type yang:date-and-time;
            description
              "This object specifies the scheduled start time to
               perform the on-demand monitoring operations.";
          }
        }
      }

      container stop-time {
        description
          "This container defines the session stop time.";

        choice stop-time {
          description
            "Measurement session stop time can be none, or
             absolute.";

          container none {
            description
              "Never end the measurement session.";
          }

          leaf absolute {
            type yang:date-and-time;
            description
              "This object specifies the scheduled stop time
               to perform the on-demand monitoring operations.";
          }
        }
      }
    }
    /* End of measurement-timing-group */

    grouping delay-measurement-configuration-group {
      description
        "This grouping includes configuration objects for Delay
         Measurement function defined in PM.";
      reference
        "draft-wang-lime-yang-pm";

      container measurement-type {
        description
          "This container defines the measurement type.";

        leaf dmm {
          type boolean;
          description
            "If true, generate DMM Message, correlate with DMR

             responses.";
        }
        leaf dm1-transmitted {
          type boolean;
          description
            "If true, generate 1DM Message.";
        }
        leaf dm1-received {
          type boolean;
          description
            "Receive 1DM PDU and generate measurement.";
        }
      }

      container measurement-enable {
        description
          "Indicates the types of DM counters that are enabled. Not
           all DM counters are supported for all DM types.";
      }

      leaf message-period {
        type uint32;
        default 100;
        description
          "This object specifies the interval between delay
            measurement OAM message transmissions.";
      }

      leaf data-pattern {
        type enumeration {
          enum zeroes {
            description "Indicates the Data TLV contains all 0s.";
          }
          enum ones {
            description "Indicates the Data TLV contains all 1s.";
          }
        }
        default zeroes;
        description
          "This object specifies the delay measurement data pattern
           included in the OAM packet.";
      }

      leaf measurement-interval {
        type uint32;
        units minutes;
        default 15;

        description
          "This object specifies a Measurement Interval in minutes.";
      }

      leaf number-intervals-stored {
        type uint32 {
          range "2..10";
        }
        default 10;
        description
          "This object specifies the number of completed measurement
           intervals to store in the history statistics table.";
      }

      leaf session-type {
        type enumeration {
          enum proactive {
            description
              "The current session is 'proactive'.";
          }
          enum on-demand {
            description
              "The current session is on-demand.";
          }
        }
        description
          "This object indicates whether the current session is
           defined to be proactive or on-demand.";
      }
    }
    /* End of delay-measurement-configuration-group */

    grouping delay-measurement-stats-group {
      description
        "This grouping includes statistics objects for a delay
         measurement session.";

      leaf suspect-status {
        type boolean;
        description
          "true means statistics for this measurement interval are
           not valid.";
      }
    }
    /* End of delay-measurement-stats-group */

/*This set of data definitions defines the role of MEP.*/
    augment "/goam:domains/goam:domain"

      +"/goam:MAs/goam:MA/goam:MEP" {
        description
          "This set of data definitions extends the MEP as described
           in goam";

        leaf delay-responder {
          type boolean;
          default true;
          description
            "This object specifies whether Delay Measurement (DMM)
             single ended Responder is enabled. The value 'false'
             indicates the Delay measurement responder is disabled
             and received DMM will be discarded.";
        }
        leaf loss-responder {
          type boolean;
          default true;
          description
            "This object specifies whether Loss Measurement (LMM)
             single ended Responder is enabled. The value 'false'
             indicates the Loss measurement responder is disabled and
             received LMM will be discarded.";

        }
    }

/*This set of data definitions defines performance measurement */
/*configuration.*/
    augment "/goam:domains/goam:domain"
      +"/goam:MAs/goam:MA/goam:MEP" {
        description
          "This set of data definitions extends the MEP as described
           in goam, specially with regard to delay measurements.";

        container delay-measurements {
          if-feature delay-measurements;
            description
              "This container contains a collection of data
               definitions related to Delay Measurements as defined
               in PM.";

          list delay-measurements {
            key "session-cookie";
            config false;
            description
              "List of Delay Measurement PM Sessions where each
               instance is uniquely identified by an session-cookie

               attribute.";

            leaf session-cookie {
              type uint32;
              config false;
              description
                "cookie to identify delay measurement session.";
            }

            leaf id {
              type string;
              description
                "This object uniquely identifies a scheduled
                 measurement time.";
            }

            leaf status {
              type boolean;
              config false;
              description
                "This object indicates DM session status, true means
                 active, false means not active.";
            }
          }
          /* End of list delay-measurements */

          uses delay-measurement-configuration-group;
          uses measurement-timing-group;

          container current-stats {
            description
              "This container contains result of the current
               Measurement Interval in a delay measurement
               session gathered during the interval indicated by
               measurement-interval.";

            leaf start-time {
              type yang:date-and-time;
              description
                "Start time for current measurement interval.";
            }

            leaf elapsed-time {
              type uint32;
              units "tens of ms";
              description
                "Elapsed time for current measurement interval in
                 0.01 seconds.";

            }

              uses delay-measurement-stats-group;
          }
          /* End of current-stats */

          list history-stats {
            key id;
            description
              "This list contains the result for historic measurement
               intervals for performance measurement session.";

            leaf id {
              type uint32;
              description
                "This id can be used to identify different history
                 stats.";
            }

            leaf start-time {
              type yang:date-and-time;
              description
                "Start time for measurement interval.";
            }

            leaf elapsed-time {
              type uint32;
              units "tens of ms";
              description
                "Elapsed time for measurement interval in 0.01
                 seconds.";
             }

            uses delay-measurement-stats-group;
          }
          /* End of history-stats */
        }
        /* End of container delay-measurements */
    }
    /* End of augment clause */

    augment "/goam:domains/goam:domain"
      +"/goam:MAs/goam:MA/goam:MEP" {
        description
          "This set of data definitions extends the MEP as described
           in goam, specially with regards to loss measurements.";

        container loss-measurements {

          if-feature loss-measurements;
          description
            "This container contains a collection of data definitions
             related to loss measurements as defined in this document.";

          list loss-measurements {
            key "session-cookie";
            config false;
            description
              "List of Loss Measurement PM Sessions where each
               instance is uniquely identified by an session-cookie
               attribute.";

            leaf session-cookie {
              type uint32;
              config false;
              description
                "Cookie to identify loss measurement session.";
            }

            leaf id {
              type string;
              description
                "This object uniquely identifies a scheduled measurement
                 time.";
            }

            leaf status {
              type boolean;
              config false;
              description
                "This object indicates loss measurement session status,
                 true means active, false means not active.";
            }
          }
          /* End of list loss-measurements */

          uses loss-measurement-configuration-group;
          uses measurement-timing-group;

          leaf availability-forward-status {
            type enumeration {
              enum available {
                description
                  "Indicates the MEP is available.";
              }
              enum unavailable {
                description

                  "Indicates the MEP is unavailable.";
              }
              enum unknown {
                description
                  "Indicates the availability is not known.";
              }
            }
            description
              "This object indicates the availability status in the
               forward direction.";
          }
          leaf availability-backward-status {
            type enumeration {
              enum available {
                description
                  "Indicates the MEP is available.";
              }
              enum unavailable {
                description
                  "Indicates the MEP is unavailable.";
              }
              enum unknown {
                description
                  "Indicates the availability is not known.";
              }
            }
            description
              "This object indicates the availability status
               in the backward direction.";
          }

          container current-stats {
            description
              "This container contains result of the current
               measurement interval in a PM loss measurement session
               gathered during the interval indicated by
               measurement-interval.";

            leaf start-time {
              type yang:date-and-time;
              description
                "Start time for current measurement interval.";
            }

            leaf elapsed-time {
              type uint32;
              units "tens of ms";
              description

              "Elapsed time for current measurement
                         interval in 0.01 seconds.";
            }
            leaf forward-available {
              type yang:gauge32;
              description
                "The current value of forward-available for the
                 referenced loss measurement session.";
            }
            leaf backward-available {
              type yang:gauge32;
              description
                "The current value of backward-available for the
                 referenced loss measurement session.";
            }
            leaf forward-unavailable {
            type yang:gauge32;
            description
              "The current value of forward-unavailable for the
               referenced loss measurement session.";
            }
            leaf backward-unavailable {
              type yang:gauge32;
              description
                "The current value of backward-unavailable for the
                 referenced loss measurement session.";
            }
            uses loss-stats-group;
          }
          /* End of container current-stats */

          list history-stats {
            key id;
            description
              "This list contains the result for historic measurement
               intervals for PM loss measurement session.";

            leaf id {
              type uint32;
              description
                "This leaf can be used to select different
                 history-stats intervals.";
            }

            leaf start-time {
              type yang:date-and-time;
              description
                "Start time for measurement interval.";

            }

            leaf elapsed-time {
              type uint32;
              units "tens of ms";
              description
                "Elapsed time for measurement interval in 0.01
                 seconds.";
            }
            leaf forward-available {
              type yang:gauge32;
              description
                "The value of forward-available for the
                 referenced loss measurement session and interval.";
            }
            leaf backward-available {
              type yang:gauge32;
              description
                "The value of backward-available for the
                 referenced loss measurement session and interval.";
            }
            leaf forward-unavailable {
              type yang:gauge32;
              description
                "The value of forward-unavailable for the
                 referenced loss measurement session and interval.";
            }
            leaf backward-unavailable {
              type yang:gauge32;
              description
                "The value of backward-unavailable for the
                 referenced loss measurement session and interval.";
            }
            uses loss-stats-group;
          }
          /* End of list history-stats */
        }
        /* End of container loss-measurements */
    }
    /* End of augments clause */

           //RPCs related to Generic PM
    rpc create-loss-measurement {
      if-feature create-loss-measurement;
      description
      "Schedule a one-way or two-way on-demand or proactive
       performance monitoring loss measurement session on a specific
       MEP and flow.

       A list entry associated with the newly created session will be
       created in the loss-measurements container and the assigned
       session identifier will be returned in the output parameter.";

      input {
        uses loss-measurement-configuration-group;
        uses measurement-timing-group;

        container destination-mep {
          uses goam:mp-address;
          uses goam:MEP-ID;
		  description
		  "destination mep";
        }
      }
      output {
        leaf session-id {
          type uint32;
          mandatory true;
          description
            "The session identifier of the newly created loss
             measurement session.";
        }
      }
    } //end of rpc

    rpc abort-loss-measurement {
      if-feature abort-delay-measurement;
      description
        "Abort a currently running or scheduled single-ended
         on-demand PM loss measurement function.";

      input {
        uses goam:maintenance-domain-id;
        uses goam:ma-identifier;

        container destination-mep {
          uses goam:mp-address;
          uses goam:MEP-ID;
		  description
		  "destination mep";
        }
        leaf session-id {
          type uint32;
          mandatory true;
          description
            "The session Id of the measurement session to
             be aborted.";
        }
      }
    } //end of RPC

    rpc create-delay-measurement {
      if-feature create-delay-measurement;
      description
        "Schedule a one-way or two-way on-demand or proactive
         performance monitoring delay measurement session on a
         specific MEP and flow. A list entry associated with the
         newly created session will be created in the
         delay-measurements container and the assigned session
         identifier will be returned in the output parameter.";

      input {
        uses delay-measurement-configuration-group;
        uses measurement-timing-group;

        container destination-mep {
          uses goam:mp-address;
          uses goam:MEP-ID;
		  description
		  "description mep.";
        }
        uses goam:flow-entropy;
      }

      output {
        leaf session-id {
        type uint32;
        mandatory true;
        description
          "The session identifier of the newly created
           delay measurement session.";
        }
      }
    } //end of rpc

    rpc abort-delay-measurement {
      if-feature abort-delay-measurement;
      description
        "Abort a currently running or scheduled single-ended
         on-demand PM function.";

      input {
        uses goam:maintenance-domain-id;
        uses goam:ma-identifier;

        container destination-mep {
          uses goam:mp-address;
          uses goam:MEP-ID;
		  description
		  "destination mep";
        }

        leaf session-id {

          type uint32;
          mandatory true;
          description
            "The session Id of the measurement session to
             be aborted.";
        }
      }
    } //end of RPC
  }
&lt;CODE ENDS&gt;</artwork>
      </figure>
    </section>

    <section title="Security Considerations">
      <t>TBD.</t>
    </section>

    <section title="IANA Considerations">
      <t>TBD.</t>
    </section>
  </middle>

  <back>
    <references title="Normative References">
      &rfc2119;

      <reference anchor="GENYANGGOAM">
        <front>
          <title>Generic YANG Data Model for Operations, Administration, and
          Maintenance (OAM)</title>

          <author fullname="Tissa Senevirathne" initials="T."
                  surname="Senevirathne ">
            <organization/>
          </author>

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

          <date month="April" year="2015"/>
        </front>

        <seriesInfo name="ID"
                    value="http://tools.ietf.org/html/draft-tissa-lime-yang-oam-management-04"/>
      </reference>
    </references>

    <references title="Informative References">
      <reference anchor="IEEE802.1Q">
        <front>
          <title>Media Access Control (MAC) Bridges and Virtual Bridged Local
          Area Networks</title>

          <author>
            <organization/>
          </author>

          <date month="August" year="2011"/>
        </front>

        <seriesInfo name="IEEE" value="Std 802.1Q-2011"/>
      </reference>

      <?rfc nclude='reference.RFC.6371'?>

      <?rfc nclude='reference.RFC.6291'?>
    </references>
  </back>
</rfc>
