<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE rfc [
<!ENTITY nbsp "&#160;">
<!ENTITY zwsp "&#8203;">
<!ENTITY nbhy "&#8209;">
<!ENTITY wj "&#8288;">
]>
<?rfc toc="yes"?>
<?rfc tocompact="yes"?>
<?rfc tocdepth="3"?>
<?rfc tocindent="yes"?>
<?rfc symrefs="yes"?>
<?rfc sortrefs="yes"?>
<?rfc comments="yes"?>
<?rfc inline="yes"?>
<?rfc compact="yes"?>
<?rfc subcompact="no"?>
<rfc xmlns:xi="http://www.w3.org/2001/XInclude" category="std" ipr="trust200902" docName="draft-ietf-mpls-mna-ioam-12" obsoletes="" updates="" submissionType="IETF" xml:lang="en" tocInclude="true" tocDepth="3" symRefs="true" sortRefs="true" version="3" consensus="true">
  <!-- xml2rfc v2v3 conversion 3.6.0 -->
  <?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>

<front>
    <title abbrev="IOAM Using MPLS Network Actions">Encapsulation for In Situ Operations, Administration, and Maintenance Data Using MPLS Network Actions</title>
    <seriesInfo name="Internet-Draft" value="draft-ietf-mpls-mna-ioam-12"/>
    
     <author fullname="Rakesh Gandhi" initials="R." surname="Gandhi" role="editor">
      <organization>Cisco Systems, Inc.</organization>
      <address>
        <postal>
          <country>Canada</country>
        </postal>
        <email>rgandhi@cisco.com</email>
      </address>
    </author>
  
    <author initials="G." surname="Mirsky" fullname="Greg Mirsky" role="editor">
      <organization>Ciena Corporation</organization>
      <address>
        <email>gregimirsky@gmail.com</email>
      </address>
    </author>

   <author fullname="Haoyu Song" initials="H." surname="Song">
      <organization>Futurewei Technologies</organization>
      <address>
        <postal>
          <country>United States of America</country>
        </postal>
        <email>haoyu.song@futurewei.com</email>
      </address>
    </author>

    <author fullname="Bin Wen" initials="B." surname="Wen">
      <organization>Comcast</organization>
      <address>
        <postal>
          <country>United States of America</country>
        </postal>
        <email>Bin_Wen@cable.comcast.com</email>
      </address>
    </author>

    <author fullname="Voitek Kozak" initials="V." surname="Kozak">
      <organization>Comcast</organization>
      <address>
        <postal>
          <country>United States of America</country>
        </postal>
        <email>Voitek_Kozak@comcast.com</email>
      </address>
    </author>

  
    <date year="2026"/>
    
    <area>Routing</area>
    <workgroup>MPLS Working Group</workgroup>
    <keyword>Internet-Draft</keyword>
    <keyword>IOAM</keyword>
    <keyword>MPLS Network Action</keyword>
    <abstract>
    <t>
    In situ Operations, Administration, and Maintenance (IOAM), defined in RFC 9197,
    collects operational and telemetry information in the packet using IOAM-Data-Fields while the packet
    traverses a path between two points in the network. 
    Several IOAM Option-Types are available, for example, Pre-allocated Trace, Proof of Transit (POT),
    Edge-to-Edge (E2E), and Incremental Trace, that can be used to collect information for calculating
    various performance metrics.
    RFC 9326 defines the IOAM Direct Export (IOAM-DEX) Option-Type,
    which is used as a trigger for IOAM data to be directly exported or locally aggregated
    without being pushed into in-flight data packets.
    </t>
    <t>
    MPLS Network Actions (MNA) mechanisms indicate actions to be performed on any combination of
    Label Switched Paths, MPLS packets, and the node itself, and to transport data needed for these actions.
    This document employs the MNA mechanisms to collect and transport the operational state and telemetry information
    using IOAM-Data-Fields as well as IOAM-DEX.
    </t>
    </abstract>
  </front>
  <middle>

    <section anchor="intro" numbered="true" toc="default">
      <name>Introduction</name>
      <t>
    In situ Operations, Administration, and Maintenance (IOAM) <xref target="RFC9197"/>
    collects operational and telemetry information in the packet using IOAM-Data-Fields while the packet
    traverses a path between two points in the network. 
    Several IOAM Option-Types are available, for example, Pre-allocated Trace, Proof of Transit (POT),
    Edge-to-Edge (E2E), and Incremental Trace, that can be used to collect information for calculating
    various performance metrics.
    Such mechanisms transport the collected information from an IOAM encapsulating node to an IOAM decapsulating
    node (both typically located at the edge of the IOAM domain within the data path).
    </t>

    <t>
    IOAM Direct Export (IOAM-DEX) <xref target="RFC9326"/> is
    an IOAM Option-Type used as a trigger for IOAM data to be directly exported or locally aggregated
    without being pushed into in-flight data packets.
    The exporting method and format are outside the scope of <xref target="RFC9326"/>.
    </t>

    <t>
    MPLS Network Actions (MNA) mechanisms <xref target="RFC9789"/>
    indicate actions to be performed on any combination of
    Label Switched Paths, MPLS packets, and the node itself,
    and allow for the transport of data needed for these actions.

     <xref target="RFC9994" format="default"/> defines mechanisms for carrying a Network Action Sub-Stack (NAS)
    as part of the MPLS label stack, i.e., the In-Stack MNA solution.

    <xref target="I-D.ietf-mpls-mna-ps-hdr"/> defines mechanisms for carrying MNA and Ancillary Data (AD) below the MPLS label stack,
    i.e., as the Post-Stack MNA solution. 

    <xref target="RFC9791"/> describes various use cases
    that can be realized using the MNA solution, including the IOAM and IOAM-DEX.
    </t>

    <t>
    This document employs the MNA mechanisms to collect and transport the operational state and telemetry information
    using IOAM Option-Types, including Pre-allocated Trace, POT, and E2E, as well as IOAM-DEX.
    The mechanism for exporting the collected information for the IOAM-DEX Option-Type is outside the scope of this document.
    Also, transporting the Incremental Trace IOAM Option-Type is outside the scope of this document.
    </t>

      </section>
      
      <section numbered="true" toc="default">
        <name>Conventions Used in This Document</name>
    
         <section anchor="abbreviations" numbered="true" toc="default">
           <name>Abbreviations</name>

           <t>
             The terminology defined in <xref target="RFC9789" format="default"/>,
             <xref target="RFC9994" format="default"/>, and
             <xref target="I-D.ietf-mpls-mna-ps-hdr" format="default"/> is used in this document.
           </t>

           <table anchor="acronyms-table">
             <name>Abbreviations</name>
             <thead>
               <tr>
                 <th align="left">Abbreviation</th>
                 <th align="left">Meaning</th>
                 <th align="left">Reference</th>
               </tr>
             </thead>
             <tbody>
                <tr>
                 <td>AD</td>
                 <td>Ancillary Data</td>
                 <td><xref target="RFC9613"/></td>
               </tr>
                 <tr>
                   <td>Blob</td>
                   <td>Binary Large Object</td>
                   <td>This document</td>
                 </tr>
               <tr>
                 <td>BoS</td>
                 <td>Bottom of Stack</td>
                 <td><xref target="RFC3032"/></td>
               </tr>
               <tr>
                  <td>HbH</td>
                 <td>Hop-by-Hop</td>
                 <td><xref target="RFC9789"/></td>
               </tr>
               <tr>
                 <td>I2E</td>
                 <td>Ingress to Egress</td>
                 <td><xref target="RFC9789"/></td>
               </tr>
               <tr>
                 <td>E2E</td>
                 <td>Edge to Edge</td>
                 <td><xref target="RFC9197"/></td>
               </tr>
               <tr>
                 <td>IHS</td>
                  <td>I2E, HbH, or Select</td>
                 <td><xref target="RFC9994"/></td>
               </tr>
               <tr>
                 <td>IOAM</td>
                 <td>In situ Operations, Administration, and Maintenance</td>
                 <td><xref target="RFC9197"/></td>
               </tr>
               <tr>
                 <td>IOAM-DEX</td>
                 <td>IOAM Direct Export</td>
                 <td><xref target="RFC9326"/></td>
               </tr>
               <tr>
                 <td>IOAM-DEX-MNA-ISD</td>
                 <td>IOAM Direct Export as MPLS Network Action ISD</td>
                 <td>This document</td>
               </tr>
               <tr>
                 <td>ISD</td>
                 <td>In-Stack Data</td>
                 <td><xref target="RFC9613"/></td>
               </tr>
               <tr>
                 <td>LSE</td>
                 <td>Label Stack Entry</td>
                  <td><xref target="RFC3032"/></td>
               </tr>
               <tr>
                 <td>MNA</td>
                 <td>MPLS Network Action</td>
                 <td><xref target="RFC9789"/></td>
               </tr>
               <tr>
                 <td>MPLS</td>
                 <td>Multiprotocol Label Switching</td>
                 <td><xref target="RFC3032"/></td>
               </tr>
               <tr>
                 <td>NAI</td>
                 <td>Network Action Indicator</td>
                  <td><xref target="RFC9613"/></td>
               </tr>
               <tr>
                 <td>NAL</td>
                 <td>Network Action Length</td>
                 <td><xref target="RFC9994"/></td>
               </tr>
               <tr>
                 <td>NAS</td>
                 <td>Network Action Sub-Stack</td>
                 <td><xref target="RFC9789"/></td>
               </tr>
               <tr>
                 <td>NASL</td>
                 <td>Network Action Sub-Stack Length</td>
                 <td><xref target="RFC9994"/></td>
               </tr>
               <tr>
                 <td>OAM</td>
                 <td>Operations, Administration, and Maintenance</td>
                  <td><xref target="RFC6291"/></td>
               </tr>
               <tr>
                 <td>P bit</td>
                 <td>Post-Stack Data Presence bit</td>
                 <td><xref target="I-D.ietf-mpls-mna-ps-hdr"/></td>
               </tr>
               <tr>
                 <td>POT</td>
                 <td>Proof of Transit</td>
                 <td><xref target="RFC9197"/></td>
               </tr>
               <tr>
                 <td>RLD</td>
                 <td>Readable Label Depth</td>
                 <td><xref target="RFC9789"/> and <xref target="I-D.ietf-mpls-mna-ps-hdr"/></td>
               </tr>
               <tr>
                 <td>PFN</td>
                 <td>Post-Stack First Nibble</td>
                 <td><xref target="RFC9790"/></td>
               </tr>
               <tr>
                 <td>PSD</td>
                 <td>Post-Stack Data</td>
                 <td><xref target="RFC9613"/></td>
               </tr>
               <tr>
                 <td>PSMH</td>
                 <td>Post-Stack MPLS Header</td>
                 <td><xref target="I-D.ietf-mpls-mna-ps-hdr"/></td>
               </tr>
               <tr>
                 <td>S bit</td>
                 <td>Bottom of Stack bit</td>
                 <td><xref target="RFC3032"/></td>
               </tr>
               <tr>
                 <td>TC</td>
                 <td>Traffic Class</td>
                 <td><xref target="RFC5462"/></td>
               </tr>
               <tr>
                 <td>TTL</td>
                 <td>Time to Live</td>
                 <td><xref target="RFC3032"/></td>
               </tr>
               <tr>
                 <td>U bit</td>
                 <td>Unknown Network Action Handling bit</td>
                 <td><xref target="RFC9994"/></td>
               </tr>
             </tbody>
           </table>
         </section>
         
        <section numbered="true" toc="default">
          <name>Requirements Language</name>
    <t>
 The key words "<bcp14>MUST</bcp14>", "<bcp14>MUST NOT</bcp14>", "<bcp14>REQUIRED</bcp14>", "<bcp14>SHALL</bcp14>", "<bcp14>SHALL NOT</bcp14>", "<bcp14>SHOULD</bcp14>", "<bcp14>SHOULD NOT</bcp14>", "<bcp14>RECOMMENDED</bcp14>", "<bcp14>NOT RECOMMENDED</bcp14>",
 "<bcp14>MAY</bcp14>", and "<bcp14>OPTIONAL</bcp14>" in this document are to be interpreted as
 described in BCP 14 <xref target="RFC2119" format="default" sectionFormat="of" derivedContent="RFC2119"/> <xref target="RFC8174" format="default" sectionFormat="of" derivedContent="RFC8174"/> when, and only when, they appear in all capitals, as shown here.
        </t>

      </section>
    </section>
    
    <section anchor="ioam-trace-option-application" numbered="true" toc="default">
      <name>Applicability of IOAM and IOAM-DEX in an MPLS Network</name>

    <t>
    Pre-allocated Trace, POT, and E2E IOAM Option-Types <xref target="RFC9197"/> use user packets to collect and transport
    the operational state and telemetry information. 
    This document defines the Post-Stack MNA <xref target="I-D.ietf-mpls-mna-ps-hdr"/> solution for encapsulation of 
    the Pre-allocated Trace, POT, and E2E IOAM Option-Types (see <xref target="ioam-mpls-sec-psd"/>).
    </t>

    <t>
    However, for some use cases, e.g., mobile backhaul, in which network resources are closely controlled,
    collecting and transporting telemetry information within a user packet may increase the
    complexity of network operations.
    In such environments, IOAM nodes can use IOAM-DEX, an IOAM Option-Type used as a trigger for IOAM data
    to be directly exported or locally aggregated without being pushed into in-flight data packets, as defined in <xref target="RFC9326"/>.

    IOAM-DEX collects the on-path telemetry information defined as IOAM data in <xref target="RFC9197"/>. 

    In this document, encapsulations for IOAM-DEX are realized as In-Stack Data (see <xref target="ioam-dex-isd-mna-sec"/>) 
    and as Post-Stack Data (see <xref target="ioam-mpls-sec-psd"/>).
    </t>

    <t>
    The procedure defined in this document for carrying IOAM Option-Types using the MNA solution can be
    applied to user traffic packets and active measurement test packets.
    <xref target="I-D.gandhi-ippm-stamp-mpls-hdr"/> uses the mechanisms defined in this document to transport IOAM Option-Types using the MNA solution,
    with Simple Two-Way Active Measurement Protocol (STAMP) test packets for Hop-by-Hop (HbH) and E2E measurements.
    <xref target="I-D.ietf-ippm-on-path-active-measurements"/> also describes
    active measurement methods where the mechanisms defined in this document
    can carry IOAM Option-Types for on-path telemetry in MPLS networks.
    </t>

