<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE rfc [
  <!ENTITY nbsp    "&#160;">
  <!ENTITY zwsp   "&#8203;">
  <!ENTITY nbhy   "&#8209;">
  <!ENTITY wj     "&#8288;">
]>
<?xml-stylesheet type="text/xsl" href="rfc2629.xslt" ?>
<!-- generated by https://github.com/cabo/kramdown-rfc version 1.7.39 (Ruby 3.2.3) -->
<rfc xmlns:xi="http://www.w3.org/2001/XInclude" ipr="trust200902" docName="draft-claise-opsawg-ipfix-ordered-ie-02" category="std" consensus="true" submissionType="IETF" updates="7011, 5476, 6183" tocInclude="true" sortRefs="true" symRefs="true" version="3">
  <!-- xml2rfc v2v3 conversion 3.34.0 -->
  <front>
    <title abbrev="IPFIX Ordered IE">Ordered Information Element Export in IP Flow Information Export (IPFIX)</title>
    <seriesInfo name="Internet-Draft" value="draft-claise-opsawg-ipfix-ordered-ie-02"/>
    <author fullname="Benoit Claise">
      <organization>Everything OPS &amp; Arrcus</organization>
      <address>
        <email>benoit@everything-ops.net</email>
      </address>
    </author>
    <author fullname="Paul Aitken">
      <organization>Ciena</organization>
      <address>
        <email>paitken@ciena.com</email>
      </address>
    </author>
    <author fullname="Holger Keller">
      <organization>Deutsche Telekom</organization>
      <address>
        <email>holger.keller@telekom.de</email>
      </address>
    </author>
    <author fullname="Yao Liu">
      <organization>ZTE Corporation</organization>
      <address>
        <email>liu.yao71@zte.com.cn</email>
      </address>
    </author>
    <author fullname="Paolo Lucente" initials="P." surname="Lucente">
      <organization>NTT</organization>
      <address>
        <postal>
          <street>Veemweg 23</street>
          <city>3771 MT Barneveld</city>
          <country>Netherlands</country>
        </postal>
        <email>paolo@ntt.net</email>
      </address>
    </author>
    <date year="2026" month="October" day="27"/>
    <area>Operations and Management</area>
    <workgroup>OPSAWG</workgroup>
    <keyword>IPFIX</keyword>
    <keyword>ordered</keyword>
    <keyword>encapsulation</keyword>
    <keyword>MPLS</keyword>
    <keyword>label stack</keyword>
    <keyword>tunneling</keyword>
    <abstract>
      <?line 83?>

<t>The IP Flow Information Export (IPFIX) protocol allows the same
Information Element to appear multiple times in a Template Record.
RFC 7011 states that multiple occurrences of the same Information
Element SHOULD follow the logical order of their treatments by the
Metering Process; however, no protocol mechanism exists for the
Exporting Process to explicitly signal to the Collecting Process that
this ordering is guaranteed.  Without such a guarantee, the Collecting
Process cannot safely interpret repeated Information Elements as ordered
observations.  This document describes the problem, presents use cases,
analyzes candidate solutions, and specifies a mechanism -- a new Ordered
Set type -- that establishes an end-to-end ordering guarantee: the
Metering Process records repeated Information Element values in the order
the corresponding observations are made, the Exporting Process preserves
and signals this guarantee, and the Collecting Process interprets the
n-th occurrence of an Information Element as corresponding to the n-th
observation by the Metering Process at the Observation Point.
This document updates RFC 7011, RFC 5476, and RFC 6183.</t>
    </abstract>
    <note removeInRFC="true">
      <name>About This Document</name>
      <t>
        Status information for this document may be found at <eref target="https://datatracker.ietf.org/doc/draft-claise-opsawg-ipfix-ordered-ie/"/>.
      </t>
    </note>
  </front>
  <middle>
    <?line 103?>

