<?xml version="1.0" encoding="US-ASCII"?>
<?xml-stylesheet type="text/xsl" href="rfc2629.xslt" ?>
<!-- generated by https://github.com/cabo/kramdown-rfc2629 version 1.2.6 -->
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
<?rfc toc="yes"?>
<?rfc sortrefs="yes"?>
<?rfc symrefs="yes"?>
<?rfc comments="yes"?>
<rfc category="std" docName="draft-bao-idr-flowspec-statistics-00"
     ipr="trust200902">
  <front>
    <title abbrev="BGP Flowspec for Statistics">BGP Flow Specification
    Extensions for Traffic Statistics</title>

    <author fullname="Lei Bao" initials="L." surname="Bao">
      <organization>Huawei Technologies</organization>

      <address>
        <email>baolei7@huawei.com</email>
      </address>
    </author>

    <date day="8" month="December" year="2023"/>

    <workgroup>IDR Working Group</workgroup>

    <abstract>
      <t>RFC8955 defines a Border Gateway Protocol Network Layer Reachability
      Information (BGP NLRI) encoding format that can be used to distribute
      (intra-domain and inter-domain) traffic Flow Specifications for IPv4
      unicast and IPv4 BGP/MPLS VPN services. This allows the routing system
      to propagate information regarding more specific components of the
      traffic aggregate defined by an IP destination prefix. It also specifies
      BGP Extended Community encoding formats, which can be used to propagate
      Traffic Filtering Actions along with the Flow Specification NLRI. Those
      Traffic Filtering Actions encode actions a routing system can take if
      the packet matches the Flow Specification.</t>

      <t>This document extends RFC 8955 with New traffic Filtering Actions.
      statistic for bytes rate per second and statistic for packets rate per
      second are useful in specified Flow processing scenario.</t>
    </abstract>
  </front>

  <middle>
    <section anchor="introduction" title="Introduction">
      <t><xref target="RFC8955"/> obsoletes "Dissemination of Flow
      Specification Rules" <xref target="RFC5575"/> (see Appendix B for the
      differences). This document also obsoletes "Clarification of the
      Flowspec Redirect Extended Community" <xref target="RFC7674"/>, since it
      incorporates the encoding of the BGP Flow Specification Redirect
      Extended Community in Section 7.4.</t>

      <t>When performing an action on a flow, you need to continuously observe
      the flow status, whether packets are continuously sent, and the
      statistic bytes rate and packets rate for the Flow Specification. This
      allows you to perform the next step on the flow. Therefore, the Action
      field in section 7.3 of <xref target="RFC8955"/> needs to be extended to
      add an action for flow statistics.</t>

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

    <section title="Traffic Filtering Actions">
      <t>Traffic-Action (traffic-action) Sub-Type 0x07 is defined in <xref
      target="RFC8955"/> (see Section 7.2). The traffic-action Extended
      Community consists of 6 octets of which only the 2 least significant
      bits of the 6th octet (from left to right) are defined by this document,
      as shown in Figure 1.</t>

      <t><figure>
          <artwork align="center"><![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
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     | Traffic Action Field                                          |
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     | Tr. Action Field (cont.)  |S|T|
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

            Figure 1: Traffic-Action Extended Community Encoding]]></artwork>
        </figure></t>

      <t>The S and T bit are defined as:</t>

      <t><list style="empty">
          <t>T Terminal Action (bit 47): When this bit is set, the traffic
          filtering engine will evaluate any subsequent Flow Specifications
          (as defined by the ordering procedure in RFC8955 Section 5.1). If
          not set, the evaluation of the traffic filters stops when this Flow
          Specification is evaluated.</t>

          <t>S Sample (bit 46): Enables traffic sampling and logging for this
          Flow Specification (only effective when set).</t>
        </list>Other 2 significant bits of the 6th octet of traffic-action is
      required to identify and indicate the action of statistics. One bit is
      statistic-rate-bytes on a flow at an interval of per second. Another bit
      is statistic-rate-packets on a flow at an interval of per second.</t>

      <t><list style="empty">
          <t>SRB Statistic rate bytes per second (bit TBD ): Enables traffic
          statistic for this Flow Specification for bytes rate per second.</t>

          <t>SRP Statistic rate packets per second (bit TBD ): Enables traffic
          statistic for this Flow Specification for packets rate per
          second.</t>
        </list></t>
    </section>

    <section anchor="security-considerations" title="Security Considerations">
      <t>TBD</t>
    </section>

    <section anchor="iana-considerations" title="IANA Considerations">
      <t>The "traffic-action" Extended Community (Section 7.3) defined in
      <xref target="RFC8955"/> has 46 unused bits, which can be used to convey
      additional meaning. IANA created and maintains a registry entitled
      "Traffic Action Fields". IANA has updated the reference for this
      registry to RFC 8955. as shown in Figure 2.</t>

      <t>Two new bits in the Traffic Action Field field are required for
      statistic-rate-bytes and statistic-rate-packets. The Bit Field and
      Reference are TBD.</t>

      <t><figure>
          <artwork align="center"><![CDATA[  +=====+=======================+===========+
  | Bit | Name                  | Reference |
  +=====+=======================+===========+
  | 47  | Terminal Action       | RFC 8955  |
  +-----+-----------------------+-----------+
  | 46  | Sample                | RFC 8955  |
  +-----+-----------------------+-----------+
  | TBD | statistic-rate-bytes  |    TBD    |
  +-----+-----------------------+-----------+
  | TBD | statistic-rate-packets|    TBD    |
  +-----+-----------------------+-----------+
 Figure 2: Registry: Traffic Action Fields
]]></artwork>
        </figure></t>
    </section>

    <section anchor="acknowledgments" title="Acknowledgments">
      <t>The authors would like to thank Guoqi Xu, Lei Bao, Haibo Wang and
      Shunwan Zhuang for their review and discussion of this document.</t>
    </section>
  </middle>

  <back>
    <references title="Normative References">
      <reference anchor="RFC2119"
                 target="https://www.rfc-editor.org/info/rfc2119">
        <front>
          <title>Key words for use in RFCs to Indicate Requirement
          Levels</title>

          <author fullname="S. Bradner" initials="S." surname="Bradner">
            <organization/>
          </author>

          <date month="March" year="1997"/>

          <abstract>
            <t>In many standards track documents several words are used to
            signify the requirements in the specification. These words are
            often capitalized. This document defines these words as they
            should be interpreted in IETF documents. This document specifies
            an Internet Best Current Practices for the Internet Community, and
            requests discussion and suggestions for improvements.</t>
          </abstract>
        </front>

        <seriesInfo name="BCP" value="14"/>

        <seriesInfo name="RFC" value="2119"/>

        <seriesInfo name="DOI" value="10.17487/RFC2119"/>
      </reference>

      <?rfc include='reference.RFC.8174'?>

      <?rfc include='reference.RFC.8955'?>

      <?rfc include='reference.RFC.5575'?>

      <?rfc include='reference.RFC.7674'?>
    </references>

    <references title="Informative References"/>
  </back>

  <!---->
</rfc>