</section>

<section anchor="ioam-mpls-sec-psd" numbered="true" toc="default">
<name>Realization of IOAM and IOAM-DEX as Post-Stack MNA</name>

    <t>
    The procedure defined utilizes the In-Stack MNA mechanisms <xref target="RFC9994" format="default"/> and Post-Stack MNA mechanisms <xref target="I-D.ietf-mpls-mna-ps-hdr"/>
    to transport IOAM Option-Types defined in <xref target="RFC9197" section="4" sectionFormat="of" format="default"/> 
    and IOAM-DEX Option-Type defined in <xref target="RFC9326" section="3.2" sectionFormat="of" format="default"/>) as Post-Stack MNA in MPLS networks.
    </t>

<section anchor="nas-for-post-stack-mna" numbered="true" toc="default">
<name>NAS for IOAM and IOAM-DEX as Post-Stack MNA</name>
    <t>
  The presence of the associated Post-Stack MPLS Header (PSMH) is indicated by setting the P bit to 1 in the NAS as defined in <xref target="I-D.ietf-mpls-mna-ps-hdr"/>.
  An example of a NAS with a Format B LSE and the associated PSMH carrying IOAM and IOAM-DEX Option-Types is shown in <xref target="ure-mna-encapsulation-in-mpls-header-e2e"/>.
    </t>
        <figure anchor="ure-mna-encapsulation-in-mpls-header-e2e">
          <name>Example of NAS with Format B LSE for Carrying IOAM and IOAM-DEX in PSMH</name>
          <artwork name="" type="" align="left" alt=""><![CDATA[
  0                   1                   2                   3
  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                MNA Label (value 4)    | TC  |S|  TTL          |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |  Opcode     |  13-bit Data (Format B) |P|IHS|S|  NASL |U| NAL |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                Label                  | TC  |1|  TTL          |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 ~ Post-Stack MPLS Header for IOAM and IOAM-DEX per Figure 2     ~
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 ~                Optional Payload + Padding                     ~
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
]]></artwork>
        </figure>

    <t>The fields in a NAS are defined as follows:</t>
    <ul spacing="normal">
      <li>The MNA Label (value 4) is defined in <xref target="RFC9994" format="default"/>.</li>
      <li>S (1-bit): The BoS <xref target="RFC3032" format="default"/>.</li>
      <li>P (1-bit): The P bit is set as specified in <xref target="I-D.ietf-mpls-mna-ps-hdr"/>.</li>
      <li>The NAL and NASL fields are set as specified in <xref target="RFC9994" format="default"/>.</li>
      <li>Opcode (7-bit): The opcode is set as specified in <xref target="RFC9994" format="default"/>.</li>
      <li>Data: The data is set as specified in <xref target="RFC9994" format="default"/>.</li>
      <li>The U bit is set as specified in <xref target="RFC9994" format="default"/> for In-Stack Network Actions and updated in <xref target="I-D.ietf-mpls-mna-ps-hdr"/>.</li>
      <li>The IHS scope field is set as defined in <xref target="RFC9994" format="default"/> and updated in <xref target="I-D.ietf-mpls-mna-ps-hdr"/>.</li>
    </ul>

    <t>
    If both edge and intermediate nodes need to process the IOAM Option-Types,
    then the IHS scope MUST be set to "HbH, value 0x1". If only edge nodes need to process
    the IOAM Option-Types, then the IHS scope MUST be set to "I2E, value 0x0".
    The I2E scope allows skipping IOAM processing on the intermediate nodes,
    i.e., it avoids the need to parse all IOAM Option-Types to detect the one that requires HbH processing.
    </t>

  </section>

   <section anchor="ioam-mpls-sec-psd-2" numbered="true" toc="default">
    <name>PSMH for IOAM and IOAM-DEX as Post-Stack MNA</name>

     <t>An example encoding of PSMH carrying IOAM and IOAM-DEX in Post-Stack MNA is shown in <xref target="ioam-psd-encaps-fig"/>.
     </t>
   
        <figure anchor="ioam-psd-encaps-fig">
          <name>Example of Post-Stack MPLS Header Carrying IOAM and IOAM-DEX</name>
          <artwork name="" type="" align="left" alt=""><![CDATA[
  0                   1                   2                   3
  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |  PFN  |Reserve|  PSMH-Len     | Type = MNA Post-Stack Header  |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |  MNA-PS-OP  |R|R|   PS-NAL    | Block-Number  |R|IOAM-Opt-Type|
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 ~       IOAM Option-Type and Data Space [RFC9197] [RFC9326]     ~
 ~       Beginning from Namespace-ID                             ~
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
]]></artwork>
        </figure>
  
  <t>The Post-Stack MPLS Base Header is added and contains the following fields 
     as defined in <xref target="I-D.ietf-mpls-mna-ps-hdr" format="default"/>.</t>

    <ul spacing="normal">
      <li>
        PFN (4-bit): The Post-Stack First Nibble (PFN) (value 0x0) as defined in
        <xref target="I-D.ietf-mpls-mna-ps-hdr" format="default"/>.
      </li>
      <li>
        PSMH-Len (8-bit): The PSMH total length in units of 4 octets as defined in
        <xref target="I-D.ietf-mpls-mna-ps-hdr" format="default"/>.
        The value excludes the first 4-octet unit for Post-Stack MPLS Base Header.
        When carrying N IOAM and IOAM-DEX network actions, all with the same PS-NAL value, PSMH-Len equals (1 + PS-NAL) * N.
      </li>
      <li>
        Type (16-bit): Type for MNA Post-Stack Header (value 1) as defined in
        <xref target="I-D.ietf-mpls-mna-ps-hdr" format="default"/>.
      </li>
    </ul>

    <t>
    The PSMH is added after the Post-Stack MPLS Base Header and contains the Post-Stack network action opcode for IOAM and IOAM-DEX,
    the length in 4-octet units, and the IOAM Option-Type with
    IOAM-Data-Fields in the Post-Stack ancillary data as shown in <xref target="ioam-psd-encaps-fig"/> and contains the following fields:</t>

          <ul spacing="normal">
          <li> <t>
         MNA-PS-OP (7-bit): Set to Opcode TBA1 (network action opcode for IOAM and IOAM-DEX in PSD)
         for the IOAM Option-Type defined in <xref target="RFC9197" format="default"/>,
         and the IOAM-DEX Option-Type defined in <xref target="RFC9326" format="default"/>.
         </t>

         <t>
         The U bit for this network action is set as specified in <xref target="I-D.ietf-mpls-mna-ps-hdr"/>.
         </t>

         <t>
         The IHS scope field for this network action is set to either I2E or HBH <xref target="I-D.ietf-mpls-mna-ps-hdr"/>.
         </t>

           </li>
           <li>
         R (3 x 1-bit): Three reserved bits appear in the PSMH row: two bits following MNA-PS-OP
         and one bit preceding IOAM-Opt-Type. All reserved bits MUST be set to 0 on
         transmission and MUST be ignored on receipt.
           </li>
           <li>
         IOAM-Opt-Type (7-bit): The field to carry the IOAM Option-Type, as defined in
         the "IOAM Option-Type Registry" in <xref target="RFC9197" format="default"/>
         and <xref target="RFC9326" format="default"/>.
           </li>
           <li>
         PS-NAL (7-bit): Unsigned integer representing the length of the IOAM-Data-Fields in 4-octet units for the MNA-PS-OP. The value excludes the first 4-octet unit.
           </li>
           <li>
         IOAM Option-Type and Data Space: IOAM-Data-Fields as specified by the
         IOAM-Opt-Type field, beginning from the Namespace-ID field. IOAM-Data-Fields are defined according to
         the IOAM Option-Type (e.g., see <xref target="RFC9197" section="4" sectionFormat="of" format="default"/>
         and <xref target="RFC9326" section="3.2" sectionFormat="of" format="default"/>).
           </li>
           <li>
         <t>Block-Number (8-bit): The Block-Number is used for the alternate marking method <xref target="RFC9341"/> to
         aggregate the IOAM-Data-Fields collected in the data plane and to correlate IOAM-Data-Fields exported from different
         nodes along the packet path, e.g., to compute measurement metrics for each block of a data flow.</t>
         <ul spacing="normal">
           <li>
             When the Flow ID field is present in the IOAM-Data-Fields in the PSMH, the Block-Number is scoped per data flow
             within the IOAM Namespace identified by the Namespace-ID field.
           </li>
           <li>
             When the Flow ID field is absent, the Block-Number is scoped per IOAM Namespace (identified by the Namespace-ID
             field) and applies to all flows sharing that Namespace.
           </li>
           <li>
             The Block-Number MUST be initialized to 0 at the start of operation and wraps from 255 back to 0 on overflow. It is
             incremented sequentially at every measurement interval configured at the encapsulating node. When the alternate
             marking method is not used, the Block-Number SHOULD be set to 0.
           </li>
         </ul>
       </li>

          </ul>

      <t>
       The following processing rules apply to the network action opcode TBA1.
      </t>

   <ul spacing="normal">
      <li>An MPLS packet MAY carry multiple network action opcode TBA1 in the same PSMH for different Option-Types.</li>
      <li>An MPLS packet MAY carry network action opcode TBA1 in more than one PSMH for different processing scopes.</li>
      <li>An MPLS packet MUST NOT carry network action opcode TBA1 in a NAS. Otherwise, the packet is treated as malformed and MUST be dropped.</li>
      <li>The IHS scope in a NAS MUST NOT be set to Select when the network action opcode TBA1 is carried in the associated PSMH. Otherwise, the packet is treated as malformed and MUST be dropped.</li>
    </ul>

      <section anchor="ioam-mpls-sec-psd-3" numbered="true" toc="default">
        <name>Example of Multiple IOAM and IOAM-DEX Option-Types as Post-Stack MNA</name>

    <t>
    An example of multiple Post-Stack Network Actions with the same IHS scope carrying different IOAM and IOAM-DEX  
    Option-Types is shown in <xref target="ure-ioam-network-action-in-mpls-header"/>.
    </t>

     <figure anchor="ure-ioam-network-action-in-mpls-header">
          <name>Example of Multiple IOAM and IOAM-DEX Option-Types as Post-Stack MNA</name>
          <artwork name="" type="" align="left" alt=""><![CDATA[
  0                   1                   2                   3
  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |  PFN  |Reserve|  PSMH-Len     | Type = MNA Post-Stack Header  |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |  MNA-PS-OP1 |R|R|   PS-NAL1   | Block-Number  |R|IOAM-Opt-Type|
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 ~  IOAM Option-Type and Data Space [RFC9197] [RFC9326]          ~
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |  MNA-PS-OP2 |R|R|   PS-NAL2   | Block-Number  |R|IOAM-Opt-Type|
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 ~  IOAM Option-Type and Data Space [RFC9197] [RFC9326]          ~
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 ~                 Optional Payload + Padding                    ~
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 ]]></artwork>
        </figure>


    <t>
    In this example, the PSMH carries the post-stack network action MNA-PS-OP1 with length PS-NAL1 and 
    the post-stack network action MNA-PS-OP2 with length PS-NAL2, both for different Option-Types.
    </t>

   </section>

   </section>

    <section anchor="procedure-for-ioam-dex" numbered="true" toc="default">
      <name>Procedure for IOAM and IOAM-DEX as Post-Stack MNA</name>
      
    <section anchor="ingress-to-egress-scope" numbered="true" toc="default">
      <name>Ingress-to-Egress Scope IOAM and IOAM-DEX as Post-Stack MNA</name>

    <t>The network actions with I2E scope carry IOAM Option-Types that
    require processing on the encapsulating and egress nodes only.
    </t>
 
    <t>
    The IOAM Option-Type carried can be the IOAM E2E
    Option-Type (value 3) defined in <xref target="RFC9197" format="default"/>
    or the IOAM-DEX Option-Type (value 4) defined
    in <xref target="RFC9326" format="default"/>.
    The network actions with I2E scope MUST NOT carry any IOAM Option-Type that
    requires IOAM processing on the intermediate nodes, as it will
    not be processed by them when the IHS scope is set to "I2E, value 0x0".</t>

        <t>
    The IOAM and IOAM-DEX network action procedure with I2E scope is summarized as follows:</t>

         <ul spacing="normal">
     <li>
    The encapsulating node inserts a NAS with the  
    IHS scope set to "I2E, value 0x0", as well as one or more network actions for IOAM and IOAM-DEX
    in the MPLS packet.
    </li>

    <li>
    The encapsulating node MUST ensure that the packet with all NASs and PSMHs
    added does not exceed the path MTU, as specified in <xref target="RFC9994" section="8" sectionFormat="of"/> and <xref target="I-D.ietf-mpls-mna-ps-hdr"/>.
    </li>

    <li>The egress node processes the IOAM-Data-Fields using the
    procedures defined in <xref target="RFC9197" format="default"/> and <xref target="RFC9326" format="default"/>.  An example of IOAM
    processing is to export the IOAM-Data-Fields for streaming telemetry.</li>

    <li>The egress node MUST remove the NAS and the associated PSMH including network actions for IOAM and IOAM-DEX and IOAM-Data-Fields
    from the received packet. The decapsulated packet is forwarded 
    downstream similar to the regular data packets or terminated locally.</li>
        </ul>
      </section>
      
    <section anchor="hop-by-hop-scope" numbered="true" toc="default">
      <name>Hop-by-Hop Scope IOAM and IOAM-DEX as Post-Stack MNA</name>

    <t>The network actions with HbH scope carry IOAM Option-Types that require
    processing at the intermediate and/or encapsulating and egress nodes.
    </t>

    <t>
    The IOAM Option-Type carried can be
    Pre-allocated Trace (value 0), POT (value 2), or E2E (value 3) defined in <xref target="RFC9197" format="default"/>, or the IOAM-DEX Option-Type (value 4) defined
    in <xref target="RFC9326" format="default"/>.</t> 

    <t>
    Note that the network actions defined in this document do not support the IOAM Incremental Trace Option-Type (value 1), which requires HbH processing.
    </t>

    <t>
    The IOAM and IOAM-DEX network action procedure with HbH scope is summarized as follows:</t>

        <ul spacing="normal">
          <li>
    The encapsulating node inserts a NAS 
    with the IHS scope set to "HbH, value 0x1", as well as one or more network actions for IOAM and IOAM-DEX 
    in the MPLS packet.</li>
          <li>The intermediate node that is enabled for the IOAM function
    processes the IOAM-Data-Fields as defined in
    <xref target="RFC9197" format="default"/> and <xref target="RFC9326" format="default"/>
    when the node recognizes the HbH scope in the NAS.</li>
          <li>The intermediate node forwards the data packet downstream.</li>
          <li>The processing on the egress node is the same as in the I2E case.</li>
        </ul>

    <t>Both HbH and I2E scope network actions for IOAM and IOAM-DEX MAY be carried in the Post-Stack MNA in an MPLS packet.
    In this case, the PSMH carrying HbH-scoped network actions MUST be added after the BoS
    and before the PSMH carrying I2E-scoped network actions.
    This minimizes the Readable Label Depth (RLD) <xref target="I-D.ietf-mpls-mna-ps-hdr"/> required on intermediate nodes for processing IOAM and IOAM-DEX.
    </t>

    </section>
    </section>

      </section>

    <section anchor="ioam-dex-isd-mna-sec" numbered="true" toc="default">
    <name>Realization of IOAM-DEX as In-Stack MNA</name>
    <t>
    The procedure defined adopts the IOAM-DEX Option-Type format
    defined in <xref target="RFC9326"/> using MNA In-Stack Data (ISD) <xref target="RFC9994" format="default"/> to support direct export in MPLS networks. 
    </t>

    <section anchor="nas-for-ioam-dex-isd-mna" numbered="true" toc="default">
    <name>NAS for IOAM-DEX as In-Stack MNA</name>

    <t>
    To transport direct export of the operational state and telemetry information,
    the IOAM-DEX-MNA-ISD Binary Large Object (blob)
    is placed in a NAS according to the procedure 
    defined in <xref target="RFC9994" format="default"/>. 
    An example NAS with Format B LSE and Format D LSE to carry IOAM-DEX-MNA-ISD is shown in <xref target="ioam-dex-mna-option-fig"/>. 
    </t>

   <figure anchor="ioam-dex-mna-option-fig">
   <name>Example of NAS with Format B LSE and Format D LSE to Carry IOAM-DEX as In-Stack MNA</name>
  <artwork name="" type="" align="left" alt=""><![CDATA[
  0                   1                   2                   3
  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                MNA Label (value 4)    | TC  |S|    TTL        |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |Opcode = TBA2|  13-bit Data (Format B) |P|IHS|S|  NASL |U| NAL |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 ~1|  IOAM-DEX-MNA-ISD per Figure 5 (Format D) |S|               ~
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
]]></artwork>
</figure>

    <t>Here, the fields in a NAS are defined as follows:</t>
    <ul spacing="normal">
    <li>The MNA Label (value 4) is defined in <xref target="RFC9994" format="default"/>.</li>
    <li>S (1-bit): The BoS <xref target="RFC3032" format="default"/>.</li>
    <li>P (1-bit): The P bit is set as specified in <xref target="I-D.ietf-mpls-mna-ps-hdr"/>.</li>
    <li>The U bit and NAL field are set as specified in <xref target="RFC9994" format="default"/>.</li>
    <li>NASL (4-bit): The number of LSEs that compose the IOAM-DEX-MNA-ISD blob.</li>
    <li>Opcode (7-bit): Set to network action opcode TBA2 for IOAM-DEX in ISD. The opcode TBA2 can be carried in Format B or Format C LSE <xref target="RFC9994" format="default"/>. </li>
    <li>Data: MUST be set to 0 in both cases, 13-bit data in Format B LSE and 20-bit data in Format C LSE <xref target="RFC9994" format="default"/>.</li>
    <li>IOAM-DEX-MNA-ISD: IOAM-DEX in MNA ISD encoding in Format D LSE <xref target="RFC9994" format="default"/>.</li>
      </ul>

    <t>
    By setting the IHS field <xref target="RFC9994" format="default"/>, the IOAM-DEX-MNA-ISD can be configured to operate in HbH, I2E, or Select scopes <xref target="RFC9789"/> to collect
    the operational state and telemetry information.
    </t>

      <t>
       The following processing rules apply to the network action opcode TBA2.
      </t>

    <ul spacing="normal">
      <li>An MPLS packet MUST NOT carry multiple network action opcode TBA2 in the same NAS. Otherwise, the packet is treated as malformed and MUST be dropped.</li>
      <li>An MPLS packet MAY carry network action opcode TBA2 in more than one NAS for different processing scopes.</li>
      <li>An MPLS packet MUST NOT carry network action opcode TBA2 in a PSMH. Otherwise, the packet is treated as malformed and MUST be dropped.</li>
    </ul>

    <t>The following processing rules apply when carrying both the network action opcode TBA1 for the IOAM-DEX Option-Type in a PSMH and the network action opcode TBA2 in a NAS in an MPLS packet:</t>
    <ul spacing="normal">
      <li>
    The network action opcode TBA2 in a NAS and the network action opcode TBA1 for the IOAM-DEX Option-Type in the associated PSMH MUST NOT be carried, due to their same IHS scope, in an MPLS packet; otherwise, the packet MUST be treated as malformed and MUST be dropped.
      </li>
      <li>
    The network action opcode TBA1 for IOAM-DEX Option-Type in a PSMH and network action opcode TBA2 in a NAS MAY be carried for different IHS scopes in an MPLS packet.
      </li>
      <li>
    Each network action for the IOAM-DEX Option-Type operates independently: opcode TBA2 triggers direct export at nodes processing the In-Stack MNA,
    while opcode TBA1 with IOAM Option-Type triggers direct export at nodes processing the Post-Stack MNA.
      </li>
    </ul>

    </section>

