<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE rfc [
  <!ENTITY nbsp    "&#160;">
  <!ENTITY zwsp   "&#8203;">
  <!ENTITY nbhy   "&#8209;">
  <!ENTITY wj     "&#8288;">
  <!ENTITY RFC2119 SYSTEM "https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml">
  <!ENTITY RFC3032 SYSTEM "https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.3032.xml">
  <!ENTITY RFC4385 SYSTEM "https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.4385.xml">
  <!ENTITY RFC5462 SYSTEM "https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.5462.xml">
  <!ENTITY RFC5586 SYSTEM "https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.5586.xml">
  <!ENTITY RFC6291 SYSTEM "https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.6291.xml">
  <!ENTITY RFC8174 SYSTEM "https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.8174.xml">
  <!ENTITY RFC8296 SYSTEM "https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.8296.xml">
  <!ENTITY RFC9017 SYSTEM "https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.9017.xml">
  <!ENTITY RFC9613 SYSTEM "https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.9613.xml">
  <!ENTITY RFC9789 SYSTEM "https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.9789.xml">
  <!ENTITY RFC9790 SYSTEM "https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.9790.xml">
  <!ENTITY RFC9791 SYSTEM "https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.9791.xml">
  <!ENTITY RFC9994 SYSTEM "https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.9994.xml">
]>
<rfc xmlns:xi="http://www.w3.org/2001/XInclude" submissionType="IETF" docName="draft-ietf-mpls-mna-ps-hdr-12" category="std" ipr="trust200902" obsoletes="" updates="9994" xml:lang="en" sortRefs="false" symRefs="true" tocInclude="true" version="3" consensus="true">
  <!-- xml2rfc v2v3 conversion 3.12.0 -->
  <!-- Generated by id2xml 1.5.0 on 2020-03-06T17:47:05Z -->
    <front>
    <title abbrev="Post-Stack MNA Specification">Post-Stack MPLS Network Action (MNA) Header Specification
    </title>
    <seriesInfo name="Internet-Draft" value="draft-ietf-mpls-mna-ps-hdr-12"/>
    <author fullname="Jaganbabu Rajamanickam" initials="J." role="editor" surname="Rajamanickam">
      <organization>Cisco Systems, Inc.</organization>
      <address>
        <postal>
          <street>Canada</street>
        </postal>
        <email>jrajaman@cisco.com</email>
      </address>
    </author>

    <author fullname="Rakesh Gandhi" initials="R." role="editor" surname="Gandhi">
      <organization>Cisco Systems, Inc.</organization>
      <address>
        <postal>
          <street>Canada</street>
        </postal>
        <email>rgandhi@cisco.com</email>
      </address>
    </author>

    <author fullname="Royi Zigler" initials="R." surname="Zigler">
      <organization>Broadcom</organization>
      <address>
        <email>royi.zigler@broadcom.com</email>
      </address>
    </author>

    <author fullname="Jie Dong" initials="J." surname="Dong">
      <organization>Huawei Technologies</organization>
      <address>
        <postal>
          <street/>
          <city>Beijing</city>
          <country>China</country>
        </postal>
        <email>jie.dong@huawei.com</email>
      </address>
    </author>
    <author fullname="Jisu Bhattacharya" initials="J." surname="Bhattacharya">
      <organization>Cisco Systems, Inc.</organization>
      <address>
        <postal>
          <street>U.S.A.</street>
        </postal>
        <email>jisu@cisco.com</email>
      </address>
    </author>   
    <date year="2026"/>
    <workgroup>MPLS Working Group</workgroup>
    <abstract>
      <t>
This document specifies the Post-Stack MPLS Network Action (MNA) Header encoding and procedures for carrying Network Action encodings and Ancillary Data after
the MPLS label stack, based on the MNA Sub-Stack including In-Stack Network Actions and Data specified in RFC 9994. MPLS Network Actions can be used to influence packet forwarding decisions, carry additional Operations, Administration, and Maintenance information in the MPLS packet, or perform user-defined operations. 
This document follows the framework specified in RFC 9789.
      </t>
      <t>
This document updates RFC 9994: the "Network Action Opcodes" registry fields, the Post-Stack MNA applicability of the opcodes, MNA scope, and Unknown action handling.
      </t>

    </abstract>
    </front>
    <middle>
      <section anchor="sect-1" numbered="true" toc="default">
    <name>Introduction</name>

<t>
    <xref target="RFC3032" format="default"/> defines the
    encoding of the MPLS label stack, the basic structure used
    to define a forwarding path. There are applications that 
    require MPLS packets to perform special network actions and
    carry optional Ancillary Data (AD) that can affect the
    packet forwarding decision or trigger Operations, Administration, and Maintenance (OAM)
    logging, as described in <xref target="RFC9791" format="default"/>.
    AD can be used to carry additional
    information for network slice purposes, as described in <xref target="RFC9791" format="default"/>.
</t>

<t>
    In some cases, more AD may be required
    than can be carried in the MPLS header, so these kinds of network
    actions and their AD are encoded after the Bottom of Stack (BoS).
    This network action with AD is called the Post-Stack (PS) MNA.
</t>

<t>
    The requirements for Post-Stack Network Actions and Post-Stack Data (PSD) 
    are described in <xref target="RFC9613" format="default"/>.
</t>

<t>
    This document specifies the Post-Stack MPLS Network Action (MNA) header encoding and 
    procedures for carrying Network Action encodings and AD after the MPLS label stack.
    The specification is based on the MNA Sub-Stack, including In-Stack Network Actions and 
    Data, specified in <xref target="RFC9994" format="default"/>. 
    This document follows the framework specified in <xref target="RFC9789" format="default"/>.
</t>

