<?xml version="1.0" encoding="utf-8"?>
<!-- This template is for creating an Internet Draft using xml2rfc,
     which is available here: http://xml.resource.org. -->
<!DOCTYPE rfc [
<!-- One method to get references from the online citation libraries.
     There has to be one entity for each item to be referenced. 
     An alternate method (rfc include) is described in the references. -->
<!ENTITY RFC2119 SYSTEM "http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml">
<!ENTITY RFC7276 SYSTEM "http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.7276.xml">
<!ENTITY RFC7384 SYSTEM "http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.7384.xml">
<!ENTITY RFC7799 SYSTEM "http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.7799.xml">
<!ENTITY RFC8126 SYSTEM "http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.8126.xml">
<!ENTITY RFC8174 SYSTEM "http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.8174.xml">
<!ENTITY RFC9055 SYSTEM "http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.9055.xml">
<!ENTITY RFC9197 SYSTEM "http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.9197.xml">
<!ENTITY RFC9326 SYSTEM "http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.9326.xml">
<!ENTITY AFI SYSTEM "http://www.iana.org/assignments/address-family-numbers/address-family-numbers.xml">
]>
<?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>
<!-- used by XSLT processors -->
<!-- For a complete list and description of processing instructions (PIs), 
     please see http://xml.resource.org/authoring/README.html. -->
<!-- Below are generally applicable Processing Instructions (PIs) that most I-Ds might want to use.
     (Here they are set differently than their defaults in xml2rfc v1.32) -->
<?rfc strict="yes" ?>
<!-- give errors regarding ID-nits and DTD validation -->
<!-- control the table of contents (ToC) -->
<?rfc toc="yes"?>
<!-- generate a ToC -->
<?rfc tocdepth="4"?>
<!-- the number of levels of subsections in ToC. default: 3 -->
<!-- control references -->
<?rfc symrefs="yes"?>
<!-- use symbolic references tags, i.e, [RFC2119] instead of [1] -->
<?rfc sortrefs="yes" ?>
<!-- sort the reference entries alphabetically -->
<!-- control vertical white space 
     (using these PIs as follows is recommended by the RFC Editor) -->
