<?xml version='1.0' encoding='utf-8'?>
<?xml-stylesheet type="text/xsl" href="rfc2629.xslt" ?>
<!-- generated by https://github.com/cabo/kramdown-rfc version 1.7.35 (Ruby 3.2.3) -->
<?rfc comments="yes"?>
<rfc xmlns:xi="http://www.w3.org/2001/XInclude" 
ipr="trust200902" 
docName="draft-liu-srv6ops-bfd-srv6-policy-encap-02" 
category="info" 
consensus="true" 
submissionType="IETF" 
tocInclude="true" 
sortRefs="true" 
symRefs="true" 
version="3">
  
 <front>
    <title abbrev="Operational Guidelines for BFD in SRv6">Operational Guidelines for BFD Monitoring in SRv6 Policies</title>
    
    <author fullname="Yisong Liu" initials="Y." surname="Liu">
      <organization>China Mobile</organization>
      <address>
	         <postal>
          <street>32 Xuanwumen West Street</street>

          <!-- Reorder these if your country does things differently -->

          <city>Beijing</city>

          <region>Xicheng District</region>

          <code>100053</code>

          <country>China</country>
        </postal>
        <email>liuyisong@chinamobile.com</email>
      </address>
    </author>
    
    <author fullname="Weiqiang Cheng" initials="W." surname="Cheng">
      <organization>China Mobile</organization>
      <address>
	         <postal>
          <street>32 Xuanwumen West Street</street>

          <!-- Reorder these if your country does things differently -->

          <city>Beijing</city>

          <region>Xicheng District</region>

          <code>100053</code>

          <country>China</country>
        </postal>
        <email>chengweiqiang@chinamobile.com</email>
      </address>
    </author>
    
    <author fullname="Changwang Lin" initials="C." surname="Lin">
      <organization>New H3C Technologies</organization>
      <address>
	  <postal>
          <street>8 Yongjia North Road</street>
          <!-- Reorder these if your country does things differently -->
          <city>Beijing</city>
          <region>Haidian District</region>
          <code>100094</code>
          <country>China</country>
       </postal>
        <email>linchangwang.04414@h3c.com</email>
      </address>
    </author>
    
    <author fullname="Xiao Min" initials="X." surname="Min">
      <organization>ZTE Corp.</organization>
      <address>
	         <postal>

          <country>China</country>
        </postal>
        <email>xiao.min2@zte.com.cn</email>
      </address>
    </author>

    <date year="2026" month="November" day="15"/>
    
    <area>Internet</area>
    <workgroup>SRV6OPS</workgroup>
    
    <abstract>
      <t>This document provides operational guidelines for Bidirectional Forwarding Detection (BFD) when applied to Segment Routing over IPv6 (SRv6) Policies. While the packet encapsulation mechanisms are standardized, this document focuses on the decisions network operators must make regarding mode selection, address management, traffic engineering integration, and troubleshooting strategies to ensure reliable service protection and efficient resource utilization.</t>
      <t>It addresses practical challenges such as handling diverse tail-end node capabilities (IPv4/IPv6), managing BFD session overhead in large-scale segment lists, and diagnosing failure detection anomalies in source-routed paths.</t>
    </abstract>
  </front>

  <middle>
    <section anchor="introduction" toc="include">
      <name>Introduction</name>
      
      <section anchor="motivation" toc="include">
        <name>Motivation for Operational Guidelines</name>
        <t>Segment Routing over IPv6 (SRv6) allows network operators to steer traffic along explicit paths defined by Segment Routing Policies (SR Policies). To meet carrier-grade availability requirements, fast failure detection is critical. Bidirectional Forwarding Detection (BFD) <xref target="RFC5880"/> is commonly used to monitor the continuity of these policies.</t>
        <t>However, simply implementing BFD for SRv6 presents operational complexities. Unlike traditional IP forwarding where the path is dynamic and determined by the routing protocol, SRv6 paths are explicitly coded into the packet header. This introduces unique challenges for operators:</t>
  
          <t>Encapsulation Choice: Operators must decide between Insert-Mode and Encaps-Mode, which have different implications for tail-end compatibility and bandwidth overhead.</t>
          <t>Address Complexity: The source and destination addresses of the BFD packets vary depending on the encapsulation mode and the state of the packet along the path (e.g., SRH popping).</t>
          <t>Troubleshooting Difficulty: Standard BFD debugging tools may misinterpret the changing headers (such as the shifting Destination Address due to SRH segment popping) as packet anomalies or forwarding loops.</t>

        <t>This document does not define new encapsulation protocols but rather provides guidance on how to deploy, configure, and maintain BFD monitoring for SRv6 Policies in real-world networks.</t>
      </section>
    </section>

    <section anchor="mode-selection" toc="include">
      <name>Operational Considerations for Mode Selection</name>
      <t>There are two primary methods for encapsulating BFD packets for SRv6 Policies: Insert-Mode and Encaps-Mode. The choice between them is a key operational decision.</t>

      <section anchor="insert-vs-encaps" toc="include">
        <name>Insert-Mode vs. Encaps-Mode Decision Criteria</name>
        <t>Insert-Mode inserts the SRH directly into the original BFD packet. Encaps-Mode wraps the entire BFD packet (including its IP header) in an outer IPv6/SRH header.</t>
        <t>Network operators should consider the following factors when selecting the mode:</t>
    	
        <t>Older Devices: If the tail-end node is an older device that does not support SRv6 decryption or termination of the specific SRH flavors used by the policy, Encaps-Mode is recommended. In Encaps-Mode, the outer headers are stripped by the penultimate hop (or specified endpoint), exposing the inner BFD packet (which typically uses standard BFD headers) to the final destination.</t>
        
        <t>Full SRv6 Support: If all nodes in the path support SRv6 and can process the SRH fully, Insert-Mode is preferred to reduce overhead.</t>

        <t>Bandwidth Overhead:</t>
        <t>Insert-Mode: Has lower overhead because it reuses the existing IPv6 header of the BFD packet and only adds the SRH.</t>
        <t>Encaps-Mode: Adds a full additional IPv6 header, SRH, and potentially increases the packet size significantly, especially if the Segment List is long. This may be a concern for high-frequency BFD packets (e.g., 1ms intervals).</t>

        <t>Debugging Visibility:</t>
        <t>Encaps-Mode: The inner packet remains constant. Tools capturing packets at intermediate nodes can clearly see the inner BFD headers, making it easier to identify the intended source and destination IPs without parsing the entire SRH.</t>
        <t>Insert-Mode: The Destination Address changes at each hop as segments are popped. This can confuse simple packet captures unless they account for SRH semantics.</t>
      </section>

      <section anchor="tail-end-interop" toc="include">
        <name>Impact on Tail-End Nodes and Interoperability</name>
        <t>Operators must verify the SRv6 Function of the last Segment in the Policy <xref target="RFC8986"/>.</t>
        <t>End.Adj / End.X SIDs: If the last segment is an adjacency SID, the node may not decapsulate the packet entirely. In Insert-Mode, the tail-end must understand how to extract the BFD payload after the SRH processing. In Encaps-Mode, the penultimate hop should perform Ultimate Segment Decapsulation (USD) to expose the inner packet to the actual tail-end endpoint.</t>
        <t>Binding SIDs (BSID): If the policy uses a BSID, the terminating node processes the BSID and may terminate the SRH. Operators must ensure that the BFD packet arriving at the local loopback or interface is parseable by the BFD agent. Encaps-Mode is generally safer here as it keeps the BFD packet self-contained.</t>
      </section>
    </section>

    <section anchor="address-management" toc="include">
      <name>Address Management and Policy Configuration</name>
      <t>Proper address configuration is critical for BFD session establishment and correct packet delivery.</t>

      <section anchor="headend-address" toc="include">
        <name>Headend Source Address Selection</name>
        <t>The Source Address (SA) of the outer IPv6 header determines the return path for BFD Echo responses or potential ICMP errors.</t>
        <t>Recommendation: Use a stable, routable IPv6 address associated with the headend node's role in the SR Policy (e.g., a loopback address or a dedicated SVI interface).</t>
        <t>Avoid Link-Local Addresses: Do not use link-local addresses as the Source Address for the outer header unless the immediate next-hop is the only destination. SR Policies often traverse multiple hops; a globally unique or domain-routable SA ensures that return traffic (if any) is handled correctly.</t>
        <t>Multi-Homed Headends: If the headend has multiple egress interfaces for the same SR Policy, consistent SA selection helps in maintaining session state clarity during failures.</t>
      </section>

      <section anchor="tailend-address" toc="include">
        <name>Tail-End Destination Address Resolution</name>
        <t>The Destination Address (DA) behavior depends on the encapsulation mode.</t>
        <t>For Insert-Mode: The initial DA in the IPv6 header matches the first segment in the SRH. However, as the packet traverses the path, the SRH pointer advances, and the DA changes to the next segment.</t>
        <t>Operational Implication: When troubleshooting, do not assume the initial DA is the final destination. The BFD process must track the active Segment List.</t>
        <t>For Encaps-Mode: The inner IPv6 header's DA is fixed to the tail-end node's address (e.g., its Loopback0 or an interface IP).</t>
        <t>Operational Implication: This provides a stable visibility into the true end-point of the BFD session. Operators can verify reachability to this specific DA using tools like ping or traceroute from intermediate nodes (if permitted) to debug path issues.</t>
        <t>Unspecified Address (::) Handling: If the SR Policy is defined with an unspecified endpoint (::), the operator MUST explicitly configure the tail-end IPv6 address in the BFD configuration. Failure to do so will result in BFD packet drops or undefined behavior.</t>
      </section>
    </section>

    <section anchor="resource-management" toc="include">
      <name>Resource Management and Scalability</name>
      <t>SRv6 Policies can contain long Segment Lists. Monitoring every segment or the entire path via BFD has significant resource implications.</t>

      <section anchor="bfd-overhead" toc="include">
        <name>BFD Session Overhead</name>
        <t>One-to-Many Mapping: A single SR Policy might consist of multiple Candidate Paths, each with multiple Segment Lists. If BFD is instantiated per Segment List, the number of BFD sessions can grow exponentially.</t>
        <t>Recommendation: Implement BFD at the Candidate Path level rather than the Segment List level, if possible. This reduces the number of sessions. If fine-grained monitoring (per Segment List) is required, ensure the controller/headend has sufficient CPU/Memory to handle the session state transitions.</t>
      </section>

      <section anchor="state-explosion" toc="include">
        <name>Mitigating State Explosion in Large Segment Lists</name>
        <t>For policies with very long Segment Lists, generating BFD packets for every hop can be inefficient.</t>
        <t>S-BFD (Seamless BFD): Use S-BFD <xref target="RFC7880"/> where available. S-BFD removes the need for a bidirectional handshake per path segment, reducing CPU load on intermediate nodes and simplifying the state model. The reflexion point is configured statically or via controller push, avoiding session negotiation overhead.</t>
        <t>Sampling: For non-critical paths, consider increasing the BFD transmit interval or using lower sensitivity timers, accepting a slight increase in detection time in exchange for reduced control plane overhead.</t>
      </section>
    </section>

    <section anchor="troubleshooting" toc="include">
      <name>Troubleshooting and Diagnostics</name>
      <t>Diagnosing BFD failures in SRv6 requires understanding the interaction between the control plane (BFD) and the data plane (SRH processing).</t>

      <section anchor="path-correctness" toc="include">
        <name>Verifying Path Correctness</name>
        <t>To confirm that BFD packets are following the intended SR Policy:</t>
        <t>Check SRH Structure: Verify that the SRH inserted/encapsulated at the headend contains the correct Segment List corresponding to the active BFD session.</t>
        <t>Verify Segment List[0]: Ensure that Segment List[0] in the SRH correctly points to the next-hop segment or tail-end, depending on the mode. A mismatch here causes packets to take a wrong path or get dropped.</t>
        <t>Packet Capture: In Encaps-Mode, look for the outer IPv6 header matching the SR Policy's start segment and the inner header matching the tail-end. In Insert-Mode, observe the change in IPv6 Destination Address across nodes. If the DA does not match the expected next segment, there is a misconfiguration in the Segment List or SRH processing.</t>
      </section>

      <section anchor="false-failures" toc="include">
        <name>Diagnosing False Failures and Timeout Issues</name>
        <t>Jitter and Loss: BFD timers are sensitive. If the SR Policy traverses congested links, BFD packets (which are small and frequent) might be dropped or delayed. Action: Ensure strict QoS priority for BFD packets. Even in SRv6, BFD packets are UDP/ICMP and may be subject to default queuing policies. Configure a dedicated Class of Service (CoS) for BFD traffic.</t>
        <t>Asymmetric Routes: In some SR implementations, the forward path (BFD packets) and the reflection path (Echo replies) might differ if not carefully configured. Ensure that the SR Policy for the return traffic (if any) or the default return path allows BFD Echo replies to reach the headend.</t>
        <t>Node Processing Delay: Intermediate nodes performing complex SRv6 functions (like End.MAC, End.DX2, etc.) may introduce latency. Adjust BFD transmit/receive multipliers accordingly.</t>
      </section>
    </section>

    <section anchor="security" toc="include">
      <name>Security Considerations</name>
      <t>BFD Authentication: As per <xref target="RFC5880"/>, operators should enable MD5 or SHA-based authentication for BFD sessions to prevent spoofing. In SRv6 environments, ensuring that authenticated BFD packets are not dropped due to checksum verification issues is crucial.</t>
      <t>SRH Protection: While not part of BFD directly, operators should ensure that the SR Policy itself is protected against unauthorized manipulation to prevent traffic steering attacks.</t>
    </section>

    <section anchor="iana" toc="include">
      <name>IANA Considerations</name>
      <t>This document has no IANA actions.</t>
    </section>

 
  </middle>

  <back>
    <references>
      <name>Normative References</name>
      <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml"/>
      <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.5880.xml"/>
      <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.7880.xml"/>
      <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.8402.xml"/>
      <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.8754.xml"/>
      <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.8986.xml"/>
      <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.9256.xml"/>
    </references>

  </back>
</rfc>