<t>
This document updates <xref target="RFC9994" format="default"/>: the "Network Action Opcodes" registry fields, the Post-Stack MNA applicability of the opcodes,
MNA scope, and Unknown action handling.
</t>

    </section>
    <section anchor="sect-2" numbered="true" toc="default">
      <name>Conventions Used in This Document</name>
      <section anchor="sect-2.1" 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 anchor="sect-2.2" numbered="true" toc="default">
      <name>Abbreviations</name>

      <t>
    The terminology defined in <xref target="RFC9613" format="default"/> is used in this document.
      </t> 

      <table anchor="abbreviations">
    <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>bSPL</td>
        <td>Base Special-Purpose Label</td>
        <td><xref target="RFC9017"/></td>
      </tr>
      <tr>
        <td>BIER</td>
        <td>Bit Index Explicit Replication</td>
        <td><xref target="RFC8296"/></td>
      </tr>
      <tr>
        <td>BoS</td>
        <td>Bottom of Stack</td>
        <td><xref target="RFC9789"/></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>IHS</td>
        <td>I2E, HbH, or Select</td>
        <td><xref target="RFC9994"/></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="RFC9789"/></td>
      </tr>
      <tr>
        <td>MNA</td>
        <td>MPLS Network Action</td>
        <td><xref target="RFC9789"/></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>PFN</td>
        <td>Post-Stack First Nibble</td>
        <td><xref target="RFC9790"/></td>
      </tr>

      <tr>
        <td>P bit</td>
        <td>Post-Stack MPLS Header Presence Bit</td>
        <td>This document</td>
      </tr>
      <tr>
        <td>PS</td>
        <td>Post-Stack</td>
        <td>This document</td>
      </tr>

      <tr>
        <td>PSD</td>
        <td>Post-Stack Data </td>
        <td>
          <xref target="RFC9613"/> and
          <xref target="RFC9789"/>
        </td>
      </tr>

       <tr>
        <td>PSMH</td>
        <td>Post-Stack MPLS Header</td>
        <td>This document</td>
      </tr>
      <tr>
        <td>PSNA</td>
        <td>Post-Stack Network Action</td>
        <td>This document</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>
    </tbody>
      </table>
    </section>


  </section>

  <section anchor="sect-3" numbered="true" toc="default">
    <name>Overview</name>

    <t>
      Two main parts are specified to support Post-Stack MNA:
    </t>
    <ul>
       <li>
          The Post-Stack MPLS Header (PSMH) Presence Bit Carried in In-Stack MNA Sub-Stack.
       </li>
       <li>
          The PSMH encoding that includes a Post-Stack MPLS Base Header and one or more Post-Stack Network Actions and their AD.
       </li>
    </ul>
    
      <t>
      Note that the PSMH can be encoded for use cases other than the PS MNA. However, this document only describes
      the procedure related to the Post-Stack MNA.
      </t>

    <section>
      <name>PSMH Presence Bit Carried in In-Stack Network Action Sub-Stack</name>
  
      <t>
    The bit at position 20 in LSE Format B, specified as
    the R (Reserved) bit in Section 4.2 of <xref target="RFC9994" format="default"/>,
    in the In-Stack Network Action Sub-Stack (NAS) is 
    defined as the P bit in this document to indicate the presence of
    the PSMH in the packet after the BoS.
      </t>

      <figure anchor="PSMH-Presence-Bit">
        <name>PSMH Presence Bit Carried in In-Stack MNA Sub-Stack</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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|  Opcode     |  13-bit Data (Format B) |P|IHS|S|  NASL |U| NAL |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
]]></artwork>
      </figure>

    <t>
    The following fields are carried in the Format B LSE in an NAS as defined in <xref target="RFC9994" format="default"/> and shown in Figure 1.
    </t>

      <ul>
          <li> 
        S (1 bit): The BoS <xref target="RFC3032" format="default"/>. 
          </li>

          <li> 
        NASL (4 bits): The Network Action Sub-Stack Length. 
          </li>

          <li> 
        NAL (3 bits): The Network Action Length. 
          </li>

          <li> 
        Opcode (7 bits): The Opcode encoded as defined in <xref target="RFC9994" format="default"/>.
          </li>

      <li> 
        Data (13 bits): The associated AD encoded as defined in <xref target="RFC9994" format="default"/>.
          </li>


      </ul>
    <t>
    This document updates <xref target="RFC9994" format="default"/> for the following fields carried in a Format B LSE in an NAS:
    </t>

      <ul>
          <li>
        IHS (2 bits): The scope of all the NAIs encoded in the NAS, as well as in the corresponding PSMH.
          </li>

          <li>
        U (1 bit): Indicates the combined Unknown Action Handling of the In-Stack and the Post-Stack Network Actions.
          </li>

      </ul>


    </section>

    <section>
      <name>PSMH Encoding</name>
      
      <t>
      The PSMH is encoded after the LSE for which the BoS bit is set, either immediately after the BoS (i.e., start offset of 0) or after any other Post-Stack headers that follow the BoS (i.e., a non-zero start offset), as described in Section 4.
      </t>

      <t>
      The PSMH consists of two main parts:
      </t>

      <ul>
          <li>
             Post-Stack MPLS Base Header
          </li>
          <li>
             Encoding for one or more Post-Stack Network Actions (PSNAs) and their AD
          </li>
      </ul>

     <section>
          <name>Post-Stack MPLS Base Header</name>

      <t>Post-Stack MPLS Base Header is defined as shown in Figure 2.
      </t>

      <figure anchor="Post-Stack-MPLS-Base-Header">
        <name>Post-Stack MPLS Base Header</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    |  Post-Stack MPLS Header Type  |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 
]]></artwork>
      </figure>

      <ul>

        <li> PFN (4 bits): The Post-Stack First Nibble (PFN) <xref target="RFC9790" format="default"/> identifies the start of the PSMH. 
        The PFN is set to 0x0 for the PSMH.
        </li>

        <li> Reserve (4 bits): Reserved bits. MUST be set to zero on transmission and ignored upon receipt.
        </li>

        <li> PSMH-Len (8 bits): The PSMH total length in 4-octet units. The length excludes the 4-octet Post-Stack MPLS Base Header.
        </li>

        <li> Type (16 bits): Post-Stack MPLS Header Type. See <xref target="IANATopHdrType"/>. 
        Note that other types of PSMHs can be defined in the future (besides the "MNA Post-Stack Header" defined in this document) and are outside the scope of this document.
        </li>

      </ul>


      <section>
          <name>Post-Stack MPLS Base Header for MNA</name>
      <t>
        For PS MNA, the Post-Stack MPLS Base Header shown in Figure 2 is added for each NAS in which the P bit is set.
        The Post-Stack MPLS Header Type is set to 1 for "MNA Post-Stack Header" and 
        the PSMH-Len includes the encoding of the Post-Stack Network Actions. 
      </t>

      <t>
        If a node does not recognize the Post-Stack MPLS Header Type, the packet is handled based on the setting of the U bit in the NAS. 
      </t>
      <t>
        PSMH-Len MUST be greater than 0, otherwise, the packet is recognized as malformed and MUST be dropped regardless of the setting of the U bit in the NAS.
      </t>
      <t>
        If a node encounters unexpected PFN in a PSMH, the packet is recognized as malformed and MUST be dropped regardless of the setting of the U bit in the NAS. 
      </t>

      </section>
      </section>

      <section>
          <name>Post-Stack Network Actions Encoding</name>
      <t>
   The format shown in Figure 3 encodes a single Post-Stack Network
   Action.  By repeating this format, multiple Post-Stack Network
   Actions and their corresponding AD can be encoded.
      </t>

      <figure anchor="Post-Stack-Network-Action-Encoding">
        <name>Post-Stack Network Action Encoding</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-PS-OP  |R|R|  PS-NAL     |       Post-Stack Data         |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
