<?xml version="1.0" encoding="utf-8"?>
<!-- 
     draft-rfcxml-general-template-annotated-00
  
     This template includes examples of most of the features of RFCXML with comments explaining 
     how to customise them, and examples of how to achieve specific formatting.
     
     Documentation is at https://authors.ietf.org/en/templates-and-schemas
-->
<?xml-model href="rfc7991bis.rnc"?>  <!-- Required for schema validation and schema-aware editing -->
<!-- <?xml-stylesheet type="text/xsl" href="rfc2629.xslt" ?> --> 
<!-- This third-party XSLT can be enabled for direct transformations in XML processors, including most browsers -->

<!DOCTYPE rfc [
  <!ENTITY nbsp    "&#160;">
  <!ENTITY zwsp   "&#8203;">
  <!ENTITY nbhy   "&#8209;">
  <!ENTITY wj     "&#8288;">
]>
<!-- If further character entities are required then they should be added to the DOCTYPE above.
     Use of an external entity file is not recommended. -->

<rfc
  xmlns:xi="http://www.w3.org/2001/XInclude"
  category="info"
  docName="draft-haas-idr-bgp-diffract-00"
  ipr="trust200902"
  obsoletes=""
  updates=""
  submissionType="IETF"
  xml:lang="en"
  version="3">
<!-- 
    * docName should be the name of your draft
    * category should be one of std, bcp, info, exp, historic
    * ipr should be one of trust200902, noModificationTrust200902, noDerivativesTrust200902, pre5378Trust200902
    * updates can be an RFC number as NNNN
    * obsoletes can be an RFC number as NNNN 
-->

  <front>
    <title abbrev="draft-haas-idr-bgp-diffract">Interoperability Procedures for BGP Routes with Color</title> <!-- https://authors.ietf.org/en/rfcxml-vocabulary#title-4 -->
    <!--  The abbreviated title is required if the full title is longer than 39 characters -->

    <seriesInfo name="Internet-Draft" value="draft-haas-idr-bgp-diffract-00"/> <!-- https://authors.ietf.org/en/rfcxml-vocabulary#seriesinfo -->
    <!-- Set value to the name of the draft  -->
   
    <author fullname="Jeffrey Haas" initials="J." surname="Haas"> <!-- https://authors.ietf.org/en/rfcxml-vocabulary#author -->
    <!-- initials should not include an initial for the surname -->
    <!-- role="editor" is optional -->
    <!-- Can have more than one author -->
      
    <!-- all of the following elements are optional -->
      <organization>Juniper Networks</organization> <!-- https://authors.ietf.org/en/rfcxml-vocabulary#organization -->
      <address> <!-- https://authors.ietf.org/en/rfcxml-vocabulary#address -->
        <postal>
          <!-- Reorder these if your country does things differently -->
          <street>1133 Innovation Way</street>
          <city>Sunnyvale</city>
          <region>CA</region>
          <code>94089</code>
          <country>US</country>
          <!-- Can use two letter country code -->
        </postal>        
<!--
        <phone>Phone</phone>
-->
        <email>jhaas@juniper.net</email>  
        <!-- Can have more than one <email> element -->
<!--
        <uri>URI</uri>
