<?xml version="1.0" encoding="US-ASCII"?>
<!-- This template is for creating an Internet Draft using xml2rfc,
    which is available here: http://xml.resource.org. -->
<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
<!-- One method to get references from the online citation libraries.
    There has to be one entity for each item to be referenced. 
    An alternate method (rfc include) is described in the references. -->

]>
<?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>
<!-- used by XSLT processors -->
<!-- For a complete list and description of processing instructions (PIs), 
    please see http://xml.resource.org/authoring/README.html. -->
<!-- Below are generally applicable Processing Instructions (PIs) that most I-Ds might want to use.
    (Here they are set differently than their defaults in xml2rfc v1.32) -->
<?rfc strict="yes" ?>
<!-- give errors regarding ID-nits and DTD validation -->
<!-- control the table of contents (ToC) -->
<?rfc toc="yes"?>
<!-- generate a ToC -->
<?rfc tocdepth="4"?>
<!-- the number of levels of subsections in ToC. default: 3 -->
<!-- control references -->
<?rfc symrefs="yes"?>
<!-- use symbolic references tags, i.e, [RFC2119] instead of [1] -->
<?rfc sortrefs="yes" ?>
<!-- sort the reference entries alphabetically -->
<!-- control vertical white space 
    (using these PIs as follows is recommended by the RFC Editor) -->