~                    Continued Post-Stack Data                  ~
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
]]></artwork>
      </figure>
      <ul>
         <li> MNA-PS-OP (7 bits): Post-Stack Network Action Opcode. 
         </li>

         <li> R (2 bits): Reserved bits.  MUST be set to zero on transmission and ignored upon receipt.
         </li>

         <li> PS-NAL (7 bits): Post-Stack Network Action Length in 4-octet units. This excludes the first 4 octets starting with MNA-PS-OP.
         </li>

         <li> Post-Stack Data (16 bits): PSD associated with the Post-Stack Network Action.
         </li>

         <li> Continued Post-Stack Data: Further PSD associated with
          the Post-Stack Network Action, as indicated by the value of
          the PS-NAL. The padding rules for PSD that do not fill
          a multiple of 4-octet units are described in the document that
          defines the Network Action, as indicated by the MNA-PS-OP value.
         </li> 

      </ul>

    <t>
    The sum of PS-NAL plus one for the 4-octet network action word for all network actions encoded in a PSMH MUST equal to the PSMH-Len.
    If not, the packet is recognized as malformed and MUST be dropped regardless of the setting of the U bit in the NAS.
    </t>

     <t>
     This document updates <xref target="RFC9994" format="default"/>: the "Network Action Opcodes" registry fields and the Post-Stack MNA applicability of the opcodes defined in <xref target="RFC9994" format="default"/> as follows.
     See <xref target="IANAFlags"/>.
    </t>

      <ul>
     <li>
         Value for MNA-PS-OP is assigned from the same registry shared by Post-Stack and In-Stack network action opcodes. 
     </li>

     <li>
         A document defining a new network action opcode MUST specify the applicability as "In-Stack", "Post-Stack" or "In-Stack and Post-Stack".
     </li>

     <li>
         The packets with opcode 127, defined in <xref target="RFC9994" format="default"/>, when carried in Post-Stack, MUST be dropped regardless of the setting of the U bit in the NAS.
     </li>

     <li>
         In case of opcode 1 for Flag-Based NAIs Without AD, defined in <xref target="RFC9994" format="default"/>, when carried in Post-Stack, the same bit position of the flags are mapped in ISD and PSD.
         </li>
      </ul>


      </section>

      <section>
          <name>Example Encoding of an MPLS Packet with PSMH</name>

      <figure anchor="Packet-With-Post-Stack-MPLS-Header">
        <name>Example Encoding of an MPLS Packet with 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
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ -
M |           MNA Label (value 4)         | TC  |0|    TTL        | N
P +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ A
L | Opcode=2    |    0                    |1|IHS|0| NASL=0|U|NAL=0| S
S +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ -
H ~                                             |0|               ~
D +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
R |                                             |1|               |
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ -
| |  0x0  |Reserve|   PSMH-Len    |  Type = MNA Post-Stack Header | B
P +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ -
S |  MNA-PS-OP  |R|R| PS-NAL      |       Post-Stack Data         | P
M +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ S
H ~                   Continued Post-Stack Data                   ~ N
| ~                                                               ~ A
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ -
  ~                                                               ~
  ~                           Payload                             ~
  ~                                                               ~
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
]]></artwork>
      </figure>


    <t> 
       An example encoding of an MPLS packet shown in Figure 4 consists of the following two main parts: 
    </t>

       <ul>
         <li> MPLS HDR: MPLS header includes an MPLS label stack and NAS. 
         </li>

         <li> PSMH: Post-Stack MPLS Header includes the Post-Stack MPLS Base Header and the Post-Stack Network Actions encoding. 
         </li>

      </ul>


    <t> 
       The MPLS header includes the following field:
    </t>

       <ul>

         <li> NAS: Network Action Sub-Stack. MNA Label set to 4 <xref target="RFC9994"/>.
         The P bit set to 1 to indicate the presence of the corresponding PSMH in the packet. An MPLS packet may carry more than one NAS, not shown in Figure 4.
         </li>

      </ul>


    <t> 
       The PSMH includes the following fields:
    </t>

       <ul>

         <li> B: The Post-Stack MPLS Base Header for the "MNA Post-Stack Header" type.
         </li>

         <li> PSNA: Post-Stack Network Actions encoding. Applicable to the "MNA Post-Stack Header" type. An MPLS packet may have more than one Post-Stack Network Action; this is not shown in Figure 4.
         </li>

      </ul>

      </section>

      </section>

    </section>

    <section anchor="SPL-OPCODES">
       <name>In-Stack Network Action Special Opcodes </name>

      <section anchor="SPL-OPCODES-PSD-OFFSET">
        <name>Opcode for PSMH Start Offset</name>
      
      <t>
      Opcode: TBA1
      </t>

      <t>
      Purpose: This opcode carries the start offset of the PSMH from the BoS.
      </t>

      <t>
      LSE Format: B or C (defined in <xref target="RFC9994" format="default"/>).
      </t>

      <t>
      Data: The data value of the LSE contains the offset from the BoS in 4-octet units. A data value
      of 1 indicates that the PSMH starts at 4 octets after the BoS.
      </t>

      <t>
      Scope: This opcode can be used with any scope.
      </t>

      <t>
      This opcode allows existing Post-Stack Headers <xref target="RFC9790"/>,
      such as the Pseudowire (PW) Control Word (0x0) <xref target="RFC4385" format="default"/>
      and Generic Associated Channel (G-ACh) (0x1) <xref target="RFC5586"/>, as well as any other PSH defined in the future,
      to be placed after the BoS and before the PSMH.
      </t>

      <t>
      A PSMH added in the packet follows the PSHs and MUST be added along with opcode TBA1 in the NAS that specify the offset of the PSMH.
      </t>

      <t>
      If the P bit is set in a given NAS and the PSMH Start Offset opcode is absent,
      the PSMH is encoded immediately after the BoS in the absence of other PSHs.      
      </t>

      <t>
      This opcode MUST be added in every NAS beyond the first NAS, when the P bit is set in the NAS, to carry the offset of the corresponding PSMH.
      </t>

      <t>
      This opcode can be placed in an NAS to process the Post-Stack Network Actions in a 
      certain order with respect to the other Opcodes in the NAS. 
      This opcode can be used with offset value 0 to influence the processing order in an NAS.
      </t>

      <t>
      The offset value is set to 0 when the PSMH starts immediately after the BoS.
      </t>

        </section>

      <section anchor="SPL-OPCODES-PSD-OFFSET-DEPTH">
        <name>Opcode for PSMH End Offset</name>
      
        <t>
      Opcode: TBA2
        </t>
        <t>
      Purpose: This opcode carries the offset of the end of the PSMH from the BoS.
        </t>
        <t>
      LSE Format: B or C (defined in <xref target="RFC9994" format="default"/>).
        </t>
        <t>
      Data: The data value of the LSE contains the offset from the
      BoS in 4-octet units. A data value
      of 5 indicates that the PSMH ends at 20 octets after the BoS.
        </t>
        <t>
      Scope: This opcode can be used with any scope.
        </t>

    <t>
    The offset of the end of the PSMH and the offset of the start of the PSMH allow the NAS parser implementation to know the size of the
    PSMH without having to parse the PSMH (e.g., for Readable Label Depth with PSMH checks).
    </t>
    <t>
    When the opcode TBA2 is added in an NAS, it MUST be added immediately after the PSMH Start Offset opcode (value TBA1) 
    when the opcode TBA1 is also present in the NAS.
    </t>

    <t>
    The offset value in opcode TBA2 MUST be greater than the offset value in opcode TBA1.
    Otherwise, the packet is recognized as malformed and MUST be dropped regardless of the setting of the U bit in the NAS. 
    </t>

    <t>
    This opcode is optional and can be placed anywhere in an NAS and does not affect the processing order of the network actions in the NAS and the corresponding PSMH.
    </t>
    
        </section>

    </section>

  <section anchor="sect-J12.12a" numbered="true" toc="default">
    <name>Procedure</name>

      <section anchor="Processing-P">
       <name>Processing Rules for P Bit </name>

