MPLS Network Action (MNA) Header Encodings
Internet-Draft draft-jags-mpls-mna-hdr-01
Jaganbabu Rajamanickam, Ed.
Cisco Systems, Inc.
Canada
jrajaman@cisco.com
Rakesh Gandhi, Ed.
Cisco Systems, Inc.
Canada
rgandhi@cisco.com
Jisu Bhattacharya
Cisco Systems, Inc.
jisu@cisco.com
Bruno Decraene
Orange
bruno.decraene@orange.com
Royi Zigler
Broadcom
royi.zigler@broadcom.com
Weiqiang Cheng
China Mobile
chengweiqiang@chinamobile.com
Luay Jalil
Verizon
luay.jalil@verizon.com
Haoyu Song
Futurewei Technologies
haoyu.song@futurewei.com
Xiao Min
ZTE Corp.
xiao.min2@zte.com.cn
Bin Wen
Comcast
Bin_Wen@cable.comcast.com
Sami Boutros
Ciena
sboutros@ciena.com
25 July 2022
MPLS Working Group
This document defines the MPLS Network Action (MNA) Header encoding formats to carry Network Actions and optionally Ancillary Data in the MPLS Label Stack and after the Label Stack. The MPLS Network Action can influence the forwarding decisions or can carry additional OAM information in the MPLS packet. This document follows the MNA requirements specified in draft-ietf-mpls-mna-requirements.
Introduction
[RFC3032] defines MPLS Header for carrying a stack of MPLS labels which are used to forward packets in an MPLS network. Today's new applications require the MPLS packets to carry network action indicators and optional Ancillary Data (AD) that would be used in MPLS packet forwarding decision or for OAM purpose. Ancillary Data can be used to carry additional information, for example, a network slice identifier, In-Situ OAM (IOAM) data, etc. Several use-cases are described in [I-D.ietf-mpls-mna-usecases].
This document defines MPLS data plane extension header format to encode MPLS Network Actions (MNA) those are efficient to process in hardware. The MPLS Network Actions are encoded in the form of flags and opcodes. These MPLS Network Actions can be encoded without Ancillary Data (AD) or with In-Stack Ancillary Data (ISD) or with Post-Stack Ancillary Data (PSD) after the Bottom of the Stack (BOS). A new Special Purpose Label (SPL) will be assigned to indicate the presence of MPLS Network Action Sub-stack (MNAS) in the MPLS packet. This document follows the MNA requirements specified in [I-D.ietf-mpls-mna-requirements].
Conventions Used in This Document
Requirements Language
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here.
Abbreviations
The MNA terminology defined in [I-D.andersson-mpls-mna-fwk] and [I-D.ietf-mpls-mna-requirements] are used in this document.
- AD: Ancillary Data.
- ADL: Additional Data Length.
- BOS: Bottom Of Stack.
- I2E: Ingress-To-Egress.
- HPI: Hop-By-Hop Post-Stack Network Action Processing Indicator.
- ISD: In-Stack Data.
- IS-NAI-Opcode: In-Stack Network Action Opcode.
- INE: In-Stack Network Action Extension Presence Indicator.
- INI: In-Stack Network Action Presence Indicator.
- MPLS: Multiprotocol Label Switching.
- MNA: MPLS Network Action.
- NAI: Network Action Indicator.
- NAI-OP: Network Action Indicator Opcode.
- NASI: Network Action Sub-stack Indicator.
- PNI: Post-Stack Network Action Presence Indicator.
- PSD: Post-Stack Data.
- SPL: Special Purpose Label in the range of 0-15.
- TC: Traffic Class.
- TTL: Time To Live.
Overview
Encoding MPLS Network Actions requires two main parts.
- 1. Network Action Sub-stack Indicator (NASI Label) - This label indicates the presence of MPLS Network Action Sub-stack in the packet. A new SPL (value TBA1) will be allocated for this purpose.
- 2. Network Action Encoding Format - The format in which the MPLS Network Actions can be carried in the MPLS packet. This includes both In-Stack and Post-Stack Network Actions.
MPLS Label Stack Entry (LSE) Format

 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|              Label                    | TC  |S|      TTL      |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