<?rfc compact="yes" ?>
<!-- do not start each main section on a new page -->
<?rfc subcompact="no" ?>
<!-- keep one blank line between list items -->
<!-- end of list of popular I-D processing instructions -->
<rfc category="std" docName="draft-ietf-idr-bgp-flowspec-oid-13" ipr="trust200902" updates="8955">
 <!-- category values: std, bcp, info, exp, and historic
    ipr values: trust200902, noModificationTrust200902, noDerivativesTrust200902,
       or pre5378Trust200902
    you can add the attributes updates="NNNN" and obsoletes="NNNN" 
    they will automatically be output with "(if approved)" -->

 <!-- ***** FRONT MATTER ***** -->

 <front>
   <!-- The abbreviated title is used in the page header - it is only necessary if the 
        full title is longer than 39 characters -->

   <title abbrev="Revised Flowspec Validation Procedure">Revised Validation Procedure for BGP Flow Specifications</title>

   <!-- add 'role="editor"' below for the editors if appropriate -->

   <!-- Another author who claims to be an editor -->

   <author fullname="James Uttaro" initials="J.U." surname="Uttaro">
     <organization>AT&amp;T</organization>

     <address>
       <postal>
         <street>200 S. Laurel Ave</street>

         <!-- Reorder these if your country does things differently -->

         <city>Middletown</city>

         <region>NJ</region>

         <code>07748</code>

         <country>USA</country>
       </postal>

       <email>ju1738@att.com</email>

       <!-- uri and facsimile elements may also be added -->
     </address>
   </author>

   <author fullname="Juan Alcaide" initials="J.A." surname="Alcaide">
     <organization>Cisco</organization>

     <address>
       <postal>
         <street>7100 Kit Creek Road</street>

         <!-- Reorder these if your country does things differently -->

         <city>Research Triangle Park</city>

         <region>NC</region>

         <code>27709</code>

         <country>USA</country>
       </postal>

       <email>jalcaide@cisco.com</email>

       <!-- uri and facsimile elements may also be added -->
     </address>
   </author>

   <author fullname="Clarence Filsfils" initials="C.F." surname="Filsfils">
     <organization>Cisco</organization>

     <address>
       <email>cf@cisco.com</email>

       <!-- uri and facsimile elements may also be added -->
     </address>
   </author>

   <author fullname="David Smith" initials="D.S." surname="Smith">
     <organization>Cisco</organization>

     <address>
       <postal>
         <street>111 Wood Ave South</street>

         <!-- Reorder these if your country does things differently -->

         <city>Iselin</city>

         <region>NJ</region>

         <code>08830</code>

         <country>USA</country>
       </postal>

       <email>djsmith@cisco.com</email>

       <!-- uri and facsimile elements may also be added -->
     </address>
   </author>

   <author fullname="Pradosh Mohapatra" initials="P.M." surname="Mohapatra">
     <organization>Sproute Networks</organization>

     <address>
       <email>mpradosh@yahoo.com</email>

       <!-- uri and facsimile elements may also be added -->
     </address>
   </author>

   <date year="2021" />

   <!-- If the month and year are both specified and are the current ones, xml2rfc will fill 
        in the current day for you. If only the current year is specified, xml2rfc will fill 
	 in the current day and month for you. If the year is not the current one, it is 
	 necessary to specify at least a month (xml2rfc assumes day="1" if not specified for the 
	 purpose of calculating the expiry date).  With drafts it is normally sufficient to 
	 specify just the year. -->

   <!-- Meta-data Declarations -->

   <area>General</area>

   <workgroup>Network Working Group</workgroup>

   <!-- WG name at the upperleft corner of the doc,
        IETF 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 IETF. -->

   <keyword>BGP flowspec</keyword>

   <!-- Keywords will be incorporated into HTML output
        files in a meta tag but they have no effect on text or nroff
        output. If you submit your draft to the RFC Editor, the
        keywords will be used for the search engine. -->

   <abstract>
     <t>
   This document describes a modification to the validation procedure
   defined for the dissemination of BGP Flow Specifications.  The
   dissemination of BGP Flow Specifications requires that the originator
   of the Flow Specification matches the originator of the best-match
   unicast route for the destination prefix embedded in the Flow
   Specification. For an iBGP received route, the originator is typically
   a border router within the same autonomous system.  The
   objective is to allow only BGP speakers within the data forwarding
   path to originate BGP Flow Specifications.  Sometimes it is desirable
   to originate the BGP Flow Specification any place within the
   autonomous system itself, for example, from a centralized BGP route
   controller.  However, the validation procedure will fail in this
   scenario.  The modification proposed herein relaxes the validation
   rule to enable Flow Specifications to be originated within the same
   autonomous system as the BGP speaker performing the validation.
   Additionally, this document revises AS_PATH validation rules so Flow
   Specifications received from an eBGP peer can be validated when such
   peer is a BGP route server.

	 </t>
	 <t>
	 This document updates the validation procedure in RFC8955.
	 </t>
   </abstract>
 </front>

 <middle>
   <section title="Requirements Language">
	<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 [RFC2119] [RFC8174] when, and only when, they
      appear in all capitals, as shown here.
	</t>
   </section>
   <section title="Introduction">
	 <t>
	 [RFC8955] defines a BGP NLRI [RFC4271] that can be used to distribute
     traffic Flow Specifications amongst BGP speakers in support of traffic
     filtering. The primary intention of [RFC8955] is to 
	 enable downstream autonomous systems to signal traffic filtering policies 
	 to upstream autonomous systems.  In this way, traffic is filtered closer
	 to the source and the upstream autonomous system(s) avoid carrying the traffic 
	 to the downstream autonomous system only to be discarded. 
	 [RFC8955] also enables more granular traffic filtering based upon 
	 upper layer protocol information (e.g., protocol port numbers) as 
	 opposed to coarse IP destination prefix-based filtering. 
	  Flow specification NLRIs received from a BGP peer are subject to validity 
	  checks before being considered feasible and subsequently installed within the respective Adj-RIB-In. 
	  </t>
	  <t>
	  The validation procedure defined within [RFC8955] requires that the
   originator of the Flow Specification NLRI matches the originator of
   the best-match unicast route for the destination prefix embedded in
   the Flow Specification.  The aim is making sure that only speakers on the forwarding path can originate the Flow Specification.
   Let's consider the particular case where the Flow Specification is originated in any location within the same autonomous system 
   than the speaker performing the validation (for example by a centralized BGP route controller),
   and the best-match unicast route is originated in another autonomous system. 
   In order for validation to succeed for a Flow Specification received from an iBGP peer, it could be possible to
   disseminate such Flow Specification NLRIs directly from the specific border
   router (within the local autonomous system) that is advertising the corresponding best-match unicast route to the local autonomous system. 
   This approach would be, however, operationally cumbersome in an autonomous system
   with a large number of border routers having complex BGP policies.
	  </t>
	  <t>
	   Figure 1 illustrates this principle.  R1 (the upstream router) and RR need to validate the Flow
	   Specification whose embedded destination prefix has a best-match
	   unicast route (dest-route) originated by ASBR2.  ASBR2 could
	   originate the Flow Specification, and it would be validated when received by RR and R1.
	   Sometimes the Flow Specification needs to be originated
	   on AS1.  ASBR1 could originate it, and Flow Specification would
	   still be validated.  In both cases, the Flow Specification is originated by a
	   router in the same forwarding path as the dest-route.  For the case
	   where AS1 has thousands of ASBRs, it becomes impractical to originate
	   different rules on each ASBR in AS1 based on which ASBR each dest-
	   route is learned from.  The objective is to advertise all the Flow
	   Specifications from the same route-controller.
     </t>
	 <t>
	 <?rfc needLines="37" ?>
     <figure align="center" anchor="fig_1">
       <artwork align="left"><![CDATA[
        R1(AS1) --- RR(AS1) --- ASBR1(AS1) --- ASBR2(AS2)
                     |
             route-controller(AS1)
	 ]]></artwork>
     </figure>
	  </t>
	  <t> This document describes a modification to the [RFC8955] validation 
	  procedure allowing Flow Specification NLRIs to be originated from a 
	  centralized BGP route controller within the local autonomous system 
	  that is not in the data forwarding path.  While the proposed modification
	  cannot be used for inter-domain coordination of traffic filtering, 
	  it greatly simplifies distribution of intra-domain traffic 
	  filtering policies within an autonomous system which has a large number 
	  of border routers having complex BGP policies. 
	  By relaxing the validation procedure for iBGP, the proposed modification 
	  allows Flow Specifications to be distributed in a standard and 
	  scalable manner throughout an autonomous system.
	  </t>
   </section>
   <section title="Motivation">
     <t>Step (b) of the validation procedure in [RFC8955], section 6 is defined with the underlying 
	 assumption that the Flow Specification NLRI traverses the same path, in the inter-domain and intra-domain 
	 route distribution graph, as that of the longest-match unicast route for the destination prefix 
	 embedded in the Flow Specification.
	 </t>
	 <t>
     In the case of inter-domain traffic filtering, the Flow Specification originator 
     at the egress border routers of an AS (e.g. RTR-D and RTR-E of AS1 in Figure 2) matches 
	 the eBGP neighbor that advertised the longest match destination prefix 
	 (see RTR-F and RTR-G respectively in Figure 2).
	 </t>
	 <t>
	 Similarly, at the upstream routers of an AS
	 (see RTR-A and RTR-B of AS1 in Figure 2), the Flow Specification originator matches 
	 the egress iBGP border routers that had advertised the unicast route 
	 for the best-match destination prefix (see RTR-D and RTR-E respectively in Figure 2). 
	 This is true even when upstream routers select paths from different 
	 egress border routers as best route based upon IGP distance.
     For example, in Figure 2: 
	 <list> 
	 <t>RTR-A chooses RTR-D as the best route
	 </t>
	 <t>RTR-B chooses RTR-E as the best route
	 </t>
	 </list>
	 </t>
	 <t>
     <?rfc needLines="37" ?>
     <figure align="center" anchor="fig_2">
       <artwork align="left"><![CDATA[
                  / - - - - - - - - - - - - -  -
                  |            AS1              |
                    +-------+        +-------+
                  | |       |        |       |  |
                    | RTR-A |        | RTR-B |
                  | |       |        |       |  |
                    +-------+        +-------+
                  |       \           /         |
                     iBGP  \         / iBGP
                  |         \       /           |
                            +-------+
                  |         |       |           |
                            | RTR-C |
                  |         |  RC   |           |
                            +-------+
                  |           /   \             |
                             /     \
                  |   iBGP  /       \ iBGP      |
                    +-------+        +-------+
                  | | RTR-D |        | RTR-E |  |
                    |       |        |       |
                  | |       |        |       |  |
                    +-------+        +-------+
                  |     |                 |     |
                   - - -|- - - - - - - - -|- - -/
                        | eBGP       eBGP |
                   - - -|- - - - - - - - -|- - -/
                  |     |                 |     |
                    +-------+        +-------+
                  | |       |        |       |  |
                    | RTR-F |        | RTR-G |
                  | |       |        |       |  |
                    +-------+        +-------+
                  |            AS2              |
                  / - - - - - - - - - - - - -  -
	 ]]></artwork>
     </figure>
   </t>
   <t>It is highly desirable that mechanisms exist to protect each AS independently 
   from network security attacks using the BGP Flow Specification NLRI for 
   intra-AS purposes only. Network operators often deploy a dedicated 
   Security Operations Center (SOC) within their AS to monitor and detect such security attacks. 
   To mitigate attacks within an AS, operators require 
   the ability to originate intra-AS Flow Specification NLRIs from a 
   central BGP route controller that is not within the data forwarding plane. 
   In this way, operators can direct border routers within their AS with 
   specific attack mitigation actions (drop the traffic, forward to a clean-pipe center, etc.).  
   </t>
   <t>
   In addition, an operator MAY extend the requirements above for a group of ASes via policy.
   This is described in section (b.2.3) of the validation procedure.
   </t>
   <t>
   A central BGP route controller that originates a Flow Specification
   NLRI should be able to avoid the complexity of having to determine
   the egress border router whose path was chosen as the best for each
   of its neighbors.

   When a central BGP route controller originates a Flow Specification NLRI, the rest of the speakers
   within the AS will see the BGP controller as the originator of the Flow Specification in terms
   of the validation procedure rules. Thus, it is necessary to modify step (b) of the [RFC8955] 
   validation procedure such that an iBGP peer that is not within the data forwarding plane
   may originate Flow Specification NLRIs.
   </t>
   </section>
   <section title="Revised Validation Procedure">
   <section title="Revision of Route Feasibility">
