<?xml version="1.0" encoding="iso-8859-1"?>
<?rfc toc="yes"?>
<?rfc symrefs="yes" ?>
<?rfc sortrefs="yes" ?>
<?rfc compact="yes" ?>
<?rfc subcompact="no" ?>

<rfc category="std" ipr="trust200902" docName="draft-wang-ippm-alt-mark-yang-01" consensus="true" submissionType="IETF">

<front>
    <title abbrev="YANG Model for AMM"> A YANG Data Model for Alternate Marking Method </title>

    <author fullname="Minxue Wang" initials="M" surname="Wang">
    <organization>China Mobile</organization>
    <address>
        <postal>
        <street>No.32 Xuanwumen west street</street>
        <!-- Reorder these if your country does things differently -->
        <city>Beijing</city>
        <region></region>
        <code>100053</code>
        <country>China</country>
        </postal>
        <phone></phone>
        <email>wangminxue@chinamobile.com</email>
        <!-- uri and facsimile elements may also be added -->
    </address>
    </author>

    <author fullname="Liuyan Han" initials="L" surname="Han">
    <organization>China Mobile</organization>
    <address>
        <postal>
        <street>No.32 Xuanwumen west street</street>
        <!-- Reorder these if your country does things differently -->
        <city>Beijing</city>
        <region></region>
        <code>100053</code>
        <country>China</country>
        </postal>
        <phone></phone>
        <email>hanliuyan@chinamobile.com</email>
        <!-- uri and facsimile elements may also be added -->
    </address>
    </author>
	
    <author fullname="Xiao Min" initials="X" surname="Min">
    <organization>ZTE Corporation</organization>
    <address>
        <postal>
        <street></street>
        <!-- Reorder these if your country does things differently -->
        <city>Nanjing</city>
        <region></region>
        <code></code>
        <country>China</country>
        </postal>
        <phone></phone>
        <email>xiao.min2@zte.com.cn</email>
        <!-- uri and facsimile elements may also be added -->
    </address>
    </author>
	
    <author fullname="Jun Guo" initials="J" surname="Guo">
    <organization>ZTE Corporation</organization>
    <address>
        <postal>
        <street></street>
        <!-- Reorder these if your country does things differently -->
        <city>Nanjing</city>
        <region></region>
        <code></code>
        <country>China</country>
        </postal>
       <phone></phone>
        <email>guo.jun2@zte.com.cn</email>
        <!-- uri and facsimile elements may also be added -->
    </address>
    </author>
	
    <author fullname="Massimo Nilo" initials="M" surname="Nilo">
    <organization>Telecom Italia</organization>
    <address>
        <postal>
        <street></street>
        <!-- Reorder these if your country does things differently -->
        <city>Torino</city>
        <region></region>
        <code></code>
        <country>Italy</country>
        </postal>
       <phone></phone>
        <email>massimo.nilo@telecomitalia.it</email>
        <!-- uri and facsimile elements may also be added -->
    </address>
    </author>
	
    <date year="2023"/>
  
    <area>Routing</area>
    <workgroup>IPPM Working Group</workgroup>

    <keyword>Request for Comments</keyword>
    <keyword>RFC</keyword>
    <keyword>Internet Draft</keyword>
    <keyword>I-D</keyword>

    <abstract>
	
    <t> 
	Alternate-Marking Method (AMM) is a technique used to perform packet loss, delay, and jitter measurements on live traffic. 
	This document defines a YANG data model for Alternate Marking Method.
	</t>
	
    </abstract>
    
</front>
  
