<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE rfc SYSTEM "rfc2629-xhtml.ent">
<?rfc toc="yes"?>
<?rfc tocompact="yes"?>
<?rfc tocdepth="3"?>
<?rfc tocindent="yes"?>
<?rfc symrefs="yes"?>
<?rfc sortrefs="yes"?>
<?rfc comments="yes"?>
<?rfc inline="yes"?>
<?rfc compact="yes"?>
<?rfc subcompact="no"?>
<rfc xmlns:xi="http://www.w3.org/2001/XInclude" category="std" ipr="trust200902" docName="draft-ietf-ippm-stamp-yang-08" obsoletes="" updates="" submissionType="IETF" xml:lang="en" tocInclude="true" tocDepth="3" symRefs="true" sortRefs="true" version="3">
  <!-- xml2rfc v2v3 conversion 3.6.0 -->
  <?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>

<front>
    <title abbrev="STAMP Data Model">Simple Two-way Active Measurement Protocol (STAMP) Data Model</title>
    <seriesInfo name="Internet-Draft" value="draft-ietf-ippm-stamp-yang-08"/>
    <author initials="G." surname="Mirsky" fullname="Greg Mirsky">
      <organization>ZTE Corp.</organization>
      <address>
        <email>gregimirsky@gmail.com</email>
        <email>gregory.mirsky@ztetx.com</email>
      </address>
    </author>
    <author fullname="Xiao Min" initials="X." surname="Min">
      <organization>ZTE Corp.</organization>
      <address>
        <postal>
          <street/>
          <city/>
          <code/>
          <country/>
        </postal>
        <email>xiao.min2@zte.com.cn</email>
      </address>
    </author>
    <!--
	<author initials="A." surname="Pan" fullname="Adrian Pan">
		<organization>Ericsson</organization>
		<address>
			<email>adrian.pan@ericsson.com</email>
		</address> 
	</author>
-->

	    <author fullname="Wei S Luo" initials="W.S." surname="Luo">
      <organization>Ericsson</organization>
      <address>
        <postal>
          <street/>
          <city/>
          <code/>
          <country/>
        </postal>
        <email>wei.s.luo@ericsson.com</email>
      </address>
    </author>
    <date year="2021"/>
    <area>Transport</area>
    <workgroup>Network Working Group</workgroup>
    <keyword>Internet-Draft</keyword>
    <keyword>IPPM</keyword>
    <keyword>STAMP </keyword>
    <keyword>YANG</keyword>
    <abstract>
      <t>
	This document specifies the data model for implementations of Session-Sender and Session-Reflector
	for Simple Two-way Active Measurement Protocol (STAMP) mode using YANG.
      </t>
    </abstract>
  </front>
  <middle>
    <section anchor="intro" numbered="true" toc="default">
      <name>Introduction</name>
      <t>
   The Simple Two-way Active Measurement Protocol (STAMP) <xref target="RFC8762" format="default"/> can be used
   to measure performance parameters of IP networks such as latency, jitter,
   and packet loss by sending test packets and monitoring their
   experience in the network. The STAMP protocol <xref target="RFC8762" format="default"/> in unauthenticated mode is on-wire compatible
   with TWAMP Light, discussed in Appendix I <xref target="RFC5357" format="default"/>. The TWAMP Light is known to have many implementations
   though no common management framework being defined, thus leaving some aspects of test packet
   processing to interpretation. As one of the goals of STAMP is  to support these variations, this document presents their analysis;
   describes the data model of the base STAMP specification. The defined STAMP data model can be augmented to include
   STAMP extensions, for example, described in <xref target="RFC8972"/>. This document defines the STAMP data model
   and specifies it formally, using the YANG data modeling language <xref target="RFC7950" format="default"/>.
      </t>
      <t>
   This version of the interfaces data model conforms to the Network
   Management Datastore Architecture (NMDA) defined in <xref target="RFC8342" format="default"/>.
      </t>
      <section numbered="true" toc="default">
        <name>Conventions used in this document</name>

        <section numbered="true" toc="default">
          <name>Requirements Language</name>
          <t>
   The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL
   NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED",
   "MAY", and "OPTIONAL" in this document are to be interpreted as
   described in BCP 14 <xref target="RFC2119" format="default"/> <xref target="RFC8174" format="default"/> 
   when, and only when, they appear in all capitals, as shown here.
          </t>
        </section>
      </section>
    </section>
    <section anchor="scope-model-applicability" numbered="true" toc="default">
      <name>Scope, Model, and Applicability</name>
      <t>
          The scope of this document includes a model of the STAMP as defined in 
         <xref target="RFC8762" format="default"/> and Section 3 <xref target="RFC8972"/>.
      </t>
      <!--<t>
          <xref target="stamp"/> updates stamp reference model presented in Appendix I <xref target="RFC5357"/>
          for the scenario when instantiation of a STAMP-Test session between Session-Sender and Session-Reflector
          controlled by communication between a Configuration Client as a manager and Configuration Servers as agents
          of the configuration session.
          
</t>-->

        <figure anchor="STAMP-ref-model">
        <name>STAMP Reference Model</name>
        <artwork name="" type="" align="left" alt=""><![CDATA[
             
      o----------------------------------------------------------o
      |                        Config client                     |
      o----------------------------------------------------------o
            ||                                          ||
            ||             NETCONF/RESTCONF             ||
            ||                                          ||
  o----------------------o                o-------------------------o
  |    Config server     |                |      Config server      |
  |                      |                |                         |
  +----------------------+                +-------------------------+
  | STAMP Session-Sender | <--- STAMP---> | STAMP Session-Reflector |
  +----------------------+                +-------------------------+
         
          ]]></artwork>
      </figure>
      <section anchor="data-model-parameters" numbered="true" toc="default">
        <name>Data Model Parameters</name>
        <t>
