<?xml version="1.0" encoding="US-ASCII"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
<!-- <?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?> -->
<?rfc strict="yes" ?>
<?rfc toc="yes"?>
<?rfc tocdepth="4"?>
<?rfc symrefs="yes"?>
<?rfc sortrefs="yes" ?>
<?rfc compact="yes" ?>
<?rfc subcompact="no" ?>
<rfc category="info" docName="draft-raszuk-mpls-raf-fwk-00"
     ipr="trust200902" obsoletes="" submissionType="IETF" updates="">

  <front>
    <title abbrev="MPLS RAF">Framework of MPLS Reference Augmented Forwarding</title>

 <author fullname='Robert Raszuk' initials='R' surname='Raszuk' role='editor'>
    <organization>NTT NI</organization>
    <address>
        <postal>
            <street></street>
            <city></city>
            <region></region>
            <code></code>
            <country></country>
        </postal>
        <email>robert@raszuk.net</email>
    </address>
</author>

<date year="2022" />
<area>Routing</area>
<workgroup>MPLS Working Group</workgroup>
<keyword>I-D</keyword>
<keyword>Internet-Draft</keyword>
<keyword>MPLS</keyword>

    <abstract>
      <t> This document specifies an architectural framework for enabling 
          MPLS based forwarding with optional reference based packet
          processing in transit network elements.</t>
    </abstract>

    <note title="Requirements Language">
      <t>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 <xref
      target="RFC2119">RFC 2119</xref>.</t>
    </note>

  </front>

  <middle>

    <section title="Introduction">
    
      <t> Growth of network services results in increased demand for custom 
          transit packet processing. Traditional per destination based best 
          effort or constrained based forwarding is no longer sufficient. Hop 
          by hop switching in addition to label or destination based LSP 
          switching can be augmented with additional packet processing at all 
          or at selective transit network elements.</t>

      <t> Such additional processing can be triggered in a number of ways. 
          Today some networks can apply local policies which enable selective
          processing on subset of packets based on the header's elements. 
          Alternative to such filtering is to embed additional information 
          in the packet header itself to indicate implicitly or explicitly 
          what additional processing is required.</t>

      <t> Examples of explicit encoding of such network actions can be found in 
          <xref target="RFC8986">SRv6 Network Programming</xref> document. For 
          MPLS data plane an analogy to SRv6 has been recently proposed in 
          <xref target="I-D.andersson-mpls-mna-fwk">draft-andersson-mpls-mna-fwk 
          </xref>.</t>

      <t> In this document authors propose an implicit model. Instead of explicitly 
          encoding all required actions as a variable size ordered list in every 
          packet this document proposes to insert fixed size 20 bit reference 
          identifier. Such value will be used to mark groups of flows with 
          identical custom forwarding behaviour.</t> 

      <t> By forwarding behaviour (further abbreviated as FB) this document 
          assumes additional network actions which may exclude packet from 
          default processing, may include additional security screening, 
          OAM triggering actions or any other special handling including, 
          but not limited to rate limited, queue mapping, redirection etc ... </t>

    </section>

    <section title="Terminology">

      <section title="Definitions">

        <t><list style="symbols">

           <t> Network Action aka Forwarding Behaviour: An operation to be performed 
               on a packet or be triggered based on given packet's arrival without 
               affecting the packet switching decision. A network action may affect 
               forwarding decisions, queuing classification, OAM measurement and 
               reporting etc .... Network Actions are not carried in packets. They 
               are distributed by configuration or control plane.</t>  

           <t> Reference Augmented Forwarding: Packet forwarding in addition to
               or instead of normal lookup (by address or label) based on a set of 
               Network Actions or Forwarding Behaviours indicated by Reference 
               Identifier.</t>

           <t> Reference Forwarding Value: A 20 bit value carried in a packet 
               used to identify a set of Network Actions defining given packet's 
               special handling.</t>

           <t> Reference Forwarding Indicator: A base Special Purpose Label 
               carried in a packet used to indicate to the packet processor that 
               the following LSE is containing Reference Forwarding Value.</t>


        </list></t>
      
      </section>

      <section title="Abbreviations">

        <t><list style="symbols">

           <t> FB - Network Actions or Forwarding Behaviours</t>  
           <t> LSE - Label Stack Entry</t>
           <t> RAF - Reference Augmented Forwarding</t>
           <t> bSPL - Base Special Purpose Label</t>
           <t> ECMP - Equal Cost Multipath</t>
           <t> RFI - Reference Forwarding Indicator</t>
           <t> RFV - Reference Forwarding Value</t>
           <t> TBA - To Be Allocated</t>
           <t> SDN - Software Defined Network</t>

        </list></t>
      
      </section>

    </section>

    <section title="Encoding">

      <t> A Reference Forwarding Value MUST be clearly distinguished from 
          any forwarding label. LSE immediately preceding label stack entry 
          containing RFV is called Reference Forwarding Indicator. RFI is 
          REQUIRED to use Special Purpose Label value (TBA by IANA).</t>

      <t><figure align='center' anchor='Figure_1' title='RFI and RFV Tuple'>
         <artwork>
  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
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |               RFI - bSPL              | TC  |S|      TTL      |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |                  RFV                  | TC  |S|      TTL      |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
               RFI:    Reference Forwarding Indicator, 20 bits
               RFV:    Reference Forwarding Value, 20 bits
               TC:     Traffic Class, 3 bits
               S:      Bottom of Stack, 1 bit
               TTL:    Time To Live
      </artwork></figure></t>

      <t> RFI and RFV tuple is always of fixed size of 8 octets. It also should
          occur only once in a given packet. It is optional. If a network uses the
          concept of LSPs it MUST be placed after the topmost label. If LSP is 
          not setup and the network uses the concept of SDN based path computation 
          it can be preset as topmost LSE. </t>

      <t> How to set values of the TTL, TC, and Bottom of Stack (S bit) fields 
          <xref target="RFC3032"></xref> for the RFI and RFV entries should be 
          the same as described in <xref target="RFC6790"></xref> Section 4.2.  
          Ingress LSR SHOULD put the same TTL and TC fields for the RFI as
          it does for transport label.  Such ingress LSR MAY choose different 
          values for the TTL and TC fields if it is known that the RFI will 
          not be exposed as the top label at any point along the LSP (as may 
          happen in cases where PHP is used and the RFI and RFV are not 
          stripped at the penultimate hop. The BoS bit for the RFI MUST be 
          set to zero (i.e., BoS is not set).  The TTL for the RFV MUST be 
          zero to ensure that it is not used inadvertently for forwarding.  
          The TC for the RFV may be any value.  The BoS bit for the RFV 
          depends on whether or not there are more labels in the label stack.</t>

    </section>

    <section title="Processing">

      <t> Any network element can insert, delete or modify RFV or RFI-RFV tuple
          if instructed to do so by special action instructions.</t> 

      <t> If a network element understands RFI and recognizes based on the top most 
          lable value special handling requirement it MAY direct packet for special
          processing. MAY or MUST processing of all requested actions (or subset of 
          those actions) really depend on the special action instructions.</t>

    </section>

    <section title="Reference to Special Instructions Mapping ">

      <t> As the proposed architecture is based on indirection, what is present in 
          the packet is only a reference to special handling instructions. Such 
          instructions are not to be explicitly carried in the packet. As each 
          network operator has a different set of operational preferences, embedding 
          insertion of actions into a data plane parsing of each packet is very 
          operationally limiting and inefficient.</t> 

      <t> Special Network Actions or Forwarding Behaviours are to be distributed 
          by configuration or by control plane. Details of their distribution are 
          outside of scope of this framework document. However, it is important 
          to recognize that this model in its roots allows open innovation for 
          vendors in developing accelerated data plane action dictionaries as 
          mapping and execution has only a local scope.</t>

      <t> It needs to be further observed that format of such configuration or 
          control plane (including PUB-SUB model) distributed Forwarding 
          Behaviours MAY have a TLV/sub-TLV structure as illustrated on Figure 
          2 and 3 below:</t>

  <t><figure align='center' anchor='Figure_2' title='FB TLV'><artwork>
  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
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |      Type     |    Flags      |            Length             |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                          DST NODE ID(s)                       |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                              RFV                              |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                           Sub-TLV(s)                          |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  </artwork></figure></t>

  <t><figure align='center' anchor='Figure_3' title='FB sub-TLV'><artwork>
  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
 +-+-+-+-+-+-+-+-+
 |     Type      |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |            Length             |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |   Special Actions and Optional Ancillary Data (variable)      |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 </artwork></figure></t>

      <t> With such encoding option it needs to be observed that for a given RFV 
          only nodes listed in the TLV will accept and install special handling 
          instructions. </t>

    </section>

    <section title="Operational Considerations">

      <t> The proposed model is designed to operate both in the networks using 
          traditional MPLS LSP (with local labels) as well with SR-MPLS (domain 
          wide labels).</t>

      <t> Nodes which utilize MPLS LSPs and did not receive any special handling 
          instructions via control plane are NOT REQUIRED to inspect anything 
          above the top label and will continue to perform basic label switching. 
          If a node is enabled to perform additional actions on the packets it 
          should leave the RFI/RFV tuple as received immediately after the top 
          label swap on the stack. The PHP action may take place as usuall 
          exposing RFI LSE. In such cases egress LSR MUST be able to understand 
          bSPL and either discard RFI/RFV tuple or if configured so execute 
          special actions on those packets before further forwarding it.</t>

      <t> [Discussion point for WG: Should nodes inserting additional labels on the 
          stack for example during FRR should copy the RFI/RFV to enable it to 
          be executed on the repair path or not ?].</t>

      <t> Nodes which utilize the concept of SR-MPLS and use global labels as a 
          replacement for use of LDP can apply the same set of procedures as 
          nodes using MPLS-LSP. </t>

      <t> Nodes which utilize the concept of SR-MPLS and use global labels with 
          segment endpoints encoded in the label stack MUST understand RFI 
          bSPL in order to correctly copy the tuple to always place it immediately 
          behind the top most segment endpoint during label stack modification.</t>

      <t> To further simplify the concept of MPLS RAF deployment networks which 
          utilize concept of domain wide labels can allocate two label values 
          from each LSR. One would indicate non RAF forwarding and the other one 
          RAF enhanced forwarding. With such allocation only nodes which recognize
          that arriving packets contain RAF aware label value and which received 
          any special handling instructions may need to perform additional RFI/RFV 
          lookup and processing. Such allocation may be unified to differentiate 
          normal vs RAF enabled labels with common label block offset or selected  
          label bit set.</t>

    </section>

    <section title="Capability Advertisement">

      <t>This document does not require any new capability to be defined.</t>
      
    </section>

    <section anchor="IANA" title="IANA Considerations">

      <t>This document defines a new bSPL label called Reference 
         Forwarding Indicator and is requesting IANA to allocate 
         one from Base Special-Purpose MPLS Label Values registry.</t>

    </section>

    <section anchor="Security" title="Security Considerations">

      <t>This document does not introduce any new security risks.</t>

    </section>

    <section anchor="Acknowledgements" title="Acknowledgements">

      <t>Author would like to thank Tony Li and Jeff Tantsura for encouraging
         me to write this up.</t>

    </section>
  </middle>

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

    <references title="Informative References">
      <?rfc include="reference.RFC.8986"?>
      <?rfc include="reference.I-D.andersson-mpls-mna-fwk"?>
    </references>
  </back>
</rfc>