New In-Stack MPLS Network Action encoding format is defined in this document to carry the In-Stack Network Action and its Ancillary Data in the MPLS Label Stack.
- It uses MPLS Label field to carry the Network Action Indicator Opcode, Flags and part of In-Stack Ancillary Data.
- It uses Traffic Class (TC) field to carry the Length of the In-Stack Network Action's Ancillary Data and Network Action I2E Scope.
- It uses MPLS Label and Time-To-Live (TTL) fields to carry the part of In-Stack Ancillary Data (can be Flags or Ancillary Data).
The MPLS Network Action encoding formats defined in this document are flexible and allow to add In-Stack and Post-Stack MPLS Network Actions in a desired order in the same MPLS packet.
A new SPL value (TBA1) is assigned to indicate the presence of the MPLS Network Action Sub-stack (NAS).
New SPL as MPLS Network Action Sub-stack Indicator with ISD

 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|     NASI=SPL (TBA1)                   | TC  |S|      TTL      |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|1|        Flag-Based-NAI               |ADL|E|S| INE,INI=1,IL  |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

New SPL as MPLS Network Action Sub-stack Indicator with PSD

 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|     NASI=SPL (TBA1)                   | TC  |S|      TTL      |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|1|        Flag-Based-NAI               | 0 |E|S| HPI,PNI=1,IL=0|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

First Word:
- This is the new SPL, indicates the presence of NASI. The TC and TTL fields of the NASI SPL are not re-purposed for encoding format flags, as the penultimate node on the MPLS packet path may propagate TTL from the transport (or forwarding) label to the next label on the label stack, overwriting the TTL on the next label. When the penultimate node is aware of the NASI SPL (value TBA1), it can also pop that label. But when the penultimate node is not aware of the NASI SPL (value TBA1), this can cause encoding format flags in the TTL of the NASI (label TBA1) label to be lost. This word helps to identify the presence of In-Stack and/or Post-Stack Network Actions.
Second Word:
This word contains the Base Header, which indicates the some of the base attributes of the In-Stack and Post-Stack NAIs encoded. In this case, the TTL fields is re-purposed to encode the Base Header Information. But the Label and TC fields are used to encode the Flag-based In-Stack NAIs.
TTL Field
The following are the information that are encoded as part of TTL field.
- IL (In-Stack Network Action Encoding Length) - The First 3-bits TTL field is used to indicate the length of the In-Stack MPLS Network Actions encoded in terms of words (32 bits). For example, IL value "0" means there are no In-Stack Network Actions encoded. If IL value is "1" means there is one word worth of In-Stack Network Action is encoded. This field is very helpful for the hardware ASICs to skip or process the In-Stack Network Actions. Using one NASI only 7 words of In-Stack Network Actions can be encoded.
- INI (In-Stack Network Action Presence Indicator) - This is the 5th bit in the TTL field. This indicates the presence of the In-Stack Network Actions encoding. This bit is defined to help the hardware ASICs to process the In-Stack Network Actions or skip.
- TBA4 - Bit 4 is reserved for future usage.
- PNI (Post-Stack Network Action Presence Indicator) - This is the 6th bit in the TTL field. This indicates the presence of the Post-Stack Network Actions encoding. This bit is defined to help the hardware ASICs to process the encoded Post-Stack Network Actions.
- HPI (Hop-By-Hop Post-Stack Network Action Processing Indicator) - This is the 7th bit in the TTL field. This indicates the presence of the Post-Stack Network Actions encoded in the packet that required Hop-By-Hop processing. This bit is defined to help the hardware ASICs to process the encoded Post-Stack Network Actions on all the mid-nodes.
- INE (In-Stack Network Action Extension Presence Indicator) - This is the 8th bit in the TTL field. One NASI can encode only 7 words of In-Stack Network Actions. If the user needs to encode more than 7 words of In-Stack Network, then this bit will indicate that it has another set of In-Stack Network Actions encoded. This gives a flexibility to extend multiple sets of Network Action Sub-stack. The Last Network Action Sub-stack will set the INE bit to "0". This has been defined for more extensibility/flexibility in the future. But at the same time, it is not advisable to encode more Ancillary Data for a specific In-Stack Network Actions. If at all a Network Actions required more supporting Ancillary Data, then those Network Actions MUST be encoded as part of Post-Stack Network Actions.
Label Field
This field encoding the Flag-based NAIs which does not require any Ancillary data to be carried to process the In-Stack NAIs.
- The First bit MUST be set "1" to prevent aliasing with the existing SPLs.
- Next 19 bits will be used to encode In-Stack NAIs. These Bit positions will be assigned by IANA.
TC Field
- ADL (Additional Data Length) - The first 2 bits are used to encode the length of additional Flag-based NAIs that are carried. This field is to extend the assignment of the Flag-based NAI bit position more than 19 (i.e) if IANA allocates bit position value more than 19, then it would take additional word to assign the new Flag-based In-Stack NAIs. By default, this value will be "0". Depending on the number of words is encoded this value will get incremented. The maximum value that is encoded would be "3" (i.e.) it allows additional 3 words to be encoded to carry Flag-based NAIs.
- E-Bit (I2E Bit) - This Flag will NOT be set when the MNA carries Flag-based In-Stack NAIs that are to be processed at Hop-By-Hop. This will allow the ASICs in the mid nodes to process the Flag-based In-Stack NAIs easily.
In-Stack MPLS Network Action Encoding
This section describes the encoding format of the MPLS Network Actions carried as part of the MPLS Label Stack. The encoding format defined is flexible (e.g., stackable opcodes in desired order), extensible (by defining new NAI-Opcodes) and ASIC friendly (by using Sub-stack Length, Opcode+Data in the same field). This encoding format allows to carry Flag-based NAIs and the NAIs that required Ancillary Data in the same packet.
In-Stack Network Action Encoding Format

 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|      NASI=SPL (TBA1)                  | TC  |S|    TTL        |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|1|        Flag-Based-NAI               |ADL|E|S|   IL, INI=1   |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| IS-NAI-Opcode |    Ancillary Data     |ADL|E|S| Ancillary Data|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