<?rfc compact="yes" ?>
<!-- do not start each main section on a new page -->
<?rfc subcompact="no" ?>
<!-- keep one blank line between list items -->
<!-- end of list of popular I-D processing instructions -->
<rfc category="std" docName="draft-ietf-ippm-ioam-data-integrity-09"
     ipr="trust200902" submissionType="IETF" consensus="true">
  <!-- ipr="full3978"-->

  <!-- category values: std, bcp, info, exp, and historic
     ipr values: full3667, noModification3667, noDerivatives3667
     you can add the attributes updates="NNNN" and obsoletes="NNNN" 
     they will automatically be output with "(if approved)" -->

  <!-- ***** FRONT MATTER ***** -->

  <front>
    <!-- The abbreviated title is used in the page header - it is only necessary if the 
         full title is longer than 39 characters -->

    <title abbrev="IOAM-Data-Fields Integrity">Integrity of In-situ OAM Data
    Fields</title>

    <!-- add 'role="editor"' below for the editors if appropriate -->

    <!-- Another author who claims to be an editor -->

    <author fullname="Frank Brockners" initials="F." surname="Brockners">
      <organization abbrev="Cisco">Cisco Systems, Inc.</organization>

      <address>
        <postal>
          <street>Hansaallee 249, 3rd Floor</street>

          <!-- Reorder these if your country does things differently -->

          <city>DUESSELDORF</city>

          <code>40549</code>

          <country>Germany</country>
        </postal>

        <email>fbrockne@cisco.com</email>

        <!-- uri and facsimile elements may also be added -->
      </address>
    </author>

    <author fullname="Shwetha Bhandari" initials="S." surname="Bhandari">
      <organization abbrev="Thoughtspot">Thoughtspot</organization>

      <address>
        <postal>
          <street>3rd Floor, Indiqube Orion, 24th Main Rd, Garden Layout, HSR
          Layout</street>

          <city>Bangalore, KARNATAKA 560 102</city>

          <country>India</country>
        </postal>

        <email>shwetha.bhandari@thoughtspot.com</email>
      </address>
    </author>

    <author fullname="Tal Mizrahi" initials="T." surname="Mizrahi">
      <organization abbrev="">Huawei</organization>

      <address>
        <postal>
          <street>8-2 Matam</street>

          <city>Haifa</city>

          <code>3190501</code>

          <country>Israel</country>
        </postal>

        <email>tal.mizrahi.phd@gmail.com</email>
      </address>
    </author>

    <author fullname="Justin Iurman" initials="J." surname="Iurman">
      <organization abbrev="">Universite de Liege</organization>

      <address>
        <postal>
          <street>10, Allee de la decouverte (B28)</street>

          <code>4000</code>

          <city>Sart-Tilman</city>

          <country>Belgium</country>
        </postal>

        <email>justin.iurman@uliege.be</email>
      </address>
    </author>

    <date day="05" month="July" year="2024"/>

    <!-- If the month and year are both specified and are the current ones, xml2rfc will fill 
         in the current day for you. If only the current year is specified, xml2rfc will fill 
	 in the current day and month for you. If the year is not the current one, it is 
	 necessary to specify at least a month (xml2rfc assumes day="1" if not specified for the 
	 purpose of calculating the expiry date).  With drafts it is normally sufficient to 
	 specify just the year. -->

    <!-- Meta-data Declarations -->

    <area>ops</area>

    <workgroup>ippm</workgroup>

    <!-- WG name at the upperleft corner of the doc,
         IETF is fine for individual submissions.  
	 If this element is not present, the default is "Network Working Group",
         which is used by the RFC Editor as a nod to the history of the IETF. -->

    <keyword>in-situ</keyword>

    <keyword>Telemetry, Tracing</keyword>

    <!-- Keywords will be incorporated into HTML output
         files in a meta tag but they have no effect on text or nroff
         output. If you submit your draft to the RFC Editor, the
         keywords will be used for the search engine. -->

    <abstract>
      <t>In-situ Operations, Administration, and Maintenance (IOAM) records 
      operational and telemetry information in the packet while the packet
      traverses a path in the network. IETF protocols require features that
      can provide secure operation. This document describes the integrity
      protection of IOAM-Data-Fields.</t>
    </abstract>
  </front>

  <middle>
    <section title="Introduction" toc="default">
      <t>"In-situ" Operations, Administration, and Maintenance (IOAM) records 
      OAM information within the packet while the packet traverses a
      particular network domain. The term "in-situ" refers to the fact that
      the OAM data is added to the data packets rather than being sent
      within packets specifically dedicated to OAM. IOAM is to complement
      mechanisms such as Ping or Traceroute.
      In terms of "active" or "passive" OAM, "in-situ" OAM can be considered a
      hybrid OAM type. "In-situ" mechanisms do not require extra packets to be
      sent. IOAM adds information to the already available data packets and
      therefore cannot be considered passive. In terms of the classification
      given in <xref target="RFC7799"/>, IOAM could be portrayed as Hybrid Type
      I. IOAM mechanisms can be leveraged where mechanisms using, e.g., ICMP do
      not apply or do not offer the desired results, such as verifying that a
      certain traffic flow takes a pre-defined path, SLA verification for the
      data traffic, detailed statistics on traffic distribution paths in
      networks that distribute traffic across multiple paths, or scenarios in
      which probe traffic is potentially handled differently from regular data
      traffic by the network devices.</t>

      <t>IOAM MUST be deployed in an IOAM-Domain. An IOAM-Domain is a set of
      nodes that use IOAM. An IOAM-Domain is bounded by its perimeter or
      edge. It is expected that all nodes in an IOAM-Domain are managed by the
      same administrative entity, that has means to select, monitor, and
      control the access to all the networking devices. As such,
      IOAM-Data-Fields are carried in the clear within packets and there are no
      protections against any node or middlebox tampering with the data.
      IOAM-Data-Fields collected in an untrusted or semi-trusted environment
      require integrity protection to support critical operational decisions.
      Please refer to <xref target="RFC9197"/> for more details on IOAM-Domains.
      </t>

      <t>Since arbitrary nodes and middleboxes can tamper with all
      packets data, including IOAM-Data-Fields, and the packets are (in general)
      processed by other intermediary nodes before they could arrive at a node
      that can verify the IOAM fields of the packet, there is little value in
      attempting to use cryptographic mechanisms to prevent such modifications
      to the IOAM fields in the packet. Instead, we limit ourselves to the
      "detectability
      problem", namely, to allow an endpoint to detect that such modification
      has occurred since the generation of the IOAM-Data-Fields. In addition to
      this detectability problem, the following considerations and requirements
      are to be taken into account in constructing an IOAM integrity
      mechanism: <list style="numbers">
          <t>IOAM data is processed by the data plane, hence viability
          of any method to prove integrity of the IOAM-Data-Fields must be
          feasible at data plane processing/forwarding rates (IOAM might
          be applied to all traffic a router forwards).</t>

          <t>IOAM data is carried within packets. Additional space
          required to prove integrity of the IOAM-Data-Fields SHOULD be
          optimal, i.e., SHOULD not exceed the Maximum Transmission Unit (MTU)
          or have adverse effect on packet processing.</t>

          <t>Protection against replay of old IOAM data SHOULD be possible.
          Without replay protection, a rogue node can present the old IOAM
          data, masking any ongoing network issues/activity and making the
          IOAM-Data-Fields collection useless.</t>

      </list></t>

      <t>This document defines a method to protect the integrity of
      IOAM-Data-Fields, using the IOAM Option-Types specified in
      <xref target="RFC9197"/> and <xref target="RFC9326"/> as an example. The
      method will similarly apply to future IOAM Option-Types.</t>
    </section>

    <section anchor="Conventions" title="Conventions">

      <section title="Requirements Language">
        <t>The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
        "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and
        "OPTIONAL" in this document are to be interpreted as described in BCP
        14 <xref target="RFC2119"/> <xref target="RFC8174"/> when, and only
        when, they appear in all capitals, as shown here.</t>
      </section>

      <section title="Abbreviations">
      <t>Abbreviations used in this document:</t>

      <t><list hangIndent="11" style="hanging">
          <t hangText="OAM:">Operations, Administration, and Maintenance</t>

          <t hangText="IOAM:">In-situ OAM</t>

          <t hangText="POT:">Proof of Transit</t>

          <t hangText="E2E:">Edge to Edge</t>

          <t hangText="DEX:">Direct Exporting</t>
        </list></t>
        </section>
    </section>

    <section anchor="ThreatAnalysis" title="Threat Analysis">
      <t>This section presents a threat analysis of integrity-related threats
      in the context of IOAM. The threats that are discussed are assumed to be
      independent of the lower layer protocols; it is assumed that threats at
      other layers are handled by security mechanisms that are deployed at
      these layers.</t>

      <t>This document is focused on integrity protection for IOAM-Data-Fields.
      Thus the threat analysis includes threats that are related to or
      result from compromising the integrity of IOAM-Data-Fields. Other
      security aspects such as confidentiality are not within the scope of
      this document.</t>

      <t>Throughout the analysis there is a distinction between on-path and
      off-path attackers. As discussed in <xref
      target="RFC9055"/>, on-path attackers are located in a
      position that allows interception and modification of in-flight protocol
      packets, whereas off-path attackers can only attack by generating
      protocol packets.</t>

      <t>The analysis also includes the impact of each of the threats.
      Generally speaking, the impact of a successful attack on an OAM protocol
      <xref target="RFC7276"/> is an illusion of nonexistent failures or
      preventing the detection of actual ones; in both cases, the attack may
      result in denial of service (DoS). Furthermore, creating the
      illusion of a nonexistent issue may trigger unnecessary processing in
      some of the IOAM nodes along the path, and may cause more IOAM-related
      data to be exported to the management plane than is conventionally
      necessary. Beyond these general impacts, threat-specific impacts are
      discussed in each of the subsections below.</t>

      <section anchor="ModifDataSec" title="Modification: IOAM-Data-Fields">
        <t>Threat <list hangIndent="10" style="empty">
            <t>An on-path attacker can modify the IOAM-Data-Fields of
            in-transit packets. The modification can either be applied to all
            packets or selectively applied to a subset of the en route
	    packets. Maliciously modified IOAM-Data-Fields can for example
            mislead network diagnostics, result in incorrect network
            performance metrics, or could misguide network optimization efforts.
            </t>
          </list></t>

        <t>Impact <list hangIndent="10" style="empty">
            <t>By systematically modifying the IOAM-Data-Fields of some or all
            of the in-transit packets, an attacker can create a fake picture of
            the network status. Potential consequences include an impact on
            network performance, a change in the recorded forwarding path of
            packets, either based on fake node positions or fake data provided
            by the attacker to fool the system that ingests IOAM-Data-Fields.</t>
          </list></t>
      </section>

      <section anchor="ModifHeaderSec"
               title="Modification: IOAM Option-Type headers">
        <t>Threat <list hangIndent="10" style="empty">
            <t>An on-path attacker can modify the header in IOAM Option-Types
            in order to change or disrupt the
            behavior of nodes processing IOAM-Data-Fields along the path.</t>
          </list></t>

        <t>Impact <list hangIndent="10" style="empty">
            <t>Changing the header of existing IOAM Option-Types, just like it
            is assumed for future IOAM Option-Types, may have several
            implications. The following list of examples is not exhaustive, and
            is based on IOAM Option-Types defined in <xref target="RFC9197"/>
            and <xref target="RFC9326"/>. An
            attacker could maliciously increase the processing overhead in nodes
            that process IOAM-Data-Fields and increase the on-the-wire overhead
            of IOAM-Data-Fields, by modifying the IOAM-Trace-Type field in the
            IOAM Trace Option-Type header. An attacker could also prevent some
            of the nodes that process IOAM-Data-Fields from incorporating
            IOAM-Data-Fields, by modifying the RemainingLen field in the IOAM
            Trace Option-Type header. Another possibility for the attacker is to
            change the definition or interpretation of IOAM-Data-Fields by
            modifying the Namespace-ID field, which is common to all IOAM
            Option-Type headers. For IOAM-Namespaces, please refer to
            <xref target="RFC9197"/>, Section 4.2. Without the right context
            (i.e., Namespace-ID),
            IOAM-Data-Fields become meaningless, just like data without
            metadata. An attacker could also set the Loopback flag
            in the IOAM Trace Option-Type header so that packet copies would be
            sent back by each node to the encapsulating node. Note that the
            modification of the header can lead to similar impacts
            described in <xref target="ModifDataSec"/>.</t>
          </list></t>
      </section>

      <section title="Injection: IOAM-Data-Fields">
        <t>Threat <list hangIndent="10" style="empty">
            <t>An attacker can inject packets with IOAM Option-Types and
            IOAM-Data-Fields. This threat is applicable to both on-path and
            off-path attackers.</t>
          </list></t>

        <t>Impact <list hangIndent="10" style="empty">
            <t>This attack and its impacts are similar to <xref
            target="ModifDataSec"/>.</t>
          </list></t>
      </section>

      <section title="Injection: IOAM Option-Type headers">
        <t>Threat <list hangIndent="10" style="empty">
            <t>An attacker can inject packets with IOAM Option-Type headers,
            thus manipulating other nodes that process IOAM-Data-Fields in the
            network. This threat is applicable to both on-path and off-path
            attackers.</t>
          </list></t>

        <t>Impact <list hangIndent="10" style="empty">
            <t>This attack and its impacts are similar to <xref
            target="ModifHeaderSec"/>.</t>
          </list></t>
      </section>

      <section title="Replay">
        <t>Threat <list hangIndent="10" style="empty">
            <t>In addition to replaying old packets in general, an attacker can
            replay packets with IOAM-Data-Fields.
            Specifically, an attacker may replay a previously transmitted IOAM
            Option-Type with a new data packet, therefore attaching old
            IOAM-Data-Fields to a fresh user packet. This threat is applicable
            to both on-path and off-path attackers.</t>
          </list></t>

        <t>Impact <list hangIndent="10" style="empty">
            <t>The impacts of this attack are similar to those described in
            <xref target="ModifDataSec"/>.</t>

          </list></t>
      </section>

      <section title="Management and Exporting">
        <t>Threat <list hangIndent="10" style="empty">
            <t>Attacks that compromise the integrity of IOAM-Data-Fields can
            be applied at the management plane, e.g., by manipulating network
            management packets. Furthermore, the integrity of IOAM-Data-Fields
            that are exported to a receiving entity can also be compromised.
            Management plane attacks are not within the scope of this
            document; the network management protocol is expected to include
            inherent security capabilities. The integrity of exported data is
            also not within the scope of this document. It is expected that
            the specification of the export format will discuss the relevant
            security aspects.</t>
          </list></t>

        <t>Impact <list hangIndent="10" style="empty">
            <t>Malicious manipulation of the management protocol can cause
            nodes that process IOAM-Data-Fields to malfunction, to be
            overloaded, or to incorporate unnecessary IOAM-Data-Fields into
            user packets. The impact of compromising the integrity of exported
            IOAM-Data-Fields is similar to the impacts of previous threats
            that were described in this section.</t>
          </list></t>
      </section>

      <section title="Delay">
        <t>Threat <list hangIndent="10" style="empty">
            <t>An on-path attacker may delay some or all of the in-transit
            packets that include IOAM-Data-Fields in order to create an
            illusion of congestion. Delay attacks are well known in the
            context of deterministic networks <xref
            target="RFC9055"/> and time synchronization <xref
            target="RFC7384"/>, and may be somewhat mitigated in these
            environments by using redundant paths in a way that is resilient
            to an attack along one of the paths. This approach does not
            address the threat in the context of IOAM, as it does not meet the
            requirement to measure a specific path or to detect a problem
            along the path. Note that the mechanisms in this document do not
            attempt to provide any mitigation against this threat.</t>
          </list></t>

        <t>Impact <list hangIndent="10" style="empty">
            <t>Since IOAM can be applied to a fraction of the traffic, an
            attacker can detect and delay only the packets that include
            IOAM-Data-Fields, thus preventing the authenticity of delay and load
            measurements.</t>
          </list></t>
      </section>

      <section title="Threat Summary">
        <figure align="center" anchor="ThreatSummary"
                title="Threat Analysis Summary">
          <artwork align="left">
            