<t>
The P bit MUST be set to 1 in an In-Stack Network Action Sub-Stack when the corresponding PSMH is added in the packet.
</t>

<t>
By default, the PSMH starts immediately after the BoS.
The offset of the PSMH that does not start immediately after the BoS is indicated using the PSMH Start Offset Opcode TBA1.
</t>

<t>
The P bit MUST be set to 1 when the network action with opcode TBA1 is added to the In-Stack Network Action Sub-Stack. The node that recognizes the network action with opcode TBA1 MUST process the packet according to the U flag if the P bit is not set.
</t>

<t>
The P bit MUST be set to 1 when the network action with opcode TBA2 is added to the In-Stack Network Action Sub-Stack. The node that recognizes the network action with opcode TBA2 MUST process the packet according to the U flag if the P bit is not set.
</t>

<t>
A node that supports the P bit processes the Post-Stack Network Actions in the PSMH as defined in this document. Conversely, a node that does not support the P bit skips processing the PSMH altogether.
</t>
      </section>

      <section anchor="Processing-Order">
       <name>Network Action Processing Order </name>

<t>
    The Post-Stack Network Actions are processed in the same order they are encoded after the BoS. 
    By default, they are processed after the In-Stack Network Actions in the Network Action Sub-Stack. 
</t>

     </section>

  <section anchor="Signaling" numbered="true" toc="default">
    <name>Node Capability Signaling</name>

    <ul>
    <li>
     Each participating transit and egress node MUST signal the Post-Stack Network Actions that it supports to the encapsulating node.
    </li>

    <li>
     Each participating transit and egress node MUST signal its "Readable Label Depth including PSMH" that can be used by the encapsulating node.
     Note that the "Readable Label Depth" defined in <xref target="RFC9994" format="default"/> is extended
     in this document to include the length of the PSMH.
    </li>

    </ul>

    <t>
      The above capability signaling will be added in appropriate protocols in the future. Signaling details are outside the scope of this document.
    </t>

  </section>


  <section anchor="BIER" numbered="true" toc="default">
      <name>Post-Stack MNA and BIER Header</name>

    <t>
    <xref target="RFC8296" format="default"/> specifies the Bit Index Explicit Replication (BIER) encapsulation for an MPLS network.
    The BIER header, defined in Section 2 of <xref target="RFC8296" format="default"/>, is used to 
    replicate and forward multicast packets to all their next hops by Bit-Forwarding Routers (BFRs).
    </t>

    <t>
    <xref target="RFC9994" format="default"/> does not specify an encoding format to carry a NAS along with the BIER header that is processed on a BFR.
    Since the PSMH uses the NAS defined in <xref target="RFC9994" format="default"/>, the processing of a PSMH on a BFR node is outside the scope of this document. 
    </t>

  </section>

  </section>

  <section anchor="sect-J12.1a" numbered="true" toc="default">
    <name>Processing the Network Action Sub-Stack and Post-Stack Header </name>

    <t>
    The processing of the Network Action Sub-Stack described in <xref target="RFC9994" format="default"/> also applies to the procedures defined in this document.
    This section defines the specific responsibilities for nodes along an MPLS path for processing a PSMH.
    </t>

    <section>
      <name> Encapsulating Node Responsibilities </name>

      <t>
    The encapsulating node MAY add a PSMH to the packet. The location of the header MAY be in accordance with local policy. The location may also be subject to any placement restrictions inherent in the implementation.
      </t>

      <t>
    The encapsulating node MUST NOT add a PSMH to the packet if the egress node does not support PSMH.
      </t>

   <t>
     The encapsulating node MUST ensure that the packet with all PSMHs added does not exceed the path MTU, as specified in Section 8 of <xref target="RFC9994" format="default"/>. 
   </t>

     <t>
    The encapsulating node MUST add the PSMH in the same order as the corresponding NAS in the MPLS header.
    </t>

    </section>

    <section>
      <name> Transit Node Responsibilities </name>

      <t>
   A transit node within the scope of the corresponding NAS MAY modify the Ancillary Data in the PSMH. Such modification MUST NOT change the length of the PSMH.
      </t>

      <t>
    A transit node MUST respect the Unknown Action Handling flag encoded in the corresponding NAS when processing the PSMH.
      </t>

      <t>
    A transit node that removes an NAS with the Select scope MUST also remove the associated PSMH. 
      </t>

    </section>

    <section>
      <name> Penultimate Node Responsibilities </name>
      <t>
    In addition to the transit node responsibilities above, the penultimate node MUST NOT remove a Hop-by-Hop (HbH) or Ingress to Egress (I2E) NAS <xref target="RFC9994" format="default"/> and the associated PSMH when the NAS is exposed after removing the forwarding (transport) label. This allows the egress node to receive and process the NAS and the associated PSMH.
      </t>
    </section>

    <section>
      <name> Egress Node Responsibilities </name>
      <t>
    The egress node MUST remove the PSMHs from the packet when it removes the NASes.
      </t>

    </section>

  </section>

  <section anchor="sect-J11" numbered="true" toc="default">
    <name>Security Considerations</name>

    <t>
    The security considerations in <xref target="RFC3032" format="default"/>, <xref target="RFC9789" format="default"/>, 
    and <xref target="RFC9994" format="default"/> also apply to this document.
    </t>

    <t>
    System designers must be aware that information included in Post-Stack AD may
    be transmitted "in the clear".  Network actions that require the
    exchange of sensitive data MUST be defined in such a way that the
    data is encrypted in transit.  Otherwise, sensitive data MUST NOT
    be transmitted using these mechanisms.
    </t>    

  </section>

  <section anchor="sect-J11b" numbered="true" toc="default">
      <name>Operational Considerations</name>