<section anchor="ioam-dex-isd-mna-enc-sec" numbered="true" toc="default">
<name>IOAM-DEX Option-Type Encoding as MNA ISD</name>

    <t>
    The IOAM-DEX-MNA-ISD blob in a NAS uses the Format D LSE <xref target="RFC9994" section="4.4" sectionFormat="of" format="default"/>,
    that maps to the IOAM-DEX Option-Type format <xref target="RFC9326"/>. In addition to the requirement to preserve the S bit, the most significant bit
    in Format D LSE is always set to 1, avoiding a possible mix-up of the LSE with one of the Base Special Purpose Labels <xref target="RFC9994"/>.
    The format of the IOAM-DEX-MNA-ISD blob in a NAS is shown in <xref target="ioam-dex-fig"/>. 
    </t>

 <figure anchor="ioam-dex-fig">
  <name>IOAM-DEX Option-Type Format for MNA ISD</name>
  <artwork name="" type="" align="left" alt=""><![CDATA[
  0                   1                   2                   3
  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |1|         Namespace-ID          | Reserved  |S|     Flags     |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |1|         IOAM-Trace-Type-MNA               |S|O|R| Ext-Flags |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |1|         Flow ID MNA (Optional)            |S|  Flow ID MNA  |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |1|         Sequence Number MNA (Optional)    |S|  Seq Num MNA  |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
]]></artwork>
</figure>
    <t>
    Here, the fields are defined as follows:
    </t>
    <ul spacing="normal">
    <li>Namespace-ID (16-bit): Identifier of the IOAM Namespace, as defined in <xref target="RFC9326" section="3.2" sectionFormat="of"/>.</li>
    
    <li>Reserved (6-bit): The Reserved field MUST be set to 0 on transmit and ignored on receipt.</li>
    
    <li>Flags (8-bit): The Flags field comprises eight one-bit subfields. The subfields in the Flags field are
    allocated by IANA in the IOAM DEX Flags registry, as defined in <xref target="RFC9326" section="4.2" sectionFormat="of"/>.</li>
    
    <li>
      <t>IOAM-Trace-Type-MNA (22-bit): The IOAM-Trace-Type-MNA corresponds to the IOAM-Trace-Type field defined in
      <xref target="RFC9326" section="3.2" sectionFormat="of"/>.</t>
      <ul spacing="normal">
        <li>
          The interpretation of bit positions, from bit 0 through bit 21, is as specified in <xref target="RFC9197"/>.
        </li>
        <li>
          Note that bits as specified in <xref target="RFC9197"/> are right-shifted one bit, so for example, bit 0 in
          <xref target="RFC9197"/> (leftmost bit for hop_Lim and node_id in short format) is mapped to bit 1 (second leftmost bit)
          in the MNA encoding.
        </li>
        <li>
          The registry that contains the assigned code points is found in IANA's IOAM Trace-Type registry
          <xref target="IANA-IOAM-Trace-Type"/>.
        </li>
      </ul>
    </li>
    
    <li><t>O (1-bit): This is a one-bit flag identical to the interpretation of bit 22 of the IOAM-Trace-Type field
    as defined in <xref target="RFC9326" section="3.2" sectionFormat="of"/>, marked as "variable-length Opaque State Snapshot"
    per <xref target="RFC9197"/>; assigned code points are found in IANA's IOAM Trace-Type registry <xref target="IANA-IOAM-Trace-Type"/>.</t></li>
    
    <li>
      <t>R (1-bit): This is a one-bit flag identical to the interpretation of bit 23 of the IOAM-Trace-Type field as defined in
      <xref target="RFC9326" section="3.2" sectionFormat="of"/>, marked as "reserved" per <xref target="RFC9197"/>; assigned code points are found
      in IANA's IOAM Trace-Type registry <xref target="IANA-IOAM-Trace-Type"/>.</t>
      <ul spacing="normal">
        <li>
          Similarly to <xref target="RFC9326"/>, the R bit is reserved to allow for future extensions of the
          IOAM-Trace-Type-MNA bit field, i.e., it indicates the presence of the extended IOAM-Trace-Type-MNA field in the next
          LSE in Format D. The format of the extended IOAM-Trace-Type-MNA field in the next LSE in Format D is outside the scope of this document.
        </li>
      </ul>
    </li>

    <li>The concatenation of the 22-bit IOAM-Trace-Type-MNA field with O and R flags, explained above, is 
    identical to the 24-bit IOAM-Trace-Type field in <xref target="RFC9326" section="3.2" sectionFormat="of"/>, and in the interpretation of those bits
    as defined in <xref target="RFC9197"/> and assigned code points found in IANA's IOAM Trace-Type registry <xref target="IANA-IOAM-Trace-Type"/>.</li>
    
    <li>
      <t>Ext-Flags (6-bit): The Ext-Flags field comprises six one-bit subfields. The allocation of the subfields in this field is according to the Extension-Flags field defined in
      <xref target="RFC9326" section="4.3" sectionFormat="of"/>.</t>
      <ul spacing="normal">
        <li>
          Four flags have been assigned by IANA: two as defined in <xref target="RFC9326" section="4.3" sectionFormat="of"/> indicating the presence
          of the optional Flow ID and Sequence Number fields, and two as defined in <xref target="RFC9630" section="4.1" sectionFormat="of"/>
          indicating the presence of the optional Multicast Branch ID field.
        </li>
        <li>
          <xref target="ext-flags"/> describes the detailed format of the Ext-Flags field.
        </li>
      </ul>
    </li>
    
    <li>
      <t>In the IOAM-DEX Option-Type defined in <xref target="RFC9326"/>, the IOAM-Trace-Type and Reserved fields together form the
      second 32-bit word, aligning the optional fields to 4-octet boundaries.</t>
      <ul spacing="normal">
        <li>
          In the case of the IOAM-DEX in MNA, for optional fields such as Flow ID MNA and Sequence Number MNA, such alignment is
          achieved without adding a Reserved field for padding.
        </li>
      </ul>
    </li>
 
    <li>
      <t>Flow ID MNA: An optional 4-octet field containing a 30-bit Flow ID (after removing leading 1 and S bits).</t>
      <ul spacing="normal">
        <li>
          <t>The semantics of the Flow ID MNA field are the same as those of the Flow ID field defined in
          <xref target="RFC9326" section="3.2" sectionFormat="of"/>, with the following two differences.</t>
        <ol spacing="normal">
          <li>
            The Flow ID MNA field carries a 30-bit value, compared to the 32-bit Flow ID field in <xref target="RFC9326"/>;
            therefore, the Flow ID space differs accordingly, and the 30-bit value will wrap around faster than the 32-bit value.
          </li>
          <li>
            The most significant bit MUST be set to 1. Bit 23 MUST be set according to the definition of the S bit in
            <xref target="RFC3032"/>.
          </li>
        </ol>
        </li>
      </ul>
    </li>
    
        <li>
      <t>Sequence Number MNA: An optional 4-octet field containing a 30-bit sequence number (after removing leading 1 and S bits).</t>
      <ul spacing="normal">
        <li>
          <t>The semantics of the Sequence Number MNA field are the same as those of the Sequence Number field defined in
          <xref target="RFC9326" section="3.2" sectionFormat="of"/>, with the following two differences.</t>
          <ol spacing="normal">
            <li>
              The Sequence Number MNA field carries a 30-bit value, compared to the 32-bit Sequence Number field in
              <xref target="RFC9326"/>; therefore, the sequence number space differs accordingly, and the 30-bit value will wrap
              around faster than the 32-bit value.
            </li>
            <li>
              The most significant bit MUST be set to 1. Bit 23 MUST be set according to the definition of the S bit in
              <xref target="RFC3032"/>.
            </li>
          </ol>
        </li>
        <li>
          In MPLS networks, when it is known that the label stack information is used for load-balancing flows, the 19-bit-long
          part of the Sequence Number MNA, starting from the bit 1 position of the LSE, MUST remain immutable for a particular
          packet flow identified by the value of the Flow ID MNA field.
        </li>
        <li>
          In MPLS networks, when it is known that other load-balancing techniques are used, all bits of the Sequence Number MNA
          field can be varied. Mechanisms to learn about the load-balancing techniques used by the nodes in MPLS networks are outside
          the scope of this document.
        </li>
      </ul>
        </li>