+-------------------------------------------+--------+------------+
| Threat                                    |In scope|Out of scope|
+-------------------------------------------+--------+------------+
|Modification: IOAM-Data-Fields             |   +    |            |
+-------------------------------------------+--------+------------+
|Modification: IOAM Option-Type headers     |   +    |            |
+-------------------------------------------+--------+------------+
|Injection: IOAM-Data-Fields                |   +    |            |
+-------------------------------------------+--------+------------+
|Injection: IOAM Option-Type headers        |   +    |            |
+-------------------------------------------+--------+------------+
|Replay                                     |   +    |            |
+-------------------------------------------+--------+------------+
|Management and Exporting                   |        |     +      |
+-------------------------------------------+--------+------------+
|Delay                                      |        |     +      |
+-------------------------------------------+--------+------------+
           </artwork>
        </figure>
      </section>
    </section>

    <section anchor="NewIOAMOptTypes" title="Integrity Protected Option-Types">
    <t>This section defines new IOAM Option-Types. Their purpose is to carry
    IOAM-Data-Fields with integrity protection. All existing IOAM Option-Types
    defined in <xref target="RFC9197"/> are extended as follows:</t>

        <t><list style="hanging">
            <t hangText="64">IOAM Pre-allocated Trace Integrity Protected
            Option-Type: corresponds to the IOAM Pre-allocated Trace Option-Type
            (<xref target="RFC9197"/>) with integrity protection.</t>

            <t hangText="65">IOAM Incremental Trace Integrity Protected
            Option-Type: corresponds to the IOAM Incremental Trace Option-Type
            (<xref target="RFC9197"/>) with integrity protection.</t>

            <t hangText="66">IOAM POT Integrity Protected Option-Type:
            corresponds to the IOAM POT Option-Type (<xref target="RFC9197"/>)
            with integrity protection.</t>

            <t hangText="67">IOAM E2E Integrity Protected Option-Type:
            corresponds to the IOAM E2E Option-Type (<xref target="RFC9197"/>)
            with integrity protection.</t>
          </list></t>

      <t>The Direct Export (DEX) Option-Type <xref target="RFC9326"/> is not
      covered by the Integrity Protection Method defined in this document (see
      <xref target="IPM"/>). This document focuses on the integrity
      protection of IOAM-Data-Fields, while DEX does not have IOAM-Data-Fields
      by definition. Therefore, DEX is considered out of scope for this
      document. DEX, as well as any IOAM Option-Type without IOAM-Data-Fields,
      MUST NOT use the Integrity Protection Method defined in this document.</t>

      <t>The IOAM Integrity Protection header follows the IOAM Option-Type
      header and precedes IOAM-Data-Fields, when the IOAM Option-Type is an
      Integrity Protected Option-Type. It is defined as follows:</t>

      <t><figure title="IOAM Integrity Protection header">
        <artwork>
 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|   Method-ID   |  Nonce Length |           Reserved            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
