<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
<!ENTITY RFC0791 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.0791.xml">
<!ENTITY RFC2119 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml">
<!ENTITY RFC3032 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.3032.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 RFC5065 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.5065.xml">
<!ENTITY RFC5701 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.5701.xml">
<!ENTITY RFC6241 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.6241.xml">
<!ENTITY RFC6482 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.6482.xml">
<!ENTITY RFC7153 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.7153.xml">
<!ENTITY RFC7606 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.7606.xml">
<!ENTITY RFC8040 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.8040.xml">
<!ENTITY RFC8174 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.8174.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 RFC8300 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.8300.xml">
<!ENTITY RFC8402 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.8402.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 RFC8986 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.8986.xml">
<!ENTITY RFC9015 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.9015.xml">
<!ENTITY RFC9117 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.9117.xml">
<!ENTITY RFC9015 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.9015.xml">
<!ENTITY RFC9184 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.9184.xml">
<!ENTITY RFC9582 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.9582.xml">
<!ENTITY I-D.ietf-idr-flowspec-v2 SYSTEM "http://xml.resource.org/public/rfc/bibxml3/reference.I-D.ietf-idr-flowspec-v2.xml">
<!ENTITY I-D.hares-idr-bgp-community-attribute 
  SYSTEM "http://xml.resource.org/public/rfc/bibxml3/reference.I-D.hares-idr-bgp-community-attribute.xml">
<!ENTITY I-D.ietf-idr-flowspec-l2vpn SYSTEM "http://xml.resource.org/public/rfc/bibxml3/reference.I-D.ietf-idr-flowspec-l2vpn.xml">
<!ENTITY I-D.ietf-idr-flowspec-nvo3 SYSTEM "http://xml.resource.org/public/rfc/bibxml3/reference.I-D.ietf-idr-flowspec-nvo3.xml">
<!ENTITY I-D.ietf-idr-flowspec-srv6 SYSTEM "http://xml.resource.org/public/rfc/bibxml3/reference.I-D.ietf-idr-flowspec-srv6.xml">
<!ENTITY I-D.ietf-idr-flowspec-mpls-match SYSTEM "https://bib.ietf.org/public/rfc/bibxml3/reference.I-D.draft-ietf-idr-flowspec-mpls-match-02.xml">
<!ENTITY I-D.ietf-idr-bgp-flowspec-label SYSTEM "http://xml.resource.org/public/rfc/bibxml3/reference.I-D.ietf-idr-bgp-flowspec-label.xml">
<!ENTITY I-D.ietf-idr-flowspec-interfaceset SYSTEM "http://xml.resource.org/public/rfc/bibxml3/reference.I-D.ietf-idr-flowspec-interfaceset.xml">
<!ENTITY I-D.ietf-idr-flowspec-path-redirect SYSTEM "http://xml.resource.org/public/rfc/bibxml3/reference.I-D.ietf-idr-flowspec-path-redirect.xml">
<!ENTITY I-D.ietf-idr-flowspec-network-slice-ts 
  SYSTEM "http://xml.resource.org/public/rfc/bibxml3/reference.I-D.ietf-idr-flowspec-network-slice-ts.xml">
<!ENTITY I-D.ietf-idr-flowspec-v2 SYSTEM "http://xml.resource.org/public/rfc/bibxml3/reference.I-D.ietf-idr-flowspec-v2.xml">
<!ENTITY I-D.ietf-6man-enhanced-vpn-vtn-id 
  SYSTEM "http://xml.resource.org/public/rfc/bibxml3/reference.I-D.ietf-6man-enhanced-vpn-vtn-id.xml">
<!ENTITY I-D.ietf-idr-fsv2-ip-basic SYSTEM "https://xml.resource.org/public/rfc/bibxml3/reference.I-D.ietf-idr-fsv2-ip-basic.xml">
<!ENTITY I-D.hares-idr-fsv2-more-ip-actions SYSTEM "https://xml.resource.org/public/rfc/bibxml3/reference.I-D.hares-idr-fsv2-more-ip-actions.xml">
<!ENTITY I-D.cui-idr-content-filter-flowspec 
  SYSTEM "http://xml.resource.org/public/rfc/bibxml3/reference.I-D.cui-idr-content-filter-flowspec.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 consensus="yes" ?>
<rfc category="std" docName="draft-hares-idr-fsv2-more-ip-filters-03"  ipr="trust200902">
  <front>
    <title abbrev="FSv2 More IP Filters">BGP Flow Specification Version 2 - More IP Filters </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>
		<phone>+1-734-604-0332</phone>
        <email>shares@ndzh.com</email>
      </address>
    </author>
    <date year="2024" />
    <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>FSv2 More IP Filters </keyword>
	<abstract>
	   <t>The BGP flow specification version 2 (FSv2) for Basic IP 
       defines user ordering of filters along with FSv1 IP Filters and 
	   FSv1 actions. This draft defines the format for the Extended 
	   IP Filters for Flow Specification FSv2.   
	   </t>
    </abstract>
  </front>
  <middle>