-->
      </address>
    </author>
   
    <date year="2022"/> <!-- https://authors.ietf.org/en/rfcxml-vocabulary#date -->
    <!-- On draft subbmission:
         * If only the current year is specified, the current day and month will be used.
         * If the month and year are both specified and are the current ones, the current day will
           be used
         * If the year is not the current one, it is necessary to specify at least a month and day="1" will be used.
    -->

    <area>Routing</area>
    <workgroup>IDR</workgroup>
    <!-- "Internet Engineering Task Force" is fine for individual submissions.  If this element is 
          not present, the default is "Network Working Group", which is used by the RFC Editor as 
          a nod to the history of the RFC Series. -->
    
    <keyword>bgp</keyword>
    <!-- Multiple keywords are allowed.  Keywords are incorporated into HTML output files for 
         use by search engines. -->

    <abstract>
      <t>"BGP Routes with Color" have become a topic of interest in the IDR
      Working Group. The authors of the various proposals have many things
      in mind to solve with them, how a color might be used, and the
      operational model for their solution.  In general, the solutions share
      some core properties: Routes for an IP endpoint, that have a
      domain-wide semantic element to differentiate forwarding (often called
      a color), and appropriate state to enable that differentiated
      forwarding.</t>
      <t>Examples of the technologies enabling differentiated forwarding
      include MPLS and Segment Routing.</t>
      <t>This document examines two of the current proposals - BGP Color-Aware
      Routing, and BGP Classful Transport - and proposes mechanisms to permit
      them to interoperate.</t>
    </abstract>
 
  </front>

  <middle>
    
    <section>
    <!-- The default attributes for <section> are numbered="true" and toc="default" -->
      <name>Introduction</name>
      <t>Introductory text</t>
      
      <section anchor="requirements">
      <!-- anchor is an optional attribute -->
        <name>Requirements Language</name>
        <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>
      <!-- The 'Requirements Language' section is optional -->
    </section>
    
    <section>
      <name>Terminology</name>
      <dl newline="true">
        <dt>Color:</dt>
        <dd>A value, typically a 32 bit unsigned integer, associated with a
        forwarding behavior.  In -CT, analogous to a Transport-Class.</dd>
        <dt>Color Domain:</dt>
        <dd>One or more networks managed by a given entity wherein the color values
        have a specific defined forwarding behavior.
        Primarily used to contrast between scenarios where the same color's
        value may carry a different forwarding behavior.</dd>
        <dt>Effective Color:</dt>
        <dd>When more than one protocol element for a BGP route can contain
        a property that gives the route a color, the Effective Color is what
        color the route is for purposes of route resolution within the
        procedures for that protocol extension.</dd>
        <dt>Endpoint:</dt>
        <dd>Terminal address for a route with color; typically a
        loopback.</dd>
        <dt>Forwarding behavior:</dt>
        <dd>Transport of IP or other traffic to an endpoint with specific properties
        that may include quality of service, steering over specific paths,
        latency properties, encapsulation, etc.</dd>
        <dt>NLRI key</dt>
        <dd>Properties of the BGP route with color's BGP NLRI that are used in
        BGP's Decision Process.</dd>
        <dt>Resolution key</dt>
        <dd>Properties of the BGP route with color that contribute to route
        resolution.  This is typically resolving a given Endpoint for a
        specific Effective Color.  This differentiates that even though the
        NLRI key may stay the same, the resolution key may change.  See,
        for example, the Local-Color-Mapping mechanism for BGP-CAR.</dd>
      </dl>
    </section>

    <section>
      <name>Overview</name>

      <t>The forwarding behaviors covered by routes for both the BGP-CAR 
      <xref target="I-D.dskc-bess-bgp-car"/> and
      BGP-CT <xref target="I-D.kaliraj-idr-bgp-classful-transport-planes"/>
      proposals can largely be mapped from one mechanism to the
      other mechanism.  BGP-CT utilizes encodings used in existing RFCs for the
      cited features typically for BGP Labeled-Unicast routes. BGP-CAR
      provides optimizations against those RFCs to attempt to enable better NLRI
      packing within a BGP Update message.</t>

      <t>BGP-CAR expects to carry portions of its forwarding behavior in non-key
      NLRI fields.</t>

      <t>The procedures for mapping forwarding state from one mechanism to
      another is covered in <xref target="mapping-forwarding"/>.</t>

      <t>BGP NLRI carry reachability that is expected to be exchanged across
      Autonomous Systems with consistent semantics for route selection.  A core
      differentiation between BGP-CAR and BGP-CT is what contents are carried in
      their NLRI keys, and operationally how this is intended to be used for
      distributing routes with color.</t>

      <t>BGP-CAR expects to distribute NLRI keys for a given end-point for a given
      color. BGP-CT expects to distribute NLRI keys for a given end-point
      carrying a Route Distinguisher.  If it is desired to pass routes from one
      mechanism into another mechanism, it is necessary to provide a mapping
      mechanism.</t>

      <t>This document introduces the idea of the "CAR-mapped-CT" route and the
      "CT-mapped-CAR" route wherein a BGP route of the appropriate AFI/SAFI
      carries the state of the other route in such a way that it can be locally
      utilized.  It also provides procedures for "unmapping" such mapped routes
      to restore them to their native AFI/SAFI when re-entering the native
      domain.</t>

      <t><xref target="mapping-nlri"/> discusses the general mapping procedures.
      <xref target="car-mapped-ct"/> discusses mapping BGP-CT routes into
      BGP-CAR routes.  <xref target="ct-mapped-car"/> discusses mapping BGP-CAR
      routes into BGP-CT routes.</t>
    </section>

    <section>
      <name>Color-Aware Routes Protocol Elements</name>
      <section>
        <name>CAR Protocol Elements Diagrams</name>
        <artset>
          <artwork type="ascii-art" name="box.txt">
            <![CDATA[
   Color-Aware Routes NLRI Type (-car-05, section 2.9.2):

    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
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |  NLRI Length  |  Key Length   |   NLRI Type   |Prefix Length  |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |               IP Prefix (variable)                           //
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |               Color (4 octets)                                |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

   Followed by optional TLVs encoded as below:

   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |     Type      |    Length     |    Value (variable)          //
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

   Local Color Map (LCM) Extended Community (-car-05, section 2.9.3):
    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=0x3  | Sub-Type=TBD2 |          Reserved             |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |                             Color                             |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
            ]]>
            </artwork>
        </artset>
      </section>
      <section>
        <name>CAR Protocol Elements</name>
        <dl newline="true">
        <dt>NLRI Key:</dt>
        <dd>(IP Prefix, Color)</dd>
        <dt>Endpoint:</dt>
        <dd>IP Prefix</dd>
        <dt>Effective Color:</dt>
        <dd>Color from NLRI, or LCM Color when LCM is present.  The default
        scenario for CAR is that the color is carried in the NLRI and only
        set in the LCM in multi-color-domain scenarios.</dd>
        <dt>Resolution Key:</dt>
        <dd>(BGP Nexthop, Effective Color)</dd>
        <dt>Forwarding:</dt>
        <dd>
          <ul>
            <li><xref target="RFC8277"/> Label Stack (optional TLV type 1)</li>
            <li><xref target="RFC8402"/> SR-MPLS Label Index (optional TLV type 2, possibly
            with <xref target="RFC8669"/> Prefix-SID)</li>
            <li><xref target="RFC9252"/> SRv6 SIDs either single or multiple full-length
            SRv6 SIDs or transposition SIDs (optional TLV type 3 plus 
            <xref target="RFC9252"/> Prefix SID)</li>
          </ul>
        </dd>
        </dl>
      </section>
    </section>

    <section>
      <name>Classful Transport Protocol Elements</name>
      <section>
        <name>Classful Transport Protocol Elements Diagrams</name>
        <artset>
          <artwork type="ascii-art" name="box.txt">
            <![CDATA[
 Classful Transport NLRI (-ct-17, section 7):

  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
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |    Length     |                 Label                 |Rsrv |S|
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 ~                     Route Distinguisher (8 bytes)             |
 |                                                               |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                     IPv4/IPv6 Prefix                          ~
 |                                                               |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

 Transport Class Extended Community (-ct-17, section 4):

  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= 0xa   | SubType= 0x02 |            Reserved           |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                     Transport Class ID                        |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
            ]]>
            </artwork>
        </artset>
      </section>
      <section>
        <name>Classful Transport Protocol Elements</name>
        <dl newline="true">
          <dt>NLRI Key:</dt>
          <dd>(Route Distinguisher, IPv4/IPv6 Prefix)</dd>
          <dt>Endpoint:</dt>
          <dd>IPv4/IPv6 Prefix</dd>
          <dt>Effective Color:</dt>
          <dd>Transport Class ID</dd>
          <dt>Resolution Key:</dt>
          <dd>(BGP Nexthop, Effective Color)</dd>
          <dt>Forwarding:</dt>
          <dd>
            <ul>
              <li><xref target="RFC8277"/> Label Stack (NLRI Labels)</li>
              <li><xref target="RFC8669"/> Prefix SID (NLRI Labels + Prefix SID Path
              Attribute)</li>
              <li><xref target="RFC9252"/> SRv6 SIDs, excluding transposition procedures.
              The Label field MAY contain a locally assigned label
              corresponding to the SRv6 forwarding, or may contain the
              distinguished value (XXX) indicating that no local label
              binding is in effect.</li>
            </ul>
          </dd>
        </dl>
      </section>
    </section>

    <section anchor="mapping-nlri">
      <name>Mapping NLRI keys: CAR Color, CT Route Distinguisher</name>

      <t>To carry routes from one protocol across BGP Speakers using the
      other protocol, NLRI key mapping operations must be carried out
      consistently.  Mapped NLRI keys MUST be able to be "unmapped"
      to the original native NLRI key.  This, along with preserving BGP
      route loop prevention mechanisms, permits consistent route selection
      across deployments.</t>

      <t>The NLRI key elements for both CAR and CT include the IP Prefix for
      the endpoint.  However, each protocol differs on the additional key
      carried in the NLRI to identify the route and its forwarding behavior.</t>
      
      <t>For CAR, the additional key is the Color of the route, and the
      original intent for that route.  In the absence of the Local Color Map
      (LCM) Extended Community, this Color is also the route's Effective
      Color.</t>

      <t>For CT, the additional key is a Route Distinguisher with similar
      semantics to those used in BGP VPNs (<xref target="RFC4364"/>, and
      others).  It serves two purposes: Providing administrative information
      about the source of the route with a set of cooperating networks;
      providing the ability to allow the same endpoint to be originated from
      the same BGP Speaker with differing forwarding behaviors that are to
      be preserved end-to-end within the cooperating networks.  CT doesn't
      encode any information about the route's Color or intent in the
      NLRI.</t>

      <t>The procedures below describe CAR-mapped-CT routes and
      CT-mapped-CAR routes.  New BGP protocol elements are defined to
      provide these mapping capabilities.</t>

      <section>
        <name>RD-Color Route Distinguisher Format</name>

        <artwork type="ascii-art" name="box.txt">
          <![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
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |       Type = TBD (2 octets)   |        Color (4 octets)       |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |         Color continued       |   Assigned Number (2 octets)  |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

             RD-Color Route Distinguisher Format
          ]]>
        </artwork>

        <t>To carry the CAR Color NLRI key element in a CT-mapped-CAR route, this
        document create the RD-Color Route Distinguisher.  Its Type is TBD
        and should be assigned from IANA's Route Distinguisher Type Field
        registry from the IETF Review range.</t>

        <t>The format of the RD-Color Route Distinguisher is a four-octet
        Administrator subfield containing the Color, followed by a
        two-octet Assigned Number subfield.</t>
      </section>

      <section>
        <name>Classful Transport Original RD Extended Community</name>

        <artwork type="ascii-art" name="box.txt">
          <![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
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |   Type= 0x03  | SubType= TBD  |        Value (6 octets)       |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                      Value continued                          |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

        Classful Transport Original RD Extended Community
          ]]>
        </artwork>

        <t>To permit CAR-mapped-CT routes to restore the original
        Route Distinguisher during unmapping, it is necessary to carry the
        original Route Distinguisher in the route CAR-mapped-CT route.  
        To do so, a new BGP Extended Community is defined: the Classful
        Transport Original RD (CTORD) Extended Community.</t>

        <t>The Classful Transport Original RD Extended Community should be
        allocated from the Transitive Opaque Extended Community Sub-Types
        registry (Type 0x03) with a sub-type TBD.  Its value field will
        contain the CT Route Distinguisher that is to be carried in the
        CAR-mapped-CT route.</t>
      </section>

      <section>
        <name>Classful Transport Original Intent Extended Community</name>

        <artwork type="ascii-art" name="box.txt">
          <![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
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |   Type= 0x0a  | SubType= TBD  |     RESERVED (2 octets)       |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                Transport Class ID (4 octets)                  |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

      Classful Transport Original Intent Extended Community
          ]]>
        </artwork>

        <t>To permit retention of the "original intent" for the CT
        route's Transport Color when carried in a CAR-mapped-CT route and
        CAR procedural purposes, a new Extended Community is defined: The
        Classful Transport Original Intent (CTOI) Extended Community.</t>

        <t>This Extended Community should be allocated from the Transport
        Class Extended Communities Sub-Types registry (Type 0x0a) with a
        sub-type TBD.  Its contents will be identical to the Transport Class
        Extended Community defined in -ct, Section 4: Two octets of RESERVED
        field, four octets for Transport Class ID.</t>
      </section>

      <section anchor="car-mapped-ct">
        <name>CAR-mapped-CT mapping procedures</name>

        <t>The need to be able to consistently map a CAR Color to a CT Route
        Distinguisher provides a challenge to the CT operational model.
        Since the originating router for the CAR route is not carried as
        part the CAR protocol procedures, there isn't clear information that
        could be utilized to consistently populate the Route
        Distinguisher.</t>

        <t>If no Classful Transport Original Intent Extended Community
        exists, the CT route's Transport Class ID is added to a newly
        created CTOI Extended Community, and this value is used for the
        CAR-mapped-CT route's Color NLRI key.</t>

        <t>If a CTOI Extended Community is already present in the CAR route,
        indicating that this route has been previously been mapped and then
        unmapped, the value from that CTOI Extended Community is used for
        the CAR-mapped-CT route's Color NLRI key.</t>

        <t>The CT route's Route Distinguisher is carried in the
        Classful Transport Original RD Extended Community in the newly
        created CAR-mapped-CT route.</t>  
      </section>
      
      <section>
        <name>CAR-mapped-CT unmapping procedures</name>

        <t>The CT route's Route Distinguisher is set from the Classful
        Transport Original RD Extended Community.  This Extended Community
        is then deleted.</t>

        <t>The CT route's Transport Class Transport Class ID Extended
        Community value is set to the value from the CAR-mapped-CT route's
        RD-Color Administrator subfield.</t>

        <t>The CT route's Classful Transport Original Intent Community is
        retained from the CAR-mapped-CT route.  This permits consistent
        CAR-mapped-CT NLRI Color mapping in the event of further
        redistribution between CT and CAR domains.</t>
      </section>

      <section anchor="ct-mapped-car">
        <name>CT-mapped-CAR mapping procedures</name>

        <t>The CT-mapped-CAR's Route Distinguisher uses the RD-Color format
        and contains the CAR route's NLRI Color in the Administrator field.
        It is RECOMMENDED that the RD-Color Assigned number subfield is set
        to zero.</t>

        <t>If a CAR Local-Color-Mapping (LCM) Extended Community is present
        on the CAR route, that community's Color value is the Effective
        Color of the CAR route.  Otherwise, the Effective Color is the value
        of the NLRI's Color field.  The LCM Extended Community deleted, if
        present.</t>

        <t>A Transport Class Extended Community is set on the
        CT-mapped-CAR's route with the Transport Class ID being assigned the
        Effective Color, determined above.</t>
      </section>

      <section>
        <name>CT-mapped-CAR unmapping procedures</name>

        <t>The CAR route's NLRI Color field is set from the RD-Color
        Administrator subfield.</t>

        <t>If the Transport Class ID for the CT-mapped-CAR route is
        different from the value used for the NLRI Color, above, a
        Local-Color-Mapping Extended Community is added to the CAR route
        using the Transport Class ID value.</t>

        <t>The Transport Class Extended Community is deleted.</t>
      </section>
    </section>

    <section anchor="mapping-forwarding">
      <name>Mapping Forwarding State</name>
      <section>
        <name>Mapping CAR Route Forwarding State into CT-mapped-CAR routes</name>
        <ul>
          <li>For <xref target="RFC8277"/> Label Stacks, the CAR Label TLVs will be
          carried in the CT NLRI Labels</li>
          <li>For <xref target="RFC8669"/> Label Index TLVs, an 
          <xref target="RFC8669"/> Prefix-SID is
          created with the Label Index set to the value from the CAR
          optional NLRI's Label Index and the Flags are similarly copied.
          If the CAR route contains a Prefix-SID SRGB, it is similarly
          copied.  The CT Label MAY be initialized with the value of the
          label derived from the Prefix SID, but this is a local matter.</li>
          <li>For <xref target="RFC9252"/> SRv6 SIDs, CT does not utilize the transposition
          scheme documented in <xref target="RFC9252"/>, Section 4.  Instead, the whole SRv6 SID
          should be encoded in the SRv6 Service Data Sub-Sub-TLV.
          (Transposition length 0.)  The CT Label MAY carry a locally
          assigned label covering this forwarding state, however it may also
          carry the distinguished label (XXX) indicating that no label
          mapping has been assigned.  (XXX needs ref in updated CT doc.)</li>
        </ul>
      </section>
      <section>
        <name>Mapping VPN CAR Routes into CT</name>
        <t>XXX</t>
      </section>
      <section>
        <name>Mapping CT Route Forwarding State into CAR-mapped-CT routes</name>
        <ul>
          <li>For the simple label stack scenario for CT (no Prefix-SID Path
          Attribute), the CT Label Stack is carried in the Type 1 Label TLV.
          (-car, Section 2.9.2.1).</li>
          <li>For <xref target="RFC8669"/> Label Index TLVs, when an 
          <xref target="RFC8669"/> Prefix-SID
          Path Attribute excluding the SRv6 Service TLVs is present, the 
          Prefix-SID Path Attribute, if present, MAY be copied if the SRGB
          is identical to local configuration.  The CAR Type 2 Label Index
          TLV (-car, Section 2.9.2.2) is initialized with the contents of
          the CT Prefix-SID's Label-Index TLV.</li>
          <li>For <xref target="RFC9252"/> SRv6 SIDs, the CAR Type 3 SRv6 SID TLV (-car,
          Section 2.9.2.3) is initialized from the CT's SRv6 SIDs carried in
          the Prefix-SID Path Attribute.  The transposition scheme encoding
          SHOULD be used, when possible.</li>
        </ul>
      </section>
      <section>
        <name>Mapping CT Routes into VPN CAR</name>
        <t>XXX</t>
      </section>
      <section>
        <name>Miscellany</name>
        <t>The CAR type specific non-key transitivity field is not directly
        mapped into CT routes.</t>
        <t>The CAR type specific non-key fields currently specify a set of
        forwarding behaviors.  The handling of all combinations of
        forwarding behaviors for currently specified types is not fully
        described in the latest CAR document.</t>
      </section>
    </section>

    <section>
      <name>BGP Decision Process and Route Resolution Considerations</name>

      <t>The sections above describe how BGP routes with color can be mapped
      from one form to the other form.  BGP implementations that implement
      both mechanisms can receive routes from both.  The purpose of the
      mapping mechanisms above is to attempt to preserve route comparability
      across mapped NLRI.</t>

      <t>The core desired behavior for these mechanisms is to permit BGP
      service routes that have a color mapping mechanism to resolve their
      BGP Nexthops over endpoints for that color.  In particular, both
      mechanisms perform a longest-match lookup for the Endpoint over the
      resolution state for a particular color.  These resolution
      mechanisms may implement specific fall-back procedures.  However, a
      given deployment of one or both of these mechanisms will desire
      consistent route selection and nexthop resolution regardless of the source 
      of the resolving state.</t>

      <t>On BGP Speakers participating in both mechanisms, operators SHOULD
      chose one of the two mechanisms to generate the BGP route resolution
      state for those protocols.  The mapping mechanisms permit BGP routes
      received across the different mechanisms to be able to tie-break in a
      single RIB according to the properties of the routes within that
      RIB.  The choice of the mapping mechanism would likely be based on the
      desired overall deployment model for routes with color and the
      underlying comparability of the routes as they are distributed across
      the cooperating networks.</t>

      <t>The chosen RIB on that BGP Speaker would then be used to create the
      route resolution state for BGP routes with color for that device.</t>
    </section>

    <section anchor="IANA">
      <name>IANA Considerations</name>

      <t>IANA is requested to allocate a Route Distinguisher from the Route
      Distinguisher Type Field registry from the IETF Review range.  The
      Description should be "RD-Color, Administrator field is a four-byte
      Color, Assigned value field is a two-byte integer".  The reference
      should be this document.</t>

      <t>IANA is requested to allocate a BGP Extended Community from the
      Transitive Opaque Extended Community Sub-Types registry.  Its name
      will be "Classful Transport Original RD".  The reference should be
      this document.</t>

      <t>IANA is requested to allocate a BGP Extended Community from the
      Transport Class Extended Communities Sub-Types registry. Its Name will
      be "Classful Transport Original RD".  The reference should be this
      document.</t>
    </section>
    
    <section anchor="Security">
      <name>Security Considerations</name>

      <t>The BGP transport route use cases for "BGP routes with color"
      largely overlap those for the original BGP Labeled Unicast protocol
      extension. (<xref target="RFC8277"/>)  Such routes are traditionally only accepted
      from trusted BGP Speakers that exist within a BGP transport
      domain.</t>

      <t>This document defines procedures for BGP Speakers implementing both
      the BGP-CAR and BGP-CT address families to mutually exchange routing
      information.  Some of these procedures utilize BGP Extended
      Communities.  Care should be taken to not accept routes with Extended
      Communities with mapping semantics from parties not eligible to
      participate in these procedures.  Such care may include filtering, or
      discarding reachability with such Extened Communities from
      unauthorized parties.</t>
    </section>
    
  </middle>

  <back>
    <references>
      <name>References</name>
      <references>
        <name>Normative References</name>
        
        <xi:include href="https://www.rfc-editor.org/refs/bibxml/reference.RFC.8174.xml"/>
        <xi:include href="https://www.rfc-editor.org/refs/bibxml/reference.RFC.8277.xml"/>
        <xi:include href="https://www.rfc-editor.org/refs/bibxml/reference.RFC.8669.xml"/>
        <xi:include href="https://www.rfc-editor.org/refs/bibxml/reference.RFC.9252.xml"/>
        <!-- The recommended and simplest way to include a well known reference -->
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml3/reference.I-D.dskc-bess-bgp-car.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml3/reference.I-D.kaliraj-idr-bgp-classful-transport-planes.xml"/>
        
      </references>
 
      <references>
        <name>Informative References</name>
       
        <reference anchor="RFC2119" target="https://www.rfc-editor.org/info/rfc2119">
        <!-- Manually added reference -->
          <front>
            <title>Key words for use in RFCs to Indicate Requirement Levels</title>
            <author initials="S." surname="Bradner" fullname="S. Bradner">
              <organization/>
            </author>
            <date year="1997" month="March"/>
            <abstract>
              <t>In many standards track documents several words are used to signify the requirements in the specification. These words are often capitalized. This document defines these words as they should be interpreted in IETF documents. This document specifies an Internet Best Current Practices for the Internet Community, and requests discussion and suggestions for improvements.
              </t>
            </abstract>
          </front>
          <seriesInfo name="BCP" value="14"/>
          <seriesInfo name="RFC" value="2119"/>
          <seriesInfo name="DOI" value="10.17487/RFC2119"/>
        </reference>
        <xi:include href="https://www.rfc-editor.org/refs/bibxml/reference.RFC.4360.xml"/>
        <xi:include href="https://www.rfc-editor.org/refs/bibxml/reference.RFC.4364.xml"/>
        <xi:include href="https://www.rfc-editor.org/refs/bibxml/reference.RFC.8402.xml"/>
      </references>
    </references>
    
    <section anchor="Acknowledgements">
      <name>Acknowledgements</name>

      <t>TBD</t>
    </section>
    
    <section anchor="Contributors">
      <name>Contributors</name>

      <t>TBD</t>
    </section>

    <section>
      <name>Example NLRI Mapping</name>

      <section>
        <name>Mapping a BGP-CT route into BGP-CAR</name>

        <t>Input:</t>
        <ul spacing="compact">
          <li>Route Distinguisher 192.0.2.1:100</li>
          <li>Endpoint: 10.0.0.1/32</li>
          <li>Label: 100</li>
          <li>Color: 999</li>
        </ul>

        <t>BGP-CT state:</t>
        <artset>
          <artwork type="ascii-art" name="box.txt">
            <![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
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |    Length     |                 Label                 |Rsrv |S|
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 ~                     Route Distinguisher (8 bytes)             |
 |                                                               |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                     IPv4/IPv6 Prefix                          ~
 |                                                               |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

 BGP-CT NLRI (AFI=1, SAFI=76)

 Length: 0x98 (152 bits)
 Label:  0x00 0x00 0x64 (100)
 Rsrv:   0x00 (0)
 S:      0x01 (1)
 Route Distinguisher: 0x00 0x01 0xc0 0x00 0x02 0x01 0x00 0x64 
                      (Type 1, 192.0.2.1 : 100)
 IPv4/IPv6 Prefix: 0x20 0x0a 0x00 0x00 0x01 (32 / 10.0.0.1)

  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= 0xa   | SubType= 0x02 |            Reserved           |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                     Transport Class ID                        |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

 Transport Class Extended Community:

 Type:     0x0a
 SubType:  0x02
 Reserved: 0x00 0x00
 Transport Class ID: 0x00 0x00 0x03 0xe7 (999)
            ]]>
            </artwork>
        </artset>

        <t>Output:</t>

        <ul spacing="compact">
          <li>NLRI Type: 1</li>
          <li>Prefix Length: 32</li>
          <li>IP Prefix: 10.0.0.1</li>
          <li>Color: 999</li>
          <li><t>Label TLV:</t>
            <ul spacing="compact">
              <li>Type: 1</li>
              <li>Length: 3</li>
              <li>Value: 100</li>
            </ul>
          </li>
          <li>CTOI Extended Community: 999</li>
          <li>CTORD Extended Community: 192.0.2.1:100</li>
        </ul>

        <artwork type="ascii-art" name="box.txt">
          <![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
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |  NLRI Length  |  Key Length   |   NLRI Type   |Prefix Length  |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |               IP Prefix (variable)                           //
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |               Color (4 octets)                                |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

 CAR NLRI (AFI=1, SAFI=83):

 NLRI Length:   0x10 (16 octets)
 Key Length:    0x09 (9 octets)
 NLRI Type:     0x01 (Color-Aware Routes NLRI Type)
 Prefix Length: 0x20 (32)
 IP Prefix:     0x0a 0x00 0x00 0x01 (10.0.0.1)
 Color:         0x00 0x00 0x03 0xe7 (999)


 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |     Type      |    Length     |    Value (variable)          //
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

 Label TLV:

 Type:   0x01 (Label TLV)
 Length: 0x03 (3)
 Label:  0x00 0x00 0x64 (100)

  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= 0x0a  | SubType= TBD  |     RESERVED (2 octets)       |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                Transport Class ID (4 octets)                  |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

 Classful Transport Original Intent Extended Community:

 Type: 0x0a
 SubType: TBD
 RESERVED: 0x00 0x000
 Transport Class ID: 0x00 0x00 0x03 0xe7 (999)

  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= 0x03  | SubType= TBD  |        Value (6 octets)       |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                      Value continued                          |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

 Classful Transport Original RD Extended Community:

 Type:    0x03
 SubType: TBD
 Value:   0x00 0x01 0xc0 0x00 0x02 0x01 0x00 0x64 
          (Type 1, 192.0.2.1 : 100)

          ]]>
        </artwork>

      </section>

      <section>
        <name>Mapping a BGP-CAR route into BGP-CT</name>

        <t>Input:</t>
        <ul spacing="compact">
          <li>NLRI Type: 1</li>
          <li>Prefix Length: 32</li>
          <li>IP Prefix: 10.0.0.1</li>
          <li>Color: 999</li>
          <li><t>Label TLV:</t>
            <ul spacing="compact">
              <li>Type: 1</li>
              <li>Length: 3</li>
              <li>Value: 100</li>
            </ul>
          </li>
        </ul>

        <artwork type="ascii-art" name="box.txt">
          <![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
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |  NLRI Length  |  Key Length   |   NLRI Type   |Prefix Length  |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |               IP Prefix (variable)                           //
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |               Color (4 octets)                                |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

 CAR NLRI (AFI=1, SAFI=83):

 NLRI Length:   0x10 (16 octets)
 Key Length:    0x09 (9 octets)
 NLRI Type:     0x01 (Color-Aware Routes NLRI Type)
 Prefix Length: 0x20 (32)
 IP Prefix:     0x0a 0x00 0x00 0x01 (10.0.0.1)
 Color:         0x00 0x00 0x03 0xe7 (999)


 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |     Type      |    Length     |    Value (variable)          //
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

 Label TLV:

 Type:   0x01 (Label TLV)
 Length: 0x03 (3)
 Label:  0x00 0x00 0x64 (100)
          ]]>
        </artwork>

        <t>Output:</t>
        <ul spacing="compact">
          <li>Route Distinguisher 192.0.2.1:100</li>
          <li>Endpoint: 10.0.0.1/32</li>
          <li>Label: 100</li>
          <li>Color: 999</li>
        </ul>

        <t>BGP-CT state:</t>
        <artset>
          <artwork type="ascii-art" name="box.txt">
            <![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
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |    Length     |                 Label                 |Rsrv |S|
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 ~                     Route Distinguisher (8 bytes)             |
 |                                                               |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                     IPv4/IPv6 Prefix                          ~
 |                                                               |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

 BGP-CT NLRI (AFI=1, SAFI=76)

 Length: 0x98 (152 bits)
 Label:  0x00 0x00 0x64 (100)
 Rsrv:   0x00 (0)
 S:      0x01 (1)
 Route Distinguisher: 0xTBD 0xTBD 0x00 0x00 0x03 0xe7 0x00 0x00 
                      (Type TBD - RD-Color, 999:0)
 IPv4/IPv6 Prefix: 0x20 0x0a 0x00 0x00 0x01 (32 / 10.0.0.1)

  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= 0xa   | SubType= 0x02 |            Reserved           |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                     Transport Class ID                        |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

 Transport Class Extended Community:

 Type:     0x0a
 SubType:  0x02
 Reserved: 0x00 0x00
 Transport Class ID: 0x00 0x00 0x03 0xe7 (999)
            ]]>
            </artwork>
        </artset>


      </section>
    </section>
    
 </back>
</rfc>