<t>
The operational considerations in <xref target="RFC9994" format="default"/> also apply to this document.
</t>

<t>
Performance and scale assessments are outside the scope of this document; the authors of any future PS MNA application documents are encouraged to address them.
</t>

<t>
The MPLS OAM packets, for example using G-ACh (with PFN 0x1) <xref target="RFC5586"/>, may be transmitted carrying MNA with PSMH
for performing network diagnostics. However, specification for this is outside the scope of this document.
</t>

<section anchor="sect-Manag-J11b" numbered="true" toc="default">
<name>Manageability Considerations</name>

<t>
A PS MNA implementation MAY collect the following counters:
</t>

<ul>
<li> Packets with PSMH received</li>
<li> Packets with PSMH dropped due to unknown actions </li>
<li> Packets with PSMH skipped due to unknown actions </li>
<li> Packets with PSMH dropped due to malformed PSMH </li>
<li> Per-Post-Stack Network Action counters </li>
</ul>

<t> Additionally, tracking both successful invocations and failures for each specific Post-Stack Network Action is
RECOMMENDED to provide granular visibility. Nodes MAY
generate rate-limited notifications or alarms for significant operational events, such as sustained high rates of PS MNA packet drops or frequent encounters of malformed PSMH, to alert operators to potential issues. Comprehensive logging of PS MNA processing details and outcomes can aid in network diagnostics and post-mortem analysis.
</t>

</section>

