<?xml version="1.0" encoding="UTF-8"?>
<rfc xmlns:xi="http://www.w3.org/2001/XInclude" category="std" ipr="trust200902" docName="draft-smm-bess-alt-label-00">
<?rfc toc="yes"?>
<?rfc compact="yes"?>
<?rfc subcompact="no"?>

  <!-- ***** FRONT MATTER ***** -->

  <front>
    <title abbrev="Alt-Label">Signaling Alternative Labels for BGP Prefixes</title>

    <author initials="S" surname="Sethuram" fullname="Shyam Sethuram"> 
    <organization>Cisco Systems</organization>
      <address>
        <email>shyam.ioml@gmail.com</email>
      </address>
    </author>
    <author initials="M" surname="Mishra" fullname="Mankamana Mishra"> 
    <organization>Cisco Systems</organization>
      <address>
        <email>mankamis@cisco.com</email>
      </address>
    </author>
    <author fullname="Satya Ranjan Mohanty" initials="S R." surname="Mohanty">
      <organization>Zscaler</organization>
      <address>
        <email>smohanty@zscaler.com</email>
      </address>
    </author>
    <author fullname="Israel Means" initials="I." surname="Means">
      <organization>AT&amp;T Labs, Inc.</organization>
      <address>
        <email>im8327@att.com</email>
      </address>
    </author>
    <author fullname="Praveen Ramadenu" initials="P." surname="Ramadenu">
      <organization>AT&amp;T Labs, Inc.</organization>
      <address>
        <email>pr9637@att.com</email>
      </address>
    </author>

    <date year="2025"/>    
    <area>Routing</area>
    <workgroup>BESS Workgroup</workgroup>
    <keyword>bgp</keyword>

    <abstract>
      <t>A single MPLS label or a label stack is advertised along with an
         address prefix as part of the NLRI belonging to labeled address families
         such as Labeled Unicast (RFC 8277), VPN (RFC 4364), etc.
      </t>
      <t>This document specifies a method to advertise one or more additional,
         alternative labels for a set of address prefixes using the Next Hop
         Dependent Characteristics (NHC) attribute.
      </t>
    </abstract>

    <note 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>
    </note>

  </front>

  <!-- ***** MIDDLE MATTER ***** -->

  <middle>

    <section anchor="sect-1" title="Introduction">
      <t>A single MPLS label or a label stack is advertised along with an NLRI
         belonging to labeled address families such as
         Labeled Unicast <xref target="RFC8277"/> <xref target="RFC4798"/>,
         VPN <xref target="RFC4364"/> <xref target="RFC4659"/>, etc.
         In certain topologies, it would be useful to advertise one or more additional,
         alternative labels associated with the same NLRI.
      </t>
      <t>This document proposes a method to encode and send such alternative labels
         using BGP Next Hop Dependent Characteristic (NHC) attribute
         <xref target="I-D.ietf-idr-entropy-label"/>.
      </t>
    </section>

    <section anchor="sect-2" title="Alternative-Label Next Hop Characteristic">

      <t>The BGP Next Hop Dependent Characteristics attribute (NHC attribute) is
         an optional, transitive BGP path attribute defined in
         <xref target="I-D.ietf-idr-entropy-label"/> consisting of the
         Next Hop address and a list of Characteristic TLVs among other things.
      </t>
      <t>A new Characteristic TLV Type called the Alternative-Label Characteristic
         is used to encode alternative labels for an NLRI. It is also referred to
         as Alt-Label Characteristic in this document.
      </t>

      <t>The encoding of the Alt-Label Characteristic TLV is shown below:
      </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
        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
        |  Characteristic Code          |  Characteristic Length        |
        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
        |  Label Type   |  Reserved                     |
        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
        |  Label Value                                  |
        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

        ]]></artwork>
      </figure>

      <list style='hanging'>
        <t hangText='Characteristic Code:'>
          Assigned by IANA to be [TBD].
        </t>
        <t hangText='Characteristic Length:'>
          Length of the Characteristic Value - set to 6.
        </t>
        <t hangText='Label Type:'>
          1 octet representing the type of alternative label. This field
          is assigned values from a new IANA registry called "BGP
          Alternative-Label Label Types".
        </t>
        <t hangText='Reserved:'>
          2 octets reserved field for future use; MUST be set to 0 when sending
          and SHOULD be ignored when received.
        </t>
        <t hangText='Label Value:'>
          3 octets encoding one MPLS Label <xref target="RFC3032"/>.
        </t>
      </list>

      <t>This document specifies Label Type 1, called "Extra-domain Label", described
         in later sections. Future documents may specify newer Label Types and
         allocate them in the IANA registry mentioned above.
      </t>

      <t>As depicted above, each Characteristic TLV supports encoding of a single
         label only i.e., label stack encoding is not supported.
      </t>

      <section anchor="sect-2.1" title="Operational behavior">
        <t>Unless specified otherwise in this document, advertisement and receive
           processing of the NHC attribute and the Alt-Label Characteristic TLVs
           follow the general behavior outlined in <xref target="I-D.ietf-idr-entropy-label"/>.
        </t>

        <t>This section specifies the general behavior for processing any Label Type.
           This behavior MAY be overridden for specific Label Types by documents
           that specify those Types.
        </t>

        <section anchor="sect-2.1.1" title="Sending Alt-Label Characteristic">
          <t>A router that originates a route may attach the NHC attribute containing
             one or more Alt-Label Characteristic TLVs. More than one such TLV may
             contain the same Label Type but with different label values.
          </t>
        </section>

        <section anchor="sect-2.1.2" title="Receiving Alt-Label Characteristic">
          <t>On the receiving router:
          </t>
          <ul>
            <li>any valid label in the received Alt-Label Characteristic TLV may
                be installed in the corresponding route forwarding entries as the
                outgoing label.
            </li>

            <li>if more than one valid label is received, it is a matter of local policy
                to decide which of those labels are installed under what conditions.
            </li>

            <li>if the received route is re-advertised by the router without changing
                the Next Hop, the received Alt-Label Characteristic TLVs MUST be
                re-advertised without modification.
            </li>

            <li>if the received route is re-advertised by the router setting itself as
                the new Nexthop:

                <ul>
                  <li>all received Alt-Label Characteristic TLVs SHOULD be removed from
                      the NHC attribute.
                  </li>
                  <li>one or more new labels MAY be allocated for the route locally,
                      and MAY be advertised encoded in Alt-Label Characteristic TLVs
                      within the NHC attribute.
                  </li>
                </ul>
            </li>
          </ul>

        </section>

      </section>

    </section>

    <section anchor="sect-3" title="Extra-domain Label Type">

      <t>This document defines a new label type called "Extra-domain Label" which
         is assigned a value of Label Type 1. This label type indicates that
         any traffic destined to that label will be forwarded to one or more
         next hops that belong to domain(s) that are different from where the
         traffic ingressed. This behavior holds true whether such next hops
         are part of a prefix's bestpaths or backup paths or any other alternate
         paths.
      </t>

      <t>What constitutes a "domain" is outside the scope of this document, and
         is defined based on local policy or configuration. One simple instance
         of a domain is an Autonomous System, in which case, as an example,
         an extra-domain label L that receives traffic from ASN-X would switch
         that traffic towards ASNs other than ASN-X. Other examples of a domain
         may be an IGP area within a single Autonomous System, or a domain
         spanning multiple Autonomous Systems, and so on.
      </t>

      <section anchor="sect-3.1" title="Sending Extra-domain label">
        <t>A router may allocate one or more extra-domain labels in addition to
           a "primary" label associated with the same route. The primary label is
           encoded as part of the NLRI (for example, <xref target="RFC8277"/>
           <xref target="RFC4364"/> etc) while the extra-domain labels would be
           encoded using the Alt-Label Characteristic TLVs.
        </t>
      </section>

      <section anchor="sect-3.2" title="Receiving Extra-domain label">
        <t>On the receiving router:
        </t>

        <ul>
          <li>the extra-domain label may be installed in the corresponding route
              forwarding entry as the outgoing label. Specifically this label can
              be installed when the route is installed as the backup path or
              the FRR path of a prefix. This is so that any traffic forwarded
              towards that label in the event of bestpaths failure will not loop
              back to this router.
          </li>

          <li>if the received route is re-advertised without changing the Nexthop, the
              received label(s) MUST be re-advertised without modification.
          </li>

          <li>if the received route is re-advertised by the router after setting itself
              as the new Nexthop:

              <ul>
                <li>the received label(s) MUST be removed from the NHC Alt-Label
                    Characteristic TLV(s).
                </li>
                <li>one or more new extra-domain labels MAY be allocated locally
                    and advertised by encoding them in Alt-Label Characteristic TLVs.
                </li>
              </ul>
          </li>
        </ul>

      </section>

      <section anchor="sect-3.3" title="Application of Extra-domain labels">
        <t>This section illustrates an use case where allocating an addtional
           label for a prefix and advertising it using the Alt-Label Characteristic
           TLV within the NHC attribute can help break a continuous loop of
           advertisements.
        </t>

        <figure>
          <artwork><![CDATA[

                    +---------------------------------+
                    |                 |               |
                    |              +----+             |
                    |              |PE3 |             |
                    |             /+----+\            |
                    |            /        \           |
                    |           /          \          |
                    |        +----+       +----+      |
                    |        |BR1 |-------|BR2 |      |
                    |        +----+       +----+      |
                    |           \           /         |
                    |            \         /          |
                    |             \       /           |
                    |              +----+             |
                    |              |PE4 |             |
                    |              +----+             |
                    |                 |               |
                    +---------------------------------+


             Figure 1: A pair of Border Routers backing up each other

          ]]></artwork>
        </figure>

        <t>The diagram depicts two Border Routers (BR1, BR2) peering with each
           other, as well as two PEs (PE3, PE4). PE3 originates some VPN routes
           which are advertised to BR1 and BR2, which in turn advertise them to PE4.
        </t>

        <list style='hanging'>
          <t hangText='Step 0:'>
            PE3 originates VPN routes and advertises them to BR1 and BR2.
          </t>

          <t hangText='Step 1:'>
            Each Border Router considers its direct path to PE3 as the bestpath
            and selects the other Border Router as its backup path.
          </t>

          <t hangText='Step 2:'>
            Initially, BR1 receives the primary path from PE3 with label L3.
            Local Label L11 is allocated with context {(PE3, L3)}. This is
            advertised to BR2 and PE4.
          </t>

          <t hangText='Step 3:'>
            Similarly, BR2 receives the primary path from PE3 with label L3.
            Local Label L21 is allocated with context {(PE3, L3)}.
            This is advertised to BR1 and PE4.
          </t>

          <t hangText='Step 4:'>
            BR1 receives the update from BR2 and selects it to be the backup
            path.  It now allocates a new local label L12 with context
            {(PE3, L3), (BR2, L21)}.
            This is advertised to BR2 and PE4.
          </t>

          <t hangText='Step 5:'>
            BR2 receives the new update from BR1. It now allocates a new local
            label L22 with context {(PE3, L3), (BR1, L12)}.
            This is advertised to BR1 and PE4.
          </t>

          <t hangText='Step 6:'>
            BR1 receives the new update from BR2. It now allocates a new local
            label L13 with context {(PE3, L3), (BR2, L22)}.
            This is advertised to BR2 and PE4.
          </t>

          <t hangText='Step 7:'>
            BR2 receives the new update from BR1. It now allocates a new local
            label L23 with context {(PE3, L3), (BR1, L13)}.
            This is advertised to BR2 and PE4.
          </t>
        </list>

        <t>The above operations continue forever resulting in a continuous loop
           of label allocations and advertisements.
        </t>

        <t>The solution to the above problem involves each Border Router
           allocating an additional label whose context points to only the
           bestpath without including any backup path information.
        </t>

        <t>Accordingly, the modified steps are described below:
        </t>

        <list style='hanging'>
          <t hangText='Step 4:'>
            BR1 receives the update from BR2 and selects it to be the backup path.
            It now allocates a new local label L12 with context
            {(PE3, L3), (BR2, L21)}.
            In the route advertisement to BR2 and PE4, label L12 is encoded as
            part of the NLRI while label L11 is encoded as an extra-domain label
            in Alt-Label Characteristic TLV.
          </t>

          <t hangText='Step 5:'>
            BR2 receives the update from BR1 and selects it to be the backup path.
            It now allocates a new local label L22 with context
            {(PE3, L3), (BR2, L11)}.
            Note that BR2 uses the extra-domain label L11 received in the Alt-Label
            Characteristic TLV when allocating its new local label L22.
            In the route advertisement to BR1 and PE4, label L22 is encoded as
            part of the NLRI while label L21 is encoded as an extra-domain label in
            Alt-Label Characteristic TLV.
          </t>

          <t hangText='Step 6:'>
            BR1 receives the new update from BR2. It now sees the label L21 in the
            Alt-Label Characeristic TLV and determines no need for a change in the
            already allocated label (L12) context which is {(PE3, L3), (BR2, L21)}.
            Hence there is no new route advertisement.
          </t>
        </list>

      </section>

    </section>

    <section anchor="sect-4" title="Error Handling">

      <t>In case of any errors encountered while processing Alt-Label
         Characteristic TLV, the error SHOULD be logged for the attention of
         the operator. Unless otherwise specified, the error handling specified
         for NHC attribute in <xref target="I-D.ietf-idr-entropy-label"/>
         should be followed.
      </t>

      <t>If the Length of the Alt-Label Characteristic TLV is not 6, then the
         TLV MUST be parsed according to the encoded length and MUST be ignored.
         Subsequent TLVs of the NHC attribute SHOULD continue to be parsed normally.
      </t>

      <t>It is not an error to receive an unrecognized Label Type value in
         this Characteristic TLV.  Such labels MUST be processed according to
         <xref target="sect-2.1.2"/>.
      </t>

      <t>If more than one instance of a TLV with the exact same Label Type
         and Label value fields are received, then all but the first instance
         MUST be ignored.
      </t>

      <t>It is not an error to receive more than one TLV instance with
         the same Label Type but different Label values. One or more of those
         labels MAY be used locally, and all such labels MUST be considered for
         further propagation subject to the behavior specified
         in <xref target="sect-2.1.2"/>.
      </t>

      <section anchor="sect-4.1" title="Extra-domain Label Type">
        <t>When receving the Extra-domain Label Type, if syntactic or semantic
           errors are encountered while parsing the Label field, then only
           that TLV MUST be ignored.
        </t>
        <t>It is not an error to receive more than one extra-domain label.
           One or more of those labels MAY be used locally, and all
           such labels MUST be considered for further propagation subject to
           the behavior specified in <xref target="sect-2.1.2"/>. The exact
           conditions under which a particular label may be selected for
           installation in local route forwarding entries is beyond the scope
           of this document and left to the local application.
        </t>

      </section>

    </section>

    <section anchor="sect-5" title="IANA Considerations">
      <t>This document requests IANA to allocate a new type code in the
         in the "BGP Next Hop Dependent Characteristic Codes" registry to
         represent "Alternative-Label Characteristic".
      </t>

      <t>This document requests IANA to create a new registry called
         "BGP Alternative-Label Label Types" with the following initial
         allocations. The remainder of the values in the registry are to
         be allocated based on a First Come, First Served policy.
      </t>

      <figure>
        <artwork><![CDATA[

          VALUE    DESCRIPTION              REFERENCE     CHANGE CONTROLLER
          -------  -----------              ---------     -----------------

          0        Reserved                 (this doc)    IETF
          1        Extra-domain Label       (this doc)    IETF
          240-254  Private use              (this doc)    IETF
          255      Reserved                 (this doc)    IETF

        ]]></artwork>
      </figure>

    </section>

    <section anchor="sect-6" title="Security Considerations">
      <t>The security considerations of the base NHC attribute described in
         <xref target="I-D.ietf-idr-entropy-label"/> continues to apply.
      </t>

      <t>The labels signaled using the new Alternative-Label Characteristic TLV
         is tightly associated with the Next Hop signaled in the NHC attribute.
         If this consistency is not maintained, intentionally or otherwise,
         it could lead to traffic mis-direction or blackholing.
         An implementaion MAY provide a local configuration option to disable
         installation and propagation of such received labels for
         specific address-families, specific routes, etc.
      </t>

    </section>

  </middle>

  <!-- ***** BACK MATTER ***** -->

  <back>

    <references anchor="sect-references" title="References">

      <references anchor="sect-norm-references" title="Normative References">
        <?rfc include="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml"?>

        <?rfc include="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.3032.xml"?>

        <?rfc include="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.4271.xml"?>

        <?rfc include="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.4364.xml"?>

        <?rfc include="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.4659.xml"?>

        <?rfc include="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.4760.xml"?>

        <?rfc include="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.4798.xml"?>

        <?rfc include="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.7606.xml"?>

        <?rfc include="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.8174.xml"?>

        <?rfc include="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.8277.xml"?>

        <?rfc include="reference.I-D.draft-ietf-idr-entropy-label-18.xml"?>

      </references>

      <references anchor="sect-info-references" title="Informative References">
        <?rfc include="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.5065.xml"?>

      </references>

    </references>

    <section title="Acknowledgements">
      <t>
      </t>
    </section>

  </back>

</rfc>