</ul>

<section anchor="ext-flags" numbered="true" toc="default">
<name>Ext-Flags Definition</name>

<t>
The length of the Ext-Flags field in the IOAM-DEX Option-Type in MNA is shorter by two one-bit fields compared to the
length of the Extension-Flags field defined in <xref target="RFC9326" section="3.2" sectionFormat="of"/>. In the 6-bit Ext-Flags field of
the IOAM-DEX-MNA-ISD header, four flags have been mapped to those IANA assigned flags in the IOAM-DEX Option-Type, and
two flags (corresponding to unassigned bits in the <xref target="RFC9326"/> Extension-Flags field) remain unassigned.
</t>

<figure anchor="ext-flag-fig">
   <name>Ext-Flags Field Format</name>
  <artwork name="" type="" align="left" alt=""><![CDATA[
                          0 1 2 3 4 5
                         +-+-+-+-+-+-+
                         |F|Q|N|I|A|A|
                         +-+-+-+-+-+-+
   ]]></artwork>
</figure>

    <t>Here, the Ext-Flags field is defined as follows:</t>
    <ul spacing="normal">
    <li>F (1-bit): One-bit flag. When the F flag is set to 1, it indicates the presence of the Flow ID field in the IOAM-DEX-MNA-ISD header.</li>
    <li>Q (1-bit): One-bit flag. When the Q flag is set to 1, it indicates the presence of the Sequence Number field in the IOAM-DEX-MNA-ISD header. The designation as Q flag is used to avoid confusion with the existing S bit for Bottom-of-Stack (BoS) in the MPLS header. This flag corresponds to the Sequence Number flag (labeled "S" in <xref target="RFC9630"/>) in the IOAM DEX Extension-Flags registry.</li>
    <li>N (1-bit): One-bit flag. When the N flag is set to 1, it indicates the presence of the Multicast Branching Node ID in the Multicast Branch ID field, as defined in <xref target="RFC9630" section="4.1" sectionFormat="of"/>.</li>
    <li>I (1-bit): One-bit flag. When the I flag is set to 1, it indicates the presence of the Multicast Branching Interface Index in the Multicast Branch ID field, as defined in <xref target="RFC9630" section="4.1" sectionFormat="of"/>. The N and I flags MUST be both set or both cleared; otherwise the header is considered malformed and the packet MUST be dropped.</li>
    <li>A (1-bit): Unassigned one-bit flags. They MUST be set to zero on transmission and MUST be ignored upon receipt. 
    </li>
    </ul>