</section>

  <section anchor="sect-J13" numbered="true" toc="default">
    <name>IANA Considerations</name>

    <section anchor="sect-J13.6" numbered="true" toc="default">
      <name>First Nibble for Post-Stack MPLS Header</name>
     <t>
    This document requests that IANA add the following entry to the
    "Post-Stack First Nibble" registry created by 
    <xref target="RFC9790" format="default"/>.
     </t> 

      <table anchor="iana-nafif-tbl-5" align="center">
        <name>Post-Stack First Nibble Registry</name>
        <thead>
          <tr>
            <th align="left"> Protocol</th>
            <th align="left"> Value</th>
            <th align="left"> Description</th>
            <th align="left"> Reference</th>
          </tr>
        </thead>
        <tbody>
          <tr>
            <td align="left"> MPLS </td>
            <td align="left"> 0x0 </td>
            <td align="left"> Post-Stack MPLS Header</td>
            <td align="left"> This document</td>
          </tr>
        </tbody>
      </table>

    </section>

    <section anchor="IANATopHdrType" numbered="true" toc="default">
      <name>Post-Stack MPLS Header Types Registry</name>

     <t>
     This document requests that IANA create a new registry with
     the name "Post-Stack MPLS Header Types" within the "MPLS Network Actions" registry group. 
     The registration procedures for this registry are "IETF Review", "Experimental Use", and "Private Use". 
     The fields are "Type" (integer), "Description" (string), and "Reference" (string).  
     </t>

     <t>
     This registry is added under "MPLS Network Actions" because the container is defined by an MNA document.
     Note that adding this registry there makes it easy for discovering,
     but the Type space is not MNA-specific, the document itself anticipates
     non-MNA PSMH types whose codepoints would then be allocated from a registry
     added under MNA.
     </t>

      <t>
     The Registration Procedures for this registry are:
      </t>
      <table anchor="iana-top-hdr-type-tbl" align="center">
        <name> Registration Procedures for the Post-Stack MPLS Header Types Registry </name>
        <thead>
          <tr>
            <th align="left">Range</th>
            <th align="center">Registration Procedures</th>
          </tr>
        </thead>
        <tbody>
          <tr>
            <td align="left">1-65520</td>
            <td align="left">IETF Review</td>
          </tr>
          <tr>
            <td align="left">65521-65524</td>
            <td align="left">Experimental Use</td>
          </tr>
          <tr>
            <td align="left">65525-65535</td>
            <td align="left">Private Use</td>
          </tr>
        </tbody>
      </table>


      <t>
    The initial assignments for this registry are:
      </t>
      <table anchor="iana-top-hdr-type-tbl-assign" align="center">
        <name>Post-Stack MPLS Header Types</name>
        <thead>
          <tr>
            <th align="left">Type</th>
            <th align="center">Description</th>
            <th align="left">Reference</th>
          </tr>
        </thead>
        <tbody>

          <tr>
            <td align="left">0</td>
            <td align="left">Reserved</td>
            <td align="left">This document</td>
          </tr>
          <tr>
            <td align="left">1</td>
            <td align="left">MNA Post-Stack Header</td>
            <td align="left">This document</td>
          </tr>

        </tbody>
      </table>

    </section>
        <section anchor="IANAFlags" numbered="true" toc="default">
      <name>Network Action Opcodes </name>

      <t>
      IANA maintains the "Network Action Opcodes" registry that is created
      by <xref target="RFC9994" format="default"/>. IANA is requested to perform two actions
      for this registry:
      </t>

      <t>
       1. Assign two code points for network actions defined in this document.
      </t>
 
      <t>
      2. Add a new column for Applicability with values to indicate whether network action opcodes may be used as In-Stack only, Post-Stack only, or In-Stack and Post-Stack.
      By default, the unassigned values are applicable for In-Stack and Post-Stack network actions.
      </t>



      <t>
      This table to be updated for the RFC-ietf-mpls-mna-nrp-selector-07 for <xref target="I-D.ietf-mpls-mna-nrp-selector" format="default"/>.
      </t>

      <t>
      The resulting entries in the registry are as follows:
      </t>

      <table anchor="iana-nafif-tbl-2" align="center">
        <name>Network Action Opcodes</name>
        <thead>
          <tr>
            <th align="left"> Opcode</th>
            <th align="left"> Description</th>
            <th align="left"> Applicability</th>
            <th align="left"> Reference</th>
          </tr>
        </thead>

        <tbody>
          <tr>
            <td align="left">0 </td>
            <td align="left">Reserved</td>
            <td align="left">Not Applicable</td>
            <td align="left"><xref target="RFC9994" format="default"/></td>
          </tr>
        </tbody>

        <tbody>
          <tr>
            <td align="left">1</td>
            <td align="left">Flag-Based Network Action Indicators without AD</td>
            <td align="left">In-Stack Only</td>
            <td align="left"><xref target="RFC9994" format="default"/></td>
          </tr>
        </tbody>

        <tbody>
          <tr>
            <td align="left">2</td>
            <td align="left">No operation Opcode</td>
            <td align="left">In-Stack and Post-Stack</td>
            <td align="left"><xref target="RFC9994" format="default"/></td>
          </tr>
        </tbody>

          <tbody>
            <tr>
              <td align="left">3</td>
              <td align="left">13-bit NRP Selector</td>
              <td align="left">In-Stack Only</td>
              <td align="left"><xref target="I-D.ietf-mpls-mna-nrp-selector" format="default"/></td>
            </tr>
          </tbody>

          <tbody>
            <tr>
              <td align="left">4</td>
              <td align="left">20-bit NRP Selector</td>
              <td align="left">In-Stack Only</td>
              <td align="left"><xref target="I-D.ietf-mpls-mna-nrp-selector" format="default"/></td>
            </tr>
          </tbody>

          <tbody>
            <tr>
              <td align="left">5</td>
              <td align="left">20-bit Entropy and NRP Selector</td>
              <td align="left">In-Stack Only</td>
              <td align="left"><xref target="I-D.ietf-mpls-mna-nrp-selector" format="default"/></td>
            </tr>
          </tbody>

          <tbody>
            <tr>
              <td align="left">6-110</td>
              <td align="left">Unassigned</td>
              <td align="left">In-Stack and Post-Stack</td>
              <td align="left"> </td>
            </tr>
          </tbody>

          <tbody>
            <tr>
              <td align="left">111-114</td>
              <td align="left">Reserved for Experimental Use</td>
              <td align="left">In-Stack and Post-Stack</td>
              <td align="left"><xref target="RFC9994" format="default"/></td>
            </tr>
          </tbody>

          <tbody>
            <tr>
              <td align="left">115-126</td>
              <td align="left">Reserved for Private Use</td>
              <td align="left">In-Stack and Post-Stack</td>
              <td align="left"><xref target="RFC9994" format="default"/></td>
            </tr>
          </tbody>

        <tbody>
          <tr>
            <td align="left">TBA1 </td>
            <td align="left">Post-Stack MPLS Header Start Offset</td>
            <td align="left">In-Stack Only</td>
            <td align="left">This document</td>
          </tr>
        </tbody>

        <tbody>
          <tr>
            <td align="left">TBA2 </td>
            <td align="left">Post-Stack MPLS Header End Offset</td>
            <td align="left">In-Stack Only</td>
            <td align="left">This document</td>
          </tr>
        </tbody>

       <tbody>
          <tr>
            <td align="left">127 </td>
            <td align="left">Opcode Range Extension Beyond 127</td>
            <td align="left">In-Stack and Post-Stack</td>
            <td align="left"><xref target="RFC9994" format="default"/></td>
          </tr>
       </tbody>

      </table>

    </section>

  </section>


 </middle>
  <back>



    <references>
      <name>References</name>
      <references>
        <name>Normative References</name>
    &RFC9994;
    &RFC2119;
    &RFC3032;
    &RFC5462;
    &RFC8174;
    &RFC9017;
    &RFC9789;
    &RFC9790;
      </references>
      <references>
    <name>Informative References</name>
    <xi:include href="https://datatracker.ietf.org/doc/bibxml3/draft-ietf-mpls-mna-nrp-selector.xml"/>
    &RFC4385;
    &RFC5586;
    &RFC6291;
    &RFC8296;
    &RFC9613;
    &RFC9791; 
      </references>
    </references>

      <section anchor="sect-J14" numbered="true" toc="default">
    <name> Examples</name>

    <section anchor="sect-J6" numbered="true" toc="default">
      <name>Examples of PSMH Encoding</name>

    <section anchor="sect-J6.1a" numbered="true" toc="default">
      <name> NAS that only indicates PSMH</name>

      <figure anchor="Header-Carrying-only-PSD">
        <name>NAS that only indicates 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  |0|    TTL        |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|   Opcode=2  |    0                    |1|IHS|0| NASL=0|U|NAL=0|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
