<?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. -->
<!ENTITY RFC2119 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml">
<!ENTITY RFC6241 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.6241.xml">
<!ENTITY RFC7950 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.7950.xml">
<!ENTITY RFC7149 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.7149.xml">
<!ENTITY RFC7426 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.7426.xml">
<!ENTITY RFC8299 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.8299.xml">
<!ENTITY RFC8309 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.8309.xml">
<!ENTITY RFC8340 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.8340.xml">
<!ENTITY RFC8453 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.8453.xml">
<!ENTITY RFC8174 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.8174.xml">
<!ENTITY RFC8345 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.8345.xml">
]>
<?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-he-idr-bgp-flowspec-ifit-02"
     ipr="trust200902">
  <front>
    <title>BGP Extensions to Enable BGP FlowSpec based IFIT</title>

    <author fullname="Xiaoming He" initials="X." surname="He">
      <organization>China Telecom</organization>

      <address>
        <email>hexm4@chinatelecom.cn</email>
      </address>
    </author>

    <author fullname="Aijun Wang" initials="A." surname="Wang">
      <organization>China Telecom</organization>

      <address>
        <email>wangaj3@chinatelecom.cn</email>
      </address>
    </author>

    <author fullname="Weiqiang Cheng" initials="W." surname="Cheng">
      <organization>China Mobile</organization>

      <address>
        <email>chengweiqiang@chinamobile.com</email>
      </address>
    </author>
    
    <author fullname="Jie Dong" initials="J." surname="Dong">
      <organization>Huawei</organization>

      <address>
        <email>jie.dong@huawei.com</email>
      </address>
    </author>

    <author fullname="Xiao Min" initials="X." surname="Min">
      <organization>ZTE Corp.</organization>

      <address>
        <email>xiao.min2@zte.com.cn</email>
      </address>
    </author> 

    <date year="2026"/>

    <area>IDR</area>

    <workgroup>IDR Working Group</workgroup>

    <keyword>In-situ Flow Information Telemetry</keyword>

    <abstract>
      <t>Border Gateway Protocol (BGP) Flow Specification (FlowSpec)
   is an extension to BGP that supports the dissemination of traffic
   flow specifications and resulting actions to be taken on packets in a
   specified flow. In-situ Flow Information Telemetry (IFIT) denotes a family of flow-oriented on-path telemetry techniques, which can provide high-precision flow insight and real-time network
   issue notification. This document defines BGP extensions to distribute BGP FlowSpec based traffic filtering carrying IFIT information. So IFIT
   behavior can be applied to the specified flow automatically.</t>
    </abstract>
  </front>

  <middle>
    <section anchor="Introduction" title="Introduction">
      <t>Border Gateway Protocol (BGP) Flow Specification defined in [RFC8955] and [RFC8956] (FlowSpec)
   is an extension to BGP that supports the dissemination of traffic
   flow specifications and resulting actions to be taken on packets in a
   specified flow. It leverages the BGP Control Plane to simplify the
   distribution of ACLs (Access Control Lists). Using the Flow
   Specification extension, new filter rules can be injected to all BGP
   peers simultaneously without changing router configuration.</t>

      <t>BGP Flow Specification [RFC8955] and [RFC8956] define some BGP Network Layer
   Reachability Information (NLRI) formats used to distribute traffic
   flow specification rules. The NLRI for (AFI=1, SAFI=133) specifies
   IPv4 unicast filtering and the NLRI for (AFI=1, SAFI=134) specifies
   IPv4 BGP/MPLS VPN filtering [RFC7432]. The NLRI for (AFI=2, SAFI=133) specifies
   IPv6 unicast filtering and the NLRI for (AFI=2, SAFI=134) specifies
   IPv6 BGP/MPLS VPN filtering. The Flow Specification match
   part defined in [RFC8955]and[RFC8956]include L3/L4 information like IPv4/6
   source/destination prefix, protocol, ports.</t>

   <t>In-situ Flow Information Telemetry (IFIT) denotes a family of flow-
   oriented on-path telemetry techniques,which can provide high-precision flow insight and real-time network
   issue notification.In particular, IFIT refers to network OAM (Operations, Administration,
   and Maintenance) data plane on-path telemetry techniques, including
   In-situ OAM (IOAM) [RFC9197] and Alternate Marking [RFC9341]. It can
   provide flow information on the entire forwarding path on a per-
   packet basis in real time.</t>

      <t>With the evolution of IP carried networks towards the intent-based and autonomous networks,flexible
   deployment of IFIT based on network dynamics and service requirements is getting a must. [I-D.draft-ietf-idr-sr-policy-ifit] defines BGP extensions to
   distribute SR policies carrying IFIT information so that IFIT
   behavior can be enabled automatically when the SR policy is applied. IFIT Attributes Sub-TLV is encoded in the Tunnel Encapsulation Attribute  (23)  defined in
   [RFC9012] using a new Tunnel-Type called SR Policy Type with
   codepoint 15. Once the IFIT attributes are signalled, if a packet arrives at the
   headend and, based on the types of steering described in [RFC9256],
   it may get steered into an SR Policy where IFIT methods are applied. However, in this way, IFIT is only applicable to SR policy environment. On the other hand, it cannot leverage the BGP FlowSpec to automatically configure traffic flow filtering to steer a packet flow into a valid SR Policy.</t>

      <t>This document defines the BGP extensions to