<section anchor="introduction">
      <name>Introduction</name>
      <t>The IPFIX protocol <xref target="RFC7011"/> ("Specification of the IP Flow
Information Export (IPFIX) Protocol for the Exchange of Flow
Information") exports Flow information from an Exporting Process to one
or more Collecting Processes.  An (Options) Template Record defines the structure of a Data Record by
specifying an ordered list of Information Elements.</t>
      <t>When the same Information Element appears more than once in a Template
Record, Section 8 of <xref target="RFC7011"/> states:</t>
      <ul empty="true">
        <li>
          <t>If an Information Element is required more than once in a Template,
the different occurrences of this Information Element SHOULD follow
the logical order of their treatments by the Metering Process.</t>
        </li>
      </ul>
      <t>The use of SHOULD rather than MUST means that an Exporting Process is
not required to guarantee this ordering.  Furthermore, Section 4.2 and
Section 4.3 of <xref target="RFC7011"/> each explicitly state:</t>
      <ul empty="true">
        <li>
          <t>the order of the Information Elements in the Template Records is not
guaranteed.</t>
        </li>
      </ul>
      <t>Nevertheless, the Metering Process SHOULD record repeated Information
Element values in the order in which the corresponding observations
are made, as this is the natural basis for any ordering guarantee.</t>
      <t>It is important to note that IPFIX is fundamentally an export protocol:
<xref target="RFC7011"/> defines the behavior of the Exporting Process and the
Collecting Process in detail, but places very few normative constraints
on the Metering Process.  The IPFIX architecture <xref target="RFC5470"/> ("Architecture for IP Flow
Information Export") explicitly scopes IPFIX as governing "the export of measured IP Flow information
from an IPFIX Exporting Process to a Collecting Process" and defines the
Metering Process as an internal component of the IPFIX Device -- alongside the Exporting Process, but not a protocol peer (see Figure 2
of <xref target="RFC5470"/>).  An end-to-end ordering guarantee requires that all
three components act consistently: the Metering Process records values
in the order in which they are observed at the Observation Point, the
Exporting Process preserves that order during export, and the Collecting
Process interprets the received ordering accordingly.</t>
      <t>There is consequently no IPFIX protocol mechanism by which the Exporting
Process can signal to the Collecting Process that the ordering of
repeated Information Elements is guaranteed to reflect the Metering
Process observation order -- even when the Metering Process correctly
records those observations in order.  Without such a signal, a
Collecting Process cannot safely interpret the n-th occurrence of an
Information Element as corresponding to the n-th observation made by
the Metering Process at the Observation Point.</t>
      <t>This limitation has several practical consequences, of which the
following are the most prominent:</t>
      <ol spacing="normal" type="1"><li>
          <t>Information Element Proliferation: position-specific Information
Elements accumulate in the IANA IPFIX registry to work around the
missing ordering guarantee (see <xref target="ie-proliferation"/>).</t>
        </li>
        <li>
          <t>Multi-Layer Encapsulation Ambiguity: without an ordering
guarantee, the Collecting Process cannot determine which encapsulation
layer a given Information Element occurrence corresponds to
(see <xref target="ml-ambiguity"/>).</t>
        </li>
      </ol>
      <t>The ordering problem also arises in the Packet Sampling (PSAMP)
protocol family <xref target="RFC5474"/> <xref target="RFC5475"/> <xref target="RFC5476"/>, which uses IPFIX
as its export protocol and relies on IPFIX IEs to describe packet
selection and observation metadata.  PSAMP defines a Composite Selector as an
ordered sequence of Primitive Selectors applied in succession to a
Packet Stream.  Section 6.5.1 of <xref target="RFC5476"/> already requires that
selectorId Information Elements in the Selection Sequence Report
Options Template MUST be listed in the order the corresponding
Primitive Selectors are applied -- making the ordering requirement
for Options Template Records older than this document.  However, this
requirement cannot be enforced at the IPFIX protocol level: the Options
Template Set (Set ID 3) of <xref target="RFC7011"/> provides no mechanism for the
Exporting Process to signal to the Collecting Process that the ordering
of repeated selectorId occurrences is guaranteed.  The Ordered Options
Template Set (Set ID 5) defined in this document closes this gap.</t>
      <t><xref target="RFC6313"/> ("Export of Structured Data in IP Flow Information Export
(IPFIX)") has sometimes been cited as a solution to this problem,
through the "ordered" semantic defined for its basicList and
subTemplateMultiList structured data types.  However, as analyzed in
detail in <xref target="rfc6313-analysis"/>, the <xref target="RFC6313"/> "ordered" semantic is an export
ordering guarantee only -- it does not assert that the order reflects the
Metering Process observation order at the Observation Point.
Furthermore, <xref target="RFC6313"/> structured data still falls under the SHOULD of
Section 8 of <xref target="RFC7011"/> and does not upgrade it to a MUST.
<xref target="RFC6313"/> therefore does not solve the problem described in this
document.</t>
      <t>This document specifies a mechanism to address these use cases by
providing an explicit ordering guarantee for repeated Information
Elements in an IPFIX (Options) Template Record.  The scope of this document is deliberately
limited to this specific problem.  Other potential IPFIX improvements are
explicitly out of scope.</t>
    </section>
    <section anchor="conventions-and-definitions">
      <name>Conventions and Definitions</name>
      <t>The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and
"OPTIONAL" in this document are to be interpreted as described in
BCP 14 <xref target="RFC2119"/> <xref target="RFC8174"/> when, and only when, they appear in all
capitals, as shown here.</t>
      <section anchor="terminology">
        <name>Terminology</name>
        <t>This document uses the IPFIX-specific terminology defined in <xref target="RFC7011"/>,
the PSAMP-specific terminology defined in <xref target="RFC5476"/>, and the IPFIX
Mediation terminology defined in <xref target="RFC6183"/> ("IP Flow
Information Export (IPFIX) Mediation: Framework").  As in <xref target="RFC7011"/>, the
first letter of each IPFIX-specific term is capitalized.</t>
        <t>The following terms are used as defined in <xref target="RFC7011"/>:</t>
        <dl>
          <dt>Collecting Process:</dt>
          <dd>
            <t>The process in a Collector that receives and processes IPFIX Messages.</t>
          </dd>
          <dt>Data Record:</dt>
          <dd>
            <t>A record that contains values of the parameters corresponding to a
Template Record.</t>
          </dd>
          <dt>Data Set:</dt>
          <dd>
            <t>A Set that contains one or more Data Records defined by the same
Template Record.</t>
          </dd>
          <dt>Exporting Process:</dt>
          <dd>
            <t>The process in an Exporter that sends IPFIX Messages to a Collecting
Process.</t>
          </dd>
          <dt>Flow Record:</dt>
          <dd>
            <t>A record that contains information about a specific Flow.</t>
          </dd>
          <dt>Information Element:</dt>
          <dd>
            <t>A protocol-independent description of an attribute that has been
observed or metered.</t>
          </dd>
          <dt>Metering Process:</dt>
          <dd>
            <t>The process that generates Flow Records from packet observations at
an Observation Point.</t>
          </dd>
          <dt>Observation Domain:</dt>
          <dd>
            <t>The largest set of Observation Points for which Flow information can
be aggregated by a Metering Process.</t>
          </dd>
          <dt>Observation Point:</dt>
          <dd>
            <t>A location in the network where IP packets can be observed.</t>
          </dd>
          <dt>Options Template Record:</dt>
          <dd>
            <t>A Template Record that defines the structure of an Options Data
Record.</t>
          </dd>
          <dt>Options Template Set:</dt>
          <dd>
            <t>A collection of one or more Options Template Records that have been
grouped together in an IPFIX Message.</t>
          </dd>
          <dt>Set:</dt>
          <dd>
            <t>A collection of records that have a similar structure, prefixed by
a header.</t>
          </dd>
          <dt>Template Record:</dt>
          <dd>
            <t>A record that defines the structure of a Data Record.</t>
          </dd>
          <dt>Template Set:</dt>
          <dd>
            <t>A collection of one or more Template Records that have been grouped
together in an IPFIX Message.</t>
          </dd>
          <dt>Transport Session:</dt>
          <dd>
            <t>In SCTP, the Transport Session is the SCTP association.  In TCP,
the Transport Session is the TCP connection.  In UDP, the Transport
Session is the UDP session, uniquely identified by the combination
of IP addresses and UDP ports used.</t>
          </dd>
        </dl>
        <t>Note: A Flow Record is a specific type of Data Record.  Options Data
Records, which carry metadata rather than Flow measurements, are also
Data Records but not Flow Records.</t>
        <t>The following term is modified from <xref target="RFC7011"/>:</t>
        <dl>
          <dt>Set ID:</dt>
          <dd>
            <t>A field in the Set header that identifies the Set type.  Value 2
identifies a Template Set, value 3 an Options Template Set, values
4 and 5 identify Ordered Template Sets and Ordered Options Template
Sets respectively as defined in this document, and values 256 and
above identify Data Sets.  Values 6-255 are reserved for future use.</t>
          </dd>
        </dl>
        <t>The following terms are used as defined in <xref target="RFC5476"/>:</t>
        <dl>
          <dt>Composite Selector:</dt>
          <dd>
            <t>An ordered composition of Selectors, in which the output Packet
Stream issuing from one Selector forms the input Packet Stream to
the succeeding Selector.</t>
          </dd>
          <dt>Primitive Selector:</dt>
          <dd>
            <t>A Selector that applies exactly one selection method and is the
elemental component of a Composite Selector.</t>
          </dd>
          <dt>Selection Sequence:</dt>
          <dd>
            <t>A specific combination of an Observation Point and a Composite
Selector, identified by a selectionSequenceId Information Element.</t>
          </dd>
        </dl>
        <t>The following term is used as defined in <xref target="RFC6183"/>:</t>
        <dl>
          <dt>IPFIX Mediator:</dt>
          <dd>
            <t>An IPFIX Device that receives IPFIX Messages from one or more
Exporting Processes or other IPFIX Mediators, optionally transforms
them through one or more Intermediate Processes, and forwards the
results to one or more Collecting Processes.</t>
          </dd>
        </dl>
        <t>The following new terms are defined in this document:</t>
        <dl>
          <dt>Ordered Template Set:</dt>
          <dd>
            <t>A Set with Set ID 4 that carries Ordered Template Records.  It uses
the same wire format as the Template Set (Set ID 2) defined in
<xref target="RFC7011"/>, with the addition that the ordering of repeated
Information Elements in the corresponding Data Records is guaranteed
to reflect the Metering Process observation order at the Observation
Point.</t>
          </dd>
          <dt>Ordered Options Template Set:</dt>
          <dd>
            <t>A Set with Set ID 5 that carries Ordered Options Template Records.
It uses the same wire format as the Options Template Set (Set ID 3)
defined in <xref target="RFC7011"/>, with the same ordering guarantee as an
Ordered Template Set.</t>
          </dd>
          <dt>Ordered Template Record:</dt>
          <dd>
            <t>A Template Record transmitted in an Ordered Template Set (Set ID 4).
The order of Information Elements in an Ordered Template Record is
significant: when the same Information Element appears more than once,
its occurrences MUST reflect the order in which the corresponding
values are observed by the Metering Process at the Observation Point.</t>
          </dd>
          <dt>Ordered Options Template Record:</dt>
          <dd>
            <t>An Options Template Record transmitted in an Ordered Options Template
Set (Set ID 5), with the same ordering guarantee as an Ordered
Template Record.</t>
          </dd>
          <dt>Ordered Data Set:</dt>
          <dd>
            <t>A Data Set whose Template ID refers to an Ordered Template Record or
an Ordered Options Template Record.  The ordering of fields in each
Data Record within the Set reflects the Metering Process observation
order.</t>
          </dd>
        </dl>
      </section>
    </section>
    <section anchor="problem-statement-use-cases">
      <name>Problem Statement &amp; Use Cases</name>
      <section anchor="the-ordering-ambiguity">
        <name>The Ordering Ambiguity</name>
        <t>The IPFIX protocol allows any Information Element to appear multiple
times in a Template Record.  Section 8 of <xref target="RFC7011"/> provides the
following guidance and example:</t>
        <ul empty="true">
          <li>
            <t>If an Information Element is required more than once in a Template,
the different occurrences of this Information Element SHOULD follow
the logical order of their treatments by the Metering Process.  [...]
For example, when exporting the two source IP addresses of an
IPv4-in-IPv4 packet, the first sourceIPv4Address Information Element
occurrence should be the IPv4 address of the outer header, while the
second occurrence should be the address of the inner header.</t>
          </li>
        </ul>
        <t>The use of SHOULD rather than MUST means that a conformant Exporting
Process is not required to respect this ordering.  Even when the
Exporting Process does follow the ordering by convention, there is no
protocol field by which it can communicate this intent to the Collecting
Process.</t>
        <t>Furthermore, the ordering of Information Elements may be affected by
optimizations within the Metering Process itself (for example, software
that processes packet headers from different encapsulation layers in
parallel rather than in strict observation order) or by optimizations
that intervene between the Metering Process and the Exporting Process.
Section 2.2 ("IPFIX Limitations") of <xref target="RFC6313"/> notes that "some
encoding optimizations are based on the permutation of Information
Element order", which conflicts with any strict ordering requirement
applied universally to all existing IPFIX Sets.</t>
      </section>
      <section anchor="ie-proliferation">
        <name>Information Element Proliferation</name>
        <t>The absence of an ordering guarantee has led implementors to define
position-specific Information Elements, effectively polluting the IANA
IPFIX registry <xref target="IANA.IPFIX"/> with entries that exist solely to work
around the lack of an ordering mechanism.  The MPLS label stack is the
most prominent example.  Rather than using a single
label stack entry Information Element appearing multiple times in
ordered fashion (such as the one defined in
<xref target="I-D.claise-opsawg-ipfix-ordered-mpls-ie"/>), the IPFIX Information Elements registry <xref target="IANA.IPFIX"/> defines
ten separate Information Elements:</t>
        <ul spacing="normal">
          <li>
            <t>mplsTopLabelStackSection (IPFIX IE 70)</t>
          </li>
          <li>
            <t>mplsLabelStackSection2 (IPFIX IE 71)</t>
          </li>
          <li>
            <t>mplsLabelStackSection3 (IPFIX IE 72)</t>
          </li>
          <li>
            <t>mplsLabelStackSection4 (IPFIX IE 73)</t>
          </li>
          <li>
            <t>mplsLabelStackSection5 (IPFIX IE 74)</t>
          </li>
          <li>
            <t>mplsLabelStackSection6 (IPFIX IE 75)</t>
          </li>
          <li>
            <t>mplsLabelStackSection7 (IPFIX IE 76)</t>
          </li>
          <li>
            <t>mplsLabelStackSection8 (IPFIX IE 77)</t>
          </li>
          <li>
            <t>mplsLabelStackSection9 (IPFIX IE 78)</t>
          </li>
          <li>
            <t>mplsLabelStackSection10 (IPFIX IE 79)</t>
          </li>
        </ul>
        <t>This approach has some drawbacks:</t>
        <ul spacing="normal">
          <li>
            <t>It consumes ten Information Element identifiers where one could suffice.</t>
          </li>
          <li>
            <t>It artificially limits the exportable label stack depth to ten entries.</t>
          </li>
          <li>
            <t>It cannot be generalized to other stacked or layered structures without
defining further sets of numbered Information Elements.</t>
          </li>
        </ul>
        <t>The same pattern extends beyond the label stack entries.  A cluster of
Information Elements exists for attributes of the top-of-stack label
only: mplsTopLabelType (IPFIX IE 46), mplsTopLabelIPv4Address (IPFIX IE 47),
mplsTopLabelPrefixLength (IPFIX IE 91), mplsTopLabelIPv6Address (IPFIX IE 140),
mplsTopLabelTTL (IPFIX IE 200), mplsTopLabelExp (IPFIX IE 203), and
postMplsTopLabelExp (IPFIX IE 237).  These exist because no general mechanism
allows expressing "the attribute of the label at stack position N."
With ordered export, a single repeated Information Element per attribute
would suffice.</t>
        <t>A Metering Process observing MPLS traffic may observe a label stack of
arbitrary depth.  An operator may wish to export the entire label stack
as a sequence of MPLS label stack entries, where the first occurrence
corresponds to the top of the stack, the second to the next label, and so
on.</t>
        <t>With the mechanism specified in this document, the Exporting Process can
use a single label stack entry Information Element (see
<xref target="I-D.claise-opsawg-ipfix-ordered-mpls-ie"/>) repeated N times
in an Ordered Template Record and signal that the sequence reflects the
top-to-bottom order of the label stack as observed by the Metering
Process.  This eliminates the need for the ten numbered label-stack
Information Elements.  Since N is chosen by the Exporting Process when
it defines the Template, label stacks of depth greater than ten can be
exported in full.  This lifts the artificial cap inherent in the
positional naming scheme.  N is however fixed for a given Template:
exporting label stacks of different depths requires a Template for each
depth.  <xref target="new-ordered-list-type"/> evaluates a list data type
that avoids this.</t>
      </section>
      <section anchor="ordering-ambiguity-in-psamp-options-template-records">
        <name>Ordering Ambiguity in PSAMP Options Template Records</name>
        <t>The ordering requirement extends beyond Template Records: it also applies
to Options Template Records used by the Packet Sampling (PSAMP) protocol
<xref target="RFC5474"/> ("A Framework for Packet Selection and Reporting")
<xref target="RFC5475"/> ("Sampling and Filtering Techniques for IP Packet
Selection") <xref target="RFC5476"/> ("Packet Sampling (PSAMP) Protocol
Specifications").  This is the primary use case for
the Ordered Options Template Set (Set ID 5) specified in this document.</t>
        <t>PSAMP defines a Composite Selector as "an ordered composition of
Selectors, in which the output Packet Stream issuing from one Selector
forms the input Packet Stream to the succeeding Selector"
(<xref target="RFC5476"/>).  The word "ordered"
in the definition is architecturally significant: a Composite Selector
is a sequence, not a set.</t>
        <t>The ordering matters semantically.  Section 8.1 of <xref target="RFC5475"/> demonstrates
that filtering followed by sampling and sampling followed by filtering
produce different statistical results:</t>
        <ul spacing="normal">
          <li>
            <t>Filter then Sample: the filter creates population subsets with
potentially different intensities, allowing the sampling rate to be
tuned per subset.  Packets not matching the filter never load the
Sampling function.</t>
          </li>
          <li>
            <t>Sample then Filter: the same sampling rate is applied to the
entire stream before filtering; packets ultimately discarded by the
filter still consume sampling capacity.</t>
          </li>
        </ul>
        <t>A Composite Selector is exported using the Selection Sequence Report
Options Template defined in Section 6.5.1 of <xref target="RFC5476"/>.  When the
Selection Sequence consists of multiple Primitive Selectors, the
selectorId Information Element appears once per Primitive Selector in
the same Options Template Record.  Section 6.5.1 of <xref target="RFC5476"/> is
explicit:</t>
        <ul empty="true">
          <li>
            <t>"the selectorId's MUST be identified in the order they are used."</t>
          </li>
        </ul>
        <t>Section 6.5.1 of <xref target="RFC5476"/> illustrates this with a concrete example:
Selection Sequence 7 (Filter selectorId 5, then Sampler selectorId 10)
and Selection Sequence 9 (Sampler selectorId 10, then Filter selectorId
5) are distinct, produce different results, and are differentiated
solely by the order of the two selectorId occurrences in the Options
Template Record.</t>
        <t>RFC 5476 therefore already requires ordered Options Template Records,
and a PSAMP-aware Collecting Process can infer this guarantee from
receipt of the Selection Sequence Report Options Template.  However,
IPFIX-layer components that do not implement PSAMP -- forwarders,
middleboxes, or generic analysis tools -- have no means to apply that
constraint.  The Ordered Options Template Set (Set ID 5) specified in
this document expresses the ordering guarantee at the IPFIX protocol
level, making it visible to any IPFIX component regardless of PSAMP
awareness.</t>
      </section>
      <section anchor="ml-ambiguity">
        <name>Multi-Layer Encapsulated Traffic</name>
        <t>Modern networks increasingly carry traffic with multiple encapsulation
layers.  SRv6 deployments, in particular, may result in packets with two
or three nested IPv6 headers, each with its own source and destination
addresses.  When an Exporting Process exports fields from such packets,
repeating Information Elements such as sourceIPv6Address and
destinationIPv6Address, the Collecting Process has no way to determine
which occurrence corresponds to which encapsulation layer unless an
ordering guarantee is explicitly provided.</t>
        <t>This problem is described in <xref target="I-D.liu-opsawg-ipfix-muti-layer"/>, which
proposes several mechanisms to address the specific case of encapsulation
layer identification.  That draft brings renewed attention to an ordering
ambiguity that has been present in IPFIX since <xref target="RFC7011"/> was first
published.  The present document addresses the underlying,
more general problem of ordered Information Element export, of which
multi-layer encapsulation is one important use case.</t>
        <t>When a packet carries multiple IP encapsulation layers -- for example, an
SRv6 packet where a Provider Edge adds an outer IPv6 header encapsulating
an inner IPv6 packet from the customer -- an Exporting Process may wish to
export fields from multiple layers.</t>
        <t>With the mechanism specified in this document, the Exporting Process can
include destinationIPv6Address twice in an Ordered Template Record and
signal that the first occurrence corresponds to the outermost
encapsulation layer and the second to the innermost, reflecting the order
observed by the Metering Process.</t>
        <t>This use case covers IPv4-in-IPv4, IPv4-in-IPv6, IPv6-in-IPv6, and any
other IP-in-IP encapsulation scenario, as well as SRv6 traffic with
nested Segment Routing Headers as described in <xref target="RFC9487"/> ("Export
of Segment Routing over IPv6 Information in IP Flow Information
Export (IPFIX)").  Further
examples include:</t>
        <ul spacing="normal">
          <li>
            <t>MAC-in-MAC (IEEE 802.1ah Provider Backbone Bridging): both
sourceMacAddress and destinationMacAddress repeat -- once for the
outer backbone MAC (B-MAC) and once for the inner customer MAC
(C-MAC).</t>
          </li>
          <li>
            <t>VXLAN <xref target="RFC7348"/> ("Virtual eXtensible Local Area Network (VXLAN):
A Framework for Overlaying Virtualized Layer 2 Networks over Layer 3
Networks") and GENEVE <xref target="RFC8926"/> ("Geneve: Generic Network
Virtualization Encapsulation"): outer IP transport
addresses (UDP/IP encapsulation) and inner tenant IP addresses both
map to Information Elements such as sourceIPv4Address and
destinationIPv4Address; without an ordering guarantee the Collecting
Process cannot distinguish transport layer from tenant layer.</t>
          </li>
          <li>
            <t>GRE: outer and inner IP header fields repeat for the same
Information Elements, with the same ambiguity.</t>
          </li>
        </ul>
        <t>Without the mechanism specified in this document, unambiguous export of
these layered fields would require defining new position-specific
Information Elements, perpetuating the same registry proliferation
already seen with MPLS.</t>
        <t>The mechanism specified in this document addresses the common case
where all encapsulation layers are exported consecutively, with the
n-th occurrence of an Information Element corresponding to the n-th
layer.  The explicit layer-marking approach of
<xref target="I-D.liu-opsawg-ipfix-muti-layer"/> is complementary and better
suited to sparse export of layers and to Collecting Processes that do
not support Ordered Sets.</t>
      </section>
    </section>
    <section anchor="solution">
      <name>New Ordered Set Specifications</name>
      <t>The solution is the New Ordered Set Type: the definition of
two new Ordered Set types, Ordered Template Set (Set ID 4) and Ordered
Options Template Set (Set ID 5).</t>
      <t>The rationale is as follows:</t>
      <ol spacing="normal" type="1"><li>
          <t>Explicit protocol semantics: A dedicated Set type provides an
unambiguous, per-Set signal that ordering is guaranteed.  The Collecting
Process requires no additional correlation or inference to determine
whether a given Template is ordered.</t>
        </li>
        <li>
          <t>Clean protocol design: Ordered data is a distinct semantic concept
that warrants a first-class protocol signal.  A new Set type is the
natural extension point within the IPFIX message format, consistent
with the principle that Set IDs 4 through 255 are reserved in
<xref target="RFC7011"/> for exactly this purpose.</t>
        </li>
        <li>
          <t>Backwards compatibility: The existing Set IDs 2, 3, and 256 to
65535 are unaffected.  Exporting Processes that do not require ordered
export continue to use the existing Set IDs without modification.</t>
        </li>
      </ol>
      <t>Analysis of alternative approaches is provided in <xref target="solution-space"/>.</t>
      <section anchor="wire-format">
        <name>Wire Format</name>
        <t>The Ordered Template Set (Set ID 4) uses exactly the same wire format
as the Template Set (Set ID 2) defined in Section 3.4.1 of <xref target="RFC7011"/>.
The Ordered Options Template Set (Set ID 5) uses exactly the same wire
format as the Options Template Set (Set ID 3) defined in Section 3.4.2
of <xref target="RFC7011"/>.  The Set ID value is the sole distinguishing element:
it signals to the Collecting Process that the ordering of repeated
Information Elements in corresponding Data Records is guaranteed.</t>
        <t>No new header fields, flags, or record structures are introduced.
Implementations that already support Set ID 2 and Set ID 3 can support
Set ID 4 and Set ID 5 by reusing the same parsing code and adding the
ordering semantic to the Template Records so identified.</t>
      </section>
      <section anchor="template-withdrawal">
        <name>Template Withdrawal</name>
        <t>The Template Withdrawal mechanism defined in Section 8.1 of <xref target="RFC7011"/>
applies to Ordered Template Records and Ordered Options Template
Records, with the update to the Set ID of a Template Withdrawal
specified in <xref target="updates-rfc7011"/>.</t>
        <t>An Ordered Template Record is withdrawn by sending an Ordered Template
Set (Set ID 4) containing a Template Record with the target Template ID
and a Field Count of 0.  An Ordered Options Template Record is withdrawn
by sending an Ordered Options Template Set (Set ID 5) with a Field Count
of 0.  A Template Withdrawal whose Set ID does not correspond to the Set
ID in which the Template Record was received is ignored by the Collecting
Process, which SHOULD log the error, as specified in Section 8.1 of
<xref target="RFC7011"/> for a Template Withdrawal of a Template that is
not presently stored.  This does not apply to the All Templates
Withdrawal and the All Options Templates Withdrawal of Section 8.1 of
<xref target="RFC7011"/>, which also withdraw the Ordered Template Records
and the Ordered Options Template Records of the Observation Domain,
respectively.</t>
        <t>Upon receipt of a Template Withdrawal, the Collecting Process MUST cease treating
Data Sets referencing the withdrawn Template ID as Ordered Data Sets and
MUST discard all stored information about that Template Record.  This
applies to the IPFIX transport state only; it does not retroactively
alter the ordering interpretation of Data Records already received and
decoded under that Template ID.</t>
        <t>A withdrawn Ordered Template ID MAY be reused by the Exporting Process
within the same Transport Session and Observation Domain, consistent
with Section 8.1 of <xref target="RFC7011"/>.  If the Template ID is subsequently
registered via an unordered Template Set (Set ID 2), the Collecting
Process MUST treat it as unordered.  If registered again via an Ordered
Template Set (Set ID 4), the ordering guarantee applies anew.  The same
applies for Options Template Records (Set IDs 3 and 5).</t>
        <t>Over UDP, Section 8.4 of <xref target="RFC7011"/> applies unchanged:
Template Withdrawals are not used, and a Template ID is reused after the
waiting period of that section.  Whether the reused Template is ordered
is determined by the Set ID of the Template Record sent for that
Template ID.</t>
        <t>For the purpose of Section 8.1 of <xref target="RFC7011"/>, the Set type in which
a Template Record is received is part of the Template definition.  A
Template Record received for an already-allocated Template ID in a Set of
a different Set type (for example, in Set ID 4 for a Template ID
previously received in Set ID 2) is therefore different from the
already-received Template, and is handled as specified in that section.
Over SCTP and TCP, changing a Template from unordered to ordered, or from
ordered to unordered, therefore requires withdrawing it first and then
sending the new Template Record.</t>
      </section>
      <section anchor="normative-behavior">
        <name>Normative Behavior</name>
        <t>The Exporting Process MUST preserve the Metering Process observation
order when constructing Data Records for an Ordered Data Set.  The
observation order is from outermost to innermost for encapsulated
traffic and from top to bottom for label stacks, as specified in
<xref target="updates-rfc7011"/>.</t>
        <t>A Collecting Process identifies an Ordered Data Set by tracking the Set
ID under which the corresponding Template Record was received.  If the
Template was received in an Ordered Template Set (Set ID 4) or an
Ordered Options Template Set (Set ID 5), all subsequent Data Sets
referencing that Template ID MUST be treated as Ordered Data Sets.  If
the Template was received in a Template Set (Set ID 2) or an Options
Template Set (Set ID 3), the ordering of repeated Information Elements
in the corresponding Data Records is not guaranteed.</t>
        <t>Section 3.4.1 of <xref target="RFC7011"/> requires Template IDs to be unique within
an Observation Domain and Transport Session.  A given Template ID can
therefore appear in only one Set type -- it cannot be registered as both
an Ordered Template Set (Set ID 4) and a Template Set (Set ID 2), nor as
both an Ordered Options Template Set (Set ID 5) and an Options Template
Set (Set ID 3).  There is consequently no ambiguity in the
Collecting Process's per-Template-ID tracking of the ordering guarantee.
The ordering guarantee is part of the state kept for a Template and is
scoped like the Template, per Transport Session and Observation Domain.</t>
        <t>The Collecting Process MUST interpret the n-th occurrence of an
Information Element in a Data Record from an Ordered Data Set as
corresponding to the n-th observation of that Information Element
by the Metering Process at the Observation Point.</t>
        <t>This ordering guarantee applies independently to each Information
Element: the n-th occurrence of IE X corresponds to the n-th
observation of IE X, and the n-th occurrence of IE Y corresponds to
the n-th observation of IE Y.  The guarantee does not impose any
relative ordering between occurrences of different Information
Elements.</t>
        <t>This guarantee covers the ordering of exported occurrences only.  The
Exporting Process is expected to export all observations consecutively;
where only a sparse subset of layers is exported, the Collecting Process
cannot determine whether exported occurrences are contiguous from the
first observation.  For sparse export scenarios, the explicit
layer-marking approach of <xref target="I-D.liu-opsawg-ipfix-muti-layer"/> is more
appropriate.</t>
        <t>The behavior of IPFIX Mediators <xref target="RFC6183"/> <xref target="RFC7014"/> ("Flow
Selection Techniques") that receive Ordered Template Sets or Ordered
Options Template Sets is specified in <xref target="updates-to-rfc-6183"/>.</t>
      </section>
      <section anchor="updates-rfc7011">
        <name>Updates to RFC 7011</name>
        <t>The following <xref target="RFC7011"/> updates are required.</t>
        <t>The following text in Section 8 of <xref target="RFC7011"/>:</t>
        <t>OLD:</t>
        <ul empty="true">
          <li>
            <t>If an Information Element is required more than once in a Template,
the different occurrences of this Information Element SHOULD follow
the logical order of their treatments by the Metering Process.  For
example, if a selected packet goes through two hash functions, and if
the two hash values are sent within a single Template, the first
occurrence of the hash value should belong to the first hash function
in the Metering Process.  For example, when exporting the two source
IP addresses of an IPv4-in-IPv4 packet, the first sourceIPv4Address
Information Element occurrence should be the IPv4 address of the
outer header, while the second occurrence should be the address of
the inner header.  Collecting Processes MUST properly handle
Templates with multiple identical Information Elements.</t>
          </li>
        </ul>
        <t>NEW:</t>
        <ul empty="true">
          <li>
            <t>If an Information Element is required more than once in a Template
transmitted in a Template Set (Set ID 2) or Options Template Set
(Set ID 3), the different occurrences of this Information Element
SHOULD follow the logical order of their treatments by the Metering
Process.  For example, if a selected packet goes through two hash
functions, and if
the two hash values are sent within a single Template, the first
occurrence of the hash value should belong to the first hash function
in the Metering Process.  For example, when exporting the two source
IP addresses of an IPv4-in-IPv4 packet, the first sourceIPv4Address
Information Element occurrence should be the IPv4 address of the
outer header, while the second occurrence should be the address of
the inner header.  Collecting Processes MUST properly handle
Templates with multiple identical Information Elements.</t>
            <t>If the Template Record is transmitted in an Ordered Template Set (Set ID 4)
or an Ordered Options Template Set (Set ID 5), the Metering Process
MUST record the repeated Information Element values in the order in
which the corresponding observations are made at the Observation
Point, the Exporting Process MUST preserve and follow this order when
constructing the corresponding Data Records, and the Collecting
Process MUST interpret the n-th occurrence as corresponding to the
n-th observation by the Metering Process at the Observation Point.
The Metering Process MUST record observations from outermost to
innermost for encapsulated traffic and from top to bottom for
label stacks.</t>
          </li>
        </ul>
        <t>The following sentence in Section 4.2 of <xref target="RFC7011"/>:</t>
        <t>OLD:</t>
        <ul empty="true">
          <li>
            <t>Since the Metering Process Reliability Statistics Options Template
contains two identical timestamp Information Elements, and since the
order of the Information Elements in the Template Records is not
guaranteed, the Collecting Process interprets the time interval of
ignored packets as the range between the two values; see Section 5.2
for wraparound considerations.</t>
          </li>
        </ul>
        <t>NEW:</t>
        <ul empty="true">
          <li>
            <t>Since the Metering Process Reliability Statistics Options Template
contains two identical timestamp Information Elements, and since the
order of the Information Elements in Options Template Records
transmitted in Sets with Set ID 3 is not guaranteed, whereas the
order in Options Template Records transmitted in Sets with Set ID 5
is guaranteed to reflect the Metering Process observation order, the
Collecting Process interprets the time interval of ignored packets as
the range between the two values; see Section 5.2 for wraparound
considerations.</t>
          </li>
        </ul>
        <t>The following sentence in Section 4.3 of <xref target="RFC7011"/>:</t>
        <t>OLD:</t>
        <ul empty="true">
          <li>
            <t>Since the Exporting Process Reliability Statistics Options Template
contains two identical timestamp Information Elements, and since the
order of the Information Elements in the Template Records is not
guaranteed, the Collecting Process interprets the time interval of
dropped packets as the range between the two values; see Section 5.2
for wraparound considerations.</t>
          </li>
        </ul>
        <t>NEW:</t>
        <ul empty="true">
          <li>
            <t>Since the Exporting Process Reliability Statistics Options Template
contains two identical timestamp Information Elements, and since the
order of the Information Elements in Options Template Records
transmitted in Sets with Set ID 3 is not guaranteed, whereas the
order in Options Template Records transmitted in Sets with Set ID 5
is guaranteed to reflect the Metering Process observation order, the
Collecting Process interprets the time interval of dropped packets as
the range between the two values; see Section 5.2 for wraparound
considerations.</t>
          </li>
        </ul>
        <t>The following sentence in Section 3.3.2 of <xref target="RFC7011"/>:</t>
        <t>OLD:</t>
        <ul empty="true">
          <li>
            <t>Values from 4 to 255 are reserved for future use.</t>
          </li>
        </ul>
        <t>NEW:</t>
        <ul empty="true">
          <li>
            <t>Values 4 and 5 are used for Ordered Template Sets and Ordered Options
Template Sets, respectively, as specified in this document.  Values from
6 to 255 are reserved for future use.</t>
          </li>
        </ul>
        <t>The following normative text is added to Section 3.3.2 of <xref target="RFC7011"/>,
after the sentence "The Length value MUST be used to determine the
position of the next Set.":</t>
        <t>NEW:</t>
        <ul empty="true">
          <li>
            <t>A Collecting Process that receives a Set with an unknown Set ID SHOULD
log a warning to assist operators in detecting configuration or
capability mismatches between Exporting and Collecting Processes.</t>
          </li>
        </ul>
        <t>The following sentence in Section 8.1 of <xref target="RFC7011"/>:</t>
        <t>OLD:</t>
        <ul empty="true">
          <li>
            <t>The Set ID field MUST contain the value 2 for Template Set Withdrawal
or the value 3 for Options Template Set Withdrawal.</t>
          </li>
        </ul>
        <t>NEW:</t>
        <ul empty="true">
          <li>
            <t>The Set ID field MUST contain the value 2 for Template Set Withdrawal,
the value 3 for Options Template Set Withdrawal, the value 4 for Ordered
Template Set Withdrawal, or the value 5 for Ordered Options Template Set
Withdrawal, that is, the Set ID of the Set in which the Template Record was
received.</t>
          </li>
        </ul>
      </section>
      <section anchor="updates-to-rfc-5476">
        <name>Updates to RFC 5476</name>
        <!-- [NOTE TO RFC EDITOR: Please replace all instances of "[this document]" in this section with the RFC number assigned to this document.] -->
        <t>Section 6.5.1 of <xref target="RFC5476"/> already mandates that selectorId occurrences
in a Selection Sequence Report Interpretation Options Template Record
MUST be listed in the order the corresponding Primitive Selectors are
applied.  However, <xref target="RFC5476"/> predates the Ordered Options Template Set
mechanism defined in this document, and therefore uses the regular
Options Template Set (Set ID 3), which provides no protocol-level signal
to the Collecting Process that the ordering is guaranteed.</t>
        <t>The following sentence in Section 6.5.1 of <xref target="RFC5476"/>:</t>
        <t>OLD:</t>
        <ul empty="true">
          <li>
            <t>If multiple Selectors are contained in the Selection Sequence Report
Interpretation, the selectorId's MUST be identified in the order they
are used.</t>
          </li>
        </ul>
        <t>NEW:</t>
        <ul empty="true">
          <li>
            <t>If multiple Selectors are contained in the Selection Sequence Report
Interpretation, the selectorId's MUST be identified in the order they
are used.  The corresponding Options Template Record MUST be
transmitted in an Ordered Options Template Set (Set ID 5) as defined
in [this document], so that the Collecting Process receives an explicit
signal that the ordering of selectorId occurrences reflects the
Composite Selector application order.</t>
          </li>
        </ul>
      </section>
      <section anchor="updates-to-rfc-6183">
        <name>Updates to RFC 6183</name>
        <t><xref target="RFC6183"/> defines the behavior of IPFIX Mediators but predates the
Ordered Template Set mechanism defined in this document.  This document
adds the following normative requirement to Mediator behavior:</t>
        <t>An IPFIX Mediator that receives Ordered Template Sets (Set ID 4) or
Ordered Options Template Sets (Set ID 5) MUST preserve the ordering
guarantee when forwarding.  The Mediator MUST forward the corresponding
Template Records in Ordered Template Sets or Ordered Options Template
Sets, and MUST preserve the observation order of fields in the
corresponding Data Records.  An IPFIX Mediator that cannot
preserve the ordering guarantee MUST NOT forward the corresponding
Template Records in Ordered Template Sets or Ordered Options Template
Sets.  Such an IPFIX Mediator MAY forward them in Template Sets (Set ID 2)
or Options Template Sets (Set ID 3), in which case no ordering guarantee
is signaled to the Collecting Process, or it MAY discard them and the
corresponding Data Sets.</t>
        <t>An IPFIX Mediator preserves the ordering guarantee when, for every
Ordered Data Record it exports, the n-th occurrence of an Information
Element still corresponds to the n-th observation of that Information
Element by the Metering Process that produced the original Data Record.
A Mediator can therefore remove an Information Element entirely, remove
trailing occurrences of it, or add Information Elements that are not
repeated.  Removing a leading or intermediate occurrence, or reordering
occurrences, does not preserve the guarantee.  A Mediator that aggregates
Data Records preserves the guarantee only if the aggregated Data Records
have identical values for all occurrences of the repeated Information
Elements.</t>
      </section>
      <section anchor="new-ipfix-information-elements">
        <name>Information Elements for Other Layers</name>
        <t>This document defines no new IPFIX Information Elements.  The generic
Information Elements for the MPLS label stack and its attributes are
defined in <xref target="I-D.claise-opsawg-ipfix-ordered-mpls-ie"/>.  For other
protocol layers, no new IPFIX IEs are required:
sourceMacAddress (IPFIX IE 56) and
destinationMacAddress (IPFIX IE 80) already serve MAC-in-MAC; and IP-level
IPFIX IEs (sourceIPv4Address, destinationIPv4Address, and their IPv6
equivalents) already serve VXLAN, GENEVE, GRE, and IP-in-IP encapsulation.
In each of these cases, the existing IPFIX IEs can simply be repeated in
an Ordered Template Record.</t>
        <t>The use of repeated Information Elements in Ordered Template Records does
not immediately obsolete the existing positional IPFIX IEs.  Implementations
that do not support ordered export (Set IDs 4 and 5) continue to require the
positional IPFIX IEs.  Once ordered export is widely deployed, the positional
MPLS IPFIX IEs (see <xref target="I-D.claise-opsawg-ipfix-ordered-mpls-ie"/>) may be
deprecated in a future document.</t>
      </section>
    </section>
    <section anchor="operational-considerations">
      <name>Operational Considerations</name>
      <t>This section follows the guidelines of <xref target="I-D.opsarea-rfc5706bis"/>
("Guidelines for Considering Operations and Management of New Protocols
and Protocol Extensions") for documenting operational and management
considerations in IETF specifications.  This document is a protocol extension to <xref target="RFC7011"/>;
operational and management considerations that are not specific to
ordered export are inherited from <xref target="RFC7011"/> and are not repeated here.</t>
      <section anchor="deployment-and-coexistence">
        <name>Deployment and Coexistence</name>
        <t>Ordered export is additive, with one exception.  Existing Set IDs 2
and 3 are unaffected, and Exporting Processes continue to operate
without modification, except that an Exporting Process implementing
this document is required to use an Ordered Options Template Set (Set
ID 5) for a PSAMP <xref target="RFC5476"/> Selection Sequence Report
Interpretation Options Template Record that contains multiple selectorId
occurrences (see <xref target="updates-to-rfc-5476"/>).  The order of the
selectorId occurrences is the order in which the Selectors are applied,
and only Set ID 5 signals that order to the Collecting Process.  For all
other Template Records,
deployment can proceed incrementally: ordered export can be enabled on a per-Template basis toward specific
Collecting Processes, without disrupting any existing IPFIX
infrastructure.  Operators upgrading PSAMP Exporting Processes SHOULD
first ensure that the Collecting Processes receiving the Selection
Sequence Report Interpretation support Set ID 5; otherwise the
Selection Sequence information may be silently discarded (see
<xref target="fault-management"/>).</t>
        <t>Operators SHOULD enable ordered export only toward Collecting Processes
that are known to support Set ID 4 and Set ID 5.  Deployment against
unaware Collecting Processes may result in silent loss of entire Ordered
Sets, as discussed in <xref target="fault-management"/>.</t>
      </section>
      <section anchor="configuration">
        <name>Configuration</name>
        <t>Except for the Selection Sequence Report Interpretation Options
Template Record described in <xref target="updates-to-rfc-5476"/>, an Exporting Process is
configured to use an Ordered Template Set (Set ID 4) or an Ordered
Options Template Set (Set ID 5) for specific Template Records.  No
protocol-level negotiation is currently defined.  Operators are responsible for
ensuring that the Collecting Process is capable of processing the
selected Set IDs before enabling ordered export.</t>
        <t>Ordered export may allow simplification of the Information Element
registry: where a deployment previously required multiple
position-specific Information Elements (e.g., mplsTopLabelStackSection
through mplsLabelStackSection10), a single repeated Information Element
in an Ordered Template Record may suffice.  This can reduce the number
of Information Element identifiers consumed in the IPFIX Information
Elements registry <xref target="IANA.IPFIX"/>.  It does not reduce the
size of Template Records, because each occurrence of an Information
Element has its own Field Specifier.</t>
      </section>
      <section anchor="verification-of-correct-operation">
        <name>Verification of Correct Operation</name>
        <t>End-to-end verification of ordered export requires confirming correct
behavior across all three components of the ordering chain:</t>
        <ul spacing="normal">
          <li>
            <t>Metering Process: records repeated Information Element values in
the order they are observed.  This is internal to the implementation
and is not directly observable on the wire.</t>
          </li>
          <li>
            <t>Exporting Process: transmits Ordered Template Sets (Set ID 4) or
Ordered Options Template Sets (Set ID 5) and constructs the corresponding Data Records with field values in
Metering Process observation order.  This can be verified by
inspecting the IPFIX Messages on the wire.</t>
          </li>
          <li>
            <t>Collecting Process: tracks which Template IDs were received in
Ordered Template Sets and interprets the n-th occurrence of a repeated
Information Element as the n-th Metering Process observation.
Correct interpretation can be verified by comparing collected data
against known traffic (e.g., known MPLS label stack or encapsulation
layer ordering in a test environment).</t>
          </li>
        </ul>
      </section>
      <section anchor="fault-management">
        <name>Fault Management</name>
        <t>The primary fault scenario for ordered export is a mismatch between
the Exporting Process and the Collecting Process: the Exporting Process
sends Ordered Sets that the Collecting Process does not understand.
Section 3.3.2 of <xref target="RFC7011"/> mandates that "the Length value MUST be
used to determine the position of the next Set," providing the mechanism
for a Collecting Process that does not support Set ID 4 or 5 to skip
the unknown Set and continue processing normally.  However,
<xref target="RFC7011"/> does not specify what a Collecting Process MUST or SHOULD
do upon receipt of an unknown Set ID -- whether to skip silently, log
the event, or terminate the Transport Session.  As a result, an
RFC 7011-compliant Collecting Process may silently discard the Set
without any notification to the Exporting Process or to the operator.
This document addresses this gap; see <xref target="updates-rfc7011"/>.</t>
        <t>Operators SHOULD monitor for unexpected loss of Flow Records that may
indicate silent Set discard at an unaware Collecting Process.  If
suspected, ordered export SHOULD be disabled for that destination until
the Collecting Process is confirmed to support Set ID 4 and Set ID 5.</t>
      </section>
      <section anchor="performance">
        <name>Performance</name>
        <t>The ordered export mechanism specified in this document introduces no
additional overhead on the wire: Ordered Template Sets and Ordered
Options Template Sets use the same wire format as their Set ID 2 and
Set ID 3 counterparts.  The only additional cost is the Collecting
Process maintaining per-Template-ID state to track whether each
Template was received in an Ordered or unordered Set, which is
negligible.</t>
        <t>The Metering Process, Exporting Process, and IPFIX Mediators may incur an implementation cost to preserve
observation order when recording repeated Information Element values,
depending on their internal architecture.  This is an implementation
consideration and is outside the scope of this document.</t>
      </section>
    </section>
    <section anchor="security-considerations">
      <name>Security Considerations</name>
      <t>This document does not change the trust model of the IPFIX protocol.
The security considerations of <xref target="RFC7011"/> apply.</t>
      <t>An Exporting Process or an IPFIX Mediator that uses an Ordered
Template Set (Set ID 4) or an Ordered Options Template Set (Set ID 5)
but fails to preserve the Metering Process
observation order will cause the Collecting Process to misinterpret
the exported data.  In particular, analytics systems that rely on the
ordering to identify encapsulation layers or label stack positions may
produce incorrect results.  Operators SHOULD ensure that the Exporting
Process, the Metering Process and any IPFIX Mediator in the path are
correctly coordinated before using ordered export.</t>
      <t>The Set ID now determines how the Collecting Process interprets the
order of repeated Information Elements.  A modification of the Set ID in
transit (2 to 4, 3 to 5, or the reverse) would change this interpretation
without otherwise corrupting the message.  The use of TLS or DTLS as
described in Section 11 of <xref target="RFC7011"/> protects against such
modification.</t>
    </section>
    <section anchor="iana-considerations">
      <name>IANA Considerations</name>
      <section anchor="ipfix-set-ids-registry">
        <name>IPFIX Set IDs Registry</name>
        <t>This document requests IANA to allocate the following values in the
"IPFIX Set IDs" subregistry of the "IP Flow Information Export (IPFIX)
Entities" registry <xref target="IANA.IPFIX"/>:</t>
        <table>
          <thead>
            <tr>
              <th align="left">Value</th>
              <th align="left">Set Identifier</th>
              <th align="left">Reference</th>
            </tr>
          </thead>
          <tbody>
            <tr>
              <td align="left">4</td>
              <td align="left">Ordered Template Set</td>
              <td align="left">This document</td>
            </tr>
            <tr>
              <td align="left">5</td>
              <td align="left">Ordered Options Template Set</td>
              <td align="left">This document</td>
            </tr>
          </tbody>
        </table>
        <t>After this allocation, IANA is requested to record the remaining
range as "6-255, Unassigned".</t>
      </section>
    </section>
  </middle>
  <back>
    <references anchor="sec-combined-references">
      <name>References</name>
      <references anchor="sec-normative-references">
        <name>Normative References</name>
        <reference anchor="RFC2119">
          <front>
            <title>Key words for use in RFCs to Indicate Requirement Levels</title>
            <author fullname="S. Bradner" initials="S." surname="Bradner"/>
            <date month="March" year="1997"/>
            <abstract>
              <t>In many standards track documents several words are used to signify the requirements in the specification. These words are often capitalized. This document defines these words as they should be interpreted in IETF documents. This document specifies an Internet Best Current Practices for the Internet Community, and requests discussion and suggestions for improvements.</t>
            </abstract>
          </front>
          <seriesInfo name="BCP" value="14"/>
          <seriesInfo name="RFC" value="2119"/>
          <seriesInfo name="DOI" value="10.17487/RFC2119"/>
        </reference>
        <reference anchor="RFC8174">
          <front>
            <title>Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words</title>
            <author fullname="B. Leiba" initials="B." surname="Leiba"/>
            <date month="May" year="2017"/>
            <abstract>
              <t>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="RFC5476">
          <front>
            <title>Packet Sampling (PSAMP) Protocol Specifications</title>
            <author fullname="B. Claise" initials="B." role="editor" surname="Claise"/>
            <author fullname="A. Johnson" initials="A." surname="Johnson"/>
            <author fullname="J. Quittek" initials="J." surname="Quittek"/>
            <date month="March" year="2009"/>
            <abstract>
              <t>This document specifies the export of packet information from a Packet SAMPling (PSAMP) Exporting Process to a PSAMP Collecting Process. For export of packet information, the IP Flow Information eXport (IPFIX) protocol is used, as both the IPFIX and PSAMP architecture match very well, and the means provided by the IPFIX protocol are sufficient. The document specifies in detail how the IPFIX protocol is used for PSAMP export of packet information. [STANDARDS-TRACK]</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="5476"/>
          <seriesInfo name="DOI" value="10.17487/RFC5476"/>
        </reference>
        <reference anchor="RFC6183">
          <front>
            <title>IP Flow Information Export (IPFIX) Mediation: Framework</title>
            <author fullname="A. Kobayashi" initials="A." surname="Kobayashi"/>
            <author fullname="B. Claise" initials="B." surname="Claise"/>
            <author fullname="G. Muenz" initials="G." surname="Muenz"/>
            <author fullname="K. Ishibashi" initials="K." surname="Ishibashi"/>
            <date month="April" year="2011"/>
            <abstract>
              <t>This document describes a framework for IP Flow Information Export (IPFIX) Mediation. This framework extends the IPFIX reference model specified in RFC 5470 by defining the IPFIX Mediator components. This document is not an Internet Standards Track specification; it is published for informational purposes.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="6183"/>
          <seriesInfo name="DOI" value="10.17487/RFC6183"/>
        </reference>
        <reference anchor="RFC7011">
          <front>
            <title>Specification of the IP Flow Information Export (IPFIX) Protocol for the Exchange of Flow Information</title>
            <author fullname="B. Claise" initials="B." role="editor" surname="Claise"/>
            <author fullname="B. Trammell" initials="B." role="editor" surname="Trammell"/>
            <author fullname="P. Aitken" initials="P." surname="Aitken"/>
            <date month="September" year="2013"/>
            <abstract>
              <t>This document specifies the IP Flow Information Export (IPFIX) protocol, which serves as a means for transmitting Traffic Flow information over the network. In order to transmit Traffic Flow information from an Exporting Process to a Collecting Process, a common representation of flow data and a standard means of communicating them are required. This document describes how the IPFIX Data and Template Records are carried over a number of transport protocols from an IPFIX Exporting Process to an IPFIX Collecting Process. This document obsoletes RFC 5101.</t>
            </abstract>
          </front>
          <seriesInfo name="STD" value="77"/>
          <seriesInfo name="RFC" value="7011"/>
          <seriesInfo name="DOI" value="10.17487/RFC7011"/>
        </reference>
        <reference anchor="RFC7014">
          <front>
            <title>Flow Selection Techniques</title>
            <author fullname="S. D'Antonio" initials="S." surname="D'Antonio"/>
            <author fullname="T. Zseby" initials="T." surname="Zseby"/>
            <author fullname="C. Henke" initials="C." surname="Henke"/>
            <author fullname="L. Peluso" initials="L." surname="Peluso"/>
            <date month="September" year="2013"/>
            <abstract>
              <t>The Intermediate Flow Selection Process is the process of selecting a subset of Flows from all observed Flows. The Intermediate Flow Selection Process may be located at an IP Flow Information Export (IPFIX) Exporter or Collector, or within an IPFIX Mediator. It reduces the effort of post-processing Flow data and transferring Flow Records. This document describes motivations for using the Intermediate Flow Selection process and presents Intermediate Flow Selection techniques. It provides an information model for configuring Intermediate Flow Selection Process techniques and discusses what information about an Intermediate Flow Selection Process should be exported.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="7014"/>
          <seriesInfo name="DOI" value="10.17487/RFC7014"/>
        </reference>
      </references>
      <references anchor="sec-informative-references">
        <name>Informative References</name>
        <reference anchor="RFC5470">
          <front>
            <title>Architecture for IP Flow Information Export</title>
            <author fullname="G. Sadasivan" initials="G." surname="Sadasivan"/>
            <author fullname="N. Brownlee" initials="N." surname="Brownlee"/>
            <author fullname="B. Claise" initials="B." surname="Claise"/>
            <author fullname="J. Quittek" initials="J." surname="Quittek"/>
            <date month="March" year="2009"/>
            <abstract>
              <t>This memo defines the IP Flow Information eXport (IPFIX) architecture for the selective monitoring of IP Flows, and for the export of measured IP Flow information from an IPFIX Device to a Collector. This memo provides information for the Internet community.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="5470"/>
          <seriesInfo name="DOI" value="10.17487/RFC5470"/>
        </reference>
        <reference anchor="RFC5474">
          <front>
            <title>A Framework for Packet Selection and Reporting</title>
            <author fullname="N. Duffield" initials="N." role="editor" surname="Duffield"/>
            <author fullname="D. Chiou" initials="D." surname="Chiou"/>
            <author fullname="B. Claise" initials="B." surname="Claise"/>
            <author fullname="A. Greenberg" initials="A." surname="Greenberg"/>
            <author fullname="M. Grossglauser" initials="M." surname="Grossglauser"/>
            <author fullname="J. Rexford" initials="J." surname="Rexford"/>
            <date month="March" year="2009"/>
            <abstract>
              <t>This document specifies a framework for the PSAMP (Packet SAMPling) protocol. The functions of this protocol are to select packets from a stream according to a set of standardized Selectors, to form a stream of reports on the selected packets, and to export the reports to a Collector. This framework details the components of this architecture, then describes some generic requirements, motivated by the dual aims of ubiquitous deployment and utility of the reports for applications. Detailed requirements for selection, reporting, and exporting are described, along with configuration requirements of the PSAMP functions. This memo provides information for the Internet community.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="5474"/>
          <seriesInfo name="DOI" value="10.17487/RFC5474"/>
        </reference>
        <reference anchor="RFC5475">
          <front>
            <title>Sampling and Filtering Techniques for IP Packet Selection</title>
            <author fullname="T. Zseby" initials="T." surname="Zseby"/>
            <author fullname="M. Molina" initials="M." surname="Molina"/>
            <author fullname="N. Duffield" initials="N." surname="Duffield"/>
            <author fullname="S. Niccolini" initials="S." surname="Niccolini"/>
            <author fullname="F. Raspall" initials="F." surname="Raspall"/>
            <date month="March" year="2009"/>
            <abstract>
              <t>This document describes Sampling and Filtering techniques for IP packet selection. It provides a categorization of schemes and defines what parameters are needed to describe the most common selection schemes. Furthermore, it shows how techniques can be combined to build more elaborate packet Selectors. The document provides the basis for the definition of information models for configuring selection techniques in Metering Processes and for reporting the technique in use to a Collector. [STANDARDS-TRACK]</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="5475"/>
          <seriesInfo name="DOI" value="10.17487/RFC5475"/>
        </reference>
        <reference anchor="RFC6313">
          <front>
            <title>Export of Structured Data in IP Flow Information Export (IPFIX)</title>
            <author fullname="B. Claise" initials="B." surname="Claise"/>
            <author fullname="G. Dhandapani" initials="G." surname="Dhandapani"/>
            <author fullname="P. Aitken" initials="P." surname="Aitken"/>
            <author fullname="S. Yates" initials="S." surname="Yates"/>
            <date month="July" year="2011"/>
            <abstract>
              <t>This document specifies an extension to the IP Flow Information Export (IPFIX) protocol specification in RFC 5101 and the IPFIX information model specified in RFC 5102 to support hierarchical structured data and lists (sequences) of Information Elements in data records. This extension allows definition of complex data structures such as variable-length lists and specification of hierarchical containment relationships between Templates. Finally, the semantics are provided in order to express the relationship among multiple list elements in a structured data record. [STANDARDS-TRACK]</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="6313"/>
          <seriesInfo name="DOI" value="10.17487/RFC6313"/>
        </reference>
        <reference anchor="RFC7012">
          <front>
            <title>Information Model for IP Flow Information Export (IPFIX)</title>
            <author fullname="B. Claise" initials="B." role="editor" surname="Claise"/>
            <author fullname="B. Trammell" initials="B." role="editor" surname="Trammell"/>
            <date month="September" year="2013"/>
            <abstract>
              <t>This document defines the data types and management policy for the information model for the IP Flow Information Export (IPFIX) protocol. This information model is maintained as the IANA "IPFIX Information Elements" registry, the initial contents of which were defined by RFC 5102. This information model is used by the IPFIX protocol for encoding measured traffic information and information related to the traffic Observation Point, the traffic Metering Process, and the Exporting Process. Although this model was developed for the IPFIX protocol, it is defined in an open way that allows it to be easily used in other protocols, interfaces, and applications. This document obsoletes RFC 5102.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="7012"/>
          <seriesInfo name="DOI" value="10.17487/RFC7012"/>
        </reference>
        <reference anchor="RFC7348">
          <front>
            <title>Virtual eXtensible Local Area Network (VXLAN): A Framework for Overlaying Virtualized Layer 2 Networks over Layer 3 Networks</title>
            <author fullname="M. Mahalingam" initials="M." surname="Mahalingam"/>
            <author fullname="D. Dutt" initials="D." surname="Dutt"/>
            <author fullname="K. Duda" initials="K." surname="Duda"/>
            <author fullname="P. Agarwal" initials="P." surname="Agarwal"/>
            <author fullname="L. Kreeger" initials="L." surname="Kreeger"/>
            <author fullname="T. Sridhar" initials="T." surname="Sridhar"/>
            <author fullname="M. Bursell" initials="M." surname="Bursell"/>
            <author fullname="C. Wright" initials="C." surname="Wright"/>
            <date month="August" year="2014"/>
            <abstract>
              <t>This document describes Virtual eXtensible Local Area Network (VXLAN), which is used to address the need for overlay networks within virtualized data centers accommodating multiple tenants. The scheme and the related protocols can be used in networks for cloud service providers and enterprise data centers. This memo documents the deployed VXLAN protocol for the benefit of the Internet community.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="7348"/>
          <seriesInfo name="DOI" value="10.17487/RFC7348"/>
        </reference>
        <reference anchor="RFC8926">
          <front>
            <title>Geneve: Generic Network Virtualization Encapsulation</title>
            <author fullname="J. Gross" initials="J." role="editor" surname="Gross"/>
            <author fullname="I. Ganga" initials="I." role="editor" surname="Ganga"/>
            <author fullname="T. Sridhar" initials="T." role="editor" surname="Sridhar"/>
            <date month="November" year="2020"/>
            <abstract>
              <t>Network virtualization involves the cooperation of devices with a wide variety of capabilities such as software and hardware tunnel endpoints, transit fabrics, and centralized control clusters. As a result of their role in tying together different elements of the system, the requirements on tunnels are influenced by all of these components. Therefore, flexibility is the most important aspect of a tunneling protocol if it is to keep pace with the evolution of technology. This document describes Geneve, an encapsulation protocol designed to recognize and accommodate these changing capabilities and needs.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="8926"/>
          <seriesInfo name="DOI" value="10.17487/RFC8926"/>
        </reference>
        <reference anchor="RFC9487">
          <front>
            <title>Export of Segment Routing over IPv6 Information in IP Flow Information Export (IPFIX)</title>
            <author fullname="T. Graf" initials="T." surname="Graf"/>
            <author fullname="B. Claise" initials="B." surname="Claise"/>
            <author fullname="P. Francois" initials="P." surname="Francois"/>
            <date month="November" year="2023"/>
            <abstract>
              <t>This document introduces new IP Flow Information Export (IPFIX) Information Elements (IEs) to identify a set of information related to Segment Routing over IPv6 (SRv6) such as data contained in a Segment Routing Header (SRH), the SRv6 control plane, and the SRv6 Endpoint behavior that traffic is being forwarded with.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="9487"/>
          <seriesInfo name="DOI" value="10.17487/RFC9487"/>
        </reference>
        <reference anchor="I-D.liu-opsawg-ipfix-muti-layer" target="https://datatracker.ietf.org/doc/html/draft-liu-opsawg-ipfix-muti-layer-02">
          <front>
            <title>Export of Multiple Encapsulation Layer Information in IPFIX</title>
            <author initials="Y." surname="Liu" fullname="Yao Liu">
              <organization>ZTE Corporation</organization>
            </author>
            <author initials="T." surname="Zhou" fullname="Taoran Zhou">
              <organization>ZTE Corporation</organization>
            </author>
            <date year="2026" month="March" day="31"/>
          </front>
          <seriesInfo name="Internet-Draft" value="draft-liu-opsawg-ipfix-muti-layer-02"/>
        </reference>
        <reference anchor="I-D.claise-opsawg-ipfix-ordered-mpls-ie">
          <front>
            <title>Generic MPLS Information Elements for Ordered Export in IPFIX</title>
            <author initials="B." surname="Claise" fullname="Benoit Claise">
              <organization>Everything OPS &amp; Arrcus</organization>
            </author>
            <author initials="P." surname="Aitken" fullname="Paul Aitken">
              <organization>Ciena</organization>
            </author>
            <author initials="H." surname="Keller" fullname="Holger Keller">
              <organization>Deutsche Telekom</organization>
            </author>
            <author initials="Y." surname="Liu" fullname="Yao Liu">
              <organization>ZTE Corporation</organization>
            </author>
            <date year="2026" month="October" day="28"/>
          </front>
          <seriesInfo name="Internet-Draft" value="draft-claise-opsawg-ipfix-ordered-mpls-ie-00"/>
        </reference>
        <reference anchor="I-D.opsarea-rfc5706bis">
          <front>
            <title>Guidelines for Considering Operations and Management in IETF Specifications</title>
            <author fullname="Benoît Claise" initials="B." surname="Claise">
              <organization>Everything OPS</organization>
            </author>
            <author fullname="Joe Clarke" initials="J." surname="Clarke">
              <organization>Cisco</organization>
            </author>
            <author fullname="Adrian Farrel" initials="A." surname="Farrel">
              <organization>Old Dog Consulting</organization>
            </author>
            <author fullname="Samier Barguil" initials="S." surname="Barguil">
              <organization>Nokia</organization>
            </author>
            <author fullname="Carlos Pignataro" initials="C." surname="Pignataro">
              <organization>Blue Fern Consulting</organization>
            </author>
            <author fullname="Ran Chen" initials="R." surname="Chen">
              <organization>ZTE</organization>
            </author>
            <date day="20" month="October" year="2025"/>
            <abstract>
              <t>   New Protocols or Protocol Extensions are best designed with due
   consideration of the functionality needed to operate and manage them.
   Retrofitting operations and management considerations is suboptimal.
   The purpose of this document is to provide guidance to authors and
   reviewers on what operational and management aspects should be
   addressed when defining New Protocols or Protocol Extensions.

   This document obsoletes RFC 5706, replacing it completely and
   updating it with new operational and management techniques and
   mechanisms.  It also introduces a requirement to include an
   "Operational Considerations" section in new RFCs in the IETF Stream.

              </t>
            </abstract>
          </front>
          <seriesInfo name="Internet-Draft" value="draft-opsarea-rfc5706bis-06"/>
        </reference>
        <reference anchor="IANA.IPFIX" target="https://www.iana.org/assignments/ipfix/ipfix.xhtml">
          <front>
            <title>IP Flow Information Export (IPFIX) Entities</title>
            <author>
              <organization>IANA</organization>
            </author>
            <date/>
          </front>
        </reference>
      </references>
    </references>
    <?line 1381?>

    <section anchor="solution-space">
      <name>Solution Space</name>
      <t>This section analyzes candidate solutions.  The analysis is presented to
inform discussion and justify the specification in <xref target="solution"/>.</t>
      <ul empty="true">
        <li>
          <t>Note: The detailed analysis in this section is intended to support
Working Group discussion.  Once the Working Group has reached
consensus on the solution, this section may be condensed
into a summary.</t>
        </li>
      </ul>
      <section anchor="updating-rfc-7011-should-to-must-alone-rejected">
        <name>Updating RFC 7011 SHOULD to MUST Alone (Rejected)</name>
        <t>The most minimal approach would be to update Section 8 of <xref target="RFC7011"/>
by strengthening the existing SHOULD to a MUST, requiring all Exporting
Processes to guarantee that repeated Information Elements follow the
Metering Process observation order.</t>
        <t>The fundamental limitation of this approach is that it constrains the
Exporting Process but provides no signal to the Collecting Process.
Even if every Exporting Process were compliant with the updated
requirement, the Collecting Process would still have no per-Template
indication of whether a given Template Record was sent by an updated
Exporting Process (ordering guaranteed) or by an older implementation
that predates the update (ordering not guaranteed).  Without such a
signal, the Collecting Process cannot safely interpret the n-th
occurrence of a repeated Information Element as the n-th Metering
Process observation.</t>
        <t>Two additional considerations reinforce the rejection.  First, Sections
4.2 and 4.3 of <xref target="RFC7011"/> explicitly state that "the order of the
Information Elements in the Template Records is not guaranteed"; a
SHOULD-to-MUST change in Section 8 alone would leave these statements
in direct conflict with the new requirement.  Second, Section 2.2 ("IPFIX Limitations") of <xref target="RFC6313"/> notes that
"some encoding optimizations are based on the permutation of
Information Element order"; a universal MUST would
prohibit such optimizations across all Templates containing repeated
Information Elements, regardless of whether ordering is semantically
significant.  This approach is therefore rejected.</t>
      </section>
      <section anchor="rfc6313-analysis">
        <name>RFC 6313 Structured Data with the "ordered" Semantic (Rejected)</name>
        <t>This option is analyzed in detail because <xref target="RFC6313"/> has been cited as
a solution to the ordering problem (see Introduction).  The analysis
below shows that it does not provide the required guarantee and is
therefore rejected.</t>
        <t><xref target="RFC6313"/> defines structured data types -- basicList, subTemplateList,
and subTemplateMultiList -- and associates them with list semantics.  One
defined semantic is:</t>
        <ul empty="true">
          <li>
            <t>The "ordered" structured data type semantic specifies that elements
from the list in the structured data are ordered.</t>
          </li>
        </ul>
        <t>Using this mechanism, an Exporting Process could encode a sequence of
ordered MPLS label values (see <xref target="I-D.claise-opsawg-ipfix-ordered-mpls-ie"/>)
as a basicList with the "ordered" semantic:</t>
        <artwork><![CDATA[
(basicList, ordered, mplsLabelStackEntry,
 <label1>, <label2>, <label3>)
]]></artwork>
        <t>Similarly, multi-layer encapsulation fields could be encoded in a
subTemplateMultiList with the "ordered" semantic.</t>
        <t>The fundamental limitation of this approach is that the <xref target="RFC6313"/>
"ordered" semantic is an export ordering guarantee, not a Metering
Process observation ordering guarantee.  Section 4.4.6 of <xref target="RFC6313"/>
states only that "elements from the list in the structured data are
ordered" -- it does not state that the order reflects the sequence in
which the Metering Process makes its observations.  Furthermore,
<xref target="RFC6313"/> structured data, when carried in an IPFIX Template Record,
still falls under the general rule of Section 8 of <xref target="RFC7011"/>:
"the different occurrences of this Information Element SHOULD follow
the logical order of their treatments by the Metering Process."
<xref target="RFC6313"/> does not upgrade this SHOULD to a MUST, nor does it bind
the "ordered" semantic to Metering Process observation order.  Since
IPFIX is an export protocol, governing the wire format between the
Exporting Process and the Collecting Process, it cannot by itself make
claims about the internal behavior of the Metering Process.  A
Collecting Process that receives a basicList or subTemplateMultiList
with the "ordered" semantic therefore cannot safely conclude that
element N corresponds to the N-th observation by the Metering Process.
This is precisely the guarantee this document requires, and <xref target="RFC6313"/>
does not provide it.  This approach is therefore rejected.</t>
      </section>
      <section anchor="new-ipfix-version-11-rejected">
        <name>New IPFIX Version 11 (Rejected)</name>
        <t>A new IPFIX version implies a broad overhaul of the protocol and would
carry community expectations far beyond the narrow scope of this
document.  The risk of scope creep is significant.</t>
        <t>Beyond scope, a version bump would be far more disruptive than new Set
IDs.  A Collecting Process that receives an IPFIX Message with an
unknown version number has no choice but to discard the entire message.
This means that introducing a new IPFIX version would cause every
existing Collecting Process to reject all IPFIX Messages -- including
those carrying unordered Data Sets -- until it is updated to support the
new version.  The deployment impact would be severe and disproportionate
to the problem being solved.</t>
        <t>By contrast, new Set IDs are additive.  Section 3.3.2 of <xref target="RFC7011"/>
reserves Set IDs 4 through 255 for future use and mandates that "the
Length value MUST be used to determine the position of the next Set."
A Collecting Process that does not support Set ID 4 or 5 can therefore
use the Set Length field to skip the unknown Set and continue processing
the remainder of the IPFIX Message normally.  All prior IPFIX extensions -- including <xref target="RFC6313"/> -- have been deployed without requiring a version
bump.  This approach is therefore rejected.</t>
      </section>
      <section anchor="marker-information-element-evaluated">
        <name>Marker Information Element (Evaluated)</name>
        <t>Define a new Information Element whose presence in an (Options) Template
Record indicates that the Information Elements following it (until the
next marker) are to be interpreted as ordered.  This approach is similar to
the encapLayerTop and encapLayer2 Information Elements proposed in
<xref target="I-D.liu-opsawg-ipfix-muti-layer"/> for encapsulation layer
identification.</t>
        <t>Advantages:</t>
        <ul spacing="normal">
          <li>
            <t>A Collecting Process that does not understand the marker Information
Element MAY discard only that one Information Element (per Section 9
of <xref target="RFC7011"/>), retaining the other fields in the Data Record.</t>
          </li>
        </ul>
        <t>Disadvantages:</t>
        <ul spacing="normal">
          <li>
            <t>The semantic of other Information Elements becomes dependent on the
presence and position of the marker Information Element, creating an
implicit dependency between IPFIX IEs that is not expressible in the
IPFIX Information Model <xref target="RFC7012"/>.</t>
          </li>
          <li>
            <t>The approach is less clean than a dedicated Set type from a protocol
design perspective.</t>
          </li>
        </ul>
      </section>
      <section anchor="options-template-indicator-evaluated">
        <name>Options Template Indicator (Evaluated)</name>
        <t>Define a new Options Template Record with a scope of Template ID,
containing a bitmap Information Element that identifies, for each field
in the referenced Template Record, whether that field belongs to an
ordered sequence.  This is analogous to the flowKeyIndicator Information
Element (IPFIX IE 173), which uses an Options Template to
convey which fields of a referenced Template Record are Flow Keys.</t>
        <t>Advantages:</t>
        <ul spacing="normal">
          <li>
            <t>Does not require changes to the Data Set format.</t>
          </li>
          <li>
            <t>The Options Template Record can be transmitted once per Template and
cached by the Collecting Process.</t>
          </li>
        </ul>
        <t>Disadvantages:</t>
        <ul spacing="normal">
          <li>
            <t>Requires the Collecting Process to correlate the Options Template
record with the Data Template before it can correctly interpret Data
Records, adding a level of indirection and a potential for
synchronization issues.</t>
          </li>
          <li>
            <t>More complex to implement than a dedicated Set type.</t>
          </li>
        </ul>
      </section>
      <section anchor="new-ordered-set-type">
        <name>New Ordered Set Type</name>
        <t>Define new Set IDs to indicate that the ordering of Information Elements
  within the corresponding Data Records is guaranteed to reflect the
  Metering Process observation order.  This approach extends the existing
  Set ID structure of <xref target="RFC7011"/>:</t>
        <table>
          <thead>
            <tr>
              <th align="left">Set ID</th>
              <th align="left">Name</th>
            </tr>
          </thead>
          <tbody>
            <tr>
              <td align="left">2</td>
              <td align="left">Template Set (existing)</td>
            </tr>
            <tr>
              <td align="left">3</td>
              <td align="left">Options Template Set (existing)</td>
            </tr>
            <tr>
              <td align="left">4</td>
              <td align="left">Ordered Template Set (new)</td>
            </tr>
            <tr>
              <td align="left">5</td>
              <td align="left">Ordered Options Template Set (new)</td>
            </tr>
          </tbody>
        </table>
        <t>Ordered Template Records (Set ID 4) and Ordered Options Template Records
  (Set ID 5) use the same wire format as their existing counterparts
  (Set ID 2 and Set ID 3 respectively), with the addition of the ordering
  semantic on the corresponding Data Records.</t>
        <t>Advantages:</t>
        <ul spacing="normal">
          <li>
            <t>Provides an explicit, unambiguous per-Set signal that ordering is
  guaranteed, without relying on the Collecting Process to parse an
  in-band marker or to maintain an out-of-band correlation table.</t>
          </li>
          <li>
            <t>No <xref target="RFC6313"/> structured data complexity is required; existing flat
  Template and Data Record formats are reused.</t>
          </li>
          <li>
            <t>Backwards compatible: existing Set IDs 2 and 3 are unaffected and
  continue to be used for cases where ordering is not guaranteed or not
  relevant.</t>
          </li>
          <li>
            <t>Generalizable to any stacked or layered protocol structure without
  requiring new position-specific Information Element definitions.</t>
          </li>
        </ul>
        <t>Disadvantages:</t>
        <ul spacing="normal">
          <li>
            <t>Requires both Exporting Process and Collecting Process updates to
  support the new Set IDs.</t>
          </li>
          <li>
            <t>A Collecting Process that does not support Set ID 4 or 5 may discard
  the entire Set upon receipt, resulting in a complete loss of the Data
  Records in that Set without any log information.  Section 3.3.2 of
  <xref target="RFC7011"/> does not specify the behavior of a Collecting Process upon
  receipt of an unknown Set ID.</t>
          </li>
        </ul>
      </section>
      <section anchor="new-ordered-list-type">
        <name>New Ordered List Data Type (Evaluated)</name>
        <t>Define a new structured data type, for example an orderedBasicList,
based on the basicList of <xref target="RFC6313"/>, whose semantic signals to the
Collecting Process that the elements reflect the Metering Process
observation order.  <xref target="RFC6313"/> does not provide this guarantee (see
<xref target="rfc6313-analysis"/>), but a new data type could.  The position of each
element could also be encoded, for example as (position, value) pairs,
so that a Collecting Process can detect elements that were not exported
(for instance, positions 1 and 3 exported but not 2).</t>
        <t>Two cases of repeated Information Elements illustrate the difference
with Ordered Template Sets:</t>
        <ol spacing="normal" type="1"><li>
            <t>Information Elements of a single technology, with an unbounded
number of occurrences, such as the SRv6 Segment List of <xref target="RFC9487"/>
or the MPLS label stack.  A list carries a variable number of elements
in a single Template Record.</t>
          </li>
          <li>
            <t>The same Information Element originating from different
technologies, such as destinationIPv6Address in the outer and inner
headers of a tunnel.  The Metering Process is configured for specific
encapsulation protocols, so the number of occurrences is known, or
bounded.  Repeated Information Elements in an Ordered Template Record
cover this case with a fixed number of occurrences.</t>
          </li>
        </ol>
        <t>Advantages:</t>
        <ul spacing="normal">
          <li>
            <t>A variable number of elements in a single Template Record, instead
of one Template Record per number of occurrences.</t>
          </li>
          <li>
            <t>Position encoding makes non-consecutive elements explicit.</t>
          </li>
        </ul>
        <t>Disadvantages:</t>
        <ul spacing="normal">
          <li>
            <t>Requires a new data type, and Exporting Process and Collecting
Process support for it.</t>
          </li>
          <li>
            <t>A list covers one Information Element.  Pairing elements of
different lists (for example the source and destination addresses of the
same layer) requires the position to be defined as shared across lists.</t>
          </li>
        </ul>
        <t>This approach is not specified in this document.</t>
      </section>
    </section>
<section anchor="migration-appendix">
      <name>Migration from Positional to Repeated Information Elements</name>
      <t>This appendix is informative.  It provides guidance for migrating
existing deployments from positional Information Elements to repeated
Information Elements used with the ordered export mechanism specified
in this document.  The mapping for the MPLS Information Elements is
provided in <xref target="I-D.claise-opsawg-ipfix-ordered-mpls-ie"/>.</t>
      <t>Positional Information Elements were defined as a workaround for the
absence of an ordering guarantee in IPFIX (see <xref target="ie-proliferation"/>).
With ordered export, a single generic Information Element repeated N
times in an Ordered Template Record replaces N positional Information
Elements, where the N-th occurrence corresponds to the N-th observation
at the Observation Point.</t>
      <t>Migration requires both Exporting Process and Collecting Process updates
to support Ordered Template Sets (Set ID 4) or Ordered Options Template
Sets (Set ID 5).  Until ordered export is universally deployed, both
positional and generic forms must be supported concurrently.</t>
    </section>
    <section anchor="changes">
      <name>Changes</name>
      <t>Note to the RFC Editor: please remove this appendix before
publication.</t>
      <section anchor="changes-00-01">
        <name>Changes from 00 to 01</name>
        <ul spacing="normal">
          <li>
            <t>Moved the solution-space analysis to <xref target="solution-space"/> and
dropped the "Recommended" label.</t>
          </li>
          <li>
            <t>Performance: added the Exporting Process and IPFIX Mediators to
the implementation-cost paragraph.</t>
          </li>
          <li>
            <t>Editorial: renumbered sections, marked "[this document]" as a
placeholder in the RFC 5476 update.</t>
          </li>
        </ul>
      </section>
      <section anchor="changes-01-02">
        <name>Changes from 01 to 02</name>
        <ul spacing="normal">
          <li>
            <t>Moved the generic MPLS Information Elements, their IANA
requests and the MPLS migration table to
<xref target="I-D.claise-opsawg-ipfix-ordered-mpls-ie"/>.</t>
          </li>
          <li>
            <t>Removed the erroneous Q-in-Q examples.</t>
          </li>
          <li>
            <t>Updated Section 8.1 of <xref target="RFC7011"/>: the Set ID of a Template
Withdrawal</t>
          </li>
          <li>
            <t>Updated Template lifecycle (Section 4.2, 4.3).</t>
          </li>
          <li>
            <t>Mediators (Section 4.3, 4.6): reworded the rule</t>
          </li>
          <li>
            <t>Section 4.3: stated the observation direction (outermost to
innermost, top to bottom).</t>
          </li>
          <li>
            <t>Section 5.2: replaced the Template Record size claim with the
Information Element registry simplification.</t>
          </li>
          <li>
            <t>Editorial changes</t>
          </li>
        </ul>
      </section>
    </section>
    <section numbered="false" anchor="acknowledgements">
      <name>Acknowledgements</name>
      <t>The authors thank Yao Liu and Taoran Zhou for their work on
<xref target="I-D.liu-opsawg-ipfix-muti-layer"/>, which identified the multi-layer
encapsulation use case and motivated the broader problem statement
addressed in this document.</t>
    </section>
  </back>

</rfc>