~                                             |0|               ~
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                             |1|               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|  0x0  |Reserve|   PSMH-Len=1  |  Type = MNA Post-Stack Header |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|  MNA-PS-OP  |R|R|  PS-NAL=0   |       Post-Stack Data         |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
~                                                               ~
~                           Payload                             ~
~                                                               ~
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
        ]]></artwork>  
      </figure>

      <t>
      In this example, as shown in Figure 5, the NAS may encode only the presence of PSMH. The PSMH starts immediately after the BoS.
      </t>

    </section>

   <section anchor="sect-J6.1aa" numbered="true" toc="default">
      <name> NAS that Indicates PSMH Start Offset</name>

      <figure anchor="Header-Carrying-only-PSD-Offset">
        <name>NAS that Indicates PSMH Start Offset </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=TBA1 |  Post-Stack Offset = 2  |1|IHS|0| NASL=0|U|NAL=0|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
~                                             |0|               ~
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                             |1|               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 
|                                                               |
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 
|  0x0  |Reserve|   PSMH-Len=1  |  Type = MNA Post-Stack Header |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 
|  MNA-PS-OP  |R|R|  PS-NAL=0   |       Post-Stack Data         |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+                                                       
~                                                               ~
~                           Payload                             ~
~                                                               ~
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
        ]]></artwork>  
      </figure>

    <t>
    The NAS may encode the start offset of the PSMH with a non-zero value, for example, when it is after another header such as G-ACh or Control Word header. 
    In this example, as shown in Figure 6, the PSMH starts at an offset of 8 octets after the BoS.
    </t>

    </section>


        <section anchor="sect-J7.1" numbered="true" toc="default">
        <name>Post-Stack Network Actions with Two Opcodes </name>

        <figure anchor="In-Stack-Ext-Hdr-1-a">
          <name>Post-Stack Network Actions with Two Opcodes</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=2=NoOp|    0                    |1|IHS|1| NASL=0|U|NAL=0|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 
|  0x0  |Reserve|   PSMH-Len=3  |  Type = MNA Post-Stack Header |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 
|  MNA-PS-OP=8|R|R|  PS-NAL=0   |       Post-Stack Data         |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+  
|  MNA-PS-OP=9|R|R|  PS-NAL=1   |       Post-Stack Data         |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+  
|                       Post-Stack Data                         |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
|                     Optional Payload + Padding                |
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
          ]]></artwork>
        </figure>
 
    <t>
    In this example, as shown in Figure 7, the PSMH encodes two different Post-Stack Network Actions.
    </t>
      
        <t>
      Details:
    </t>
        <ul empty="true" spacing="normal">
          <li> PSMH-Len=3: This is the length of PSMH contents after the Post-Stack MPLS Base Header. </li>
          <li> MNA-PS-OP=8: Post-Stack Network Action Opcode 8.
           A network action allocation is outside of this document.  </li>
          <li> PS-NAL=0: Post-Stack Network Action does not contain any additional data. </li>
          <li> MNA-PS-OP=9: Post-Stack Network Action Opcode 9.
           A network action allocation is outside of this document.  </li>
          <li> PS-NAL=1: Post-Stack Network Action contains one additional 4-octet AD. </li>
      </ul>
  
  </section>

       <section anchor="sect-J7.2" numbered="true" toc="default">
        <name>Post-Stack Network Actions with Two Different Scopes </name>

        <figure anchor="In-Stack-Ext-Hdr-1-b">
          <name>Post-Stack Network Actions with Two Different Scopes</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=2=NoOp|    0                    |1|HbH|0| NASL=0|U|NAL=0|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 
|          MNA Label (value 4)          | TC  |0|    TTL        |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Opcode=TBA1 |  Post-Stack Offset = 2  |1|I2E|1| NASL=0|U|NAL=0|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 
|  0x0  |Reserve|   PSMH-Len=1  |  Type = MNA Post-Stack Header |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+  
|  MNA-PS-OP=8|R|R|  PS-NAL=0   |       Post-Stack Data         |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|  0x0  |Reserve|   PSMH-Len=2  |  Type = MNA Post-Stack Header |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 
|  MNA-PS-OP=9|R|R|  PS-NAL=1   |       Post-Stack Data         |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                      Post-Stack Data                          |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
|                     Optional Payload + Padding                |
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
          ]]></artwork>
        </figure>
 
        <t>
 In this example, as shown in Figure 8, the PSMH encodes two Post-Stack Network Actions with different scopes. The first scope is HbH, and the second scope is I2E.
    </t>
      
     <t>
      Details:
    </t>
        <ul empty="true" spacing="normal">
          <li> The offset of the HbH-scoped Post-Stack Network Action is 0.</li>

          <li> PSMH-Len=1: This is the length of PSMH contents after the first Post-Stack MPLS Base Header. </li>
          <li> MNA-PS-OP=8: Post-Stack Network Action Opcode 8.
           A network action allocation is outside of this document.  </li>
          <li> PS-NAL=0: Post-Stack Network Action does not contain any additional data. </li>
          <li> Opcode TBA1 carries the offset of the I2E-scoped Post-Stack Network Action. The data is 2, i.e., the PSMH starts 8 octets after the BoS.</li>
          <li> PSMH-Len=2: This is the length of PSMH contents after the second Post-Stack MPLS Base Header. </li>
          <li> MNA-PS-OP=9: Post-Stack Network Action Opcode 9. 
           A network action allocation is outside of this document.  </li>
          <li> PS-NAL=1: Post-Stack Network Action contains one additional 4-octet AD. </li>
      </ul>
  
  </section>
  </section>

     <section anchor="sect-J6.1bb" numbered="true" toc="default">
      <name> Examples of In-Stack and Post-Stack Network Actions </name>

     <section anchor="sect-J6.1b" numbered="true" toc="default">
      <name> NAS with In-Stack and Post-Stack Network Actions </name>

      <figure anchor="Header-Carrying-ISD-PSD">
        <name>NAS with In-Stack and Post-Stack Network Actions</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=1    |   Flag-Based NAIs       |1|IHS|0| NASL=0|U|NAL=0|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