First Word:
- NASI will identify the presence of MPLS Network Action Sub-stacks.
Second Word:
This word contains the base MNA indicators and the Flag Based NAIs that has been described in the above section.
- INI flag is set to "1" to indicate the presence of any In-Stack MPLS Network Actions.
- IL will be set depending on the encoded In-Stack Network Actions.
- Flag-Based-NAI - Network Action that does not require Ancillary data to process can be encoded. This has been described in detail in the above section.
Third Word:
This word contains the NAIs that requires some Ancillary Data to be processed.
Label Field:
The first 8 bits are used to define the In-Stack Network Action Opcode (IS-NAI-Opcode). The opcode method of identifying a specific Network Actions are common in today's hardware ASICs (Similar to any IPv4/IPv6/VxLAN header processing), so this method is easy to be adopted by the existing hardware. This will allow the hardware ASICs to serially or in-parallel process the Network Actions.
This opcode ranges from 1 to 255. NAI-Opcode value of 0 is marked as invalid to avoid the label value aliasing with the reserved SPLs.
- IS-NAI-Opcode Value:1 - Opcode reserved to indicate the start offset of the Post-Stack Network Actions encoding after the MPLS Label Bottom of the Stack. This can allow to carry Generic Control Word (0000b) [RFC4385] and G-ACh (0001b) [RFC5586] fields immediately after the BOS. Adding of this opcode is not required when the BOS data starts immediately after the Bottom of the Label Stack (i.e. when offset is 0).
- IS-NAI-Opcode Value:2-254 - MUST be assigned by IANA. When the opcode is allocated for a specific applications Network Action, the respective Ancillary Data format MUST be defined. Also other required attributes of the Network Action MUST be defined like functionality, Hop-By-Hop Processing etc..
- IS-NAI-Opcode Value:255 - IANA Allocated for IS-NAI-Opcode range extension. This gives the extensibility for opcode range beyond 255.
IS-NAI-Opcode/Flag-Based-NAI Bits MUST define the following procedure before it can be used:
- 1. Define the Data format for the MPLS Network Actions to be encoded.
- 2. Define the Hop-By-Hop or Ingress-To-Egress (only on the decapsulation node) processing scope.
- 3. The Hop-By-Hop IS-NAI-Opcodes MUST be placed before the Ingress-To-Egress IS-NAI-Opcodes in the MPLS Network Action Stack to optimize the Hop-By-Hop processing in hardware.
Next 12 bits in the Label field and the 8 bits from the TTL field are used to carry Ancillary Data corresponding to the IS-NAI-Opcode.
TC Field:
This field is used to indicate the following.
- ADL (Additional Data Length): This indicates the additional number of word fields used to encode Additional Ancillary Data. By default, an IS-NAI-Opcode can carry 20 bits of Ancillary Data. If a specific opcode needs to carry more than 20 bits of Ancillary Data, then this field should be encoded with the right value. By default, the ADL value would be "0". For example, if a specific opcode needs to carry 32 bits of Ancillary Data then the ADL value would be "1". This will allow the hardware ASIC to easily move to the next opcode. In some cases, if the node does not understand the opcode value, then this field will be used to skip the current opcode and move to the next opcode offset for further processing.
- E (I2E-Bit): In-Stack MPLS Network Action that requires processing only at the egress node. This bit indicates will be set to "0" in case of Hop-By-Hop processing is required.
TTL Field:
This 8-bit field is used to carry In-Stack Ancillary Data apart from the 12 bits in the Label field.
NOTE:
- An intermediate node may use the full MPLS Label Stack for ECMP hash computation hence the In-Stack MPLS extension header MUST NOT change the Label Field part of the IS-NA data within the same traffic flow. But the TTL part of In-Stack Ancillary Data can change for the same traffic flow without affecting the ECMP hash. The In-Stack Network Action encoding defined above ensures this.
In-Stack MPLS Network Action Encoding more than 20 bits of Ancillary Data
In some cases, the In-Stack Network Action can require more than 20 bits of supporting Ancillary Data. In these cases, the following Ancillary Data encoding should be used. This is applicable for the Flag-based In-Stack NAI encoding described in the section 3.1
In-Stack Network Action With Additional Ancillary Data Encoding Format

 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|     NASI=SPL (TBA1)                   | TC  |S|      TTL      |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|1|        Flag-Based-NAI               |ADL|E|S|   IL, INI=1   |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| IS-NAI-Opcode |    Ancillary Data     |ADL|E|S| Ancillary Data|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|1|     Additional Ancillary Data             |S| Ancillary Data|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