</section>

  </section>

  </section>

    <section anchor="considerations" numbered="true" toc="default">
      <name>Considerations for IOAM and IOAM-DEX in MPLS Networks</name>

       <section anchor="node-capability" numbered="true" toc="default">
        <name>Node Capability</name>
      <t>The following behaviors for node capability apply:</t>

      <ul spacing="normal">
        <li>
      An MNA-capable egress node that supports the network action for IOAM and IOAM-DEX may not support the specific IOAM Option-Type or IOAM-Data-Fields
      carried in the packet. In that case, the egress node MUST handle the network action
      according to the U bit as defined in <xref target="RFC9994" format="default"/> and updated in <xref target="I-D.ietf-mpls-mna-ps-hdr"/>.
        </li>
        <li>
      The MNA-capable intermediate node that does not support the network action for IOAM and IOAM-DEX, or the IOAM Option-Type or IOAM-Data-Fields carried in the packet,
      MUST handle the network action according to the U bit as defined in <xref target="RFC9994" format="default"/> and updated in <xref target="I-D.ietf-mpls-mna-ps-hdr"/>.
        </li>
        <li>
      The intermediate node that does not support the MNA skips processing the IOAM and IOAM-DEX functions.
        </li>
      </ul>

    <t>
    The encapsulating node needs to know if the intermediate and egress nodes can support the IOAM and IOAM-DEX network actions.
    Information about the IOAM and IOAM-DEX capabilities of the nodes may be configured, collected through management protocols, 
    or distributed by control protocols (such as advertising by routing protocols). 
    The encapsulating node learns
    about the IOAM and IOAM-DEX capabilities of nodes using mechanisms that
    are out of scope for this document.
    </t>

    <t>
    The encapsulating node needs to know about the path maximum transmission unit (MTU) for the nodes on
    the path <xref target="RFC3032"/>.  Information about the path MTU of the nodes may
    be configured, collected through management protocols, or distributed
    by control protocols (such as MTU signaling for Label Distribution
    Protocol <xref target="RFC3988"/> and Path MTU Discovery for IPv6 <xref target="RFC8201"/>).  The
    mechanisms to learn about the path MTU of nodes in the path are out of
    scope for this document.
    </t>

    <t>
    The encapsulating node needs to know about the RLD of the nodes in
    the path as described in <xref target="RFC9789" section="2.3.1" sectionFormat="of"/> and updated in <xref target="I-D.ietf-mpls-mna-ps-hdr"/>, 
    so that IOAM and IOAM-DEX Option-Types can be read by nodes in the path.  Information about the
    RLD of the nodes may be configured, collected through management
    protocols, or distributed by control protocols (such as advertising
    by routing protocols).  The mechanisms to learn about the RLD of nodes in
    the path are out of scope for this document.
    </t>

      </section>

      <section anchor="readable-label-depth-consideration" numbered="true" toc="default">
        <name>Readable Label Depth</name>
    <t>
    The encapsulating node needs to ensure that the IOAM Option-Types and their IOAM-Data-Fields and IOAM-DEX data in a NAS and 
    the associated PSMH are added within the RLD <xref target="I-D.ietf-mpls-mna-ps-hdr"/>
    of the downstream MNA-capable nodes so that they can process the IOAM-Data-Fields and IOAM-DEX data.
    </t>
       </section>
      
        <section anchor="nested-mpls-encapsulation" numbered="true" toc="default">
        <name>Nested MPLS Encapsulation</name>
    <t>The following processing rules apply to nested MPLS encapsulation when adding a new MPLS encapsulation:</t>
    <ul spacing="normal">
      <li>
    When a packet is received with a network action opcode TBA2 for IOAM-DEX in ISD or opcode TBA1 for IOAM and IOAM-DEX in PSD, and the nested MPLS
    encapsulating node needs to add the network action opcode TBA2 for a different scope for IOAM-DEX in ISD, the node MUST add
    a new NAS with network action opcode TBA2 as part of the new MPLS encapsulation.
      </li>

       <li>
    When a packet is received with a network action opcode TBA2 for IOAM-DEX in ISD or opcode TBA1 for IOAM and IOAM-DEX in PSD, the nested MPLS
    encapsulating node MUST NOT add the network action opcode TBA2 for the same scope for IOAM-DEX in ISD as part of the new MPLS encapsulation.
      </li>

      <li>
    When a packet is received with an MPLS header, the nested MPLS
    encapsulating node MUST NOT add the new network action opcode TBA1 for IOAM and IOAM-DEX in PSD as part of the new MPLS encapsulation.
    This is because inserting a PSMH in an MPLS-encapsulated packet received from the network is not supported by <xref target="I-D.ietf-mpls-mna-ps-hdr"/>.
      </li>
    </ul>

       </section>
    </section>

           <section anchor="operational" numbered="true" toc="default">
      <name>Operational Considerations</name>

    <t>
    Operational considerations discussed in <xref target="RFC9994" format="default"/> and  
    <xref target="I-D.ietf-mpls-mna-ps-hdr"/> apply to this document.
    </t>

    <t>
    Management considerations discussed in <xref target="RFC9789"/>,
    management and deployment considerations discussed in <xref target="RFC9197"/>, and 
    performance considerations discussed in <xref target="RFC9326" section="5" sectionFormat="of"/> are also applicable here.
    </t>

    <t>
    Further operational considerations include policies controlling the processing of the collected operational state and telemetry information, and their transport in MPLS networks.
    Additional considerations are described in <xref target="considerations"/> for deploying IOAM and IOAM-DEX in MPLS networks.
    </t>

    <t>
    An implementation MAY collect the following counters:
    </t>

    <ul>
        <li> Packets received with IOAM network actions</li>
        <li> Packets received with IOAM-DEX in ISD network actions</li>
        <li> Packets dropped with IOAM network actions due to an unknown IOAM function</li>
        <li> Packets dropped with IOAM-DEX in ISD network actions due to an unknown IOAM-DEX function</li>
        <li> Packets dropped with IOAM network actions due to a malformed network action</li>
        <li> Packets dropped with IOAM-DEX in ISD network actions due to a malformed network action</li>
    </ul>

    <t> 
    Nodes MAY generate rate-limited notifications or alarms for significant operational events, such as sustained high 
    rates of IOAM-related packet drops to alert operators to potential issues. 
    Comprehensive logging of IOAM and IOAM-DEX network action processing details can aid in network diagnostics and post-mortem analysis.
    </t>

    </section>

    <section anchor="security" numbered="true" toc="default">
      <name>Security Considerations</name>
    <t>
    The security considerations discussed in <xref target="RFC9197" format="default"/>, 
    <xref target="RFC9326" format="default"/>, and <xref target="RFC9378" format="default"/> for IOAM and IOAM-DEX apply to this document.
    </t>

    <t>
    The security considerations discussed in <xref target="RFC9341" format="default"/> for alternate marking and <xref target="RFC9630" format="default"/> for IOAM deployment 
    apply to this document.
    </t>

    <t>
    The security considerations discussed in <xref target="RFC9789" format="default"/>, <xref target="RFC9994" format="default"/>, and  
    <xref target="I-D.ietf-mpls-mna-ps-hdr"/> for MNA apply to this document.
    </t>

    <t>
    The usage of network actions defined in this document for IOAM and IOAM-DEX is intended for 
    deployment in a single network administrative domain.
    As such, it assumes that the operator enabling the IOAM and IOAM-DEX  
    operations has previously verified the integrity of the path that packets take.
    However, operators need to properly secure the IOAM and IOAM-DEX
    in the domain to avoid malicious configuration and use, which could include
    injecting malicious IOAM and IOAM-DEX packets into the domain.
    </t>

    </section>

    <section anchor="iana-consider" numbered="true" toc="default">
    <name>IANA Considerations</name>
      <section anchor="iana-option-consider" numbered="true" toc="default">
      <name>Network Action Opcodes</name>
      <t>IANA is requested to assign code points from its Network Action Opcodes registry
      (created in <xref target="RFC9994" format="default"/> and updated in <xref target="I-D.ietf-mpls-mna-ps-hdr"/>)
      as specified in <xref target="iana-ioam-dex-mna-option-tbl"/>.</t>
      
          <table anchor="iana-ioam-dex-mna-option-tbl" align="center">
          <name>Network Action Opcodes</name>
          <thead>
            <tr>
              <th align="left">Opcode</th>
              <th align="left">Description</th>
              <th align="left">In-Stack Only, Post-Stack Only, In-Stack and Post-Stack</th>
              <th align="left">Reference</th>
            </tr>
          </thead>
          <tbody>

          <tr>
            <td align="left">TBA1</td>
            <td align="left">Network Action for IOAM and IOAM-DEX in PSD</td>
            <td align="left">Post-Stack Only</td>
            <td align="left">This document</td>
          </tr>

           <tr>
             <td align="left">TBA2</td>
             <td align="left">Network Action for IOAM-DEX in ISD</td>
             <td align="left">In-Stack Only</td>
             <td align="left">This document</td>
           </tr>

         </tbody>
        </table>
        
      </section>
      
    </section>


      
      </middle>
  
  <back>
  <references>
  <name>References</name>
  <references>
        <name>Normative References</name>
      <xi:include href="https://datatracker.ietf.org/doc/bibxml3/draft-ietf-mpls-mna-ps-hdr.xml"/>
      <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml"/>
      <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.3032.xml"/>
      <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8174.xml"/>
      <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.9197.xml"/>
      <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.9326.xml"/>
      <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.9341.xml"/>
      <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.9630.xml"/>
      <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.9789.xml"/>
      <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.9994.xml"/>

    </references>
    
    <references>
    <name>Informative References</name>
      <xi:include href="https://datatracker.ietf.org/doc/bibxml3/draft-gandhi-ippm-stamp-mpls-hdr.xml"/>
        <xi:include href="https://datatracker.ietf.org/doc/bibxml3/draft-ietf-ippm-on-path-active-measurements.xml"/>
      <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.5462.xml"/>
      <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.6291.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.3988.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8201.xml"/>
      <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.9378.xml"/>
      <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.9613.xml"/>
      <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.9791.xml"/>
      <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.9790.xml"/>
      <reference anchor="IANA-IOAM-Trace-Type" target="https://www.iana.org/assignments/ioam/ioam.xhtml#trace-type">
        <front>
            <title>IOAM Trace-Type</title>
            <author>
              <organization>IANA</organization>
            </author>
          </front>
        </reference>
        
          </references>
    
    </references>

  <section anchor="appendix-examples" numbered="false" toc="default">
    <name>Appendix A: In-Stack and Post-Stack Network Action Processing Order Example</name>

    <t>
    As described in <xref target="RFC9994" section="5.5" sectionFormat="of" format="default"/>, the network actions in a NAS are processed in order starting from the top of the label stack.
    The PSMH Start Offset Network Action opcode TBA3 defined in <xref target="I-D.ietf-mpls-mna-ps-hdr"/> can be added to interleave Post-Stack 
    Network Actions with In-Stack Network Actions to define processing order.  
    The following example shows how to process the
    Post-Stack Network Action before some of the In-Stack Network Actions in a NAS.
    </t>

      <figure anchor="In-Stack-NA-Ordering-3">
        <name>Example of In-Stack and Post-Stack Network Action Processing Order</name>
        <artwork name="" type="" align="left" alt=""><![CDATA[
  0                   1                   2                   3
  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+--
 |           MNA Label (value 4)         | TC  |0|    TTL        | |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
 | Opcode=L    |      Ancillary Data     |1|IHS|0| NASL=3|U|NAL=0| |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ N
 | Opcode=1    |      Flag-Based NAIs          |0| NAIs  |U|NAL=0| A
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ S
 | Opcode=TBA3 |      0                        |0|  0    |U|NAL=0| |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
 | Opcode=M    |      Ancillary Data           |1|  AD   |U|NAL=0| |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+--
 | PFN   |Reserve|    PSMH-Len   | Type = MNA Post-Stack Header  | |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ P
 |Opcode = TBA1|R|R|   PS-NAL    | Block-Number  |R|IOAM-Opt-Type| S
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ M
 ~       IOAM Option-Type and Data Space [RFC9197] [RFC9326]     ~ H
 ~       Beginning from Namespace-ID                             ~ |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+--
 ~                 Optional Payload + Padding                    ~
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+--
        ]]></artwork>
      </figure>

    <t>
    In this example, shown in <xref target="In-Stack-NA-Ordering-3"/>, the network actions in the NAS are processed in the following order:
    </t>

    <ul spacing="normal">
      <li>Opcode L (allocated outside of this document) is processed first.</li>
      <li>Opcode 1 (for Flag-Based NAIs defined in <xref target="RFC9994" format="default"/>) is processed next.</li>
      <li>Opcode TBA3 (Network Action for PSMH Start Offset opcode defined in <xref target="I-D.ietf-mpls-mna-ps-hdr"/>) is processed next.</li>
      <li>Opcode TBA1 (Network Action for IOAM and IOAM-DEX in PSD opcode) in the associated PSMH is processed next. The Data value set to 0 indicates that the PSMH starts immediately after the BoS.</li>
      <li>Opcode M (allocated outside of this document) is processed finally.</li>
    </ul>

    <t>
    Note: Opcode TBA3 will be assigned by IANA as part of <xref target="I-D.ietf-mpls-mna-ps-hdr"/>.
    This example will be updated by the RFC editor with the IANA assigned value for TBA3 at the time of publication.
    This note is to be removed once TBA3 value is updated in this example.
    </t>

  </section>
        
        <section numbered="false" toc="default">
      <name>Acknowledgments</name>
