<?xml version="1.0" encoding="US-ASCII"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
<?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 category="std" docName="draft-ietf-mpls-self-ping-06" ipr="trust200902">
  <front>
    <title abbrev="LSP Self-Ping">LSP Self-Ping</title>

    <author fullname="Ron Bonica" initials="R." surname="Bonica">
      <organization>Juniper Networks</organization>

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

        <email>rbonica@juniper.net</email>
      </address>
    </author>

    <author fullname="Ina Minei" initials="I. " surname="Minei">
      <organization>Google, Inc.</organization>

      <address>
        <postal>
          <street>1600 Amphitheatre Parkway</street>

          <city>Mountain View</city>

          <region>CA</region>

          <code>94043</code>

          <country>U.S.A.</country>
        </postal>

        <email>inaminei@google.com</email>
      </address>
    </author>

    <author fullname="Michael Conn" initials="M. " surname="Conn">
      <organization>Verizon</organization>

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

        <email>michael.e.conn@verizon.com</email>
      </address>
    </author>

    <author fullname="Dante Pacella" initials="D." surname="Pacella">
      <organization>Verizon</organization>

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

        <email>dante.j.pacella@verizon.com</email>
      </address>
    </author>

    <author fullname="Luis Tomotaki" initials="L." surname="Tomotaki">
      <organization>Verizon</organization>

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

        <email>luis.tomotaki@verizon.com</email>
      </address>
    </author>

    <date day="1" month="November" year="2015"/>

    <area>Routing Area</area>

    <workgroup>MPLS Working Group</workgroup>

    <keyword>MPLS</keyword>

    <keyword>RSVP-TE</keyword>

    <keyword>diagnostic</keyword>

    <abstract>
      <t>When certain RSVP-TE optimizations are implemented, ingress LSRs can
      receive RSVP RESV messages before forwarding state has been installed on
      all downstream nodes. According to the RSVP-TE specification, the
      ingress LSR can forward traffic through an LSP as soon as it receives a
      RESV message. However, if the ingress LSR forwards traffic through the
      LSP before forwarding state has been installed on all downstream nodes,
      traffic can be lost.</t>

      <t>This document describes LSP Self-ping. When an ingress LSR receives
      an RESV message, it can invoke LSP Self-ping procedures to ensure that
      forwarding state has been installed on all downstream nodes.</t>

      <t>LSP Self-ping is a new protocol. It is not an extension of LSP Ping.
      Although LSP Ping and LSP Self-ping are named similarly, each is
      designed for a unique purpose. Each protocol listens on its own UDP port
      and executes its own procedures.</t>

      <t>LSP Self-ping is an extremely light-weight mechanism. It does not
      consume control plane resources on transit or egress LSRs.</t>
    </abstract>

    <note 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"/>.</t>
    </note>
  </front>

  <middle>
    <section title="Introduction">
      <t>Ingress Label Switching Routers (LSR) use <xref
      target="RFC3209">RSVP-TE</xref> to establish MPLS Label Switched Paths.
      The following paragraphs describe RSVP-TE procedures.</t>

      <t>The ingress LSR calculates a path between itself and an egress LSR.
      The calculated path can be either strictly or loosely routed. Having
      calculated a path, the ingress LSR constructs an RSVP PATH message. The
      PATH message includes an Explicit Route Object (ERO) that represents the
      path between the ingress and egress LSRs.</t>

      <t>The ingress LSR forwards the PATH message towards the egress LSR,
      following the path defined by the ERO. Each transit LSR that receives
      the PATH message executes admission control procedures. If the transit
      LSR admits the LSP, it sends the PATH message downstream, to the next
      node in the ERO.</t>

      <t>When the egress LSR receives the PATH message, it binds a label to
      the LSP. The label can be implicit null, explicit null, or non-null. The
      egress LSR then installs forwarding state (if necessary), and constructs
      an RSVP RESV message. The RESV message contains a Label Object that
      includes the label that has been bound to the LSP.</t>

      <t>The egress LSR sends the RESV message upstream towards the ingress
      LSR. The RESV message visits the same transit LSRs that the PATH message
      visited, in reverse order. Each transit LSR binds a label to the LSP,
      updates its forwarding state and updates the RESV message. As a result,
      the Label Object in the RESV message contains the label that has been
      bound to the LSP most recently. Finally, the transit LSR sends the RESV
      message upstream, along the reverse path of the LSP.</t>

      <t>When the ingress LSR receives the RESV message, it installs
      forwarding state. Once the ingress LSR installs forwarding state it can
      forward traffic through the LSP.</t>

      <t>Referring to any LSR, RFC 3209 says, "&ldquo;The node SHOULD be
      prepared to forward packets carrying the assigned label prior to sending
      the RESV message&rdquo;. However, RFC 3209 does not strictly require
      this behavior.</t>

      <t>Some implementations optimize the above-described procedure by
      allowing LSRs to send RESV messages before installing forwarding state
      <xref target="RFC6383"/>. This optimization is desirable, because it
      allows LSRs to install forwarding state in parallel, thus accelerating
      the process of LSP signaling and setup. However, this optimization
      creates a race condition. When the ingress LSR receives a RESV message,
      some downstream LSRs may have not yet installed forwarding state. If the
      ingress LSR forwards traffic through the LSP before forwarding state has
      been installed on all downstream nodes, traffic can be lost.</t>

      <t>This document describes LSP Self-ping. When an ingress LSR receives
      an RESV message, it can invoke LSP Self-ping procedures to verify that
      forwarding state has been installed on all downstream nodes. By
      verifying the installation of downstream forwarding state, the ingress
      LSR eliminates this particular cause of traffic loss.</t>

      <t>LSP Self-ping is a new protocol. It is not an extension of <xref
      target="RFC4379">LSP Ping</xref>. Although LSP Ping and LSP Self-ping
      are named similarly, each is designed for a unique purpose. Each
      protocol listens on its own UDP port and executes its own
      procedures.</t>

      <t>LSP Self-ping is an extremely light-weight mechanism. It does not
      consume control plane resources on transit or egress LSRs.</t>
    </section>

    <section title="Applicability">
      <t>LSP Self-ping is applicable in the following scenario:</t>

      <t><list style="symbols">
          <t>The ingress LSR signals a point-to-point LSP</t>

          <t>The ingress LSR receives a RESV message</t>

          <t>The RESV message indicates that all downstream nodes have begun
          the process of forwarding state installation</t>

          <t>The RESV message does not guarantee that all downstream nodes
          have completed the process of forwarding state installation</t>

          <t>The ingress LSR needs to confirm that all downstream nodes have
          completed the process for forwarding state installation</t>

          <t>The ingress LSR does not need to confirm the correctness of
          downstream forwarding state, because there is a very high likelihood
          that downstream forwarding state is correct</t>

          <t>Control plane resources on the egress LSR may be scarce</t>

          <t>The need to conserve control plane resources on the egress LSR
          outweighs the need to determine whether downstream forwarding state
          is correct</t>
        </list>Unlike LSP Ping and <xref
      target="I-D.akiya-bfd-seamless-base">S-BFD</xref>, LSP Self-ping is not
      a general purpose MPLS OAM mechanism. It cannot reliably determine
      whether downstream forwarding state is correct. For example, if a
      downstream LSR installs a forwarding state that causes an LSP to
      terminate at the wrong node, LSP Self-ping will not detect an error. In
      another example, if a downstream LSR erroneously forwards a packet
      without an MPLS label, LSP Self-ping will not detect an error.</t>

      <t>Furthermore, LSP Self-ping fails when either of the following
      conditions are true:</t>

      <t><list style="symbols">
          <t>The LSP under test is signaled by the <xref
          target="RFC5036">Label Distribution Protocol (LDP) Independent Mode
          </xref></t>

          <t><xref target="RFC3704">Reverse Path Forwarding (RPF)</xref>
          filters are enabled on links that connect the ingress LSR to the
          egress LSR</t>
        </list></t>

      <t>While LSP Ping and S-BFD are general purpose OAM mechanisms, they are
      not applicable in the above described scenario because:</t>

      <t><list style="symbols">
          <t>LSP Ping consumes control plane resources on the egress LSR</t>

          <t>An S-BFD implementation either consumes control plane resources
          on the egress LSR or requires special support for S-BFD on the
          forwarding plane.</t>
        </list></t>

      <t>By contrast, LSP Self-ping requires nothing from the egress LSR
      beyond the ability to forward an IP datagram.</t>

      <t>LSP Self-ping's purpose is to determine whether forwarding state has
      been installed on all downstream LSRs. Its primary constraint is to
      minimize its impact on egress LSR performance. This functionality is
      valuable during network convergence events that impact a large number of
      LSPs.</t>

      <t>Therefore, LSP Self-ping is applicable in the scenario described
      above, where the LSP is signaled by RSVP, RPF is not enabled, and the
      need to conserve control plane resources on the egress LSR outweighs the
      need to determine whether downstream forwarding state is correct.</t>
    </section>

    <section title="The LSP Self-ping Message">
      <t>The LSP Self-ping Message is a <xref target="RFC0768">User Datagram
      Protocol (UDP)</xref> packet that encapsulates a session ID. If the RSVP
      messages used to establish the LSP under test were delivered over <xref
      target="RFC0791">IPv4</xref>, the UDP datagram MUST be encapsulated in
      an IPv4 header. If the RSVP messages used to establish the LSP were
      delivered over <xref target="RFC2460">IPv6</xref>, the UDP datagram MUST
      be encapsulated in an IPv6 header.</t>

      <t>In either case:</t>

      <t><list style="symbols">
          <t>The IP Source Address MAY be configurable. By default, it MUST be
          the address of the egress LSR</t>

          <t>The IP Destination Address MUST be the address of the ingress
          LSR</t>

          <t>The IP Time to Live (TTL) / Hop Count MAY be configurable. By
          default, it MUST be 255</t>

          <t>The IP DSCP MAY be configurable. By default, it MUST be <xref
          target="RFC4594">CS6 (Ox48)</xref></t>

          <t>The UDP Source Port MUST be selected from the <xref
          target="RFC6335">dynamic range (49152-65535)</xref></t>

          <t>The UDP Destination Port MUST be <xref
          target="IANA.PORTS">lsp-self-ping (8503)</xref></t>
        </list>UDP packet contents have the following format:</t>

      <t><figure align="center" title="LSP Self-ping Message">
          <artwork name="LSP Self-ping Message"><![CDATA[       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
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |                        Session-ID                             |
      |                        (64 bits)                              |  
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

]]></artwork>
        </figure></t>

      <t>The Session-ID is a 64-bit field that associates an LSP Self-ping
      message with an LSP Self-ping session.</t>
    </section>

    <section anchor="proc" title="LSP Self Ping Procedures">
      <t>In order to verify that an LSP is ready to carry traffic, the ingress
      LSR creates a short-lived LSP Self-ping session. All session state is
      maintained locally on the ingress LSR. Session state includes the
      following information:</t>

      <t><list style="symbols">
          <t>Session-ID: A 64-bit number that identifies the LSP Self-ping
          session</t>

          <t>Retry Counter: The maximum number of times that the ingress LSR
          probes the LSP before terminating the LSP Self-ping session. The
          initial value of this variable is determined by configuration.</t>

          <t>Retry Timer: The number of milliseconds that the LSR waits after
          probing the LSP. The initial value of this variable is determined by
          configuration.</t>

          <t>Status: A boolean variable indicating the completion status of
          the LSP Self-ping session. The initial value of this variable is
          FALSE.</t>
        </list></t>

      <t>Implementations MAY represent the above mentioned information in any
      format that is convenient to them.</t>

      <t>The ingress LSR executes the following procedure until Status equals
      TRUE or Retry Counter equals zero:</t>

      <t><list style="symbols">
          <t>Format a LSP Self-ping message.</t>

          <t>Set the Session-ID in the LSP Self-ping message to the Session-ID
          mentioned above</t>

          <t>Send the LSP Self-ping message through the LSP under test</t>

          <t>Set a timer to expire in Retry Timer milliseconds</t>

          <t>Wait until either an LSP Self-ping message associated with the
          session returns or the timer expires. If an LSP Self-ping message
          associated with the session returns, set Status to TRUE. Otherwise,
          decrement the Retry Counter. Optionally, increase the value of Retry
          Timer according to an appropriate back off algorithm.</t>
        </list></t>

      <t>In the process described above, the ingress LSR addresses an LSP
      Self-ping message to itself and forwards that message through the LSP
      under test. If forwarding state has been installed on all downstream
      LSRs, the egress LSR receives the LSP Self-ping message and determines
      that it is addressed to the ingress LSR. So, the egress LSR forwards LSP
      Self-ping message back to the ingress LSR, exactly as it would forward
      any other IP packet.</t>

      <t>The LSP Self-ping message can arrive at the egress LSR with or
      without an MPLS header, depending on whether the LSP under test executes
      penultimate hop-popping procedures. If the LSP Self-ping message arrives
      at the egress LSR with an MPLS header, the egress LSR removes that
      header.</t>

      <t>If the egress LSR's most preferred route to the ingress LSR is
      through an LSP, the egress LSR forwards the LSP Self-ping message
      through that LSP. However, if the egress LSR's most preferred route to
      the ingress LSR is not through an LSP, the egress LSR forwards the LSP
      Self-ping message without MPLS encapsulation.</t>

      <t>When an LSP Self-ping session terminates, it returns its completion
      status to the invoking protocol. For example, if RSVP-TE invokes LSP
      Self-ping as part of the LSP set-up procedure, LSP Self-ping returns its
      completion status to RSVP-TE.</t>
    </section>

    <section title="Bidirectional LSP Procedures">
      <t>A bidirectional LSP has an active side and a passive side. The active
      side calculates the ERO and signals the LSP in the forward direction.
      The passive side reverses the ERO and signals the LSP in the reverse
      direction.</t>

      <t>When LSP Self-ping is applied to a bidirectional LSP:</t>

      <t><list style="symbols">
          <t>The active side calculates ERO, signals LSP and runs LSP
          Self-ping</t>

          <t>The Passive side reverses ERO, signals LSP and runs another
          instance of LSP Self-ping</t>

          <t>Neither side forwards traffic through the LSP until local LSP
          Self-ping returns TRUE</t>
        </list>The two LSP Self-ping sessions, mentioned above, are
      independent of one another. They are not required to have the same
      Session-ID. Each endpoint can forward traffic through the LSP as soon as
      the its local LSP Self-ping returns TRUE. Endpoints are not required to
      wait until both LSP Self-ping sessions have returned TRUE.</t>
    </section>

    <section anchor="IANA" title="IANA Considerations">
      <t>IANA has assigned <xref target="IANA.PORTS">UDP Port Number
      8503</xref> for use by LSP Self-ping.</t>
    </section>

    <section anchor="Security" title="Security Considerations">
      <t>LSP Self-ping messages are easily forged. Therefore, an attacker can
      send the ingress LSR a forged LSP Self-ping message, causing the ingress
      LSR to terminate the LSP Self-ping session prematurely. In order to
      mitigate these threats, operators SHOULD filter LSP Self-ping packets at
      the edges of the MPLS signaling domain. Furthermore, implementations
      SHOULD NOT assign Session-ID's in a predictable manner. In order to
      avoid predictablity, imlementations can leverage a <xref
      target="NIST-CSPRNG">Cryptographically Secure Pseudo-randomn Number
      Generator (CSPRNG)</xref></t>
    </section>

    <section title="Contributors">
      <t>The following individuals contributed significantly to this
      document:</t>

      <t><list style="empty">
          <t>Mark Wygant</t>

          <t>Verizon</t>

          <t>mark.wygant@verizon.com</t>

          <t/>

          <t>Ravi Torvi</t>

          <t>Juniper Networks</t>

          <t>rtorvi@juniper.net</t>
        </list></t>
    </section>

    <section anchor="Acknowledgements" title="Acknowledgements">
      <t>Thanks to Yakov Rekhter, Ravi Singh, Eric Rosen, Eric Osborne, Greg
      Mirsky and Nobo Akiya for their contributions to this document.</t>
    </section>
  </middle>

  <back>
    <references title="Normative References">
      <?rfc include="reference.RFC.0768"?>

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

      <?rfc include="reference.RFC.0791"?>

      <?rfc include="reference.RFC.2460"?>

      <?rfc ?>

      <?rfc include="reference.RFC.3209"?>

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

      <?rfc include="reference.RFC.4379"?>

      <?rfc ?>

      <?rfc include="reference.RFC.5036"?>

      <?rfc ?>

      <?rfc include="reference.RFC.6335"?>
    </references>

    <references title="Informative References">
      <?rfc include='reference.I-D.akiya-bfd-seamless-base.xml'