<t>Step (b) of the validation procedure specified in [RFC8955], section 6 is redefined as follows:
     <list style="hanging" hangIndent="3">
         <t hangText="b)">One of the following conditions MUST hold true:
         <list style="numbers">
            <t>The originator of the Flow Specification matches the originator of the best-match
			unicast route for the destination prefix embedded in the Flow Specification (this
			is the unicast route with the longest possible prefix length covering the destination prefix
			embedded in the Flow Specification).
			</t>
            <t>The AS_PATH attribute of the Flow Specification is empty or contains only AS_CONFED_SEQUENCE and/or AS_CONFED_SET segments [RFC5065].
			 <list style="numbers">
			 <t>This condition SHOULD be enabled by default (it may be disabled by explicit configuration as described on the next list item (b.2.1))..
			 an empty AS_PATH. 
			 </t>
			 <t>This condition MAY be disabled by explicit configuration on a BGP speaker. A possible case would be if we know for a fact that only
			 the right egress border routers (i.e. those that are also egress border routers for the best routes)
			 are originating a Flow Specification NLRI.
			 </t>
			 <t>As an extension to this rule, a given non-empty AS_PATHs (or AS_PATHS containing only AS_CONFED_SEQUENCE and/or AS_CONFED_SET segments), 
			 MAY be validated by policy. A possible case would be if the AS_SEQUENCE and AS_SET contained only ASes that are known to belong to our
			 own administrative domain.
			</t>
			 </list>
			 </t> 
          </list> 
		  </t>
		  
        </list>