distribute BGP FlowSpec based traffic filtering together with IFIT information. So the IFIT
behavior can be applied to the specified flow automatically. In this way, IFIT is automatically enabled and running.</t>

      
    </section>

    <section title="Conventions">
    
     <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
      <xref target="RFC2119"/> <xref target="RFC8174"/> when, and only when,
      they appear in all capitals, as shown here.</t>
     </section>

     <section title="Terminology">
      <t>Abbreviations used in this document:</t>
      <t>ACL:     Access Control List</t>
      <t>AFI:     Address Family Identifier</t>
	 <t>AS:      Autonomous System</t>
      <t>DEX:     Direct Exporting</t>
      <t>IFIT:    In-situ Flow Information Telemetry</t>
      <t>IOAM:    In situ Operation, Administration, and Maintenance</t>
      <t>NLRI:    Network Layer Reachability Information</t>
      <t>OAM:     Operation, Administration, and Maintenance</t>
      <t>SAFI:    Subsequent Address Family Identifier</t>
     </section>
    </section>

    <section title="IFIT Attribute">
      <t>IFIT attribute is an optional non-transitive BGP path
   attribute.  IANA is requested to allocate the reserved value as the type code of the
   attribute in the "BGP Path Attributes" registry [IANA-BGP-PARAMS].
   The attribute is composed of a set of Type-Length-Value (TLV)
   encodings.  Each TLV contains information corresponding to a
   particular IFIT type.  An IFIT TLV is structured as shown in Figure 1.<figure title="IFIT TLV">
   <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
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |    IFIT Type (2 octets)       |        Length (2 octets)      |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |                                                               |
  |                        Value (variable)                       |
  |                                                               |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+</artwork>
        </figure></t>

      <t>IFIT Type (2 octets):  Identifies a type of IFIT. This document defines two types of IFIT as follows.

      <list style="symbols">
      <t>When the IFIT Type is 1, it is the IOAM Type [RFC9197], [RFC9326].</t>

      <t>When the IFIT Type is 2, it is the AltMark Type [RFC9343].</t>
      </list>
      </t>

      <t>Length (2 octets): The total number of octets of the Value field.</t>

      <t>Value (variable):  Comprised of one or multiple sub-TLVs.</t>

      <t>Each sub-TLV consists of three fields: A 1-octet type, a 1-octet length, and zero or more octets of
   value.  A sub-TLV is structured as shown in Figure 2.<figure title="IFIT Sub-TLV">
      <artwork>
                 +--------------------------------+
                 |    Sub-TLV Type (1 octet)      |
                 +--------------------------------+
                 |    Sub-TLV Length (1 octet)    |
                 +--------------------------------+
                 |    Sub-TLV Value (variable)    |
                 +--------------------------------+</artwork>
        </figure></t>

      <t>Sub-TLV Type (1 octet): Each sub-TLV type defines a certain OAM option
      about the IFIT TLV that contains this sub-TLV.</t>

	 <t>Sub-TLV Length (1  octet): The total number of octets of the
      Sub-TLV Value field.</t>

	 <t>Sub-TLV Value (variable): Encoding of the Value field depends on the
      sub-TLV type.  The following subsections define the encoding in
      detail.</t>
     </section>

    <section title="IFIT Attribute Sub-TLVs">

	 <t>This section specifies a number of sub-TLVs. These sub-TLVs can be
   included in two TLVs of the IFIT attribute.</t>

      <t>For IFIT Type 1, namely the IOAM Type, four sub-TLVs are defined in this document as follows:

      <list style="symbols">
      <t>IOAM Pre-allocated Trace Option [RFC9197] Sub-TLV, Type=1.</t>

      <t>IOAM Incremental Trace Option [RFC9197] Sub-TLV, Type=2.</t>

      <t>IOAM Directly Export (DEX) Option [RFC9326] Sub-TLV, Type=3.</t>

      <t>IOAM Edge-to-Edge Option [RFC9197] Sub-TLV, Type=4.</t>
     </list></t>

      <t>For IFIT Type 2, namely the AltMark Type, two sub-TLVs are defined in this document as follows:

      <list style="symbols">
      <t>Alternate Marking [RFC9343] Sub-TLV, Type=1.</t>

      <t>Enhanced Alternate Marking sub-TLV,  Type=2.</t>
     </list></t>

      <section title="IOAM Sub-TLVs">

        <t>IOAM Sub-TLVs include four sub-TLVs, and every sub-TLV structure is defined in the following subsections.</t>

        <section title="IOAM Pre-allocated Trace Option Sub-TLV">
        
        <t>The IOAM tracing data is expected to be collected at every node that
   a packet traverses to ensure visibility into the entire path a packet
   takes within an IOAM domain.  The preallocated tracing option will
   create pre-allocated space for each node to populate its information.
