<?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"
  docName="draft-li-idr-flowspec-redirect-direct-ip-01"
  ipr="trust200902"
  obsoletes=""
  sortRefs="true"
  consensus="true"
  updates=""
  submissionType="IETF"
  xml:lang="en"
  version="3">
<!-- [REPLACE] 
       * docName with name of your draft
     [CHECK] 
       * category should be one of std, bcp, info, exp, historic
       * ipr should be one of trust200902, noModificationTrust200902, noDerivativesTrust200902, pre5378Trust200902
       * updates can be an RFC number as NNNN
       * obsoletes can be an RFC number as NNNN 
-->

  <front>
    <title abbrev="Flow Specification Direct IP">BGP Flow Specification Redirects to Direct IP</title>
    <!--  [REPLACE/DELETE] abbrev. The abbreviated title is required if the full title is longer than 39 characters -->

    <seriesInfo name="Internet-Draft" value="draft-li-idr-flowspec-redirect-direct-ip-01"/>
   
    <author fullname="Zhenqiang Li" initials="Z" role="editor" surname="Li">
      <!-- [CHECK]
             * initials should not include an initial for the surname
             * role="editor" is optional -->
    <!-- Can have more than one author -->
      
    <!-- all of the following elements are optional -->
      <organization>China Mobile</organization>
      <address>
        <postal>
          <!-- Reorder these if your country does things differently -->
          <street>29 Finance Avenue, Xicheng District</street>
          <city>Beijing</city>
          <country>CN</country>
          <!-- Uses two letter country code -->
        </postal>        
        <email>lizhenqiang@chinamobile.com</email>  
        <!-- Can have more than one <email> element -->
      </address>
    </author>
	<author fullname="Zhiwei An" initials="Z" role="editor" surname="An">
      <!-- [CHECK]
             * initials should not include an initial for the surname
             * role="editor" is optional -->
    <!-- Can have more than one author -->
      
    <!-- all of the following elements are optional -->
      <organization>China Mobile</organization>
      <address>
        <postal>
          <!-- Reorder these if your country does things differently -->
          <street>10 Manbai Road, Changping District</street>
          <city>BeiJing</city>
          <country>CN</country>
          <!-- Uses two letter country code -->
        </postal>
        <email>anzhiwei@chinamobile.com</email>  
        <!-- Can have more than one <email> element -->
        
      </address>
    </author>
    <author fullname="Ziqing Cao" initials="Z" surname="Cao">
      <organization>Huawei</organization>
      <address>
        <postal>
          <street>Huawei Bld., No.156 Beiqing Rd.</street>
          <city>Beijing</city>
          <country>CN</country>
        </postal>
        <email>caoziqing@huawei.com</email>
      </address>
    </author>
   
    <date year="2026"/>
    <!-- On draft subbmission:
         * If only the current year is specified, the current day and month will be used.
         * If the month and year are both specified and are the current ones, the current day will
           be used
         * If the year is not the current one, it is necessary to specify at least a month and day="1" will be used.
    -->

    <area>Routing</area>
    <workgroup>Inter-Domain Routing</workgroup>
    <!-- "Internet Engineering Task Force" is fine for individual submissions.  If this element is 
          not present, the default is "Network Working Group", which is used by the RFC Editor as 
          a nod to the history of the RFC Series. -->

    <keyword>BGP</keyword>
    <keyword>Flow Specification</keyword>
    <keyword>Redirect</keyword>
	<keyword>Direct IP</keyword>
    <!-- [REPLACE/DELETE]. Multiple allowed.  Keywords are incorporated into HTML output files for 
         use by search engines. -->

    <abstract>
      <t>A bit, D bit, is defined in the Flow-spec Redirect-to-IPv4 Extended Community, which is used by BGP Flow Specification to indicate that the associated Flow Specification policy be set to an invalid state when the directly connected link associated with the redirect target address becomes unavailable.</t>
    </abstract>
 
  </front>

  <middle>
    
    <section anchor="intro">
      <name>Introduction</name>
      <t>BGP Flow Specification, as specified in <xref target="RFC8955"/> and <xref target="RFC8956"/>, is widely used for traffic steering, traffic rate limiting, and other traffic-control purposes. <xref target="I-D.ietf-idr-flowspec-redirect-ip"/> defines the BGP Flow Specification Redirect-to-IP action, which enables Flow Specification to redirect traffic to an IP address.</t>
      <t><xref target="I-D.ietf-idr-flowspec-redirect-ip"/> specifies that the BGP speaker is expected to do a longest-prefix-match lookup of the "target address" in the database it uses to resolve next-hop addresses and then forward the redirected packets based on the resulting route, referred to as the "target route". In some cases, this mechanism can prevent a network element from promptly setting the corresponding BGP Flow Specification policy to an invalid state. This not only wastes resources on the network element and in the network, but may also cause a traffic forwarding loop, preventing traffic from reaching its destination and causing service interruption. The specific scenarios are described in the next section.</t>
      <t>This document extends the Flow-spec Redirect-to-IPv4 Extended Community defined in <xref target="I-D.ietf-idr-flowspec-redirect-ip"/> by defining a new directly connected link indication bit, called the D bit. The D bit uses the previously undefined bit 14 in the Local Administrator field. An SDN controller sets the D bit to 1 when it sends a BGP Flow Specification policy that redirects traffic to the peer interface address of a directly connected link and requires the receiving network element to set the corresponding policy to an invalid state if that link becomes unavailable.</t>
      <t>How a network element detects the failure of a directly connected link is implementation specific and is not specified in this document. Possible mechanisms include, but are not limited to, Bidirectional Forwarding Detection (BFD) <xref target="RFC5880"/>, ARP-based neighbor reachability checks <xref target="RFC826"/>, and Link Aggregation Control Protocol (LACP) state monitoring <xref target="IEEE8021AX"/>.</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>Scenarios to Be Addressed</name>
      <t>The figures in this section use solid lines ("---") for physical links, asterisks ("***") for the logical BGP connection between the SDN controller and Router 1, and lines with arrowheads ("===>") for the direction of the traffic being discussed. The number associated with each physical link is both its IGP metric and, except for Link A, its delay in milliseconds. Link A has an IGP metric of 100 and a delay of 1 millisecond.</t>
      <section>
        <name>Scenario 1</name>
        <t>As shown in <xref target="fig-scenario-1"/>, Network 2 uses the prefix 198.51.100.0/24. Interface Address 1 and Interface Address 2 are 192.0.2.1 and 192.0.2.2, respectively, on Link A. The numbers shown on the links are their IGP metrics and, except for Link A, also represent their delays in milliseconds. Link A has an IGP metric of 100 and a delay of 1 millisecond.</t>
        <t>Under normal destination-based forwarding, the path from Router 1 to Router 4 through Router 3 has a total IGP metric of 20, while the path through Router 2 has a total IGP metric of 30. Therefore, traffic from Network 1 to Network 2 is forwarded by Router 1 over Link B to Router 3, by Router 3 over Link C to Router 4, and then by Router 4 to Network 2.</t>
        <t>For traffic that requires a lower-delay path, the SDN controller generates a BGP Flow Specification route that matches packets with a destination in 198.51.100.0/24 and carries a Redirect-to-IPv4 action with the target address 192.0.2.2. The SDN controller sends this route to Router 1. After installing the corresponding policy, Router 1 redirects matching traffic over Link A to Router 4, which then forwards the traffic to Network 2.</t>
        <figure>
          <name>Redirected Traffic after Failure of the Direct Link</name>
          <artwork anchor="fig-scenario-1"><![CDATA[
              +----------------+
              | SDN Controller |
              +----------------+
                       *
                       * BGP Flow Specification
                       *
                       v
                              +----------+
                              | Router 2 |
                              +----------+
                          15 /            \ 15
                 Link D     /              \     Link E
                           /                \
   +----+         +----------+   X     +----------+         +----+
   | N1 |---------| Router 1 |---------| Router 4 |---------| N2 |
   +----+         +----------+ Link A  +----------+         +----+
                          \    metric 100    /
                   Link B  \   (FAILED)     / Link C
                       10   \              /   10
                             \            /
                              +----------+
                              | Router 3 |
                              +----------+

     After Link A fails while the Flow Specification policy remains active:
       R1 ===> R3 ===> R4
          ]]></artwork>
        </figure>
        <t>While Link A is available, Router 1 has a connected route to the redirect target address 192.0.2.2 and sends the matching traffic directly to Router 4 over Link A. The redirected traffic therefore uses the 1-millisecond link instead of the normal 20-millisecond path through Links B and C.</t>
        <t>When Link A fails, Router 1 removes the connected route to 192.0.2.2. However, the redirect target address may remain reachable through another route, such as an aggregate route or a default route whose forwarding path uses Links B and C. Under the procedures in <xref target="I-D.ietf-idr-flowspec-redirect-ip"/>, Router 1 therefore retains the BGP Flow Specification policy and redirects the matching traffic over Link B to Router 3. Router 3 then forwards the traffic over Link C to Router 4, which forwards it to Network 2.</t>
        <t>Retaining the BGP Flow Specification policy after Link A fails is unnecessary in this scenario. Without the policy, Router 1 would use the same destination-based path through Router 3 and Router 4. Moreover, the redirected traffic no longer uses the intended low-delay Link A and may no longer satisfy its delay requirement.</t>
      
      </section>
      <section>
        <name>Scenario 2</name>
        <t>As shown in <xref target="fig-scenario-2"/>, Network 2 uses the prefix 198.51.100.0/24 and connects only to Router 2. S4 is a traffic scrubbing system, rather than an ordinary router. Router 1 connects to S4 over Link A, with interface addresses 192.0.2.1 and 192.0.2.2, respectively. Router 3 connects to Router 1 over Link B and to S4 over Link C. Router 1 reaches Network 2 through Router 2 over Link D, and Router 3's destination-based route to Network 2 uses Router 1 as its next hop.</t>
        <t>The SDN controller installs a BGP Flow Specification policy on Router 1 that matches packets destined to 198.51.100.0/24 and redirects them to S4's interface address 192.0.2.2. While Link A is available, Router 1 sends matching traffic directly to S4 for scrubbing. S4 reinjects the cleaned traffic toward Router 2 and Network 2 through a separate forwarding path that avoids reapplying Router 1's redirect policy. The clean-traffic reinjection path is omitted from the figure.</t>
        <figure anchor="fig-scenario-2">
          <name>Forwarding Loop after Failure of the Direct Link to S4</name>
          <artwork type="ascii-art"><![CDATA[
              +----------------+
              | SDN Controller |
              +----------------+
                       *
                       * BGP Flow Specification
                       *
                       v
                              +----------+         +----+
                              | Router 2 |---------| N2 |
                              +----------+         +----+
                          15 /
                 Link D     /
                           /
   +----+         +----------+   X     +----------+
   | N1 |---------| Router 1 |---------|    S4    |
   +----+         +----------+ Link A  +----------+
                          \   metric 100    /
                   Link B  \   (FAILED)    / Link C
                       10   \             /   10
                             \           /
                              +----------+
                              | Router 3 |
                              +----------+

   S4: traffic scrubbing system
   Clean-traffic reinjection path omitted.

   Forwarding loop over Link B after Link A fails:
     R1 === redirect-target lookup ===> R3
     R1 <== destination lookup (N2) === R3
          ]]></artwork>
        </figure>
        <t>When Link A fails, Router 1 removes the connected route to 192.0.2.2. In this example, an aggregate or default route still resolves the redirect target through Router 3 over Link B. Router 1 therefore retains the BGP Flow Specification policy and sends matching traffic destined to Network 2 to Router 3.</t>
        <t>The redirected packets in this example retain their original destination addresses and are not encapsulated in a tunnel to S4. After receiving a packet, Router 3 performs normal destination-based forwarding toward Network 2. Its route to Network 2 uses Router 1 as the next hop, so it sends the packet back to Router 1 over Link B. Router 3 does not need a BGP Flow Specification policy to cause this return path.</t>
        <t>When Router 1 receives the packet again, it matches the same BGP Flow Specification policy and redirects it toward S4 through Router 3. The packet consequently loops between Router 1 and Router 3 until its TTL expires. The loop consumes forwarding resources, and the packet is discarded without reaching Network 2, resulting in service interruption.</t>
        
      </section>
    </section>

    <section anchor="d-bit">
      <name>D Bit for Flow-spec Redirect-to-IPv4</name>
      <t>This document extends the Flow-spec Redirect-to-IPv4 Extended Community defined in <xref target="I-D.ietf-idr-flowspec-redirect-ip"/> by defining a new directly connected link indication bit, called the D bit. The D bit is used to instruct a receiving network element to set the corresponding BGP Flow Specification policy that redirects traffic to an IP address to an invalid state when the directly connected link associated with that address becomes unavailable.</t>
      <t>The D bit is encoded using the previously undefined bit 14 in the Local Administrator field of the Flow-spec Redirect-to-IPv4 Extended Community, as shown in <xref target="fig-d-bit"/>.</t>
      <figure anchor="fig-d-bit" align="center">
        <name>Format of the D Bit in the Local Administrator Field</name>
        <artwork align="center"><![CDATA[
       0                   1
       0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |          Reserved         |D|C|
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
        ]]></artwork>
      </figure>
      <t>Where:</t>
      <t>D bit: The directly connected link indication bit. When a BGP Flow Specification policy is configured to redirect traffic to an IP address and the D bit is set to 1, the receiving network element sets the corresponding BGP Flow Specification policy to an invalid state if the directly connected link associated with that IP address becomes unavailable. When the directly connected link recovers, the network element sets the policy back to a valid state.</t>
      <t>When the D bit is set to 0, the processing behavior of the Redirect-to-IPv4 action is unchanged. If the directly connected link associated with the redirect target address becomes unavailable but the network element still has a route to that IP address, the corresponding BGP Flow Specification policy is not set to an invalid state and remains valid.</t>
      
    </section>


    <section anchor="behavior">
      <name>Behavior</name>
      <t>When an SDN controller intends matching traffic to be redirected to the peer interface address of a directly connected link, it originates a BGP Flow Specification route with the Redirect-to-IP action defined in <xref target="I-D.ietf-idr-flowspec-redirect-ip"/>. The SDN controller sets the D bit when the redirect action is required to remain valid only while that directly connected link is available.</t>
      <t>After receiving the BGP Flow Specification route and completing the applicable validation procedures, a network element that supports the D bit associates the redirect target address with the directly connected link used to reach that address. The method used to determine the operational state of the link is implementation specific, as discussed in <xref target="intro"/>.</t>
      <t>When the D bit is set and the associated directly connected link becomes unavailable, the network element sets the corresponding BGP Flow Specification policy to an invalid state and stops applying its Redirect-to-IP action. The network element does not keep that policy active by resolving the redirect target through a less-specific aggregate route or a default route. Matching packets are then processed by any other applicable policy or, if no such policy applies, by normal destination-based forwarding. This behavior prevents the unintended detour described in Scenario 1 and the forwarding loop described in Scenario 2.</t>
      <t>When the associated directly connected link becomes available again, the network element re-evaluates the policy. If the redirect target is again reachable over that directly connected link and the BGP Flow Specification route remains otherwise valid, the network element sets the policy back to a valid state and resumes applying the Redirect-to-IP action. No new advertisement from the SDN controller is required solely because the link state changes.</t>
      <t>When the D bit is not set, the procedures specified in <xref target="I-D.ietf-idr-flowspec-redirect-ip"/> are unchanged.</t>
    </section>


    <section anchor="backward-compatibility">
      <name>Deployment Considerations</name>
      <t>This extension supports incremental deployment. Existing BGP Flow Specification policies without the D bit retain the Redirect-to-IPv4 processing specified in <xref target="I-D.ietf-idr-flowspec-redirect-ip"/>. Introducing support for the D bit does not, by itself, change the behavior of those policies.</t>
      <t>A receiver that supports this extension MUST follow the behaviors specified in this document.</t>
      <t>A receiver that supports Redirect-to-IPv4 but not this extension MUST ignore the D bit and continue processing the policy, in accordance with the reserved-bit processing rules defined in <xref target="I-D.ietf-idr-flowspec-redirect-ip"/>. The receiver MUST NOT discard the extended community or the Flow Specification route solely because the D bit is set.</t>
      <t>Consequently, the direct-link protection described in this document applies only to policies with the D bit set to 1 on supporting receivers. Policies with D set to 0, and policies on receivers that ignore D, may still exhibit the failure behavior described in the scenarios. Previously advertised policies require an update with D set to 1 to obtain this protection on supporting receivers.</t>
    </section>
    
    <section anchor="IANA">
      <name>IANA Considerations</name>
      <t>This document defines the D bit at bit position 14
      in the Local Administrator field of the existing
      Flow-spec Redirect-to-IPv4 Extended Community.</t>

      <t>IANA is requested to add this document as an additional
      reference for the "Flow-spec Redirect-to-IPv4" entry
      in the "Transitive IPv4-Address-Specific Extended Community
      Sub-Types" registry
      <xref target="IANA_bgp_extended_communities_trans_ipv4"/>.</t>
    </section>
    
    <section anchor="Security">
      <!-- All drafts are required to have a security considerations section. See RFC 3552 for a guide. -->
      <name>Security Considerations</name>
      <t>The security considerations discussed in <xref target="I-D.ietf-idr-flowspec-redirect-ip"/> also apply to this document.</t>
    </section>
    
  </middle>

  <back>
    <references>
      <name>References</name>
      <references>
        <name>Normative References</name>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml"/>
		<xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8174.xml"/>		
		<reference anchor="I-D.ietf-idr-flowspec-redirect-ip" target="https://datatracker.ietf.org/doc/html/draft-ietf-idr-flowspec-redirect-ip-16">
          <front>
            <title>BGP Flow-Spec Redirect-to-IP Action</title>
            <author initials="J." surname="Haas" fullname="Jeffrey Haas"/>
            <author initials="W." surname="Henderickx" fullname="Wim Henderickx"/>
            <author initials="W.A." surname="Simpson" fullname="William Allen Simpson"/>
            <date year="2026" month="May" day="21"/>
          </front>
          <seriesInfo name="Internet-Draft" value="draft-ietf-idr-flowspec-redirect-ip-16"/>
        </reference>
		<reference anchor="IANA_bgp_extended_communities_trans_ipv4" target="https://www.iana.org/assignments/bgp-extended-communities">
		  <front>
		    <title>Transitive IPv4-Address-Specific Extended Community Sub-Types</title>
		    <author>
		      <organization>IANA</organization>
		    </author>
		  </front>
		</reference>
      </references>
	  
	  <references>
        <name>Informative References</name>
		<xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.826.xml"/>
		<xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.5880.xml"/>
		<reference anchor="IEEE8021AX" target="https://standards.ieee.org/standard/802_1AX-2020.html">
		  <front>
		    <title>IEEE Standard for Local and Metropolitan Area Networks--Link Aggregation</title>
		    <author>
		      <organization>IEEE</organization>
		    </author>
		    <date month="May" year="2020"/>
		  </front>
		  <seriesInfo name="IEEE Std" value="802.1AX-2020"/>
		</reference>
		<xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8955.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8956.xml"/>
      </references>

    </references>
    


    <section anchor="Acknowledgements" numbered="false">
      <!-- [REPLACE/DELETE] an Acknowledgements section is optional -->
      <name>Acknowledgements</name>
      <t>TBD.</t>
	</section>
    
 </back>
</rfc>