This section describes containers within the STAMP data model.
</t>
        <section anchor="session-sender" numbered="true" toc="default">
          <name>STAMP-Sender</name>
          <t>
          The stamp-session-sender container holds items that are related
          to the configuration of the stamp Session-Sender logical entity.
          </t>
          <t>
          The stamp-session-sender-state container holds information about
          the state of the particular STAMP test session.
          </t>
          <t>
          RPCs stamp-sender-start and stamp-sender-stop respectively start and stop
          the referenced session by the stamp-session-id of the STAMP.
          </t>
          <section anchor="test-modes" numbered="true" toc="default">
            <name>Controls for Test Session and Performance Metric Calculation</name>
            <t>
          The data model supports several scenarios for a STAMP Session-Sender to execute test sessions and calculate
          performance metrics: 
            </t>
            <ul spacing="normal">
              <li>
          The test mode in which the test packets are sent unbound in time as defined by
          the parameter 'interval' in the stamp-session-sender container frequency is referred to as continuous
          mode. Performance metrics in the continuous mode are calculated at a period defined by the
          parameter 'measurement-interval'.
          </li>
              <li>
          The test mode that has a specific number of the test packets configured for the test session in the
          'number-of-packets' parameter is referred to as a periodic mode. The 
          STAMP-Sender MAY repeat the test session with the same parameters.
          The 'repeat' parameter defines the number of tests and the 
          'repeat-interval' - the interval between the consecutive tests. The performance metrics are calculated
          after each test session when the interval defined by the 'session-timeout' expires.
          </li>
            </ul>
          </section>
        </section>
        
        <section anchor="session-reflector" numbered="true" toc="default">
          <name>STAMP-Reflector</name>
          <t>
   The stamp-session-reflector container holds
   items that are related to the configuration of the STAMP 
   Session-Reflector logical entity.
          </t>
          <t>
             The stamp-session-refl-state container holds Session-Reflector
             state data for the particular STAMP test session.
          </t>
        </section>
      </section>
    </section>
    
    <section anchor="data-model" numbered="true" toc="default">
      <name>Data Model</name>
      <t>
Creating the STAMP data model presents several challenges, and among them
is the identification of a test-session at Session-Reflector. A Session-Reflector MAY require
only as little as the STAMP Session Identifier (SSID) and the source IP address in received STAMP-Test packet to spawn a new
test session. More so, to test processing of Class-of-Service along the same route in
Equal Cost Multi-Path environment Session-Sender may perform STAMP test sessions
concurrently using the same source IP address, source UDP port number, destination
IP address, and destination UDP port number. Thus the only parameter that can be used to
differentiate these test sessions would be DSCP value. The DSCP field may get re-marked
along the path, and without the use of Class of Service TLV (Section 4.4 <xref target="RFC8972" format="default"/>) that will go undetected,
but by using SSID and the source IP address as a key, we can ensure that STAMP test packets that
are considered as different test sessions follow the same path even in ECMP environments.

