<?xml version="1.0" encoding="US-ASCII"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
<?rfc toc="yes"?>
<?rfc tocompact="yes"?>
<?rfc tocdepth="1"?>
<?rfc tocindent="yes"?>
<?rfc symrefs="yes"?>
<?rfc sortrefs="yes"?>
<?rfc comments="yes"?>
<?rfc inline="yes"?>
<?rfc compact="yes"?>
<?rfc subcompact="no"?>
<rfc category="std" docName="draft-tgraf-opsawg-ipfix-srv6-srh-03"
     ipr="trust200902">
  <front>
    <title
    abbrev="IPFIX Segment Routing IPv6 Information">Export&nbsp;of&nbsp;Segment&nbsp;Routing&nbsp;IPv6&nbsp;Information&nbsp;in
    IP&nbsp;Flow&nbsp;Information&nbsp;Export&nbsp;(IPFIX)</title>

    <author fullname="Thomas Graf" initials="T" surname="Graf">
      <organization>Swisscom</organization>

      <address>
        <postal>
          <street>Binzring 17</street>

          <city>Zurich</city>

          <code>8045</code>

          <country>Switzerland</country>
        </postal>

        <email>thomas.graf@swisscom.com</email>
      </address>
    </author>

    <author fullname="Benoit Claise" initials="B" surname="Claise">
      <organization>Huawei</organization>

      <address>
        <email>benoit.claise@huawei.com</email>
      </address>
    </author>

    <date day="20" month="March" year="2022"/>

    <abstract>
      <t>This document introduces new IP Flow Information Export (IPFIX)
      information elements to identify the SRv6 Segment Routing Header
      dimensions and SRv6 Control Plane Protocol that traffic is being
      forwarded with.</t>
    </abstract>
  </front>

  <middle>
    <section anchor="Introduction" title="Introduction">
      <t>A new type of Routing Extension Header called Segment Routing Header
      (SRH) is defined by <xref target="RFC8754"/> which is used for applying
      Segment Routing (SR) on the IPv6 data plane.</t>

      <t>Three routing protocol extensions, <xref
      target="I-D.li-lsr-ospfv3-srv6-extensions">OSPFv3 Extensions</xref>,
      <xref target="I-D.ietf-lsr-isis-srv6-extensions">IS-IS
      Extensions</xref>, <xref target="I-D.ietf-bess-srv6-services">BGP Prefix
      Segment Identifiers (Prefix-SIDs)</xref> and one <xref
      target="I-D.ietf-pce-segment-routing-ipv6">Path Computation Element
      Communication Protocol (PCEP) Extension</xref> have been defined to
      propagate Segment Identifiers (SIDs) for the IPv6 data plane.</t>

      <t>This document defines eight new IPFIX Information Elements (IEs) and
      two new subregistries within the "IPFIX Information Elements" registry
      <xref target="RFC7012"/>, respectively for the new SRH dimensions and
      routing protocol and PCEP extensions.</t>
    </section>

    <section anchor="IE" title="IPFIX Information Elements">
      <t>This section defines and describes the new IPFIX IEs.<list
          style="hanging">
          <t hangText="ipv6SRHFlags"><vspace blankLines="0"/> 8-bit flags
          defined in the SRH.</t>

          <t hangText="ipv6SRHTag"><vspace blankLines="0"/> 16-bit tag field
          defined in the SRH that marks a packet as part of a class or group
          of packets sharing the same set of properties.</t>

          <t hangText="ipv6SRHSegment"><vspace blankLines="0"/> 128-bit IPv6
          address that represents an SRv6 segment.</t>

          <t hangText="ipv6SRHSegmentBasicList"><vspace blankLines="0"/>
          Ordered basicList <xref target="RFC6313"/> of zero or more 128-bit
          IPv6 addresses in the SRH that represents the SRv6 segment list. The
          Segment List is encoded starting from the active segment of the SR
          Policy.</t>

          <t hangText="ipv6SRHSegmentListSection"><vspace blankLines="0"/>
          Exposes the SRH Segment List as defined in section 2 of <xref
          target="RFC8754"/> as series of n octets.</t>

          <t hangText="ipv6SRHSegmentsLeft"><vspace blankLines="0"/> 8-bit
          unsigned integer defining the number of route segments remaining to
          reach the end of the segment list.</t>

          <t hangText="ipv6SRHSection"><vspace blankLines="0"/> Exposes the
          SRH and its TLV's as defined in section 2 of <xref
          target="RFC8754"/> as series of n octets.</t>

          <t hangText="ipv6SRHSegmentType"><vspace blankLines="0"/> Name of
          the routing protocol or PCEP extension from where the active SRv6
          segment has been learned from.</t>
        </list></t>
    </section>

    <section anchor="Use-Cases" title="Use Cases">
      <t>By using ipv6SRHSegmentBasicList(TBD4), ipv6SRHSegmentsLeft (TBD6),
      ipv6SRHSegmentType(TBD8) and forwardingStatus(89) it is possible to
      identify</t>

      <t><list style="symbols">
          <t>how many packets are forwarded or dropped</t>

          <t>if dropped, for which reasons,</t>

          <t>identify the control plane protocol which defined the active
          segment,</t>

          <t>the SRv6 segment list and</t>

          <t>how many SRv6 segments are left.</t>
        </list></t>
    </section>

    <section anchor="IANA" title="IANA Considerations">
      <t>This document requests IANA to create new IEs (see table1) and two
      new subregistries called "IPFIX IPv6 SRH Flags" (table 2) and "IPFIX
      IPv6 SRH Segment type" (table 3) under the "IPFIX Information Elements"
      registry <xref target="RFC7012"/> available at <xref
      target="IANA-IPFIX"/> and assign the following code initial points.</t>

      <t><figure>
          <artwork><![CDATA[

     +-------+---------------------------+
     |Element|        Name               |
     |   ID  |                           |
     +-------+---------------------------+
     | TBD1  | ipv6SRHFlags              |
     |       |                           |
     +-------+---------------------------+
     | TBD2  | ipv6SRHTag                |
     |       |                           |
     +-------+---------------------------+
     | TBD3  | ipv6SRHSegment            |
     |       |                           |
     +-------+---------------------------+
     | TBD4  | ipv6SRHSegmentBasicList   |
     |       |                           |
     +-------+---------------------------+
     | TBD5  | ipv6SRHSegmentListSection |
     |       |                           |
     +-------+---------------------------+
     | TBD6  | ipv6SRHSegmentsLeft       |
     |       |                           |
     +-------+---------------------------+
     | TBD7  | ipv6SRHSection            |
     +-------+---------------------------+
     | TBD8  | ipv6SRHSegmentType        |
     +-------+---------------------------+

  Table 1: Creates IEs in the "IPFIX Information Elements" registry
       ]]></artwork>
        </figure></t>

      <t>Note to the RFC-Editor:</t>

      <t><list style="symbols">
          <t>Please replace TBD1 - TBD12 with the values allocated by IANA</t>

          <t>Please replace the [RFC-to-be] with the RFC number assigned to
          this document</t>
        </list></t>

      <section anchor="IANAipv6SRHFlags" title="ipv6SRHFlags">
        <t>Name: ipv6SRHFlags <vspace blankLines="0"/> ElementID: TBD1 <vspace
        blankLines="0"/> Description: This Information Element identifies the
        8-bit flags defined in the SRH. Values for this Information Element
        are listed in the "IPFIX IPv6 SRH Flags" registry, see [IANA-IPFIX].
        Initial values in the registry are defined by the table below. New
        assignments of values will be administered by IANA and are subject to
        Expert Review <xref target="RFC8126"/>. Experts need to check
        definitions of new values for completeness, accuracy, and redundancy.
        <figure>
            <artwork><![CDATA[

+--------+-------------------+--------------------------------------+
| Value  |    Description    |              Reference               |
+--------+-------------------+--------------------------------------+
| 0-7    | Unassigned        |                                      |
+--------+-------------------+--------------------------------------+

      Table 2: "IPFIX IPv6 SRH Flags" registry

       ]]></artwork>
          </figure> <vspace blankLines="0"/> Abstract Data Type: unsigned8
        <vspace blankLines="0"/> Data Type Semantics: flags <vspace
        blankLines="0"/> Reference: [RFC-to-be], RFC8754</t>
      </section>

      <section anchor="IANAipv6SRHTag" title="ipv6SRHTag">
        <t>Name: ipv6SRHTag <vspace blankLines="0"/> ElementID: TBD2 <vspace
        blankLines="0"/> Description: This Information Element identifies the
        16-bit tag field defined in the SRH that marks a packet as part of a
        class or group of packets sharing the same set of properties. <vspace
        blankLines="0"/> Abstract Data Type: unsigned16 <vspace
        blankLines="0"/> Data Type Semantics: identifier <vspace
        blankLines="0"/> Reference: [RFC-to-be], RFC8754</t>
      </section>

      <section anchor="IANAipv6SRHSegment" title="ipv6SRHSegment">
        <t>Name: ipv6SRHSegment <vspace blankLines="0"/> ElementID: TBD3
        <vspace blankLines="0"/> Description: This Information Element
        identifies the 128-bit IPv6 address that represents an SRv6 segment.
        <vspace blankLines="0"/> Abstract Data Type: ipv6address <vspace
        blankLines="0"/> Data Type Semantics: default <vspace blankLines="0"/>
        Reference: [RFC-to-be], RFC8754</t>
      </section>

      <section anchor="IANAipv6SRHSegmentBasicList"
               title="ipv6SRHSegmentBasicList">
        <t>Name: ipv6SRHSegmentBasicList <vspace blankLines="0"/> ElementID:
        TBD4 <vspace blankLines="0"/> Description: This Information Element
        identifies the Ordered basicList [RFC6313] of zero or more 128-bit
        IPv6 addresses in the SRH that represents the SRv6 segment list. The
        Segment List is encoded starting from the active segment of the SR
        Policy. <vspace blankLines="0"/> Abstract Data Type: basicList <vspace
        blankLines="0"/> Data Type Semantics: list <vspace blankLines="0"/>
        Reference: [RFC-to-be], RFC8754</t>
      </section>

      <section anchor="IANAipv6SRHSegmentListSection"
               title="ipv6SRHSegmentListSection">
        <t>Name: ipv6SRHSegmentListSection <vspace blankLines="0"/> ElementID:
        TBD5 <vspace blankLines="0"/> Description: Exposes the SRH Segment
        List as defined in section 2 of <xref target="RFC8754"/> as series of
        n octets. <vspace blankLines="0"/> Abstract Data Type: octetArray
        <vspace blankLines="0"/> Data Type Semantics: default <vspace
        blankLines="0"/> Reference: [RFC-to-be], RFC8754</t>
      </section>

      <section anchor="IANAipv6SRHSegmentsLeft" title="ipv6SRHSegmentsLeft">
        <t>Name: ipv6SRHSegmentsLeft <vspace blankLines="0"/> ElementID: TBD6
        <vspace blankLines="0"/> Description: This Information Element
        identifies the 8-bit unsigned integer defining the number of route
        segments remaining to reach the end of the segment list. <vspace
        blankLines="0"/> Abstract Data Type: unsigned8 <vspace
        blankLines="0"/> Data Type Semantics: quantity <vspace
        blankLines="0"/> Reference: [RFC-to-be], RFC8754</t>
      </section>

      <section anchor="IANAipv6SRHSection" title="ipv6SRHSection">
        <t>Name: ipv6SRHSection <vspace blankLines="0"/> ElementID: TBD7
        <vspace blankLines="0"/> Description: This Information Element exposes
        the SRH and its TLV's as defined in s ection 2 of <xref
        target="RFC8754"/> as series of n octets. <vspace blankLines="0"/>
        Abstract Data Type: octetArray <vspace blankLines="0"/> Data Type
        Semantics: default <vspace blankLines="0"/> Reference: [RFC-to-be],
        RFC8754</t>
      </section>

      <section anchor="ipv6SRHSegmentType" title="ipv6SRHSegmentType">
        <t>Name: ipv6SRHSegmentType <vspace blankLines="0"/> ElementID: TBD8
        <vspace blankLines="0"/> Description: This Information Element
        identifies the name of the routing protocol or PCEP extension from
        where the active SRv6 segment has been learned from. Values for this
        Information Element are listed in the "IPFIX IPv6 SRH Segment type"
        registry, see [IANA-IPFIX]. Initial values in the registry are defined
        by the table below. New assignments of values will be administered by
        IANA and are subject to Expert Review <xref target="RFC8126"/>.
        Experts need to check definitions of new values for completeness,
        accuracy, and redundancy. <figure>
            <artwork><![CDATA[

+-------+--------------------+--------------------------------------+
| Value |     Description    |              Reference               |
+-------+--------------------+--------------------------------------+
| TBD9  | Unknown            | [RFC-to-be]                          |
|       |                    |                                      |
+-------+--------------------+--------------------------------------+
| TBD10 | Path Computation   | [RFC-to-be],                         |
|       | Element            | draft-ietf-pce-segment-routing-ipv6  |
+-------+--------------------+--------------------------------------+
| TB11  | OSPFv3             | [RFC-to-be],                         |
|       | Segment Routing    | draft-li-ospf-ospfv3-srv6-extensions |
+-------+--------------------+--------------------------------------+
| TBD12 | IS-IS              | [RFC-to-be]                          |
|       | Segment Routing    | draft-ietf-lsr-isis-srv6-extensions  |
+-------+--------------------+--------------------------------------+
| TBD13 | BGP Segment        | [RFC-to-be],                         |
|       | Routing Prefix-SID | draft-ietf-bess-srv6-services        |
+-------+--------------------+--------------------------------------+

  Table 3: "IPFIX IPv6 SRH Segment type" subregistry

       ]]></artwork>
          </figure> <vspace blankLines="0"/> Abstract Data Type: unsigned8
        <vspace blankLines="0"/> Data Type Semantics: identifier <vspace
        blankLines="0"/> Reference: [RFC-to-be]</t>
      </section>
    </section>

    <section anchor="Operational" title="Operational Considerations">
      <t>The zero or more 128-bit IPv6 addresses in the SRH [RFC8754] can be
      exported in two different ways, with two different IPFIX IEs:</t>

      <t><list style="symbols">
          <t>ipv6SRHSegmentBasicList</t>

          <t>ipv6SRHSegmentListSection</t>
        </list></t>

      <t>The ipv6SRHSegmentBasicList encodes the SID list of IPv6 addresses
      with a basicList, specified in the IPFIX Structured Data <xref
      target="RFC6313"/>. This encoding offers the advantage to the data
      collection that the different IPv6 addresses are already structured as a
      list, without the need of post processing. However, this method requires
      some extra processing on the exporter, to realize the BasicList data
      mapping.</t>

      <t>The ipv6SRHSegmentListSection, on the other hand, encodes the list of
      IPv6 addresses as an octetArray. This doesn't impose any data flow
      manipulation on the exporter, facilitating the immediate export.
      However, the data collection must be able to decode the IPv6 addresses
      according the SR specifications.</t>

      <t>It is not expected that an exporter would support both
      ipv6SRHSegmentBasicList and ipv6SRHSegmentListSection at the same
      time.</t>
    </section>

    <section anchor="Security" title="Security Considerations">
      <t>There exists no significant extra security considerations regarding
      the allocation of these new IPFIX IEs compared to <xref
      target="RFC7012"/>.</t>
    </section>

    <section anchor="Acknowledgements" title="Acknowledgements">
      <t>I would like to thank Pierre Francois, Yao Liu and Paolo Lucente for
      their review and valuable comments.</t>
    </section>
  </middle>

  <back>
    <references title="Normative References">
      <?rfc include='reference.RFC.7012'?>

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

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

    <references title="Informative References">
      <?rfc include='reference.RFC.8754'?>

      <?rfc include='reference.I-D.li-lsr-ospfv3-srv6-extensions'?>

      <?rfc include='reference.I-D.ietf-lsr-isis-srv6-extensions'?>

      <?rfc include='reference.I-D.ietf-bess-srv6-services'?>

      <?rfc include='reference.I-D.ietf-pce-segment-routing-ipv6'?>

      <reference anchor="IANA-IPFIX"
                 target="https://www.iana.org/assignments/ipfix/ipfix.xhtml">
        <front>
          <title>IANA, "IP Flow Information Export (IPFIX) Entities"</title>

          <author/>

          <date/>
        </front>
      </reference>
    </references>

    <section anchor="Encoding-Example" title="IPFIX Encoding Example">
      <t>In this section an example is provided to show the encoding format
      for the newly introduced IEs.</t>

      <t><figure>
          <artwork><![CDATA[

+-----+------+-----+--------+---------------------------------------|
| SRH | SRH  | SRH | Segment|             Segment List              |
| Nr  | Flags| Tag | Type   |                                       |
+-----+------+-----+--------+---------------------------------------+
| 1   | 0    | 123 | IS-IS  | 2001:db8::1, 2001:db8::2, 2001:db8::3 |
+-----+------+-----+--------+---------------------------------------+
| 2   | 0    | 456 | IS-IS  | 2001:db8::4, 2001:db8::5              |
+-----+------+-----+--------+---------------------------------------+
| 3   | 0    | 789 | IS-IS  | 2001:db8::6                           |
+-----+------+-----+--------+---------------------------------------+

     Table 4: 3 observed SRH headers and their routing protocol
       ]]></artwork>
        </figure></t>

      <section anchor="Template-Example" title="Template Record">
        <t><figure>
            <artwork><![CDATA[

    0                   1                   2                   3
    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |          SET ID = 2           |       Length = 41             |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |      Template ID = 256        |      Field Count = 4          |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |0|     ipv6SRHFlags = TBD1     |      Field Length = 1         |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |0|      ipv6SRHTag = TBD2      |      Field Length = 2         |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |0|  ipv6SRHSegmentType = TBD8  |      Field Length = 1         |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |0|    ipv6SRHSegment = TBD3    |      Field Length = 16        |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |0|ipv6SRHSegmentBasicList= TBD4|      Field Length = 0xFFFF    |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

               Table 4: Template Record Encoding Format

            ]]></artwork>
          </figure></t>

        <t>In this example, the Template ID is 256, which will be used in the
        Data Record. The field length for ipv6SRHSegmentBasicList is 0xFFFF,
        which means the length of this IE is variable, and the actual length
        of this IE is indicated by the List Length field in the basicList
        format as per <xref target="RFC6313"/>.</t>
      </section>

      <section anchor="Data-Set-Example" title="Data Set">
        <t>The data set is represented as follows:</t>

        <figure>
          <artwork><![CDATA[

    0                   1                   2                   3
    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |         SET ID = 256          |           Length = 136        |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   | ipv6SRHFlags  |        ipv6SRHTag = 123       | ipv6SRHSegment|
   | = 0           |                               | Type = TBD12  |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |      255      |        List Length = 53       |semantic=      |
   |               |                               |ordered        |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |     ipv6SRHSegment = TBD4     |        Field Length = 16      |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |             Segment List[0] = 2001:db8::1  (16 bytes)         |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |             Segment List[1] = 2001:db8::2  (16 bytes)         |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |             Segment List[2] = 2001:db8::3  (16 bytes)         |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   | ipv6SRHFlags  |        ipv6SRHTag = 456       | ipv6SRHSegment|
   | = 0           |                               | Type = TBD12  |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |      255      |        List Length = 37       |semantic=      |
   |               |                               |ordered        |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |     ipv6SRHSegment = TBD4     |        Field Length = 16      |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |             Segment List[0] = 2001:db8::4  (16 bytes)         |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |             Segment List[1] = 2001:db8::5  (16 bytes)         |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   | ipv6SRHFlags  |        ipv6SRHTag = 789       | ipv6SRHSegment|
   | = 0           |                               | Type = TBD12  |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |      255      |        List Length = 21       |semantic=      |
   |               |                               |ordered        |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |     ipv6SRHSegment = TBD4     |        Field Length = 16      |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |             Segment List[0] = 2001:db8::6  (16 bytes)         |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                  Table 5: Data Set Encoding Format

            ]]></artwork>
        </figure>
      </section>
    </section>
  </back>
</rfc>