~                             Nonce                             ~
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
~                  Integrity Check Value (ICV)                  ~
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
        </artwork>
      </figure></t>

      <t><list style="hanging">
        <t hangText="Method-ID:">8-bit unsigned integer.
        It defines the Integrity Protection Method to compute the Integrity
        Check Value (ICV) field. If a node encounters an unknown value, it MUST
        NOT change the contents of the IOAM Integrity Protection header and MUST
        NOT change the contents of the IOAM-Data-Fields. In other words, the
        node MUST NOT process the IOAM Option-Type.
        See <xref target="IOAM-IP-registry"/>.</t>

        <t hangText="Nonce Length:">8-bit unsigned integer. It
        defines the length of the Nonce field, in octets.</t>

        <t hangText="Reserved:">16-bit Reserved field. It MUST be set to zero
        upon transmission and ignored upon receipt.</t>

        <t hangText="Nonce:"> Variable length field. Its size depends on the
        Nonce Length field.</t>

        <t hangText="Integrity Check Value (ICV):"> Variable length field. Its
        size depends on the Method-ID field.
        </t>
      </list></t>

      <t>In order to keep IOAM-Data-Fields aligned, the total length of the IOAM
      Integrity Protection header MUST be a multiple of 4 octets.</t>

      <section title="Trace Integrity Protected Option-Types">
        <t>Both the IOAM Pre-allocated Trace Option-Type header and the IOAM
        Incremental Trace Option-Type header, as defined in <xref
        target="RFC9197"/>, are followed by the IOAM Integrity
        Protection header when the IOAM Option-Type is respectively set to
        the IOAM Pre-allocated Trace Integrity Protected Option-Type or the IOAM
        Incremental Trace Integrity Protected Option-Type:
        <figure>
          <artwork>
 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|         Namespace-ID          | NodeLen | Flags | RemainingLen|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                IOAM-Trace-Type                |   Reserved    |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|   Method ID   |  Nonce length |           Reserved            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