</t>
      <section anchor="tree-diagram" numbered="true" toc="default">
        <name>Tree Diagrams</name>
        <t>
   This section presents a simplified graphical representation of the
 STAMP data model using a YANG tree diagram <xref target="RFC8340" format="default"/>.
        </t>
        <figure anchor="stamp-config-tree">
          <name>STAMP Configuration Tree Diagram</name>
          <artwork name="" type="" align="left" alt=""><![CDATA[
          
module: ietf-stamp
    +--rw stamp
    |  +--rw stamp-session-sender {session-sender}?
    |  |  +--rw sender-enable?   boolean
    |  |  +--rw sender-test-session* [stamp-session-id]
    |  |     +--rw test-session-enable?           boolean
    |  |     +--rw number-of-packets?             union
    |  |     +--rw interval?                      uint32
    |  |     +--rw session-timeout?               uint32
    |  |     +--rw measurement-interval?          uint32
    |  |     +--rw repeat?                        union
    |  |     +--rw repeat-interval?               uint32
    |  |     +--rw dscp-value?                    inet:dscp
    |  |     +--rw test-session-reflector-mode?   session-reflector-mode
    |  |     +--rw sender-ip                      inet:ip-address
    |  |     +--rw session-sender-udp-port  inet:port-number
    |  |     +--rw stamp-session-id                uint32
    |  |     +--rw session-reflector-ip             inet:ip-address
    |  |     +--rw session-reflector-udp-port?      inet:port-number
    |  |     +--rw sender-timestamp-format?       timestamp-format
    |  |     +--rw security! {stamp-security}?
    |  |     |  +--rw key-chain?   kc:key-chain-ref
    |  |     +--rw first-percentile?              percentile
    |  |     +--rw second-percentile?             percentile
    |  |     +--rw third-percentile?              percentile
    |  +--rw stamp-session-reflector {session-reflector}?
    |     +--rw reflector-enable?       boolean
    |     +--rw ref-wait?               uint32
    |     +--rw reflector-mode-state?   session-reflector-mode
    |     +--rw reflector-test-session* [stamp-session-id]
    |        +--rw stamp-session-id                    union
    |        +--rw dscp-handling-mode?           session-dscp-mode
    |        +--rw dscp-value?                   inet:dscp
    |        +--rw sender-ip?                    union
    |        +--rw sender-udp-port?              union
    |        +--rw reflector-ip?                 union
    |        +--rw reflector-udp-port?           inet:port-number
    |        +--rw reflector-timestamp-format?   timestamp-format
    |        +--rw security! {stamp-security}?
    |           +--rw key-chain?   kc:key-chain-ref

          ]]></artwork>
        </figure>
        <figure anchor="stamp-state-tree">
          <name>STAMP State Tree Diagram</name>
          <artwork name="" type="" align="left" alt=""><![CDATA[
          
module: ietf-stamp
    +--ro stamp-state
       +--ro stamp-session-sender-state {session-sender}?
       |  +--ro test-session-state* [stamp-session-id]
       |     +--ro stamp-session-id              uint32
       |     +--ro sender-session-state?   enumeration
       |     +--ro current-stats
       |     |  +--ro start-time                    yang:date-and-time
       |     |  +--ro interval?                     uint32
       |     |  +--ro duplicate-packets?            uint32
       |     |  +--ro reordered-packets?            uint32
       |     |  +--ro sender-timestamp-format?      timestamp-format
       |     |  +--ro reflector-timestamp-format?   timestamp-format
       |     |  +--ro dscp?                         inet:dscp
       |     |  +--ro two-way-delay
       |     |  |  +--ro delay
       |     |  |  |  +--ro min?   yang:gauge64
       |     |  |  |  +--ro max?   yang:gauge64
       |     |  |  |  +--ro avg?   yang:gauge64
       |     |  |  +--ro delay-variation
       |     |  |     +--ro min?   yang:gauge32
       |     |  |     +--ro max?   yang:gauge32
       |     |  |     +--ro avg?   yang:gauge32
       |     |  +--ro one-way-delay-far-end
       |     |  |  +--ro delay
       |     |  |  |  +--ro min?   yang:gauge64
       |     |  |  |  +--ro max?   yang:gauge64
       |     |  |  |  +--ro avg?   yang:gauge64
       |     |  |  +--ro delay-variation
       |     |  |     +--ro min?   yang:gauge32
       |     |  |     +--ro max?   yang:gauge32
       |     |  |     +--ro avg?   yang:gauge32
       |     |  +--ro one-way-delay-near-end
       |     |  |  +--ro delay
       |     |  |  |  +--ro min?   yang:gauge64
       |     |  |  |  +--ro max?   yang:gauge64
       |     |  |  |  +--ro avg?   yang:gauge64
       |     |  |  +--ro delay-variation
       |     |  |     +--ro min?   yang:gauge32
       |     |  |     +--ro max?   yang:gauge32
       |     |  |     +--ro avg?   yang:gauge32
       |     |  +--ro low-percentile
       |     |  |  +--ro delay-percentile
       |     |  |  |  +--ro rtt-delay?        yang:gauge64
       |     |  |  |  +--ro near-end-delay?   yang:gauge64
       |     |  |  |  +--ro far-end-delay?    yang:gauge64
       |     |  |  +--ro delay-variation-percentile
       |     |  |     +--ro rtt-delay-variation?        yang:gauge32
       |     |  |     +--ro near-end-delay-variation?   yang:gauge32
       |     |  |     +--ro far-end-delay-variation?    yang:gauge32
       |     |  +--ro mid-percentile
       |     |  |  +--ro delay-percentile
       |     |  |  |  +--ro rtt-delay?        yang:gauge64
       |     |  |  |  +--ro near-end-delay?   yang:gauge64
       |     |  |  |  +--ro far-end-delay?    yang:gauge64
       |     |  |  +--ro delay-variation-percentile
       |     |  |     +--ro rtt-delay-variation?        yang:gauge32
       |     |  |     +--ro near-end-delay-variation?   yang:gauge32
       |     |  |     +--ro far-end-delay-variation?    yang:gauge32
       |     |  +--ro high-percentile
       |     |  |  +--ro delay-percentile
       |     |  |  |  +--ro rtt-delay?        yang:gauge64
       |     |  |  |  +--ro near-end-delay?   yang:gauge64
       |     |  |  |  +--ro far-end-delay?    yang:gauge64
       |     |  |  +--ro delay-variation-percentile
       |     |  |     +--ro rtt-delay-variation?        yang:gauge32
       |     |  |     +--ro near-end-delay-variation?   yang:gauge32
       |     |  |     +--ro far-end-delay-variation?    yang:gauge32
       |     |  +--ro two-way-loss
       |     |  |  +--ro loss-count?         int32
       |     |  |  +--ro loss-ratio?         percentage
       |     |  |  +--ro loss-burst-max?     int32
       |     |  |  +--ro loss-burst-min?     int32
       |     |  |  +--ro loss-burst-count?   int32
       |     |  +--ro one-way-loss-far-end
       |     |  |  +--ro loss-count?         int32
       |     |  |  +--ro loss-ratio?         percentage
       |     |  |  +--ro loss-burst-max?     int32
       |     |  |  +--ro loss-burst-min?     int32
       |     |  |  +--ro loss-burst-count?   int32
       |     |  +--ro one-way-loss-near-end
       |     |  |  +--ro loss-count?         int32
       |     |  |  +--ro loss-ratio?         percentage
       |     |  |  +--ro loss-burst-max?     int32
       |     |  |  +--ro loss-burst-min?     int32
       |     |  |  +--ro loss-burst-count?   int32
       |     |  +--ro sender-ip                     inet:ip-address
       |     |  +--ro session-sender-udp-port       inet:port-number
       |     |  +--ro session-reflector-ip                  inet:ip-address
       |     |  +--ro session-reflector-udp-port?   inet:port-number
       |     |  +--ro sent-packets?                 uint32
       |     |  +--ro rcv-packets?                  uint32
       |     |  +--ro sent-packets-error?           uint32
       |     |  +--ro rcv-packets-error?            uint32
       |     |  +--ro last-sent-seq?                uint32
       |     |  +--ro last-rcv-seq?                 uint32
       |     +--ro history-stats* [stamp-session-id]
       |        +--ro stamp-session-id                    uint32
       |        +--ro end-time                      yang:date-and-time
       |        +--ro interval?                     uint32
       |        +--ro duplicate-packets?            uint32
       |        +--ro reordered-packets?            uint32
       |        +--ro sender-timestamp-format?      timestamp-format
       |        +--ro reflector-timestamp-format?   timestamp-format
       |        +--ro dscp?                         inet:dscp
       |        +--ro two-way-delay
       |        |  +--ro delay
       |        |  |  +--ro min?   yang:gauge64
       |        |  |  +--ro max?   yang:gauge64
       |        |  |  +--ro avg?   yang:gauge64
       |        |  +--ro delay-variation
       |        |     +--ro min?   yang:gauge32
       |        |     +--ro max?   yang:gauge32
       |        |     +--ro avg?   yang:gauge32
       |        +--ro one-way-delay-far-end
       |        |  +--ro delay
       |        |  |  +--ro min?   yang:gauge64
       |        |  |  +--ro max?   yang:gauge64
       |        |  |  +--ro avg?   yang:gauge64
       |        |  +--ro delay-variation
       |        |     +--ro min?   yang:gauge32
       |        |     +--ro max?   yang:gauge32
       |        |     +--ro avg?   yang:gauge32
       |        +--ro one-way-delay-near-end
       |        |  +--ro delay
       |        |  |  +--ro min?   yang:gauge64
       |        |  |  +--ro max?   yang:gauge64
       |        |  |  +--ro avg?   yang:gauge64
       |        |  +--ro delay-variation
       |        |     +--ro min?   yang:gauge32
       |        |     +--ro max?   yang:gauge32
       |        |     +--ro avg?   yang:gauge32
       |        +--ro low-percentile
       |        |  +--ro delay-percentile
       |        |  |  +--ro rtt-delay?        yang:gauge64
       |        |  |  +--ro near-end-delay?   yang:gauge64
       |        |  |  +--ro far-end-delay?    yang:gauge64
       |        |  +--ro delay-variation-percentile
       |        |     +--ro rtt-delay-variation?        yang:gauge32
       |        |     +--ro near-end-delay-variation?   yang:gauge32
       |        |     +--ro far-end-delay-variation?    yang:gauge32
       |        +--ro mid-percentile
       |        |  +--ro delay-percentile
       |        |  |  +--ro rtt-delay?        yang:gauge64
       |        |  |  +--ro near-end-delay?   yang:gauge64
       |        |  |  +--ro far-end-delay?    yang:gauge64
       |        |  +--ro delay-variation-percentile
       |        |     +--ro rtt-delay-variation?        yang:gauge32
       |        |     +--ro near-end-delay-variation?   yang:gauge32
       |        |     +--ro far-end-delay-variation?    yang:gauge32
       |        +--ro high-percentile
       |        |  +--ro delay-percentile
       |        |  |  +--ro rtt-delay?        yang:gauge64
       |        |  |  +--ro near-end-delay?   yang:gauge64
       |        |  |  +--ro far-end-delay?    yang:gauge64
       |        |  +--ro delay-variation-percentile
       |        |     +--ro rtt-delay-variation?        yang:gauge32
       |        |     +--ro near-end-delay-variation?   yang:gauge32
       |        |     +--ro far-end-delay-variation?    yang:gauge32
       |        +--ro two-way-loss
       |        |  +--ro loss-count?         int32
       |        |  +--ro loss-ratio?         percentage
       |        |  +--ro loss-burst-max?     int32
       |        |  +--ro loss-burst-min?     int32
       |        |  +--ro loss-burst-count?   int32
       |        +--ro one-way-loss-far-end
       |        |  +--ro loss-count?         int32
       |        |  +--ro loss-ratio?         percentage
       |        |  +--ro loss-burst-max?     int32
       |        |  +--ro loss-burst-min?     int32
       |        |  +--ro loss-burst-count?   int32
       |        +--ro one-way-loss-near-end
       |        |  +--ro loss-count?         int32
       |        |  +--ro loss-ratio?         percentage
       |        |  +--ro loss-burst-max?     int32
       |        |  +--ro loss-burst-min?     int32
       |        |  +--ro loss-burst-count?   int32
       |        +--ro sender-ip                     inet:ip-address
       |        +--ro session-sender-udp-port       inet:port-number
       |        +--ro session-reflector-ip                  inet:ip-address
       |        +--ro session-reflector-udp-port?   inet:port-number
       |        +--ro sent-packets?                 uint32
       |        +--ro rcv-packets?                  uint32
       |        +--ro sent-packets-error?           uint32
       |        +--ro rcv-packets-error?            uint32
       |        +--ro last-sent-seq?                uint32
       |        +--ro last-rcv-seq?                 uint32
       +--ro stamp-session-refl-state {session-reflector}?
          +--ro reflector-light-admin-status?   boolean
          +--ro test-session-state* [stamp-session-id]
             +--ro stamp-session-id                    uint32
             +--ro reflector-timestamp-format?   timestamp-format
             +--ro sender-ip                     inet:ip-address
             +--ro session-sender-udp-port       inet:port-number
             +--ro session-reflector-ip                  inet:ip-address
             +--ro session-reflector-udp-port?   inet:port-number
             +--ro sent-packets?                 uint32
             +--ro rcv-packets?                  uint32
             +--ro sent-packets-error?           uint32
             +--ro rcv-packets-error?            uint32
             +--ro last-sent-seq?                uint32
             +--ro last-rcv-seq?                 uint32
          ]]></artwork>
        </figure>
        <figure anchor="stamp-rpc-tree">
          <name>STAMP RPC Tree Diagram</name>
          <artwork name="" type="" align="left" alt=""><![CDATA[
          
  rpcs:
    +---x stamp-sender-start
    |  +---w input
    |     +---w stamp-session-id    uint32
    +---x stamp-sender-stop
       +---w input
          +---w stamp-stamp-session-id    uint32
          ]]></artwork>
        </figure>
      </section>
      <section anchor="yang-module" numbered="true" toc="default">
        <name>YANG Module</name>
        <sourcecode name="ietf-stamp@2021-07-10.yang" type="" markers="true"><![CDATA[

module ietf-stamp {
  yang-version 1.1;
  namespace "urn:ietf:params:xml:ns:yang:ietf-stamp";
  //namespace need to be assigned by IANA
  prefix "ietf-stamp";

import ietf-inet-types {
prefix inet;
reference "RFC 6991: Common YANG Types.";
}
import ietf-yang-types {
     prefix yang;
reference "RFC 6991: Common YANG Types.";
}
import ietf-key-chain {
prefix kc;
reference "RFC 8177: YANG Data Model for Key Chains.";
}

  organization
    "IETF IPPM (IP Performance Metrics) Working Group";

  contact
    "WG Web: http://tools.ietf.org/wg/ippm/
     WG List: ippm@ietf.org

     Editor: Greg Mirsky
          gregimirsky@gmail.com
     Editor: Xiao Min
          xiao.min2@zte.com.cn
     Editor: Wei S Luo
          wei.s.luo@ericsson.com";

  description
    "This YANG module specifies a vendor-independent model
     for the Simple Two-way Active Measurement Protocol (STAMP).

     The data model covers two STAMP logical entities -
     Session-Sender and Session-Reflector; characteristics 
     of the STAMP test session, as well as measured and
     calculated performance metrics.

        Copyright (c) 2021 IETF Trust and the persons identified as
        the document authors.  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 "2021-07-10" {
    description
      "Initial Revision. Base STAMP specification is covered";
    reference 
      "RFC XXXX: STAMP YANG Data Model.";
  }

/*
 * Typedefs
 */
typedef session-reflector-mode {
  type enumeration {
    enum stateful {
      description
        "When the Session-Reflector is stateful,
        i.e. is aware of STAMP-Test session state.";
      }
      enum stateless {
        description
          "When the Session-Reflector is stateless,
          i.e. is not aware of the state of
          STAMP-Test session.";
      }
    }
    description "State of the Session-Reflector";
    reference
      "RFC 8762 Simple Two-way Active
       Measurement Protocol (STAMP) Section 4.";
}

typedef session-dscp-mode {
  type enumeration {
    enum copy-received-value {
      description
        "Use DSCP value copied from received
        STAMP test packet of the test session.";
    }
    enum use-configured-value {
      description
        "Use DSCP value configured for this
        test session on the Session-Reflector.";
    }
  }
  description
    "DSCP handling mode by Session-Reflector.";
}

typedef timestamp-format {
  type enumeration {
    enum ntp-format {
      description
        "NTP 64 bit format of a timestamp";
    }
    enum ptp-format {
      description
        "PTPv2 truncated format of a timestamp";
    }
  }
  description
    "Timestamp format used by Session-Sender
    or Session-Reflector.";
  reference
    "RFC 8762 Simple Two-way Active
     Measurement Protocol (STAMP) Section 4.2.1.";
}

typedef percentage {
  type decimal64 {
    fraction-digits 5;
  }
  description "Percentage";
}

typedef percentile {
  type decimal64 {
    fraction-digits 5;
  }
  description
    "Percentile is a measure used in statistics
    indicating the value below which a given
    percentage of observations in a group of
    observations fall.";
}


/*
 * Feature definitions.
 */
feature session-sender {
  description
    "This feature relates to the device functions as the
    STAMP Session-Sender";
  reference
    "RFC 8762 Simple Two-way Active
     Measurement Protocol (STAMP) Section 4.2.";
}

feature session-reflector {
  description
    "This feature relates to the device functions as the
    STAMP Session-Reflector";
  reference
    "RFC 8762 Simple Two-way Active
     Measurement Protocol (STAMP) Section 4.3.";
}

feature stamp-security {
  description "Secure STAMP supported";
  reference
   "RFC 8762 Simple Two-way Active
     Measurement Protocol (STAMP) Section 4.4.";
}

/*
 * Reusable node groups
 */

grouping maintenance-statistics {
  description "Maintenance statistics grouping";
  leaf sent-packets {
    type uint32;
    description "Packets sent";
  }
  leaf rcv-packets {
    type uint32;
    description "Packets received";
  }
  leaf sent-packets-error {
    type uint32;
    description "Packets sent error";
  }
  leaf rcv-packets-error {
    type uint32;
    description "Packets received error";
  }
  leaf last-sent-seq {
    type uint32;
    description "Last sent sequence number";
  }
  leaf last-rcv-seq {
    type uint32;
    description "Last received sequence number";
  }
}

grouping test-session-statistics {
  description
    "Performance metrics calculated for
    a STAMP test session.";

  leaf interval  {
    type uint32;
    units microseconds;
    description
            "Time interval between transmission of two
      consecutive packets in the test session";
    }

    leaf duplicate-packets  {
      type uint32;
      description "Duplicate packets";
    }

    leaf reordered-packets  {
      type uint32;
      description "Reordered packets";
    }

    leaf sender-timestamp-format {
      type timestamp-format;
      description "Sender Timestamp format";
    }

    leaf reflector-timestamp-format {
      type timestamp-format;
      description "Reflector Timestamp format";
    }

    leaf dscp {
      type inet:dscp;
      description
        "The DSCP value that was placed in the header of
         STAMP UDP test packets by the Session-Sender.";
    }

    container two-way-delay {
      description
        "two way delay result of the test session";
      uses delay-statistics;
    }

    container one-way-delay-far-end {
      description
        "one way delay far-end of the test session";
      uses delay-statistics;
    }

    container one-way-delay-near-end {
      description
        "one way delay near-end of the test session";
      uses delay-statistics;
    }

    container low-percentile {
      when "/stamp/stamp-session-sender/"
        +"sender-test-session[stamp-session-id]/"
        +"first-percentile != '0.00'" {
          description
            "Only valid if the
            the first-percentile is not NULL";
      }
     description
      "Low percentile report";
       uses time-percentile-report;
    }

    container mid-percentile {
      when "/stamp/stamp-session-sender/"
        +"sender-test-session[stamp-session-id]/"
        +"second-percentile != '0.00'" {
          description
            "Only valid if the
            the first-percentile is not NULL";
      }
      description
      "Mid percentile report";
       uses time-percentile-report;
    }

    container high-percentile {
      when "/stamp/stamp-session-sender/"
        +"sender-test-session[stamp-session-id]/"
        +"third-percentile != '0.00'" {
        description
          "Only valid if the
           the first-percentile is not NULL";
      }
     description
        "High percentile report";
      uses time-percentile-report;
    }

    container two-way-loss {
      description
        "Two way loss count and ratio result of
        the test session";
      uses packet-loss-statistics;
    }

    container one-way-loss-far-end {
      when "/stamp/stamp-session-sender/"
        +"sender-test-session[stamp-session-id]/"
        +"test-session-reflector-mode = 'stateful'" {
        description
          "One-way statistic is only valid if the
          session-reflector is in stateful mode.";
      }
      description
        "One way loss count and ratio far-end of
         the test session";
      uses packet-loss-statistics;
    }

    container one-way-loss-near-end {
      when "/stamp/stamp-session-sender/"
        +"sender-test-session[stamp-session-id]/"
        +"test-session-reflector-mode = 'stateful'" {
        description
          "One-way statistic is only valid if the
           session-reflector is in stateful mode.";
      }
      description
        "One way loss count and ratio near-end of
        the test session";
      uses packet-loss-statistics;
    }
    uses session-parameters;
    uses maintenance-statistics;
}

grouping stamp-session-percentile {
  description "Percentile grouping";
  leaf first-percentile {
    type percentile;
    default 95.00;
    description
      "First percentile to report";
  }
  leaf second-percentile {
    type percentile;
    default 99.00;
    description
      "Second percentile to report";
  }
  leaf third-percentile {
    type percentile;
    default 99.90;
    description
      "Third percentile to report";
  }
}

grouping delay-statistics {
  description "Delay statistics grouping";
  container delay {
  description "Packets transmitted delay";
    leaf min {
      type yang:gauge64;
      units nanoseconds;
      description
        "Min of Packets transmitted delay";
    }
    leaf max {
      type yang:gauge64;
      units nanoseconds;
      description
        "Max of Packets transmitted delay";
    }
    leaf avg {
    type yang:gauge64;
    units nanoseconds;
    description
      "Avg of Packets transmitted delay";
    }
  }

  container delay-variation {
    description
      "Packets transmitted delay variation";
    leaf min {
      type yang:gauge32;
      units nanoseconds;
      description
        "Min of Packets transmitted
         delay variation";
    }
    leaf max {
      type yang:gauge32;
      units nanoseconds;
      description
        "Max of Packets transmitted
         delay variation";
    }
    leaf avg {
      type yang:gauge32;
      units nanoseconds;
                description
        "Avg of Packets transmitted
         delay variation";
    }
  }
}

grouping time-percentile-report {
  description "Delay percentile report grouping";
  container delay-percentile {
    description
      "Report round-trip, near- and far-end delay";
    leaf rtt-delay {
      type yang:gauge64;
      units nanoseconds;
      description
        "Percentile of round-trip delay";
    }
    leaf near-end-delay {
      type yang:gauge64;
        units nanoseconds;
        description
          "Percentile of near-end delay";
    }
    leaf far-end-delay {
      type yang:gauge64;
      units nanoseconds;
      description
        "Percentile of far-end delay";
    }
  }

  container delay-variation-percentile {
    description
      "Report round-trip, near- and far-end delay variation";
    leaf rtt-delay-variation {
      type yang:gauge32;
      units nanoseconds;
      description
        "Percentile of round-trip delay-variation";
    }
    leaf near-end-delay-variation {
      type yang:gauge32;
      units nanoseconds;
      description
        "Percentile of near-end delay variation";
    }
    leaf far-end-delay-variation {
      type yang:gauge32;
      units nanoseconds;
      description
        "Percentile of far-end delay-variation";
    }
  }
}

grouping packet-loss-statistics {
  description
    "Grouping for Packet Loss statistics";
  leaf loss-count {
    type int32;
    description
      "Number of lost packets
       during the test interval.";
  }
  leaf loss-ratio {
    type percentage;
    description
      "Ratio of packets lost to packets
       sent during the test interval.";
  }
  leaf loss-burst-max {
    type int32;
    description
      "Maximum number of consecutively
       lost packets during the test interval.";
  }
  leaf loss-burst-min {
    type int32;
    description
      "Minimum number of consecutively
       lost packets during the test interval.";
  }
  leaf loss-burst-count {
    type int32;
    description
    "Number of occasions with packet
     loss during the test interval.";
  }
}

grouping session-parameters {
  description
    "Parameters Session-Sender";
  leaf sender-ip {
    type inet:ip-address;
    mandatory true;
    description "Sender IP address";
  }
  leaf session-sender-udp-port {
    type inet:port-number {
      range "49152..65535";
    }
    mandatory true;
    description "Sender UDP port number";
    reference
    "RFC 8762 Simple Two-Way Active
     Measurement Protocol Section 4.1.";
  }
  leaf stamp-session-id {
    type uint32;
    description
    "A STAMP test session identifier
    assigned by the Session-Sender.";
    reference
    "RFC 8972 Simple Two-Way Active
     Measurement Protocol Optional
     Extensions Section 3.";
  }
  leaf session-reflector-ip {
    type inet:ip-address;
    mandatory true;
    description "Reflector IP address";
  }
  leaf session-reflector-udp-port {
    type inet:port-number{
      range "862 | 1024..49151 | 49152..65535";
    }
    default 862;
    description
    "Reflector UDP port number";
    reference
    "RFC 8762 Simple Two-Way Active
     Measurement Protocol Section 4.1.";
  }
}

grouping session-security {
  description
    "Grouping for STAMP security and related parameters";
  container security {
    if-feature stamp-security;
    presence "Enables secure STAMP";
    description
      "Parameters for STAMP authentication";
    leaf key-chain {
      type kc:key-chain-ref;
      description "Name of key-chain";
    }
  }
  reference
    "RFC 8762 Simple Two-Way Active
     Measurement Protocol Section 4.4.";
}

/*
 * Configuration Data
 */
container stamp {
  description
    "Top level container for STAMP configuration";

  container stamp-session-sender {
    if-feature session-sender;
    description "STAMP Session-Sender container";

    leaf sender-enable {
      type boolean;
      default "true";
      description
        "Whether this network element is enabled to
        act as STAMP Session-Sender";
      reference
        "RFC 8762 Simple Two-Way Active
         Measurement Protocol Section 4.2.";
    }

    list sender-test-session {
      key "stamp-session-id";
      unique "stamp-session-id";
      description
        "This structure is a container of test session
        managed objects";

      leaf test-session-enable {
        type boolean;
        default "true";
        description
          "Whether this STAMP Test session is enabled";
      }

      leaf number-of-packets {
        type union {
          type uint32 {
            range 1..4294967294 {
            description
              "The overall number of UDP test packet
              to be transmitted by the sender for this
              test session";
            }
          }
          type enumeration {
            enum forever {
              description
                "Indicates that the test session SHALL
                be run *forever*.";
            }
          }
        }
        default 10;
        description
          "This value determines if the STAMP-Test session is
          bound by number of test packets or not.";
      }

      leaf interval  {
        type uint32;
        units microseconds;
        description
          "Time interval between transmission of two
          consecutive packets in the test session in
          microseconds";
      }

      leaf session-timeout {
        when "../number-of-packets != 'forever'" {
          description
            "Test session timeout only valid if the
            test mode is periodic.";
        }
        type uint32;
        units "seconds";
        default 900;
        description
          "The timeout value for the Session-Sender to
          collect outstanding reflected packets.";
      }

      leaf measurement-interval {
        when "../number-of-packets = 'forever'" {
          description
            "Valid only when the test to run forever,
            i.e. continuously.";
        }
        type uint32;
        units "seconds";
        default 60;
        description
          "Interval to calculate performance metric when
          the test mode is 'continuous'.";
      }

      leaf repeat {
        type union {
          type uint32 {
            range 0..4294967294;
          }
          type enumeration {
            enum forever {
              description
                "Indicates that the test session SHALL
                be repeated *forever* using the
                information in repeat-interval
                parameter, and SHALL NOT decrement
                the value.";
            }
          }
        }
        default 0;
        description
          "This value determines if the STAMP-Test session must
          be repeated. When a test session has completed, the
          repeat parameter is checked. The default value
          of 0 indicates that the session MUST NOT be repeated.
          If the repeat value is 1 through 4,294,967,294
          then the test session SHALL be repeated using the
          information in repeat-interval parameter.
          The implementation MUST decrement the value of repeat
          after determining a repeated session is expected.";
      }

      leaf repeat-interval {
        when "../repeat != '0'";
        type uint32;
        units seconds;
        default 0;
        description
          "This parameter determines the timing of repeated
          STAMP-Test sessions when repeat is more than 0.";
      }

      leaf dscp-value {
        type inet:dscp;
        default 0;
        description
          "DSCP value to be set in the test packet.";
      }

      leaf test-session-reflector-mode {
        type session-reflector-mode;
        default "stateless";
        description
          "The mode of STAMP-Reflector for the test session.";
      }

      uses session-parameters;
      leaf sender-timestamp-format {
        type timestamp-format;
        default ntp-format;
        description "Sender Timestamp format";
      }
      uses session-security;
      uses stamp-session-percentile;
    }
  }

  container stamp-session-reflector {
    if-feature session-reflector;
    description
      "STAMP Session-Reflector container";
    leaf reflector-enable {
      type boolean;
      default "true";
      description
        "Whether this network element is enabled to
        act as STAMP Session-Reflector";
    }

    leaf ref-wait {
      type uint32 {
        range 1..604800;
      }
      units seconds;
      default 900;
          description
        "REFWAIT(STAMP test session timeout in seconds),
        the default value is 900";
    }

    leaf reflector-mode-state {
      type session-reflector-mode;
            default stateless;
      description
        "The state of the mode of the STAMP
        Session-Reflector";
    }

    list reflector-test-session {
      key "session-index";
      unique "sender-ip stamp-session-id";
      description
        "This structure is a container of test session
        managed objects";

      leaf session-index {
        type uint32;
        description "Session index";
      }

      leaf stamp-session-id {
        type union {
          type uint32;
          type enumeration {
            enum any {
              description
                "Indicates that the Session-Reflector
                accepts STAMP test packets from
                a Session-Sender with any SSID
                value";
              reference
                "RFC 8972 Simple Two-Way Active
                Measurement Protocol Optional
                Extensions Section 3.";
            }
          }
      }
  
      leaf dscp-handling-mode {
        type session-dscp-mode;
        default copy-received-value;
        description
          "Session-Reflector handling of DSCP:
          - use value copied from received STAMP-Test packet;
          - use value explicitly configured";
      }

      leaf dscp-value {
        when "../dscp-handling-mode = 'use-configured-value'";
        type inet:dscp;
        default 0;
        description
        "DSCP value to be set in the reflected packet
        if dscp-handling-mode is set to use-configured-value.";
      }

      leaf sender-ip {
        type union {
          type inet:ip-address;
          type enumeration {
            enum any {
              description
                "Indicates that the Session-Reflector
                accepts STAMP test packets from
                any Session-Sender";
            }
          }
        }
        default any;
        description
          "This value determines whether specific
          IPv4/IPv6 address of the Session-Sender
          or the wildcard, i.e. any address";
      }

      leaf sender-udp-port {
        type union {
          type inet:port-number {
            range "49152..65535";
          }
          type enumeration {
            enum any {
              description
                "Indicates that the Session-Reflector
                accepts STAMP test packets from
                any Session-Sender";
            }
          }
        }
        default any;
        description
          "This value determines whether specific
          port number of the Session-Sender
          or the wildcard, i.e. any";
      }

      leaf reflector-ip {
        type union {
          type inet:ip-address;
          type enumeration {
            enum any {
              description
                "Indicates that the Session-Reflector
                accepts STAMP test packets on
                any of its interfaces";
            }
          }
        }
        default any;
        description
          "This value determines whether specific
          IPv4/IPv6 address of the Session-Reflector
          or the wildcard, i.e. any address";
      }

      leaf reflector-udp-port {
        type inet:port-number{
          range "862 | 1024..49151 | 49152..65535";
        }
        default 862;
        description
        "Reflector UDP port number";
        reference
        "RFC 8762 Simple Two-Way Active
         Measurement Protocol Section 4.1.";
      }

      leaf reflector-timestamp-format {
        type timestamp-format;
        default ntp-format;
        description "Reflector Timestamp format";
      }
      uses session-security;
    }
  }
}

 /*
 * Operational state data nodes
 */
container stamp-state {
  config false;
  description
    "Top level container for STAMP state data";

  container stamp-session-sender-state {
    if-feature session-sender;
    description
      "Session-Sender container for state data";
    list test-session-state{
      key "session-index";
      description
        "This structure is a container of test session
        managed objects";

      leaf session-index {
        type uint32;
        description "Session index";
      }

      leaf sender-session-state {
        type enumeration {
          enum active {
            description "Test session is active";
          }
          enum ready {
            description "Test session is idle";
          }
        }
        description
          "State of the particular STAMP test
          session at the sender";
      }

      container current-stats {
        description
          "This container contains the results for the current
          Measurement Interval in a Measurement session ";
        leaf start-time {
          type yang:date-and-time;
          mandatory true;
          description
            "The time that the current Measurement Interval started";
        }

        uses test-session-statistics;

      }

      list history-stats {
        key session-index;
        description
          "This container contains the results for the history
          Measurement Interval in a Measurement session ";
        leaf session-index {
          type uint32;
          description
            "The identifier for the Measurement Interval
            within this session";
        }

        leaf end-time {
          type yang:date-and-time;
          mandatory true;
          description
            "The time that the Measurement Interval ended";
        }

        uses test-session-statistics;
      }
    }
  }

  container stamp-session-refl-state {
    if-feature session-reflector;
    description
      "STAMP Session-Reflector container for
      state data";
    leaf reflector-light-admin-status {
      type boolean;
      description
        "Whether this network element is enabled to
        act as STAMP Session-Reflector";
    }

    list test-session-state {
      key "session-index";
      description
        "This structure is a container of test session
        managed objects";

      leaf session-index {
        type uint32;
        description "Session index";
      }

      leaf reflector-timestamp-format {
        type timestamp-format;
        description "Reflector Timestamp format";
      }
      uses session-parameters;
      uses maintenance-statistics;

    }
  }
}

rpc stamp-sender-start {
  description
    "start the configured sender session";
  input {
    leaf stamp-session-id {
      type uint32;
      mandatory true;
      description
        "The STAMP session to be started";
    }
  }
}

rpc stamp-sender-stop {
  description
    "stop the configured sender session";
  input {
    leaf stamp-session-id {
      type uint32;
      mandatory true;
      description
        "The session to be stopped";
    }
  }
}
}

 ]]></sourcecode>
      </section>
    </section>
    <section anchor="iana-consider" numbered="true" toc="default">
      <name>IANA Considerations</name>
      <t>
   This document registers a URI in the IETF XML registry <xref target="RFC3688" format="default"/>.
   Following the format in <xref target="RFC3688" format="default"/>, the following registration is
   requested to be made.
</t>
      <t>
   URI: urn:ietf:params:xml:ns:yang:ietf-stamp
</t>
      <t>
   Registrant Contact: The IPPM WG of the IETF.
</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="RFC7950" format="default"/>.
</t>
      <t>
   name: ietf-stamp
</t>
      <t>
   namespace: urn:ietf:params:xml:ns:yang:ietf-stamp
</t>
      <t>
   prefix: stamp
</t>
      <t>
   reference: RFC XXXX
</t>
    </section>
    <section anchor="security" numbered="true" toc="default">
      <name>Security Considerations</name>
      <t>
      The YANG module specified in this document defines a schema for data
   that is designed to be accessed via network management protocols such
   as NETCONF <xref target="RFC6241" format="default"/> or RESTCONF <xref target="RFC8040" format="default"/>.
   The lowest NETCONF layer is the secure transport layer, and the mandatory-to-implement secure
   transport is Secure Shell (SSH) <xref target="RFC6242" format="default"/>. The lowest RESTCONF layer
   is HTTPS, and the mandatory-to-implement secure transport is TLS
   <xref target="RFC8446" format="default"/>.
      </t>
      <t>
      The NETCONF access control model <xref target="RFC8341" format="default"/> provides the means to
   restrict access for particular NETCONF or RESTCONF users to a
   pre-configured subset of all available NETCONF or RESTCONF protocol
   operations and content.
      </t>
      <t>
     There are a number of data nodes defined in this YANG module that are
   writable/creatable/deletable (i.e., config true, which is the
   default). These data nodes may be considered sensitive or vulnerable
   in some network environments. Write operations (e.g., edit-config)
   to these data nodes without proper protection can have an adverse
   effect on network operations.  These are the subtrees and data nodes
   and their sensitivity/vulnerability:
</t>
      <t>TBD</t>
      <t>
   Unauthorized access to any data node of these subtrees can adversely
   affect the routing subsystem of both the local device and the
   network. This may lead to corruption of the measurement that may result in
   false corrective action, e.g., false negative or false positive. That could be, for
   example, prolonged and undetected deterioration of the quality of service or
   actions to improve the quality unwarranted by the real network conditions.
</t>
      <t>
   Some of the readable data nodes in this YANG module may be considered
   sensitive or vulnerable in some network environments.  It is thus
   important to control read access (e.g., via get, get-config, or
   notification) to these data nodes. These are the subtrees and data
   nodes and their sensitivity/vulnerability:
</t>
      <!--
   <t>/ietf-vrrp:stamp</t>
-->
   <t>TBD</t>
      <t>
   Unauthorized access to any data node of these subtrees can disclose
   the operational state information of VRRP on this device.
      </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:
</t>
      <t>TBD</t>
    </section>
    <section numbered="true" toc="default">
      <name>Acknowledgments</name>
      <t>
 Authors recognize and appreciate valuable comments provided by Adrian Pan and Henrik Nydell.
      </t>
    </section>
  </middle>
  <back>
    <references>
      <name>References</name>
      <references>
        <name>Normative References</name>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8174.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.7950.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.3688.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.5357.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.6241.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.6242.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8341.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8040.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8446.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8762.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8342.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8972.xml"/>
      </references>
      <references>
        <name>Informative References</name>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8340.xml"/>
      </references>
    </references>
    <section anchor="appendix-a" numbered="true" toc="default">
      <name>Example of STAMP Session Configuration</name>
      <t>
      <xref target="sender-example" format="default"/> shows a configuration example of a STAMP-Sender.
      </t>
      <figure anchor="sender-example">
        <name>XML instance of STAMP Session-Sender configuration</name>
        <artwork name="" type="" align="left" alt=""><![CDATA[    
   <?xml version="1.0" encoding="utf-8"?>
   <data xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
    <stamp xmlns="urn:ietf:params:xml:ns:yang:ietf-stamp">
        <stamp-session-sender>
          <session-enable>enable</session-enable>
            <stamp-session-id>10</stamp-session-id>
            <test-session-enable>enable<test-session-enable>
            <number-of-packets>forever</number-of-packets>
            <interval>10</interval> <!-- 10 microseconds -->
            <measurement-interval/> <!-- use default 60 seconds -->
            <!-- use default 0 repetitions, 
                  i.e. do not repeat this session -->
            <repeat/> 
            <dscp-value/> <!-- use deafult 0 (CS0) -->
            <!-- use default 'stateless' -->
            <test-session-reflector-mode/> 
            <sender-ip></sender-ip>
            <session-sender-udp-port></session-sender-udp-port>
            <session-reflector-ip></session-reflector-ip>
            <session-reflector-udp-port/> <!-- use default 862 -->
            <sender-timestamp-format/>
            <!-- No authentication -->
            <first-percentile/> <!-- use default 95 -->
            <second-percentile/> <!-- use default 99 -->
            <third-percentile/> <!-- use default 99.9 -->
        </stamp-session-sender>
     </stamp>
   </data>

]]></artwork>
      </figure>
      <figure anchor="reflector-example">
        <name>XML instance of STAMP Session-Reflector configuration</name>
        <artwork name="" type="" align="left" alt=""><![CDATA[    
   <?xml version="1.0" encoding="utf-8"?>
   <data xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
    <stamp xmlns="urn:ietf:params:xml:ns:yang:ietf-stamp">
        <stamp-session-reflector>
          <session-enable>enable</session-enable>
          <ref-wait/> <!-- use default 900 seconds -->
          <!-- use default 'stateless' -->
          <reflector-mode-state/> 
          <stamp-session-id/>   <!-- use default 'any' -->
          <!-- use default 'copy-received-value' -->
          <dscp-handling-mode/>
          <!-- not used because of dscp-hanling-mode 
                being 'copy-received-value' -->
          <dscp-value/> 
          <sender-ip/> <!-- use default 'any' -->
          <sender-udp-port/>  <!-- use default 'any' -->
          <reflector-ip/> <!-- use default 'any' -->
          <reflector-udp-port/>  <!-- use default 862 -->
          <reflector-timestamp-format/>
          <!-- No authentication -->
        </stamp-session-reflector>
     </stamp>
   </data>

]]></artwork>
      </figure>
    </section>
  </back>
</rfc>
