<?xml version='1.0' encoding='utf-8'?>
<rfc xmlns:xi="http://www.w3.org/2001/XInclude" version="3" category="std" consensus="true" docName="draft-ietf-idr-flow-spec-v6-22" indexInclude="true" ipr="trust200902" number="8956" prepTime="2020-12-31T13:38:10" scripts="Common,Latin" sortRefs="true" submissionType="IETF" symRefs="true" tocDepth="2" tocInclude="true" updates="8955" xml:lang="en">
  <link href="https://datatracker.ietf.org/doc/draft-ietf-idr-flow-spec-v6-22" rel="prev"/>
  <link href="https://dx.doi.org/10.17487/rfc8956" rel="alternate"/>
  <link href="urn:issn:2070-1721" rel="alternate"/>
  <front>
    <title abbrev="IPv6 Flow Specification">Dissemination of Flow Specification Rules for IPv6</title>
    <seriesInfo name="RFC" value="8956" stream="IETF"/>
    <author role="editor" fullname="Christoph Loibl" initials="C" surname="Loibl">
      <organization showOnFrontPage="true">next layer Telekom GmbH</organization>
      <address>
        <postal>
          <street>Mariahilfer Guertel 37/7</street>
          <city>Vienna</city>
          <region/>
          <code>1150</code>
          <country>Austria</country>
        </postal>
        <phone>+43 664 1176414</phone>
        <email>cl@tix.at</email>
      </address>
    </author>
    <author fullname="Robert Raszuk" initials="R" surname="Raszuk" role="editor">
      <organization showOnFrontPage="true">NTT Network Innovations</organization>
      <address>
        <postal>
          <street>940 Stewart Dr</street>
          <city>Sunnyvale</city>
          <region>CA</region>
          <code>94085</code>
          <country>United States of America</country>
        </postal>
        <email>robert@raszuk.net</email>
      </address>
    </author>
    <author role="editor" fullname="Susan Hares" initials="S" surname="Hares">
      <organization showOnFrontPage="true">Huawei</organization>
      <address>
        <postal>
          <street>7453 Hickory Hill</street>
          <city>Saline</city>
          <region>MI</region>
          <code>48176</code>
          <country>United States of America</country>
        </postal>
        <email>shares@ndzh.com</email>
      </address>
    </author>
    <date month="12" year="2020"/>
    <area>Routing</area>
    <workgroup>IDR</workgroup>
    <keyword>BGP Flow Specification</keyword>
    <keyword>V6</keyword>
    <abstract pn="section-abstract">
      <t indent="0" pn="section-abstract-1">
   "Dissemination of Flow Specification Rules" (RFC 8955)
   provides a Border Gateway Protocol (BGP)
   extension for the propagation of traffic flow information for
   the purpose of rate limiting or filtering IPv4 protocol data packets.
      </t>
      <t indent="0" pn="section-abstract-2">
   This document extends RFC 8955 with IPv6 functionality.
   It also updates RFC 8955 by changing the IANA Flow Spec 
   Component Types registry.
      </t>
    </abstract>
    <boilerplate>
      <section anchor="status-of-memo" numbered="false" removeInRFC="false" toc="exclude" pn="section-boilerplate.1">
        <name slugifiedName="name-status-of-this-memo">Status of This Memo</name>
        <t indent="0" pn="section-boilerplate.1-1">
            This is an Internet Standards Track document.
        </t>
        <t indent="0" pn="section-boilerplate.1-2">
            This document is a product of the Internet Engineering Task Force
            (IETF).  It represents the consensus of the IETF community.  It has
            received public review and has been approved for publication by
            the Internet Engineering Steering Group (IESG).  Further
            information on Internet Standards is available in Section 2 of 
            RFC 7841.
        </t>
        <t indent="0" pn="section-boilerplate.1-3">
            Information about the current status of this document, any
            errata, and how to provide feedback on it may be obtained at
            <eref target="https://www.rfc-editor.org/info/rfc8956" brackets="none"/>.
        </t>
      </section>
      <section anchor="copyright" numbered="false" removeInRFC="false" toc="exclude" pn="section-boilerplate.2">
        <name slugifiedName="name-copyright-notice">Copyright Notice</name>
        <t indent="0" pn="section-boilerplate.2-1">
            Copyright (c) 2020 IETF Trust and the persons identified as the
            document authors. All rights reserved.
        </t>
        <t indent="0" pn="section-boilerplate.2-2">
            This document is subject to BCP 78 and the IETF Trust's Legal
            Provisions Relating to IETF Documents
            (<eref target="https://trustee.ietf.org/license-info" brackets="none"/>) in effect on the date of
            publication of this document. Please review these documents
            carefully, as they describe your rights and restrictions with
            respect to this document. Code Components extracted from this
            document must include Simplified BSD License text as described in
            Section 4.e of the Trust Legal Provisions and are provided without
            warranty as described in the Simplified BSD License.
        </t>
      </section>
    </boilerplate>
    <toc>
      <section anchor="toc" numbered="false" removeInRFC="false" toc="exclude" pn="section-toc.1">
        <name slugifiedName="name-table-of-contents">Table of Contents</name>
        <ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1">
          <li pn="section-toc.1-1.1">
            <t indent="0" keepWithNext="true" pn="section-toc.1-1.1.1"><xref derivedContent="1" format="counter" sectionFormat="of" target="section-1"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-introduction">Introduction</xref></t>
            <ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.1.2">
              <li pn="section-toc.1-1.1.2.1">
                <t indent="0" keepWithNext="true" pn="section-toc.1-1.1.2.1.1"><xref derivedContent="1.1" format="counter" sectionFormat="of" target="section-1.1"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-definitions-of-terms-used-i">Definitions of Terms Used in This Memo</xref></t>
              </li>
            </ul>
          </li>
          <li pn="section-toc.1-1.2">
            <t indent="0" keepWithNext="true" pn="section-toc.1-1.2.1"><xref derivedContent="2" format="counter" sectionFormat="of" target="section-2"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-ipv6-flow-specification-enc">IPv6 Flow Specification Encoding in BGP</xref></t>
          </li>
          <li pn="section-toc.1-1.3">
            <t indent="0" pn="section-toc.1-1.3.1"><xref derivedContent="3" format="counter" sectionFormat="of" target="section-3"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-ipv6-flow-specification-com">IPv6 Flow Specification Components</xref></t>
            <ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.3.2">
              <li pn="section-toc.1-1.3.2.1">
                <t indent="0" pn="section-toc.1-1.3.2.1.1"><xref derivedContent="3.1" format="counter" sectionFormat="of" target="section-3.1"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-type-1-destination-ipv6-pre">Type 1 - Destination IPv6 Prefix</xref></t>
              </li>
              <li pn="section-toc.1-1.3.2.2">
                <t indent="0" pn="section-toc.1-1.3.2.2.1"><xref derivedContent="3.2" format="counter" sectionFormat="of" target="section-3.2"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-type-2-source-ipv6-prefix">Type 2 - Source IPv6 Prefix</xref></t>
              </li>
              <li pn="section-toc.1-1.3.2.3">
                <t indent="0" pn="section-toc.1-1.3.2.3.1"><xref derivedContent="3.3" format="counter" sectionFormat="of" target="section-3.3"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-type-3-upper-layer-protocol">Type 3 - Upper-Layer Protocol</xref></t>
              </li>
              <li pn="section-toc.1-1.3.2.4">
                <t indent="0" pn="section-toc.1-1.3.2.4.1"><xref derivedContent="3.4" format="counter" sectionFormat="of" target="section-3.4"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-type-7-icmpv6-type">Type 7 - ICMPv6 Type</xref></t>
              </li>
              <li pn="section-toc.1-1.3.2.5">
                <t indent="0" pn="section-toc.1-1.3.2.5.1"><xref derivedContent="3.5" format="counter" sectionFormat="of" target="section-3.5"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-type-8-icmpv6-code">Type 8 - ICMPv6 Code</xref></t>
              </li>
              <li pn="section-toc.1-1.3.2.6">
                <t indent="0" pn="section-toc.1-1.3.2.6.1"><xref derivedContent="3.6" format="counter" sectionFormat="of" target="section-3.6"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-type-12-fragment">Type 12 - Fragment</xref></t>
              </li>
              <li pn="section-toc.1-1.3.2.7">
                <t indent="0" pn="section-toc.1-1.3.2.7.1"><xref derivedContent="3.7" format="counter" sectionFormat="of" target="section-3.7"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-type-13-flow-label-new">Type 13 - Flow Label (new)</xref></t>
              </li>
              <li pn="section-toc.1-1.3.2.8">
                <t indent="0" pn="section-toc.1-1.3.2.8.1"><xref derivedContent="3.8" format="counter" sectionFormat="of" target="section-3.8"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-encoding-examples">Encoding Examples</xref></t>
              </li>
            </ul>
          </li>
          <li pn="section-toc.1-1.4">
            <t indent="0" pn="section-toc.1-1.4.1"><xref derivedContent="4" format="counter" sectionFormat="of" target="section-4"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-ordering-of-flow-specificat">Ordering of Flow Specifications</xref></t>
          </li>
          <li pn="section-toc.1-1.5">
            <t indent="0" pn="section-toc.1-1.5.1"><xref derivedContent="5" format="counter" sectionFormat="of" target="section-5"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-validation-procedure">Validation Procedure</xref></t>
          </li>
          <li pn="section-toc.1-1.6">
            <t indent="0" pn="section-toc.1-1.6.1"><xref derivedContent="6" format="counter" sectionFormat="of" target="section-6"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-ipv6-traffic-filtering-acti">IPv6 Traffic Filtering Action Changes</xref></t>
            <ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.6.2">
              <li pn="section-toc.1-1.6.2.1">
                <t indent="0" pn="section-toc.1-1.6.2.1.1"><xref derivedContent="6.1" format="counter" sectionFormat="of" target="section-6.1"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-redirect-ipv6-rt-redirect-i">Redirect IPv6 (rt-redirect-ipv6) Type 0x000d</xref></t>
              </li>
            </ul>
          </li>
          <li pn="section-toc.1-1.7">
            <t indent="0" pn="section-toc.1-1.7.1"><xref derivedContent="7" format="counter" sectionFormat="of" target="section-7"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-security-considerations">Security Considerations</xref></t>
          </li>
          <li pn="section-toc.1-1.8">
            <t indent="0" pn="section-toc.1-1.8.1"><xref derivedContent="8" format="counter" sectionFormat="of" target="section-8"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-iana-considerations">IANA Considerations</xref></t>
            <ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.8.2">
              <li pn="section-toc.1-1.8.2.1">
                <t indent="0" pn="section-toc.1-1.8.2.1.1"><xref derivedContent="8.1" format="counter" sectionFormat="of" target="section-8.1"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-flow-spec-ipv6-component-ty">Flow Spec IPv6 Component Types</xref></t>
              </li>
              <li pn="section-toc.1-1.8.2.2">
                <t indent="0" pn="section-toc.1-1.8.2.2.1"><xref derivedContent="8.2" format="counter" sectionFormat="of" target="section-8.2"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-ipv6-address-specific-exten">IPv6-Address-Specific Extended Community Flow Spec IPv6 Actions</xref></t>
              </li>
            </ul>
          </li>
          <li pn="section-toc.1-1.9">
            <t indent="0" pn="section-toc.1-1.9.1"><xref derivedContent="9" format="counter" sectionFormat="of" target="section-9"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-normative-references">Normative References</xref></t>
          </li>
          <li pn="section-toc.1-1.10">
            <t indent="0" pn="section-toc.1-1.10.1"><xref derivedContent="Appendix A" format="default" sectionFormat="of" target="section-appendix.a"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-example-python-code-flow_ru">Example Python Code: flow_rule_cmp_v6</xref></t>
          </li>
          <li pn="section-toc.1-1.11">
            <t indent="0" pn="section-toc.1-1.11.1"><xref derivedContent="" format="none" sectionFormat="of" target="section-appendix.b"/><xref derivedContent="" format="title" sectionFormat="of" target="name-acknowledgments">Acknowledgments</xref></t>
          </li>
          <li pn="section-toc.1-1.12">
            <t indent="0" pn="section-toc.1-1.12.1"><xref derivedContent="" format="none" sectionFormat="of" target="section-appendix.c"/><xref derivedContent="" format="title" sectionFormat="of" target="name-contributors">Contributors</xref></t>
          </li>
          <li pn="section-toc.1-1.13">
            <t indent="0" pn="section-toc.1-1.13.1"><xref derivedContent="" format="none" sectionFormat="of" target="section-appendix.d"/><xref derivedContent="" format="title" sectionFormat="of" target="name-authors-addresses">Authors' Addresses</xref></t>
          </li>
        </ul>
      </section>
    </toc>
  </front>
  <middle>
    <section anchor="intro" numbered="true" toc="include" removeInRFC="false" pn="section-1">
      <name slugifiedName="name-introduction">Introduction</name>
      <t indent="0" pn="section-1-1">The growing amount of IPv6 traffic in private and public networks
   requires the extension of tools used in IPv4-only networks to also support
   IPv6 data packets.
      </t>
      <t indent="0" pn="section-1-2">
   This document analyzes the differences between describing IPv6
   <xref target="RFC8200" format="default" sectionFormat="of" derivedContent="RFC8200"/> flows and those of IPv4 packets. It specifies
   new Border Gateway Protocol <xref target="RFC4271" format="default" sectionFormat="of" derivedContent="RFC4271"/> encoding formats to enable
   "Dissemination of Flow Specification Rules" <xref target="RFC8955" format="default" sectionFormat="of" derivedContent="RFC8955"/>
   for IPv6.
      </t>
      <t indent="0" pn="section-1-3">
    This specification is an extension of the base established in <xref target="RFC8955" format="default" sectionFormat="of" derivedContent="RFC8955"/>. 
    It only defines the delta changes required to support IPv6, while all other
    definitions and operation mechanisms of "Dissemination of Flow Specification
    Rules" will remain in the main specification and will not be repeated here.
      </t>
      <section numbered="true" toc="include" removeInRFC="false" pn="section-1.1">
        <name slugifiedName="name-definitions-of-terms-used-i">Definitions of Terms Used in This Memo</name>
        <dl newline="false" spacing="normal" indent="10" pn="section-1.1-1">
          <dt pn="section-1.1-1.1">AFI:</dt>
          <dd pn="section-1.1-1.2">Address Family Identifier</dd>
          <dt pn="section-1.1-1.3">AS: </dt>
          <dd pn="section-1.1-1.4">Autonomous System</dd>
          <dt pn="section-1.1-1.5">NLRI: </dt>
          <dd pn="section-1.1-1.6">Network Layer Reachability Information</dd>
          <dt pn="section-1.1-1.7">SAFI: </dt>
          <dd pn="section-1.1-1.8">Subsequent Address Family Identifier</dd>
          <dt pn="section-1.1-1.9">VRF: </dt>
          <dd pn="section-1.1-1.10">Virtual Routing and Forwarding</dd>
        </dl>
        <t indent="0" pn="section-1.1-2">
    The key words "<bcp14>MUST</bcp14>", "<bcp14>MUST NOT</bcp14>", "<bcp14>REQUIRED</bcp14>", "<bcp14>SHALL</bcp14>", "<bcp14>SHALL NOT</bcp14>", "<bcp14>SHOULD</bcp14>", "<bcp14>SHOULD NOT</bcp14>", "<bcp14>RECOMMENDED</bcp14>", "<bcp14>NOT RECOMMENDED</bcp14>",
    "<bcp14>MAY</bcp14>", and "<bcp14>OPTIONAL</bcp14>" in this document are to be interpreted as
    described in BCP 14 <xref target="RFC2119" format="default" sectionFormat="of" derivedContent="RFC2119"/> <xref target="RFC8174" format="default" sectionFormat="of" derivedContent="RFC8174"/> 
    when, and only when, they appear in all capitals, as shown here.
        </t>
      </section>
    </section>
    <section numbered="true" toc="include" removeInRFC="false" pn="section-2">
      <name slugifiedName="name-ipv6-flow-specification-enc">IPv6 Flow Specification Encoding in BGP</name>
      <t indent="0" pn="section-2-1">
   <xref target="RFC8955" format="default" sectionFormat="of" derivedContent="RFC8955"/> defines SAFIs
   133 (Dissemination of Flow Specification rules) and 134 (L3VPN
   Dissemination of Flow Specification rules) in order to carry
   the corresponding Flow Specification.
      </t>
      <t indent="0" pn="section-2-2">
   Implementations wishing to exchange IPv6 Flow Specifications <bcp14>MUST</bcp14> use
   BGP's Capability Advertisement facility to exchange the Multiprotocol
   Extension Capability Code (Code 1), as defined in <xref target="RFC4760" format="default" sectionFormat="of" derivedContent="RFC4760"/>.
   The (AFI, SAFI) pair carried in the Multiprotocol Extension Capability <bcp14>MUST</bcp14> be
   (AFI=2, SAFI=133) for IPv6 Flow Specification rules and (AFI=2, SAFI=134) for L3VPN Dissemination of Flow Specification rules.
      </t>
    </section>
    <section numbered="true" toc="include" removeInRFC="false" pn="section-3">
      <name slugifiedName="name-ipv6-flow-specification-com">IPv6 Flow Specification Components</name>
      <t indent="0" pn="section-3-1">
   The encoding of each of the components begins with a Type field (1 octet)
   followed by a variable length parameter. The following sections define
   component types and parameter encodings for IPv6.
      </t>
      <t indent="0" pn="section-3-2">
   Types 4 (Port), 5 (Destination Port), 6 (Source Port), 9 (TCP Flags), 10 (Packet Length), 
   and 11 (DSCP), 
   as defined in <xref target="RFC8955" format="default" sectionFormat="of" derivedContent="RFC8955"/>,
   also apply to IPv6. Note that IANA has updated the "Flow Spec Component Types" registry in order 
   to contain both IPv4 and IPv6 Flow Specification component type numbers in a single registry
   (<xref target="IANA" format="default" sectionFormat="of" derivedContent="Section 8"/>).   
      </t>
      <section anchor="type_1" toc="include" numbered="true" removeInRFC="false" pn="section-3.1">
        <name slugifiedName="name-type-1-destination-ipv6-pre">Type 1 - Destination IPv6 Prefix</name>
        <dl newline="false" spacing="normal" indent="3" pn="section-3.1-1">
          <dt pn="section-3.1-1.1">Encoding:</dt>
          <dd pn="section-3.1-1.2">&lt;type (1 octet), length (1 octet), offset (1 octet), pattern (variable), 
	padding (variable) &gt;</dd>
        </dl>
        <t indent="0" pn="section-3.1-2">This defines the destination prefix to match.  
      The offset has been defined to allow for flexible matching to portions of an
      IPv6 address where one is required to skip over the first N bits of the address.
      (These bits skipped are often indicated as "don't care" bits.)
      This can be especially useful where part of the IPv6 address
      consists of an embedded IPv4 address, and matching needs to happen
      only on the embedded IPv4 address. The encoded pattern contains
      enough octets for the bits used in matching (length minus offset
      bits).
        </t>
        <dl newline="false" spacing="normal" indent="11" pn="section-3.1-3">
          <dt pn="section-3.1-3.1">length:</dt>
          <dd pn="section-3.1-3.2">This indicates the N-th most significant bit in the address where 
           bitwise pattern matching stops. 
        </dd>
          <dt pn="section-3.1-3.3">offset:</dt>
          <dd pn="section-3.1-3.4">This indicates the number of most significant address bits to 
           skip before bitwise pattern matching starts.
        </dd>
          <dt pn="section-3.1-3.5">pattern:</dt>
          <dd pn="section-3.1-3.6">This contains the matching pattern. The length of the pattern is defined by the 
           number of bits needed for pattern matching (length minus offset).
        </dd>
          <dt pn="section-3.1-3.7">padding:</dt>
          <dd pn="section-3.1-3.8">This contains the minimum number of bits required to pad the component to an octet boundary.
           Padding bits <bcp14>MUST</bcp14> be 0 on encoding and <bcp14>MUST</bcp14> be ignored on decoding.
        </dd>
        </dl>
        <t indent="0" pn="section-3.1-4">
        If length = 0  and offset = 0, this component matches every address; otherwise, length <bcp14>MUST</bcp14> be in the 
	range offset &lt; length  &lt; 129 or the component is malformed.</t>
        <t indent="0" pn="section-3.1-5">
        Note: This Flow Specification component can be represented by the notation ipv6address/length 
	if offset is 0 or  
        ipv6address/offset-length. The ipv6address in this notation is the textual IPv6 representation 
	of the pattern 
        shifted to the right by the number of offset bits. See also <xref target="examples" format="default" sectionFormat="of" derivedContent="Section 3.8"/>.    
        </t>
      </section>
      <section anchor="type_2" toc="include" numbered="true" removeInRFC="false" pn="section-3.2">
        <name slugifiedName="name-type-2-source-ipv6-prefix">Type 2 - Source IPv6 Prefix</name>
        <dl newline="false" spacing="normal" indent="3" pn="section-3.2-1">
          <dt pn="section-3.2-1.1">Encoding:</dt>
          <dd pn="section-3.2-1.2">&lt;type (1 octet), length (1 octet), offset (1 octet), pattern (variable), 
	padding (variable) &gt;</dd>
        </dl>
        <t indent="0" pn="section-3.2-2">This defines the source prefix to match. The length, offset, pattern, and padding
          are the same as in <xref target="type_1" format="default" sectionFormat="of" derivedContent="Section 3.1"/>.
        </t>
      </section>
      <section anchor="type_3" numbered="true" toc="include" removeInRFC="false" pn="section-3.3">
        <name slugifiedName="name-type-3-upper-layer-protocol">Type 3 - Upper-Layer Protocol</name>
        <dl newline="false" spacing="normal" indent="3" pn="section-3.3-1">
          <dt pn="section-3.3-1.1">Encoding:</dt>
          <dd pn="section-3.3-1.2">&lt;type (1 octet), [numeric_op, value]+&gt;</dd>
        </dl>
        <t indent="0" pn="section-3.3-2">This contains a list of {numeric_op, value} pairs that
      are used to match the first Next Header value octet in IPv6 packets 
      that is not an extension header and thus indicates that the next item 
      in the packet is the corresponding upper-layer header (see 
      <xref target="RFC8200" sectionFormat="of" section="4" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8200#section-4" derivedContent="RFC8200"/>).
        </t>
        <t indent="0" pn="section-3.3-3">This component uses the Numeric Operator (numeric_op) described in
      <xref target="RFC8955" sectionFormat="of" section="4.2.1.1" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8955#section-4.2.1.1" derivedContent="RFC8955"/>.
      Type 3 component values <bcp14>SHOULD</bcp14> be encoded as a single octet
      (numeric_op len=00).
        </t>
        <t indent="0" pn="section-3.3-4">Note: While IPv6 allows for more than one Next Header field in the
	  packet, the main goal of the Type 3 Flow Specification component is to
      match on the first upper-layer IP protocol value.  Therefore, the
      definition is limited to match only on this specific Next Header field in
      the packet.
        </t>
      </section>
      <section anchor="type_7" toc="include" numbered="true" removeInRFC="false" pn="section-3.4">
        <name slugifiedName="name-type-7-icmpv6-type">Type 7 - ICMPv6 Type</name>
        <dl newline="false" spacing="normal" indent="3" pn="section-3.4-1">
          <dt pn="section-3.4-1.1">Encoding:</dt>
          <dd pn="section-3.4-1.2">&lt;type (1 octet), [numeric_op, value]+&gt;</dd>
        </dl>
        <t indent="0" pn="section-3.4-2">This defines a list of {numeric_op, value} pairs used to match the
    Type field of an ICMPv6 packet (see also <xref target="RFC4443" sectionFormat="of" section="2.1" format="default" derivedLink="https://rfc-editor.org/rfc/rfc4443#section-2.1" derivedContent="RFC4443"/>).
        </t>
        <t indent="0" pn="section-3.4-3">
        This component uses the Numeric Operator (numeric_op) described
        in <xref target="RFC8955" sectionFormat="of" section="4.2.1.1" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8955#section-4.2.1.1" derivedContent="RFC8955"/>.
        Type 7 component values <bcp14>SHOULD</bcp14> be encoded as a single octet
        (numeric_op len=00).
        </t>
        <t indent="0" pn="section-3.4-4">
        In case of the presence of the ICMPv6 type
        component, only ICMPv6 packets can match the entire Flow Specification.
        The ICMPv6 type component, if present, never matches when the packet's
        upper-layer IP protocol value is not 58 (ICMPv6), if the packet is fragmented
        and this is not the first fragment, or if the system is unable to
        locate the transport header. Different implementations may or may not be
        able to decode the transport header.
        </t>
      </section>
      <section anchor="type_8" toc="include" numbered="true" removeInRFC="false" pn="section-3.5">
        <name slugifiedName="name-type-8-icmpv6-code">Type 8 - ICMPv6 Code</name>
        <dl newline="false" spacing="normal" indent="3" pn="section-3.5-1">
          <dt pn="section-3.5-1.1">Encoding:</dt>
          <dd pn="section-3.5-1.2">&lt;type (1 octet), [numeric_op, value]+&gt;</dd>
        </dl>
        <t indent="0" pn="section-3.5-2">
    This defines a list of {numeric_op, value} pairs used to match the
    code field of an ICMPv6 packet (see also <xref target="RFC4443" sectionFormat="of" section="2.1" format="default" derivedLink="https://rfc-editor.org/rfc/rfc4443#section-2.1" derivedContent="RFC4443"/>).
        </t>
        <t indent="0" pn="section-3.5-3">
        This component uses the Numeric Operator (numeric_op) described
        in <xref target="RFC8955" sectionFormat="of" section="4.2.1.1" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8955#section-4.2.1.1" derivedContent="RFC8955"/>.
        Type 8 component values <bcp14>SHOULD</bcp14> be encoded as a single octet
        (numeric_op len=00).
        </t>
        <t indent="0" pn="section-3.5-4">
        In case of the presence of the ICMPv6 code
        component, only ICMPv6 packets can match the entire Flow Specification.
        The ICMPv6 code component, if present, never matches when the packet's
        upper-layer IP protocol value is not 58 (ICMPv6), if the packet is fragmented
        and this is not the first fragment, or if the system is unable to
        locate the transport header. Different implementations may or may not be
        able to decode the transport header.
        </t>
      </section>
      <section anchor="type_12" numbered="true" toc="include" removeInRFC="false" pn="section-3.6">
        <name slugifiedName="name-type-12-fragment">Type 12 - Fragment</name>
        <dl newline="false" spacing="normal" indent="3" pn="section-3.6-1">
          <dt pn="section-3.6-1.1">Encoding:</dt>
          <dd pn="section-3.6-1.2">&lt;type (1 octet), [bitmask_op, bitmask]+&gt;</dd>
        </dl>
        <t indent="0" pn="section-3.6-2">This defines a list of {bitmask_op, bitmask} pairs used to match specific IP fragments.</t>
        <t indent="0" pn="section-3.6-3">This component uses the Bitmask Operator (bitmask_op) described
      in <xref target="RFC8955" sectionFormat="of" section="4.2.1.2" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8955#section-4.2.1.2" derivedContent="RFC8955"/>. The
      Type 12 component bitmask <bcp14>MUST</bcp14> be encoded as a single octet bitmask
      (bitmask_op len=00).
        </t>
        <figure anchor="figure_fragment_bitmask_operand" align="left" suppress-title="false" pn="figure-1">
          <name slugifiedName="name-fragment-bitmask-operand">Fragment Bitmask Operand</name>
          <artwork name="" type="" align="left" alt="" pn="section-3.6-4.1">
                   0   1   2   3   4   5   6   7
                 +---+---+---+---+---+---+---+---+
                 | 0 | 0 | 0 | 0 |LF |FF |IsF| 0 |
                 +---+---+---+---+---+---+---+---+
</artwork>
        </figure>
        <t indent="0" pn="section-3.6-5">Bitmask values:
        </t>
        <dl newline="false" spacing="normal" indent="6" pn="section-3.6-6">
          <dt pn="section-3.6-6.1">IsF:</dt>
          <dd pn="section-3.6-6.2">Is a fragment other than the first -- match if IPv6 Fragment Header 
	  (<xref target="RFC8200" sectionFormat="of" section="4.5" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8200#section-4.5" derivedContent="RFC8200"/>) Fragment Offset is not 0</dd>
          <dt pn="section-3.6-6.3">FF:</dt>
          <dd pn="section-3.6-6.4">First fragment -- match if IPv6 Fragment Header (<xref target="RFC8200" sectionFormat="of" section="4.5" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8200#section-4.5" derivedContent="RFC8200"/>) Fragment Offset is 0 AND M flag is 1</dd>
          <dt pn="section-3.6-6.5">LF:</dt>
          <dd pn="section-3.6-6.6">Last fragment -- match if IPv6 Fragment Header (<xref target="RFC8200" sectionFormat="of" section="4.5" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8200#section-4.5" derivedContent="RFC8200"/>) Fragment Offset is not 0 AND M flag is 0</dd>
          <dt pn="section-3.6-6.7">0:</dt>
          <dd pn="section-3.6-6.8">
            <bcp14>MUST</bcp14> be set to 0 on NLRI encoding and <bcp14>MUST</bcp14> be ignored 
	  during decoding</dd>
        </dl>
      </section>
      <section anchor="type_13" numbered="true" toc="include" removeInRFC="false" pn="section-3.7">
        <name slugifiedName="name-type-13-flow-label-new">Type 13 - Flow Label (new)</name>
        <dl newline="false" spacing="normal" indent="3" pn="section-3.7-1">
          <dt pn="section-3.7-1.1">Encoding:</dt>
          <dd pn="section-3.7-1.2">&lt;type (1 octet), [numeric_op, value]+&gt;</dd>
        </dl>
        <t indent="0" pn="section-3.7-2">This contains a list of {numeric_op, value} pairs that are used to match
      the 20-bit Flow Label IPv6 header field (<xref target="RFC8200" sectionFormat="of" section="3" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8200#section-3" derivedContent="RFC8200"/>).
        </t>
        <t indent="0" pn="section-3.7-3">This component uses the Numeric Operator (numeric_op) described in
      <xref target="RFC8955" sectionFormat="of" section="4.2.1.1" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8955#section-4.2.1.1" derivedContent="RFC8955"/>. Type 13
      component values <bcp14>SHOULD</bcp14> be encoded as 4-octet quantities
      (numeric_op len=10).
        </t>
      </section>
      <section anchor="examples" numbered="true" toc="include" removeInRFC="false" pn="section-3.8">
        <name slugifiedName="name-encoding-examples">Encoding Examples</name>
        <section numbered="true" removeInRFC="false" toc="exclude" pn="section-3.8.1">
          <name slugifiedName="name-example-1">Example 1</name>
          <t indent="0" pn="section-3.8.1-1">
   The following example demonstrates the prefix encoding for
   packets from ::1234:5678:9a00:0/64-104 to 2001:db8::/32 and upper-layer protocol tcp.
          </t>
          <table anchor="example-1" align="left" pn="table-1">
            <thead>
              <tr>
                <th align="left" colspan="1" rowspan="1">len</th>
                <th align="left" colspan="1" rowspan="1">destination</th>
                <th align="left" colspan="1" rowspan="1">source</th>
                <th align="left" colspan="1" rowspan="1">ul-proto</th>
              </tr>
            </thead>
            <tbody>
              <tr>
                <td align="left" colspan="1" rowspan="1">0x12</td>
                <td align="left" colspan="1" rowspan="1">01 20 00 20 01 0d bb</td>
                <td align="left" colspan="1" rowspan="1">02 68 40 12 34 56 78 9a</td>
                <td align="left" colspan="1" rowspan="1">03 81 06</td>
              </tr>
            </tbody>
          </table>
          <t indent="0" pn="section-3.8.1-3">Decoded:</t>
          <table anchor="example-1-decoded" align="left" pn="table-2">
            <thead>
              <tr>
                <th align="left" colspan="1" rowspan="1">Value</th>
                <th align="left" colspan="1" rowspan="1"/>
                <th align="left" colspan="1" rowspan="1"/>
              </tr>
            </thead>
            <tbody>
              <tr>
                <td align="left" colspan="1" rowspan="1">0x12</td>
                <td align="left" colspan="1" rowspan="1">length</td>
                <td align="left" colspan="1" rowspan="1">18 octets (if len&lt;240, 1 octet)</td>
              </tr>
              <tr>
                <td align="left" colspan="1" rowspan="1">0x01</td>
                <td align="left" colspan="1" rowspan="1">type</td>
                <td align="left" colspan="1" rowspan="1">Type 1 - Dest. IPv6 Prefix</td>
              </tr>
              <tr>
                <td align="left" colspan="1" rowspan="1">0x20</td>
                <td align="left" colspan="1" rowspan="1">length</td>
                <td align="left" colspan="1" rowspan="1">32 bits</td>
              </tr>
              <tr>
                <td align="left" colspan="1" rowspan="1">0x00</td>
                <td align="left" colspan="1" rowspan="1">offset</td>
                <td align="left" colspan="1" rowspan="1">0 bits</td>
              </tr>
              <tr>
                <td align="left" colspan="1" rowspan="1">0x20</td>
                <td align="left" colspan="1" rowspan="1">pattern</td>
                <td align="left" colspan="1" rowspan="1"/>
              </tr>
              <tr>
                <td align="left" colspan="1" rowspan="1">0x01</td>
                <td align="left" colspan="1" rowspan="1">pattern</td>
                <td align="left" colspan="1" rowspan="1"/>
              </tr>
              <tr>
                <td align="left" colspan="1" rowspan="1">0x0d</td>
                <td align="left" colspan="1" rowspan="1">pattern</td>
                <td align="left" colspan="1" rowspan="1"/>
              </tr>
              <tr>
                <td align="left" colspan="1" rowspan="1">0xb8</td>
                <td align="left" colspan="1" rowspan="1">pattern</td>
                <td align="left" colspan="1" rowspan="1">(no padding needed)</td>
              </tr>
              <tr>
                <td align="left" colspan="1" rowspan="1">0x02</td>
                <td align="left" colspan="1" rowspan="1">type</td>
                <td align="left" colspan="1" rowspan="1">Type 2 - Source IPv6 Prefix</td>
              </tr>
              <tr>
                <td align="left" colspan="1" rowspan="1">0x68</td>
                <td align="left" colspan="1" rowspan="1">length</td>
                <td align="left" colspan="1" rowspan="1">104 bits</td>
              </tr>
              <tr>
                <td align="left" colspan="1" rowspan="1">0x40</td>
                <td align="left" colspan="1" rowspan="1">offset</td>
                <td align="left" colspan="1" rowspan="1">64 bits</td>
              </tr>
              <tr>
                <td align="left" colspan="1" rowspan="1">0x12</td>
                <td align="left" colspan="1" rowspan="1">pattern</td>
                <td align="left" colspan="1" rowspan="1"/>
              </tr>
              <tr>
                <td align="left" colspan="1" rowspan="1">0x34</td>
                <td align="left" colspan="1" rowspan="1">pattern</td>
                <td align="left" colspan="1" rowspan="1"/>
              </tr>
              <tr>
                <td align="left" colspan="1" rowspan="1">0x56</td>
                <td align="left" colspan="1" rowspan="1">pattern</td>
                <td align="left" colspan="1" rowspan="1"/>
              </tr>
              <tr>
                <td align="left" colspan="1" rowspan="1">0x78</td>
                <td align="left" colspan="1" rowspan="1">pattern</td>
                <td align="left" colspan="1" rowspan="1"/>
              </tr>
              <tr>
                <td align="left" colspan="1" rowspan="1">0x9a</td>
                <td align="left" colspan="1" rowspan="1">pattern</td>
                <td align="left" colspan="1" rowspan="1">(no padding needed)</td>
              </tr>
              <tr>
                <td align="left" colspan="1" rowspan="1">0x03</td>
                <td align="left" colspan="1" rowspan="1">type</td>
                <td align="left" colspan="1" rowspan="1">Type 3 - Upper-Layer Protocol</td>
              </tr>
              <tr>
                <td align="left" colspan="1" rowspan="1">0x81</td>
                <td align="left" colspan="1" rowspan="1">numeric_op</td>
                <td align="left" colspan="1" rowspan="1">end-of-list, value size=1, ==</td>
              </tr>
              <tr>
                <td align="left" colspan="1" rowspan="1">0x06</td>
                <td align="left" colspan="1" rowspan="1">value</td>
                <td align="left" colspan="1" rowspan="1">06</td>
              </tr>
            </tbody>
          </table>
          <t indent="0" pn="section-3.8.1-5">This constitutes an NLRI with an NLRI length of 18 octets.</t>
          <t indent="0" pn="section-3.8.1-6">
    Padding is not needed either for the destination prefix pattern
    (length - offset = 32 bits) or for the source prefix pattern
    (length - offset = 40 bits), as both patterns end on an octet
    boundary.
</t>
        </section>
        <section numbered="true" removeInRFC="false" toc="exclude" pn="section-3.8.2">
          <name slugifiedName="name-example-2">Example 2</name>
          <t indent="0" pn="section-3.8.2-1">
   The following example demonstrates the prefix encoding for all
   packets from ::1234:5678:9a00:0/65-104 to 2001:db8::/32.
</t>
          <table anchor="example-2" align="left" pn="table-3">
            <thead>
              <tr>
                <th align="left" colspan="1" rowspan="1">length</th>
                <th align="left" colspan="1" rowspan="1">destination</th>
                <th align="left" colspan="1" rowspan="1">source</th>
              </tr>
            </thead>
            <tbody>
              <tr>
                <td align="left" colspan="1" rowspan="1">0x0f</td>
                <td align="left" colspan="1" rowspan="1">01 20 00 20 01 0d b8</td>
                <td align="left" colspan="1" rowspan="1">02 68 41 24 68 ac f1 34</td>
              </tr>
            </tbody>
          </table>
          <t indent="0" pn="section-3.8.2-3">Decoded:</t>
          <table anchor="example-2-decoded" align="left" pn="table-4">
            <thead>
              <tr>
                <th align="left" colspan="1" rowspan="1">Value</th>
                <th align="left" colspan="1" rowspan="1"/>
                <th align="left" colspan="1" rowspan="1"/>
              </tr>
            </thead>
            <tbody>
              <tr>
                <td align="left" colspan="1" rowspan="1">0x0f</td>
                <td align="left" colspan="1" rowspan="1">length</td>
                <td align="left" colspan="1" rowspan="1">15 octets (if len&lt;240, 1 octet)</td>
              </tr>
              <tr>
                <td align="left" colspan="1" rowspan="1">0x01</td>
                <td align="left" colspan="1" rowspan="1">type</td>
                <td align="left" colspan="1" rowspan="1">Type 1 - Dest. IPv6 Prefix</td>
              </tr>
              <tr>
                <td align="left" colspan="1" rowspan="1">0x20</td>
                <td align="left" colspan="1" rowspan="1">length</td>
                <td align="left" colspan="1" rowspan="1">32 bits</td>
              </tr>
              <tr>
                <td align="left" colspan="1" rowspan="1">0x00</td>
                <td align="left" colspan="1" rowspan="1">offset</td>
                <td align="left" colspan="1" rowspan="1">0 bits</td>
              </tr>
              <tr>
                <td align="left" colspan="1" rowspan="1">0x20</td>
                <td align="left" colspan="1" rowspan="1">pattern</td>
                <td align="left" colspan="1" rowspan="1"/>
              </tr>
              <tr>
                <td align="left" colspan="1" rowspan="1">0x01</td>
                <td align="left" colspan="1" rowspan="1">pattern</td>
                <td align="left" colspan="1" rowspan="1"/>
              </tr>
              <tr>
                <td align="left" colspan="1" rowspan="1">0x0d</td>
                <td align="left" colspan="1" rowspan="1">pattern</td>
                <td align="left" colspan="1" rowspan="1"/>
              </tr>
              <tr>
                <td align="left" colspan="1" rowspan="1">0xb8</td>
                <td align="left" colspan="1" rowspan="1">pattern</td>
                <td align="left" colspan="1" rowspan="1">(no padding needed)</td>
              </tr>
              <tr>
                <td align="left" colspan="1" rowspan="1">0x02</td>
                <td align="left" colspan="1" rowspan="1">type</td>
                <td align="left" colspan="1" rowspan="1">Type 2 - Source IPv6 Prefix</td>
              </tr>
              <tr>
                <td align="left" colspan="1" rowspan="1">0x68</td>
                <td align="left" colspan="1" rowspan="1">length</td>
                <td align="left" colspan="1" rowspan="1">104 bits</td>
              </tr>
              <tr>
                <td align="left" colspan="1" rowspan="1">0x41</td>
                <td align="left" colspan="1" rowspan="1">offset</td>
                <td align="left" colspan="1" rowspan="1">65 bits</td>
              </tr>
              <tr>
                <td align="left" colspan="1" rowspan="1">0x24</td>
                <td align="left" colspan="1" rowspan="1">pattern</td>
                <td align="left" colspan="1" rowspan="1"/>
              </tr>
              <tr>
                <td align="left" colspan="1" rowspan="1">0x68</td>
                <td align="left" colspan="1" rowspan="1">pattern</td>
                <td align="left" colspan="1" rowspan="1"/>
              </tr>
              <tr>
                <td align="left" colspan="1" rowspan="1">0xac</td>
                <td align="left" colspan="1" rowspan="1">pattern</td>
                <td align="left" colspan="1" rowspan="1"/>
              </tr>
              <tr>
                <td align="left" colspan="1" rowspan="1">0xf1</td>
                <td align="left" colspan="1" rowspan="1">pattern</td>
                <td align="left" colspan="1" rowspan="1"/>
              </tr>
              <tr>
                <td align="left" colspan="1" rowspan="1">0x34</td>
                <td align="left" colspan="1" rowspan="1">pattern/pad</td>
                <td align="left" colspan="1" rowspan="1">(contains 1 bit of padding)</td>
              </tr>
            </tbody>
          </table>
          <t indent="0" pn="section-3.8.2-5">This constitutes an NLRI with an NLRI length of 15 octets.</t>
          <t indent="0" pn="section-3.8.2-6">
    The source prefix pattern is 104 - 65 = 39 bits in length. 
    After the pattern, one bit of padding needs to be added so that the 
    component ends on an octet boundary. However, only the first 39 bits 
    are actually used for bitwise pattern matching, starting with a 65-bit 
    offset from the topmost bit of the address. 
</t>
        </section>
      </section>
    </section>
    <section numbered="true" toc="include" removeInRFC="false" pn="section-4">
      <name slugifiedName="name-ordering-of-flow-specificat">Ordering of Flow Specifications</name>
      <t indent="0" pn="section-4-1">
	The definition for the order of traffic filtering rules from
    <xref target="RFC8955" sectionFormat="of" section="5.1" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8955#section-5.1" derivedContent="RFC8955"/> is
    reused with new consideration for the IPv6 prefix offset.  As long
    as the offsets are equal, the comparison is the same, retaining
    longest-prefix-match semantics.  If the offsets are not equal, the
    lowest offset has precedence, as this Flow Specification matches the most significant bit.
      </t>
      <t indent="0" pn="section-4-2">
      The code in <xref target="flow_rule_cmp_src" format="default" sectionFormat="of" derivedContent="Appendix A"/> shows a Python3 implementation
      of the resulting comparison algorithm. The full code was tested with Python 3.7.2 and can be
      obtained at <eref target="https://github.com/stoffi92/draft-ietf-idr-flow-spec-v6/tree/master/flowspec-cmp" brackets="angle"/>.
      </t>
    </section>
    <section numbered="true" toc="include" removeInRFC="false" pn="section-5">
      <name slugifiedName="name-validation-procedure">Validation Procedure</name>
      <t indent="0" pn="section-5-1">
    The validation procedure is the same as specified in
    <xref target="RFC8955" sectionFormat="of" section="6" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8955#section-6" derivedContent="RFC8955"/> with the exception
    that item a) of the validation procedure should now read as follows:
      </t>
      <blockquote pn="section-5-2">
        <ol type="%c)" indent="adaptive" spacing="normal" start="1" pn="section-5-2.1">
	  <li pn="section-5-2.1.1" derivedCounter="a)">A destination prefix component with offset=0 is embedded in the
          Flow Specification</li>
        </ol>
      </blockquote>
    </section>
    <section numbered="true" toc="include" removeInRFC="false" pn="section-6">
      <name slugifiedName="name-ipv6-traffic-filtering-acti">IPv6 Traffic Filtering Action Changes</name>
      <t indent="0" pn="section-6-1">Traffic Filtering Actions from <xref target="RFC8955" sectionFormat="of" section="7" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8955#section-7" derivedContent="RFC8955"/>
        can also be applied to IPv6 Flow Specifications. To allow
        an IPv6-Address-Specific Route-Target, a new Traffic Filtering
        Action IPv6-Address-Specific Extended Community is specified in
        <xref target="redirect_ipv6" format="default" sectionFormat="of" derivedContent="Section 6.1"/> below.
      </t>
      <section anchor="redirect_ipv6" numbered="true" toc="include" removeInRFC="false" pn="section-6.1">
        <name slugifiedName="name-redirect-ipv6-rt-redirect-i">Redirect IPv6 (rt-redirect-ipv6) Type 0x000d</name>
        <t indent="0" pn="section-6.1-1">The redirect IPv6-Address-Specific Extended Community
       allows the traffic to be redirected to a VRF routing instance that
       lists the specified IPv6-Address-Specific Route-Target in its import
       policy.  If several local instances match this criteria, the choice
       between them is a local matter (for example, the instance with the
       lowest Route Distinguisher value can be elected).
        </t>
        <t indent="0" pn="section-6.1-2">This IPv6-Address-Specific Extended Community uses the same encoding as the IPv6-Address-Specific 
	Route-Target Extended Community
       (<xref target="RFC5701" sectionFormat="of" section="2" format="default" derivedLink="https://rfc-editor.org/rfc/rfc5701#section-2" derivedContent="RFC5701"/>) with the
       Type value always 0x000d.
        </t>
        <t indent="0" pn="section-6.1-3">The Local Administrator subfield contains a number from a numbering
          space that is administered by the organization to which the IP
          address carried in the Global Administrator subfield has been
          assigned by an appropriate authority. 
        </t>
        <t indent="0" pn="section-6.1-4">Interferes with: All BGP Flow Specification redirect Traffic Filtering
           Actions (with itself and those specified in
           <xref target="RFC8955" sectionFormat="of" section="7.4" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8955#section-7.4" derivedContent="RFC8955"/>).
        </t>
      </section>
    </section>
    <section numbered="true" toc="include" removeInRFC="false" pn="section-7">
      <name slugifiedName="name-security-considerations">Security Considerations</name>
      <t indent="0" pn="section-7-1">This document extends the functionality in <xref target="RFC8955" format="default" sectionFormat="of" derivedContent="RFC8955"/> 
      to be applicable to IPv6 data packets. The same security considerations from <xref target="RFC8955" format="default" sectionFormat="of" derivedContent="RFC8955"/> now also apply to IPv6 networks.</t>
      <t indent="0" pn="section-7-2"><xref target="RFC7112" format="default" sectionFormat="of" derivedContent="RFC7112"/> describes the impact of oversized 
      IPv6 header chains when trying to match on the transport header; <xref target="RFC8200" sectionFormat="of" section="4.5" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8200#section-4.5" derivedContent="RFC8200"/> also requires that the first fragment must include 
      the upper-layer header, but there could be wrongly formatted packets not respecting <xref target="RFC8200" format="default" sectionFormat="of" derivedContent="RFC8200"/>. IPv6 Flow Specification component Type 3 (<xref target="type_3" format="default" sectionFormat="of" derivedContent="Section 3.3"/>) will not be enforced for those illegal packets. 
      Moreover, there are hardware limitations in several routers (<xref target="RFC8883" sectionFormat="of" section="1" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8883#section-1" derivedContent="RFC8883"/>) that may make it impossible to enforce a policy signaled 
      by a Type 3 Flow Specification component or Flow Specification components that match on 
      upper-layer properties of the packet.</t>
    </section>
    <section anchor="IANA" numbered="true" toc="include" removeInRFC="false" pn="section-8">
      <name slugifiedName="name-iana-considerations">IANA Considerations</name>
      <t indent="0" pn="section-8-1">This section complies with <xref target="RFC7153" format="default" sectionFormat="of" derivedContent="RFC7153"/>.
      </t>
      <section numbered="true" toc="include" removeInRFC="false" pn="section-8.1">
        <name slugifiedName="name-flow-spec-ipv6-component-ty">Flow Spec IPv6 Component Types</name>
        <t indent="0" pn="section-8.1-1">
    IANA has created and maintains a registry entitled "Flow Spec Component Types". 
    IANA has added this document as a reference for that registry.  
    Furthermore, the registry has been updated to also contain the IPv6 Flow Specification 
    Component Types as described below. The registration procedure remains unchanged.
        </t>
        <section numbered="true" toc="exclude" removeInRFC="false" pn="section-8.1.1">
          <name slugifiedName="name-registry-template">Registry Template</name>
          <dl newline="false" spacing="normal" indent="13" pn="section-8.1.1-1">
            <dt pn="section-8.1.1-1.1">Type Value:</dt>
            <dd pn="section-8.1.1-1.2">contains the assigned Flow Specification component type value</dd>
            <dt pn="section-8.1.1-1.3">IPv4 Name:</dt>
            <dd pn="section-8.1.1-1.4">contains the associated IPv4 Flow Specification component name as specified in 
	    <xref target="RFC8955" format="default" sectionFormat="of" derivedContent="RFC8955"/></dd>
            <dt pn="section-8.1.1-1.5">IPv6 Name:</dt>
            <dd pn="section-8.1.1-1.6">contains the associated IPv6 Flow Specification component name as specified in
	    this document</dd>
            <dt pn="section-8.1.1-1.7">Reference:</dt>
            <dd pn="section-8.1.1-1.8">contains references to the specifications</dd>
          </dl>
        </section>
        <section numbered="true" toc="exclude" removeInRFC="false" pn="section-8.1.2">
          <name slugifiedName="name-registry-contents">Registry Contents</name>
          <dl newline="false" spacing="compact" indent="13" pn="section-8.1.2-1">
            <dt pn="section-8.1.2-1.1">Type Value:</dt>
            <dd pn="section-8.1.2-1.2">0</dd>
            <dt pn="section-8.1.2-1.3">IPv4 Name:</dt>
            <dd pn="section-8.1.2-1.4">Reserved</dd>
            <dt pn="section-8.1.2-1.5">IPv6 Name:</dt>
            <dd pn="section-8.1.2-1.6">Reserved</dd>
            <dt pn="section-8.1.2-1.7">Reference:</dt>
            <dd pn="section-8.1.2-1.8">
              <xref target="RFC8955" format="default" sectionFormat="of" derivedContent="RFC8955"/>, RFC 8956</dd>
          </dl>
          <dl newline="false" spacing="compact" indent="13" pn="section-8.1.2-2">
            <dt pn="section-8.1.2-2.1">Type Value:</dt>
            <dd pn="section-8.1.2-2.2">1</dd>
            <dt pn="section-8.1.2-2.3">IPv4 Name:</dt>
            <dd pn="section-8.1.2-2.4">Destination Prefix</dd>
            <dt pn="section-8.1.2-2.5">IPv6 Name:</dt>
            <dd pn="section-8.1.2-2.6">Destination IPv6 Prefix</dd>
            <dt pn="section-8.1.2-2.7">Reference:</dt>
            <dd pn="section-8.1.2-2.8">
              <xref target="RFC8955" format="default" sectionFormat="of" derivedContent="RFC8955"/>, RFC 8956</dd>
          </dl>
          <dl newline="false" spacing="compact" indent="13" pn="section-8.1.2-3">
            <dt pn="section-8.1.2-3.1">Type Value:</dt>
            <dd pn="section-8.1.2-3.2">2</dd>
            <dt pn="section-8.1.2-3.3">IPv4 Name:</dt>
            <dd pn="section-8.1.2-3.4">Source Prefix</dd>
            <dt pn="section-8.1.2-3.5">IPv6 Name:</dt>
            <dd pn="section-8.1.2-3.6">Source IPv6 Prefix</dd>
            <dt pn="section-8.1.2-3.7">Reference:</dt>
            <dd pn="section-8.1.2-3.8">
              <xref target="RFC8955" format="default" sectionFormat="of" derivedContent="RFC8955"/>, RFC 8956</dd>
          </dl>
          <dl newline="false" spacing="compact" indent="13" pn="section-8.1.2-4">
            <dt pn="section-8.1.2-4.1">Type Value:</dt>
            <dd pn="section-8.1.2-4.2">3</dd>
            <dt pn="section-8.1.2-4.3">IPv4 Name:</dt>
            <dd pn="section-8.1.2-4.4">IP Protocol</dd>
            <dt pn="section-8.1.2-4.5">IPv6 Name:</dt>
            <dd pn="section-8.1.2-4.6">Upper-Layer Protocol</dd>
            <dt pn="section-8.1.2-4.7">Reference:</dt>
            <dd pn="section-8.1.2-4.8">
              <xref target="RFC8955" format="default" sectionFormat="of" derivedContent="RFC8955"/>, RFC 8956</dd>
          </dl>
          <dl newline="false" spacing="compact" indent="13" pn="section-8.1.2-5">
            <dt pn="section-8.1.2-5.1">Type Value:</dt>
            <dd pn="section-8.1.2-5.2">4</dd>
            <dt pn="section-8.1.2-5.3">IPv4 Name:</dt>
            <dd pn="section-8.1.2-5.4">Port</dd>
            <dt pn="section-8.1.2-5.5">IPv6 Name:</dt>
            <dd pn="section-8.1.2-5.6">Port</dd>
            <dt pn="section-8.1.2-5.7">Reference:</dt>
            <dd pn="section-8.1.2-5.8">
              <xref target="RFC8955" format="default" sectionFormat="of" derivedContent="RFC8955"/>, RFC 8956</dd>
          </dl>
          <dl newline="false" spacing="compact" indent="13" pn="section-8.1.2-6">
            <dt pn="section-8.1.2-6.1">Type Value:</dt>
            <dd pn="section-8.1.2-6.2">5</dd>
            <dt pn="section-8.1.2-6.3">IPv4 Name:</dt>
            <dd pn="section-8.1.2-6.4">Destination Port</dd>
            <dt pn="section-8.1.2-6.5">IPv6 Name:</dt>
            <dd pn="section-8.1.2-6.6">Destination Port</dd>
            <dt pn="section-8.1.2-6.7">Reference:</dt>
            <dd pn="section-8.1.2-6.8">
              <xref target="RFC8955" format="default" sectionFormat="of" derivedContent="RFC8955"/>, RFC 8956</dd>
          </dl>
          <dl newline="false" spacing="compact" indent="13" pn="section-8.1.2-7">
            <dt pn="section-8.1.2-7.1">Type Value:</dt>
            <dd pn="section-8.1.2-7.2">6</dd>
            <dt pn="section-8.1.2-7.3">IPv4 Name:</dt>
            <dd pn="section-8.1.2-7.4">Source Port</dd>
            <dt pn="section-8.1.2-7.5">IPv6 Name:</dt>
            <dd pn="section-8.1.2-7.6">Source Port</dd>
            <dt pn="section-8.1.2-7.7">Reference:</dt>
            <dd pn="section-8.1.2-7.8">
              <xref target="RFC8955" format="default" sectionFormat="of" derivedContent="RFC8955"/>, RFC 8956</dd>
          </dl>
          <dl newline="false" spacing="compact" indent="13" pn="section-8.1.2-8">
            <dt pn="section-8.1.2-8.1">Type Value:</dt>
            <dd pn="section-8.1.2-8.2">7</dd>
            <dt pn="section-8.1.2-8.3">IPv4 Name:</dt>
            <dd pn="section-8.1.2-8.4">ICMP Type</dd>
            <dt pn="section-8.1.2-8.5">IPv6 Name:</dt>
            <dd pn="section-8.1.2-8.6">ICMPv6 Type</dd>
            <dt pn="section-8.1.2-8.7">Reference:</dt>
            <dd pn="section-8.1.2-8.8">
              <xref target="RFC8955" format="default" sectionFormat="of" derivedContent="RFC8955"/>, RFC 8956</dd>
          </dl>
          <dl newline="false" spacing="compact" indent="13" pn="section-8.1.2-9">
            <dt pn="section-8.1.2-9.1">Type Value:</dt>
            <dd pn="section-8.1.2-9.2">8</dd>
            <dt pn="section-8.1.2-9.3">IPv4 Name:</dt>
            <dd pn="section-8.1.2-9.4">ICMP Code</dd>
            <dt pn="section-8.1.2-9.5">IPv6 Name:</dt>
            <dd pn="section-8.1.2-9.6">ICMPv6 Code</dd>
            <dt pn="section-8.1.2-9.7">Reference:</dt>
            <dd pn="section-8.1.2-9.8">
              <xref target="RFC8955" format="default" sectionFormat="of" derivedContent="RFC8955"/>, RFC 8956</dd>
          </dl>
          <dl newline="false" spacing="compact" indent="13" pn="section-8.1.2-10">
            <dt pn="section-8.1.2-10.1">Type Value:</dt>
            <dd pn="section-8.1.2-10.2">9</dd>
            <dt pn="section-8.1.2-10.3">IPv4 Name:</dt>
            <dd pn="section-8.1.2-10.4">TCP Flags</dd>
            <dt pn="section-8.1.2-10.5">IPv6 Name:</dt>
            <dd pn="section-8.1.2-10.6">TCP Flags</dd>
            <dt pn="section-8.1.2-10.7">Reference:</dt>
            <dd pn="section-8.1.2-10.8">
              <xref target="RFC8955" format="default" sectionFormat="of" derivedContent="RFC8955"/>, RFC 8956</dd>
          </dl>
          <dl newline="false" spacing="compact" indent="13" pn="section-8.1.2-11">
            <dt pn="section-8.1.2-11.1">Type Value:</dt>
            <dd pn="section-8.1.2-11.2">10</dd>
            <dt pn="section-8.1.2-11.3">IPv4 Name:</dt>
            <dd pn="section-8.1.2-11.4">Packet Length</dd>
            <dt pn="section-8.1.2-11.5">IPv6 Name:</dt>
            <dd pn="section-8.1.2-11.6">Packet Length</dd>
            <dt pn="section-8.1.2-11.7">Reference:</dt>
            <dd pn="section-8.1.2-11.8">
              <xref target="RFC8955" format="default" sectionFormat="of" derivedContent="RFC8955"/>, RFC 8956</dd>
          </dl>
          <dl newline="false" spacing="compact" indent="13" pn="section-8.1.2-12">
            <dt pn="section-8.1.2-12.1">Type Value:</dt>
            <dd pn="section-8.1.2-12.2">11</dd>
            <dt pn="section-8.1.2-12.3">IPv4 Name:</dt>
            <dd pn="section-8.1.2-12.4">DSCP</dd>
            <dt pn="section-8.1.2-12.5">IPv6 Name:</dt>
            <dd pn="section-8.1.2-12.6">DSCP</dd>
            <dt pn="section-8.1.2-12.7">Reference:</dt>
            <dd pn="section-8.1.2-12.8">
              <xref target="RFC8955" format="default" sectionFormat="of" derivedContent="RFC8955"/>, RFC 8956</dd>
          </dl>
          <dl newline="false" spacing="compact" indent="13" pn="section-8.1.2-13">
            <dt pn="section-8.1.2-13.1">Type Value:</dt>
            <dd pn="section-8.1.2-13.2">12</dd>
            <dt pn="section-8.1.2-13.3">IPv4 Name:</dt>
            <dd pn="section-8.1.2-13.4">Fragment</dd>
            <dt pn="section-8.1.2-13.5">IPv6 Name:</dt>
            <dd pn="section-8.1.2-13.6">Fragment</dd>
            <dt pn="section-8.1.2-13.7">Reference:</dt>
            <dd pn="section-8.1.2-13.8">
              <xref target="RFC8955" format="default" sectionFormat="of" derivedContent="RFC8955"/>, RFC 8956</dd>
          </dl>
          <dl newline="false" spacing="compact" indent="13" pn="section-8.1.2-14">
            <dt pn="section-8.1.2-14.1">Type Value:</dt>
            <dd pn="section-8.1.2-14.2">13</dd>
            <dt pn="section-8.1.2-14.3">IPv4 Name:</dt>
            <dd pn="section-8.1.2-14.4">Unassigned</dd>
            <dt pn="section-8.1.2-14.5">IPv6 Name:</dt>
            <dd pn="section-8.1.2-14.6">Flow Label</dd>
            <dt pn="section-8.1.2-14.7">Reference:</dt>
            <dd pn="section-8.1.2-14.8">RFC 8956</dd>
          </dl>
          <dl newline="false" spacing="compact" indent="13" pn="section-8.1.2-15">
            <dt pn="section-8.1.2-15.1">Type Value:</dt>
            <dd pn="section-8.1.2-15.2">14-254</dd>
            <dt pn="section-8.1.2-15.3">IPv4 Name:</dt>
            <dd pn="section-8.1.2-15.4">Unassigned</dd>
            <dt pn="section-8.1.2-15.5">IPv6 Name:</dt>
            <dd pn="section-8.1.2-15.6">Unassigned</dd>
          </dl>
          <dl newline="false" spacing="compact" indent="13" pn="section-8.1.2-16">
            <dt pn="section-8.1.2-16.1">Type Value:</dt>
            <dd pn="section-8.1.2-16.2">255</dd>
            <dt pn="section-8.1.2-16.3">IPv4 Name:</dt>
            <dd pn="section-8.1.2-16.4">Reserved</dd>
            <dt pn="section-8.1.2-16.5">IPv6 Name:</dt>
            <dd pn="section-8.1.2-16.6">Reserved</dd>
            <dt pn="section-8.1.2-16.7">Reference:</dt>
            <dd pn="section-8.1.2-16.8">
              <xref target="RFC8955" format="default" sectionFormat="of" derivedContent="RFC8955"/>, RFC 8956</dd>
          </dl>
        </section>
      </section>
      <section numbered="true" toc="include" removeInRFC="false" pn="section-8.2">
        <name slugifiedName="name-ipv6-address-specific-exten">IPv6-Address-Specific Extended Community Flow Spec IPv6 Actions</name>
        <t indent="0" pn="section-8.2-1">
        IANA maintains a registry entitled "Transitive IPv6-Address-Specific
        Extended Community Types". For the purpose of
        this work, IANA has assigned a new value:
        </t>
        <table anchor="iana_ext_comm_subtypes" align="center" pn="table-5">
          <name slugifiedName="name-transitive-ipv6-address-spe">Transitive IPv6-Address-Specific Extended Community Types Registry</name>
          <thead>
            <tr>
              <th align="left" colspan="1" rowspan="1">Type Value</th>
              <th align="left" colspan="1" rowspan="1">Name</th>
              <th align="left" colspan="1" rowspan="1">Reference</th>
            </tr>
          </thead>
          <tbody>
            <tr>
              <td align="left" colspan="1" rowspan="1">0x000d</td>
              <td align="left" colspan="1" rowspan="1">Flow spec rt-redirect-ipv6 format</td>
              <td align="left" colspan="1" rowspan="1">RFC 8956</td>
            </tr>
          </tbody>
        </table>
      </section>
    </section>
  </middle>
  <back>
    <references pn="section-9">
      <name slugifiedName="name-normative-references">Normative References</name>
      <reference anchor="RFC2119" target="https://www.rfc-editor.org/info/rfc2119" quoteTitle="true" derivedAnchor="RFC2119">
        <front>
          <title>Key words for use in RFCs to Indicate Requirement Levels</title>
          <author initials="S." surname="Bradner" fullname="S. Bradner">
            <organization showOnFrontPage="true"/>
          </author>
          <date year="1997" month="March"/>
          <abstract>
            <t indent="0">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>
      <reference anchor="RFC4271" target="https://www.rfc-editor.org/info/rfc4271" quoteTitle="true" derivedAnchor="RFC4271">
        <front>
          <title>A Border Gateway Protocol 4 (BGP-4)</title>
          <author initials="Y." surname="Rekhter" fullname="Y. Rekhter" role="editor">
            <organization showOnFrontPage="true"/>
          </author>
          <author initials="T." surname="Li" fullname="T. Li" role="editor">
            <organization showOnFrontPage="true"/>
          </author>
          <author initials="S." surname="Hares" fullname="S. Hares" role="editor">
            <organization showOnFrontPage="true"/>
          </author>
          <date year="2006" month="January"/>
          <abstract>
            <t indent="0">This document discusses the Border Gateway Protocol (BGP), which is an inter-Autonomous System routing protocol.</t>
            <t indent="0">The primary function of a BGP speaking system is to exchange network reachability information with other BGP systems.  This network reachability information includes information on the list of Autonomous Systems (ASes) that reachability information traverses. This information is sufficient for constructing a graph of AS connectivity for this reachability from which routing loops may be pruned, and, at the AS level, some policy decisions may be enforced.</t>
            <t indent="0">BGP-4 provides a set of mechanisms for supporting Classless Inter-Domain Routing (CIDR).  These mechanisms include support for advertising a set of destinations as an IP prefix, and eliminating the concept of network "class" within BGP.  BGP-4 also introduces mechanisms that allow aggregation of routes, including aggregation of AS paths.</t>
            <t indent="0">This document obsoletes RFC 1771.  [STANDARDS-TRACK]</t>
          </abstract>
        </front>
        <seriesInfo name="RFC" value="4271"/>
        <seriesInfo name="DOI" value="10.17487/RFC4271"/>
      </reference>
      <reference anchor="RFC4443" target="https://www.rfc-editor.org/info/rfc4443" quoteTitle="true" derivedAnchor="RFC4443">
        <front>
          <title>Internet Control Message Protocol (ICMPv6) for the Internet Protocol Version 6 (IPv6) Specification</title>
          <author initials="A." surname="Conta" fullname="A. Conta">
            <organization showOnFrontPage="true"/>
          </author>
          <author initials="S." surname="Deering" fullname="S. Deering">
            <organization showOnFrontPage="true"/>
          </author>
          <author initials="M." surname="Gupta" fullname="M. Gupta" role="editor">
            <organization showOnFrontPage="true"/>
          </author>
          <date year="2006" month="March"/>
          <abstract>
            <t indent="0">This document describes the format of a set of control messages used in ICMPv6 (Internet Control Message Protocol).  ICMPv6 is the Internet Control Message Protocol for Internet Protocol version 6 (IPv6).  [STANDARDS-TRACK]</t>
          </abstract>
        </front>
        <seriesInfo name="STD" value="89"/>
        <seriesInfo name="RFC" value="4443"/>
        <seriesInfo name="DOI" value="10.17487/RFC4443"/>
      </reference>
      <reference anchor="RFC4760" target="https://www.rfc-editor.org/info/rfc4760" quoteTitle="true" derivedAnchor="RFC4760">
        <front>
          <title>Multiprotocol Extensions for BGP-4</title>
          <author initials="T." surname="Bates" fullname="T. Bates">
            <organization showOnFrontPage="true"/>
          </author>
          <author initials="R." surname="Chandra" fullname="R. Chandra">
            <organization showOnFrontPage="true"/>
          </author>
          <author initials="D." surname="Katz" fullname="D. Katz">
            <organization showOnFrontPage="true"/>
          </author>
          <author initials="Y." surname="Rekhter" fullname="Y. Rekhter">
            <organization showOnFrontPage="true"/>
          </author>
          <date year="2007" month="January"/>
          <abstract>
            <t indent="0">This document defines extensions to BGP-4 to enable it to carry routing information for multiple Network Layer protocols (e.g., IPv6, IPX, L3VPN, etc.).  The extensions are backward compatible - a router that supports the extensions can interoperate with a router that doesn't support the extensions.  [STANDARDS-TRACK]</t>
          </abstract>
        </front>
        <seriesInfo name="RFC" value="4760"/>
        <seriesInfo name="DOI" value="10.17487/RFC4760"/>
      </reference>
      <reference anchor="RFC5701" target="https://www.rfc-editor.org/info/rfc5701" quoteTitle="true" derivedAnchor="RFC5701">
        <front>
          <title>IPv6 Address Specific BGP Extended Community Attribute</title>
          <author initials="Y." surname="Rekhter" fullname="Y. Rekhter">
            <organization showOnFrontPage="true"/>
          </author>
          <date year="2009" month="November"/>
          <abstract>
            <t indent="0">Current specifications of BGP Extended Communities (RFC 4360) support the IPv4 Address Specific Extended Community, but do not support an IPv6 Address Specific Extended Community.  The lack of an IPv6 Address Specific Extended Community may be a problem when an application uses the IPv4 Address Specific Extended Community, and one wants to use this application in a pure IPv6 environment.  This document defines a new BGP attribute, the IPv6 Address Specific Extended Community, that addresses this problem.  The IPv6 Address Specific Extended Community is similar to the IPv4 Address Specific Extended Community, except that it carries an IPv6 address rather than an IPv4 address.  [STANDARDS TRACK]</t>
          </abstract>
        </front>
        <seriesInfo name="RFC" value="5701"/>
        <seriesInfo name="DOI" value="10.17487/RFC5701"/>
      </reference>
      <reference anchor="RFC7112" target="https://www.rfc-editor.org/info/rfc7112" quoteTitle="true" derivedAnchor="RFC7112">
        <front>
          <title>Implications of Oversized IPv6 Header Chains</title>
          <author initials="F." surname="Gont" fullname="F. Gont">
            <organization showOnFrontPage="true"/>
          </author>
          <author initials="V." surname="Manral" fullname="V. Manral">
            <organization showOnFrontPage="true"/>
          </author>
          <author initials="R." surname="Bonica" fullname="R. Bonica">
            <organization showOnFrontPage="true"/>
          </author>
          <date year="2014" month="January"/>
          <abstract>
            <t indent="0">The IPv6 specification allows IPv6 Header Chains of an arbitrary size.  The specification also allows options that can, in turn, extend each of the headers.  In those scenarios in which the IPv6 Header Chain or options are unusually long and packets are fragmented, or scenarios in which the fragment size is very small, the First Fragment of a packet may fail to include the entire IPv6 Header Chain.  This document discusses the interoperability and security problems of such traffic, and updates RFC 2460 such that the First Fragment of a packet is required to contain the entire IPv6 Header Chain.</t>
          </abstract>
        </front>
        <seriesInfo name="RFC" value="7112"/>
        <seriesInfo name="DOI" value="10.17487/RFC7112"/>
      </reference>
      <reference anchor="RFC7153" target="https://www.rfc-editor.org/info/rfc7153" quoteTitle="true" derivedAnchor="RFC7153">
        <front>
          <title>IANA Registries for BGP Extended Communities</title>
          <author initials="E." surname="Rosen" fullname="E. Rosen">
            <organization showOnFrontPage="true"/>
          </author>
          <author initials="Y." surname="Rekhter" fullname="Y. Rekhter">
            <organization showOnFrontPage="true"/>
          </author>
          <date year="2014" month="March"/>
          <abstract>
            <t indent="0">This document reorganizes the IANA registries for the type values and sub-type values of the BGP Extended Communities attribute and the BGP IPv6-Address-Specific Extended Communities attribute.  This is done in order to remove interdependencies among the registries, thus making it easier for IANA to determine which codepoints are available for assignment in which registries.  This document also clarifies the information that must be provided to IANA when requesting an allocation from one or more of these registries.  These changes are compatible with the existing allocations and thus do not affect protocol implementations.  The changes will, however, impact the "IANA Considerations" sections of future protocol specifications. This document updates RFC 4360 and RFC 5701.</t>
          </abstract>
        </front>
        <seriesInfo name="RFC" value="7153"/>
        <seriesInfo name="DOI" value="10.17487/RFC7153"/>
      </reference>
      <reference anchor="RFC8174" target="https://www.rfc-editor.org/info/rfc8174" quoteTitle="true" derivedAnchor="RFC8174">
        <front>
          <title>Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words</title>
          <author initials="B." surname="Leiba" fullname="B. Leiba">
            <organization showOnFrontPage="true"/>
          </author>
          <date year="2017" month="May"/>
          <abstract>
            <t indent="0">RFC 2119 specifies common key words that may be used in protocol  specifications.  This document aims to reduce the ambiguity by clarifying that only UPPERCASE usage of the key words have the  defined special meanings.</t>
          </abstract>
        </front>
        <seriesInfo name="BCP" value="14"/>
        <seriesInfo name="RFC" value="8174"/>
        <seriesInfo name="DOI" value="10.17487/RFC8174"/>
      </reference>
      <reference anchor="RFC8200" target="https://www.rfc-editor.org/info/rfc8200" quoteTitle="true" derivedAnchor="RFC8200">
        <front>
          <title>Internet Protocol, Version 6 (IPv6) Specification</title>
          <author initials="S." surname="Deering" fullname="S. Deering">
            <organization showOnFrontPage="true"/>
          </author>
          <author initials="R." surname="Hinden" fullname="R. Hinden">
            <organization showOnFrontPage="true"/>
          </author>
          <date year="2017" month="July"/>
          <abstract>
            <t indent="0">This document specifies version 6 of the Internet Protocol (IPv6). It obsoletes RFC 2460.</t>
          </abstract>
        </front>
        <seriesInfo name="STD" value="86"/>
        <seriesInfo name="RFC" value="8200"/>
        <seriesInfo name="DOI" value="10.17487/RFC8200"/>
      </reference>
      <reference anchor="RFC8883" target="https://www.rfc-editor.org/info/rfc8883" quoteTitle="true" derivedAnchor="RFC8883">
        <front>
          <title>ICMPv6 Errors for Discarding Packets Due to Processing Limits</title>
          <author initials="T." surname="Herbert" fullname="T. Herbert">
            <organization showOnFrontPage="true"/>
          </author>
          <date year="2020" month="September"/>
          <abstract>
            <t indent="0">Network nodes may discard packets if they are unable to process protocol headers of packets due to processing constraints or limits. When such packets are dropped, the sender receives no indication, so it cannot take action to address the cause of discarded packets. This specification defines several new ICMPv6 errors that can be sent by a node that discards packets because it is unable to process the protocol headers. A node that receives such an ICMPv6 error may use the information to diagnose packet loss and may modify what it sends in future packets to avoid subsequent packet discards.</t>
          </abstract>
        </front>
        <seriesInfo name="RFC" value="8883"/>
        <seriesInfo name="DOI" value="10.17487/RFC8883"/>
      </reference>
      <reference anchor="RFC8955" target="https://www.rfc-editor.org/info/rfc8955" quoteTitle="true" derivedAnchor="RFC8955">
        <front>
          <title>Dissemination of Flow Specification Rules</title>
          <author initials="C" surname="Loibl" fullname="Christoph Loibl">
            <organization showOnFrontPage="true"/>
          </author>
          <author initials="S" surname="Hares" fullname="Susan Hares">
            <organization showOnFrontPage="true"/>
          </author>
          <author initials="R" surname="Raszuk" fullname="Robert Raszuk">
            <organization showOnFrontPage="true"/>
          </author>
          <author initials="D" surname="McPherson" fullname="Danny McPherson">
            <organization showOnFrontPage="true"/>
          </author>
          <author initials="M" surname="Bacher" fullname="Martin Bacher">
            <organization showOnFrontPage="true"/>
          </author>
          <date month="December" year="2020"/>
        </front>
        <seriesInfo name="RFC" value="8955"/>
        <seriesInfo name="DOI" value="10.17487/RFC8955"/>
      </reference>
    </references>
    <section anchor="flow_rule_cmp_src" numbered="true" toc="include" removeInRFC="false" pn="section-appendix.a">
      <name slugifiedName="name-example-python-code-flow_ru">Example Python Code: flow_rule_cmp_v6</name>
      <sourcecode name="" type="python" markers="true" pn="section-appendix.a-1">
"""
Copyright (c) 2020 IETF Trust and the persons identified as authors
of the code. All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, is permitted pursuant to, and subject to the license
terms contained in, the Simplified BSD License set forth in Section
4.c of the IETF Trust's Legal Provisions Relating to IETF Documents
(https://trustee.ietf.org/license-info).
"""

import itertools
import collections
import ipaddress


EQUAL = 0
A_HAS_PRECEDENCE = 1
B_HAS_PRECEDENCE = 2
IP_DESTINATION = 1
IP_SOURCE = 2

FS_component = collections.namedtuple('FS_component',
                                      'component_type value')


class FS_IPv6_prefix_component:
    def __init__(self, prefix, offset=0,
                 component_type=IP_DESTINATION):
        self.offset = offset
        self.component_type = component_type
        # make sure if offset != 0 that none of the
        # first offset bits are set in the prefix
        self.value = prefix
        if offset != 0:
            i = ipaddress.IPv6Interface(
                (self.value.network_address, offset))
            if i.network.network_address != \
                ipaddress.ip_address('0::0'):
                raise ValueError('Bits set in the offset')


class FS_nlri(object):
    """
    FS_nlri class implementation that allows sorting.

    By calling .sort() on an array of FS_nlri objects these
    will be sorted according to the flow_rule_cmp algorithm.

    Example:
    nlri = [ FS_nlri(components=[
             FS_component(component_type=4,
                          value=bytearray([0,1,2,3,4,5,6])),
             ]),
             FS_nlri(components=[
             FS_component(component_type=5,
                          value=bytearray([0,1,2,3,4,5,6])),
             FS_component(component_type=6,
                          value=bytearray([0,1,2,3,4,5,6])),
             ]),
           ]
    nlri.sort() # sorts the array according to the algorithm
    """
    def __init__(self, components = None):
        """
        components: list of type FS_component
        """
        self.components = components

    def __lt__(self, other):
        # use the below algorithm for sorting
        result = flow_rule_cmp_v6(self, other)
        if result == B_HAS_PRECEDENCE:
            return True
        else:
            return False


def flow_rule_cmp_v6(a, b):
    """
    Implementation of the flowspec sorting algorithm in
    RFC 8956.
    """
    for comp_a, comp_b in itertools.zip_longest(a.components,
                                           b.components):
        # If a component type does not exist in one rule
        # this rule has lower precedence
        if not comp_a:
            return B_HAS_PRECEDENCE
        if not comp_b:
            return A_HAS_PRECEDENCE
        # Higher precedence for lower component type
        if comp_a.component_type &lt; comp_b.component_type:
            return A_HAS_PRECEDENCE
        if comp_a.component_type &gt; comp_b.component_type:
            return B_HAS_PRECEDENCE
        # component types are equal -&gt; type-specific comparison
        if comp_a.component_type in (IP_DESTINATION, IP_SOURCE):
            if comp_a.offset &lt; comp_b.offset:
                return A_HAS_PRECEDENCE
            if comp_a.offset &gt; comp_b.offset:
                return B_HAS_PRECEDENCE
            # both components have the same offset
            # assuming comp_a.value, comp_b.value of type
            # ipaddress.IPv6Network
            # and the offset bits are reset to 0 (since they are
            # not represented in the NLRI)
            if comp_a.value.overlaps(comp_b.value):
                # longest prefixlen has precedence
                if comp_a.value.prefixlen &gt; \
                    comp_b.value.prefixlen:
                    return A_HAS_PRECEDENCE
                if comp_a.value.prefixlen &lt; \
                    comp_b.value.prefixlen:
                    return B_HAS_PRECEDENCE
                # components equal -&gt; continue with next
                # component
            elif comp_a.value &gt; comp_b.value:
                return B_HAS_PRECEDENCE
            elif comp_a.value &lt; comp_b.value:
                return A_HAS_PRECEDENCE
        else:
            # assuming comp_a.value, comp_b.value of type
            # bytearray
            if len(comp_a.value) == len(comp_b.value):
                if comp_a.value &gt; comp_b.value:
                    return B_HAS_PRECEDENCE
                if comp_a.value &lt; comp_b.value:
                    return A_HAS_PRECEDENCE
                # components equal -&gt; continue with next
                # component
            else:
                common = min(len(comp_a.value),
                             len(comp_b.value))
                if comp_a.value[:common] &gt; \
                    comp_b.value[:common]:
                    return B_HAS_PRECEDENCE
                elif comp_a.value[:common] &lt; \
                      comp_b.value[:common]:
                    return A_HAS_PRECEDENCE
                # the first common bytes match
                elif len(comp_a.value) &gt; len(comp_b.value):
                    return A_HAS_PRECEDENCE
                else:
                    return B_HAS_PRECEDENCE
    return EQUAL
</sourcecode>
    </section>
    <section numbered="false" toc="include" removeInRFC="false" pn="section-appendix.b">
      <name slugifiedName="name-acknowledgments">Acknowledgments</name>
      <t indent="0" pn="section-appendix.b-1">The authors would like to thank <contact fullname="Pedro Marques"/>, <contact fullname="Hannes Gredler"/>, <contact fullname="Bruno Rijsman"/>, <contact fullname="Brian Carpenter"/>, and <contact fullname="Thomas Mangin"/> for their valuable input.
      </t>
    </section>
    <section numbered="false" toc="include" removeInRFC="false" pn="section-appendix.c">
      <name slugifiedName="name-contributors">Contributors</name>
      <contact fullname="Danny McPherson">
        <organization showOnFrontPage="true">Verisign, Inc.</organization>
        <address>
          <postal/>
          <email>dmcpherson@verisign.com</email>
        </address>
      </contact>
      <contact fullname="Burjiz Pithawala">
        <organization showOnFrontPage="true">Individual</organization>
        <address>
          <postal/>
          <email>burjizp@gmail.com</email>
        </address>
      </contact>
      <contact fullname="Andy Karch">
        <organization showOnFrontPage="true">Cisco Systems</organization>
        <address>
          <postal>
            <street>170 West Tasman Drive</street>
            <city>San Jose</city>
            <region>CA</region>
            <code>95134</code>
            <country>United States of America</country>
          </postal>
          <email>akarch@cisco.com</email>
        </address>
      </contact>
    </section>
    <section anchor="authors-addresses" numbered="false" removeInRFC="false" toc="include" pn="section-appendix.d">
      <name slugifiedName="name-authors-addresses">Authors' Addresses</name>
      <author role="editor" fullname="Christoph Loibl" initials="C" surname="Loibl">
        <organization showOnFrontPage="true">next layer Telekom GmbH</organization>
        <address>
          <postal>
            <street>Mariahilfer Guertel 37/7</street>
            <city>Vienna</city>
            <region/>
            <code>1150</code>
            <country>Austria</country>
          </postal>
          <phone>+43 664 1176414</phone>
          <email>cl@tix.at</email>
        </address>
      </author>
      <author fullname="Robert Raszuk" initials="R" surname="Raszuk" role="editor">
        <organization showOnFrontPage="true">NTT Network Innovations</organization>
        <address>
          <postal>
            <street>940 Stewart Dr</street>
            <city>Sunnyvale</city>
            <region>CA</region>
            <code>94085</code>
            <country>United States of America</country>
          </postal>
          <email>robert@raszuk.net</email>
        </address>
      </author>
      <author role="editor" fullname="Susan Hares" initials="S" surname="Hares">
        <organization showOnFrontPage="true">Huawei</organization>
        <address>
          <postal>
            <street>7453 Hickory Hill</street>
            <city>Saline</city>
            <region>MI</region>
            <code>48176</code>
            <country>United States of America</country>
          </postal>
          <email>shares@ndzh.com</email>
        </address>
      </author>
    </section>
  </back>
</rfc>
