<?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="info" docName="draft-ali-spring-bfd-sr-policy-02"
     ipr="trust200902">
  <front>
    <title abbrev="BFD for SR Policies for TE">Bidirectional Forwarding
    Detection (BFD) for Segment Routing Policies for Traffic
    Engineering</title>

    <author fullname="Zafar Ali" initials="Z." surname="Ali">
      <organization>Cisco Systems</organization>

      <address>
        <postal>
          <street/>

          <city/>

          <code/>

          <country/>
        </postal>

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

    <author fullname="Ketan Talaulikar" initials="K." surname="Talaulikar">
      <organization>Cisco Systems</organization>

      <address>
        <postal>
          <street/>

          <city/>

          <code/>

          <country/>
        </postal>

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

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

      <address>
        <postal>
          <street/>

          <city/>

          <code/>

          <country/>
        </postal>

        <email>cfilsfil@cisco.com</email>
      </address>
    </author>
    
    <author fullname="Nagendra Kumar Nainar" initials="N." surname="Nainar">
      <organization>Cisco Systems</organization>

      <address>
        <postal>
          <street/>

          <city/>

          <code/>

          <country/>
        </postal>

        <email>naikumar@cisco.com</email>
      </address>
    </author>
    
    <author fullname="Carlos Pignataro" initials="C." surname="Pignataro">
      <organization>Cisco Systems</organization>

      <address>
        <postal>
          <street/>

          <city/>

          <code/>

          <country/>
        </postal>

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

    <date year=""/>

    <area>Routing</area>

    <workgroup>SPRING</workgroup>

    <keyword>BFD</keyword>

    <keyword>Segment Routing</keyword>

    <keyword>Traffic Engineering</keyword>

    <abstract>
      <t>Segment Routing (SR) allows a headend node to steer a packet flow
      along any path using a segment list which is referred to as a SR Policy.
      Intermediate per-flow states are eliminated thanks to source routing.
      The header of a packet steered in an SR Policy is augmented with the
      ordered list of segments associated with that SR Policy. Bidirectional
      Forwarding Detection (BFD) is used to monitor different kinds of paths
      between node. BFD mechanisms can be also used to monitor the
      availability of the path indicated by a SR Policy and to detect any
      failures. Seamless BFD (S-BFD) extensions provide a simplified mechanism
      which is suitable for monitoring of paths that are setup dynamically and
      on a large scale.</t>

      <t>This document describes the use of Seamless BFD (S-BFD) mechanism to
      monitor the SR Policies that are used for Traffic Engineering (TE) in SR
      deployments.</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">RFC 2119</xref>.</t>
    </note>
  </front>

  <middle>
    <section title="Introduction">
      <t>Segment Routing (SR) (<xref target="RFC8402"/>) allows a headend node
      to steer a packet flow along any path for specific objectives like
      Traffic Engineering (TE) and to provide it treatment according to the
      specific established service level agreement (SLA) for it. Intermediate
      per-flow states are eliminated thanks to source routing. The headend
      node steers a flow into an SR Policy. The header of a packet steered in
      an SR Policy is augmented with the ordered list of segments associated
      with that SR Policy. <xref
      target="I-D.ietf-spring-segment-routing-policy">SR Policy</xref>
      specifies the concepts of SR Policy and steering into an SR Policy.</t>

      <t>SR Policy state is instantiated only on the head-end node and any
      intermediate node or the endpoint node does not require any state to be
      maintained or instantiated for it. SR Policies are not signaled through
      the network nodes except the signaling required to instantiate them on
      the head-end in the case of a controller based deployment. This enables
      SR Policies to scale far better than previous TE mechanisms. This also
      enables SR Policies to be instantiated dynamically and on demand basis
      for steering specific traffic flows corresponding to service routes as
      they are signaled. These automatic steering and signaling mechanisms for
      SR Policies are described in <xref
      target="I-D.ietf-spring-segment-routing-policy">SR Policy</xref>.</t>

      <t>There is a requirement to continuously monitor the availability of
      the path corresponding to the SR Policy along the nodes in the network
      to rapidly detect any failures in the forwarding path so that it
      could take corrective action to restore service. The corrective actions
      may be either to invalidate the candidate path that has experienced
      failure and to switch to another candidate path within the same SR
      Policy OR to activate another backup SR Policy or candidate path for
      end-to-end path protection. These mechanisms are beyond the scope of
      this document.</t>

      <t>Bidirectional Forwarding Detection (BFD) mechanisms have been
      specified for use for monitoring of unidirectional MPLS LSPs via <xref
      target="RFC5884">BFD MPLS</xref>. <xref target="RFC7880">Seamless BFD
      </xref> defines a simplified mechanism for using BFD by eliminating
      the negotiation aspect and the need to maintain per session state 
      entries on the tail end of the policy, thus providing benefits
      such as quick provisioning, as well as improved control and flexibility
      for network nodes initiating path monitoring. When BFD or S-BFD is used
      for verification of such unidirectional LSP paths, the reverse path is
      via the shortest path from the tail-end router back to the head-end
      router as determined by routing.</t>

      <t>The SR Policy is essentially a unidirectional path through the
      network. This document describes the use of BFD and more specifically
      S-BFD for monitoring of SR Policy paths through the network. SR can be
      instantiated using both MPLS and IPv6 dataplanes. The mechanism
      described in this document applies to both these instantiations of SR
      Policy.</t>
    </section>

    <section title="Choice of S-BFD over BFD">
      <t><xref target="RFC5884">BFD MPLS</xref> describes a mechanism where
      <xref target="RFC8029">LSP Ping</xref> is used to bootstrap the BFD
      session over an MPLS TE LSP path. The LSP Ping mechanism was extended to
      support SR LSPs via <xref target="RFC8287">SR LSP Ping</xref> and a
      similar mechanism could have been considered for BFD monitoring of SR
      Policies on MPLS data-plane. However, this document proposes instead to
      use S-BFD mechanism as it is more suitable for SR Policies.</t>

      <t>Some of the key aspects of SR Policies that are considered in
      arriving at this decision are as follows:<list style="symbols">
          <t>SR Policies do not require any signaling to be performed through
          the network nodes in order to be setup. They are simply instantiated
          on the head-end node via provisioning or even dynamically by a
          controller via <xref
          target="I-D.ietf-idr-segment-routing-te-policy">BGP SR-TE</xref> or
          using PCEP (<xref target="I-D.ietf-pce-segment-routing">PCEP
          SR</xref>, <xref target="RFC8281">PCE Initiated</xref>, <xref
          target="RFC8231">PCEP Stateful</xref>).</t>

          <t>SR Policies result in state being instantiated only on the
          head-end node and no other node in the network.</t>

          <t>In many deployments, SR Policies are instantiated dynamically and
          on-demand or in the case of automated steering for BGP routes, when
          routes are learnt with specific color communities (refer <xref
          target="I-D.ietf-spring-segment-routing-policy">SR Policy</xref> for
          details).</t>

          <t>SR Policies are expected to be deployed in much higher scale.</t>

          <t>SR Policies can be instantiated both for MPLS and IPv6
          data-planes and hence a monitoring mechanism which works for both is
          desirable.</t>
        </list></t>

      <t>In view of the above, the BFD mechanism to be used for monitoring
      them needs to be simple, lightweight, one that does not result in
      instantiation of per SR Policy state anywhere but the head-end and which
      can be setup and deleted dynamically and on-demand. The S-BFD
      extensions provide this support as described in <xref
      target="RFC7880">Seamless BFD</xref>. Furthermore, <xref
      target="RFC7882">S-BFD Use-Cases</xref> clarifies the applicability in
      the Centralized TE and SR scenarios.</t>
    </section>

    <section anchor="PROCEDURES" title="Procedures">
      <t>The general procedures and mechanisms for S-BFD operations are
      specified in <xref target="RFC7880">Seamless BFD</xref>. This section
      describes the specifics related to S-BFD use for SR Policies.</t>

      <t>SR Policies are represented on a head-end router as
      &lt;color,endpoint IP address&gt; tuple. The SRTE process on the
      head-end determines the tail-end node of a SR Policy on the basis of the
      endpoint IP address. In the cases where the SR Policy endpoint is
      outside the domain of the head-end node, this information is available
      with the centralized controller that computed the multi-domain SR Policy
      path for the head-end.</t>
      
      	<section title="S-BFD Discriminator">
      		<t>In order to enable S-BFD monitoring for a given SR Policy, the S-BFD
      		Discriminator for the tail-end node (i.e. one with the endpoint IP
      		address) which is going to be the S-BFD Reflector is required. <xref
      		target="RFC7883">ISIS S-BFD</xref> and <xref target="RFC7884">OSPF
      		S-BFD</xref> describe the extensions to the ISIS and OSPF link state
      		routing protocols that allow all nodes to advertise their S-BFD
      		Discriminators across the network. 
      		<xref target="I-D.li-idr-bgp-ls-sbfd-extensions">BGP-LS S-BFD</xref> 
      		describes extensions for advertising the S-BFD discriminators via BGP-LS 
      		across domains and to a controller. Thus, either the SRTE head-end 
      		node or the controller, as the case may be, have the S-BFD Discriminator of the
      		tail-end node of the SR Policy available.</t>
      		
      		<t>When the end point IP address configured in the SR policy is IPv4, an implementation
      		may support the use of end point address as the S-BFD Discriminator if SBFDReflector
      		is enabled to associate the end point address as Discriminator for the target 
      		identifier.
      		 </t>
      		 
      		 <t>The selection of S-BFD Discriminator from IGP or end point address is a local
      		 implementation matter and can be controlled by configuration knob.
      		 </t>
      	</section>
      	
      	<section title="S-BFD session Initiation by SBFDInitiator">
      		<t>The SRTE Process can straightaway instantiate the S-BFD mechanism on 
      		the SR Policy as soon as it is provisioned in the forwarding to start
      		verification of the path to the endpoint. No signaling or provisioning 
      		is required for the tail-end node on a per SR Policy basis and it just 
      		performs its role as a stateless S-BFD Reflector. The return path used by 
      		S-BFD is via the normal IP routing back to the head-end node. Once the 
      		specific SR Policy path is verified via S-BFD, then it is considered as 
      		active and may be used for traffic steering.</t>
      		
      		<t>The S-BFD monitoring continues for the SR Policy and any failure is 
      		notified to the SRTE process. In response to the failure of a specific 
      		candidate path, the SRTE process may trigger any of the following based 
      		on local policy or implementation specific aspects which are outside the 
      		scope of this document:
      			<list style="symbols"> 
      				<t>Trigger path-protection for the SR Policy</t>
      				
      				<t>Declare the specific candidate path as invalid and switch to 
      				using the next valid candidate path based on preference</t>
      				
      				<t>If no alternate candidate path is available, then handle the 
      				steering over that SR Policy based on its invalidation policy (e.g. 
      				drop or switch to best effort routing).</t>
      			</list>
      		</t>
      	</section>
      	
      	<section title="Controlled Return Path">
      		<t>S-BFD response from SBFDResponder is IP routed and so the procedure defined 
      		in the above sections will receive the response through uncontrolled return 
      		path. S-BFD echo packets with relevant stack of segment ID can be used to 
      		control the return path.
      		</t>
      		
      		<figure>
						<artwork><![CDATA[
      
         +-----B-------C-----+
        /                     \
       A-----------E-----------D
        \                     /
         +-----F-------G-----+

         Forward Paths: A-B-C-D
         IP Return Paths: D-E-A

         Figure 1: S-BFD Echo Example

	  ]]></artwork>
					</figure>
			
			<t>Node A sending S-BFD control packets with segment stack {B, C, D} 
			will cause S-BFD control packets to traverse the paths A-B-C-D in the 
			forward direction.  The response S-BFD control packets from node D 
			back to node A will be IP routed and will traverse the paths D-E-A. 
			The SBFDInitiator sending such packets can also send S-BFD echo 
			packets with segment stack {B, C, D, C, A}. S-BFD echo packets will 
			u-turn on node D and traverse the paths D-C-B-A.  If required, the 
			SBFDInitiator can possess multiple types of S-BFD echo packets, with 
			each having varying return paths.  In this particular example, the 
			SBFDInitiator can be sending two types of S-BFD echo packets in 
			addition to S-BFD control packets.
			
				<list style="symbols">
					<t>S-BFD Control Packets
						<list style="symbols">
							<t>Segment Stack: {B, C, D}
							</t>
							<t>Return Path: D->E->A
							</t>
						</list>
					</t>
					
					<t>S-BFD Echo packets #1
						<list style="symbols">
							<t>Segment Stack: {B, C, D, C, A}
							</t>
							<t>Return Path: D->C->B->A
							</t>
						</list>
					</t>
					
					<t>S-BFD Echo packets #2
						<list style="symbols">
							<t>Segment Stack: {B, C, D, G, A}
							</t>
							<t>Return Path: D->G->F->A
							</t>
						</list>
					</t>
				</list>
			</t>
			
			<t>The SBFDInitiator can correlate the result of each packet type to 
			determine the nature of the failure.  One such example of failure 
			correlation is described in the figure below.
			
			<figure>
						<artwork><![CDATA[
      
       
     +---+-----------------------------------------------------------+
     |   |                      S-BFD Echo Pkt                       |
     |   +------------------------------------+----------------------+
     |   |              Success               |       Failure        |
     +-+-+------------------------------------+----------------------+
     | |S|                                    |                      |
     |S|u|                                    |                      |
     |||c|                                    |Forward SID stack good|
     |B|c|             All is well            |Return SID stack bad  |
     |F|e|                                    |Return IP path good   |
     |D|s|                                    |                      |
     | |s|                                    |                      |
     |C+-+----------------------+-------------+----------------------+
     |t|F|Forward SID stack good|             |                      |
     |r|a|Return SID stack good |Send Alert   |                      |
     |l|i|Return IP path bad    |Discrim S-BFD|                      |
     | |l+--------- OR ---------+w/ Forward   |Forward SID stack bad |
     |P|u|Forward SID stack is  |SID stack to |                      |
     |k|r|terminating on wrong  |differentiate|                      |
     |t|e|node                  |             |                      |
     +-+-+----------------------+-------------+----------------------+

         Figure 2: SBFDInitiator Failure Correlation Example

	  ]]></artwork>
					</figure>
			</t>
      	</section>
      	
      	<section title="S-BFD Echo Recommendation">
      	   <t>
      		<list style="symbols">
      			<t>It is RECOMMENDED to compute and use smallest number of segment 
      			stack to describe the return path of S-BFD echo packets to prevent 
      			the segment stack being too large.  How SBFDInitiator determines 
      			when to use S-BFD echo packets and how to identify corresponding 
      			segment stack for the return paths are outside the scope of this 
      			document.
      			</t>
      			
      			<t>It is RECOMMENDED that SBFDInitiator does not send only S-BFD echo 
      			packets.  S-BFD echo packets are crafted to traverse the network 
      			and to come back to self, thus there is no guarantee that S-BFD 
      			echo are u-turning on the intended remote target.  On the other 
      			hand, S-BFD control packets can verify that segment stack of the 
      			forward direction reaches the intended remote target.  Therefore, 
      			an SBFDInitiator SHOULD send S-BFD control packets when sending 
      			S-BFD echo packets.
      			</t>
      		</list>
      		</t>
      		
      	</section>
      
    </section>

    <section anchor="IANA" title="IANA Considerations">
      <t>None</t>
    </section>

    <section anchor="Security" title="Security Considerations">
      <t>Procedures described in this document do not affect the BFD or
      Segment Routing security model. See the 'Security Considerations'
      section of <xref target="RFC7880"/> for a discussion of S-BFD security
      and to <xref target="RFC8402"/> for analysis of security in SR
      deployments.</t>
    </section>

    <section anchor="Contributors" title="Contributors">
      <t><figure>
          <artwork><![CDATA[Mallik Mudigonda
Cisco Systems Inc.

Email: mmudigon@cisco.com]]></artwork>
        </figure></t>
    </section>

    <section anchor="Acknowledgements" title="Acknowledgements">
      <t/>
    </section>
  </middle>

  <back>
    <references title="Normative References">
      <?rfc include="http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml"?>

      <?rfc include="http://xml.resource.org/public/rfc/bibxml/reference.RFC.7880.xml"?>

      <?rfc include="http://xml.resource.org/public/rfc/bibxml/reference.RFC.7882.xml"?>

      <?rfc include="http://xml.resource.org/public/rfc/bibxml/reference.RFC.7883.xml"?>

      <?rfc include="http://xml.resource.org/public/rfc/bibxml/reference.RFC.7884.xml"?>

      <?rfc include="http://xml.resource.org/public/rfc/bibxml/reference.RFC.8402.xml"?>

      <?rfc include="reference.I-D.li-idr-bgp-ls-sbfd-extensions.xml"?>

      <?rfc include="reference.I-D.ietf-spring-segment-routing-policy.xml"?>
    </references>

    <references title="Informative References">
    
      <?rfc include="http://xml.resource.org/public/rfc/bibxml/reference.RFC.8287.xml"?>

      <?rfc include="http://xml.resource.org/public/rfc/bibxml/reference.RFC.5884.xml"?>

      <?rfc include="http://xml.resource.org/public/rfc/bibxml/reference.RFC.8029.xml"?>

      <?rfc include="reference.I-D.ietf-pce-segment-routing.xml"?>

      <?rfc include="http://xml.resource.org/public/rfc/bibxml/reference.RFC.8231.xml"?>

      <?rfc include="http://xml.resource.org/public/rfc/bibxml/reference.RFC.8281.xml"?>

      <?rfc include="reference.I-D.ietf-idr-segment-routing-te-policy.xml"?>
    </references>
  </back>
</rfc>