~                             Nonce                             ~
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
~                  Integrity Check Value (ICV)                  ~
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
~                       IOAM-Data-Fields                        ~
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
          </artwork>
        </figure></t>
      </section>

      <section title="POT Integrity Protected Option-Type">
        <t>The IOAM POT Option-Type header, as defined in <xref
        target="RFC9197"/>, is followed by the IOAM Integrity
        Protection header when the IOAM Option-Type is set to the IOAM POT
        Integrity Protected Option-Type:
        <figure>
          <artwork>
 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|         Namespace-ID          | IOAM-POT-Type | IOAM-POT-Flags| 
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|   Method ID   |  Nonce length |           Reserved            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
~                             Nonce                             ~
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
~                  Integrity Check Value (ICV)                  ~
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
~                       IOAM-Data-Fields                        ~
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
          </artwork>
        </figure></t>
      </section>

      <section title="E2E Integrity Protected Option-Type">
        <t>The IOAM E2E Option-Type header, as defined in <xref
        target="RFC9197"/>, is followed by the IOAM Integrity
        Protection header when the IOAM Option-Type is set to the IOAM E2E
        Integrity Protected Option-Type:
        <figure>
          <artwork>
 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|         Namespace-ID          |         IOAM-E2E-Type         |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|   Method ID   |  Nonce length |           Reserved            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
