<?xml version="1.0" encoding="utf-8"?>
<!-- 
     draft-rfcxml-general-template-standard-00
  
     This template includes examples of the most commonly used features of RFCXML with comments 
     explaining how to customise them. This template can be quickly turned into an I-D by editing 
     the examples provided. Look for [REPLACE], [REPLACE/DELETE], [CHECK] and edit accordingly.
     Note - 'DELETE' means delete the element or attribute, not just the contents.
     
     Documentation is at https://authors.ietf.org/en/templates-and-schemas
-->
<?xml-model href="rfc7991bis.rnc"?>  <!-- Required for schema validation and schema-aware editing -->
<!-- <?xml-stylesheet type="text/xsl" href="rfc2629.xslt" ?> -->
<!-- This third-party XSLT can be enabled for direct transformations in XML processors, including most browsers -->


<!DOCTYPE rfc [
  <!ENTITY nbsp    "&#160;">
  <!ENTITY zwsp   "&#8203;">
  <!ENTITY nbhy   "&#8209;">
  <!ENTITY wj     "&#8288;">
]>
<!-- If further character entities are required then they should be added to the DOCTYPE above.
     Use of an external entity file is not recommended. -->

<rfc
  xmlns:xi="http://www.w3.org/2001/XInclude"
  category="std"
  consensus="true"
  docName="draft-yang-bfd-sbfd-proxy-03"
  ipr="trust200902"
  obsoletes=""
  updates=""
  submissionType="IETF"
  xml:lang="en"
  version="3">
  
  <front>
    <title abbrev="S-BFD Proxy">S-BFD Proxy</title>

    <seriesInfo name="Internet-Draft" value="draft-yang-bfd-sbfd-proxy-03"/>
   
    <author fullname="Qing Yang" initials="Q" role="editor" surname="Yang">
      <organization>Arista Networks Inc</organization>
      <address>
        <email>qyang@arista.com</email>  
      </address>
    </author>
   
    <author fullname="Feng Zhu" initials="F" surname="Zhu">
      <organization>Arista Networks Inc</organization>
      <address>
        <email>fzhu@arista.com</email>  
      </address>
   </author>

    <author fullname="Victor Wen" initials="V" surname="Wen">
      <organization>Arista Networks Inc</organization>
      <address>
        <email>vwen@arista.com</email>  
      </address>
    </author>

    <author fullname="Hanchen Zheng" initials="H" surname="Zheng">
      <organization>ByteDance Inc</organization>
      <address>
        <email>hanchen.zheng@bytedance.com</email>  
      </address>
   </author>
    
    <author fullname="Liu Yang" initials="L" surname="Yang">
      <organization>ByteDance Inc</organization>
      <address>
        <email>yangliu.jason@bytedance.com</email>  
      </address>
    </author>
   
    <date year="2026"/>

    <area>General</area>
    <workgroup>Internet Engineering Task Force</workgroup>

    <keyword>S-BFD</keyword>

    <abstract>
      <t>This document proposes an extension to Seamless Bidirectional Forwarding Detection (S-BFD). </t>   
      <t>The S-BFD initiator will send packets that carry extra information, and this enables reflector to act as a proxy, and respond with the extra information in consideration.</t> 
      <t>This document updates RFC 7880.</t>
    </abstract>
 
  </front>

  <middle>
    
    <section>
      <name>Introduction</name>
      <t>Seamless Bidirectional Forwarding Detection (S-BFD), as described in <xref target="RFC7880"/> and related documents, has defined a mechanism for liveliness detection of paths end-to-end. </t>
      <t>However, in certain cases, such liveliness detection is not possible end-to-end. There could be a number of reasons. For example, the path termination point may not be able to perform S-BFD reflector functionality, or it is not possible for the path termination point to route back to the source IP address of the initiator. </t>
      <t>In such cases, however, it may still be useful or essential for the S-BFD initiator to detect the liveliness of the path.</t>
      <t>In this draft, we propose a mechanism for an intermediate node in the path to act as a proxy for the real end point, and the report S-BFD status would be for the entire path.</t>
      
      <section>
        <name>Requirements Language</name>
        <t>The key words "MUST", "MUST NOT", "REQUIRED", "SHALL",
          "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT
          RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be
          interpreted as described in BCP 14 <xref target="RFC2119"/>
          <xref target="RFC8174"/> when, and only when, they appear in
          all capitals, as shown here.</t>
      </section>
    </section>
    
    <section>
      <name>S-BFD Proxy Reflector Overview</name>
      <t>Similar to regular S-BFD sessions, in an S-BFD proxy session, the initiator will determine, with help of configuration, which is outside the scope of this specification, a proxy reflector, along the path, to be the responder of the S-BFD packet. It then sends the S-BFD packet terminating at the proxy reflector, and the proxy reflector reflects the S-BFD packet with a status in consideration of the remaining path. </t>

      <t>In order for the proxy reflector to reflect the status of the entire path, the initiator will have to include the information about the remaining path in the S-BFD packet payload (see section 4).</t>

      <t>When the reflector receives the S-BFD packet, instead of just reflecting the packet as defined in RFC7880, it will retrieve the remaining path information from S-BFD packet, and inspect the health of the corresponding path (scope outside of this spec). It will then respond with the appropriate status back to the initiator. </t>

      <t>It is possible that the initiator may have multiple paths passing through the proxy reflector. In order for the initiator to differentiate the different sessions, the proxy reflector will have to keep track of the discriminator combination. The reflector MAY remove the auxiliary TLV from the S-BFD payload, except when required otherwise. See section 4 for exception. </t>

      <t>This is exemplified in Figure 1. </t>

	<figure title="S-BFD Proxy"><artwork align="left">
                     A---------B---------C---------D
                     ^                   ^
                     |                   |
                 System-ID            System-ID
                    xxx                  yyy
                BFD Discrim           BFD Discrim
                    123                  456

        </artwork></figure>		    

      <t>In this example, A is the head end, and has a path all the way to D. But for some reason, an end to end S-BFD session to D is not possible. Instead, A will attempt to have an S-BFD session using C as the proxy reflector. </t>

      <t>A will encode the remaining path corresponding to the last segment, C-D, in the S-BFD packet payload. When C, acting as proxy reflector, receives the packet, it decodes the path information for C-D and inspects the health of that segment, through some means, and responds to A. A will interpret the response as the status of the entire tunnel end-to-end.    
