<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
<!ENTITY RFC0768 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.0768.xml">
<!ENTITY RFC2119 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml">
<!ENTITY RFC4656 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.4656.xml">
<!ENTITY RFC5357 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.5357.xml">
<!ENTITY RFC8174 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8174.xml">
<!ENTITY RFC2104 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.2104.xml">
<!ENTITY RFC2113 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.2113.xml">
<!ENTITY RFC4868 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.4868.xml">
<!ENTITY RFC7880 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.7880.xml">
<!ENTITY RFC6038 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.6038.xml">
<!ENTITY RFC6437 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.6437.xml">
<!ENTITY RFC6936 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.6936.xml">
<!ENTITY RFC7506 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.7506.xml">
<!ENTITY RFC7820 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.7820.xml">
<!ENTITY RFC8029 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8029.xml">
<!ENTITY RFC8186 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8186.xml">
<!ENTITY RFC8321 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8321.xml">
<!ENTITY RFC8402 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8402.xml">
<!ENTITY RFC8754 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8754.xml">
<!ENTITY RFC8762 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8762.xml">
<!ENTITY I-D.ietf-spring-segment-routing-policy SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml3/reference.I-D.ietf-spring-segment-routing-policy.xml">
<!ENTITY I-D.ietf-spring-mpls-path-segment SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml3/reference.I-D.ietf-spring-mpls-path-segment.xml">
<!ENTITY I-D.ietf-pce-binding-label-sid SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml3/reference.I-D.ietf-pce-binding-label-sid.xml">
<!ENTITY I-D.ietf-pce-sr-bidir-path SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml3/reference.I-D.ietf-pce-sr-bidir-path.xml">
<!ENTITY I-D.gandhi-spring-twamp-srpm SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml3/reference.I-D.gandhi-spring-twamp-srpm.xml">
<!ENTITY I-D.gandhi-spring-stamp-srpm SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml3/reference.I-D.gandhi-spring-stamp-srpm.xml">
<!ENTITY I-D.ietf-spring-srv6-network-programming SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml3/reference.I-D.ietf-spring-srv6-network-programming.xml">
<!ENTITY I-D.ietf-mpls-spl-terminology SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml3/reference.I-D.ietf-mpls-spl-terminology.xml">
]>
<rfc category="std" docName="draft-gandhi-spring-sr-enhanced-plm-03"
     ipr="trust200902" submissionType="IETF">
  <!-- Generated by id2xml 1.5.0 on 2020-02-06T01:41:26Z -->

  <?rfc compact="yes"?>

  <?rfc text-list-symbols="oo*+-"?>

  <?rfc subcompact="no"?>

  <?rfc sortrefs="no"?>

  <?rfc symrefs="yes"?>

  <?rfc strict="yes"?>

  <?rfc toc="yes"?>

  <front>
    <title abbrev="Performance and Liveness Monitoring in SR">
    Enhanced Performance Delay and Liveness Monitoring in Segment Routing Networks</title>

    <author fullname="Rakesh Gandhi" initials="R." role="editor"
            surname="Gandhi">
      <organization>Cisco Systems, Inc.</organization>

      <address>
        <postal>
          <street>Canada</street>
        </postal>

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

    <author fullname="Clarence Filsfils" initials="C." surname="Filsfils">
      <organization>Cisco Systems, Inc.</organization>

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

    <author fullname="Navin Vaghamshi" initials="N." surname="Vaghamshi">
      <organization>Reliance</organization>

      <address>
        <email>Navin.Vaghamshi@ril.com</email>
      </address>
    </author>

    <author fullname="Moses Nagarajah" initials="M." surname="Nagarajah">
      <organization>Telstra</organization>

      <address>
        <email>Moses.Nagarajah@team.telstra.com</email>
      </address>
    </author>

    <author fullname="Richard Foote" initials="R." surname="Foote">
      <organization>Nokia</organization>

      <address>
        <email>footer.foote@nokia.com</email>
      </address>
    </author>

    <date day="26" month="September" year="2020"/>

    <workgroup>SPRING Working Group</workgroup>

    <abstract>
      <t>Segment Routing (SR) leverages the source routing paradigm. SR is
      applicable to both Multiprotocol Label Switching (SR-MPLS) and IPv6
      (SRv6) data planes. This document defines procedure for 
      Enhanced Performance Delay and Liveness Monitoring (PDLM) in Segment Routing networks.
      The procedure leverages the probe messages compatible with the delay measurement 
      message formats defined in RFC 5357 (Two-Way
      Active Measurement Protocol (TWAMP)) and RFC 8762 (Simple 
      Two-Way Active Measurement Protocol (STAMP)) and is applicable to  
      end-to-end SR Paths including 
      SR Policies for both SR-MPLS and SRv6 data planes.</t>
    </abstract>
  </front>

  <middle>
    <section anchor="sect-1" title="Introduction">
      <t>Segment Routing (SR) leverages the source routing paradigm and
      greatly simplifies network operations for Software Defined Networks
      (SDNs). SR is applicable to both Multiprotocol Label Switching (SR-MPLS)
      and IPv6 (SRv6) data planes <xref target="RFC8402"/>. SR takes advantage
      of the Equal-Cost Multipaths (ECMPs) between source and transit nodes,
      between transit nodes and between transit and destination nodes. SR
      Policies as defined in <xref format="default"
      target="I-D.ietf-spring-segment-routing-policy"/> are used to steer
      traffic through a specific, user-defined paths using a stack of
      Segments. Built-in Performance Delay Measurement (DM) as well as 
      Liveness Monitoring for Connectivity Verification (CV) and 
      Continuity Check (CC) are essential requirements to
      provide Service Level Agreements (SLAs) in SR networks.</t>

      <t>The One-Way Active Measurement Protocol (OWAMP) defined in <xref
      target="RFC4656"/> and Two-Way Active Measurement Protocol (TWAMP)
      defined in <xref target="RFC5357"/> provide capabilities for the
      measurement of various performance metrics in IP networks using probe
      messages. The TWAMP Light [Appendix I in RFC5357] and the 
      Simple Two-way Active Measurement Protocol (STAMP) <xref target="RFC8762"/> provide 
      simplified mechanisms for active performance measurement in IP networks, 
      alleviating the need for control-channel signaling by using configuration 
      data model to provision a test-channel.</t>
      
      <t><xref target="I-D.gandhi-spring-twamp-srpm"/> defines procedure
      for performance measurement using TWAMP Light messages with user-defined IP/UDP 
      paths in SR networks. <xref target="I-D.gandhi-spring-stamp-srpm"/> defines similar 
      procedure using STAMP messages in SR networks. The procedure for one-way and two-way modes 
      defined for delay measurement can also be applied to liveness monitoring of SR Paths. 
      However, it limits the scale for number of PM sessions and fault detection interval
      since the probe query messages need to be punted from the forwarding path
      (to slow path or control plane) and response messages need to be injected.</t>

      <t>For Liveness Monitoring, Seamless Bidirectional Forwarding Detection (S-BFD)
      <xref target="RFC7880"/> can be used in Segment Routing networks.
      However, S-BFD requires protocol support on the reflector node to process
      the S-BFD packets as packets need to be punted from the forwarding path in order to
      send the reply thereby limiting the scale for number of PM sessions and fault
      detection interval. In addition, S-BFD protocol does not have the
      capability today to enable performance delay monitoring in SR
      networks. Enabling multiple protocols in SR networks, S-BFD for liveness
      monitoring and TWAMP Light or STAMP for performance delay monitoring increases
      the deployment and operational complexities in SR networks.</t>

      <t>This document defines procedure for 
      Enhanced Performance Delay and Liveness Monitoring (PDLM) in Segment Routing networks.
      The procedure leverages the probe messages compatible with the delay measurement 
      message formats defined in RFC 5357 (Two-Way
      Active Measurement Protocol (TWAMP)) and RFC 8762 (Simple 
      Two-Way Active Measurement Protocol (STAMP)) and is applicable to  
      end-to-end SR Paths including 
      SR Policies for both SR-MPLS and SRv6 data planes.</t>
    </section>

    <section anchor="sect-2" title="Conventions Used in This Document">
      <section anchor="sect-2.1" title="Requirements Language">
        <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"/> <xref target="RFC8174"/> when, and only when, they
        appear in all capitals, as shown here.</t>
      </section>

      <section anchor="sect-2.2" title="Abbreviations">
        <t>BFD: Bidirectional Forwarding Detection.</t>

        <t>BSID: Binding Segment ID.</t>

        <t>DM: Delay Measurement.</t>

        <t>ECMP: Equal Cost Multi-Path.</t>

        <t>LM: Loss Measurement.</t>

        <t>MPLS: Multiprotocol Label Switching.</t>

        <t>OWAMP: One-Way Active Measurement Protocol.</t>

        <t>PDLM: Performance Delay and Liveness Monitoring.</t>

        <t>PM: Performance Measurement.</t>

        <t>PTP: Precision Time Protocol.</t>

        <t>SID: Segment ID.</t>

        <t>SL: Segment List.</t>

        <t>SR: Segment Routing.</t>

        <t>SRH: Segment Routing Header.</t>

        <t>SR-MPLS: Segment Routing with MPLS data plane.</t>

        <t>SRv6: Segment Routing with IPv6 data plane.</t>

	<t>STAMP: Simple Two-way Active Measurement Protocol.</t>

        <t>TWAMP: Two-Way Active Measurement Protocol.</t>
      </section>

    <section title="Reference Topology" anchor="sect-2.3"><t>
    In the reference topology shown in Figure 1, the nodes R1 and R5 are connected via 
    Point-to-Point (P2P) SR Path such as SR Policy
    <xref target="I-D.ietf-spring-segment-routing-policy"/> 
    originating on node R1 with endpoint on node R5.</t>

      <figure anchor="ure-reference-topology" title="Reference Topology">
        <artwork>
                         t1
                        /
               +-------+      Probe          +-------+
               |       | - - - - - - - - - - |       |
               |   R1  |====================||  R5   |
               |       |&lt;- - - - - - - - - - |       |
               +-------+      Return Probe   +-------+
                        \
                         t4
                Sender                       Reflector
                                             (Simply Forward)
       </artwork>
      </figure>
      </section>
    </section>
 
  <section anchor="sect-3" title="Overview">
    <section title="Loopback Mode" anchor="sect-3.1"><t>
    In loopback mode, the sender node R1 initiates probe messages and the reflector node R5
    forwards them just like data packets for the normal traffic back to the sender node R1. 
    The probe messages are not punted at the reflector node
    and it does not process them and generate response messages.
    The reflector node must not drop the loopback probe messages, 
    for example, due to a local policy provisioned on the node. 
    No PM session is created on the reflector node.</t>

    <t>The Source and Destination IP addresses in the probe messages are set to the reflector 
    and the sender node addresses, respectively (representing the reverse path).
    Both Source and Destination UDP ports in the probe messages are allocated dynamically or user-configured  
    from the range specified in <xref target="RFC8762"/>.  
    The UDP ports used in loopback mode are different than the ports
    used for TWAMP and STAMP sessions.
    The IPv4 Time To Live (TTL) and IPv6 Hop Limit (HL) are set to 255.</t>

     </section>

      <section anchor="sect-3.2"
               title="Loopback Mode Enabled with Network Programming Function"
               toc="default">
      <t>In "loopback mode enabled with network programming function",
      both transmit (t1) and receive (t2) timestamps in data plane are collected
      by the probe messages sent in loopback mode as shown in Figure 2.
      The network programming function optimizes the "operations of punt 
      and inject the probe packet" on the reflector 
      node as timestamping is implemented in hardware. This helps to achieve higher scale
      and faster rate, resulting in faster failure detection.</t>

      <figure align="center"
              anchor="ure-loopback-mode-enabled-with-network-programming"
              title="Loopback Mode Enabled with Network Programming Function">
       <artwork>
                         t1                t2
                        /                   \
               +-------+      Probe          +-------+
               |       | - - - - - - - - - - |       |
               |   R1  |====================||  R5   |
               |       |&lt;- - - - - - - - - - |       |
               +-------+      Return Probe   +-------+
                Sender                       Reflector
                                             (Timestamp, 
                                              Pop and Forward)
      </artwork>
      </figure>
   
      <t>The sender node adds transmit (t1)
      timestamp in the payload of the probe message and clears the receive (t2) timestamp. 
      The reflector node adds the receive timestamp in the 
      payload of the received probe 
      message in hardware without punting the message to slow-path (or control-plane). The reflector node only
      adds the receive timestamp if the source or destination address in the probe message matches
      the local node address to ensure that the probe message reaches the 
      intended reflector node and the receive timestamp is returned by the that node.
      The payload of the probe message is not modified by any intermediate nodes.</t>

      <t>The network programming function enables the node to add receive timestamp
      in the payload of the probe message at a specific offset which is locally
      provisioned consistently in the network. 
      In the probe message defined in Figure 4 for  
      delay measurement, the 64-bit receive timestamp is added at byte-offset 16 which is 
      from the start of the payload.</t>

      </section>

    <section title="Example Provisioning Model" anchor="sect-3.3"><t>
    An example provisioning model and typical measurement parameters are shown in Figure 3:</t>
 
    <figure title="Example Provisioning Model" anchor="ure-example-provisioning-model"><artwork><![CDATA[

                            +------------+
                            | Controller |
                            +------------+
  PDLM Mode                     /    \      Timestamp Label/SRV6 EP
    LB or Enhanced Mode        /      \       Timestamp2 Offset
  Message Format              /        \      Timestamp Format
  Missed Probe Message Count /          \
  Timestamp Label/SRv6 EP   /            \
    Timestamp Format       /              \
  Delay Threshold/Count   /                \
  Source/Dest UDP Ports  /                  \
                        v                    v
                    +-------+            +-------+
                    |       |            |       |
                    |   R1  |============|   R5  |
                    |       |  SR Path   |       |
                    +-------+            +-------+
                     Sender              Reflector
]]></artwork>
    </figure>

    <t>Example of message format is TWAMP and STAMP, example of  
    Timestamp Format is 64-bit PTPv2 <xref target="IEEE1588"/> and NTP, etc.</t>
    
    <t>The mechanisms to provision the
    sender and reflector nodes are outside the scope of this document.</t>

     </section>
    </section>

    <section title="Probe Message Formats" anchor="sect-4"><t>
    The probe messages compatible with the delay measurement message formats defined in 
    TWAMP <xref target="RFC5357"/> and STAMP <xref target="RFC8762"/> 
    are specified in Figure 4.
    </t>

   <figure title="Probe Packet Formats" anchor="ure-probe-packet-format"><artwork><![CDATA[

  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |                     Sequence Number                           |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |                     Transmit Timestamp (t1)                   |
  |                                                               |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |  Transmit Error Estimate      |  MBZ                          |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |                     Receive Timestamp (t2)                    |
  |                                                               |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |  Receive Error Estimate       |  MBZ                          |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  .                     Variable Length Padding                   .
  ~                                                               ~
  .                                                               .
  .                                                               .
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 
   
                TWAMP Compatible Probe Packet Format


  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |                     Sequence Number                           |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |                     Transmit Timestamp (t1)                   |
  |                                                               |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |  Transmit Error Estimate      |  SSID                         |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |                     Receive Timestamp (t2)                    |
  |                                                               |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |  Receive Error Estimate       |  MBZ                          |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |                     Fixed Length Padding                      |
  |                                                               |
  |                                                               |
  |                                                               |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 
 
                STAMP Compatible Probe Packet Format
]]></artwork>
    </figure>


   <t>Sequence Number is the sequence number of the probe packet according
   to its transmit order.  It starts with zero and is incremented by one
   for each subsequent packet.</t>

   <t>Transmit Timestamp and Transmit Error Estimate are the Sender's transmit
   timestamp and error estimate for the probe packet,
   respectively.  Similarly, Receive Timestamp and Receive Error Estimate are 
   the Reflector's receive timestamp and error estimate, respectively. 
   The timestamp and error estimate fields
   follow the definition and formats defined in Section 4.1.2 in
   [RFC4656].  Timestamp format preferred is 64-bit PTPv2 <xref target="IEEE1588"/> as
   specified in <xref target="RFC8186"/>, implemented in hardware.</t> 

    </section>


    <section anchor="sect-5" title="Performance Delay and Liveness Monitoring">
     <t>For performance delay and liveness monitoring of an end-to-end SR Path including SR Policy, 
     PM probes in loopback mode is used.  
     </t>
 
     <t>For SR Policy, the probe messages are sent using the Segment List (SL) of the Candidate-path 
     <xref target="I-D.ietf-spring-segment-routing-policy"/>.
     When a Candidate-path has more than one Segment Lists, multiple
     probe messages are sent, one using each Segment List. The return probe messages are received by
     the sender node via IP/UDP <xref target="RFC0768"/> return path by default. 
     The Segment List of the return SR path can be added in the probe message header
     to receive the return probe message on a specific path using the Binding SID 
     <xref target="I-D.ietf-pce-binding-label-sid"/> or Segment List of the Reverse SR Policy <xref
     target="I-D.ietf-pce-sr-bidir-path"/>.</t>

    <section anchor="sect-5.1" title="Probe Message for SR-MPLS">
     <t>The probe messages are 
     sent using the MPLS header containing the label stack of the SR
     Policy as shown in Figure 5. In case of IP/UDP
     return path, the MPLS header is removed by the reflector node.
     The label stack can contain a reverse SR-MPLS 
     path to receive the return probe message on a specific path. 
     In this case, the MPLS header will not be removed
     by the reflector node.</t>

        <figure anchor="ure-probe-message-header-for-sr-mpls"
                title="Example Probe Message for SR-MPLS">
          <artwork>  0                   1                   2                   3
  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |            Label(1)                   | TC  |S|      TTL      |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  .                                                               .
  .                                                               .
  .                                                               .
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |            Label(n)                   | TC  |S|      TTL      |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  | IP Header                                                     |
  .  Source IP Address = Reflector IPv4 or IPv6 Address           .
  .  Destination IP Address = Sender IPv4 or IPv6 Address         .
  .  Protocol = UDP                                               .
  .                                                               .
  +---------------------------------------------------------------+
  | UDP Header                                                    |
  .  Source Port = As chosen by Sender                            .
  .  Destination Port = As chosen by Sender                       .
  .                                                               .
  +---------------------------------------------------------------+
  |  Payload as defined in Figure 4                               |
  .                                                               .
  +---------------------------------------------------------------+</artwork>
        </figure>
      </section>

   <section anchor="sect-5.2" title="Probe Message for SRv6">
    <t>The probe messages for SRv6 data plane are sent using the 
    Segment Routing Header (SRH) <xref target="RFC8754"/> containing 
    the Segment List of the SR Policy as shown in Figure 6. In case of IP/UDP
    return path, the SRH is removed by the reflector node.
    The Segment List can contain a reverse SRv6 path to receive 
    the return probe message on a specific path. In this case, the 
    SRH will not be removed by the reflector node.
    When the return probe message contains an SRH at the sender node,
    the procedure defined for upper-layer header processing for SRv6 SIDs
    in [I-D.ietf-spring-srv6-network-programming] is used to process the
    UDP header in the received probe messages.</t>

        <figure anchor="ure-probe-message-header-for-srv6"
                title="Example Probe Message for SRv6">
          <artwork>  
  +---------------------------------------------------------------+
  | IP Header                                                     |
  .  Source IP Address = Sender IPv6 Address                      .
  .  Destination IP Address = Destination IPv6 Address            .
  .                                                               .
  +---------------------------------------------------------------+
  | SRH as specified in RFC 8754                                  |
  .     &lt;Segment List&gt;                                            .
  .                                                               .
  +---------------------------------------------------------------+
  | IP Header                                                     |
  .  Source IP Address = Reflector IPv6 Address                   .
  .  Destination IP Address = Sender IPv6 Address                 .
  .                                                               .
  +---------------------------------------------------------------+
  | UDP Header                                                    |
  .  Source Port = As chosen by Sender                            .
  .  Destination Port = As chosen by Sender                       .
  .                                                               .
  +---------------------------------------------------------------+
  |  Payload as defined in Figure 4                               |
  .                                                               .
  +---------------------------------------------------------------+</artwork>
        </figure>
      </section>
    </section>

    <section anchor="sect-6"
             title="Enhanced Performance Delay and Liveness Monitoring">
      <t>The enhanced performance delay and liveness monitoring of an end-to-end SR Path including SR Policy is
      defined using the PM probes in "loopback mode enabled with network programming function".</t>


      <section anchor="sect-6.1"
               title="Probe Message with Timestamp Label for SR-MPLS"
               toc="default">
      <t>In this document, new Timestamp Label 
      (Extended Special-Purpose value TBD1) is defined for SR-MPLS data plane to enable network programming
      function for "timestamp, pop and forward" the received packet.</t>

      <t>In the probe message for SR-MPLS,
      Timestamp Label is added in the MPLS header as shown in Figure 7, to
      collect "Receive Timestamp" field in the payload of the probe message. 
      The label stack for the reverse SR-MPLS path can be added after the Timestamp 
      Label to receive the return probe message on a specific path.
      When a node receives a message with
      Timestamp Label, after timestamping the packet at a specific offset, 
      the node pops the Timestamp Label and forwards the
      message using the next label or IP header in the message (just like the 
      data packets for the normal traffic).</t>

        <figure anchor="ure-probe-message-header-for-sr-mpls-with-timestamp-label"
                title="Example Probe Message with Timestamp Label for SR-MPLS">
          <artwork>
  0                   1                   2                   3
  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |            Label(1)                   | TC  |S|      TTL      |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  .                                                               .
  .                                                               .
  .                                                               .
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |            Label(n)                   | TC  |S|      TTL      |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |            Extension Label (15)       | TC  |S|      TTL      |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |            Timestamp Label (TBA1)     | TC  |S|      TTL      |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  | IP Header                                                     |
  .  Source IP Address = Reflector IPv4 or IPv6 Address           .
  .  Destination IP Address = Sender IPv4 or IPv6 Address         .
  .  Protocol = UDP                                               .
  .                                                               .
  +---------------------------------------------------------------+
  | UDP Header                                                    |
  .  Source Port = As chosen by Sender                            .
  .  Destination Port = As chosen by Sender                       .
  .                                                               .
  +---------------------------------------------------------------+
  |  Payload as defined in Figure 4                               |
  .                                                               .
  +---------------------------------------------------------------+</artwork>
        </figure>


	<section title="Timestamp Label Allocation" anchor="sect-6.1.1" toc="default"><t>
      Timestamp Label can be allocated using one of the following
      methods:</t>

	<t><list style="symbols"><t>Label (value TBA1) assigned by IANA from the "Extended
      Special-Purpose MPLS Values" <xref target="I-D.ietf-mpls-spl-terminology"/>. 
      The timestamp offset is fixed at byte-offset 16 from the start of the payload and timestamp format is 64-bit PTPv2 for this label.</t>

	<t>Label allocated by a Controller from the global table of the
      egress node.  The Controller provisions the label on both
      ingress and egress nodes, as well as timestamp offset and timestamp format.</t>

	<t>Label allocated by the egress node. The signaling and IGP flooding
      extension for the label (including timestamp offset and timestamp format) 
      are outside the scope of this document.</t>

	</list>
	</t>

	</section>

      <section anchor="sect-6.1.2"
               title="Node Capability for Timestamp Label"
	       toc="default">
      <t>The ingress node needs 
      to know if the egress node can process the Timestamp Label to avoid dropping probe packets. 
      The signaling extension 
      for this capability exchange is outside the scope of this document.</t>

      </section>


      </section>

      <section anchor="sect-6.2"
               title="Probe Message with Timestamp Endpoint Function for SRv6">
      <t>In this document, Timestamp Endpoint function for "Timestamp and Forward
      (TSF)" (SRv6 Endpoint Behaviour value TBD2) is defined for Segment Routing Header (SRH) <xref
      target="RFC8754"/> for SRv6 data plane to enable
      network programming function to "timestamp and forward" the received
      packet.</t>

      <t>In the probe message for SRv6,
      End.TSF function is added for the target Segment Identifier (SID) in SRH 
      <xref target="RFC8754"/> as shown in Figure 8,
      to collect "Receive Timestamp" field in the payload of the probe message. 
      The Segment List for the reverse path can be added after the target SID 
      to receive the return probe message on a specific path.
      When a reflector node receives a message with
      End.TSF function for the target SID which is local, 
      after timestamping the packet at a specific offset,
      the node forwards the packet using the next SID or IP header in the message 
      (just like the data packets for the normal traffic).</t>

        <figure anchor="ure-probe-message-header-for-srv6-with-endpoint-function"
                title="Example Probe Message with Endpoint Function for SRv6">
          <artwork>
  +---------------------------------------------------------------+
  | IP Header                                                     |
  .  Source IP Address = Sender IPv6 Address                      .
  .  Destination IP Address = Destination IPv6 Address            .
  .                                                               .
  +---------------------------------------------------------------+
  | SRH as specified in RFC 8754                                  |
  .     &lt;Segment List&gt;                                            .
  .     SRv6 Endpoint End.TSF (value TBA2)                        .
  .                                                               .
  +---------------------------------------------------------------+
  | IP Header                                                     |
  .  Source IP Address = Reflector IPv6 Address                   .
  .  Destination IP Address = Sender IPv6 Address                 .
  .                                                               .
  +---------------------------------------------------------------+
  | UDP Header                                                    |
  .  Source Port = As chosen by Sender                            .
  .  Destination Port = As chosen by Sender                       .
  .                                                               .
  +---------------------------------------------------------------+
  |  Payload as defined in Figure 4                               |
  .                                                               .
  +---------------------------------------------------------------+</artwork>
        </figure>


	<section title="Timestamp Endpoint Function Assignment" anchor="sect-6.2.1" toc="default"><t>
      Timestamp endpoint function for "Timestamp and Forward" can be signaled using one of the following methods:</t>

	<t><list style="symbols"><t>Timestamp endpoint function (value TBA2) assigned by IANA from the "SRv6 Endpoint Behaviors Registry".
      The timestamp offset is fixed at byte-offset 16 from the start of the payload and timestamp format is 64-bit PTPv2 for this endpoint function.</t>

	<t>Timestamp endpoint function assigned by a Controller.  The Controller provisions the value on both
      ingress and egress nodes, as well as timestamp offset and timestamp format.</t>

	<t>Timestamp endpoint function assigned by the egress node. The signaling and IGP flooding
      extension for the endpoint function (including timestamp offset and timestamp format) 
      are outside the scope of this document.</t>

	</list>
	</t>
      </section>

      <section anchor="sect-6.2.2"
               title="Node Capability for Timestamp Endpoint Function"
	       toc="default">
      <t>The ingress node needs 
      to know if the egress node can process the Timestamp Endpoint Function to enable the monitoring. 
      The signaling extension 
      for this capability exchange is outside the scope of this document.</t>
      </section>

    </section>
   </section>

   <section anchor="sect-7" title="ECMP Handling" toc="default">
     <t>An SR Policy can have ECMPs between the source and transit nodes,
      between transit nodes and between transit and destination nodes. 
      The PM probe messages need to be sent to traverse different ECMP 
      paths to monitor the liveness for an end-to-end SR Policy.</t>

      <t>Forwarding plane has various hashing functions available to forward
      packets on specific ECMP paths. In IPv4 header of the PM probe messages,
      sweeping of Destination Address in 127/8 range can be used to exercise different 
      ECMP paths in the loopback mode as long as the return path is also SR-MPLS.
      The Flow Label field in the outer IPv6 header can also be used for sweeping 
      to exercise different ECMP paths.</t>
   </section>
 
   <section anchor="sect-8" title="Failure Notification" toc="default">
     <t>Liveness success for SR Path is initially notified as soon as one or more 
      return probe messages are received at the sender node.</t>

      <t>Liveness failure for SR Path is notified when consecutive N number of return probe
      messages are not received at the sender node, where N (Missed Probe Message Count) is locally
      provisioned value. Similarly, delay metrics are notified as an example when consecutive 
      M number of probe messages have measured delay values exceed user-configured 
      thresholds (absolute and percentage), where M is also locally provisioned value.</t>

      <t>For the probe messages generated by the Sender node R1 in the 
      loopback mode, a failure on the reverse direction path can also cause 
      the return probe messages to not reach the Sender node.
      This is also true in case of the probe response messages generated by the Reflector node R5 
      e.g. to indicate node R1 of any failure on the forward direction path. As such, the probe-based methods 
      have this limitation for the liveness monitoring of the forward direction path.</t> 

      <t>In loopback mode, the timestamps t1 and t4 are used to measure round-trip delay.
      In loopback mode enabled with network programming function, the timestamps t1 and t2 are used
      to measure one-way delay.</t>

   </section>


   <section anchor="sect-9" title="Security Considerations" toc="default">
      <t>The Performance Delay and Liveness Monitoring is intended for deployment in
      the well-managed private and service provider networks. As such, it assumes
      that a node involved in a monitoring operation has previously verified
      the integrity of the path and the identity of the reflector
      node. If desired, attacks can be mitigated by performing basic
      validation and sanity checks, at the sender, of the timestamp
      fields in received probe  messages. The minimal state
      associated with these protocols also limits the extent of disruption
      that can be caused by a corrupt or invalid message to a single
      probe cycle. Cryptographic
      measures may be used by the correct configuration of access-control
      lists and firewalls.</t>
   </section>

   <section anchor="sect-10" title="IANA Considerations" toc="default">
      <t>IANA maintains the "Special-Purpose Multiprotocol Label Switching
      (MPLS) Label Values" registry (see
      &lt;https://www.iana.org/assignments/mpls-label-values/mpls-label-values.xml&gt;).
      IANA is requested to allocate Timestamp Label value from the "Extended
      Special-Purpose MPLS Label Values" registry:</t>

      <figure>
        <artwork>
  +-------------+---------------------------------+---------------+
  | Value       | Description                     | Reference     |
  +-------------+---------------------------------+---------------+
  | TBA1        | Timestamp Label                 | This document |
  +-------------+---------------------------------+---------------+
      </artwork>
      </figure>

      <t>IANA is requested to allocate, within the "SRv6 Endpoint Behaviors
      Registry" sub-registry belonging to the top-level "Segment Routing 
      Parameters" registry <xref
      target="I-D.ietf-spring-srv6-network-programming"/>, the following
      allocation:</t>

      <figure>
        <artwork>     
  +-------------+---------------------------------+---------------+
  | Value       | Endpoint Behavior               | Reference     |
  +-------------+---------------------------------+---------------+
  | TBA2        | End.TSF (Timestamp and Forward) | This document |
  +-------------+---------------------------------+---------------+</artwork>
      </figure>
   </section>
  </middle>

  <back>
    <references title="Normative References">
      &RFC0768;
      &RFC2119;
      &RFC4656;
      &RFC5357;
      &RFC8174;
      &RFC8762;
    </references>

    <references title="Informative References">
      <reference anchor="IEEE1588">
        <front>
          <title>1588-2008 IEEE Standard for a Precision Clock Synchronization
          Protocol for Networked Measurement and Control Systems</title>

          <author>
            <organization>IEEE</organization>
          </author>

          <date month="March" year="2008"/>
        </front>
      </reference>

      &RFC7880;
      &RFC8186;
      &RFC8402;
      &RFC8754;
      &I-D.gandhi-spring-twamp-srpm;
      &I-D.gandhi-spring-stamp-srpm;
      &I-D.ietf-spring-segment-routing-policy;
      &I-D.ietf-spring-srv6-network-programming;
      &I-D.ietf-mpls-spl-terminology;
      &I-D.ietf-pce-binding-label-sid;
      &I-D.ietf-pce-sr-bidir-path;
    </references>


   <section title="Acknowledgments" numbered="no" anchor="acknowledgments"><t>
   The authors would like to thank Greg Mirsky, Mach Chen, Kireeti Kompella, and Adrian Farrel for providing
   the review comments.</t>
	</section>

  </back>
</rfc>
