<?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-04"
     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. Therefore, IFIT behavior
      can be automatically applied to the matched flow to capture real-time
      network dynamics.</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. 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, source/destination port.</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, such as Path
      tracking, packet loss localization,queue depth/congestion level, as well
      as SLA compliance verification. so on. In particular, IFIT refers to
      network Operations, Administration, and Maintenance (OAM) 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.ietf-idr-sr-policy-ifit] defines BGP extensions to distribute
      SR policy carrying IFIT information so that IFIT behavior can be enabled
      automatically when the SR policy is applied.
      [I-D.ietf-idr-bgp-ifit-capabilities] defines a new Characteristic
      to advertise the IFIT capabilities from the endpoint node to the headend
      node, so that the headend can determine whether a particular IFIT Option
      type can be encapsulated in data packets.</t>

      <t>More generally, 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 matched flow,
      and be automatically enabled and running. In particular, this document
      defines a new BGP path attribute - IFIT attribute, attached to the BGP
      UPDATE message. It is is worth noting that this IFIT attribute is
      general-purpose BGP path attribute, and could also applied to any other
      BGP address families.</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 a value as the 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><![CDATA[
  0                   1                   2                   3
  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |    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><![CDATA[
               +--------------------------------+
               |    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><![CDATA[
  0                   1                   2                   3
  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
 +---------------+---------------+-------------------------------+
 |    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
          on transmission 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><![CDATA[
  0                   1                   2                   3
  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
 +---------------+---------------+-------------------------------+
 |    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>The definition of other fields is the same as the pre-allocated
          trace option sub-TLV defined 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><![CDATA[
  0                   1                   2                   3
  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
                                 +---------------+---------------+
                                 |    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 sequentially assigned by the headend device
          (encapsulating node).</t>

          <t>IOAM Trace Type: A 24-bit identifier that specifies which
          IOAM-Data-Fields should be exported, as defined in Section 3.2 of
          [RFC9326].</t>

          <t>Rsvd: A 4-bit field reserved for further usage. It MUST be zero
          on transmission 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><![CDATA[
  0                   1                   2                   3
  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
                                 +---------------+---------------+
                                 |    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><![CDATA[
  0                   1                   2                   3
  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
                                 +---------------+---------------+
                                 |    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 mode.</t>

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

          <t>Rsvd: 8-bit field reserved for further usage. It MUST be zero on
          transmission 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><![CDATA[
  0                   1                   2                   3
  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
 +---------------+---------------+-------+-+-+-+-+-+-+-+---------+
 |    Type=2     |   Length=6    |Period |L|D|H|E|F|S|M|   Rsvd  |
 +---------------+---------------+-------+-+-+-+-+-+-+-+---------+
 |                       Flow ID(Optional)                       |
 +---------------------------------------------------------------+]]></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 mode.</t>

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

          <t>F: 1-bit flag set to 1 indicating an optional 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]. 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 Sequence Number 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 sequentially 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 sequentially assigned
          by the headend device (encapsulating node).</t>

          <t>Rsvd: 5-bit field reserved for further usage. It MUST be zero on
          transmission 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 preferable 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 such that the fidelity of
      performance measurement for user traffic flow (e.g., packet loss) 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><![CDATA[
  0                   1                   2                   3
  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
 +---------------+---------------+-------------------------------+
 |      Type     |   Sub-Type    |            ASN                |             
 +-------------------------------+-------------------------------+
 |         Sampling Rate         |          Reserved             |
 +---------------------------------------------------------------+]]></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: 2-octet unsigned integer as a percentage in packets,
        restricted to [0x0000,0xffff], with value 0x0000 (0) indicating a
        sampling rate of 0, and value 0xffff (65535) indicating a sampling
        rate of 100%. The resolution is 0.0015%. A sampling rate of 0 should
        result in no packet for the particular flow to be applied to IFIT, and
        a sampling rate of 100% should result in all traffic for the
        particular flow to be be applied to IFIT.</t>

        <t>Reserved: 2-octet reserved field, It MUST be zero on transmission
        and ignored on receipt.</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>Typically, 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><![CDATA[
  +--------------+
  | Centralized  |
  | Controller   |
  +--------------+
       |	   
       |   Send BGP FlowSpec UPDATE message to Headend, carrying:
       |   NLRI: Traffic filter rules
       |   IFIT attribute
       |   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>Flow Specifications with IFIT attribute received from a BGP peer that
      are accepted in the respective Adj-RIB-In are used as input to the route
      selection process. The validation procedure is the same as specified in
      [RFC8955],[RFC8956], and [RFC9117].</t>

      <t>Additionally, the IFIT attribute (if present) MUST be attached to the
      BGP UPDATE message and MUST have an IFIT TLV whose IFIT Type sets to the
      IOAM Type (1) or the AltMark Type (2).</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
      update without a valid IFIT attribute (comprising of all valid
      TLVs/sub-TLVs) is not usable.</t>

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

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

      <t>When an IFIT TLV includes any valid sub-TLV that is but unrecognized
      or unsupported, the BGP update SHOULD NOT be considered unusable. An
      implementation MAY provide an option for ignoring unsupported
      sub-TLVs.</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 Code">
        <t>IANA is requested to allocate a value as the code of the attribute
        in the "BGP Path Attributes" registry [IANA-BGP-PARAMS].</t>

        <t><artwork><![CDATA[
    Code         Description          Reference
    ------------------------------------------------
    TBA          IFIT                 This document]]></artwork></t>
      </section>

      <section title="In-situ Flow Information Telemetry (IFIT) Grouping">
        <t>IANA is requested to create a new registry grouping name "In-situ
        Flow Information Telemetry (IFIT).</t>

        <t>IANA is requested to create the following new registries under the
        "In-situ Flow Information Telemetry (IFIT) registry group. <list
            style="symbols">
            <t>The "IFIT Type" registry.</t>

            <t>The "IOAM Type Sub-TLVs" registry.</t>

            <t>The "AltMark Type Sub-TLVs" registry.</t>
          </list></t>
      </section>

      <section title="IFIT Type">
        <t>IANA is requested to allocate the following values as the type code
        of the IFIT Type TLVs in the "IFIT Type" registry.</t>

        <t><artwork><![CDATA[
    Value         Description       Reference
   -----------------------------------------------
     0            Reserved          This document
     1            IOAM Type         This document
     2            AltMark Type      This document
     3-255        Unassigned
   -----------------------------------------------]]></artwork></t>
      </section>

      <section title="IOAM Type Sub-TLVs">
        <t>IANA is requested to allocate the following values as the type code
        of the IOAM Type Sub-TLVs in the "IOAM Type Sub-TLVs" registry.</t>

        <t><artwork><![CDATA[
     Value        Description                                  Reference
    ------------------------------------------------------------------------
      0           Reserved                                     This document
      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
      5-255       Unassigned
    -------------------------------------------------------------------------]]></artwork></t>
      </section>

      <section title="AltMark Type Sub-TLVs">
        <t>IANA is requested to allocate the following values as the type code
        of the AltMark Type Sub-TLVs in the "AltMark Type Sub-TLVs"
        registry.</t>

        <t><artwork><![CDATA[
     Value        Description                              Reference
    ---------------------------------------------------------------------
      0           Reserved                                 This document
      1           Alternate Marking Sub-TLV                This document
      2           Enhanced Alternate Marking sub-TLV       This document
      3-255       Unassigned
    ---------------------------------------------------------------------]]></artwork></t>
      </section>

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

        <t><artwork><![CDATA[
     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 traffic flows may
      have some impact on network forwarding performance, thus the traffic
      sampling action may be needed for protecting network resources. In
      particular, settting the appropriate traffic sampling rate for the IOAM
      trace monitoring is also necessary.</t>
    </section>

    <section title="Acknowledgement">
      <t>The authors would like to thank Jeffrey Haas for the valuable
      comments and suggestions.</t>
    </section>
  </middle>

  <back>
    <references title="Normative References">
      <?rfc include="reference.RFC.2119.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.ietf-idr-bgp-ifit-capabilities.xml"?>

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