The structure of IOAM pre-allocated trace option sub-TLV is defined as follows:<figure title="IOAM Pre-allocated Trace Option Sub-TLV">
      <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
   +---------------+---------------+-------------------------------+
   |    Type=1     |   Length=6    |        Namespace ID           |
   +---------------+---------------+---------------+-------+-------+
   |                   IOAM Trace Type             | Flags | Rsvd  |
   +-----------------------------------------------+-------+-------+</artwork>
        </figure></t>

	   <t>Type: 1 (to be assigned by IANA).</t>

	   <t>Length: 6, the total number of octets of the Sub-TLV Value field.</t>

	   <t>Namespace ID: A 16-bit identifier of an IOAM-Namespace. The
   definition is described in section 4.4 of [RFC9197].</t>

 	   <t>IOAM Trace Type: A 24-bit identifier which specifies which data types
   are used in the node data list.  The definition is
   described in section 4.4 of [RFC9197].</t>

        <t>Flags: A 4-bit field. The definition is described in
   [RFC9322] and section 4.4 of [RFC9197].</t>

        <t>Rsvd: A 4-bit field reserved for further usage. It MUST be zero and
   ignored on receipt.</t>
	    </section>

	    <section title="IOAM Incremental Trace Option Sub-TLV">	    

         <t>The incremental tracing option contains a variable node data fields
   where each node allocates and pushes its node data immediately
   following the option header. The structure of IOAM incremental trace option sub-TLV is defined as
   follows:<figure title="IOAM Incremental Trace Option Sub-TLV">
      <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
   +---------------+---------------+-------------------------------+
   |    Type=2     |   Length=6    |        Namespace ID           |
   +---------------+---------------+---------------+-------+-------+
   |               IOAM Trace Type                 | Flags | Rsvd  |
   +-----------------------------------------------+-------+-------+</artwork>
        </figure></t>

	    <t>Type: 2 (to be assigned by IANA).</t>

	    <t>Length: 6, the total number of octets of the Sub-TLV Value field.</t>

	    <t>All the other fields definitions are the same as the pre-allocated
   trace option sub-TLV in section 4.1.1.</t>
	    </section>

	    <section title="IOAM Directly Export (DEX) Option Sub-TLV">  
	    
   	    <t>IOAM DEX option is used as a trigger for IOAM data to be
   directly exported to a collector without being pushed into in-flight
   data packets. The structure of IOAM DEX sub-TLV is defined as
   follows:<figure title="IOAM DEX Option Sub-TLV">
      <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
                                   +---------------+---------------+
                                   |    Type=3     |   Length=12   |
   +-----------------------------------------------+---------------+
   |        Namespace ID           |    Flags      |Extension-Flags|
   +-------------------------------+---------------+---------------+
   |               IOAM Trace Type                 |      Rsvd     |
   +-----------------------------------------------+---------------+
   |                         Flow ID                               |
   +---------------------------------------------------------------+</artwork>
         </figure></t>

         <t>Type: 3 (to be assigned by IANA).</t>

	    <t>Length: 12, the total number of octets of the Sub-TLV Value field.</t>

	    <t>Namespace ID: A 16-bit identifier of an IOAM-Namespace. The
   definition is described in section 4.4 of [RFC9197].</t>

	    <t>Flags: A 8-bit field. The definition is described in
   section 3.2 of [RFC9326].</t>

	    <t>Extension-Flags: A 8-bit field. The definition is described in
   section 3.2 of [RFC9326]. Every bit in the Extension-Flag field that is set to 1 indicates the existence
      of a corresponding optional 4-octet field. Bit 0 (the most significant bit) is defined as Flow ID and bit 1 as Sequence Number. Flow ID may be uniquely assigned by the collector. In this document, when bit 1 is set to 1, Sequence Number MUST be sequently assigned by the headend device (encapsulating node).</t>
   
 	    <t>IOAM Trace Type: A 24-bit identifier which specifies which data types
   are used in the node data list.  The definition is
   described in section 4.4 of [RFC9197].</t>

         <t>Rsvd: A 4-bit field reserved for further usage. It MUST be zero and
   ignored on receipt.</t>

   	    <t>Flow ID: A 32-bit flow identifier. The definition is
   described in section 3.2 of [RFC9326]. Flow ID may be uniquely assigned by the collector.</t>
	   </section>

	   <section title="IOAM Edge-to-Edge Option Sub-TLV"> 

	   <t>The IOAM edge-to-edge option is to carry data that is added by the
   IOAM encapsulating node and interpreted by IOAM decapsulating node.