?>

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

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

      <reference anchor="IANA.PORTS"
                 target="http://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.txt">
        <front>
          <title>Service Name and Transport Protocol Port Number
          Registry</title>

          <author>
            <organization>IANA</organization>
          </author>

          <date/>
        </front>
      </reference>

      <reference anchor="NIST-CSPRNG">
        <front>
          <title>NIST Special Publication 800-90A, Recommendation for Random
          Number Generation Using Deterministic Random Bit Generators</title>

          <author fullname="National Institute of Standards and Technology, U.S. Department of Commerce">
            <organization/>
          </author>

          <date month="January" year="2012"/>
        </front>
      </reference>
    </references>

    <section title="Rejected Approaches">
      <t>In a rejected approach, the ingress LSR uses LSP-Ping to verify LSP
      readiness. This approach was rejected for the following reasons.</t>

      <t>While an ingress LSR can control its control plane overhead due to
      LSP Ping, an egress LSR has no such control. This is because each
      ingress LSR can, on its own, control the rate of the LSP Ping originated
      by the LSR, while an egress LSR must respond to all the LSP Pings
      originated by various ingresses. Furthermore, when an MPLS Echo Request
      reaches an egress LSR it is sent to the control plane of the egress LSR,
      which makes egress LSR processing overhead of LSP Ping well above the
      overhead of its data plane (MPLS/IP forwarding). These factors make LSP
      Ping problematic as a tool for detecting LSP readiness to carry traffic
      when dealing with a large number of LSPs.</t>

      <t>By contrast, LSP Self-ping does not consume any control plane
      resources at the egress LSR, and relies solely on the data plane of the
      egress LSR, making it more suitable as a tool for checking LSP readiness
      when dealing with a large number of LSPs.</t>

      <t>In another rejected approach, the ingress LSR does not verify LSP
      readiness. Instead, it sets a timer when it receives an RSVP RESV
      message and does not forward traffic through the LSP until the timer
      expires. This approach was rejected because it is impossible to
      determine the optimal setting for this timer. If the timer value is set
      too low, it does not prevent black-holing. If the timer value is set too
      high, it slows down the process of LSP signalling and setup.</t>

      <t>Moreover, the above-mentioned timer is configured on a per-router
      basis. However, its optimum value is determined by a network-wide
      behavior. Therefore, changes in the network could require changes to the
      value of the timer, making the optimal setting of this timer a moving
      target.</t>
    </section>
  </back>
</rfc>