~                                             |0|               ~
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                             |1|               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|  0x0  |Reserve|   PSMH-Len=1  |  Type = MNA Post-Stack Header |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 
|  MNA-PS-OP=8|R|R|  PS-NAL=0   |       Post-Stack Data         |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 
~                                                               ~
~                           Payload                             ~
~                                                               ~
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
        ]]></artwork>  
      </figure>

      <t>
In this example, as shown in Figure 9, the NAS may encode In-Stack Network Actions and indicate the presence of a PSMH. 
The IHS field indicates the scope of both the In-Stack and Post-Stack Network Actions.
      </t>

    <t>
      Details:
    </t>
        <ul empty="true" spacing="normal">
          <li> PSMH-Len=1: This is the length of PSMH contents after the first Post-Stack MPLS Base Header. </li>
          <li> MNA-PS-OP=8: Post-Stack Network Action Opcode 8.
           A network action allocation is outside of this document.  </li>
          <li> PS-NAL=0: Post-Stack Network Action does not contain any additional data. </li>
      </ul>


    </section>

    <section anchor="sect-J6.1c" numbered="true" toc="default">
      <name> NASes with Different In-Stack and Post-Stack Scopes</name>

      <figure anchor="Header-Carrying-ISD-PSD-Diff-Scope">
        <name>NASes with Different In-Stack and Post-Stack Scopes</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=1    |   Flag-Based NAIs       |0|HbH|0| NASL=0|U|NAL=0|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 
|          MNA Label (value 4)          | TC  |0|    TTL        |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|Opcode=2=NoOp|    0                    |1|I2E|1| NASL=0|U|NAL=0|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|  0x0  |Reserve|   PSMH-Len=1  | Type = MNA Post-Stack Header  |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 
|  MNA-PS-OP=8|R|R|  PS-NAL=0   |       Post-Stack Data         |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 
~                                                               ~
~                           Payload                             ~
~                                                               ~
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
        ]]></artwork>  
      </figure>

      <t>
    In this example, as shown in Figure 10, the label stack may carry In-Stack Network Actions
    with HbH scope and Post-Stack Network Actions with I2E scope.
    In this case, there will be two NASes in the label stack. The first NAS will encode the In-Stack Network Action with the
    HbH scope and the second NAS will encode the presence
    of an I2E-scoped Post-Stack Network Action.
      </t>

      
    <t>
      Details:
    </t>
        <ul empty="true" spacing="normal">
          <li> PSMH-Len=1: This is the length of PSMH contents after the first Post-Stack MPLS Base Header. </li>
          <li> MNA-PS-OP=8: Post-Stack Network Action Opcode 8.
           A network action allocation is outside of this document.  </li>
          <li> PS-NAL=0: Post-Stack Network Action does not contain any additional data. </li>
        </ul>

    </section>

    <section anchor="sect-J6.1d" numbered="true" toc="default">
      <name> NAS with a BIER Header</name>

      <figure anchor="Header-Carrying-ISD-PSD-BIER">
        <name>NAS with a BIER Header</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        | N
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ A
| Opcode=TBA1 |Post-Stack Offset = 2+N  |1|I2E|0| NASL=0|U|NAL=0| S
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ -
|              BIFT-id (20 bits)        | TC  |1|    TTL        | |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ B
| 0101b | Ver=0 |  BSL  |            Entropy                    | I
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ E
|OAM|Rsv|    DSCP   |   Proto   |    BFIR-id                    | R
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ H
|                                                               | D
~                        BitString (N*4 octets)                 ~ R
|                                                               | |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ -
|  0x0  |Reserve|   PSMH-Len=1  | Type = MNA Post-Stack Header  | P
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ S
|  MNA-PS-OP  |R|R|  PS-NAL=0   |       Post-Stack Data         | MH
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ -
~                                                               ~ 
~                           Payload                             ~
~                                                               ~
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
        ]]></artwork>  
      </figure>

    <t>
    In this example, as shown in Figure 11, 
    a multicast packet with a BIER header, defined in Section 2 of <xref target="RFC8296" format="default"/>, 
    carries an MPLS encapsulation that is processed by non-BFR nodes.
    A NAS is carried before the BIER header in the MPLS label stack and the associated PSMH is carried below the BIER header.
    </t>
    <t>
    The PSMH start offset is the length of the BIER header that follows the BoS, in 4-octet units: two 4-octet words 
    plus the BitString (N words), i.e., (2+N)*4 octets in Figure 11.  The first four octets of the BIER header are the BoS LSE itself and are not counted for the offset.
    </t>

    </section>

  </section>
  
 </section>

    <section numbered="false" anchor="acknowledgments" toc="default">
      <name>Acknowledgments</name>
      <t>
      The authors would like to thank the authors and contributors of RFC 9994,
      as this document borrows some text from an earlier version of that document.
      The authors would like to thank Greg Mirsky, Loa Andersson, Haoyu Song, Adrian Farrel, Yao Liu, 
      and Joel Halpern for reviewing this document and providing many useful comments.
      The authors also thank Chongfeng Xie for the OpsDir review and Tony Przygienda for the RtgDir review, which helped improve this document.
      Thank you Ketan Talaulikar for the IESG review and providing many useful comments to 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[
John Drake 
Juniper Networks 
United States 
Email: je_drake@yahoo.com
    ]]></artwork>

    </section>

  </back>
</rfc>
