<?xml version='1.0' encoding='utf-8'?>

<!DOCTYPE rfc [
  <!ENTITY nbsp    "&#160;">
  <!ENTITY zwsp   "&#8203;">
  <!ENTITY nbhy   "&#8209;">
  <!ENTITY wj     "&#8288;">
]>


<rfc xmlns:xi="http://www.w3.org/2001/XInclude" ipr="trust200902" docName="draft-ietf-mpls-mna-fwk-15" number="9789" consensus="true" category="info" submissionType="IETF" version="3" updates="" obsoletes="" xml:lang="en" sortRefs="true" symRefs="true" tocInclude="true">

  <front>
    <title abbrev="MNA Framework">MPLS Network Actions (MNAs) Framework</title>
    <seriesInfo name="RFC" value="9789"/>
    <author initials="L." surname="Andersson" fullname="Loa Andersson">
      <organization>Huawei Technologies</organization>
      <address>
        <email>loa@pi.nu</email>
      </address>
    </author>
    <author initials="S." surname="Bryant" fullname="Stewart Bryant">
      <organization>University of Surrey 5GIC</organization>
      <address>
        <email>sb@stewartbryant.com</email>
      </address>
    </author>
    <author initials="M." surname="Bocci" fullname="Matthew Bocci">
      <organization>Nokia</organization>
      <address>
        <email>matthew.bocci@nokia.com</email>
      </address>
    </author>
    <author initials="T." surname="Li" fullname="Tony Li">
      <organization>Juniper Networks</organization>
      <address>
        <email>tony.li@tony.li</email>
      </address>
    </author>
    <date year="2025" month="July"/>
    <area>RTG</area>
    <workgroup>mpls</workgroup>

    <abstract>
      <t>This document describes an architectural framework for MPLS
      Network Action (MNA) technologies.  MNA technologies are used to
      indicate actions that impact the forwarding or other processing (such as
      monitoring) of the packet along the Label Switched Path (LSP) of the
      packet and to transfer any additional data needed for these actions.</t>
      <t>This document provides the foundation for the development of a common
      set of network actions and information elements supporting additional
      operational models and capabilities of MPLS networks.</t>
    </abstract>
  </front>
  <middle>
    <section anchor="introduction">
      <name>Introduction</name>
      <t>This document describes an architectural framework for MPLS
Network Action (MNA) technologies.  MNA technologies are used to
indicate actions for Label Switched Paths (LSPs) and/or MPLS packets
and to transfer data needed for these actions.</t>
      <t>This document provides the foundation for the development of a common
set of network actions and information elements supporting additional
operational models and capabilities of MPLS networks.  MNA solutions
derived from this framework are intended to address the requirements
found in <xref target="RFC9613"/>. In addition, MNA may
support actions that overlap existing MPLS functionality. This may be
beneficial for numerous reasons, such as making it more efficient to
combine existing functionality and new functions in the same MPLS
packet.</t>

<t>MPLS forwarding actions are instructions to MPLS routers to apply
additional actions when forwarding a packet. These might include
load-balancing a packet given its entropy, indicating whether or not
to perform Fast Reroute on a failure, and indicating whether or not a packet has metadata
relevant to the forwarding actions along the path.</t>
      <t>This document generalizes the concept of MPLS "forwarding actions" to
"network actions" that include any action that an MPLS router is
requested to take on the packet. Network actions include any MPLS forwarding
actions but may also include other operations (such as security functions,
Operations, Administration, and Maintenance (OAM) procedures, etc.) that are not directly related to forwarding of
the packet. MPLS network actions are always triggered by an MNA
packet but may have implications for subsequent traffic, including
non-MNA packets, as discussed in <xref target="State"/>.</t>
      <t>MNA technologies may redefine the semantics of the Label, Traffic
Class (TC), and Time to Live (TTL) fields in an MPLS Label Stack Entry
(LSE) within a Network Action Sub-Stack (NAS).</t>
      <section anchor="REQ-lang">
        <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&nbsp;14 <xref target="RFC2119"/> <xref
    target="RFC8174"/> when, and only when, they appear in all capitals, as
    shown here.
        </t>

        <t>Although this is an Informational document, these conventions are
applied to achieve clarity in the requirements that are presented.</t>
      </section>

        <section anchor="normative-definitions">
          <name>Normative Definitions</name>
          <t>This document adopts the definitions of the following terms and
