<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
<!ENTITY RFC2119 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml">
<!ENTITY RFC4271 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.4271.xml">
<!ENTITY RFC4360 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.4360.xml">
<!ENTITY RFC4760 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.4760.xml">
<!ENTITY RFC6241 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.6241.xml">
<!ENTITY RFC7153 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.7153.xml">
<!ENTITY RFC8040 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.8040.xml">
<!ENTITY RFC8205 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.8205.xml">
<!ENTITY RFC8206 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.8206.xml">
<!ENTITY RFC8955 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.8955.xml">
<!ENTITY RFC8956 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.8956.xml">
<!ENTITY I-D.ietf-idr-bgp-flowspec-oid SYSTEM "http://xml.resource.org/public/rfc/bibxml3/reference.I-D.ietf-idr-bgp-flowspec-oid.xml">
<!ENTITY I-D.ietf-idr-wide-bgp-communities SYSTEM "http://xml.resource.org/public/rfc/bibxml3/reference.I-D.ietf-idr-wide-bgp-communities.xml">
]>
<?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>
<?rfc toc="yes" ?>
<?rfc symrefs="yes" ?>
<?rfc sortrefs="yes"?>
<?rfc compact="yes" ?>
<?rfc subcompact="no" ?>
<?rfc iprnotified="no" ?>
<?rfc strict="no" ?>
<rfc category="std" docName="draft-hares-idr-flowspec-v2-01"  ipr="trust200902">
  <front>
    <title abbrev="BGP FlowSpec v2">BGP Flow Specification Version 2 </title>
    <author fullname="Susan Hares" initials="S" surname="Hares">
      <organization>Hickory Hill Consulting</organization>
      <address>
        <postal>
          <street>7453 Hickory Hill</street>
          <city>Saline</city>
          <region>MI</region>
          <code>48176</code>
          <country>USA</country>
        </postal>
        <email>shares@ndzh.com</email>
      </address>
    </author>
    <date year="2021" />
    <area>Routing Area</area>
    <workgroup>IDR Working Group</workgroup>
    <keyword>RFC</keyword>
    <keyword>Request for Comments</keyword>
    <keyword>I-D</keyword>
    <keyword>Internet-Draft</keyword>
    <keyword>BGP Flow Specification</keyword>
	<abstract>
      <t>BGP flow specification version 1 (RFC8955, RFC8956) describes the distribution
	  of traffic filter policy (traffic filters and actions) which are distributed
	  via BGP to BGP peers. Multiple applications utilize the BGP distributed 
	  traffic filter policy.  These applications include:  
      (1) mitigation of Denial of Service (DoS), (2) enabling of traffic filtering 
      in BGP/MPLS VPNS, (3)centralized traffic control for networks utilizing either 
	  SDN control of router firewall functions. During the deployment of BGP flow specification 
	  v1, the following issues were detected:  1) problems due to the lack of clear TLV encoding 
	  for rules for flow specifications, 2) desire to order filters rules, and 3) 
	  ordering of actions to provide deterministic actions.  Version 2 of the BGP flow specification 
	  protocol addresses these features. 
	  </t>
	  <t> BGP Flow Specification v2 is encapsulated in a different NLRI which encapsulates previous 
	  flow specification informatino. 
	   </t>
    </abstract>
  </front>
  <middle>
  <section anchor="intro" title="Introduction">
	  <t>BGP (<xref target="RFC4271"></xref>) flow specification (see <xref target="RFC8955"></xref> and <xref target="RFC8956"></xref>) 
	  describes the distribution of traffic filter policy (traffic filters and actions) which are distributed via BGP to 
      BGP peers.  The traffic filter policy is applied when packets are received on a 
      router with the flow specification function turned on. 
	  Multiple applications utilize the BGP distributed 
	  traffic filter policy.  These applications include:  
      (1) mitigation of Denial of Service (DoS), (2) enabling of traffic filtering 
      in BGP/MPLS VPNS, and (3)centralized traffic control for networks utilizing either 
	  SDN control of router firewall functions. During the deployment of BGP flow specification 
	  v1, the following issues were detected:  
	  <list style="symbols"> 
	  <t>problems due to the lack of clear TLV encoding,  </t>
	  <t>desire to order filtering rules, and </t>
	  <t> desire to order actions to provide deterministic interactions of actions.</t>
	  </list>
	  Version 2 of the BGP flow specification 
	  protocol addresses these features. 
	  </t>
	  <t>This document describes distribution of three new BGP Flow Specification NLRI
	  (3 AFIs (1, 2, and 6) with SAFI (TBD) that allow user-ordered list of traffic match filters, 
	  and user-ordered traffic match actions encoded in BGP Wide Communities. 
	  This document contains a overview in this section and the following other sections: 
	  <list style="symbols">
	  <t>section 2 - Definitions,</t>
	  <t>section 3 - Rules for dissemination of Flow Specification v2,
	  </t>
	  <t>section 4 - Optional Security, </t>
	  <t>section 5 - IANA considerations,</t>
	  <t>section 6 - security considerations.</t>
	  </list>
	  </t>
	  <t>
	  This section reviews the existing flow specification and provides a logical description of
	  ordered flow specification.
	  </t>
	  <section title="Flow Specification v1 Review">
	  <t>
	  If one considers the reception of the packet as  an event,
	  then BGP flow specification describes a set of minimalistic 
	  Event-MatchCondition-Action (ECA) policies where the 
	  match-condition is defined in the BGP NLRI, and the action is defined
	  either by the default condition (accept traffic) or actions 
	  defined in Extended BGP Community values <xref target="RFC4360"></xref>.
	  </t>
	  <t>
	  The initial set of policy <xref target="RFC8955"></xref> and <xref target="RFC8956"></xref> 
	  for this policy includes 13 types of match filters encoded the following: 
	  specific AFI/SAFIs for the IPv4 and IPv6 AFIs: 
	  <list>
	  <t>IPv4 traffic: AFI:1, SAFI:133; 
	  </t>
	  <t>IPv6 Traffic: AFI:2  SAFI:133 </t>
	  <t>BGP/MPLS IPv4 VPN: AFI:1, SAFI: 134	 
	  </t>
	  <t> BGP/MPLS IPv6 VPN: AFI:2, SAFI: 134</t>
	  </list>
	  </t>
      <t> The 13 types of filters are the following: 
	  <list style="symbols">
	  <t>Type 1: Destination Prefix </t>
	  <t>Type 2: Source Prefix</t>
	  <t>Type 3: IP Protocol (v4,<xref target="RFC8955"></xref> ) 
	  or Upper Layer Protocol (v6, <xref target="RFC8956"></xref>) </t>
	  <t>Type 4: Port </t>
	  <t>Type 5: Destination Port </t>
	  <t>Type 6: Source Port </t>
	  <t>Type 7: ICMPv4 Type (v4,<xref target="RFC8955"></xref> ) or
	    ICMPv6 Type (v6, <xref target="RFC8956"></xref>) </t>
	  <t>Type 8: ICMPv4 Code (v4,<xref target="RFC8955"></xref> ) or
	   ICMPv6 code(v6, <xref target="RFC8956"></xref>)  </t>
	   <t>Type 9: TCP flags (v4,<xref target="RFC8955"></xref> )</t>
	   <t>Type 10: Packet length</t>
	   <t>Type 11: DSCP marking </t>
	   <t>Type 12: Fragment </t>
	   <t>Type 13: Flow Label (v6, <xref target="RFC8956"></xref>) </t>
	  </list> 
	  </t>
	  <t>
	 The actions proposed in <xref target="RFC8955"></xref> and <xref target="RFC8956"></xref>
	 for exclusion on Extended Community (0xttss) are the following:  
	 <list style="symbols">
	 <t>Traffic rate limited by bytes   (0x8006) [2 byte AS, 4 byte float]</t>
	 <t>Traffic action (set by bitmask, bits 47 and 46 defined) (0x8007) </t>
	 <t>rt-redirect IPv4 (0x8008) [2 byte AS, 4 octet value] </t>
 	 <t>rt-redirect IPv4 (0x8108) [4 byte IPv4 address, 2 octet value] </t>
	 <t>rt-redirect IPv4 (0x8108) [4 byte AS, 2 octet value] </t>
	 <t>traffic marking  (0x8009) (DSCP value) </t>
	 <t>Traffic rate limited by packets (0x800C) [2 byte AS, 4 byte float]</t> 	
	<t>rt-redirect IPv6 (0x820D) [2 byte AS, 4 octet value] </t>
 	 <t>rt-redirect IPv6 (0x810D) [4 byte IPv4 address, 2 octet value] </t>
	 <t>rt-redirect IPv6 (0x820D) [4 byte AS, 2 octet value] </t>
	 <t></t>
	 </list>
	 </t> 
	 <t> The flow specification filers and actions combine to make up flow 
	 specification rules associated with an NRLI.  The Extended Communities 
	 for actions can be attached to a single rule or multiple rules. 
	Figure 1 shows a diagram of the flow specification data structures. 
<figure>
<artwork>
 
     +--------------------------------------+
     | Flow Specification (FS)              | 
     |  Policy                              | 
     +--------------------------------------+	
       	 ^               ^              ^
         |               |              | 
         |               |              |   
+--------^----+  +-------^-------+     +-------------+    
|   FS Rule1  |  |   FS Rule     | ... |  FS rule    |
+-------------+  +---------------+     +-------------+
                    :          :        
                    :          :        
                 ...:          :........   
                 :                     :
       +---------V---------+      +----V-------------+
       |  Rule Condition   |      |   Rule Action    |
       |  in BGP NLRIs     |      | in BGP extended  |
	   | AFIs: 1 and 2     |      | Communities      |
       | SAFI 133, 134     |      |                  | 
       +-------------------+      +------------------+
           :     :    :                 :      :    :
      .....:     .    :.....       .....:      .    :.....
      :          :         :       :           :         :
 +----V---+  +---V----+ +--V---+ +-V------+ +--V-----++--V---+
 |  Match |  | match  | |match | | Action | | action ||action|
 |Operator|  |Variable| |Value | |Operator| |variable|| Value|
 |*1      |  |        | |      | |(subtype| |        ||      |
 +--------+  +--------+ +------+ +--------+ +--------++------+
 
   *1 match operator may be complex. 
 
   Figure 1: BGP Flow Specification Policy 
</artwork>
</figure>
</t>
</section>
<section title="Order Flow Specification Data Proposed for v2">
<t>An minimal ordered specification of the rules would include an order indicator
per rule. The inclusion of names for each rule, match condition and action 
allows for logical indirection. The existing extended community 
which tags multiple NLRIs could be saved as an indirect reference
by name.  For Flow specification v1 actions, the Extended 
actions could be assigned default names.  The 
actions could be linked to many NLRIs.  Figure 2 below 
 provides a logical diagram of the ordering of 
rules and the association of names per rule, rule match action, 
and rule action. </t>
<t>Since many policies also group data flow specifications under rule groups, 
many implementations may order set of rules under a particular group policy. 
Network Management display of BGP filers may use the Rule Grouping mechanism 
to display the filters. </t>

<t> 
<figure>
<artwork>
 
       +--------------------------------+ 	
       |          Rule Group            | 
       +------------------------------ -+			   
       	 ^          ^                  ^
		 |          ----------         |
         |                   |		   ------
         |                   |               |
+--------^-------+   +-------^-----+     +---^-----+
|      Rule1     |   |     Rule2   | ... |  Rule-n |
+----------------+   +-------------+     +---------+ 
                      :  :   :    :     
    :.................:  :   :    :
    :	       |.........:   :    :
 +--V--+    +--V--+          :    :        
 | name|    |order| .........:    :.....   
 +-----+    +-----+ :                  :
                    :                  :
   +----------------V----+  +-----V-------  --+
   |Rule Match condition |  | Rule Action     |
   +---------------------+  +-----------------+
    :	   :     :    :       :      :   :   :
 +--V--+   :     :    :    +--V--+   :   :   :        
 | name|   :     :    :    |name |   :   :   :
 +-----+   :     :    :    +-----+	 :   :   :
           :     :    :              :   :   :...........
           :     :    :              :   :              :     
      .....:     .    :.....       ..:   :.....         :
      :          :         :       :          :         :
 +----V---+  +---V----+ +--V---+ +-V------++--V-----++--V---+
 |  Match |  | match  | |match | | Action || action ||action|
 |Operator|  |variable| |Value | |Operator||Variable|| Value|
 +--------+  +--------+ +------+ +--------++--------++------+

   Figure 2: Order Flow Specification Data storage
</artwork>
</figure>
</t>
</section>
</section>
	 <section title="Definitions">
	 <section title="Definitions and Acronyms">
      <t><list>
		  <t>NETCONF: The Network Configuration Protocol <xref target="RFC6241"></xref>.</t>
		  <t>RESTCONF:  The RESTCONF configuration Protocol <xref target="RFC8040"></xref> </t>
		  <t>BGPSEC - secure BGP <xref target="RFC8205"></xref> updated by <xref target="RFC8206"></xref> </t>
		  <t>BGP Session ephemeral state - state which does not survive the loss of BGP peer,</t>
		  <t>Ephemeral state - state which does not survive the reboot of a software module,
		   or a hardware reboot. Ephemeral state can be ephemeral configuration state or 
		   operational state.</t>
		   <t>configuration state - state which persist across a reboot of software module within 
		      a routing system or a reboot of a hardware routing device.</t>
        </list>
		</t>
    </section>
     <section title="RFC 2119 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"></xref>.
	 </t>
	 </section> 
	 </section>
	
 <section title="Dissemination of BGP Flow Specification version 2 NLRI ">
 <t>
 The BGP Flow Specification version 2 (BGP-FS v2) uses an NRLI with the format for
 AFIs for IPv4 (AFI = 1), IPv6 (AFI = 2), and L2VPN (L2VPN = 6) with a SAFI of (TBD=xx). 
 This NLRI information is encoded using MP_READ_NRI and MP_UNREACH_NLRI attributes defined in
 <xref target="RFC4760"></xref>.  Whenever the corresponding application does not require
 Next-HOP information, this shall be encoded as zero-octet length Next Hop in the MP_REAC_NLRI
 and ignored upon receipt. 
 </t>
<t>Implementations wishing to exchange flow specification rules MUST use 
BGP's Capability Advertisement facility to exchange the Multiprotocol Extension Capability Code 
(Code 1) as defined in <xref target="RFC4760"></xref>, and 
indicate a capability for flow specification v2 (TBD). 
</t> 
<section title="Encoding of BGP-FS v2 Filters">
<t>The AFI/SAFI NLRI for BGP Flow Specification has the format:
 <figure>
  <artwork>
 +------------------------+
 |length (2 octets)       |
 +------------------------+
 | Sub-TLVs (variable)    |
 | +====================+ |
 | | order (2 octets)   | |
 | +--------------------+ |
 | | type (2 octets)    | |
 | +--------------------+ |
 | | length (2 octets)  | |
 | +--------------------+ |
 | | value (variable)   | |
 | +====================+ |
 +------------------------+
 
 Figure 3 -Flow Specification v2 format
  </artwork>
  </figure>
  </t>
  <t>
  where:
  <list style="symbols">
  <t> order - is 2 octet field indicating the flow-specification global rule order </t>
  <t> type - is one of the following types 
  <list>
  <t>identifier (value = 00)  </t>
  <t>match rule (value = 01) with default action of block traffic </t>
  <t>match rule (value = 02) with default action of permit traffic </t>
  <t>match rule (value = 03) with action TLVs  </t>
  <t>match rule (value = 04) with Wide Communities Action TLVS </t>
  <t>match rule (value = 05) with tunnel matching from 
     (draft-ietf-idr-flowspec-nv03-13.txt) </t>
  </list>
  </t>
  <t> length - is the length of the NLRI,</t>
  <t>value is a series of sub-TLVs fields (TLV)
  depended on the type value defined in the sections below.</t>
 </list>  
  </t>
  <t>Filters are processed in the order specified by the user. 
  </t>
<section title="Encoding of Value field for Rule Identification (Value = 00)">
<t>The BGP flow specification V2 identifier sub-TLVs use the following format: 
  <figure>
  <artwork>
 +------------------------+
 |length (2 octets)       |
 +------------------------+
 | Sub-TLVs (variable)    |
 | +====================+ |
 | | order (2 octets)   | |
 | +--------------------+ |
 | | type = 00          | |
 | +--------------------+ |
 | | length (4 octets)  | |
 | +--------------------+ |
 | | identifier for     | | 
 | | rule (variable)    | |
 | +====================+ |
 +------------------------+
 
 Figure 4 - NRLI revision 
  </artwork>
  </figure>
  </t>
  <t>
  The octets for the identifier are string of octets
  of variable length.  
</t>
</section>
<section title="Encoding of Value field for default Action of Block traffic (Value = 01)">
<t>The BGP flow specification V2 identifier sub-TLVs use the following format: 
  <figure>
  <artwork>
 +--------------------------+
 |length (2 octets)         |
 +--------------------------+
 | Sub-TLVs (variable)      |
 | +======================+ |
 | | order (2 octets)     | |
 | +----------------------+ |
 | | type = 01            | |
 | +----------------------+ |
 | | length (variable)    | |
 | +----------------------+ |
 | | value field          | |
 | | AFI/SAFI field (4)   | |
 | | components (variable | |
 | +======================+ |
 +--------------------------+
 
 Figure 5 - Flow specification v2 
 with default Block traffic flow 
  </artwork>
  </figure>
  </t>
  <t>Flow Specification v2 with a default Action of block traffic has the following sub-TLVs
  in the value field: 
  <list>
  <t>a value of an AFI/SAFI field with 4 bytes
  [AFI 2 Bytes, SAFI 1 byte, 1 Byte reserved]
  </t>
  <t>Component fields as defined in the following documents:
  <list>
  <t> <xref target="RFC8955"></xref>, </t>
  <t> <xref target="RFC8956"></xref>, </t>
  <t> draft-ietf-idr-flowspec-l2vpn </t>
  </list>  
   </t> 
   </list>
</t>
</section>
<section title="Encoding of Value field for default Action of Permit traffic (Value = 02)">
<t>The BGP flow specification V2 identifier sub-TLVs use the following format: 
  <figure>
  <artwork>
 +--------------------------+
 |length (2 octets)         |
 +--------------------------+
 | Sub-TLVs (variable)      |
 | +======================+ |
 | | order (2 octets)     | |
 | +----------------------+ |
 | | type = 01            | |
 | +----------------------+ |
 | | length (variable)    | |
 | +----------------------+ |
 | | value field          | |
 | | AFI/SAFI field (4)   | |
 | | components (variable | |
 | +======================+ |
 +--------------------------+
 
 Figure 6 - Flow specification v2 
 with default permit traffic flow 
  </artwork>
  </figure>
  </t>
  <t>Flow Specification v2 with Filters and Default action of block traffic has the following sub-TLVs
  in the value field: 
  <list>
  <t>a value of an AFI/SAFI field with 4 bytes
  [AFI 2 Bytes, SAFI 1 byte, 1 Byte reserved]
  </t>
  <t>Component fields as defined in the following documents:
  <list>
  <t> <xref target="RFC8955"></xref>, </t>
  <t> <xref target="RFC8956"></xref>, </t>
  <t> draft-ietf-idr-flowspec-l2vpn </t>
  </list>  
   </t> 
   </list>
</t>
</section>
<section title="Encoding of Value field filters plus actions(Value = 03)">
<t>The BGP flow specification V2 identifier sub-TLVs use the following format: 
  <figure>
  <artwork>
 +----------------------------+
 |length (2 octets)           |
 +----------------------------+
 | Sub-TLVs (variable)        |
 | +=======================+  |
 | | order (2 octets)      |  |
 | +-----------------------+  |
 | | type = 01             |  |
 | +-----------------------+  |
 | | length (variable)     |  |
 | +-----------------------+  |
 | | value field           |  |
 | |                       |  |
 | | Action length   (4)   |  |
 | | Action sub-TLVs (var) |  | 
 | | number of filters     |  |
 | | [filter 1]            |  |
 | | AFI/SAFI field (4)    |  |
 | | components (variable) |  |
 | | [filter 2]            |  |
 | | AFI/SAFI field (4)    |  |
 | | components (variable) |  |
 | | ....                  |  |
 | +=======================+  |
 +----------------------------+
 
 Figure 7 - Flow Specification with
 Actions encoded in NLRI 
  </artwork>
  </figure>
  </t>
  <t>The Flow Specification v2 with action fields applies actions to 
the AFI/SAFI field.  The format of the field is 
  <list>
  <t>Action length (4 bytes) </t>
  <t>Action SubTLVs (variable) in format Type (2 bytes), 
  length (2 bytes), and value (variable). 
  The types are: 
  <list> 
  <t>Extended community (01)</t>
  <t>Wide Community (02)</t>
  </list>
  <figure>
  <artwork>
  [Type (2 bytes)][Extended-Community-type (2 bytes)][6 bytes] 
 
 Figure 8 - Extended Community action type encoding 
   </artwork>
  </figure>
  The Extended community types are the following: 
  	 <list>
	 <t>Type 1: Traffic rate limited by bytes   (0x8006) [2 byte AS, 4 byte float]</t>
	 <t>Type 2: Traffic action (set by bitmask, bits 47 and 46 defined) (0x8007) </t>
	 <t>Type 3: rt-redirect IPv4 (0x8008) [2 byte AS, 4 octet value] </t>
 	 <t>Type 4: rt-redirect IPv4 (0x8108) [4 byte IPv4 address, 2 octet value] </t>
	 <t>Type 5: rt-redirect IPv4 (0x8108) [4 byte AS, 2 octet value] </t>
	 <t>Type 6: traffic marking  (0x8009) (DSCP value) </t>
	 <t>Type 7: Traffic rate limited by packets (0x800C) [2 byte AS, 4 byte float]</t> 	
	 <t>Type 8: rt-redirect IPv6 (0x820D) [2 byte AS, 4 octet value] </t>
 	 <t>Type 9: rt-redirect IPv6 (0x810D) [4 byte IPv4 address, 2 octet value] </t>
	 <t>Type 10: rt-redirect IPv6 (0x820D) [4 byte AS, 2 octet value] </t>
	 <t></t>
	 </list>
</t>
  <t>Component fields as defined in the following documents:
  <list>
  <t> <xref target="RFC8955"></xref>, </t>
  <t> <xref target="RFC8956"></xref>, </t>
  <t> draft-ietf-idr-flowspec-l2vpn </t>
  </list>  
   </t> 
   </list>
</t>
<t>The BGP-FS version 2 actions are passed in a Wide Community <xref target="I-D.ietf-idr-wide-bgp-communities"></xref>
atom with the following format. 
</t>
</section>
<section title="Encoding of Value Fields filters passed in Wide Communities (Value = 04)">
<t>The BGP-FS version 2 actions are passed in a Wide Community <xref target="I-D.ietf-idr-wide-bgp-communities"></xref>
atom with the following format: 
  <figure>
  <artwork>
 +----------------------------+
 |length (2 octets)           |
 +----------------------------+
 | Sub-TLVs (variable)        |
 | +=======================+  |
 | | order (2 octets)      |  |
 | +-----------------------+  |
 | | type = 01             |  |
 | +-----------------------+  |
 | | length (variable)     |  |
 | +-----------------------+  |
 | | value field           |  |
 | |                       |  |
 | | Action length(4)      |  |
 | | Atom-id-1  (4)        |  |
 | | Atom-id-2 (4)         |  | 
 | | number of filters     |  |
 | | [filter 1]            |  |
 | | AFI/SAFI field (4)    |  |
 | | components (variable) |  |
 | | [filter 2]            |  |
 | | AFI/SAFI field (4)    |  |
 | | components (variable) |  |
 | | ....                  |  |
 | +=======================+  |
 +----------------------------+
 
 Figure 9 - Flow Specification with
 IDs for Wide Community Actions 
  </artwork>
  </figure>
  </t>
 <t>The BGP Atom IDs in the 
 Wide Community must contain: 
  <figure>
  <artwork> 
+--------------------------+
| Atom ID (4 octets)       |
+--------------------------+
| order (2 octets)         |
+--------------------------+
| Action type (2 octets)   |
+--------------------------+
| Action length (2 octets) |
+--------------------------+
| Action Values (variable) |
| (multiples of 2 octets)  | 
+--------------------------+

Figure 10 
Wide Community Atom 

</artwork>
</figure>
</t>
<t>
where: 
<list style="symbols">
<t>Action type (2 octets) - is the type of action. These actions can be 
standardized (0x0001 - 0x3ffff), vendor specific (0x40000-0x7FFFF),
or reserved (0x0, 0x80000-0xFFFFFFFF). 
</t>
<t>Action length - length of actions including variable field, </t>
<t>Action values - value of actions (variable) defined in individual 
definitions.  
</t>
</list>
</t>
<t>The BGP Flow Specification (BGP-FS) atom can be part of the Wide Community 
container (type 1) or the BGP Flow Specification Atom can be part of the
BGP Flow Specification container (type 2) which will have: 
<figure>
<artwork>
+-----------------------------+
| Source AS Number  (4 octets)|  
+-----------------------------+
| list of atoms (variable)    |
+-----------------------------+ 
figure 11 
</artwork>
</figure>
</t>
</section>
<section title="Encoding of Value Fields filters for Tunnels (Value = 05)">
<t>This section needs to be discussed with the authors of 
draft-ietf-idr-flowspec-nv03. 
</t>
</section> 
</section> 
</section> 
<section title="Optional Security Additions">
<t>This section discusses the optional BGP Security additions for BGP-FS v2
relating to BGPSEC <xref target="RFC8205"></xref> and ROA. 
</t> 
 <section title="BGP FS v2 and BGPSEC">
 <t> Flow specification v1 (<xref target="RFC8955"></xref> and <xref target="RFC8956"></xref>)
do not BGP Flow specifications to be passed BGPSEC <xref target="RFC8205"></xref>
  BGP Flow Specification v2 can be passed in BGPSEC, but it is not required. 
  </t>
</section>
  <section title="BGP FS v2 with with ROA">
  <t>
  BGP Flow Specification v2 can utilize ROAs in the validation. If BGP-FS v2 is 
  used with BGPSEC and ROA, the first thing is to validate the 
  route within BGPSEC and second to utilize BGP ROA to validate
  the route origin. 
  </t>
  <t> The BGP-FS peers using both ROA and BGP-FS validation 
  determine that a BGP Flow specification is valid
  if and only if one of the following cases: 
  <list style="symbols">
  <t>If the BGP Flow Specification NLRI has a IPv4 or 
  IPv6 address in destination address match
  filter and the following is true:
  <list style="symbols">
  <t>A BGP ROA has been received to validate the originator, and</t>
  <t>the route is the best-match unicast route for the destination
  prefix embedded in the match filter; or </t>
  </list>
  </t>
  <t>If a BGP ROA has not been received that matches the 
  IPv4 or IPv6 destination address in the destination filter, the 
  match filter must abide by the <xref target="RFC8955"></xref> and
  <xref target="RFC8956"></xref> validation rules of: 
  <list>
  <t>The originator match of the flow specification matches the
  originator of the best-match unicast route for the destination
  prefix filter embedded in the flow specification", and
  </t>
  <t>No more specific unicast routes exist when compared with the 
   flow destination prefix that have been received from a different
   neighboring AS than the best-match unicast route, which has been 
   determined in step A.
   </t>
  </list>
  </t>
  </list>
  The best match is defined to be the longest-match NLRI with the highest preference. 
</t>
</section>
<section title="Revise Flow Specification Security for centralized Server">
<t>
The distribution of Flow Specifications from a centralized server supports
mitigation of DoS attacks. <xref target="I-D.ietf-idr-bgp-flowspec-oid"></xref> 
suggests the following redefined procedure for validation for this case: 
</t>
<t>
A route is valid if the following conditions holds true:
<list style="symbols">
<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.
</t>
<t>The AS_PATH and AS4_PATH attribute of the flow
   specification are empty (on originating AS)
</t>
<t>The AS_PATH and AS4_PATH attribute of the flow
  specification does not contain AS_SET and AS_SEQUENCE
  segments (on originating AS with AS Confederation)
</t>
</list>
</t>
<t>This reduced validation mechanism can be used for BGP-FS v2 within 
a single domain. 
</t>
</section>
</section>
 <section anchor="IANA" title="IANA Considerations">
   <t>This section complies with <xref target="RFC7153"></xref>
   </t>
   <t> This document requests:
<list>
<t> SAFI be defined for IPv4 (AFI = 1), IPv6 (AFI=2), L2VPN (AFI=25) for BGP-FS
</t>
<t>SAFI be defined for BGP/MPLS IPv4 (AFI = 1), IPv6 (AFI=2), L2VPN (AFI=25) for BGP-FS 
</t> 
</list>   
   </t>
   <t>Registry be created for BGP-FS V2 filter component types
   with the following ranges:
   <list>  
   <t>0x00 - reserved </t>
   <t>0x01 - 0x3FFFF - standards action</t>
   <t>0x40000- 0x7FFFF - vendor specific filters </t>
   <t>0x80000 -0xFFFFFFFF - reserved  </t>
   <t>0x80000 -0xFFFFFFFF - reserved   </t>
   </list>
   </t>
   <t>Registry be created for BGP-FS v2 action types with the 
   following ranges: 
   <list>
   <t> 0x0 - reserved </t>
   <t>0x01 - 0x3ffff - standards action </t>
   <t>0x40000 - 0x7ffff - vendor actions </t>
   <t>0x80000 - 0xFFFFFFF - reserved </t>
   </list>
   </t>
 </section>
 <section title="Security Considerations">
   <t>The use of ROA improves on <xref target="RFC8955"></xref>
   to check the route orgination is valid can improve the 
   validation sequence for a multiple-AS environment.  The use of BGPSEC 
   <xref target="RFC8205"></xref> to secure the packet
   can increase security of BGP flow specification information sent in the packet.  
   </t>
   <t>The use of the reduced validation within an AS <xref target="I-D.ietf-idr-bgp-flowspec-oid"></xref>
   can provide adequate validation for distribution of flow specification within an single 
   autonomous system for prevention of DDOS. 
   </t>
   <t>Distribution of flow filters may provide insight into traffic being sent within 
   an AS, but this information should be composite information that does not reveal the
   traffic patterns of individuals. 
   </t>
    </section>
  </middle>
  <back>
    <references title="Normative References">
      &RFC2119;
      &RFC4271;
	  &RFC4360;
	  &RFC4760;
	  &RFC7153;
	  &RFC8955;
	  &RFC8956;
	  &I-D.ietf-idr-wide-bgp-communities;
	  &I-D.ietf-idr-bgp-flowspec-oid; 
	</references>
	<references title="Informative References">
	&RFC6241; 
	&RFC8040;
	&RFC8205;
	&RFC8206;
	 </references>
  </back>
</rfc>