</t>
<t>Explanation:
<list>
<t>
In this context, a local domain includes the local AS or the local
confederation [RFC5065].  Receiving either an empty AS_PATH or one
with only AS_CONFED_SEQUENCE and/or AS_CONFED_SET segments indicates that the Flow Specification was
originated inside the local domain.

</t>
<t>
With the above modification to the [RFC8955] validation procedure, a BGP peer within the local domain
that is not within the data forwarding path can originate a Flow Specification. 
</t>
<t>
Disabling the new condition above (b.2.2) may be a good practice when the operator knows with 
certainty that a Flow Specification will not be originated inside the local domain.
</t> 
<t>
Also, policy may be useful to validate a specific set of non-empty AS_PATHs (b.2.3). For example,
it could validate a Flow Specification whose AS_PATH contains only an AS_SEQUENCE with ASes that are all known
to belong to the same administrative domain.
</t>
</list>
</t>
</section>

<section title="Revision of AS_PATH Validation"> 
<t>
[RFC8955] states:
</t>
<t>
BGP implementations MUST also enforce that the
AS_PATH attribute of a route received via the External Border Gateway Protocol (eBGP) 
contains the neighboring AS in the left-most position of the AS_PATH attribute.
</t>
<t>
This rule prevents the  exchange of BGP Flow Specification NLRIs at Internet 
exchanges with BGP route servers [RFC7947]. Therefore, this document also redefines the [RFC8955] AS_PATH validation 
procedure referenced above as follows:
</t>
<t>
BGP Flow Specification implementations MUST enforce that the AS in the left-most position of the AS_PATH attribute of a Flow Specification route
received via the External Border Gateway Protocol (eBGP) matches the AS in the left-most position of the AS_PATH attribute of the best-match unicast route for the destination prefix 
embedded in the Flow Specification NLRI.
</t>
<t>
Explanation:
<list>
<t>
For clarity, the AS in the left-most position of the AS_PATH means the AS that was last added to the AS_SEQUENCE.
</t>
<t>This proposed modification enables the exchange of 
BGP Flow Specification NLRIs at Internet exchanges with 
BGP route servers while at the same time, for security reasons, 
prevents an eBGP peer from advertising an inter-domain 
Flow Specification for a destination prefix that it does 
not provide reachability information for. 
</t>
<t>Comparing only the last ASes added is sufficient for 
eBGP learned Flow Specification NLRIs. 
Requiring a full AS_PATH match would limit origination of 
inter-domain Flow Specifications to the origin
AS of the best-match unicast route for the destination prefix embedded 
in the Flow Specification only. As such, a full AS_PATH 
validity check may prevent transit ASes from 
originating inter-domain Flow Specifications, which is not desirable.
</t>
<t>
Note, however, that not checking the full AS_PATH allows any rogue or misconfigured AS the ability to originate undesired
Flow Specifications. This is a security BGP threat, but out of the scope of this document.
</t>
<t>
Redefinition of this AS_PATH validation rule for a Flow Specification does not mean that the original rule in [RFC8955] cannot be enforced as well.
Its enforcement remains optional per [RFC4271] section 6.3. 
That is, a BGP speaker can enforce the first AS in the AS_PATH to be the same as the neighbor AS for any address-family route (including a Flow Specification).
</t>
<t>
Using the new rule to validate a Flow Specification route received from an External Border Gateway Protocol (eBGP) 
peer belonging to the same local domain (in the case of a confederation)
is out of the scope of this document. Note that although it's possible, its utility is dubious.
Although it is conceivable that an router in the same local domain (both iBGP and eBGP within the same local domain) could send a rogue update,
only eBGP (outside the local domain) risk is considered within this document (in the same spirit of the mentioned beforehand AS_PATH validation in [RFC4271]).
</t>
</list>
</t>
</section>
</section>
<section title="Topology Considerations">
<t>
[RFC8955] indicates that the originator may refer to the originator path attribute (ORIGINATOR_ID) 
or (if the attribute is not present) the transport address of the peer from which the BGP speaker received the update.
If the latter applies, a network should be designed so it has a congruent topology amongst ipv4 unicast routes and Flow Specification routes.
By congruent topology, it is understood that for the two equivalent routes (i.e. the Flow Specification route and its best-match unicast route) are learned from the same peer accross the AS.
That would likely not be true, for instance, if some peers only negotiated one type of address-family or if each address-family had a different set of policies.
</t>
<t>
With the additional second condition (b.2) in the validation procedure, non-congruent topologies are supported within the local domain if the Flow Specification
is originated within the local domain.
</t>
<t>
Explanation:
<list>
<t>
Consider the validation procedure preceding this document. The second condition (b.2) does not exist. The two following scenarios have a non-congruent topology:
<list style="numbers">
<t>Consider a topology with two BGP speakers with two peering sessions between them, one for unicast and 
one for Flow Specification. This is a non-congruent topology. Let's assume that the ORIGINATOR_ID attribute was not received (e.g. a route
reflector receiving routes from its clients). In this case, the Flow Specification validation procedure will fail because of the first condition (b.1).
</t>
<t>Consider a topology with a BGP speaker within a confederation of ASes, inside local AS X. The ORIGINATOR_ID attribute is not advertised within the local domain.
Let's assume the Flow Specification route is received from peer A and the best-match unicast route
is received from peer B. Both peers belong to local AS Y. Both AS X and AS Y belong to the same local domain.
The Flow Specification validation procedure will also fail because of the first condition (b.1).
</t>
</list>
</t>
<t>
In the scenarios above, if Flow Specifications are originated in
the same local domain, the AS_PATH will be empty or contain just
AS_CONFED_SEQUENCE and/or AS_CONFED_SET segments.  Condition (b.2) evaluates to true. Therefore, using the
second condition (b.2), as defined by this document, guarantees that the overall
validation procedure will pass.  Thus, non-congruent topologies
are supported if the Flow Specification is originated in the same
local domain.
</t>
<t>
Flow Specification originated in a different local
domain needs a congruent topology. The reason is that the second condition
(b.2) evaluates to false and only the first condition (b.1) is evaluated.
</t>
</list>
</t>
</section>
<section anchor="IANA" title="IANA Considerations">
     <t>This memo includes no request to IANA.</t>
     