abbreviations from <xref target="RFC9613"/> as
normative: "Network Action", "Network Action Indicator (NAI)",
"Ancillary Data (AD)", and "Scope".</t>
          <t>In addition, this document defines the following terms:</t>
          <dl spacing="normal" newline="false">
            <dt>Network Action Sub-Stack (NAS):</dt><dd>A set of related,
            contiguous LSEs in the MPLS label stack for carrying information
            related to network actions. The Label, TC, and TTL values in the
            LSEs in the NAS may be redefined, but the meaning of the S bit is
            unchanged.</dd>
            <dt>Network Action Sub-Stack Indicator (NSI):</dt><dd>The first LSE in the NAS, which
    contains a special-purpose label that indicates the start of the NAS.</dd>
          </dl>
        </section>
        <section anchor="abbreviations">
          <name>Abbreviations</name>
          <table anchor="Tab-apprev">
            <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 align="left">AD</td>
                <td align="left">Ancillary Data</td>
                <td align="left">
                  <xref target="RFC9613"/></td>
              </tr>
              <tr>
                <td align="left">BIER</td>
                <td align="left">Bit Index Explicit Replication</td>
                <td align="left">
                  <xref target="RFC8279"/></td>
              </tr>
              <tr>
                <td align="left">BoS</td>
                <td align="left">Bottom of Stack</td>
                <td align="left">
                  <xref target="RFC6790"/></td>
              </tr>
              <tr>
                <td align="left">bSPL</td>
                <td align="left">Base Special-Purpose Label</td>
                <td align="left">
                  <xref target="RFC9017"/></td>
              </tr>
              <tr>
                <td align="left">ECMP</td>
                <td align="left">Equal-Cost Multipath</td>
                <td align="left">
                  <xref target="RFC9522"/></td>
              </tr>
              <tr>
                <td align="left">EL</td>
                <td align="left">Entropy Label</td>
                <td align="left">
                  <xref target="RFC6790"/></td>
              </tr>
              <tr>
                <td align="left">ERLD</td>
                <td align="left">Entropy Readable Label Depth</td>
                <td align="left">
                  <xref target="RFC8662"/></td>
              </tr>
              <tr>
                <td align="left">eSPL</td>
                <td align="left">Extended Special-Purpose Label</td>
                <td align="left">
                  <xref target="RFC9017"/></td>
              </tr>
              <tr>
                <td align="left">HbH</td>
                <td align="left">Hop by Hop</td>
                <td align="left">In the MNA context, this document.</td>
              </tr>
              <tr>
                <td align="left">I2E</td>
                <td align="left">Ingress to Egress</td>
                <td align="left">In the MNA context, this document.</td>
              </tr>
              <tr>
                <td align="left">IGP</td>
                <td align="left">Interior Gateway Protocol</td>
                <td align="left"></td>
              </tr>
              <tr>
                <td align="left">ISD</td>
                <td align="left">In-Stack Data</td>
                <td align="left">
                  <xref target="RFC9613"/></td>
              </tr>
              <tr>
                <td align="left">LSE</td>
                <td align="left">Label Stack Entry</td>
                <td align="left">
                  <xref target="RFC3032"/></td>
              </tr>
              <tr>
                <td align="left">LSP</td>
                <td align="left">Label Switched Path</td>
                <td align="left">
                </td>
              </tr>
              <tr>
                <td align="left">MNA</td>
                <td align="left">MPLS Network Action</td>
                <td align="left">
                  <xref target="RFC9613"/></td>
              </tr>
              <tr>
                <td align="left">MSD</td>
                <td align="left">Maximum SID Depth</td>
                <td align="left">
                  <xref target="RFC8491"/></td>
              </tr>
              <tr>
                <td align="left">NAI</td>
                <td align="left">Network Action Indicator</td>
                <td align="left">
                  <xref target="RFC9613"/></td>
              </tr>
              <tr>
                <td align="left">NAS</td>
                <td align="left">Network Action Sub-Stack</td>
                <td align="left">This document</td>
              </tr>
              <tr>
                <td align="left">NSI</td>
                <td align="left">Network Action Sub-Stack Indicator</td>
                <td align="left">This document</td>
              </tr>
              <tr>
                <td align="left">PSD</td>
                <td align="left">Post-Stack Data</td>
                <td align="left">
                  <xref target="RFC9613"/> and <xref target="PSD"/> of this document</td>
              </tr>
              <tr>
                <td align="left">RLD</td>
                <td align="left">Readable Label Depth</td>
                <td align="left">This document</td>
              </tr>
              <tr>
                <td align="left">SID</td>
                <td align="left">Segment Identifier</td>
                <td align="left">
                  <xref target="RFC8402"/></td>
              </tr>
              <tr>
                <td align="left">SPL</td>
                <td align="left">Special-Purpose Label</td>
                <td align="left">
                  <xref target="RFC9017"/></td>
              </tr>
              <tr>
                <td align="left">TC</td>
                <td align="left">Traffic Class</td>
                <td align="left">
                </td>
              </tr>
              <tr>
                <td align="left">TTL</td>
                <td align="left">Time to Live</td>
                <td align="left">
                </td>
              </tr>
            </tbody>
          </table>
        </section>
      </section>

    <section anchor="structure">
      <name>Structure</name>

      <t>An MNA solution specifies one or more network actions to apply to an
MPLS packet.  These network actions and their ancillary data may be carried in
sub-stacks within the MPLS label stack and/or post-stack
data.  A solution must specify where the network
action sub-stacks occur in the label stack, if and how frequently they should be
replicated within the label stack, and how the network action
sub-stack and post-stack data are encoded.</t>
      <t>It seems highly likely that some ancillary data will be needed at many