First and Second Word:
These values are already described in the above section.
Third Word:
These values are also described above, but the ADL length will be set to "1", to indicate the presence of additional word data that is carried. This ADL length is corresponding to the specific opcode.
Fourth Word:
This is the Additional Ancillary Data that is encoded to support the IS-NAI-Opcode. The below is the format to encode single additional word to carry Ancillary Data. This format would be replicated for each additional word of Ancillary Data encoded.
- The first bit in the Label field MUST be set to "1". This is to prevent aliasing the label field with other SPLs on the legacy routers.
- Next 19 bits of the Label field can be used to encode Ancillary Data.
- The TC field carries part of Additional Ancillary Data.
- The TTL field carries a part of the Additional Ancillary Data.
Post-Stack MPLS Network Action Encoding
Based on the PNI and HPI flags, the Post-Stack Network Actions will be processed. The details of the Post-Stack Network Action encoding have been provided in [I-D.song-mpls-extension-header].
In-Stack Network Action Encoding Example-1 - Carrying Flag-based In-Stack Network Action without Ancillary Data
Example In-Stack Network Action Encoding Carrying Flag-based NA

 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|     NASI=SPL (TBA1)                   |  TC |S|      TTL      |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|1|        Flag-Based-NAI               | 0 |E|S| IL=0, INI=1   |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Second Word:
Label Field:
- First bit MUST be set to "1".
- Next 19 bits are used to encode the flag-based Network Actions that do not need any corresponding Ancillary Data to process. Each Flag encoded is a unique Flag-based Network Action. This Flag position will be assigned by IANA. For example, an application-A can be allocated Flag position as "2" and another application-B can be allocated Flag position as "5". If application-A and B needs to set their Network Actions then the Flag bit position "2" and "5" will be set. The Flag positions are counted from left to right.
TC Field:
- ADL - This value depends on the length of the Flag value the MPLS In-Stack header is carrying. In this case the packet is carrying only bit position "1" and "3", the ADL value will be set to "0".
TTL Field:
- INI flag is set to "1" to indicate the presence of In-Stack Network Actions.
Example In-Stack Network Action Encoding Carrying Flag-based NA with Flag position is more than 20

 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|     NASI=SPL (TBA1)                   | TC  |S|     TTL       |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|1|        Flag-Based-NAI               | 1 |E|S| IL=1, INI=1   |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|1| Additional Flag-Based-NAI                 |S| Flag-Based-NAI|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

In this Example, let us assume that an application-C has been allocated a Flag position of "21" by IANA, If the application-C needs to execute its Network Action on the MPLS packet then the 2nd bit in the third Label field will be set to indicate the Flags position "21".
ADL is set to "1" indicates the Flag-Based-NAI word is encoded.
If the Flag-Based-NAI contains Hop-By-Hop NA then this bit will be set to "0".
IL is set to "1" indicates the additional In-Stack NAI word encoded.
INI flag is set to indicate the presence of the In-Stack NAI.
While encoding the Additional Ancillary Data, the Most Significant bit of the third Label Field MUST be set to "1" to prevent from aliasing with the reserved SPLs in the case of legacy devices.
In-Stack Network Action Encoding Example-2 - Carrying Only Network Actions that require Ancillary Data
Example In-Stack Network Action that requires Ancillary Data

 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|     NASI=SPL (TBA1)                   | TC  |S|    TTL        |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|1|        Flag-Based-NAI=0             | 0 |E|S| IL=1, INI=1   |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|IS-NAI-Opcode  |  Ancillary Data       | 0 |E|S| Ancillary Data|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

In this Example, the MNA is carrying only the In-Stack Network Action that requires Ancillary Data.
Second Word:
IL length is set to "1" to indicate an additional 1 word of IS-NA is encoded.
INI flag is set to "1" to indicate the presence of In-Stack MPLS Network Actions.
Third Word:
Label Field:
- First 8 bits encodes the In-Stack Network Action opcode. In this case the IS-NAI-Opcode value ranges from 1 to 254. This value is assigned by IANA. This opcode value defines Ancillary Data format carried in the Label field and the TTL field.
- Next 12 bits are encoded with the Ancillary Data.
TC Field:
- ADL - In this case, since the Ancillary Data that is encode is less than 21 bits, the value of ADL encoded is "0".
TTL Field:
- 8-bit field is used to encode the In-Stack Ancillary Data apart from 12-bit Label field.
Example In-Stack Network Action that requires Ancillary Data of more than 20-bit length

 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|     NASI=SPL (TBA1)                   | TC  |S|     TTL       |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|1|        Flag-Based-NAI=0             | 0 |E|S| IL=2, INI=1   |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|IS-NAI-Opcode  |   Ancillary Data      | 1 |E|S| Ancillary Data|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|1|  Additional Ancillary Data              |E|S| Ancillary Data|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

