<?xml version="1.0" encoding="US-ASCII"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
<?rfc toc="yes"?>
<?rfc tocompact="yes"?>
<?rfc tocdepth="3"?>
<?rfc tocindent="yes"?>
<?rfc symrefs="yes"?>
<?rfc sortrefs="yes"?>
<?rfc comments="yes"?>
<?rfc inline="yes"?>
<?rfc compact="yes"?>
<?rfc subcompact="no"?>
<rfc category="std" docName="draft-dong-mpls-mna-encaps-00" ipr="trust200902">
  <front>
    <title abbrev="MNA Solution">Encapsulation of MPLS Network Actions and
    associated Data</title>

    <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="Tianran Zhou" initials="T." surname="Zhou">
      <organization>Huawei Technologies</organization>

      <address>
        <postal>
          <street/>

          <city>Beijing</city>

          <country>China</country>
        </postal>

        <email>zhoutianran@huawei.com</email>
      </address>
    </author>

    <date day="24" month="July" year="2022"/>

    <area>Routing Area</area>

    <workgroup>MPLS Working Group</workgroup>

    <abstract>
      <t>This document specifies a solution for carrying MPLS network actions
      and the associated data either in the MPLS label stack or after the MPLS
      label stack.</t>
    </abstract>
  </front>

  <middle>
    <section title="Introduction">
      <t>The use cases and requirements to carry additional network
      instructions and the associated data in data packets in MPLS networks,
      i.e., MPLS Network Actions (MNA), are described in <xref
      target="I-D.ietf-mpls-mna-usecases"/> and <xref
      target="I-D.ietf-mpls-mna-requirements"/> respectively. <xref
      target="I-D.andersson-mpls-mna-fwk"/> introduces a framework of MNA, in
      which the In-stack Data (ISD) and Post-Stack Data (PSD) are considered
      as two possible mechanisms to carry the MPLS network actions and the
      optional data associated with the actions.</t>

      <t>This document specifies a general solution for carrying MPLS network
      actions and the optional data associated with the network actions either
      in the MPLS label stack or after the MPLS label stack. The specification
      of specific type of network action and the associated data is out of the
      scope of this document.</t>

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

    <section title="Design Principles">
      <t>The MPLS architecture as specified in <xref target="RFC3031"/>
      provides a mechanism for forwarding packets through a network without
      requiring any analysis of the packet payload's network layer header by
      intermediate nodes (Label Switching Routers - LSRs). The encoding of
      MPLS label stack is specified in <xref target="RFC3032"/>.</t>

      <t>Section 3.1 of <xref target="I-D.ietf-mpls-mna-requirements"/>
      provides the general requirements on the MNA solution. Specifically, it
      is required that any solution must maintain the properties of MPLS:
      extensibility, flexibility and efficiency by using control plane context
      combined with a simple data plane mechanism to allow the network to make
      forwarding decisions about a packet.</t>

      <t>The proposed solution in this document aims to meet the requirements
      in <xref target="I-D.ietf-mpls-mna-requirements"/> with the following
      design principles:</t>

      <t><list style="symbols">
          <t>Minimize the length of MNA information carried as ISD in the MPLS
          label stack. When ISD is needed, an ISD design with fixed length is
          RECOMMENDED.</t>

          <t>Carry the MNA information with large and/or variable length and
          possibly flexible structure as PSD in the post-stack extension
          headers as defined in <xref
          target="I-D.song-mpls-extension-header"/>.</t>
        </list></t>
    </section>

    <section title="MNA Indicator">
      <t>The MNA Indicator is introduced to indicate the presence of any MNA
      information in the packet. It can be used to indicate the existence of
      MNA actions and the optional associated data in the ISD, or the PSD or
      both. Since this indicator is generic for all types of MPLS network
      actions, it is reasonable to allocate a basic Special Purpose MPLS label
      (bSPL) for it. The TC and TTL fields of the MNA Indicator are redefined
      as flags.</t>

      <t>The format of the MNA Indicator is shown as below:</t>

      <t><figure>
          <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
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |       MNA Indicator=SPL (TBA)         |H|I|P|S|ISF|    RSV    |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
               Figure 1. The format of MNA Indicator ]]></artwork>
        </figure></t>

      <t>Where:</t>

      <t><list style="symbols">
          <t>MNA Indicator label: A new bSPL, the value is TBA by IANA.</t>

          <t>H (Hop-by-Hop processing) flag: When set, it indicates that the
          MNA information in the packet needs to be processed hop-by-hop.</t>

          <t>I (In-stack MNA information) flag: When set, it indicates the
          next label entry is used to carry the MNA information.</t>

          <t>P (Post-stack MNA information) flag: When set, it indicates there
          is post-stack data following the MPLS label stack.</t>

          <t>S: Bottom of Stack. The value of the S bit depends on the
          position of the MNA indicator in the label stack.</t>

          <t>ISF (In-stack data Format): The first 2-bit of the original TTL
          field. When the I bit is set, the ISF field is used to indicate the
          format of the in-stack MNA information in the following label
          stack.The following ISF values are defined in this document. <list
              style="symbols">
              <t>ISF = 00: There is no in-stack MNA information. When the I
              flag is 0, the value of the ISF field MUST be set to 0 on
              transmit and MUST be ignored on receipt.</t>

              <t>ISF = 01: The following label stack entry is used to carry a
              list of network actions without any associated data.</t>

              <t>ISF = 10: The following label stack entry is used to carry a
              domain significant label value which could be used by the
              network nodes to determine the set of network actions based on
              local policy.</t>

              <t>ISF = 11: Reserved. It could be used to indicate other format
              of the in-stack MNA information.</t>
            </list></t>

          <t>RSV: The rest 6 bits in the original TTL field are reserved for
          future use. They MUST be set to 0 on transmit and MUST be ignored on
          receipt.</t>
        </list></t>
    </section>

    <section title="In-stack Network Actions without Data">
      <t>When the I flag in the MNA Indicator is set, and the ISF field is set
      to 01, the MPLS label stack entry which follows the MNA indicator is
      encoded as a list of flags of network actions which do not require any
      associated action data to be carried in the packet.</t>

      <t>The format of the In-stack network actions without data is shown as
      below:</t>

      <t><figure>
          <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
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |    In-stack action flags w/o data     |  TC |S|     TTL       |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      Figure 2. The format of In-stack action flags without Data]]></artwork>
        </figure></t>

      <t>Where:</t>

      <t><list style="symbols">
          <t>Label field: The 20-bit label field is used to encode the
          in-stack network actions which do not require any associated
          data.</t>

          <t>TC field: The value of the TC field SHOULD be set to zero. It be
          may be redefined for future use.</t>

          <t>TTL field: The value of TTL field SHOULD be set to 0. This is to
          ensure that it is not used inadvertently for forwarding. It may be
          redefined for future use.</t>
        </list></t>
    </section>

    <section title="In-stack Network Actions Identifier">
      <t>When the I flag in the MNA Indicator is set, and the ISF field is set
      to 10, the MPLS label stack entry which follows the MNA indicator is
      encoded as a domain significant label value which could be used by the
      network nodes to determine the set of network actions to be performed
      based on local policy. This label serves as an implicit identifier of
      the in-stack network actions. The encoding and functionality is the same
      as the Reference Forwarding Value (RFV) as defined in<xref
      target="I-D.raszuk-mpls-raf-fwk"/>.</t>

      <t>The format of in-stack network actions identifier is shown as
      below:</t>

      <t><figure>
          <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
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |                 RFV                   |  TC |S|    TTL=0      |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      Figure 3. The format of In-stack Network Actions Identifier]]></artwork>
        </figure></t>

      <t>Where:</t>

      <t><list style="symbols">
          <t>RFV (Referenced Forwarding Value), this is defined in <xref
          target="I-D.raszuk-mpls-raf-fwk"/>.</t>

          <t>TC: The value of the TC field SHOULD be set to zero. It be may be
          redefined for future use.</t>

          <t>S: Bottom of Stack.</t>

          <t>TTL: The value of the TTL field SHOULD be set to 0. It may be
          redefined for future use.</t>
        </list></t>
    </section>

    <section title="Post-stack Network Actions with Data">
      <t>When the P flag in the MNA Indicator is set, it indicates there is
      post-stack data (PSD) carried after the MPLS label stack. The encoding
      of post-stack network actions and the optional associated data is based
      on the MPLS post-stack extension headers as defined in <xref
      target="I-D.song-mpls-extension-header"/>.</t>
    </section>

    <section anchor="IANA" title="IANA Considerations">
      <t>IANA is requested to allocate a new value for the MNA Indicator label
      from the "Base Special-Purpose MPLS Label Values" registry.</t>

      <t>IANA is requested to create a new registry for the bit positions of
      the In-stack network action flags without data.</t>
    </section>

    <section anchor="Security" title="Security Considerations">
      <t>TBD</t>
    </section>

    <section anchor="Acknowledgements" title="Acknowledgements">
      <t>The authors would like to thank XXX for the review and
      discussion.</t>
    </section>
  </middle>

  <back>
    <references title="Normative References">
      <?rfc include="reference.RFC.2119"?>

      <?rfc include='reference.RFC.8174'?>

      <?rfc include='reference.RFC.3031'?>

      <?rfc include='reference.RFC.3032'?>
    </references>

    <references title="Informative References">
      <?rfc include='reference.I-D.ietf-mpls-mna-requirements'?>

      <?rfc include='reference.I-D.ietf-mpls-mna-usecases'?>

      <?rfc include='reference.I-D.andersson-mpls-mna-fwk'?>

      <?rfc include='reference.I-D.song-mpls-extension-header'?>

      <?rfc include='reference.I-D.raszuk-mpls-raf-fwk'?>
    </references>
  </back>
</rfc>