points along an LSP.  Replication of ancillary data throughout the
label stack would be highly inefficient, as would a full rewrite of
the label stack at each hop; thus, MNA allows encoding of network actions
and ancillary data deeper in the label stack, requiring
implementations to look past the first LSE.  Processing of the label
stack past the top-of-stack LSE was first introduced with the Entropy
Label (EL) <xref target="RFC6790"/>.</t>
      <t>A network action sub-stack contains:</t>
      <ul spacing="normal">
        <li>
          <t>Network Action Sub-Stack Indicator (NSI): The first LSE in the NAS, which
contains a special-purpose label, called the MNA label, that
is used to indicate the start of a network action sub-stack.</t>
        </li>
        <li>
          <t>Network Action Indicators (NAIs): Optionally, a set of indicators that
describes the set of network actions. If the set of indicators is not
in the sub-stack, a solution could encode them in post-stack data. A
network action is said to be present if there is an indicator in the
packet that invokes the action.</t>
        </li>
        <li>

          <t>In-Stack Data (ISD): A set of zero or more LSEs that carry ancillary data
for the network actions that are present. Network action indicators
are not considered ancillary data.</t>
        </li>
      </ul>
      <t>Each network action present in the network action sub-stack may have
zero or more LSEs of in-stack data. The ordering of the in-stack data
LSEs corresponds to the ordering of the network action indicators. The
encoding of the in-stack data, if any, for a network action must be
specified in the document that defines the network action. In-stack
data may be referenced by multiple network actions.</t>
      <t>As an example, in-stack data might look like the following label stack with an
embedded NAS:</t>

<figure>
  <name>A Label Stack with an Embedded Network Action Sub-Stack</name>
      <artwork><![CDATA[
    0                   1                   2                   3
    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |               Label                   | TC  |0|      TTL      |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |               Label                   | TC  |0|      TTL      |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |               Label                   | TC  |0|      TTL      |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |                Network Action Sub-Stack     |0|               |
   ~                                                               ~
   |         Network Action Sub-Stack continued  |0|               |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |               Label                   | TC  |0|      TTL      |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |               Label                   | TC  |1|      TTL      |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |                           Payload                             |
]]></artwork>
</figure>
      <t>Certain network actions may also specify that data is carried after
the label stack. This is called post-stack data. The encoding of the
post-stack data, if any, for a network action must be specified in the
document that defines the network action.  If multiple network actions
are present and have post-stack data, the ordering of their post-stack
data corresponds to the ordering of the network action indicators.</t>

<t>As an example, a packet containing post-stack data might contain a label stack followed by post-stack data, followed by the payload:</t>

<figure>
  <name>A Label Stack Followed by Post-Stack Data</name>
      <artwork><![CDATA[
    0                   1                   2                   3
    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |               Label                   | TC  |0|      TTL      |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |               Label                   | TC  |1|      TTL      |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |                       Post-Stack Data                         |
   ~                                                               ~
   |                  Post-Stack Data continued                    |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |                           Payload                             |
]]></artwork>
</figure>
      <t>A solution must specify the order for network actions to be
applied to the packet for the actions to have consistent
semantics. Since there are many possible orderings, especially with
bit catalogs (<xref target="Catalogs"/>), the solution must provide an unambiguous
specification. The precise semantics of an action are dependent on the
contents of the packet, including any ancillary data, and the state of
the router.</t>

<t>This document assumes that the MPLS WG will select a single
solution for the encoding of ISD and not more than one solution for
the encoding of PSD.</t>
      <section anchor="scopes">
        <name>Scopes</name>
        <t>A network action may need to be processed by every node along the
path or some subset of the nodes along its path. Some of the scopes
that an action may have are:</t>
        <ul spacing="normal">
          <li>
            <t>Hop by Hop (HbH): Every node along the path will perform the action.</t>
          </li>
          <li>
            <t>Ingress to Egress (I2E): Only the last node on the path will perform
the action.</t>
          </li>
          <li>
            <t>Select: Only specific nodes along the path will perform the action.</t>
          </li>
        </ul>
        <t>If a solution supports the select scope, it must describe how it
specifies the set of nodes to perform the actions.</t>


<t>This framework does not place any constraints on the scope of, or the
ancillary data for, a network action.  Any network action may appear
in any scope or combination of scopes, may have no ancillary data, and
may require in-stack data and/or post-stack data.  Some combinations
may be suboptimal, but this framework does not restrict the combinations
in an MNA solution.  A specific MNA solution may define such
constraints.</t>
      </section>
      <section anchor="partial-processing">
        <name>Partial Processing</name>
        <t>As described in <xref target="RFC3031"/>, legacy devices that do not recognize the
MNA label will discard the packet if the top label is the MNA label.</t>
        <t>Devices that do recognize the MNA label might not implement all of the
network actions that are present. A solution must specify how
unrecognized network actions that are present should be handled.</t>
        <t>One alternative is that an implementation should stop processing
network actions when it encounters an unrecognized network
action. Subsequent present network actions would not be
applied. The result is dependent on the solution's order of
operations.</t>
        <t>Another alternative is that an implementation should drop any packet