In this example, the IS-NA carries more than 20-bit of Ancillary Data.
Second Word:
- IL length is set to "2" to indicate an additional 2 word of IS-NA is encoded.
- INI flag is set to "1" to indicate the presence of In-Stack MPLS Network Actions.
Third Word:
- The IS-NAI opcode and the first part of the Ancillary Data is encoded.
- ADL is set to "1", indicating the presence of additional word of Ancillary data corresponding to this opcode.
Fourth Word:
- First bit in the Label field MUST be set to "1".
- Rest of the 19bits Label field, TC and TTL field May contain the Ancillary data corresponding to the above opcode encoded.
Since it carried additional "1" word worth of Ancillary Data, ADL value in the second MPLS TC field is set to "1".
While encoding the Additional Ancillary Data, the Most Significant bit of the Label Field MUST be set to "1" to prevent from aliasing with the reserved SPLs in the case of legacy devices.
In-Stack Network Action Encoding Example-3 - Carrying Multiple Network Actions that require Ancillary Data
Example In-Stack Network Action Carrying Multiple NA with the Ancillary Data

 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|     NASI=SPL (TBA1)                   |  TC |S|     TTL       |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|1|        Flag-Based-NAI=0             | 0 |E|S| IL=2, INI=1   |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|IS-NAI-Opcode=3| Ancillary Data3       | 0 |E|S|Ancillary Data3|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|IS-NAI-Opcode=5| Ancillary Data5       | 0 |E|S|Ancillary Data5|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