~                             Nonce                             ~
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
~                  Integrity Check Value (ICV)                  ~
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
~                       IOAM-Data-Fields                        ~
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
          </artwork>
        </figure></t>
      </section>
    </section>

    <section anchor="IPM" title="Integrity Protection Method">
      <t>This document defines a new method that uses a symmetric key based
      algorithm for the integrity protection of IOAM-Data-Fields.
      The method MUST use AES-GMAC (<xref target="NIST.800-38D"/>), a block
      cipher mode of operation providing data origin authentication, which is
      also a specialization of the Galois/Counter Mode (GCM). The GCM
      authenticated encryption operation has four inputs: a secret key, an
      Initialization Vector (IV), a plaintext, and Additional Authenticated Data
      (AAD). It has two outputs: a ciphertext whose length is identical to the
      plaintext and an Authentication Tag. GMAC is the special case of GCM in
      which the plaintext has a length of zero. Therefore, the empty ciphertext
      output is ignored, and the only output is the Authentication Tag.</t>

      <t>In this method, the AES-GMAC Authentication Tag MUST NOT be truncated,
      meaning its size MUST always be 16 octets (i.e., a full Authentication
      Tag). More security
      recommendations are discussed in <xref target="Security"/>. Below, we
      refer to the AES-GMAC Initialization Vector (IV) as the nonce, and to the
      AES-GMAC Authentication Tag as the Integrity Check Value (ICV).</t>

      <section anchor="IPM-Encap" title="Encapsulating node">
        <t>The encapsulating node generates a nonce and stores it in the Nonce
        field of the IOAM Integrity Protection header (the Nonce length
        field is set accordingly). It MUST be a 12-octet
        nonce, based on the "Deterministic Construction" (see
        <xref target="Security"/>). The Method ID field MUST be set to 1, as
        defined in <xref target="IOAM-IP-registry"/>.</t>

        <t>The Integrity Check Value (ICV) is the result of a GMAC operation
        over a selection of header fields (see
        <xref target="SelectHdrFields"/>) and immutable IOAM-Data-Fields added
        by the encapsulating node. With the nonce provided to
        GMAC, the encapsulating node performs the following operation:
          <list style="bullets">
            <t>AAD = (header fields || node's immutable IOAM-Data-Fields)</t>
            <t>ICV = GMAC(AAD)</t>
          </list>
        </t>

        <t>The encapsulating node stores the ICV in the corresponding field of
        the IOAM Integrity Protection header.</t>

        <section anchor="SelectHdrFields" title="Selection of header fields">
          <t>The main objective of the Integrity Protection Method defined in
          this document is to provide integrity protection of IOAM-Data-Fields.
          However, some Option-Type header fields are crucial for
          IOAM-Data-Fields. Without them, IOAM-Data-Fields are meaningless.
          Therefore, the integrity of such header fields MUST be protected too.
          </t>

          <t>For Trace Option-Types, here is the list of header fields that
          participate (in that order) in the integrity protection of
          IOAM-Data-Fields:
            <list style="numbers">
              <t>Namespace-ID</t>
              <t>IOAM-Trace-Type</t>
            </list>

          The NodeLen field is not included in the list because it can be
          deduced from the IOAM-Trace-Type field. Other header fields that are
          not included in the list are either mutable or only useful for
          processing Trace Option-Types (i.e., they don't provide context or
          meaning to IOAM-Data-Fields).</t>

          <t>For a POT Option-Type, here is the list of header fields that
          participate (in that order) in the integrity protection of
          IOAM-Data-Fields:
            <list style="numbers">
              <t>Namespace-ID</t>
              <t>IOAM-POT-Type</t>
            </list>

          Other header fields that are not included in the list are either
          mutable or only useful for processing a POT Option-Type (i.e., they
          don't provide context or meaning to IOAM-Data-Fields).</t>

          <t>For a E2E Option-Type, here is the list of header fields that
          participate (in that order) in the integrity protection of
          IOAM-Data-Fields:
            <list style="numbers">
              <t>Namespace-ID</t>
              <t>IOAM-E2E-Type</t>
            </list>

          Those are all the header fields defined for a E2E Option-Type.</t>

          <t>New IOAM Integrity Protected Option-Types that
          intend to use the Integrity Protection Method defined in this
          document MUST also specify a list of corresponding Option-Type header
          fields that participate in the integrity protection of
          IOAM-Data-Fields, as above. The same logic can be applied to select
          header fields, by following this simple rule:
            <list style="bullets">
              <t>Only immutable IOAM Option-Type header fields that provide
              context or meaning to IOAM-Data-Fields are considered, others are
              excluded (e.g., mutable or reserved fields). For example, the
              Namespace-ID, which is common to all IOAM Option-Types, MUST
              always be included in the list. Once specified, the list MUST NOT
              change for interoperability reasons.</t>
            </list>
          </t>
        </section>
      </section>

      <section anchor="IPM-Transit" title="Transit node">
        <t>For a transit node, the Integrity Check Value (ICV) is the result of
        a GMAC operation over the received ICV field and immutable
        IOAM-Data-Fields added by the transit node. With the
        received Nonce field provided to GMAC, the transit node performs the
        following operation:
          <list style="bullets">
            <t>AAD = (ICV field || node's immutable IOAM-Data-Fields)</t>
            <t>ICV = GMAC(AAD)</t>
          </list>
        </t>

        <t>The transit node updates the ICV field in the IOAM Integrity
        Protection header.</t>

        <!--<t>If the transit node does not add any IOAM-Data-Fields (e.g., it
        only modifies mutable IOAM-Data-Fields or does nothing), then the
        transit node MUST NOT update the ICV field in the IOAM Integrity
        Protection header.</t>-->

        <t>A transit node MUST NOT add or remove the IOAM Integrity Protection
        header.</t>
      </section>

      <section anchor="IPM-Decap" title="Decapsulating node">
        <t>The decapsulating node MAY perform the function of the Validator. If
        it does, please refer to <xref target="IPM-Validator"/>.</t>

        <t>If the decapsulating node does not perform the function of the
        Validator, which is an alternative to put the Validator out of the
        forwarding path in case of performance concerns, the decapsulating node
        MUST send the entire IOAM Integrity Protected Option-Type to the
        Validator. The method to send it to the Validator is out of scope for
        this document. Before that, the decapsulating node updates the ICV field
        in the IOAM Integrity Protection header. The Integrity Check Value (ICV)
        is the result of a GMAC operation over the received ICV field and
        immutable IOAM-Data-Fields added by the decapsulating node. With the
        received Nonce field provided to GMAC, the decapsulating node performs
        the following operation:
          <list style="bullets">
            <t>AAD = (ICV field || node's immutable IOAM-Data-Fields)</t>
            <t>ICV = GMAC(AAD)</t>
          </list>
        </t>

        <!--<t>If the decapsulating node does not add any IOAM-Data-Fields (e.g., it
        only modifies mutable IOAM-Data-Fields or does nothing), then the
        decapsulating node MUST NOT update the ICV field in the IOAM Integrity
        Protection header.</t>-->

        <t>The decapsulating node MUST NOT add the IOAM Integrity Protection
        header.</t>
      </section>

      <section anchor="IPM-Validator" title="Validator">
        <t>A node that performs the validation of the integrity protection is
        referred to as the Validator. This method assumes that symmetric keys
        have been distributed to the Validator only. The details of the
        mechanisms used for key distribution are outside the scope of this
        document. We refer to the method as "Zero Trust" in the sense that
        neither the encapsulating node, nor transit nodes, nor any other
        non-IOAM nodes need to be trusted. The Validator is the only
        point of trust, meaning the method is considered a full integrity
        protection of IOAM-Data-Fields.</t>

        <t>The Validator MUST recompute the ICV by iteratively following the
        previous steps of the method in the same order, using the respective
        symmetric keys received previously. The recomputed ICV is then compared
        to the received ICV field. As a result, the Validator can detect if the
        integrity of IOAM-Data-Fields is intact or altered. The validation is
        one-step in some cases (e.g., with POT Type-0 or E2E), where only the
        encapsulating node updates the ICV, according to the definition of this
        method. For other cases where transit nodes also update the ICV (e.g.,
        with Trace Option-Types), the Validator MUST identify these transit
        nodes in order to look up their respective keys. For that, a unique
        identifier of the node, such as the "node_id" for Trace Option-Types,
        MUST be included in IOAM-Data-Fields. Whatever the Option-Type, the
        nonce allows the encapsulating node to be identified (see
        <xref target="Security"/>). Details on how the mapping
        between those identifiers and keys is implemented on the Validator are
        outside the scope of this document.</t>

        <t>The Validator MUST NOT update the ICV field in the IOAM Integrity
        Protection header. Since its role is to validate the integrity of
        IOAM-Data-Fields, it trusts itself whether it adds IOAM-Data-Fields or
        not.</t>
      </section>
    </section>

    <section anchor="IANA" title="IANA Considerations">

      <section anchor="IOAM-type-registry" title="IOAM Option-Types">
        <t>IANA is requested to define the following new code points in the
        "IOAM Option-Type" registry:</t>

        <t><list style="hanging">
            <t hangText="64">IOAM Pre-allocated Trace Integrity Protected
            Option-Type (see <xref target="NewIOAMOptTypes"/>)</t>

            <t hangText="65">IOAM Incremental Trace Integrity Protected
            Option-Type (see <xref target="NewIOAMOptTypes"/>)</t>

            <t hangText="66">IOAM POT Integrity Protected Option-Type
            (see <xref target="NewIOAMOptTypes"/>)</t>

            <t hangText="67">IOAM E2E Integrity Protected Option-Type
            (see <xref target="NewIOAMOptTypes"/>)</t>
        </list></t>

        <t>A document defining a new IOAM Integrity Protected Option-Type
        intended to use the method in this document MUST specify the
        corresponding IOAM Option-Type header fields involved in the integrity
        protection of IOAM-Data-Fields. See <xref target="SelectHdrFields"/> as
        an example.</t>
      </section>

      <section anchor="IOAM-IP-registry"
               title="IOAM Integrity Protection Method Suite">
        <t>IANA is requested to define a new registry named "IOAM Integrity
        Protection Method Suite", inside the "In Situ OAM (IOAM)" registry
        group.</t>

        <t>This new registry defines 256 code points to identify IOAM Integrity
        Protection methods. The following code points are
        defined in this document:

        <figure title="IOAM Integrity Protection Method Suite">
          <artwork>
  ID     Description                           Reference
+------+-------------------------------------+---------------+
| 0x00 | Reserved                            | This document |
+------+-------------------------------------+---------------+
| 0x01 | Zero Trust (AES-GMAC, 16-octet ICV) | This document |
+------+-------------------------------------+---------------+
| 0x02 |                                     |               |
| ...  | Unassigned                          |               |
| 0xFE |                                     |               |
+------+-------------------------------------+---------------+
| 0xFF | Reserved                            | This document |
+------+-------------------------------------+---------------+
          </artwork>
        </figure> Code points 2-254 are available for assignment via the "IETF
        Review" process, as per <xref target="RFC8126"/>.</t>

        <t>New registration requests MUST use the following template: the value
        of the requested code point, a description of the method, and a
        reference to the document defining the code point.</t>
      </section>
    </section>

    <section anchor="Security" title="Security Considerations">
      <t>Please refer to <xref target="ThreatAnalysis"/> for a threat analysis
      of integrity-related threats in the context of IOAM.</t>

      <t>The Integrity Protection Method defined in this document (see
      <xref target="IPM"/>) leverages symmetric keys. The symmetric keys need to
      be exchanged in a secure way between the nodes involved with integrity
      protection of IOAM-Data-Fields. The details of the key exchange are
      outside the scope of this document.</t>

      <t>There is an additional per-packet processing for each node that uses
      the Integrity Protection Method defined in this document. Inappropriate
      use of this Integrity Protection Method might overload nodes and cause
      them to stop functioning properly. Operators deploying IOAM with this
      Integrity Protection Method MUST ensure that such overload situations are
      avoided. This could for example be achieved by applying IOAM only to a
      subset of the entire traffic, keeping in mind that only that subset would
      be integrity protected.</t>

      <t>To ensure integrity protection of IOAM-Data-Fields, the Integrity
      Protection Method defined in this document uses AES-GMAC
      (<xref target="NIST.800-38D"/>). In that context, a generated key MUST be
      fresh. Another important requirement is that the same combination of a
      nonce (AES-GMAC IV) and a key MUST NOT be used more than once. Otherwise,
      security guarantees are destroyed. To avoid such scenario, and to avoid
      frequent rotation or refreshing of keys, a 12-octet nonce MUST be used,
      and the nonce MUST be based on the "Deterministic Construction"
      (<xref target="NIST.800-38D"/>, Sec. 8) as follows:
        <list style="bullets">
          <t>The nonce is the concatenation of two fields, called the fixed
          field and the invocation field.</t>

          <t>The fixed field identifies the device and MUST be unique (e.g., the
          IOAM unique identifier of the device).</t>

          <t>The invocation field identifies the sets of inputs (i.e., packets)
          to the authenticated encryption function in that particular device,
          and MUST be unique for each packet. It typically is either an integer
          counter or a linear feedback shift register that is driven by a
          primitive polynomial to ensure a maximal cycle length. In either case,
          the invocation field increments upon each invocation of the
          authenticated encryption function.</t>

          <t>The leading (i.e., leftmost) 32 bits of the nonce MUST hold the
          fixed field, while the trailing (i.e., rightmost) 64 bits MUST hold
          the invocation field. It means a limit of 2^32 distinct
          devices, and a limit of 2^64 invocations (i.e., packets) for a given
          key. As an example, it would take 7 years for a key to reach the limit
          of 2^64 with 1500-byte packets on a 1 Pbps (Petabits per second) link,
          while it would take 170 days with 100-byte packets.</t>
        </list>
      </t>

      <t>The nonce makes an ICV (AES-GMAC Authentication Tag) unique but does
      not necessarily prevent replay attacks. To enable replay protection, the
      encapsulating node and the Validator MUST agree on a common methodology to
      keep the nonce valid only for a specific period of time, which is outside
      the scope of this document. However, a suggestion would be to put a 64-bit
      timestamp in the invocation field of the nonce, based on the above
      recommendations.</t>
    </section>

    <section title="Acknowledgements">
      <t>The authors would like to thank Santhosh N, Rakesh Kandula, Saiprasad
      Muchala, Al Morton, Greg Mirsky, Benjamin Kaduk, Mehmet Beyaz,
      and Martin Duke for their comments and advice.</t>
    </section>
  </middle>

  <!--  *****BACK MATTER ***** -->

  <back>
    <!-- References split into informative and normative -->

    <!-- There are 2 ways to insert reference entries from the citation libraries:
     1. define an ENTITY at the top, and use "ampersand character"RFC2629; here (as shown)
     2. simply use a PI "less than character"?rfc include="reference.RFC.2119.xml"?> here
        (for I-Ds: include="reference.I-D.narten-iana-considerations-rfc2434bis.xml")

     Both are cited textually in the same manner: by using xref elements.
     If you use the PI option, xml2rfc will, by default, try to find included files in the same
     directory as the including file. You can also define the XML_LIBRARY environment variable
     with a value containing a set of directories to search.  These can be either in the local
     filing system or remote ones accessed by http (http://domain/dir/... ).-->

    <references title="Normative References">
      &RFC2119;

      &RFC8126;

      &RFC8174;
    </references>

    <references title="Informative References">
      &RFC7276;

      &RFC7384;

      &RFC7799;

      &RFC9055;

      &RFC9197;

      &RFC9326;

      <reference anchor="NIST.800-38D"
                 target="http://csrc.nist.gov/publications/nistpubs/800-38D/SP-800-38D.pdf">
        <front>
          <title>Recommendation for Block Cipher Modes of Operation:
          Galois/Counter Mode (GCM) and GMAC</title>

          <author>
            <organization>National Institute of Standards and
            Technology</organization>
          </author>

          <date year="2001"/>
        </front>

        <seriesInfo name="" value="NIST Special Publication 800-38D"/>
      </reference>

    </references>
  </back>
</rfc>