The structure of IOAM edge-to-edge option sub-TLV is defined as follows:<figure title="IOAM Edge-to-Edge Option Sub-TLV">
      <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
                                   +---------------+---------------+
                                   |    Type=4     |    Length=4   |
   +-----------------------------------------------+---------------+
   |        Namespace ID           |         IOAM E2E Type         |
   +-------------------------------+-------------------------------+</artwork>
         </figure></t>

         <t>Type: 4 (to be assigned by IANA).</t>

	    <t>Length: 4, the total number of octets of the Sub-TLV Value field.</t>

	    <t>Namespace ID: A 16-bit identifier of an IOAM-Namespace. The
   definition is described in section 4.4 of [RFC9197].</t>

	    <t>IOAM E2E Type: A 16-bit identifier which specifies which data types
   are used in the E2E option data. The definition is
   described in section 4.6 of [RFC9197].</t>
         </section>
        </section>

	  <section title="AltMark Sub-TLVs">

	  <t>AltMark Sub-TLVs include two sub-TLVs, and every sub-TLV structure is defined in the following subsections.</t>

	   <section title="Alternate Marking Sub-TLV">

	   <t>The structure of Alternate Marking sub-TLV is defined as
   follows:<figure title="Alternate Marking Sub-TLV">
        <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
                                   +---------------+---------------+
                                   |    Type=1     |   Length=4    |
   +-------------------------------+---------------+-+-+-+-+-------+
   |                  FlowMonID                    |L|D|H|E|  Rsvd |
   +-----------------------------------------------+-+-+-+-+-------+</artwork>
         </figure></t>

         <t>Type: 1 (to be assigned by IANA).</t>

	    <t>Length: 4, the total number of octets of the Sub-TLV Value field.</t>

	    <t>FlowMonID: A 20-bit identifier to uniquely identify a monitored flow
   within the measurement domain.  The definition is
   described in section 5.3 of [RFC9343].</t>

   	    <t>L:  1-bit Loss flag set to 1 indicating Packet Loss Measurement as described in
      Section 5.1 of [RFC9343].</t>

   	    <t>D:  1-bit Delay flag set to 1 indicating Packet Delay Measurement as described in
      Section 5.2 of [RFC9343].</t>

   	    <t>H: 1-bit flag set to 1 indicating that the measurement is Hop-by-Hop.</t>

   	    <t>E: 1-bit flag set to 1 indicating that the measurement is End-to-End.</t>

	    <t>Rsvd: 4-bit field reserved for further usage.  It MUST be zero and
   ignored on receipt.</t>
	    </section>

	    <section title="Enhanced Alternate Marking Sub-TLV">

	    <t>The structure of Enhanced Alternate Marking sub-TLV is defined as
   follows:<figure title="Enhanced Alternate Marking Sub-TLV">
         <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
   +---------------+---------------+-------+-+-+-+-+-+-+-+---------+
   |    Type=2     |   Length=6    |Period |L|D|H|E|F|S|M|   Rsvd  |
   +---------------+---------------+-------+-+-+-+-+-+-+-+---------+
   |                           Flow ID                             |
   +---------------------------------------------------------------+</artwork>
         </figure></t>

         <t>Type: 2 (to be assigned by IANA).</t>

	    <t>Length: 6, the total number of octets of the Sub-TLV Value field.</t>

	    <t>Period: 4-bit field used for encoding at most 16 measuement periods. The definition of its value and the corresponding measuement period is out of this document.</t>

   	    <t>L:  1-bit Loss flag set to 1 indicating Packet Loss Measurement as described in
      Section 5.1 of [RFC9343].</t>

   	    <t>D:  1-bit Delay flag set to 1 indicating Delay Measurement as described in
      Section 5.2 of [RFC9343].</t>

   	    <t>H: 1-bit flag set to 1 indicating that the measurement is Hop-by-Hop.</t>

   	    <t>E: 1-bit flag set to 1 indicating that the measurement is End-to-End.</t>

   	    <t>F: 1-bit flag set to 1 indicating 32-bit Flow ID, which uniquely identify a monitored flow
   within the measurement domain. The definition and usage is
   described in section 7 of [I-D.draft-he-ippm-ioam-dex-extensions-incorporating-am-03]. In the centralized way, Flow ID is uniquely assigned by the controller; in the distributed way, Flow ID is locally assigned by the headend device (encapsulating node).</t>

         <t>S: 1-bit flag set to 1 indicating an optional 32-bit Sequence Number, starting from 0
   and incremented by 1 for each packet from the same flow at the
   encapsulating node. The field is set at the encapsulating node and exported to the
   receiving entity by the forwarding nodes. The Sequence
   Number, when combined with the Flow ID, provides a convenient
   approach to correlate the exported data from the same user packet.In this document, when bit S is set to 1, Sequence Number MUST be sequently assigned by the headend device (encapsulating node).</t>

   	    <t>M: 1-bit flag set to 1 indicating an optional 32-bit Measurement Period Number(MPN), starting from 0
   and incremented by 1 for the specified flow with the same Flow ID.
   The field is set at the encapsulating node and exported to the
   receiving entity by the forwarding nodes.  The MPN, when combined
   with the Flow ID, provides a convenient approach to correlate the
   exported data of the same flow during the same measurement period
   from multiple nodes. In this document, when bit M is set to 1, MPN MUST be sequently assigned by the headend device (encapsulating node).</t>

	    <t>Rsvd: 5-bit field reserved for further usage.  It MUST be zero and
   ignored on receipt.</t>
	    </section>
	   </section>
	  </section>
	  
	 <section title="Traffic Sampling Action">
        
 	 <t>IFIT may be applied on all the traffic flow or a subset of the traffic. For the IOAM Type, take IOAM trace monitoring as example, when an IOAM encapsulating
      node incorporates the IOAM Pre-allocated Trace Option type (passport mode) or the DEX Option type (postcard mode) into all packets of the
      user traffic it forwards, more bandwidth and processing resources are required. So it is appropriate for an IOAM encapsulating node to apply the IOAM functionality to the selected subset of the traffic. But for the AltMark Type, it is more perferable for an encapsulating node
      to color all the traffic of interest it forwards, not a subset
      of the traffic, thus the fidelity of performance measurement for user traffic flow (e.g., packet loss, delay and jitter) can be ensured.</t>

	 <t>This document defines a new Traffic Sampling Action that
   it standardizes as BGP Extended Communities [RFC4360].</t>
   
       <section title="Traffic Sampling Extended Community">

       <t>The structure of the traffic sampling Extended Community is defined as
   follows:<figure title="Traffic Sampling Extended Community">
       <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
   +---------------+---------------+-------------------------------+
   |      Type     |   Sub-Type    |            ASN                |             
   +-------------------------------+-------------------------------+
   |                      Sampling Rate                            |
   +---------------------------------------------------------------+</artwork>
         </figure></t>

	    <t>Type: 1-octet, BGP Transitive Extended Community Type, set to 0x80.</t>

	    <t>Sub-Type: 1-octet, TBA (to be assigned by IANA).</t>

	    <t>ASN: 2-octet AS number, which can be assigned from
   a 2-octet AS number. When a 4-octet AS number is locally present,
   the 2 least significant octets of such an AS number can be used.
   This value is purely informational and SHOULD NOT be interpreted by
   the implementation.</t>

   	    <t>Sampling Rate: 4-octet float, which carries the sampling rate information in IEEE
   floating point [IEEE.754.1985] format.
   A sampling rate of 0 should result on no packet for the particular
   flow to be applied to IFIT, and a sampling rate of 100% should result on all traffic for the particular
   flow to be be applied to IFIT.  On encoding, the sampling rate MUST NOT be
   negative.</t>
 	    </section>
	   </section>  	    

     <section title="BGP FlowSpec Operations with IFIT Attributes">

	  <t>A Flow Specification is an n-tuple consisting of several matching
   criteria that can be applied to IP traffic flow. A given IP packet is
   said to match the defined Flow Specification if it matches all the
   specified criteria. This n-tuple is encoded into a BGP NLRI. Flow
   Specifications can be seen as more specific routing entries to a
   unicast prefix, and the routing system can take advantage of the ACL (Access Control List) capabilities in the router's forwarding path.</t>

      <t>Generally, in operator network, the centralized controller determines the particular user traffic to be monitored according to service requirements; at the same time, the centralized controller also need to determine th IFIT type applied to  the specified traffic flow.  Based on  BGP FlowSpec, the centralized controller sends the BGP FlowSpec update message to the headend device (i.e,. IOAM encapsulating node), carrying NLRI and IFIT attributes along with the traffic sampling Extended Community(if present). The BGP FlowSpec update message is used to instruct the headend device to perform IFIT automatic configuration on the monitored traffic flows. The headend device automatically generates ACLs according to the received traffic filter rules, and encapsulates IFIT for the incoming specified traffic flow packets, achieving the automated configuration for the monitored traffic flows. </t>

	 <t>Once the centralized controller determines to terminate monitoring the specified traffic flow, it can withdraw the corresponding NRLI routes, indicating that the headend device will remove the ACLs related to the traffic filter rules and stop encapsulating IFIT for the incoming specified traffic flow packets.<figure title="IFIT applied to the specified traffic flow">
      <artwork>
    +--------------+
    | Centralized  |
    | Controller   |
    +--------------+
         |   
         |   Send BGP FlowSpec update message to Headend, carrying:
         |   NLRI: Traffic filter rules
         |   IFIT attributes
         |   Traffic Sampling Extended Community (may be present)
         |
         |            
         |           
         V          (-----------------)
     +-------+    (                    )       +--------+
     |       |  (       Native IP or     )     |        |
     |Headend|-( =========================> )- |Endpoint|
     +-------+  (  BGP/MPLS VPN Network  )     +--------+
                  (                    )
                    (-----------------)</artwork>
         </figure></t>
 	 </section> 

	<section title="Validation Procedure and Error Handling">

	<t>The validation procedure is the same as specified in Section 6 of
   [RFC8955] and Section 5 of [RFC8955].</t>

	<t>Additionally, The IFIT Attribute MUST be attached to the BGP
      Update and MUST have an IFIT Type TLV set to the IOAM Type (1) or the AltMark Type (2).</t>

     <t>When the IFIT Type TLV includes any sub-TLV that is
   unrecognized or unsupported, the update SHOULD NOT be considered
   usable. An implementation MAY provide an option for ignoring
   unsupported sub-TLVs.</t>

   	<t>A router that receives an BGP update that is not valid
   according to these criteria MUST treat the update as malformed.</t>

   	<t>The validation of the TLVs/sub-TLVs introduced in this document and
   defined in their respective sub-sections of Section 4 MUST be
   performed to determine if they are malformed or invalid. In case of any error detected, either at
   the attribute or its TLV/sub-TLV level, the "treat-as-withdraw"
   strategy MUST be applied.  This is because a BGP Flowspec update
   without a valid IFIT Attribute (comprising of all
   valid TLVs/sub-TLVs) is not usable.</t>

   	<t>A BGP Flowspec update that is determined to be not valid, and therefore
   malformed, MUST be handled by the "treat-as-withdraw" strategy.</t>

   	<t>An implementation SHOULD log any errors found during the above
   validation for further analysis.</t>
    </section>
	
    <section anchor="IANA" title="IANA Considerations">
      <section title="IFIT Attribute Type Code">
       <t>IANA is requested to allocate the reserved value as the type code of the
   attribute in the "BGP Path Attributes" registry [IANA-BGP-PARAMS].</t>

       <t> <artwork>
       Type Code    Description          Reference
      -----------------------------------------------
        TBA        IFIT Attribute      This document</artwork></t>        
      </section>

	<section title="IFIT Type">
       <t>IANA is requested to create a IFIT Type registry. IANA is requested to allocate the following values as the type code of the IFIT Attribute TLVs. Unassigned Type values will be assigned
   on a First Come First Served (FCFS) basis. </t>

       <t> <artwork>
   Value    Description          Reference
   -----------------------------------------------
     1        IOAM Type         This document

     2        AltMark Type      This document</artwork></t>
	</section>

	<section title="IFIT Attribute Sub-TLVs">
	 <section title="IOAM Type Sub-TLVs">
       <t>IANA is requested to create a IOAM Type registry. IANA is requested to allocate the following values as the type code of the IOAM Type Sub-TLVs. Unassigned Type values will be assigned
   on a First Come First Served (FCFS) basis.</t>

       <t> <artwork>
    Value                    Description                      Reference
    --------------------------------------------------------------------------
      1        IOAM Pre-allocated Trace Option Sub-TLV         This document

      2        IOAM Incremental Trace Option Sub-TLV           This document

      3        IOAM Directly Export (DEX) Option Sub-TLV       This document

      4        IOAM Edge-to-Edge Option Sub-TLV                This document</artwork></t>
	 </section>

      <section title="AltMark Type Sub-TLVs">
       <t>IANA is requested to create an AltMark Type registry. IANA is requested to allocate the following values as the type code of the AltMark Type Sub-TLVs. Unassigned Type values will be assigned
   on a First Come First Served (FCFS) basis.</t>

       <t> <artwork>
    Value             Description                         Reference
    -------------------------------------------------------------------
      1        Alternate Marking Sub-TLV                 This document

      2        Enhanced Alternate Marking sub-TLV        This document</artwork></t>
	 </section>
	</section>

	<section title="Traffic Sampling Extended Community">
      <t>IANA is requested to allocate the reserved value as the Sub-type code of Traffic Sampling Extended Community in the registry entitled "Generic Transitive Experimental Use Extended Community Sub-Types".</t>

       <t> <artwork>
   Type Value     Sub-Type Value       Description             Reference
  --------------------------------------------------------------------------
   0x80           TBA                  Traffic Sampling        This document