</t>
    </section>   
   <section>
      <name>Packet format</name>
      <t>S-BFD proxy reflector introduces new field in the BFD packet.</t>
      <t></t>
   <figure title="Packet format"><artwork align="left">   
    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
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |Vers |  Diag   |Sta|P|F|C|A|D|M|  Detect Mult  |    Length     |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |                       My Discriminator                        |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |                      Your Discriminator                       |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |                    Desired Min TX Interval                    |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |                   Required Min RX Interval                    |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |                 Required Min Echo RX Interval                 |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |   Auth Type   |   Auth Len    |    Authentication Data...     |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |  Aux Type     | Aux Len       |    Aux  Data…                 |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   </artwork></figure>

	<t>The extra information is carried after the (optional) Auth Type, in the Aux TLVs. </t>

	<t>Since there is no bit available in the 2nd 8-bit header to indicate the existence of this field, we will modify the decoding procedure as the following: if, after decoding to the end of S-BFD packet, including the optional Auth, the length consumed is less than the total Length field in the first word, the remaining bytes will be considered as Aux TLVs. </t>

	<t>There might be multiple auxiliary TLVs from that point on. If at any point, the Aux Len indicates a length bigger than the remaining bytes, the packet will be considered malformed and MUST be discarded. Aux Len must have a minimum value of 2 (in bytes). Packet with Aux Len less than 2 MUST be discarded.</t>

	<t>Otherwise, the Aux Len bytes will be consumed and its interpretation will depend on the Aux Type specification. If somehow the packet end is reached with still remaining length, the packet MUST be discarded.</t>

	<t>The Aux Len denotes the length of the auxiliary path data. The Aux Lens from all auxiliary TLVs  are added to the BFD length field.</t>
	<t>The Aux Type takes 8 bits, with the highest bit as the ‘reflection bit’. </t>

	<t>When the reflection bit is not set, the reflector which supports this specification is required to inspect the content, and reflects the packet accordingly. If the reflector does not recognize this particular type, it MUST drop it without reflecting back. This rule shall trump the next. I.e, if there are multiple Aux TLVs, and a mix of TLVs with reflection bit set and not set, the ‘reflection bit clear’ rule shall take precedence. </t>

	<t>When this bit is set, i.e, for type in ranges of 128-255, it is required to reflect back the packet even without understanding the content of the type and TLV. Inspecting the TLV contents, when the reflector recognizes the type, is optional and reflecting status back is at the discretion of the reflector.</t>

	<t>If authentication is included, then it is still assumed that the authentication is done on the entire packet, including the auxiliary TLV portion.</t>

	<t>For each Aux  Type, there SHOULD be at most one TLV associated with. If more than one is sent, undefined behavior may follow.</t>
	
	<t>The following Aux types are defined:</t>
        <t>Aux Type (8 bit):</t>
        <t>0 reserved </t>
        <t>1 MPLS label stack for purpose of additional check</t>
        <t>2 MPLS label stack for purpose of return path</t>

	<t>When the type is set to 1, it denotes a stack of labels. The labels may or may not have global significance, and its allocation and communication between the S-BFD initiator and S-BFD proxy reflector is outside the scope of this document. Each label will take the entire 32 bit (including TOS, BOS, and TTL field, but these may not be used). The purpose of type 1 is for proxy functionality, that the reflector may check reachability of the label stack</t>

        <t>When the type is set to 2, it again denotes a stack of labels. The labels are encoded the same way as 1. Here the reflector is expected to use the label stack as the return path back to initiator, as versus going over the IP forwarding.</t> 
    </section>
    
   <section>
      <name>S-BFD Proxy Reflector Procedures</name>
      	<t>The reflector, or responder, upon reception of proxy S-BFD Control packets (type 1 above), after verifying the validity of the