<section anchor="intro" title="Introduction">
      <t> Version 2 of BGP flow specification (FSv2) has a series of 
	  foundational documents (<xref target="I-D.ietf-idr-fsv2-ip-basic"></xref>, 
	  this document, <xref target="I-D.hares-idr-fsv2-more-ip-actions"></xref>, 
	  and [draft-hares-idr-fsv2-non-ip]) plus drafts on specific filter components, 
	  actions, or groups of filter components and actions. 
	  </t>
	  <t>The remainder of this introductory section provides a introduction to 
	  FSv2. </t>
 	  <t> Section 2 contains a description of the format of the FSv2 NLRI with 	  
	 the Extended IP Filters TLV. The Extended IP Filters TLV 
	 allows the user to specify new IP Filters components and a group of 
	 IP Filter components.  	 
	 The concept of a group of filter components allows an BGP peer originating 
	 a FSv2 NLRI with the Extended IP Filter TLV to pass what components the 
	 originating BGP Peer expects will be supported by the BGP Peers receiving 
     the FSv2 Extended Filter TLV. The group field is designed to aid upgrades
     to additional component by providing a simple check the FSv2 component 
     range passed in the Extended Filters TLV. Groups can be register with IANA
	 in either a FCFS range or IETF Consensus range. Section 2 also provides 
	 templates for defining: a) new components to be passed in the 
	 Extended IP Filter group and b) new Extended IP Filter groups. 
    </t>
	<t> Section 3 provides two new Filters approved in IDR WG drafts. 
	 Section 3.1 provides definitions for new components: TTL, SID in 
	 IPv6 Segment Routing header (SRH). These two components were defined
     in the original specification for Flow Specification v2 
	 (<xref target="I-D.ietf-idr-flowspec-v2"></xref>). Section 3.2 
	 also provides prototypes for a few existing components to aid 
     authors of IDR drafts (current or proposed) examples to aid their 
	 quick use of the Extended IP Filters. 
	 </t>
     <t> 	 
	Section 4 provides information on Validation and Error handling for the 
	Extended Filters TLV. Section 5 contains manageability considerations for 
	FSv2 with Extended IP Filters TLV. Section 6 contains IANA considerations 
	and section 7 contains security considerations.  
	</t> 
	<section title="FSv2 background">
	  <t> FSv2 specifies new user-ordered filters that will be used with the IPv4 (AFI=1) and 
	  IPv6 (AFI=2) 2 new SAFIs (TBD1, TBD2) for FSv2 to be used with 5 AFIs   
	  (1, 2, 6, 25, and 31) to allow user-ordered lists of traffic match filters for user-ordered 
	  traffic match actions encoded in Communities (Extended or Wide Communities).  The first SAFI (TBD1) 
	  is used for IP forwarding, and the second SAFI (TBD2) will be used with VPNs. The supported 
	  AFI/SAFI combinations in FSV2 are:
	  <list style="symbols">
	  <t> IPV4 (AFI=1, SAFI=TBD1), </t>
	  <t> IPv6 (AFI=2, SAFI=TBD1), </t>
	  <t> L2   (AFI=6, SAFI=TBD1), </t>
	  <t> SFC  (AFI=31, SAFI=TBD1), </t>
	  <t> BGP/MPLS IPv4 VPN (AFI=1, SAFI=TBD2), </t> 
	  <t> BGP/MPLS IPV6 VPN (AFI=2, SAFI=TBD2), </t>
	  <t> BGP/MPLS L2VPN (AFI=25, SAFI=TBD2), and </t>
      <t> SFC VPN (AFI=31, SAFI=TBD2)</t>
      </list> 	  
	 </t>
	 <t> FSv1 and FSv2 use different AFI/SAFIs to send flow specification filters.  Since BGP  
	  route selection is performed per AFI/SAFI, this approach can be 
	  termed “ships in the night” based on AFI/SAFI. 
	  </t>	
      <t>The full FSv2 specification ( Version 2 of BGP flow specification (FSv2) was original defined in 
	  <xref target="I-D.ietf-idr-flowspec-v2"></xref>.   contains more than initial implementers desired to put in a 
      single upgrade. Therefore, the original FSv2 draft remains an WG draft, 
	  but the content will be split out into groups of functions that can be easily 
      deployed as upgrades to FSv1.  The upgrades will come in the following groups:
	  <dl> 
	  <dt> FSv2 IP Basic (<xref target="I-D.ietf-idr-fsv2-ip-basic"></xref>):</dt><dd> This specification 
	  defines the FSv2 NLRI that allows user ordering of filters plus in a IP Basic TLV which only allows 
	  FSv1 components. FSv2 actions are implemented in Extended Communities (FSv2-EC). FSv2 defines 
	  how the actions defined in FSv2-EC are ordered.  Multiple FSv2-EC actions can be attached to 
	  a single filter component, so FSv2 defines an Action Chain Ordering community to define 
	  what happens if one of these multiple actions fails.  All FSv2 implementations must support
	  the minimal subset in this document. 
	  </dd> 
	  <dt> FSv2 IP Extended Filters (this document):</dt><dd> This document defines 
	  the Extended IP Filters TLV to allow easy addition of FSv2 filters.  
	  The original FSv2 had definitions <xref target="I-D.ietf-idr-flowspec-v2"></xref> for 
	  FSv2 TTL and SRv6 Header (SRH) filter so these components are included in this specification.   
      </dd>  	  
	  <dt>FSv2 Individual drafts for IP Extended Filters:</dt><dd> These drafts should utilize the template given 
      in section 2.2  Current proposals for Extended IP Filters can request component identifier(s) be 
	  included in this draft's BGP FSv2 Component registry list. Grouping of Extended IP Filter can 
	  be registered in the Extended IP Filter Groups (see section 2.3).  	  
	  </dd>
	  <dt>FSv2 IP Extended Actions (<xref target="I-D.hares-idr-fsv2-more-ip-actions"></xref>):</dt> <dd> This 
      document defines a FSV2 TLV for the for the BGP Community Path Attribute, and a protocols for 
	  combining FSv2 Extended Community (FSv2-EC) Actions with FSv2 Community Path Attributes. 	  
	  </dd> 
	  <dt>FSv2 Individual drafts for FSv2 Actions:</dt><dd> These drafts may define FSv2 actions in 
	  Extended Communities and/or FSv2 actions in the FSv2 TLV of the BGP Community Attribute.
	  </dd> 
	  <dt>Non-IP Filters (draft-hares-idr-fsv2-non-ip]:</dt> <dd> defines the template for 
      FSv2 non-IP filters for MPLS, L2 traffic, SFC, and tunnel traffic, and FSV2 non-IP actions.
	  </dd>
	  <dt>Individual drafts on Non-IP Filters:</dt> <dd> IDR drafts for non-ip functions passed in 
	  BGP FSv2 includes: MPLS ([draft-hares-idr-fsv2-mpls]), L2VPN (<xref target="I-D.ietf-idr-flowspec-l2vpn"></xref>), and 
	  NV03 (<xref target="I-D.ietf-idr-flowspec-nvo3"></xref>). </dd> 
	  </dl> 
	  </t>
	 </section>
	<section title="Definitions and Acronyms">
	  <dl>
  		  <dt>AFI: </dt><dd>Address Family Identifier</dd>
		  <dt>AS: </dt><dd> Autonomous System </dd>
		  <dt>BGPSEC: </dt><dd>secure BGP <xref target="RFC8205"></xref> updated by <xref target="RFC8206"></xref> </dd>
  		  <dt>BGP Session ephemeral state: </dt><dd>state which does not survive the loss of BGP peer session.</dd>
		  <dt>BGP Configuration state: </dt><dd> state which persist across a reboot of software module within 
		      a routing system or a reboot of a hardware routing device.</dd>
		  <dt>DDOs: </dt> <dd>Distributed Denial of Service.</dd>
		  <dt>Ephemeral state: </dt><dd>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.</dd>
		   <dt>FS: </dt><dd> Flow Specification. </dd> 
		  <dt>FSv1: </dt><dd>Flow Specification version 1 <xref target="RFC8955"></xref> <xref target="RFC8956"></xref></dd>
  		  <dt>FSv2: </dt><dd>Flow Specification version 2 <xref target="I-D.ietf-idr-fsv2-ip-basic"></xref>, [this document]. </dd>
          <dt>FS-EC: </dt><dd> Flow Specification Extended Community </dd>
          <dt>FSv1-EC: </dt><dd> FSv1 Extended Community that signals actions that occur after a filter match </dd>
          <dt>FSv2-EC: </dt><dd> FSv2 Extended Community that signals actions that occur after a filter match.  FSv2-EC are preformed 
              with either a default order of processing or signal the FSv2-EC are performed in implementation order. </dd>
		  <dt>NETCONF: </dt><dd>The Network Configuration Protocol <xref target="RFC6241"></xref>.</dd>
		  <dt>RESTCONF: </dt><dd>The RESTCONF configuration Protocol <xref target="RFC8040"></xref>. </dd>
		  <dt>RIB: </dt><dd>Routing Information Base.</dd>
		  <dt>ROA: </dt><dd>Route Origin Authentication <xref target="RFC9582"></xref></dd>
		  <dt>RR: </dt><dd> Route Reflector.</dd>
		  <dt>SAFI: </dt><dd>Subsequent Address Family Identifier. </dd>
        </dl>
    </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 BCP 14 <xref target="RFC2119"></xref>
   <xref target="RFC8174"></xref> when, and only when, they appear in all capitals as shown here.    
	 </t>
	</section> 
</section> 
<section title="Extending the IP Filters  ">
<t>
The format of the FSv2 NLRI field for IP Filters is defined in
<xref target="I-D.ietf-idr-fsv2-ip-basic"></xref>. 
This format includes a common header with fields for
user specified order, dependency filter chain, and a TLV
for filter components (type, length, value). 
</t>
<t>  
This section defines the use of the dependency filter chain (section 2.1) 
in the NLRI and the format of the Extended IP Filters TLV (section 2.2).
The Extended IP Filter group provides a flexible means to define which 
components are supported by the Extended IP Filter TLV.  Four Extended 
Filter Component groups are defined in section 2.3, but additional 
may be defined via an IANA Registry.  The ordering of Filters is by 
user define order number, then component, then value within a component. 
Section 2.4 provides the rules for ordering for FSv2 NLRI with 
IP Basic Filters and Extended IP Filters. Section 2.5 provides 
a template for new Extended IP Components. 
</t>
<section title="Dependency Filter Chain in FSv2 NLRI Header">
 <t>FSv2 filters may be distributed in multiple 
 BGP UPDATE packets. The format of the FSv2 NLRI is 
 shown in Figure 3-1.  In FSv2, the user can define the 
 order of the filters by an including an order in the 
 FSV2 NLRI prior to the filter. 
 FSv2 also defines an optional dependency filter chain to allow
 the filter chains to be identified across all FSV2
 Filter chains. This information may be installed from 
 BGP data based into firewalls. 
</t>
<t>
 <figure>
 <artwork>
 +-------------------------------+
 | NLRI length (2 octets)        |
 +-------------------------------+
 |    TLVs+                      |
 | +===========================+ |
 | | order (4 octets)          | |
 | +---------------------------+ |
 | | Dependent filter chain    | | 
 | |(type, chain ID, count,    | |
 | | item) (8 octets)          | |
 | +---------------------------+ | 
 | + FSv2 Filter type          + |
 | | (2 octets)                | |
 | +---------------------------+ |
 | + length TLVs (2 octet)     + |
 | + --------------------------+ |
 | + value (variable)          + |
 | +---------------------------+ |
 +-------------------------------+

  Figure 2-1 - FSv2 NLRI with Extended IP Filter type. 
</artwork>
 </figure>
</t>
<t> Where: 
<dl> 
  <dt>order: </dt> <dd>4 octet field for the FSv21 user defined order of the filter with a 
   a value of 1-n.  The value of zero is invalid </dd>  
  <dt>Dependent Filters Chain: </dt><dd> 8 octets for identifying a chain of 
   FSv2 filters that must be deployed at the same time. (See figure 2-2 for 
   details.)  If the dependency filters chain field is also zero, there 
   is no dependency filter chain defined. </dd>
  <dt>FSv2 Filter type: </dt><dd> 2 octet field for the FSv2 filter type. 
  The Extended IP Filter type value is 2. </dd>
  <dt>length: </dt><dd>2 octet field for the length of the value field. 
  </dd>
  <dt>value field: </dt><dd>variable length field defined per FSv2 filter type. 
  The value field for the Extended IP Filter rules has the format 
  shown in Figure 2-3. </dd>
  </dl>
</t>
 <t>
 The dependency filter chain has the following components: 
 <figure>
 <artwork>
    +-------------------------------+
    |  Version  (1 octet)           |
    +-------------------------------+
    |  chain id (3 octets)          |
    +-------------------------------+
    |  Count of items (2 octets)    |
    + ------------------------------+
    |  Item (2 octets)              |
    +-------------------------------+
	
  Figure 2-2 – IP header SubTLV format  
</artwork>
</figure>
</t>
<t>
where: 
<dl>
  <dt>Version: </dt><dd> This 1 octet field defines the version of the filter chain.  
   Valid values are 1-0xFF.  Value 0 is reserved. 
   </dd>
   <dt>Chain ID: </dt><dd> This 3 octet field identifies the filter chain. 
   Valid values include 0x00001 to 0xFFFFFF with the value zero (0x000000) being reserved. 
   </dd>
   <dt>Count of items: </dt><dd>This 2 octet field contains the
   count of item on this filter dependency chains.
   Valid values are 0x0001 to 0xFFFF with the value of zero being reserved.  
   </dd>
   <dt>Item: </dt><dd> This (2 octets): filter sequence number on chain 
      Valid values are 0x0001 to 0xFFFF with the value of zero being reserved. 
   </dd>
 </dl>
</t>  
</section>

<section title="Extended IP Filters TLV">
<t> 
The Extended IP Filters TLV has a type value of 2 with 
a variable length.  The Extended IP Filters value field has 
the form shown in Figure 2-3 where:
<dl>
<dt>FSv2 Extended Filters Group: </dt> <dd> is a 1 octet field indicating the 
group of components supported.  Three groups are defined in this document.
Additional groups may be defined by registering the group in the 
FSv2 Extended IP Filter group registry (see IANA registry policy in 
section x.x), but those groups are outside the scope of this document. 
</dd>
<dt>Components+: </dt><dd> This field is a sequence of FSv2 Components
with the format shown in figure 2-4.  
</dd>
</dl>
</t>
 <t>
<figure>
<artwork>
    Extended Filters value field 
 +-------------------------------+
 |  +--------------------------+ |
 |  | FSv2 Extended Filters    | | 
 |  | group(2 octets)          | |
 |  +--------------------------+ |
 |  |  Components+ (variable)  | |
 |  +--------------------------+ |	
 +-------------------------------+

 Figure 2-3 - Extended IP Filters TLV
</artwork>
</figure>
</t>
<t>Each Component is a sequence of TLVs with the format
<figure>
<artwork>
  +-------------------------------+
  |  Component Type (1 octet)     |
  +-------------------------------+
  |  Component length (2 octets)  |
  + ------------------------------+
  |  Component value (variable)   |
  +-------------------------------+
  
  Figure 2-4 – Component format 

</artwork>
</figure>
</t>
<t>
Where:
<dl>
<dt>Component type: </dt><dd>is a 1 octet specify the component type. 
</dd>
<dt>Component length: </dt><dd> is a 2 octet value specifying the component length. 
</dd>
<dt>Component value: </dt><dd>is a variable field defined per component. 
</dd>
</dl> 
</t>
<t> 
The valid components for the Extended IP Filters defined by 
this specification are listed in table 2-X below. 
These components include the following: 
<dl>
<dt> IP Basic components: </dt> <dd> Components 1-13 are defined in 
<xref target="I-D.ietf-idr-fsv2-ip-basic"></xref>.
</dd>
<dt>TTL </dt><dd> Filter on Time to Live in IPv4 packet or 
maximum hop limit in IPv6 packets.</dd>
<dt> SID function </dt> <dd> SID in segment routing 
header (SRH) in the IPv6 packet. 
</dd> 
</dl> 
</t>
<t>
<figure>
<artwork>
           Table 2-1
 
 Components for Extended IP Filters 
          
SubTLV    Extended IP Filters Components 
-type     for IP Extended Filters version 2
--------  ----------------------------------
   0 -    TTL 
   1 -    IP Destination prefix 
   2 -    IP Source prefix 
   3 –    IPv4 Protocol od 
          IPv6 Upper Layer Protocol
   4 –    Port  
   5 –    Destination Port 
   6 –    Source Port
   7 –    ICMPv4 type or ICMPv6 type  
   8 –    ICMPv4 code or ICMPv6 code 
   9 –    TCP Flags 
  10 –    Packet length
  11 –    DSCP  
  12 –    Fragment 
  13 –    Flow Label 
  14 -    TTL 
  15 -    Reserved 
  16 -    SID in Routing IPv6 Header 
</artwork>
</figure>
</t>
</section>
<section title="Extended IP Filters Component Groups">
<t>
Three groups are defined for Extended IP Filters: 
<dl>
<dt>FSv1: </dt><dd> comprised of FSv2 components 1-13
(see Table 3-1)  </dd>
<dt>FSv1 with TTL </dt><dd> compromised of FSv2 components 0-14 
where TTL has component values 0 and 14 (see Table 3-2). 
</dd>
<dt>SR (Segment Routing) </dt><dd> comprised of FSv2 components 0-17
were TTL has the component value of 0 and 14 (see Table 3-3).
</dd>
</dl>
</t>
<t>
<figure>
<artwork>
Table 2-2 FSv1 Component Group (0x00) 

SubTLV    Extended IP Filters Components 
-type     for IP Extended Filters version 1
--------  ----------------------------------
   1 -    IP Destination prefix 
   2 -    IP Source prefix 
   3 –    IPv4 Protocol or 
          IPv6 Upper Layer Protocol
   4 –    Port  
   5 –    Destination Port 
   6 –    Source Port
   7 –    ICMPv4 type or ICMPv6 type  
   8 –    ICMPv4 code or ICMPv6 code 
   9 –    TCP Flags 
  10 –    Packet length
  11 –    DSCP  
  12 –    Fragment 
  13 –    Flow Label 
</artwork>
</figure>
</t> 
<t>
<figure>
<artwork>
        
Table 2-3 FSv1 + TTL Component Group (0x01)  
 
SubTLV    Extended IP Filters Components 
-type     for IP Extended Filters version 1
--------  ----------------------------------
   0 -    TTL 
   1 -    IP Destination prefix 
   2 -    IP Source prefix 
   3 –    IPv4 Protocol or 
          IPv6 Upper Layer Protocol
   4 –    Port  
   5 –    Destination Port 
   6 –    Source Port
   7 –    ICMPv4 type or ICMPv6 type  
   8 –    ICMPv4 code or ICMPv6 code 
   9 –    TCP Flags 
  10 –    Packet length
  11 –    DSCP  
  12 –    Fragment 
  13 –    Flow Label 
  14 -    TTL 
</artwork>
</figure>
</t> 
<t>
<figure>
<artwork>
 Table 2-4 Segment Routing Group (0x02) 
          
SubTLV    Extended IP Filters Components 
-type     for IP Extended Filters version 2
--------  ----------------------------------
   0 -    TTL 
   1 -    IP Destination prefix 
   2 -    IP Source prefix 
   3 –    IPv4 Protocol od 
          IPv6 Upper Layer Protocol
   4 –    Port  
   5 –    Destination Port 
   6 –    Source Port
   7 –    ICMPv4 type or ICMPv6 type  
   8 –    ICMPv4 code or ICMPv6 code 
   9 –    TCP Flags 
  10 –    Packet length
  11 –    DSCP  
  12 –    Fragment 
  13 –    Flow Label 
  14 -    TTL 
  15 -    Reserved 
  16 -    SID in Routing IPv6 Header 
</artwork>
</figure>
</t>
<t>
<figure> 
<artwork>
Table 2-5 Extended IP Component Ranges

Sub-TLV range   Definition 
-------------  -------------
   1-13        V1 filters 
  14-63        IP Extended Filters  
</artwork>
</figure> 
</t> 
</section>

<section title="Ordering within FSv2 NLRI in Update Packet">
<t>The transmission of TLVs within a FSV2 NLRI  
SHOULD be sent via ascending user order.  
</t>
<t> Within a single user order, the TLVs should be ordered by FSv2 Filter type.  
The FSv2 Filter types which MUST be supported for the Extended IP Filter support
are Filter Type IP Basic (type = 1) and Filter Type Extended IP Filters (type = 2).  
Other FSv2 Filter types MAY be supported, but the support of those filter types 
is outside the scope of this document. 
</t> 
<t> Within a single user order number and the same IP Basic Filter Type, the components should 
be ordered by ascending numerical order of the component type. 
</t>
<t> Within a single user order number and the same Extended IP Basic Type, the components should 
also be ordered by ascending component numbers. The Extended IP Filters version number simply 
indicates which components are required to be supported per version. 
</t>
<t>Within a single user order and a single component number, the order of the filters is defined by the 
component.  For example, if the component types are the same, then the value fields are compared 
as defined in <xref target="I-D.ietf-idr-fsv2-ip-basic"></xref>, <xref target="RFC8955"></xref>
and <xref target="RFC8956"></xref>.  The filters MUST be stored with the value fields in ascending order.  
NLRIs having TLVs which do not follow the above ordering rules MUST be considered as
 malformed by a BGP FSv2 propagator. This rule prevents any ambiguities that arise
from the multiple copies of the same NLRI from multiple BGP FSv2 propagators. 
A BGP implementation SHOULD treat such malformed NLRIs as ""Treat-as-withdraw"" 
<xref target="RFC7606"></xref>.  
</t>
</section> 
<section title="Template for Extended IP Components">
<t>
<dl>
<dt>Summary: </dt><dd> One line title summary </dd>
<dt>Component type: </dt><dd> The numerical value for component type. 
If the component value has not been assigned by IANA, this value should 
be in the form TBDx where x is a number (1..N). 
</dd> 
<dt>Description: </dt><dd> Description of what component does. 
</dd>
<dt>What field component targets in IPv4 packet: </dt><dd> The specific field  or 
fields the compnent filters. If the field filter is in the IPv6 packet, 
then this field is left (n/a). </dd>
<dt>What field Filter targets in IPv6 packet: </dt><dd> The specific field  or 
fields the compnent filters. If the field filter is in the IPv4 packet, 
then this field is left (n/a). </dd>
<dt> Length: </dt><dd> Describe the length or possible lengths of this field. 
</dd>
<dt> Encoding of Component Value field </dt> <dd>This is the encoding of the 
value in FSv2 NLRI. The best descriptions combine a diagram plus a description. 
</dd> 
<dt>Ordering within component: </dt><dd> The mechanism to order if multiple 
components of the same type occur. 
</dd> 
<dt>conflicts with other filters: </dt><dd> Describe what other filters this 
component could interfere with. </dd>  
<dt>Example encoding: </dt><dd> Provide one simple example of 
the encoding of a filter for the component. 
</dd> 
<dt>references: </dt><dd>earlier documents which defined this filter. 
</dd>
</dl>
</t>
</section> 
</section> 
<section title="New Extended IP Components">
<section title="TTL (type = 0(0x00) or 14(0x0E))">
<t>
<dl> 
<dt>Summary: </dt><dd> Defines matches for 8-bit (1 octet) TTL field in IPv4 header 
and 8-bit (1 octet) in IPv6 header Hop limit. 
</dd>
<dt>Component Type: </dt> <dd> 0 (0x00) and 14 (0x0E). 
Component type of zero (0x00) places the TTL (IPv4) or Hop limit (IPv6)
filter prior to any other component test. Component ID value of 14 (0x0E) places the
TTL (IPv4)/Hop limit (IPv6) filter after all IP Basic Filters.
</dd> 
<dt>Description: </dt><dd> This component filters IPv4 packets on a certain 
range of values for TTL for IPv4 packets or a range of avalues for Hop Limit for
IPv6 packets. </dd>
<dt>What field Filter targets in IPv4 packet:</dt><dd> TTL field </dd>
<dt>What field Filter targets in IPv6 packet: </dt><dd> Hop Limit field </dd>
<dt>Length: </dt><dd>variable with valid values 2-N in increments of 2 octets. </dd>  
<dt>Encoding of Component: </dt> <dd> 
</dd>
</dl>
</t>
<t> 
<figure>
<artwork> 
TTL Component Value encoding 

&lt;[numeric_op, value]+&gt;

   Figure 3-1 
</artwork>
</figure> 
</t> 
<t>where: 
<dl>
<dt>numeric_op:</dt><dd> 1 octet field can express less than, greater than, or equal. 
The field numeric_op is defined in <xref target="I-D.ietf-idr-fsv2-ip-basic"></xref>.
This is the same format as the numeric-op for FSv1 components.  </dd>
<dt> value: </dt><dd> is a 1 octet value for TTL for IPv4 packets 
and Hop limit for IPv6. </dd>
</dl>
</t>
<t>
<dl>
<dt>ordering of components: </dt><dd> by full value of number_op concatenated with value </dd>
<dt>conflict: </dt><dd>none</dd>
<dt>reference: </dt><dd>draft-bergeon-flowspec-ttl-match-00.txt </dd>
</dl>
</t>
</section>
<section title="Parts of SID (type=16 (0x10))">
<t>
<dl>
<dt>Summary: </dt><dd> IPv6 Service Identifier (SRv6 SID) Filter </dd> 
<dt>Component type: </dt><dd> 16 (0x10) </dd>
<dt>Description: </dt><dd> Filters the SRv6 SEgment Identifier in an IPv6
address associated the Segment Routing Header (SRH) (<xref target="RFC8402"></xref>).
</dd> 
<dt>What field targets in IPv6 Packet: </dt><dd> Segment Routing Header (SRH) 
<dl>
<dt>SID in SRH:</dt><dd> <xref target="RFC8402"></xref> defines SRv6 Segment Identifier (SID) 
   as an IPv6 address explicitly associated with the segment. <xref target="RFC8986"></xref> defines 
   the SID format as: "LOC:FUNCT:ARG" where:
   <list style="symbols">
   <t>locator (LOC) is encoded in the L most significant bits of the SID, followed by </t>
   <t> F bits of function (FUNCT), and </t>
   <t> A bits of arguments (ARG). </t>
  </list>
</dd>
</dl>
</dd>
<dt>Length</dt><dd> The total of three lengths (i.e., LOC length + FUNCT length + ARG
length) MUST NOT be greater than 128.  If it is greater than 128, an
error occurs and it is treated as a withdrawal [RFC7606] and
[RFC4760]. The length of the value field depends on the field type and is 
the length of the SID parts being matched (see Table 3, Figure 3-6) 
in bytes, rounded up if that length is not a multiple of 8. 
</dd>
<dt>Encoding FSv2 Component Value: </dt><dd> This component is expressed as 
 as a list of filter match conditions where a match is expressed as a bit match for 
 some parts of SID (LOC, FUNCT, ARG) or the whole SID.     
<figure>
<artwork>
  
  +------------------+-------------------+
  | type (1 octet)   | Loc-Len (1 octet) |   
  +------------------+-------------------+
  | FUNCT-len (octet)| ARG -len (1 octet)}
  +------------------+-------------------+
  sequence of 
  +--------------------------------------+
  | op (1 octet)     |   value (variable | 
  +------------------+-------------------+
 [type, LOC-Len, FUNCT-Len, ARG-Len, [op, value]+]
 
       Figure 3-2 
 </artwork>
 </figure>
<t>
where:
</t>
<list style="symbols">
<t>type (1 octet):  one type octet determining type of match. 
The only valid value is 0x00 for Parts of SID. </t> 
<t>LOC-Len (1 octet):  This indicates the length in bits of LOC  in SID.
</t>
<t>FUNCT-Len (1 octet):  This indicates the length in bits of FUNCT in SID.
</t>
<t>ARG-Len (1 octet):  This indicates the length in bits of ARG in SID.
</t>
<t>[op, value]+:  This contains a list of {operator, value} pairs that are used to match some parts of SID. 
</t>
</list> 
</dd>
<dt>The operator (op) byte: </dt><dd> is encoded as:  
<figure> 
<artwork>
      0   1   2   3   4   5   6   7
    +---+---+---+---+---+---+---+---+
    | e | a | field type|lt |gt |eq |
    +---+---+---+---+---+---+---+---+
            Figure 3-3

</artwork>
</figure> 
<dl>
<dt>where: </dt><dd>the behavior of each operator bit has clear similarity with that
of [RFC8955]'s Numeric Operator field. 
<dl> 
<dt>e (end-of-list bit):</dt><dd>Set in the last {op, value} pair in the sequence.
</dd>
<dt>a - AND bit: </dt><dd> If unset, the previous term is logically ORed with the
current one.  If set, the operation is a logical AND.  It should be
unset in the first operator byte of a sequence.  The AND operator has
higher priority than OR for the purposes of evaluating logical
expressions.
</dd> 
</dl>
</dd>
<dt>field type: </dt><dd>3 bits with the following meanings: 
<dl>
<dt>000: </dt><dd>SID's LOC</dd>
<dt>001: </dt><dd>SID's FUNCT </dd>
<dt>010: </dt><dd>SID's ARG </dd>
<dt>011: </dt><dd>SID's LOC:FUNCT (the concatenation of the LOC and FUNCTION fields) 
</dd>
<dt>100: </dt><dd>SID's FUNCT:ARG (the concatenation of the FUNCTION and ARG fields) 
</dd>
<dt>101: </dt><dd>SID's LOC:FUNCT:ARG (the concatenation of the FUNCTION and ARG fields) 
</dd>
<dt>Note: </dt><dd> For an unknown field type, Error Handling is to "treat as withdrawal" [RFC7606]
and [RFC4760].</dd> 
</dl>
</dd>
<dt>lt: </dt><dd>less than comparison between data' and value'.
</dd>
<dt>gt: </dt><dd> greater than comparison between data' and value'.
</dd>
<dt>eq: </dt><dd> equality between data' and value'. </dd>
<dt>use of lt,gt, and eq: </dt> <dd>The data' and value' used in lt, 
gt and eq are indicated by the field type in an operator and the value field following the operator.
</dd>
</dl>
<t>
<figure>
<artwork>
         Table 3-1  SID Parts fields 

       +-----------------------+------------------------------+
       | Field Type            | Value                        |
       +=======================+==============================+
       | SID's LOC             | value of LOC bits            |
       +-----------------------+------------------------------+
       | SID's FUNCT           | value of FUNCT bits          |
       +-----------------------+------------------------------+
       | SID's ARG             | value of ARG bits            |
       +-----------------------+------------------------------+
       | SID's LOC:FUNCT       | value of LOC:FUNCT bits      |
       +-----------------------+------------------------------+
       | SID's FUNCT:ARG       | value of FUNCT:ARG bits      |
       +-----------------------+------------------------------+
       | SID's LOC:FUNCT:ARG   | value of LOC:FUNCT:ARG bits  |
       +-----------------------+------------------------------+
                          

</artwork>
</figure>
</t>
<t>
<figure>
<artwork>
        ------------------ SID,  128 bits ----------------
       /                                                  \ 
      +-----------+-----------+-----------+----------------+
      |    LOC    |   FUNCT   |    ARG    |      ...       |
      +-----------+-----------+-----------+----------------+
       \         / \         / \         / \              /
          j bits     k bits       m bits    128-j-k-m bits
       \                     /
         LOC:FUNCT, j+k bits
                   \                     /
                     FUNCT:ARG, k+m bits
       \                                 /
         -- LOC:FUNCT:ARG, j+k+m bits –

                    Figure 3-4

</artwork>
</figure>
</t>
</dd>
<dt>Dependency between components: </dt> <dd> TBD </dd>
<dt>conflicts between components: </dt><dd> TBD </dd> 
<dt>Examples in: </dt><dd> TBD </dd>
<dt>reference: </dt><dd><xref target="I-D.ietf-idr-flowspec-srv6"></xref> 
</dd>
</dl>
</t> 
</section> 
</section> 
<section title="Proposed Extended IP Components and Filter Groups ">
<t>This section provides suggested templates for existing proposals
for components and Extended IP Filter Groups.  
This section will be deleted prior to publication, and the 
proposals moved to individual drafts. 
</t> 
<section title="NRP ID Filter(type=17) (0x11)">
<t>
<dl>
<dt>Summary: </dt><dd>Network Resource Partition ID Component </dd>
<dt>Description: </dt><dd>This filters an Option in 
 the Next-Hop-Options header in IPv6 packet (<xref target="RFC8402"></xref>, section 4).
  A Network Resource Partition (NRP) option carries around the network resource 
  partition information (NRP) in the Hop-by-Hop options header (<xref target="I-D.ietf-6man-enhanced-vpn-vtn-id"></xref>). 
  This IPv6 Extension head has:
   <dl> 
   <dt>Flags (flags): </dt><dd>This is a 8 bit flag field in a single octet.  One bit, "S" defined in most significant bit. The 
     S stands for strict match of NRP ID field. The NRP Flags field is filtered for by the FSv2 component Flags field. 
   </dd>
   <dt>Context type (CT): </dt><dd> 1 octet field indicating the semantics and length of NRP-ID field.  The value of CT=0
   indicates a 4-octet NRP ID, F bits of function (FUNCT), and A bits of arguments (ARG). </dd>
  </dl>
</dd>
<dt>What filtering in IPv6 Packet: </dt><dd>IPv6 Hop-by-Hop Options Header (<xref target="RFC8402"></xref>)
</dd>
<dt>FSv2 NRP ID Component value field: </dt><dd> Defines match for NRP ID in the 
NRP option of Hop-by-Hop Header. This FSv2 component has following format: 

<figure>
<artwork>
 
        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
                                       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
                                       |  Option Type  |  Opt Data Len |
       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
       |     Flags                     |            Reserved           |
       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
       |                           NRP ID                              |
       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
	   
	         Figure 4-1:  NRP FSv2 Component 
</artwork>
</figure>
where: 
<dl>
<dt> Flags: </dt><dd> This field is 2 octets with only the most signficant bit defined as Global Bit (g). 
<dl> 
<dt>Global bit (g): </dt><dd> When set, it indicates the NRP ID to be matched with a globally unique NRP ID. 
Otherwise, the NRP-ID is to be a domain significant NRP ID.  The global NRP ID has been 
coordinated among these domains. 
</dd>
</dl>
</dd> 
<dt>Reserved: </dt><dd> This a 2-octet field reserved for future use. 
It SHOULD be set to zero on transmission and MUST be ignored on receipt. 
</dd>
<dt>NRP ID: </dt><dd> This is a 4-octet identifier which is used to identify an NRP
</dd>
</dl> 
</dd>
<dt>Interactions with:</dt><dd> None </dd> 
<dt>reference:</dt><dd> <xref target="I-D.ietf-idr-flowspec-network-slice-ts"></xref>
</dd>
</dl>
</t>
</section> 
<section title="IP Payloads Match type=18 (0x12)) ">
<t>
<dl>
<dt>Summary: </dt><dd> IP Payload filter 
</dd>
<dt>Description: </dt><dd> Flexible Deep packet filters </dd>
<dt>IP Packet filtering: </dt><dd>IPv4 and/or IPv6 
</dd>
<dt>What filtering in packet: </dt><dd>Data in header or within the payload.  
</dd>
<dt>Encoding: </dt><dd> The filter has an offset to filter data from the point specified in the "offset-type field" for 
using a filter of specific length (content-length) with a specific pattern (content).  The type of packet
IPv4 or IPv6 is specified in Type of IP packet.
<t>  
The structure of the component is: 
<figure>
<artwork>
 
        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
                                       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
                                       |  Option Type  | component Len |
       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
       | PType | Otype |   offset  (offset-value)      | content length|
       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
       |                        content                                |
       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
	   
	         Figure 4-2: FSv2 IP Payload Match Component 
</artwork>
</figure>
</t>
Where the 
<list style="symbols">
<t> Ptype - 4 bit field indicating the packet type via AFI (IPv4 or IPv6) 
<list> 
<t> IPv4 = 1 </t>
<t> IPv6 = 2 </t> 
</list> 
</t> 
<t> Otype - 4 bit field indicating the offset type where 
<list>
<t> 0 = IP header </t>
<t> 1 = IP header data </t> 
<t> 2 = Data within TCP/UDP  </t> 
</list>
</t> 
<t> offset - is number of bytes to the payload from the point defined by Ptype and Otype. 
</t> 
<t> content length - length of the content. 
</t>
<t> content - content filter field to match (significant field bit zero). 
</t>
</list>
</dd>
<dt>Ordering within component:</dt><dd> (TBD)</dd>
<dt>Interacts with components: </dt><dd> (TBD) </dd> 
<dt>reference: </dt><dd> <xref target="I-D.cui-idr-content-filter-flowspec"></xref>
</dd> 
</dl>
</t>
 </section> 
<section title="Group ID (type=19 (0x13))">
<t>
<dl>
<dt>Summary: </dt><dd>Filter on Group ID 
</dd>
<dt>Description: </dt><dd> Flexible filters on group identifiers </dd>
<dt>IP Packet filtering: </dt><dd>IPv4 or IPv6 
</dd>
<dt>What filtering: </dt><dd>Group ID specified sub-type 
</dd>
<dt>What Filtering in Packet: </dt><dd>The filter looks for a specific type of 
group ID within either the IPv4 or IPv6 packet header.  
</dd>
<dt>Encoding of component: </dt><dd> The structure of the component 
is the following  
<t>
<figure>
<artwork>
 
        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
                                       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
                                       |  Option Type  |  Opt Data Len |
       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
       | Packet Type   | Offset type   | Group type    | SubGroup type |       
       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
       | Offset value                  |  GMask length | SG Mask length| 
       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+         
       |                        Group Mask                             |
       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
       |                        Group ID value                         |
       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+  
       |                        Sub-Group Mask                         |
       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
       |                        Sub-Group Value                        |
       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 
	         Figure 4-3: FSv2 IP Payload Match Component 
</artwork>
</figure>
</t>
<t>Where the 
<list style="symbols">
<t> Packet type - 8 bit field indicating the packet type 
<list> 
<t> IPv4 = 1 </t>
<t> IPv6 = 2 </t> 
</list> 
</t> 
<t> Offset type - 4 bit field indicating the offset type where 
<list>
<t> 0 = IP header </t>
<t> 1 = IP header data </t> 
<t> 2 = Data within TCP/UDP  </t> 
</list>
</t> 
<t> offset - is number of bytes to the payload from the point defined by Ptype and Otype. 
</t> 
<t> Group type - 1 octet field indicating the type of group ID 
<list>
<t> 0 = Reserved </t>
<t> 1 = Indirection ID </t> 
<t> 2 = Interface group </t> 
<t> 3 = CATS ID </t> 
<t> 4 = SAV ID  </t> 
<t> 5 = APN ID  </t> 
</list>
</t> 
<t> Sub-Group type - Sub group within filters.  
<list>
<t> 0 = Reserved </t>
<t> 1 = data traffic (Inbound/outbound) </t>
<t> 1 = data traffic  Inbound only  </t>
<t> 2 = data traffic  outbound only  </t>
</list>
</t> 
<t> Group Mask - (variable) Group field mask 
</t>
<t> Group ID value - (variable) Group ID value to match 
</t>
<t>Sub Group Mask - (variable) Sub-Group Mask
</t>
<t>Sub-Group Value - (variable) Sub-Group value to match on
</t> 
</list>
</t>
</dd>
<dt>Ordering within component: </dt><dd>TBD
</dd>
<dt>Dependency between components: </dt><dd> TBD
</dd>
<dt>Donflicts with other components:  </dt><dd>(TBD) 
</dd>
<dt>Reference: </dt><dd> TBD (just a sample) </dd>
<dt>Note: </dt><dd>In addition, the Group will need to define a 
registries for Group types and sub-group types. 
</dd>
</dl>
</t>
</section> 
<section title="Proposed Filter Groups">
<t>Three new Extended IP filter groups could be created from 
these filters for SRv6, SRv6+Payload, SRv6 + groups. 
Tables 3-x, 3-x, and 3-y show these grouping. 
These groups are simply suggests for the proposed 
individual drafts to consider. 
</t>
<t> 
<figure>
<artwork>
 Table 4-1 SR + Payload Filters 
          
SubTLV    Extended IP Filters Components 
-type     for IP Extended Filters version 2
--------  ----------------------------------
   0 -    TTL 
   1 -    IP Destination prefix 
   2 -    IP Source prefix 
   3 –    IPv4 Protocol od 
          IPv6 Upper Layer Protocol
   4 –    Port  
   5 –    Destination Port 
   6 –    Source Port
   7 –    ICMPv4 type or ICMPv6 type  
   8 –    ICMPv4 code or ICMPv6 code 
   9 –    TCP Flags 
  10 –    Packet length
  11 –    DSCP  
  12 –    Fragment 
  13 –    Flow Label 
  14 -    TTL 
  15 -    Reserved 
  16 -    SID in Routing IPv6 Header 
  17 -    NRP-ID in Hop-by-Hop IPv6 Header
  18 -    Payload 
</artwork>
</figure>
</t>
<t>
<figure>
<artwork>
 Table 4-2 SR + Payloads + Group Filters 
          
SubTLV    Extended IP Filters Components 
-type     for IP Extended Filters version 2
--------  ----------------------------------
   0 -    TTL 
   1 -    IP Destination prefix 
   2 -    IP Source prefix 
   3 –    IPv4 Protocol od 
          IPv6 Upper Layer Protocol
   4 –    Port  
   5 –    Destination Port 
   6 –    Source Port
   7 –    ICMPv4 type or ICMPv6 type  
   8 –    ICMPv4 code or ICMPv6 code 
   9 –    TCP Flags 
  10 –    Packet length
  11 –    DSCP  
  12 –    Fragment 
  13 –    Flow Label 
  14 -    TTL 
  15 -    Reserved 
  16 -    SID in Routing IPv6 Header 
  17 -    NRP-ID in Hop-by-Hop IPv6 Header
  18 -    Payload
  19 -    Group filters   
</artwork>
</figure>
</t>
</section>  
</section> 
<section title="Validation and Error Handling">
<t>Validation of the FSv2 NLRI follows the rules from 
section 4.1 of <xref target="I-D.ietf-idr-fsv2-ip-basic"></xref>. 
For ease of reference to this validation procedure, 
the implementer might consider the following facts: 
<dl>
<dt> Extended IP filters - </dt> <dd> are passed as either IPv4 
(AFI=1, SAFI=TBD1), IPv6 (AFI=2, SAFI=TBD1), 
IPv4 VPN (AFI=1, SAFI=TBD2), IPv6 VPN (AFI=2, SAFI=TBD2).  
or (AFI=2) SAFI=TBD1 or SAFI=TBD2.  </dd>
<dt> IP Extended filters sent in SAFI=TBD1 - </dt> 
<dd> are validated against SAFI=1.  To be specific, 
(AFI=1, SAFI=TBD1) is validated against (AFI=1, SAFI=1), 
and (AFI=2, SAFI=TBD1) is validasted against (AFI=2, SAFI=1).</dd>
<dt> IP Extended filters sent in SAFI=TBD2 - </dt>
<dd> are validated against SAFI=128.  To be specific, 
(AFI=1, SAFI=TBD2) is validated against (AFI=1, SAFI=128) AND
(AFI=2, SAFI=TBD2) is validated against (AFI=2, SAFI=128). 
</dd> 
</dl>
</t>
<t> Validation of the FSv2 NLRI follows the rules from 
section 4.2 of <xref target="I-D.ietf-idr-fsv2-ip-basic"></xref>
apply to the FSV2 NLRI filters. For ease of reference to 
this section, implementers might consider the following facts:
<dl>
<dt>FSv2 defines a Rule-0 for 0/0 with "permit-all" action. - </dt>
<dd>By default, FSv2 (and FSv1) restrict the flow from permit all. 
By configuration, Rule-0 could be set to 0/0 with "permit-none" 
and filters could have the benefit of allowing traffic.  If this 
configuration knob is set, then it MUST be used in a limited Domain 
of cooperating networks. </dd> 
<dt> FSv2 rules are ordered by ascending user order number,
FSv2 Filter type, FSv2 component type, and FSv2 component value. </dt>
<dd>This ordering rules means that multiple FSv2 filter rules 
with the same user order number of ordered by ascending FSv2 filter types 
(IP Basic (0x01) and Extended IP Filters (0x02)).  If the FSv2 filter 
has the same user order and Filter type, then the order 
is by ascending FSv2 component type numbers.  Finally, if 
FSv2 filters have the same user order, Flter type, component type, 
then the filter is ordered by the component value.    
</dd> 
<dt>Order is deterministic, but arbitrary. </dt> <dd> Users may 
use the user ordering and dependency chain to establish more complex
relationships. </dd>
</dl> 
</t> 
<t> The following two error handling rules stated in 
Section 4.1.3 of <xref target="I-D.ietf-idr-fsv2-ip-basic"></xref>
 must be followed by all BGP speakers:
<dl>
<dt>1) FSv2 NLRI having TLV which do not have the correct 
length or syntax </dt> <dd> must be considered MALFORMED.
Syntax is defined as having each field within NLRI header  
(order, dependent filters chain and within the  
FSv2 TLV (IP Basic TLV or Extended TLV) header, and each 
component. Any MALFORMED FSv2 NLRI is handled as "TREAT AS WITHDRAW"
per <xref target="RFC7606"></xref>.</dd> 
<dt>2) Any FSV2 NLRI which do not follow the ordering rules </dt>
<dd>described in section 4 <xref target="I-D.ietf-idr-fsv2-ip-basic"></xref> 
for filters is considered MALFORMED. </dd>
</dl>
</t>
<t> Actions are transmitted on Extended Communities (EC) for 
FSv2 basic actions (FSv2-EC) or BGP Community path attribute (CPA) 
with FSv2 TLV (FSv2-CPA). The following rules MUST be followed
by the FSv2 actions: 
<dl>
<dt>If BGP Community Path Attribute is not supported, then: </dt><dd>FSv2-EC MUST be ordered by FSv2 default order 
(see <xref target="I-D.ietf-idr-fsv2-ip-basic"></xref>) if one of the two conditions is not present:
<list style="symbols">
<t>Implement configuration knob that implementation specific order
is set </t>
<t>Action Chain Order (ACO) FSV2-EC is attached with the 
Action dependency set to implementation specific </t>
</list>
</dd>  
<dt>If a BGP Community Path Attribute with a FSv2 TLV (FSv2-CPA)is supported and attached 
in an invalid form, then: </dt><dd>the FSv2-CPA is ignored and not forwarded. </dd>
<dt>If BGP Community Path Attribute with a FSv2 TLV (FSv2-CPA) is supported and 
a valid FSv2-CPA is attached, then: </dt><dd> the FSv2-CPA takes precedence over FSv2-EC. 
The BGP Community Path attribute allows for user ordering with 
user order values of [1-N]. By default, the FSv2-EC follow the FSv2-CP actions 
(N+1) with all FSv2-EC on the same user order number.  Early deployments
of FSv2-CPA may want to reverse this order (first FSv2-EC, then BGP Community Path attribute). 
If so, FSv2-EC should be defined as [action order 0] by configuration knob. 
</dd>
</dl>
</t>  
</section> 
<section title="Manageability">
<t>FSv1 is a key part of many existing networks. 
The introduction of FSv2 is expected to be a phased process.
where FSv1 is replaced slowly.  One potential way this might 
occur is the following: 
<dl>
<dt>FSv2 IP basic replaces FSv1 - </dt><dd>A FSv2 implementation 
may simply configure FSv2 with the same IP Basic components 
as used in FSv1, and a user order of 1 for FSv2.  FSv1 would 
be configured with a default user order of 10. The same Extended Communities 
are passed plus an ACO community (Generic Transitive Extended Community (0x01))
with ACO-Dependency of 0x0 (implementation specific) and AC-FAilure (0x00). 
</dd>
<dt>FSv2 IP basic with default Action order </dt><dd> 
ACO FSv2-EC used when FSv2-EC action order is needed to detect conflicts
in actions in remote BGP peers. </dd>
<dt>FSv2 IP basic with flexible user order </dt> <dd>
After the implementations are solid, it is expected that 
networks will use FSv2 user ordering to provide flexible ordering. 
</dd>
<dt>FSv2 Extended IP Filters with no dependency chain are deployed. </dt><dd>
The dependency chain field can be left as zero for any deployment of FSv2
Filter NLRI. </dd>
<dt>FSv2 MPLS Filters with no dependency chain are deployed. </dt><dd>
The default ordering of the filters with the same user order number 
would be IP Basic Filters (0x01), Extended IP Filters (0x02), 
and MPLS Filters (0x03). If MPLS filters need to be done first, then 
the user order of MPLS would need to be lower than Extended IP filters. 
Please note that SRv6 headers are Extended IP Filters so SRv6 takes
precedence over MPLS label filters. </dd>
</dl>
</t> 
</section> 
<section anchor="IANA" title="IANA Considerations">
   <t>This section complies with <xref target="RFC7153"></xref>.
   </t>
   <section title="FSv2 Component types">
   <t>IANA is requested to indicate [this draft] as a reference on the 
   following assignments in the Flow Specification Component Types 
   Registry: 
   </t>
   <t>
   <figure>
   <artwork>
 ID    Name         Reference
 ----  -----------  ----------------- 
  0    TTL          [this document] 
 14    TTL          [this document]
 15    Reserved     [this document] 
 16    Partial SID  [this document] 
 17    NRP ID       [this document] 
  </artwork> 
   </figure>
   </t>
   </section>
   <section title="FSV2 IP Extended Filter Groups">
   <t>IANA is requested to create the following a registry
   for extended IP Filters Group with the following values.
   Registry type is "IETF-Consensus" for values 0x04 to 0xFF. 
   Registry type is "FCFS" for values 0x100 to 0x1FF. 
  <figure>
  <artwork> 
 ID   Group Name    Valid FSV2 
                    component values   Reference
 ---  -----------   ----------------  -----------------
  0   FSv1          0-13              [this document] 
  1   FSv1 + TTL    0-14              [this document]  
  2   SRv6          0-16              [this document] 
  
  Values 0x04  - 0xFF (255) - Assigned via IETF Consensus   
  Values 0x100 - 0x1FF (300-511) - Expert review   
  Values 0x200 - 0x2FF (512-7670 - FCFS 
 </artwork>
 </figure> 
   </t>
   <t> A template for requesting the IP Filters group 
   assignment is given below. 
   </t>
<section title="Template for Requesting FSv2 Extended Filters  Group">
<t>
<dl>
<dt>Name: </dt><dd> Provide a short name (10 characters, maximum)</dd> 
<dt>Summary: </dt><dd> One line title summary </dd>
<dt>Component IDs included:  </dt><dd> The numerical value for component ID type.  
</dd> 
<dt>Type of Group Assignment: </dt><dd> This should either be IETF Consensus, 
Expert review or FCFS. </dd>
<dt>Document reference: </dt><dd> document that defines group </dd>
<dt>Contact: </dt><dd> Person making request </dd> 
</dl>
</t>
</section>
   </section>
 </section>
 <section title="Security Considerations">
   <t>The use of ROA improves on <xref target="RFC8955"></xref>
   by checking to see of the route origination. This check can improve the 
   validation sequence for a multiple-AS environment.  
   </t>
   <t>>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="RFC9117"></xref>
   can provide adequate validation for distribution of flow specification within a 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">
	  &RFC0791;
      &RFC2119;
	  &RFC3032;
      &RFC4271;
	  &RFC4360;
	  &RFC4760;
	  &RFC5065;
	  &RFC5701;
	  &RFC6482;
	  &RFC7153;
	  &RFC7606;
	  &RFC8174;
	  &RFC8955;
	  &RFC8956;
	  &RFC9015;
	  &RFC9117;
	  &RFC9184;
	  &RFC9582;
	  &I-D.hares-idr-bgp-community-attribute;
	  &I-D.ietf-idr-flowspec-l2vpn;
	  &I-D.ietf-idr-flowspec-nvo3;
	  &I-D.ietf-idr-flowspec-srv6;
	  &I-D.ietf-idr-flowspec-interfaceset;
	  &I-D.ietf-idr-flowspec-path-redirect;
	  &I-D.ietf-idr-flowspec-mpls-match;
	  &I-D.ietf-idr-bgp-flowspec-label;
  	  &I-D.ietf-idr-flowspec-network-slice-ts;
	  &I-D.ietf-6man-enhanced-vpn-vtn-id;
	  &I-D.ietf-idr-fsv2-ip-basic;
	</references>
	<references title="Informative References">
	&RFC6241; 
	&RFC8040;
	&RFC8205;
	&RFC8206;
	&RFC8300;
	&RFC8402; 
	&RFC8986;
	&I-D.ietf-idr-flowspec-v2;
    &I-D.cui-idr-content-filter-flowspec; 
	&I-D.hares-idr-fsv2-more-ip-actions; 
	 </references>
  </back>
</rfc>