<?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-ding-idr-rtc-for-bgp-flow-sr-01"
     ipr="trust200902">
  <front>
    <title abbrev="RTC for BGP Flowspec &amp; SR-Policy">Route Target
    Constraint for BGP Flow Spec(BGP Flow) and BGP Segment Routing
    Policies(BGP SR-Policy)</title>

    <author fullname="Xiangfeng Ding" initials="X." surname="Ding">
      <organization>Huawei Technologies</organization>

      <address>
        <postal>
          <street>No. 156 Beiqing Road</street>

          <city>Beijing</city>

          <region/>

          <code>100095</code>

          <country>P.R. China</country>
        </postal>

        <phone/>

        <facsimile/>

        <email>dingxiangfeng@huawei.com</email>

        <uri/>
      </address>
    </author>

    <author fullname="Zhen Tan" initials="Z." surname="Tan">
      <organization>Huawei Technologies</organization>

      <address>
        <postal>
          <street>No. 156 Beiqing Road</street>

          <city>Beijing</city>

          <region/>

          <code>100095</code>

          <country>P.R. China</country>
        </postal>

        <phone/>

        <facsimile/>

        <email>tanzhen6@huawei.com</email>

        <uri/>
      </address>
    </author>

    <author fullname="Lili Wang" initials="L." surname="Wang">
      <organization>Huawei Technologies</organization>

      <address>
        <postal>
          <street>No. 156 Beiqing Road</street>

          <city>Beijing</city>

          <region/>

          <code>100095</code>

          <country>P.R. China</country>
        </postal>

        <phone/>

        <facsimile/>

        <email>lily.wong@huawei.com</email>

        <uri/>
      </address>
    </author>

    <date day="23" month="December" year="2025"/>

    <workgroup>IDR Working Group</workgroup>

    <abstract>
      <t>This document specifies an extension to the application scenarios of
      Route Target Constraints (RTC). By using the Global Administrator field
      of the IPv4 Address Specific Extended Community to identify a network
      node and exchanging BGP Route-Target routes, a BGP speaker can generate
	  an egress policy for filtering routing updates associated with specific
	  network nodes,which could implement precise control and distribution of
	  services such as BGP Flow Specification and BGP Segment Routing Policies.
	  </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><xref target="RFC4271">BGP</xref> has been used to distribute
      different types of routing and policy information. In some scenarios,
      the distributed routing information is specific for certain services,
      such as BGP/MPLS IP VPNs.</t>

      <t><xref target="RFC4684">Route Target Constraints (RTC)</xref>, extends
      Outbound Route Filtering (ORF), describes how route targets are
      exchanged through the BGP RTC address family on a BGP/MPLS IP VPN
      network to generate egress policies. This feature enables the BGP/MPLS
      IP VPN network to control the advertisement of VPN routing information
      in a more refined manner.</t>

      <t>This document introduces an extension to the application scenarios of
      <xref target="RFC4684">Route Target Constraints (RTC)</xref> to control
      the distribution of routing information to one or a group of network
      nodes, which could implement precise control of services such as <xref
      target="RFC8955">BGP Flow Spec</xref> and <xref
      target="I-D.ietf-idr-segment-routing-te-policy">BGP Segment Routing
      Policies</xref>.</t>

      <section title="Terminology">
        <t>This document introduces the following terms:</t>

        <t><list style="hanging">
            <t hangText="RTC">Route Target Constraints [RFC 4684]</t>

            <t hangText="ORF">Outbound Route Filtering</t>

            <t hangText="Flowspec">BGP Flow Specification</t>

            <t hangText="SR-Policy">BGP Segment Routing Policy</t>

            <t hangText="NLRI">Network Layer Reachability Information</t>
          </list></t>
      </section>
    </section>

    <section title="Route Target Membership NLRI Advertisements">
      <t>The encapsulation of Route Target membership NLRI is defined in <xref
      target="RFC4684">Route Target Constraints (RTC)</xref>, the NLRI is
      advertised in BGP UPDATE messages using the MP_REACH_NLRI and
      MP_UNREACH_NLRI attributes. The (AFI, SAFI) value pair used to identify
      this NLRI is (AFI=1, SAFI=132).</t>

      <t>The route-target field in the NLRI indicates a network node and is
      encoded as a <xref target="RFC4360">IPv4 Address Specific Extended
      Community</xref>, as shown blow:</t>

      <t><figure title="Route Target membership NLRI Format">
          <artwork align="center"><![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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                           origin as                           |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| 0x01 or 0x41  |   Sub-Type    |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                      Global Administrator                     |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|    Local Administrator        |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
]]></artwork>
        </figure>While encoding these fields:</t>

      <t><list style="symbols">
          <t>Global Administrator: 4 octets, indicates the router identifier
          of the node. If the Global Administrator is set to 0.0.0.0, it means
          that the peer node accepts all policy rules from the RR.</t>

          <t>Local Administrator: 2 octets, reserved for future use, MUST be
          set to 0 upon the sender and MUST be ignored upon the receiver.</t>
        </list></t>

      <t/>
    </section>

    <section title="Use case">
      <t>This section describes a few use-case scenarios.</t>

      <t/>

      <section title="BGP Flow Spec ORF">
        <t><figure title="BGP Flow Spec ORF">
            <artwork align="center"><![CDATA[ +----------------------------------------------+
 |              +----------+                    |
 |              |Controller|                    |
 |              +----------+                    |
 |                 |                            |
 |                 |                            |
 |                 +---------+                  |
 |                 |         |                  |
 |                 |   RR    |                  |
 |                 |         |                  |
 |                 +---------+                  |
 |                /           \                 |
 |               /             \                |
 |   +---------+                +---------+     |
 |   |   PE1   |                |   PE2   |     |
 |   +---------+                +---------+     |
 |   Flow speaker 1             Flow speaker 2  |
 |   rt-id 1.1.1.1              rt-id 2.2.2.2   |
 |                    AS 100                    |
 +----------------------------------------------+
]]></artwork>
          </figure>In the topology above, the Controller, PE1, and PE2
        establish IBGP peer relationships with the RR respectively. PE1 and
        PE2 are clients of the RR. The Controller distributes Flowspec rules
        through the RR, and the RR reflects the Flowspec rules to PE1 and
        PE2.</t>

        <t>PE1 sends route target membership NLRI{100, 1.1.1.1:0} to the RR,
        and PE2 sends route target membership NLRI{100, 2.2.2.2:0} to the RR.
        After receiveing the UPDATE messages with Route Target Membership
        NLRI, the RR will trigger the RIB-OUTS of the Flowspec route to match
        the egress policies and update the route to PEs.</t>

        <t>If hierarchical RRs are deployed, the RRs need to advertise all
        received route target membership NLRI routes to the upper-layer
        RRs.</t>
      </section>

      <section title="BGP Segment Routing Policies ORF">
        <t><figure title="BGP Segment Routing Policies ORF">
            <artwork align="center"><![CDATA[ +----------------------------------------------+
 |              +----------+                    |
 |              |Controller|                    |
 |              +----------+                    |
 |                 |                            |
 |                 |                            |
 |                 +---------+                  |
 |                 |         |                  |
 |                 |   RR    |                  |
 |                 |         |                  |
 |                 +---------+                  |
 |                /           \                 |
 |               /             \                |
 |   +---------+                +---------+     |
 |   |   PE1   |                |   PE2   |     |
 |   +---------+                +---------+     |
 |   Policy 1                   Policy 2        |
 |   rt-id 1.1.1.1              rt-id 2.2.2.2   |
 |                    AS 100                    |
 +----------------------------------------------+
]]></artwork>
          </figure>It is described in <xref
        target="I-D.ietf-idr-segment-routing-te-policy">BGP Segment Routing
        Policies</xref> that one or more route targets SHOULD be attached to
        the advertisement, where each route target identifies one or more
        intended headends for the advertised SR Policy update. In the topology
        above, when the controller needs to deliver SR policies to PE1 and
        PE2, it will advertises SR policies with route target extended
        communities, SR Policy1 with {1.1.1.1:0} and SR Policy2 with
        {2.2.2.2:0}, to RR. The RR will reflect SR Policies to both PE1 and
        PE2. PEs need to do an ingress filtering, by matching route target
        extended community with its own router-id. In this case, PE1 will keep
        SR Policy1 and drop SR Policy2, as well as PE2 will keep SR Policy2
        and drop SR Policy1. During this process, even though SR policies are
        correctly provisioned, the RR advertises all routes to all peers,
        which may cause network congestion.</t>

        <t>The ORF operations described in this document work as an egress
        filter on RR. PE1 sends route target membership NLRI{100, 1.1.1.1:0}
        to the RR, and PE2 sends route target membership NLRI{100, 2.2.2.2:0}
        to the RR. After receiving the Route Target Membership NLRI from the
        PE, the RR generates a PE-specific egress filter. Before advertising
        routes to PEs, the RR matches routes with egress policies, and will
        only deliver SR policy1 to PE1 and SR policy1 to PE2 respectively. In
        this way, services could be correctly deployed and network bandwidth
        could be saved.</t>
      </section>
    </section>

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

    <section anchor="Security" title="Security Considerations">
      <t>TBD</t>
    </section>
  </middle>

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

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

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

    <references title="References">
      <?rfc include="reference.RFC.4271"?>

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

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