that contains any unrecognized present network actions.</t>
        <t>A third alternative is that an implementation should perform all
recognized present network actions but ignore all unrecognized
present network actions.</t>
        <t>Other alternatives may also be possible. The solution should specify the
alternative adopted.</t>
        <t>In some solutions, an indication may be provided in the packet or in
the action as to how the forwarder should proceed if it does not
recognize the action. Where an action needs to be processed at every hop,
it is recommended that care be taken not to construct an LSP that
traverses nodes that do not support that action. It is recognized that,
in some circumstances, it may not be possible to construct an LSP that
avoids such nodes, such as when a network is reconverging
following a failure or when IP Fast Reroute (IPFRR) <xref target="RFC5714"/> is taking place.</t>
      </section>
      <section anchor="signaling">
        <name>Signaling</name>

	<t>A node that wishes to make use of MNA and apply network actions to a
packet must understand the nodes that the packet will transit, whether
or not the nodes support MNA, and the network actions that are to be
invoked. These capabilities are presumed to be signaled by protocols
that are out of scope for this document and are presumed to have
per-network-action granularity. If a solution requires alternate
signaling, it must specify that explicitly.</t>
        <section anchor="readable-label-depth">
          <name>Readable Label Depth</name>
          <t>Readable Label Depth (RLD) is defined as the number of LSEs, starting
from the top of the stack, that a router can read in an incoming MPLS
packet with no performance impact.  <xref target="RFC8662"/> introduced Entropy
Readable Label Depth (ERLD). Readable Label Depth is the same concept,
but it is generalized and not specifically associated with the Entropy Label
(EL) or MNA.</t>
          <t>ERLD is not redundant with RLD because ERLD 
specifies a value of zero if a system does not support the Entropy
Label. Since a system could reasonably support MNA or other MPLS
functions and needs to advertise an RLD value but not support the
Entropy Label, another advertised value is required.</t>

<t>A node that pushes a NAS onto the label stack is responsible for
ensuring that all nodes that are expected to process the NAS will have
the entire NAS within their RLD. A node <bcp14>SHOULD</bcp14> use signaling (e.g., the signaling described in
<xref target="RFC9088"/> and <xref target="RFC9089"/>) to determine this.  An exception might be,
for example, when the node has out-of-band knowledge that all nodes
along the path do not have RLD limitations and thus could avoid the
unnecessary overhead of using signaling.</t>
          <t>Per <xref target="RFC8662"/>, a node that does not support EL will advertise a
value of zero for its ERLD, so advertising ERLD alone does not suffice
in all cases. A node <bcp14>MAY</bcp14> advertise both ERLD and RLD, and it <bcp14>SHOULD</bcp14> do so
if its ERLD and RLD values are different. Again, if a node has
out-of-band knowledge that all nodes do not have RLD limitations, then
signaling can be avoided. If a node's ERLD and RLD values are the
same, it <bcp14>MAY</bcp14> only advertise ERLD for efficiency reasons. If a node
supports MNA but does not support EL, then it <bcp14>SHOULD</bcp14> advertise RLD
unless it has out-of-band knowledge that no nodes in the domain have
RLD restrictions.</t>
          <t>RLD is advertised by an IGP MSD-Type value of 3 and <bcp14>MAY</bcp14> be
advertised as a Node MSD,
Link MSD, or both.</t>

<t>An MNA node <bcp14>MUST</bcp14> use the RLD determined by selecting the first
advertised non-zero value from the following:</t>
          <ul spacing="normal">
            <li>
              <t>The RLD advertised for the link</t>
            </li>
            <li>
              <t>The RLD advertised for the node</t>
            </li>
            <li>
              <t>The non-zero ERLD for the node</t>
            </li>
          </ul>
          <t>A node's RLD is a function of its hardware capabilities and is not
expected to depend on the specifics of the MNA solution.</t>
        </section>
      </section>
      <section anchor="State">
        <name>State</name>
        <t>A network action can affect the state stored in the network. This
implies that a packet may affect how subsequent packets are
handled. In particular, one packet may affect subsequent packets in
the same LSP.</t>
      </section>
    </section>
    <section anchor="carry">
      <name>Encoding</name>
      <t>Several possible ways to encode NAIs have been proposed.  This
section summarizes the proposals and some considerations for
the various alternatives.</t>

<t>When network actions are carried in the MPLS label stack, then
regardless of their type, they are represented by a set of LSEs termed
a Network Action Sub-Stack (NAS).  A NAS consists of a special-purpose label,
optionally followed by LSEs that specify which network actions are to
be performed on the packet and the in-stack ancillary data for each
indicated network action. Different network actions may be placed
together in one NAS or may be carried in different sub-stacks.</t>
      <t><xref target="RFC9613"/> requires that a solution not add unnecessary
      LSEs to the sub-stack (see requirement 9 in <xref section="3.1" sectionFormat="of"
      target="RFC9613"/>). Accordingly, solutions should also
      make efficient use of the bits within the sub-stack (except the S-bit),
      as inefficient use of the bits could result in the addition of
      unnecessary LSEs.</t>
      <section anchor="NAI">
        <name>The MNA Label</name>
        <t>The first LSE in a network action sub-stack contains a special-purpose label