packets, will inspect payload and check the health of the remaining path, and respond with the appropriate status. </t>

	<t>If the remaining tunnel path is down, the responder must set the bfd.SessionState to Down. Else it should set to Up. Notice here, when the remaining path is down, the responder should not drop the packet and let the initiator time out. This will help the initiator to detect the failure faster. </t>

	<t>For backward compatibility purposes, we propose to set the bfd.SessionState to Down, as versus AdminDown, as specified in RFC7880.</t>

	<t>In addition it shall also respond to the initiator with a diagnostic code of ‘6 -- Concatenated Path Down‘ in the S-BFD reply. </t>

	<t>The reflector, or responder, upon reception of S-BFD control packets with type 2 above, after verifying the validity of the packets, shall respond with the appropriate status. In addition, it shall encapsulate the packet with the specified label stack, and forward accordingly. The label stack here will represent a potentially traffic engineered path back to the initiator. </t>
   </section>

   <section>
      <name>S-BFD Proxy Initiator Procedures</name>
      <t>Changes to RFC7880 is when an initiator receives a packet with bfd.SessionState to be Down, it should immediately turn the S-BFD state to be Down. </t>
   </section>

   <section>
      <name>SBFDInitiator State Machine</name>
	<t>The following diagram provides the RECOMMENDED state machine for stateful SBFDInitiators. </t>
	<t></t>
	
<figure title="SBFDInitiator Finite State Machine"><artwork align="left">	
        DOWN,       	+--+
      	ADMIN DOWN,     |  |
      	TIMER    	|  V
                 	+------+   UP             +------+
                 	|      |----------------->|      |----+
                 	| DOWN |                  |  UP  |    | UP
                 	|      |&lt;-----------------|      |&lt;---+
                 	+------+  DOWN,ADMIN DOWN,+------+
                            	  TIMER
	
</artwork></figure>
	<t>Note that the above state machine is different from the S-BFD specification <xref target="RFC7880"/>.  This is because the proxy reflector may send a packet with DOWN state.</t>
   </section>

   <section>
      <name>S-BFD Echo Function</name>
      <t>Since the operation outlined here requires cooperation of the reflector, echo mode is not supported for S-BFD proxy. </t>
   </section>

   <section>
      <name>Co-existence with Classical S-BFD Sessions</name>
      <t>It is possible for S-BFD proxy sessions to coexist with regular S-BFD sessions, even between the same initiator-reflector pair. </t>
   </section>

    <section anchor="IANA">
      <name>IANA Considerations</name>
      <t>This memo includes no request to IANA. </t>
    </section>
    
    <section anchor="Security">
      <name>Security Considerations</name>
      <t>The same security considerations as those described in RFC7880 will apply to this document.</t>
    </section>
    
  </middle>

  <back>
    <references>
      <name>References</name>
      <references>
        <name>Normative References</name>

        <xi:include href="https://www.rfc-editor.org/refs/bibxml/reference.RFC.2119.xml"/>
        <xi:include href="https://www.rfc-editor.org/refs/bibxml/reference.RFC.8174.xml"/>
        <xi:include href="https://www.rfc-editor.org/refs/bibxml/reference.RFC.5880.xml"/>
        <xi:include href="https://www.rfc-editor.org/refs/bibxml/reference.RFC.7880.xml"/>
        <xi:include href="https://www.rfc-editor.org/refs/bibxml/reference.RFC.7881.xml"/>
        <xi:include href="https://www.rfc-editor.org/refs/bibxml/reference.RFC.7882.xml"/>
        <xi:include href="https://www.rfc-editor.org/refs/bibxml/reference.RFC.7885.xml"/>
        
      </references>
    </references> 
    <section anchor="Acknowledgements" numbered="false">
      <!-- [REPLACE/DELETE] an Acknowledgements section is optional -->
      <name>Acknowledgements</name>
      <t>The authors of this document would like to thank Joseph Swaminathan, Zhen Xue, Hanchen Zheng, Kelvin Liu and Mamen Xu for the discussion and comments of this document. 
      </t>
    </section> 
 </back>
</rfc>