<middle>

    <section title="Introduction">

    <t>
	Alternate-Marking Method (<xref target="RFC9341"/> <xref target="RFC9342"/>) is a technique used to perform packet loss, delay, 
	and jitter measurements on live traffic.
	<xref target="RFC9343"/> defines how to encode Alternate-Marking information in IPv6 Extension Header.
	<xref target="I-D.ietf-mpls-inband-pm-encapsulation"/> defines how to encode Alternate-Marking information in MPLS Label Stack.
	This document defines a YANG data model for alternate marking method.
	</t>
	
	</section>
	 
	<section title="Tree Diagram"> 
	 <t>This section presents a simplified graphical representation of the AMM data model using a YANG tree diagram <xref target="RFC8340"/>. </t>

     <figure  align="center">
            <artwork align="center"><![CDATA[	 
module: ietf-alternate-marking
  +--rw configuration
     +--rw alternate-marking
        +--rw global
        |  +--rw label?      uint32
        |  +--rw fii-mode?   enumeration
        +--rw head-node
        |  +--rw flow* [flow-id]
        |     +--rw flow-id              uint32
        |     +--rw alternate-status?    enable-status
        |     +--rw period?              alternate-marking-period
        |     +--rw hop-by-hop-status?   enable-status
        |     +--rw source-mac?          yang:mac-address
        |     +--rw dest-mac?            yang:mac-address
        |     +--rw vlan-id?             uint16
        |     +--rw internal-vlan-id?    uint16
        |     +--rw priority-8021p?      uint8
        |     +--rw sip?                 inet:ip-prefix
        |     +--rw dip?                 inet:ip-prefix
        |     +--rw protocol?            uint8
        |     +--rw source-port?         uint16
        |     +--rw dest-port?           uint16
        |     +--rw vpn-type?            enumeration
        |     +--rw vpn-name?            string
        |     +--rw if-name              string
        |     +--rw member-port?         string
        +--rw end-node
           +--rw relation* [flow-id]
              +--rw flow-id              uint32
              +--rw (vpn-type)?
              |  +--:(vrf)
              |  |  +--rw vrf-name       string
              |  +--:(vpws)
              |  |  +--rw vpws-name      string
              |  +--:(vpls)
              |     +--rw vpls-name      string
              +--rw period?              alternate-marking-period
              +--rw hop-by-hop-status?   enable-status
              +--rw if-name?             string
            ]]></artwork>
       <postamble></postamble>
      </figure>
    </section>

	<section title="Alternate Marking Method YANG Data Model"> 
     <figure  align="center">
       <artwork align="center"><![CDATA[			
<CODE BEGINS> file "ietf-alternate-marking@2022-07-08.yang"
module ietf-alternate-marking {
  yang-version "1.1";
  namespace "urn:ietf:params:xml:ns:yang:ietf-alternate-marking";
  
  prefix alternate-marking;
  
  import ietf-inet-types {
    prefix inet ;
    reference "RFC 6991: Common YANG Data Types";
    revision-date 2013-07-15 ;
  }
  import ietf-yang-types {
    prefix yang ;
    reference "RFC 6991: Common YANG Data Types";
    revision-date 2013-07-15 ;
  }
  
  organization
    "IETF IPPM (IP Performance Measurement) Working Group";

  contact
    "WG Web:   <http://datatracker.ietf.org/group/ippm/>
     WG List:  <mailto:ippm@ietf.org>

     Author:   Minxue Wang
               <mailto:wangminxue@chinamobile.com>
     Author:   Liuyan Han
               <mailto:hanliuyan@chinamobile.com>
     Author:   Xiao Min
               <mailto:xiao.min2@zte.com.cn>
     Author:   Jun Guo
               <mailto:guo.jun2@zte.com.cn>
     Author:   Massimo Nilo
               <mailto:massimo.nilo@telecomitalia.it>";

  description
    "This document defines a YANG data model used for alternate
     marking method.

     This YANG model conforms to the Network Management
     Datastore Architecture (NDMA) as described in RFC 8342.

     Copyright (c) 2023 IETF Trust and the persons identified as
     authors of the code.  All rights reserved.

     Redistribution and use in source and binary forms, with or
     without modification, is permitted pursuant to, and subject
     to the license terms contained in, the Simplified BSD License
     set forth in Section 4.c of the IETF Trust's Legal Provisions
     Relating to IETF Documents
     (http://trustee.ietf.org/license-info).

     This version of this YANG module is part of RFC XXXX;
     see the RFC itself for full legal notices.";
			  
  revision 2022-05-11 {
    description 'First draft.'
                ;
  }
  
  typedef alternate-marking-period {
    type enumeration {
      enum 1s {
        value 1 ;
        description 'Alternate marking period is 1s.'
                    ;
      }
      enum 10s {
        value 2 ;
        description 'Alternate marking period is 10s.'
                    ;
      }
      enum 30s {
        value 3 ;
        description 'Alternate marking period is 30s.'
                    ;
      }
      enum 60s {
        value 4 ;
        description 'Alternate marking period is 60s.'
                    ;
      }
      enum 5min {
        value 5 ;
        description 'Alternate marking period is 5min.'
                    ;
      }
    }
    description 'Alternate marking period,including '
              + '1s,10s,30s,60s,5min.'
                ;
  }
  typedef enable-status {
    type enumeration {
      enum enable {
        value 1 ;
        description 'Enables the function.'
                    ;
      }
      enum disable {
        value 0 ;
        description 'Disables the function.'
                    ;
      }
    }
    description 'Enable status,including enable and disable.'
                ;
  }
  container configuration {
    description 'Configuration of alternate marking model Info.'
                ;
    container alternate-marking {
      description 'alternate-marking flow configuration.'
                  ;
      container global {
        description 'Global configuration.'
                    ;
        leaf label {
          description 'The label ranges from 4 to 6 and 8 '
                    + 'to 12(default:12).'
                      ;
          type uint32 {
            range '4..6 | 8..12'
                  {
              description 'The range of the label.'
                          ;
            }
          }
          default 12 ;
        }
        leaf fii-mode {
          description 'Position ID of the guide label.'
                      ;
          type enumeration {
            enum non-bottom {
              value 0 ;
            }
            enum bottom {
              value 1 ;
            }
          }
          default non-bottom ;
        }
      }
      container head-node {
        description 'Configure alternate-marking flow coloring.'
                    ;
        list flow {
          description 'Configure alternate-marking flow coloring.'
                      ;
          key flow-id ;
          leaf flow-id {
            description 'The flow id to identify a specific flow, '
                      + 'ranges from 1 to 1048575. In IPv6 '
                      + 'encoding it is called FlowMonID and in '
                      + 'MPLS encoding it is called Flow-ID.'
                        ;
            type uint32 {
              range 1..1048575 {
                description 'The range of flow id.'
                            ;
              }
            }
          }
          leaf alternate-status {
            description 'The status of flow alternate marking, '
                      + 'including enable and disable'
                      + '(default:enable).'
                        ;
            type enable-status ;
            default enable ;
          }
          leaf period {
            description 'The period of flow coloring,including '
                      + '1s,10s,30s,60s and 5min(default:30s).'
                        ;
            type alternate-marking-period ;
            default 30s ;
          }
          leaf hop-by-hop-status {
            description 'The status of hop-by-hop coloring, '
                      + 'including enable and '
                      + 'disable(default:enable).'
                        ;
            type enable-status ;
            default disable ;
          }
          leaf source-mac {
            description 'The source MAC address.'
                        ;
            type yang:mac-address ;
          }
          leaf dest-mac {
            description 'The destination MAC address.'
                        ;
            type yang:mac-address ;
          }
          leaf vlan-id {
            description 'The value of vlan ID,ranges from 1 '
                      + 'to 4094.'
                        ;
            type uint16 {
              range 1..4094 {
                description 'The range of VLAN ID.'
                            ;
              }
            }
          }
          leaf internal-vlan-id {
            description 'The value of internal vlan ID,ranges '
                      + 'from 1 to 4094.'
                        ;
            type uint16 {
              range 1..4094 {
                description 'The range of internal VLAN ID.'
                            ;
              }
            }
          }
          leaf priority-8021p {
            description 'The value of priority-8021p,ranges '
                      + 'from 0 to 7.'
                        ;
            type uint8 {
              range 0..7 {
                description 'The range of priority-8021p.'
                            ;
              }
            }
          }
          leaf sip {
            description 'The source ip address.'
                        ;
            type inet:ip-prefix ;
          }
          leaf dip {
            description 'The destination ip address.'
                        ;
            type inet:ip-prefix ;
          }
          leaf protocol {
            description 'The protocol number,ranges from 1 to 255.'
                        ;
            type uint8 {
              range 1..255 {
                description 'The range of protocol.'
                            ;
              }
            }
          }
          leaf source-port {
            description 'The source port,ranges from 1 to '
                      + '65535.'
                        ;
            type uint16 {
              range 1..65535 {
                description 'The range of port number.'
                            ;
              }
            }
          }
          leaf dest-port {
            description 'The destination port,ranges from '
                      + '1 to 65535.'
                        ;
            type uint16 {
              range 1..65535 {
                description 'The range of port number.'
                            ;
              }
            }
          }
          leaf vpn-type {
            description 'The VPN type of the UNI interface.'
                        ;
            type enumeration {
              enum l3vpn {
                value 0 ;
              }
              enum l2vpn {
                value 1 ;
              }
            }
            default l3vpn ;
          }
          leaf vpn-name {
            description 'The access VPN name of ip flow.'
                        ;
            type string {
              length 1..31 {
                description 'The range of VRF name length.'
                            ;
              }
            }
          }
          leaf if-name {
            description 'The UNI interface name of ip flow.'
                        ;
            type string {
              length 1..31 ;
            }
            mandatory true ;
          }
          leaf member-port {
            description 'The member port of the UNI interface.'
                        ;
            type string ;
          }
        }
      }
      container end-node {
        description 'Configure the relation between Flowid and VPN.'
                    ;
        list relation {
          description 'Configure the relation between Flowid '
                    + 'and VPN.'
                      ;
          key flow-id ;
          leaf flow-id {
            description 'The flow id to identify a specific flow, '
                      + 'ranges from 1 to 1048575.'
                        ;
            type uint32 {
              range 1..1048575 {
                description 'The range of flow-id.'
                            ;
              }
            }
          }
          choice vpn-type {
            description 'Choose one from vrf and vpws.'
                        ;
            case vrf {
              description 'Type is VRF.'
                          ;
              leaf vrf-name {
                description 'The name of VRF,this string length '
                          + 'ranges from 1 to 32.'
                            ;
                type string {
                  length 1..32 {
                    description 'This string length ranges from '
                              + '1 to 32.'
                                ;
                  }
                }
                mandatory true ;
              }
            }
            case vpws {
              description 'Type is vpws.'
                          ;
              leaf vpws-name {
                description 'The name of VPWS,this string length '
                          + 'ranges from 1 to 32.'
                            ;
                type string {
                  length 1..32 {
                    description 'This string length ranges from '
                              + '1 to 32.'
                                ;
                  }
                }
                mandatory true ;
              }
            }
            case vpls {
              description 'Type is VPLS.'
                          ;
              leaf vpls-name {
                description 'The name of VPLS,this string length '
                          + 'ranges from 1 to 32.'
                            ;
                type string {
                  length 1..32 {
                    description 'This string length ranges from '
                              + '1 to 32.'
                                ;
                  }
                }
                mandatory true ;
              }
            }
          }
          leaf period {
            description 'The flip period of relation,including '
                      + '1s,10s,30s,60s,5min(default:30s).'
                        ;
            type alternate-marking-period ;
            default 30s ;
          }
          leaf hop-by-hop-status {
            description 'The status of hop-by-hop,including enable '
                      + 'and disable(default:disable).'
                        ;
            type enable-status ;
            default disable ;
          }
          leaf if-name {
            description 'The UNI interface name of relation.'
                        ;
            type string {
              length 1..31 ;
            }
          }
        }
      }
    }
  }
}
<CODE ENDS>
            ]]></artwork>
       <postamble></postamble>
      </figure>
    </section>

    <section title="Security Considerations">
	
    <t>	TBD.</t>
	
    </section>
  
    <section title="IANA Considerations"> 
    <t> TBD.</t>
    </section>
    
    <section title="Acknowledgements">
	<t> The authors would like to acknowledge Zhanwei Dou and Chuang Tang for their contribution to this document.</t>
	<t> The authors would like to acknowledge Giuseppe Fioccola and Mauro Cociglio for their careful review and very helpful comments.</t>
    </section>  
  
</middle>
  
<back>

    <references title="Normative References">
     <?rfc include="reference.RFC.9341"?>
     <?rfc include="reference.RFC.9342"?>
    </references>

	<references title="Informative References">
     <?rfc include="reference.RFC.8340"?>
     <?rfc include="reference.RFC.9343"?>
     <?rfc include="reference.I-D.ietf-mpls-inband-pm-encapsulation"?>
    </references>

</back>
</rfc>