</artwork></t>        
      </section> 
	</section>

    <section anchor="scecurity" title="Security Considerations">
      <t>The security mechanisms of the base BGP security model apply to the
   extensions described in this document as well.  See the Security
   Considerations section of [RFC4271] for a discussion of BGP security.</t>

	 <t>The BGP extensions specified in this document enable
   IFIT within an controlled domain, as defined in [RFC9378] and [I.D.draft-ietf-ippm-alt-mark-deployment]. IFIT operates within a controlled
   domain and its security considerations also apply to BGP
   sessions when carrying IFIT information.  The IFIT configurations
   distributed by BGP are expected to be used entirely within this
   trusted IFIT domain which comprises a single AS or multiple ASes/
   domains within a single provider network.  Therefore, precaution is
   necessary to ensure that the IFIT information advertised via BGP
   sessions is limited to nodes in a secure manner within this trusted
  IFIT domain.</t>

      <t>Flow Specification BGP speakers (e.g., the centralized controller) also need to be cautious for sending BGP updates. For example, sending updates at a high rate, or generating a high number of Flow Specifications may stress the receiving
   systems (the Headend devices), or exceed their capabilities.</t>

      <t>Another major concern is that enabling IFIT on all the traffic flows may have some impact on network forwarding performance, thus the traffic sampling action is needed for protecting network resources. In particular, settting the appropriate traffic sampling rate for the IOAM trace monitoring is also necessary.</t>
      
    </section>
  </middle>

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

	 <?ieee include="reference.IEEE.754.1985.xml"?>

      <?rfc include="reference.RFC.4271.xml"?>

      <?rfc include="reference.RFC.4360.xml"?>

      <?rfc include="reference.RFC.4760.xml"?>

      <?rfc include="reference.RFC.8126.xml"?>

      <?rfc include="reference.RFC.8174.xml"?>

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

      <?rfc include="reference.RFC.8956.xml"?>

      <?rfc include="reference.RFC.9197.xml"?>

      <?rfc include="reference.RFC.9326.xml"?>

      <?rfc include="reference.RFC.9341.xml"?>

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

    <references title="Informative References">
      <?rfc include="reference.I-D.ietf-ippm-alt-mark-deployment.xml"?>

      <?rfc include="reference.RFC.9378.xml"?>

      <?rfc include="reference.I-D.ietf-idr-sr-policy-ifit.xml"?>

      <?rfc include="reference.I-D.he-ippm-ioam-dex-extensions-incorporating-am.xml"?>

      <?rfc include="reference.I-D.he-ippm-ioam-extensions-incorporating-am.xml"?>
    </references>
  </back>
</rfc>