that indicates a network action sub-stack. A solution has several
choices for this special-purpose label.</t>
        <section anchor="existing-base-spl">
          <name>Existing Base SPL</name>
          <t>A solution may reuse an existing Base SPL (bSPL). If it elects to do
so, it must explain how the usage is backward compatible, including
in the case where there is ISD.</t>
          <t>If an existing inactive bSPL is selected that will not be
backward compatible, then it must first be retired per
<xref target="RFC7274"/> and then reallocated.</t>
        </section>
        <section anchor="new-base-spl">
          <name>New Base SPL</name>
          <t>A solution may select a new bSPL.</t>
        </section>
        <section anchor="new-extended-spl">
          <name>New Extended SPL</name>
          <t>A solution may select a new Extended SPL (eSPL). If it elects to do so, it must
address the requirement for the minimal number of LSEs.</t>
        </section>
        <section anchor="user-defined-label">
          <name>User-Defined Label</name>
          <t>A solution may allow the network operator to define the label that
indicates the network action sub-stack. This creates management
overhead for the network operator to coordinate the use of this label
across all nodes on the path using management or signaling
protocols. The user-defined label could be network-wide or
LSP-specific.  If a solution elects to use a user-defined label, the
solution should justify this overhead.</t>
        </section>
      </section>
      <section anchor="tc-and-ttl">
        <name>TC and TTL</name>

	<t>In the first LSE of the network action sub-stack, only the 20 bits of
the Label value and the Bottom of Stack bit are used by the NSI; the TC field
(3 bits) and the TTL (8 bits) are not used.  This could leave 11 bits
that could be used for MNA purposes.</t>
        <section anchor="tc-and-ttl-retained">
          <name>TC and TTL Retained</name>
          <t>If the solution elects to retain the TC and TTL fields, then the first
LSE of the network action sub-stack would appear as described in <xref target="RFC3032"/>:</t>

<figure>
  <name>A Label Stack Entry with TC and TTL Retained</name>
          <artwork><![CDATA[
    0                   1                   2                   3
    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |               Label                   | TC  |S|      TTL      |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
]]></artwork>
</figure>

<dl spacing="compact" newline="false">
  <dt>Label:</dt><dd>Label value, 20 bits</dd>
  <dt>TC:</dt><dd>Traffic Class, 3 bits</dd>
  <dt>S:</dt><dd>Bottom of Stack, 1 bit</dd>
  <dt>TTL:</dt><dd>Time To Live, 8 bits</dd>
</dl>

          <t>Further LSEs would be needed to encode NAIs.  If a solution elects to
retain the TC and TTL fields, it must address the requirement for the minimal
number of LSEs.</t>
        </section>
        <section anchor="tc-and-ttl-repurposed">
          <name>TC and TTL Repurposed</name>
          <t>If the solution elects to reuse the TC and TTL fields, then the first
LSE of the network action sub-stack would appear as follows:</t>

<figure>
  <name>A Label Stack Entry with TC and TTL Repurposed</name>
          <artwork><![CDATA[
    0                   1                   2                   3
    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |                Label                  |x x x|S|x x x x x x x x|
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
]]></artwork>
</figure>

<dl spacing="compact" newline="false">
  <dt>Label:</dt><dd>Label value, 20 bits</dd>
  <dt>x:</dt><dd>Bit available for use in solution definition</dd>
  <dt>S:</dt><dd>Bottom of Stack, 1 bit</dd>
</dl>
          <t>The solution may use more LSEs to contain NAIs.  If a solution elects
to use more LSEs, it must address the requirement for the minimal
number of LSEs.</t>
        </section>
      </section>
      <section anchor="length-of-the-nas">
        <name>Length of the NAS</name>
        <t>A solution must have a mechanism (such as an indication of the length
   of the NAS) to enable an implementation to find the end of the NAS.
   This must be easily processed even by implementations that do not
   understand the full contents of the NAS.  Two options are described
   below; other solutions may be possible.</t>
        <section anchor="lastcontinuation-bits">
          <name>Last/Continuation Bits</name>
          <t>A solution may use a bit per LSE to indicate whether or not the NAS continues
into the next LSE. The bit may indicate continuation by being
set or by being clear. The overhead of this approach is one bit per
LSE and has the advantage that it can effectively encode an
arbitrarily sized NAS. This approach is efficient if the NAS is small.</t>
        </section>
        <section anchor="length-field">
          <name>Length Field</name>
          <t>A solution may opt to have a fixed-size Length field at a fixed
location within the NAS. The fixed size of the Length field may not be
large enough to support all possible NAS contents. This approach may
be more efficient if the NAS is long, but not longer than can be
described by the Length field.</t>

<t>One hardware designer recommends a Length field as this
minimizes branching in the logic.</t>
        </section>
      </section>
      <section anchor="encoding-of-scopes">
        <name>Encoding of Scopes</name>
        <t>A solution may choose to explicitly encode the scope of each action