<t>
The authors would like to thank Adrian Farrel and Xueyan Song for reviewing this document and providing review comments.

The authors would also like to thank Patrick Khordoc, Sagar Soni, Shwetha Bhandari, Vengada Prasad Govindan, Tarek Saad, 
Stewart Bryant, Xiao Min, Jaganbabu Rajamanickam, Jie Dong, and Cheng Li for reviewing the early version of this document. 

The authors would also like to thank Mach Chen, Andrew Malis, Matthew Bocci, and Nick Delregno for the 
MPLS-RT expert review of the early version of this document.

The authors also thank Matthew Bocci for the early Rtgdir review, Sheng Jiang for early Opsdir review, and Giuseppe Fioccola for the PerfMetrDir 
review, which helped improve this document.
</t>
    </section>
    
   <section numbered="false" anchor="contributors" toc="default">
      <name>Contributors</name>
      <t>The following people have substantially contributed to this document:</t>
     <artwork name="" type="" align="left" alt=""><![CDATA[

Zafar Ali
Cisco Systems, Inc.
Email: zali@cisco.com

Frank Brockners
Cisco Systems, Inc.
Germany
Email: fbrockne@cisco.com

Loa Andersson
Huawei Technologies
Email: loa@pi.nu

   ]]></artwork>

    </section>

  </back>

</rfc>