</section>

   <section anchor="Security" title="Security Considerations">

     <t>
    This document updates the route feasibility validation procedures for Flow Specifications
    learned from iBGP peers and through route servers.  This change is in
    line with the procedures in [rfc8955] and thus maintain security
    characteristics equivalent to the existing security properties of BGP
    unicast routing.
    </t>
    <t>
    The security considerations discussed in [RFC8955] apply to this
    specification as well.
    </t>
   <t>   
   The original AS_PATH validation rule ([RFC4271] section 6.3) becomes
   hereby optional (section 4.2).  If that original rule is actually not
   enforced it may introduce some security risks. A peer (or a client of a route server peer) 
   in AS X could advertise a rogue Flow Specification route whose first AS in AS_PATH  was Y (assume Y is the first AS
   in the AS_PATH of the best-match unicast route).  This risk
   is impossible to prevent if the Flow Specification route is received from a route server peer.
   If that peer is known for a fact not to be a route server,
   that optional rule SHOULD be enforced for Flow Specification routes.
	</t>
	<t>
	BGP updates learned from iBGP peers are considered 
    trusted, so the Traffic Flow Specifications contained in BGP updates
    are also considered trusted.  Therefore it is not required to
    validate that the originator of an intra-domain Traffic Flow
    Specification matches the originator of the best-match unicast route
    for the flow destination prefix.  Note that this trustworthy consideration is not
    absolute and the new possibility than an iBGP speaker could send a rouge Flow Specification is introduced.
	</t>

	 <t>
	 The changes in Section 4.1 don't affect the validation procedures for eBGP-learned routes.
   </t>
   </section>

   <section anchor="Acknowledgements" title="Acknowledgements">
     <t>The authors would like to thank Han Nguyen for his direction on this
	 work as well as Waqas Alam, Keyur Patel, Robert Raszuk, Eric Rosen and 
	 Shyam Sethuram for their review comments.
	 </t>
   </section>
 </middle>

 <!--  *****BACK MATTER ***** -->

 <back>

   <references title="Normative References">
     <?rfc include="http://xml.resource.org/public/rfc/bibxml/reference.RFC.8955.xml">?>
	 
	 <?rfc include="http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml"?>
	 
	 <?rfc include="http://xml.resource.org/public/rfc/bibxml/reference.RFC.8174.xml"?>

     <?rfc include="http://xml.resource.org/public/rfc/bibxml/reference.RFC.4271.xml"?>

     <?rfc include="http://xml.resource.org/public/rfc/bibxml/reference.RFC.5065.xml"?>

     <?rfc include="http://xml.resource.org/public/rfc/bibxml/reference.RFC.6793.xml"?>
	 
	 <?rfc include="http://xml.resource.org/public/rfc/bibxml/reference.RFC.7947.xml"?>
     
   </references>

 </back>
</rfc>