contained in a network action sub-stack. For example, a NAS might
contain Action A (HbH), Action B (HbH), and Action C (HbH).  A
solution may alternately choose to have the scope encoded implicitly,
based on the actions present in the network action sub-stack. For
example, a NAS might contain the following actions with HbH scope: A, B, and C.  This choice
may have performance implications as an implementation might have to
parse the network actions that are present in a network action
sub-stack only to discover that there are no actions for it to
perform.</t>
        <t>For example, suppose that a NAS is embedded in a label stack at a
depth of six LSEs and the NAS contains three actions, each with Select
scope. These actions are not applicable at the current node and should
be ignored. If the scope is encoded explicitly with each action, then
an implementation must parse each action. However, if the scope is
encoded as part of the NAS, then an implementation only needs to parse the
start of the NAS and not individual actions.</t>
        <t>Solutions need to consider the order of scoped NAIs and their
associated AD within individual sub-stacks and the order of per-scope
sub-stacks, so that network actions and the AD can be
readily found and not be processed by nodes that are not required
to handle those actions.</t>
      </section>
      <section anchor="INDEX">
        <name>Encoding a Network Action</name>
        <t>Two options for encoding NAIs are described below; other solutions may
be possible. Any solution should allow the encoding of an arbitrary
number of NAIs.</t>
        <section anchor="Catalogs">
          <name>Bit Catalogs</name>
          <t>A solution may opt to encode the set of network actions as a list of
bits, sometimes known as a catalog. The solution must provide a
mechanism to determine how many LSEs are devoted to the catalog when
the NAIs are carried in-stack. A set bit in the catalog would indicate
that the corresponding network action is present.</t>
          <t>Catalogs are efficient if the number of present network actions is
relatively high and if the size of the necessary catalog is small. For
example, if the first 16 actions are all present, a catalog can encode
this in 16 bits. However, if the number of possible actions is large,
then a catalog can become inefficient. Selecting only one action that
is the 256th action would require a catalog of 256 bits, which would
require more than one LSE when the NAIs are carried in-stack.</t>
          <t>A solution may include a bit-remapping mechanism so that a given
domain may optimize for its commonly used actions.</t>
        </section>
        <section anchor="operation-codes">
          <name>Operation Codes</name>
          <t>A solution may opt to encode the set of present network actions as a
list of operation codes (opcodes).  Each opcode is a fixed number of
bits. The size of the opcode bounds the number of network actions
that the solution can support.</t>
          <t>Opcodes are efficient if there are only one or two active network
actions. For example, if an opcode is 8 bits, then two active network
actions could be encoded in 16 bits. However, if 16
actions are required, then opcodes would consume 128 bits. Opcodes are
efficient at encoding a large number of possible actions. If only
the 256th action is to be selected, that still requires 8 bits.</t>
        </section>
      </section>
      <section anchor="PSD">
        <name>Encoding of Post-Stack Data</name>

	<t>A solution may carry NAI and AD as PSD. For ease of parsing, all
AD should be co-located with its NAI.</t>
        <t>If there are multiple instances of post-stack data, they should occur
in the same order as their relevant network action sub-stacks and then
in the same order as their relevant network actions occur within the
network action sub-stacks.</t>
        <section anchor="first-nibble-considerations">
          <name>First Nibble Considerations</name>
          <t>The first nibble after the label stack has been used to convey
   information in certain cases <xref target="RFC4385"/>. A consolidated view of the uses of the
   first nibble is provided in <xref target="RFC9790"/>.</t>
          <t>For example, in <xref target="RFC4928"/>, this nibble is investigated to find out
   if it has the value "4" or "6". If it does not, it is assumed that
   the packet payload is not IPv4 or IPv6, and Equal-Cost Multipath
   (ECMP) is not performed.</t>

   <t>It should be noted that this is an inexact method. For example, an Ethernet
   pseudowire without a control word might have "4" or "6" in the first
   nibble and thus will be subject to ECMP forwarding.</t>
          <t>Nevertheless, the method is implemented and deployed; it is used
   today and will be for the foreseeable future.</t>

   <t>The use of the first nibble for Bit Index Explicit Replication
   (BIER) is specified in <xref target="RFC8296"/>. BIER sets the first nibble to
   5. The same is true for a BIER payload as for any use of the first
   nibble: it is not possible to conclude that the payload is BIER
   even if the first nibble is set to 5 because an Ethernet pseudowire
   without a control word might begin with a 5.  However, the BIER approach meets the design goal of <xref target="RFC8296"/> to determine that the payload is IPv4,  IPv6, or a packet with a header that includes a pseudowire control word.
   </t>
          <t><xref target="RFC4385"/> allocates 0b0000 for the pseudowire control word and 0b0001
 as the control word for the pseudowire Associated Channel Header
 (ACH).</t>
          <t>A PSD solution should specify the contents of the first nibble, the
actions to be taken for the value, and the interaction with post-stack
data used concurrently by other MPLS applications.</t>
        </section>
      </section>
    </section>
    <section anchor="semantics">
      <name>Semantics</name>
      <t>For MNA to be consistent across implementations and predictable in