This is the example where the MPLS packet carries multiple In-Stack Network Actions that require Ancillary Data to process.
Thrid Word
- Label-Field - First 8-bit field is used to represent In-Stack Network Action Opcode value "3". The next 12 bits indicates the first 12 bits of Ancillary Data corresponding to the Opcode "3".
- TC-Field - ADL - Since no Additional Ancillary Data is encoded or the opcode "3", this field is set to "0".
- TTL-Field - This 8-bit indicates the rest of eight bits of Ancillary Data corresponding to the opcode "3".
Fourth Word
- Label-Field - First 8-bit field is used to represent In-Stack Network Action Opcode value "4". The next 12 bits indicates the first 12 bits of Ancillary Data corresponding to the Opcode "4".
- TC-Field - ADL - Since no Additional Ancillary Data is encoded or the opcode "4", this field is set to "0".
- TTL-Field - This 8-bit indicates the rest of the eight bits of Ancillary Data corresponding to the opcode "4".
Node Capability Signaling
The node capability for the MPLS Network Action must be signaled before the MPLS Encapsulating node can add the necessary MPLS Network Action in the MPLS Label Stack. The capability signaling will be added in LDP, RSVP-TE, BGP, IS-IS, OSPF, BGP-LS, etc. This is outside the scope of this document.
Security Considerations
The security considerations in [RFC3032] also apply to the extensions defined in this document. The NASI Label MUST NOT be exposed to the node which does not support it.
Backward Compatibility
- For the legacy node that does not advertise the MPLS Network Action capability, the Encapsulating node MUST make sure that the MPLS Network Action Sub-stack indicator is not at the top of the MPLS Label Stack to avoid dropping the packets. Based on the signalling, if the MPLS egress node is not capable of the processing MPLS Network Actions then it should not add MNA in the packet. In the worst case, if the legacy routes that does not understand the new SPL allocated then those routers will drop the packets.
- The MPLS Network Action Encoding format is designed to make sure that it does not alias with any reserved SPL.
- The MPLS Network Actions can co-exist with the existing GAL / G-ACh based encoding of data.
- The TC and TTL fields of the NASI SPL are not re-purposed for encoding, as the penultimate node on the MPLS packet path may propagate TTL from the transport (or forwarding) label to the next label on the label stack, overwriting the TTL on the next label. When the penultimate node is aware of the NASI SPL (value TBA1), it can also pop that label. But when the penultimate node is not aware of the NASI SPL (value TBA1), this can cause encoding format flags in the TTL of the NASI (label TBA1) label to be lost.
Processing In-Stack MPLS Network Actions
Encapsulating Node:
- MUST NOT add In-Stack MPLS Network Action Sub-stack if the decapsulation node is not capable of In-Stack MPLS Network Action.
- SHOULD NOT change the IS-NAI-Opcode and the first 12 bits of the In-Stack Ancillary Data for the same packet flow to avoid ECMP path change.
- MAY change In-Stack Ancillary Data part present only in the TTL field for the same packet flow.
- MUST ensure that the penultimate node does not remove the MPLS Network Action Sub-stack.
Intermediate Node:
- MUST ignore the IS-NAI-Opcode that are not supported.
- MUST NOT add In-Stack MPLS Network Action Sub-stack if the decapsulation node is not capable of In-Stack MPLS Network Actions.
- SHOULD NOT change the IS-NAI-Opcode and the first 12 bits of the In-Stack Ancillary Data for the same packet flow.
- MAY change In-Stack Ancillary Data part present only in the TTL field for the same packet flow.
- MAY remove the IS-NAI-Opcode and its corresponding data for all matching packet flow.
Decapsulating Node:
- MUST remove the In-Stack MPLS Network Action Sub-stack.
IANA Considerations
Below are the IANA actions which this document is requesting.
The registries created by this document will be collected in a new registry grouping called “MPLS Network Action,” which will be located at https://www.iana.org/assignments/mpls-network-action.
IANA Considerations for MNA Encoding Flags
IANA is requested to create a new registry with name "MNA Encoding Flags" to assign the bit position and the meaning to the Flags to repurpose TTL and TC fields in the Label Stack Entry (LSE).
MNA Encoding Flags Registry
Bit Position | Description | Reference
11-0 | IETF Review | This document
Following MNA Encoding Flag values are assigned from this registry.
MNA Encoding Flag Values
Value | Description | Reference
0-2 | In-Stack Network Action Encoding Length (IL) | This document
3 | Reserved | This document
4 | In-Stack Network Action Presence Indicator (INI) | This document
5 | Post-Stack Network Action Presence Indicator (PNI) | This document
6 | Hop-By-Hop Post-Stack Network Action Processing Indicator (HPI) | This document
7 | In-Stack Network Action Extension Presence Indicator (INE) | This document
8 | End of Stack (S) | This document
9-10 | Additional Data Length (ADL) | This document
11 | Ingress-To-Egress (E) | This document
IANA Considerations Flag-based Network Actions
IANA is requested to create a new registry with name "In-Stack MPLS Network Action Indicator Flags" to assign the bit position and the meaning to the Flag-based Network Actions upon the user request. Based on the need this registry will be extended more than 19 bit positions.
In-Stack MPLS Network Action Indicator Flags Registry
Bit Position | Description | Reference
18-0 | Unassigned | This document
IANA Considerations for IS-NAI-Opcode
IANA is requested to create a new registry with name "In-Stack MPLS Network Action Indicator Opcodes" to assign IS-NAI-Opcode values. All code-points in the range 1 through 175 in this registry shall be allocated according to the "IETF Review" procedure as specified in [RFC8126]. Code points in the range 176 through 239 in this registry shall be allocated according to the "First Come First Served" procedure as specified in [RFC8126]. Remaining code-points are allocated according to Table 4:
In-Stack MPLS Network Action Indicator Opcodes Registry
Value | Description | Reference
0 - 175 | IETF Review | This document
176 - 239 | First Come First Served | This document
240 - 251 | Experimental Use | This document
252 - 254 | Private Use | This document
Following IS-NAI-Opcode Indicator values are assigned from this registry.
In-Stack Network Action Indicator Opcode Values
Value | Description | Reference
0 | Reserved | This document
1 | Offset of start of Post-Stack Network Action Header | This document
255 | Opcode Range Extension Beyond 255 | This document
IANA Considerations for New Special Purpose Label
IANA is requested to allocate a value TBA1 for the SPL label from the "Base Special-Purpose MPLS Label Values" registry to indicate the presence of MNA Sub-stack.
Appendix
Alternate approach for In-Stack Network Action Encoding
Instead of encoding In-Stack Network Action Indicator Opcode in the Label field, here is an alternate way of adding In-Stack Network Action Indicator Opcode in the TTL field.
Alternate In-Stack Network Action Encoding Format

 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|      NASI=SPL (TBA1)                  |  TC |S|    TTL        |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|1|        Flag-Based-NAI               | 0 |E|S| IL=1, INI=1   |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|1|         Ancillary Data              |ADL|E|S| IS-NAI-Opcode |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