operational environments, its semantics need to be entirely
predictable. An MNA solution <bcp14>MUST</bcp14> specify a deterministic order for
processing each of the network actions in a packet. Each network
action must specify how it interacts with all other previously defined
network actions. Private network actions are network actions that are
not publicly documented. Private network actions <bcp14>MUST</bcp14> be included in
the ordering of network actions, but the interactions of private
actions with other actions are outside of the scope of this document.</t>
    </section>
    <section anchor="definition-of-a-network-action">
      <name>Definition of a Network Action</name>
      <t>A document defining a network action must contain the following:</t>
      <dl spacing="normal" newline="false">
        <dt>Name:</dt><dd>The name of the network action.</dd>
        <dt>Network Action Indicator:</dt><dd>The bit position or opcode that
        indicates that the network action is active.</dd>
        <dt>Scope:</dt><dd>Description of which nodes should
        perform the network action as described in <xref
        target="scopes"/>.</dd>
        <dt>State:</dt><dd>Indication of whether the network action
        can modify state in the network and, if so, the state that may be
        modified and its side effects.</dd>
        <dt>Required/Optional:</dt><dd>Indication of whether a
        node is required to perform the network action.</dd>
        <dt>In-Stack Data:</dt><dd>The number of LSEs of in-stack data, if
        any, and the encoding of the in-stack data. If the in-stack data is of
        a variable length, then the solution must specify how an
        implementation can determine the length without implementing the
        network action.
      </dd>
        <dt>Post-Stack Data:</dt><dd>The encoding of post-stack data, if any.  If the post-stack data
    is of a variable length, then the solution must specify how an
    implementation can determine the length without implementing the
    network action.
      </dd>
      </dl>
      <t>A solution should create an IANA registry for network
actions.</t>
    </section>
    <section anchor="management-considerations">
      <name>Management Considerations</name>
      <t>Network operators will need to be cognizant of which network actions
are supported by which nodes and will need to ensure that this is
signaled. Some solutions may require network-wide
configuration to synchronize the use of the labels that indicate the
start of a NAS. Solution documents must clearly state what management
considerations apply to the solutions they are describing. Solution
documents must describe mechanisms for performing network diagnostics
in the presence of MNAs.</t>
    </section>
    <section anchor="security-considerations">
      <name>Security Considerations</name>
      <t>An analysis of the security of MPLS systems is provided in
<xref target="RFC5920"/>, which also notes that the MPLS forwarding plane has no
built-in security mechanisms.</t>

<t>Central to the security of MPLS networks is operational security of
the network, something that operators of MPLS networks are well versed
in.  The deployment of link-level security (e.g., <xref target="MACsec"/>) prevents
link traffic observation covertly acquiring the label stack for an
attack.  This is particularly important in the case of a network
deploying MNA, because the MNA information may be sensitive.  Thus, the
confidentiality and authentication achieved through the use of
link-level security is particularly advantageous.</t>
      <t>Some additional proposals to add encryption to the MPLS forwarding
      plane have been suggested <xref
      target="I-D.ietf-mpls-opportunistic-encrypt"/>, but no mechanisms have
      been agreed upon at the time of publication of this document.  <xref
      target="I-D.ietf-mpls-opportunistic-encrypt"/> offers hop-by-hop
      security that encrypts the label stack and is functionally equivalent to
      that provided by <xref target="MACsec"/>.  Alternatively, it also offers
      end-to-end encryption of the MPLS payload with no cryptographic
      integrity protection of the MPLS label stack.</t>

      <t>Particular care is needed when introducing any end-to-end
security mechanism to allow an in-stack MNA solution that needs to
employ on-path modification of the MNA data or where post-stack
MNA data needs to be examined on-path.</t>
      <t>A cornerstone of MPLS security is to protect the network from
processing MPLS labels that originated outside the network.</t>
      <t>Operators have considerable experience in excluding MPLS-encoded
packets at the network boundaries, for example, by  excluding all MPLS
packets and all packets that are revealed to be carrying an MPLS 
packet as the payload of IP tunnels.  Where such packets are accepted
into an MPLS network from an untrusted third party, non-MPLS packets 
are immediately encapsulated in an MPLS label stack specified by the
MPLS network operator, and MPLS packets have additional label
stack entries imported as specified by the MPLS network operator. 
Thus, it is difficult for an attacker to pass an MPLS-encoded
packet into a network or to present any instructions to the network
forwarding system.</t>
      <t>Within a single well-managed domain, an adjacent domain may be
considered to be trusted provided that it is sufficiently shielded
from third-party traffic ingress and third-party traffic observation.
In such a situation, no new security vulnerabilities are introduced by
MNA.</t>
      <t>In some inter-domain applications (including carrier's carrier) where
a first network's MPLS traffic is encapsulated directly over a second
MPLS network by simply pushing additional MPLS LSEs, the contents of
the first network's payload and label stack may be visible to the
forwarders in the second network.  Historically, this has been benign
and indeed useful for ECMP.  However, if the first network's traffic
has MNA information, this may be exposed to MNA-capable forwarders and
cause unpredictable behavior or modification of the customer MPLS
label stack or MPLS payload.  This is an increased vulnerability
introduced by MNA that <bcp14>SHOULD</bcp14> be addressed in any MNA solution.</t>
      <t>Several mitigations are available to an operator:</t>
      <ol type="a">
	<li>Reject all incoming packets containing MNA information that do not
	come from a trusted network. Note that it may be acceptable to accept
	and process MNA information from a trusted network.</li>
	<li>Fully encapsulate the inbound packet in a new additional MPLS
	label stack such that the forwarder finds a Bottom of Stack (BoS) bit
	imposed by the carrier network and only finds MNA information added by
	the carrier network.</li>
      </ol>
      <t>A mitigation that we reject as unsafe is having the ingress Label Switching Router (LSR) push
sufficient additional labels such that any MNA information received in
packets entering the network from a third-party network is made
inaccessible due to it being below the RLD.  This is unsafe in the
presence of an overly conservative RLD value and can result in the
third-party MNA information becoming visible to and acted on by an
MNA forwarder in the carrier network.</t>
    </section>
    <section anchor="iana-considerations">
      <name>IANA Considerations</name>
      <t>IANA has allocated the following code point in the "IGP
MSD-Types" registry <xref target="MSD"/> within the "Interior Gateway Protocol (IGP)
Parameters" registry group:
      </t>

<table anchor="igp-msp-reg">
  <name>New IGP MSD-Type</name>
  <thead>
    <tr>
      <th>Value</th>
      <th>Name</th>
      <th>Data Plane</th>
      <th>Reference</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>3</td>
      <td>Readable Label Depth</td>
      <td>MPLS</td>
      <td>RFC 9789</td>
    </tr>
  </tbody>
</table>
      
    </section>
  </middle>
  <back>

    <displayreference target="I-D.ietf-mpls-opportunistic-encrypt" to="MPLS-OPP-SEC"/>

    <references>
      <name>References</name>

      <references>
        <name>Normative References</name>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.3031.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.3032.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.4385.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.5920.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.7274.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8174.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.9017.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.9613.xml"/>
      </references>
      <references>
        <name>Informative References</name>
	<!-- [I-D.ietf-mpls-opportunistic-encrypt] Expired -->
	
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml3/reference.I-D.ietf-mpls-opportunistic-encrypt.xml"/>

	

        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.4928.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.5714.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.6790.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8279.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8296.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8402.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8491.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8662.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.9088.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.9089.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.9522.xml"/>

		<!-- [I-D.ietf-mpls-1stnibble] RFC9790 - cluster 520 document -->

<reference anchor="RFC9790" target="https://www.rfc-editor.org/info/rfc9790">
<front>
            <title>IANA Registry and Processing Recommendations for the First Nibble Following a Label Stack</title>
            <author fullname="Kireeti Kompella" initials="K." surname="Kompella">
              <organization>Juniper Networks</organization>
            </author>
            <author fullname="Stewart Bryant" initials="S." surname="Bryant">
              <organization>University of Surrey 5GIC</organization>
            </author>
            <author fullname="Matthew Bocci" initials="M." surname="Bocci">
              <organization>Nokia</organization>
            </author>
            <author fullname="Greg Mirsky" initials="G." surname="Mirsky" role="editor">
              <organization>Ericsson</organization>
            </author>
            <author fullname="Loa Andersson" initials="L." surname="Andersson">
              <organization>Huawei Technologies</organization>
            </author>
            <author fullname="Jie Dong" initials="J." surname="Dong">
              <organization>Huawei Technologies</organization>
            </author>

<date month='July' year='2025'/>
</front>
<seriesInfo name="RFC" value="9790"/>
<seriesInfo name="DOI" value="10.17487/RFC9790"/>
</reference>

        <reference anchor="MACsec" target="https://ieeexplore.ieee.org/document/8585421">
          <front>
            <title>
              IEEE Standard for Local and metropolitan area networks-Media Access Control (MAC) Security
            </title>
            <author>
              <organization>IEEE</organization>
            </author>
            <date day="26" month="December" year="2018"/>
          </front>
          <seriesInfo name="IEEE Std" value="802.1AE-2018"/>
          <seriesInfo name="DOI" value="10.1109/ieeestd.2018.8585421"/>
        </reference>

        <reference anchor="MSD" target="https://www.iana.org/assignments/igp-parameters/">
          <front>
            <title>IGP MSD-Types</title>
            <author>
              <organization>IANA</organization>
            </author>
          </front>
        </reference>
      </references>
    </references>

    <section anchor="acknowledgements" numbered="false">
      <name>Acknowledgements</name>
      <t>This document is the result of work started in MPLS Open Design Team,
      with participation by the MPLS, PALS, and DETNET Working Groups.</t>
      <t>The authors would like to thank <contact fullname="Adrian Farrel"/>
      for his contributions. The authors would also like to thank <contact fullname="John Drake"/>, <contact
      fullname="Toerless Eckert"/>, and <contact fullname="Jie Dong"/> for
      their comments.</t>
    </section>
    
  </back>

</rfc>