INI flag is set to "1" to indicate the presence of In-Stack MPLS Network Actions.
Since In-Stack MPLS Network Action encoding is part of the MPLS Header, the MPLS Header is redefined to encode the MPLS Network Actions.
Fourth Word:
Label Field:
- Most significant bit is always set to "1" to avoid aliasing with the reserved SPLs.
- Rest of the 19 bits in the Label can be used to carry the Ancillary Data corresponding to the IS-NAI-Opcode.
TC Field:
- ADL (Additional Data Length): Length of Additional Ancillary Data that is encoded.
TTL Field:
This carries In-Stack Network Action Indicator Opcode.
References
Normative References
[RFC2119]

Key words for use in RFCs to Indicate Requirement Levels
S. Bradner
March 1997
BCP 14
RFC 2119
DOI 10.17487/RFC2119
[RFC3032]

MPLS Label Stack Encoding
E. Rosen
D. Tappan
G. Fedorkow
Y. Rekhter
D. Farinacci
T. Li
A. Conta
January 2001
RFC 3032
DOI 10.17487/RFC3032
[RFC8126]

Guidelines for Writing an IANA Considerations Section in RFCs
M. Cotton
B. Leiba
T. Narten
June 2017
BCP 26
RFC 8126
DOI 10.17487/RFC8126
[RFC8174]

Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words
B. Leiba
May 2017
BCP 14
RFC 8174
DOI 10.17487/RFC8174
Informative References
[I-D.song-mpls-extension-header]

MPLS Extension Header
Haoyu Song
Futurewei Technologies
Zhenbin Li
Huawei
Tianran Zhou
Huawei
Loa Andersson
Bronze Dragon Consulting
Zhaohui Zhang
Juniper Networks
Rakesh Gandhi
Cisco Systems
Jaganbabu Rajamanickam
Cisco Systems
Jisu Bhattacharya
Cisco Systems
08 July 2022
Internet-Draft draft-song-mpls-extension-header-07
[I-D.andersson-mpls-mna-fwk]

MPLS Network Actions Framework
Loa Andersson
Stewart Bryant
Matthew Bocci
27 June 2022
Internet-Draft draft-andersson-mpls-mna-fwk-04.txt
[I-D.ietf-mpls-mna-requirements]

Requirements for MPLS Network Action Indicators and MPLS Ancillary Data
Matthew Bocci
Nokia
Stewart Bryant
University of Surrey 5GIC
John Drake
Juniper Networks
21 June 2022
Internet-Draft draft-ietf-mpls-mna-requirements-01.txt
[I-D.ietf-mpls-mna-usecases]

Usecases for MPLS Indicators and Ancillary Data
Tarek Saad
Juniper Networks
Kiran Makhijani
Futurewei Technologies
Haoyu Song
Futurewei Technologies
19 May 2022
Internet-Draft draft-ietf-mpls-mna-usecases-00
[RFC5586]

MPLS Generic Associated Channel
M. Bocci, Ed.
M. Vigoureux, Ed.
S. Bryant, Ed.
June 2009
RFC 5586
DOI 10.17487/RFC5586
[RFC4385]

Pseudowire Emulation Edge-to-Edge (PWE3) Control Word for Use over an MPLS PSN
S. Bryant
G. Swallow
L. Martini
D. McPherson
February 2006
RFC 4385
DOI 10.17487/RFC4385
Acknowledgments
The authors of this document would like to thank the MPLS Working Group Design Team for the discussions and comments on this document. The authors would also like to thank Amanda Baber for reviewing the IANA Considerations and providing many useful suggestions.
Contributors
TBA