<?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-ietf-idr-bgp-ls-segment-routing-ext-18"
     ipr="trust200902">
  <front>
    <title abbrev="BGP LS extensions for Segment Routing">BGP Link-State
    extensions for Segment Routing</title>

    <author fullname="Stefano Previdi" initials="S." surname="Previdi">
      <organization>Huawei Technologies</organization>

      <address>
        <postal>
          <street/>

          <city>Rome</city>

          <code/>

          <country>Italy</country>
        </postal>

        <email>stefano@previdi.net</email>
      </address>
    </author>

    <author fullname="Ketan Talaulikar" initials="K." role="editor"
            surname="Talaulikar">
      <organization>Cisco Systems, Inc.</organization>

      <address>
        <postal>
          <street/>

          <city/>

          <code/>

          <country>India</country>
        </postal>

        <email>ketant@cisco.com</email>
      </address>
    </author>

    <author fullname="Clarence Filsfils" initials="C." surname="Filsfils">
      <organization>Cisco Systems, Inc.</organization>

      <address>
        <postal>
          <street/>

          <city>Brussels</city>

          <code/>

          <country>Belgium</country>
        </postal>

        <email>cfilsfil@cisco.com</email>
      </address>
    </author>

    <author fullname="Hannes Gredler" initials="H." surname="Gredler">
      <organization>RtBrick Inc.</organization>

      <address>
        <postal>
          <street/>

          <city/>

          <region/>

          <code/>

          <country/>
        </postal>

        <email>hannes@rtbrick.com</email>
      </address>
    </author>

    <author fullname="Mach(Guoyi) Chen" initials="M." surname="Chen">
      <organization>Huawei Technologies</organization>

      <address>
        <postal>
          <street>Huawei Building, No. 156 Beiqing Rd.</street>

          <city>Beijing</city>

          <code>100095</code>

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

        <email>mach.chen@huawei.com</email>
      </address>
    </author>

    <date year=""/>

    <area>Routing</area>

    <workgroup>Inter-Domain Routing</workgroup>

    <keyword>BGP-LS</keyword>

    <keyword>Segment Routing</keyword>

    <keyword>SID</keyword>

    <keyword>MPLS</keyword>

    <keyword>Label advertisement</keyword>

    <keyword>IS-IS</keyword>

    <keyword>OSPF</keyword>

    <keyword>OSPFv3</keyword>

    <abstract>
      <t>Segment Routing (SR) allows for a flexible definition of end-to-end
      paths by encoding paths as sequences of topological sub-paths, called
      "segments". These segments are advertised by routing protocols e.g. by
      the link state routing protocols (IS-IS, OSPFv2 and OSPFv3) within IGP
      topologies.</t>

      <t>This document defines extensions to the BGP Link-state address-family
      in order to carry segment routing information via BGP.</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>
    <section title="Introduction">
      <t>Segment Routing (SR) allows for a flexible definition of end-to-end
      paths by combining sub-paths called "segments". A segment can represent
      any instruction: topological or service-based. A segment can have a
      local semantic to an SR node or global semantic within a domain. Within
      IGP topologies, an SR path is encoded as a sequence of topological
      sub-paths, called "IGP segments". These segments are advertised by the
      link-state routing protocols (IS-IS, OSPFv2 and OSPFv3).</t>

      <t><xref target="RFC8402"/> defines the Link-State IGP segments -
      Prefix, Node, Anycast and Adjacency segments. Prefix segments, by
      default, represent an ECMP-aware shortest-path to a prefix, as per the
      state of the IGP topology. Adjacency segments represent a hop over a
      specific adjacency between two nodes in the IGP. A prefix segment is
      typically a multi-hop path while an adjacency segment, in most of the
      cases, is a one-hop path. Node and anycast segments are variations of
      the prefix segment with their specific characteristics.</t>

      <t>When Segment Routing is enabled in an IGP domain, segments are
      advertised in the form of Segment Identifiers (SIDs). The IGP link-state
      routing protocols have been extended to advertise SIDs and other
      SR-related information. IGP extensions are described for: <xref
      target="RFC8667">IS-IS</xref>, <xref target="RFC8665">OSPFv2</xref> and
      <xref target="RFC8666">OSPFv3</xref>. Using these extensions, Segment
      Routing can be enabled within an IGP domain.</t>

      <t>Segment Routing (SR) allows advertisement of single or multi-hop
      paths. The flooding scope for the IGP extensions for Segment routing is
      IGP area-wide. Consequently, the contents of a Link State Database
      (LSDB) or a Traffic Engineering Database (TED) has the scope of an IGP
      area and therefore, by using the IGP alone it is not enough to construct
      segments across multiple IGP Area or AS boundaries.</t>

      <t>In order to address the need for applications that require
      topological visibility across IGP areas, or even across Autonomous
      Systems (AS), the BGP-LS address-family/sub-address-family have been
      defined to allow BGP to carry Link-State information. The BGP Network
      Layer Reachability Information (NLRI) encoding format for BGP-LS and a
      new BGP Path Attribute called the BGP-LS attribute are defined in <xref
      target="RFC7752"/>. The identifying key of each Link-State object,
      namely a node, link, or prefix, is encoded in the NLRI and the
      properties of the object are encoded in the BGP-LS attribute.</t>

      <t><figure anchor="MECHANISM-CONSUMER-PRODUCER"
          title="Link State info collection">
          <artwork><![CDATA[
                        +------------+
                        |  Consumer  |
                        +------------+
                              ^
                              |
                              v
                    +-------------------+
                    |    BGP Speaker    |         +-----------+
                    | (Route-Reflector) |         | Consumer  |
                    +-------------------+         +-----------+
                          ^   ^   ^                       ^
                          |   |   |                       |
          +---------------+   |   +-------------------+   |
          |                   |                       |   |
          v                   v                       v   v
    +-----------+       +-----------+             +-----------+
    |    BGP    |       |    BGP    |             |    BGP    |
    |  Speaker  |       |  Speaker  |    . . .    |  Speaker  |
    +-----------+       +-----------+             +-----------+
          ^                   ^                         ^
          |                   |                         |
         IGP                 IGP                       IGP
        ]]></artwork>
        </figure></t>

      <t><xref target="MECHANISM-CONSUMER-PRODUCER"/> denotes a typical
      deployment scenario. In each IGP area, one or more nodes are configured
      with BGP-LS. These BGP speakers form an IBGP mesh by connecting to one
      or more route-reflectors. This way, all BGP speakers (specifically the
      route-reflectors) obtain Link-State information from all IGP areas (and
      from other ASes from EBGP peers). An external component connects to the
      route-reflector to obtain this information (perhaps moderated by a
      policy regarding what information is or isn't advertised to the external
      component) as described in <xref target="RFC7752"/>.</t>

      <t>This document describes extensions to BGP-LS to advertise the SR
      information. An external component (e.g., a controller) can collect SR
      information from across an SR domain (as described in <xref
      target="RFC8402"/>) and construct the end-to-end path (with its
      associated SIDs) that need to be applied to an incoming packet to
      achieve the desired end-to-end forwarding. SR operates within a trusted
      domain consisting of a single or multiple ASes managed by the same
      administrative entity e.g. within a single provider network.</t>
    </section>

    <section title="BGP-LS Extensions for Segment Routing">
      <t>This document defines SR extensions to BGP-LS and specifies the TLVs
      and sub-TLVs for advertising SR information within the BGP-LS Attribute.
      <xref target="ISISTLV"/> and <xref target="OSPFTLV"/> lists the
      equivalent TLVs and sub-TLVs in IS-IS, OSPFv2 and OSPFv3 protocols.</t>

      <t><xref target="RFC7752">BGP-LS</xref> defines the BGP-LS NLRI that can
      be a Node NLRI, a Link NLRI or a Prefix NLRI. <xref
      target="RFC7752">BGP-LS</xref> defines the TLVs that map link-state
      information to BGP-LS NLRI within the BGP-LS Attribute. This document
      adds additional BGP-LS Attribute TLVs in order to encode SR information.
      It does not introduce any changes to the encoding of the BGP-LS
      NLRIs.</t>

      <section anchor="NODE" title="Node Attributes TLVs">
        <t>The following Node Attribute TLVs are defined:</t>

        <texttable anchor="node-attribute_tlv" title="Node Attribute TLVs">
          <ttcol align="center">Type</ttcol>

          <ttcol align="left">Description</ttcol>

          <ttcol align="right">Section</ttcol>

          <c>1161</c>

          <c>SID/Label</c>

          <c><xref target="SIDLABELTLV"/></c>

          <c>1034</c>

          <c>SR Capabilities</c>

          <c><xref target="SRCAPTLV"/></c>

          <c>1035</c>

          <c>SR Algorithm</c>

          <c><xref target="SRALGOTLV"/></c>

          <c>1036</c>

          <c>SR Local Block</c>

          <c><xref target="SRLB"/></c>

          <c>1037</c>

          <c>SRMS Preference</c>

          <c><xref target="SRMSPREF"/></c>
        </texttable>

        <t>These TLVs should only be added to the BGP-LS Attribute associated
        with the Node NLRI describing the IGP node that is originating the
        corresponding IGP TLV/sub-TLV described below.</t>

        <section anchor="SIDLABELTLV" title="SID/Label TLV">
          <t>The SID/Label TLV is used as a sub-TLV by the SR Capabilities
          (<xref target="SRCAPTLV"/>) and Segment Routing Local Block (SRLB)
          (<xref target="SRLB"/>) TLVs. This information is derived from the
          protocol specific advertisements. <list style="symbols">
              <t>IS-IS, as defined by the SID/Label sub-TLV in section 2.3 of
              <xref target="RFC8667"/>.</t>

              <t>OSPFv2/OSPFv3, as defined by the SID/Label sub-TLV in section
              2.1 of <xref target="RFC8665"/> and section 3.1 of <xref
              target="RFC8666"/>.</t>
            </list></t>

          <t>The TLV has the following format: <figure anchor="SIDLTLVFIG"
              title="SID/Label TLV Format">
              <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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|               Type            |            Length             |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                      SID/Label (variable)                    //
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

]]></artwork>
            </figure></t>

          <t>Where:<list style="hanging">
              <t>Type: 1161</t>

              <t>Length: Variable. Either 3 or 4 depending whether the value
              is encoded as a label or as an index/SID.</t>

              <t>SID/Label: If length is set to 3, then the 20 rightmost bits
              represent a label (the total TLV size is 7) and the 4 leftmost
              bits are set to 0. If length is set to 4, then the value
              represents a 32 bit SID (the total TLV size is 8).</t>
            </list></t>
        </section>

        <section anchor="SRCAPTLV" title="SR Capabilities TLV">
          <t>The SR Capabilities TLV is used in order to advertise the node's
          SR Capabilities including its Segment Routing Global Base (SRGB)
          range(s). In the case of IS-IS, the capabilities also include the
          IPv4 and IPv6 support for the SR-MPLS forwarding plane. This
          information is derived from the protocol specific advertisements.
          <list style="symbols">
              <t>IS-IS, as defined by the SR Capabilities sub-TLV in section
              3.1 of <xref target="RFC8667"/>.</t>

              <t>OSPFv2/OSPFv3, as defined by the SID/Label Range TLV in
              section 3.2 of <xref target="RFC8665"/>. OSPFv3 leverages the
              same TLV as defined for OSPFv2.</t>
            </list></t>

          <t>The SR Capabilities TLV has the following format: <figure
              anchor="SRCAPTLVFIG" title="SR Capabilities TLV Format">
              <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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|               Type            |          Length               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|      Flags    |   Reserved    | 
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                  Range Size 1                 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                SID/Label sub-TLV 1                           //
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

...

+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                  Range Size N                 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                SID/Label sub-TLV N                           //
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

]]></artwork>
            </figure></t>

          <t>Where:<list style="hanging">
              <t>Type: 1034</t>

              <t>Length: Variable. Minimum length is 12.</t>

              <t>Flags: 1 octet of flags as defined in section 3.1 of <xref
              target="RFC8667"/> for IS-IS. The flags are not currently
              defined for OSPFv2 and OSPFv3 and MUST be set to 0 and ignored
              on receipt.</t>

              <t>Reserved: 1 octet that MUST be set to 0 and ignored on
              receipt.</t>

              <t>One or more entries, each of which have the following
              format:<list style="hanging">
                  <t>Range Size: 3 octet with a non-zero value indicating the
                  number of labels in the range.</t>

                  <t>SID/Label TLV (as defined in <xref
                  target="SIDLABELTLV"/>) used as sub-TLV which encodes the
                  first label in the range. Since the SID/Label TLV is used to
                  indicate the first label of the SRGB range, only label
                  encoding is valid under the SR Capabilities TLV.</t>
                </list></t>
            </list></t>
        </section>

        <section anchor="SRALGOTLV" title="SR Algorithm TLV">
          <t>The SR Algorithm TLV is used in order to advertise the SR
          Algorithms supported by the node. This information is derived from
          the protocol specific advertisements. <list style="symbols">
              <t>IS-IS, as defined by the SR-Algorithm sub-TLV in section 3.2
              of <xref target="RFC8667"/>.</t>

              <t>OSPFv2/OSPFv3, as defined by the SR-Algorithm TLV in section
              3.1 of <xref target="RFC8665"/>. OSPFv3 leverages the same TLV
              as defined for OSPFv2.</t>
            </list>The SR Algorithm TLV has the following format: <figure
              anchor="SRALGTLVFIG" title="SR Algorithm TLV Format">
              <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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|            Type               |            Length             |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|  Algorithm 1  |  Algorithm... |  Algorithm N  |                
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

]]></artwork>
            </figure></t>

          <t>Where:<list style="hanging">
              <t>Type: 1035</t>

              <t>Length: Variable. Minimum length is 1 and maximum can be
              256.</t>

              <t>Algorithm: One or more fields of 1 octet each identifying the
              algorithm.</t>
            </list></t>
        </section>

        <section anchor="SRLB" title="SR Local Block TLV">
          <t>The SR Local Block (SRLB) TLV contains the range(s) of labels the
          node has reserved for local SIDs. Local SIDs are used, e.g., in IGP
          (IS-IS, OSPF) for Adjacency-SIDs, and may also be allocated by
          components other than IGP protocols. As an example, an application
          or a controller may instruct a node to allocate a specific local
          SID. Therefore, in order for such applications or controllers to
          know the range of local SIDs available, it is required that the node
          advertises its SRLB.</t>

          <t>This information is derived from the protocol specific
          advertisements. <list style="symbols">
              <t>IS-IS, as defined by the SR Local Block sub-TLV in section
              3.3 of <xref target="RFC8667"/>.</t>

              <t>OSPFv2/OSPFv3, as defined by the SR Local Block TLV in
              section 3.3. of <xref target="RFC8665"/>. OSPFv3 leverages the
              same TLV as defined for OSPFv2.</t>
            </list></t>

          <t>The SRLB TLV has the following format: <figure
              anchor="SRLBTLVFIG" title="SRLB TLV Format">
              <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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|               Type            |               Length          |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|      Flags    |   Reserved    | 
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|              Sub-Range Size 1                 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                SID/Label sub-TLV 1                           //
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

...

+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|              Sub-Range Size N                 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                SID/Label sub-TLV N                           //
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

]]></artwork>
            </figure></t>

          <t>Where:<list style="hanging">
              <t>Type: 1036</t>

              <t>Length: Variable. Minimum length is 12.</t>

              <t>Flags: 1 octet of flags. The flags are as defined in section
              3.3 of <xref target="RFC8667"/> for IS-IS. The flags are not
              currently defined for OSPFv2 and OSPFv3 and MUST be set to 0 and
              ignored on receipt.</t>

              <t>Reserved: 1 octet that MUST be set to 0 and ignored on
              receipt.</t>

              <t>One or more entries corresponding to sub-range(s), each of
              which have the following format:<list style="hanging">
                  <t>Range Size: 3 octet value indicating the number of labels
                  in the range.</t>

                  <t>SID/Label TLV (as defined in <xref
                  target="SIDLABELTLV"/>) used as sub-TLV which encodes the
                  first label in the sub-range. Since the SID/Label TLV is
                  used to indicate the first label of the SRLB sub-range, only
                  label encoding is valid under the SR Local Block TLV.</t>
                </list></t>
            </list></t>
        </section>

        <section anchor="SRMSPREF" title="SRMS Preference TLV">
          <t>The Segment Routing Mapping Server (SRMS) Preference TLV is used
          in order to associate a preference with SRMS advertisements from a
          particular source. <xref target="RFC8661"/> specifies the SRMS
          functionality along with SRMS preference of the node advertising the
          SRMS Prefix-to-SID Mapping ranges.</t>

          <t>This information is derived from the protocol specific
          advertisements. <list style="symbols">
              <t>IS-IS, as defined by the SRMS Preference sub-TLV in section
              3.4 of <xref target="RFC8667"/>.</t>

              <t>OSPFv2/OSPFv3, as defined by the SRMS Preference TLV in
              section 3.4 of <xref target="RFC8665"/>. OSPFv3 leverages the
              same TLV as defined for OSPFv2.</t>
            </list></t>

          <t>The SRMS Preference TLV has the following format: <figure
              anchor="SRMSTLVFIG" title="SRMS Preference TLV Format">
              <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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|            Type               |            Length             |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Preference    |
+-+-+-+-+-+-+-+-+

]]></artwork>
            </figure></t>

          <t>Where:<list style="hanging">
              <t>Type: 1037</t>

              <t>Length: 1.</t>

              <t>Preference: 1 octet carrying an unsigned 8 bit SRMS
              preference.</t>
            </list></t>
        </section>
      </section>

      <section anchor="LINK" title="Link Attribute TLVs">
        <t>The following Link Attribute TLVs are are defined:</t>

        <texttable anchor="link-attribute_tlv" title="Link Attribute TLVs">
          <ttcol align="center">Type</ttcol>

          <ttcol align="left">Description</ttcol>

          <ttcol align="right">Section</ttcol>

          <c>1099</c>

          <c>Adjacency SID TLV</c>

          <c><xref target="ADJSIDTLV"/></c>

          <c>1100</c>

          <c>LAN Adjacency SID TLV</c>

          <c><xref target="LANADJSIDTLV"/></c>

          <c>1172</c>

          <c>L2 Bundle Member TLV</c>

          <c><xref target="L2BUNDLETLV"/></c>
        </texttable>

        <t>These TLVs should only be added to the BGP-LS Attribute associated
        with the Link NLRI describing the link of the IGP node that is
        originating the corresponding IGP TLV/sub-TLV described below.</t>

        <section anchor="ADJSIDTLV" title="Adjacency SID TLV">
          <t>The Adjacency SID TLV is used in order to advertise information
          related to an Adjacency SID. This information is derived from
          Adj-SID sub-TLV of IS-IS (section 2.2.1 of <xref
          target="RFC8667"/>), OSPFv2 (section 6.1 of <xref
          target="RFC8665"/>) and OSPFv3 (section 7.1 of <xref
          target="RFC8666"/>).</t>

          <t>The Adjacency SID TLV has the following format: <figure
              anchor="ADJSIDTLVFIG" title="Adjacency SID TLV Format">
              <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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|               Type            |              Length           |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Flags         |     Weight    |             Reserved          |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                   SID/Label/Index (variable)                 //
+---------------------------------------------------------------+

]]></artwork>
            </figure></t>

          <t>Where:<list style="hanging">
              <t>Type: 1099</t>

              <t>Length: Variable. Either 7 or 8 depending on Label or Index
              encoding of the SID</t>

              <t>Flags. 1 octet value which should be set as: <list
                  style="symbols">
                  <t>IS-IS Adj-SID flags are defined in section 2.2.1 of <xref
                  target="RFC8667"/>.</t>

                  <t>OSPFv2 Adj-SID flags are defined in section 6.1 of <xref
                  target="RFC8665"/>.</t>

                  <t>OSPFv3 Adj-SID flags are defined in section 7.1 of <xref
                  target="RFC8666"/>.</t>
                </list></t>

              <t>Weight: 1 octet carrying the weight used for load-balancing
              purposes. The use of weight is described in section 3.4 of <xref
              target="RFC8402"/>.</t>

              <t>Reserved: 2 octets that MUST be set to 0 and ignored on
              receipt.</t>

              <t>SID/Index/Label: <list style="symbols">
                  <t>IS-IS: Label or index value as defined in section 2.2.1
                  of <xref target="RFC8667"/>.</t>

                  <t>OSPFv2: Label or index value as defined in section 6.1 of
                  <xref target="RFC8665"/>.</t>

                  <t>OSPFv3: Label or index value as defined in section 7.1 of
                  <xref target="RFC8666"/>.</t>
                </list></t>
            </list></t>

          <t>The Flags and, as an extension, the SID/Index/Label fields of
          this TLV are interpreted according to the respective underlying
          IS-IS, OSPFv2 or OSPFv3 protocol. The Protocol-ID of the BGP-LS Link
          NLRI is used to determine the underlying protocol specification for
          parsing these fields.</t>
        </section>

        <section anchor="LANADJSIDTLV" title="LAN Adjacency SID TLV">
          <t>For a LAN, normally a node only announces its adjacency to the
          IS-IS pseudo-node (or the equivalent OSPF Designated and Backup
          Designated Routers). The LAN Adjacency Segment TLV allows a node to
          announce adjacencies to all other nodes attached to the LAN in a
          single instance of the BGP-LS Link NLRI. Without this TLV, the
          corresponding BGP-LS link NLRI would need to be originated for each
          additional adjacency in order to advertise the SR TLVs for these
          neighbor adjacencies.</t>

          <t>This information is derived from LAN-Adj-SID sub-TLV of IS-IS
          (section 2.2.2 of <xref target="RFC8667"/>) and LAN Adj-SID sub-TLV
          of OSPFv2 (section 6.2 of <xref target="RFC8665"/>) and OSPFv3
          (section 7.2 of <xref target="RFC8666"/>).</t>

          <t>The LAN Adjacency SID TLV has the following format: <figure
              anchor="LADJSIDTLVFIG" title="LAN Adjacency SID TLV Format">
              <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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|              Type             |            Length             |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|     Flags     |     Weight    |            Reserved           |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|             OSPF Neighbor ID / IS-IS System-ID                |
+                               +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                    SID/Label/Index (variable)                //
+---------------------------------------------------------------+

]]></artwork>
            </figure></t>

          <t>Where:<list style="hanging">
              <t>Type: 1100</t>

              <t>Length: Variable. For IS-IS it would be 13 or 14 depending on
              Label or Index encoding of the SID. For OSPF it would be 11 or
              12 depending on Label or Index encoding of the SID.</t>

              <t>Flags. 1 octet value which should be set as: <list
                  style="symbols">
                  <t>IS-IS LAN Adj-SID flags are defined in section 2.2.2 of
                  <xref target="RFC8667"/>.</t>

                  <t>OSPFv2 LAN Adj-SID flags are defined in section 6.2 of
                  <xref target="RFC8665"/>.</t>

                  <t>OSPFv3 LAN Adj-SID flags are defined in section 7.2 of
                  <xref target="RFC8666"/>.</t>
                </list></t>

              <t>Weight: 1 octet carrying the weight used for load-balancing
              purposes. The use of weight is described in section 3.4 of <xref
              target="RFC8402"/>.</t>

              <t>Reserved: 2 octets that MUST be set to 0 and ignored on
              receipt.</t>

              <t>Neighbor ID: 6 octets for IS-IS for the System-ID and 4
              octets for OSPF for the OSPF Router-ID of the neighbor.</t>

              <t>SID/Index/Label: <list style="symbols">
                  <t>IS-IS: Label or index value as defined in section 2.2.2
                  of <xref target="RFC8667"/>.</t>

                  <t>OSPFv2: Label or index value as defined in section 6.2 of
                  <xref target="RFC8665"/>.</t>

                  <t>OSPFv3: Label or index value as defined in section 7.2 of
                  <xref target="RFC8666"/>.</t>
                </list></t>
            </list></t>

          <t>The Neighbor ID, Flags and, as an extension, the SID/Index/Label
          fields of this TLV are interpreted according to the respective
          underlying IS-IS, OSPFv2 or OSPFv3 protocol. The Protocol-ID of the
          BGP-LS Link NLRI is used to determine the underlying protocol
          specification for parsing these fields.</t>
        </section>

        <section anchor="L2BUNDLETLV" title="L2 Bundle Member Attribute TLV">
          <t>The L2 Bundle Member Attribute TLV identifies an L2 Bundle Member
          link which in turn is associated with a parent L3 link. The L3 link
          is described by the Link NLRI defined in <xref target="RFC7752"/>
          and the L2 Bundle Member Attribute TLV is associated with the Link
          NLRI. The TLV MAY include sub-TLVs which describe attributes
          associated with the bundle member. The identified bundle member
          represents a unidirectional path from the originating router to the
          neighbor specified in the parent L3 Link. Multiple L2 Bundle Member
          Attribute TLVs MAY be associated with a Link NLRI.</t>

          <t>This information is derived from L2 Bundle Member Attributes TLV
          of IS-IS (section 2 of <xref target="RFC8668"/>). The equivalent
          functionality has not been specified as yet for OSPF.</t>

          <t>The L2 Bundle Member Attribute TLV has the following format:
          <figure anchor="L2BTLVFIG"
              title="L2 Bundle Member Attributes TLV Format">
              <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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|               Type            |          Length               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                     L2 Bundle Member Descriptor               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                  Link attribute sub-TLVs(variable)          //
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

]]></artwork>
            </figure></t>

          <t>Where:<list style="hanging">
              <t>Type: 1172</t>

              <t>Length: Variable.</t>

              <t>L2 Bundle Member Descriptor: 4 octets field that carries a
              Link Local Identifier as defined in <xref
              target="RFC4202"/>.</t>
            </list></t>

          <t>Link attributes for L2 Bundle Member Links are advertised as
          sub-TLVs of the L2 Bundle Member Attribute TLV. The sub-TLVs are
          identical to existing BGP-LS TLVs as identified in the table
          below.</t>

          <texttable anchor="l2subtlvs"
                     title="BGP-LS Attribute TLVs also used as sub-TLVs of L2 Bundle Member Attribute TLV">
            <ttcol align="center">TLV Code Point</ttcol>

            <ttcol align="left">Description</ttcol>

            <ttcol align="left">Reference Document</ttcol>

            <c>1088</c>

            <c>Administrative group (color)</c>

            <c><xref target="RFC7752"/></c>

            <c>1089</c>

            <c>Maximum link bandwidth</c>

            <c><xref target="RFC7752"/></c>

            <c>1090</c>

            <c>Max. reservable link bandwidth</c>

            <c><xref target="RFC7752"/></c>

            <c>1091</c>

            <c>Unreserved bandwidth</c>

            <c><xref target="RFC7752"/></c>

            <c>1092</c>

            <c>TE default metric</c>

            <c><xref target="RFC7752"/></c>

            <c>1093</c>

            <c>Link protection type</c>

            <c><xref target="RFC7752"/></c>

            <c>1099</c>

            <c>Adjacency Segment Identifier (Adj-SID) TLV</c>

            <c><xref target="ADJSIDTLV"/></c>

            <c>1100</c>

            <c>LAN Adjacency Segment Identifier (Adj-SID) TLV</c>

            <c><xref target="LANADJSIDTLV"/></c>

            <c>1114</c>

            <c>Unidirectional link delay</c>

            <c><xref target="RFC8571"/></c>

            <c>1115</c>

            <c>Min/Max Unidirectional link delay</c>

            <c><xref target="RFC8571"/></c>

            <c>1116</c>

            <c>Unidirectional Delay Variation</c>

            <c><xref target="RFC8571"/></c>

            <c>1117</c>

            <c>Unidirectional packet loss</c>

            <c><xref target="RFC8571"/></c>

            <c>1118</c>

            <c>Unidirectional residual bandwidth</c>

            <c><xref target="RFC8571"/></c>

            <c>1119</c>

            <c>Unidirectional available bandwidth</c>

            <c><xref target="RFC8571"/></c>

            <c>1120</c>

            <c>Unidirectional bandwidth utilization</c>

            <c><xref target="RFC8571"/></c>
          </texttable>
        </section>
      </section>

      <section anchor="PREFIX" title="Prefix Attribute TLVs ">
        <t>The following Prefix Attribute TLVs are defined:</t>

        <texttable anchor="prefix-attribute_tlv" title="Prefix Attribute TLVs">
          <ttcol align="center">Type</ttcol>

          <ttcol align="left">Description</ttcol>

          <ttcol align="left">Section</ttcol>

          <c>1158</c>

          <c>Prefix SID</c>

          <c><xref target="PREFIXSIDTLV"/></c>

          <c>1159</c>

          <c>Range</c>

          <c><xref target="RANGETLV"/></c>

          <c>1170</c>

          <c>Prefix Attribute Flags</c>

          <c><xref target="PREFIXATTRFLAGTLV"/></c>

          <c>1171</c>

          <c>Source Router Identifier</c>

          <c><xref target="SOURCEIDTLV"/></c>

          <c>1174 (suggested)</c>

          <c>Source OSPF Router-ID</c>

          <c><xref target="SOURCEOSPFRIDTLV"/></c>
        </texttable>

        <t>These TLVs should only be added to the BGP-LS Attribute associated
        with the Prefix NLRI describing the prefix of the IGP node that is
        originating the corresponding IGP TLV/sub-TLV described below.</t>

        <section anchor="PREFIXSIDTLV" title="Prefix SID TLV">
          <t>The Prefix SID TLV is used in order to advertise information
          related to a Prefix SID. This information is derived from Prefix-SID
          sub-TLV of IS-IS (section 2.1 of <xref target="RFC8667"/>) and the
          Prefix SID sub-TLV of OSPFv2 (section 5 of <xref target="RFC8665"/>)
          and OSPFv3 (section 6 of <xref target="RFC8666"/>).</t>

          <t>The Prefix SID TLV has the following format: <figure
              anchor="PFXSIDTLVFIG" title="Prefix SID TLV Format">
              <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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|               Type            |            Length             |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|     Flags     |   Algorithm   |           Reserved            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                       SID/Index/Label (variable)             //
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

]]></artwork>
            </figure></t>

          <t>Where:<list style="hanging">
              <t>Type: 1158</t>

              <t>Length: Variable. 7 or 8 depending on Label or Index encoding
              of the SID</t>

              <t>Flags: 1 octet value which should be set as: <list
                  style="symbols">
                  <t>IS-IS Prefix SID flags are defined in section 2.1.1 of
                  <xref target="RFC8667"/>.</t>

                  <t>OSPFv2 Prefix SID flags are defined in section 5 of <xref
                  target="RFC8665"/>.</t>

                  <t>OSPFv3 Prefix SID flags are defined in section 6 of <xref
                  target="RFC8666"/>.</t>
                </list></t>

              <t>Algorithm: 1 octet value identify the algorithm. The
              semantics of algorithm are described in section 3.1.1 of <xref
              target="RFC8402"/>.</t>

              <t>Reserved: 2 octets that MUST be set to 0 and ignored on
              receipt.</t>

              <t>SID/Index/Label: <list style="symbols">
                  <t>IS-IS: Label or index value as defined in section 2.1 of
                  <xref target="RFC8667"/>.</t>

                  <t>OSPFv2: Label or index value as defined in section 5 of
                  <xref target="RFC8665"/>.</t>

                  <t>OSPFv3: Label or index value as defined in section 6 of
                  <xref target="RFC8666"/>.</t>
                </list></t>
            </list></t>

          <t>The Flags and, as an extension, the SID/Index/Label fields of
          this TLV are interpreted according to the respective underlying
          IS-IS, OSPFv2 or OSPFv3 protocol. The Protocol-ID of the BGP-LS
          Prefix NLRI is used to determine the underlying protocol
          specification for parsing these fields.</t>
        </section>

        <section anchor="PREFIXATTRFLAGTLV" title="Prefix Attribute Flags TLV">
          <t>The Prefix Attribute Flags TLV carries IPv4/IPv6 prefix attribute
          flags information. These flags are defined for OSPFv2 in section 2.1
          of <xref target="RFC7684"/>, for OSPFv3 in section A.4.1.1 of <xref
          target="RFC5340"/> and for IS-IS in section 2.1 of <xref
          target="RFC7794"/>.</t>

          <t>The Prefix Attribute Flags TLV has the following format: <figure
              anchor="PFXATRTLVFIG" title="Prefix Attribute Flags TLV Format">
              <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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|            Type               |            Length             |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                        Flags (variable)                      //
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

]]></artwork>
            </figure></t>

          <t>Where:<list style="hanging">
              <t>Type: 1170</t>

              <t>Length: Variable.</t>

              <t>Flags: a variable length flag field (according to the length
              field). Flags are routing protocol specific and are to be set as
              below:<list style="symbols">
                  <t>IS-IS flags correspond to the IPv4/IPv6 Extended
                  Reachability Attribute Flags defined in section 2.1 of <xref
                  target="RFC7794"/>. In the case of the X-flag when
                  associated with IPv6 prefix reachability, the setting
                  corresponds to the setting of the X-flag in the fixed format
                  of IS-IS TLVs 236 <xref target="RFC5308"/> and 237 <xref
                  target="RFC5120"/>.</t>

                  <t>OSPFv2 flags correspond to the Flags field of the OSPFv2
                  Extended Prefix TLV defined in section 2.1 of <xref
                  target="RFC7684"/></t>

                  <t>OSPFv3 flags map to the Prefix Options field defined in
                  section A.4.1.1 of <xref target="RFC5340"/> and extended in
                  section 3.1 of <xref target="RFC8362"/></t>
                </list></t>
            </list></t>

          <t>The Flags field of this TLV is interpreted according to the
          respective underlying IS-IS, OSPFv2 or OSPFv3 protocol. The
          Protocol-ID of the BGP-LS Prefix NLRI is used to determine the
          underlying protocol specification for parsing this field.</t>
        </section>

        <section anchor="SOURCEIDTLV" title="Source Router Identifier TLV">
          <t>The Source Router Identifier TLV contains the IPv4 or IPv6 Router
          Identifier of the originator of the Prefix. For the IS-IS protocol
          this is derived from the IPv4/IPv6 Source Router ID sub-TLV as
          defined in section 2.2 of <xref target="RFC7794"/>. For the OSPF
          protocol, this is derived from the Prefix Source Router Address
          sub-TLV as defined in section 2.2 of <xref
          target="I-D.ietf-lsr-ospf-prefix-originator"/>.</t>

          <t>The Source Router Identifier TLV has the following format:
          <figure anchor="SRCRIDTLVFIG"
              title="Source Router Identifier TLV Format">
              <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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|            Type               |            Length             |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|               4 or 16 octet Router Identifier                //
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

]]></artwork>
            </figure></t>

          <t>Where:<list style="hanging">
              <t>Type: 1171</t>

              <t>Length: Variable. 4 or 16 for IPv4 and IPv6 prefix
              respectively.</t>

              <t>Router-ID: the IPv4 or IPv6 Router-ID in case of IS-IS and
              the IPv4 or IPv6 Router Address in the case of OSPF.</t>
            </list></t>
        </section>

        <section anchor="SOURCEOSPFRIDTLV" title="Source OSPF Router-ID TLV">
          <t>The Source OSPF Router-ID TLV is applicable only for the OSPF
          protocol and contains OSPF Router-ID of the originator of the
          Prefix. It is derived from the Prefix Source OSPF Router-ID sub-TLV
          as defined in section 2.1 of <xref
          target="I-D.ietf-lsr-ospf-prefix-originator"/>.</t>

          <t>The Source OSPF Router-ID TLV has the following format: <figure
              anchor="SRCOSPFRIDTLVFIG"
              title="Source OSPF Router-ID TLV Format">
              <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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|            Type               |            Length             |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                    4 octet OSPF Router-ID                    //
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

]]></artwork>
            </figure></t>

          <t>Where:<list style="hanging">
              <t>Type: 1174 (suggested)</t>

              <t>Length: 4</t>

              <t>OSPF Router-ID: the OSPF Router-ID of the node originating
              the prefix.</t>
            </list></t>
        </section>

        <section anchor="RANGETLV" title="Range TLV">
          <t>The Range TLV is used in order to advertise a range of
          prefix-to-SID mappings as part of the Segment Routing Mapping Server
          (SRMS) functionality <xref target="RFC8661"/>, as defined in the
          respective underlying IGP SR extensions <xref target="RFC8665"/>
          (section 4), <xref target="RFC8666"/> (section 5) and <xref
          target="RFC8667"/> (section 2.4). The information advertised in the
          Range TLV is derived from the SID/Label Binding TLV in the case of
          IS-IS and the OSPFv2/OSPFv3 Extended Prefix Range TLV in the case of
          OSPFv2/OSPFv3.</t>

          <t>A Prefix NLRI, that been advertised with a Range TLV, is
          considered a normal routing prefix (i.e. prefix reachability) only
          when there is also an IGP metric TLV (TLV 1095) associated it.
          Otherwise, it is considered only as the first prefix in the range
          for prefix-to-SID mapping advertisement.</t>

          <t>The format of the Range TLV is as follows:<figure
              anchor="RANGETLVFIG" title="Range TLV Format">
              <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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|             Type              |             Length            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|     Flags     | Reserved      |             Range Size        |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                           sub-TLVs                           //
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

]]></artwork>
            </figure></t>

          <t>Where:<list>
              <t>Type: 1159</t>

              <t>Length: Variable. 11 or 12 depending on Label or Index
              encoding of the SID</t>

              <t>Flags: 1 octet value which should be set as: <list
                  style="symbols">
                  <t>IS-IS SID/Label Binding TLV flags are defined in section
                  2.4.1 of <xref target="RFC8667"/>.</t>

                  <t>OSPFv2 OSPF Extended Prefix Range TLV flags are defined
                  in section 4 of <xref target="RFC8665"/>.</t>

                  <t>OSPFv3 Extended Prefix Range TLV flags are defined in
                  section 5 of <xref target="RFC8666"/>.</t>
                </list></t>

              <t>Reserved: 1 octet that MUST be set to 0 and ignored on
              receipt.</t>

              <t>Range Size: 2 octets that carry the number of prefixes that
              are covered by the advertisement..</t>
            </list></t>

          <t>The Flags field of this TLV is interpreted according to the
          respective underlying IS-IS, OSPFv2 or OSPFv3 protocol. The
          Protocol-ID of the BGP-LS Prefix NLRI is used to determine the
          underlying protocol specification for parsing this field.</t>

          <t>The prefix-to-SID mappings are advertised using sub-TLVs as
          below:<figure>
              <artwork><![CDATA[IS-IS:
    SID/Label Range TLV
        Prefix-SID sub-TLV

OSPFv2/OSPFv3:
    OSPFv2/OSPFv3 Extended Prefix Range TLV
        Prefix SID sub-TLV

BGP-LS:
    Range TLV
        Prefix-SID TLV (used as a sub-TLV in this context)

]]></artwork>
            </figure></t>

          <t>The prefix-to-SID mapping information for the BGP-LS Prefix-SID
          TLV (used as sub-TLV in this context) is encoded as described in
          <xref target="PREFIXSIDTLV"/>.</t>
        </section>
      </section>

      <section anchor="ISISTLV"
               title="Equivalent IS-IS Segment Routing TLVs/Sub-TLVs">
        <t>This section illustrate the IS-IS Segment Routing Extensions TLVs
        and sub-TLVs mapped to the ones defined in this document.</t>

        <t>The following table, illustrates for each BGP-LS TLV, its
        equivalence in IS-IS.</t>

        <texttable anchor="ISISTLVTAB"
                   title="IS-IS Segment Routing Extensions TLVs/Sub-TLVs">
          <ttcol align="left">Description</ttcol>

          <ttcol align="left">IS-IS TLV/sub-TLV</ttcol>

          <ttcol align="left">Reference</ttcol>

          <c>SR Capabilities</c>

          <c>SR-Capabilities sub-TLV (2)</c>

          <c><xref target="RFC8667"/></c>

          <c>SR Algorithm</c>

          <c>SR-Algorithm sub-TLV (19)</c>

          <c><xref target="RFC8667"/></c>

          <c>SR Local Block</c>

          <c>SR Local Block sub-TLV (22)</c>

          <c><xref target="RFC8667"/></c>

          <c>SRMS Preference</c>

          <c>SRMS Preference sub-TLV (19)</c>

          <c><xref target="RFC8667"/></c>

          <c>Adjacency SID</c>

          <c>Adj-SID sub-TLV (31)</c>

          <c><xref target="RFC8667"/></c>

          <c>LAN Adjacency SID</c>

          <c>LAN-Adj-SID sub-TLV (32)</c>

          <c><xref target="RFC8667"/></c>

          <c>Prefix SID</c>

          <c>Prefix-SID sub-TLV (3)</c>

          <c><xref target="RFC8667"/></c>

          <c>Range</c>

          <c>SID/Label Binding TLV (149)</c>

          <c><xref target="RFC8667"/></c>

          <c>SID/Label</c>

          <c>SID/Label sub-TLV (1)</c>

          <c><xref target="RFC8667"/></c>

          <c>Prefix Attribute Flags</c>

          <c>Prefix Attributes Flags sub-TLV (4)</c>

          <c><xref target="RFC7794"/></c>

          <c>Source Router Identifier</c>

          <c>IPv4/IPv6 Source Router ID sub-TLV (11/12)</c>

          <c><xref target="RFC7794"/></c>

          <c>L2 Bundle Member Attributes</c>

          <c>L2 Bundle Member Attributes TLV (25)</c>

          <c><xref target="RFC8668"/></c>
        </texttable>
      </section>

      <section anchor="OSPFTLV"
               title="Equivalent OSPFv2/OSPFv3 Segment Routing TLVs/Sub-TLVs">
        <t>This section illustrate the OSPFv2 and OSPFv3 Segment Routing
        Extensions TLVs and sub-TLVs mapped to the ones defined in this
        document.</t>

        <t>The following table, illustrates for each BGP-LS TLV, its
        equivalence in OSPFv2 and OSPFv3.</t>

        <texttable anchor="OSPFTVLTAB"
                   title="OSPFv2 Segment Routing Extensions TLVs/Sub-TLVs">
          <ttcol align="left">Description</ttcol>

          <ttcol align="left">OSPFv2 TLV/sub-TLV</ttcol>

          <ttcol align="left">Reference</ttcol>

          <c>SR Capabilities</c>

          <c>SID/Label Range TLV (9)</c>

          <c><xref target="RFC8665"/></c>

          <c>SR Algorithm</c>

          <c>SR-Algorithm TLV (8)</c>

          <c><xref target="RFC8665"/></c>

          <c>SR Local Block</c>

          <c>SR Local Block TLV (14)</c>

          <c><xref target="RFC8665"/></c>

          <c>SRMS Preference</c>

          <c>SRMS Preference TLV (15)</c>

          <c><xref target="RFC8665"/></c>

          <c>Adjacency SID</c>

          <c>Adj-SID sub-TLV (2)</c>

          <c><xref target="RFC8665"/></c>

          <c>LAN Adjacency SID</c>

          <c>LAN Adj-SID sub-TLV (3)</c>

          <c><xref target="RFC8665"/></c>

          <c>Prefix SID</c>

          <c>Prefix SID sub-TLV (2)</c>

          <c><xref target="RFC8665"/></c>

          <c>Range</c>

          <c>OSPF Extended Prefix Range TLV (2)</c>

          <c><xref target="RFC8665"/></c>

          <c>SID/Label</c>

          <c>SID/Label sub-TLV (1)</c>

          <c><xref target="RFC8665"/></c>

          <c>Prefix Attribute Flags</c>

          <c>Flags of OSPFv2 Extended Prefix TLV (1)</c>

          <c><xref target="RFC7684"/></c>

          <c>Source Router Identifier</c>

          <c>Prefix Source Router-ID sub-TLV (4)</c>

          <c><xref target="I-D.ietf-lsr-ospf-prefix-originator"/></c>

          <c>Source OSPF Router-ID</c>

          <c>Prefix Source OSPF Router-ID sub-TLV (5)</c>

          <c><xref target="I-D.ietf-lsr-ospf-prefix-originator"/></c>
        </texttable>

        <texttable anchor="OSPFV3TVLTAB"
                   title="OSPFv3 Segment Routing Extensions TLVs/Sub-TLVs">
          <ttcol align="left">Description</ttcol>

          <ttcol align="left">OSPFv3 TLV/sub-TLV</ttcol>

          <ttcol align="left">Reference</ttcol>

          <c>SR Capabilities</c>

          <c>SID/Label Range TLV (9)</c>

          <c><xref target="RFC8665"/></c>

          <c>SR Algorithm</c>

          <c>SR-Algorithm TLV (8)</c>

          <c><xref target="RFC8665"/></c>

          <c>SR Local Block</c>

          <c>SR Local Block TLV (14)</c>

          <c><xref target="RFC8665"/></c>

          <c>SRMS Preference</c>

          <c>SRMS Preference TLV (15)</c>

          <c><xref target="RFC8665"/></c>

          <c>Adjacency SID</c>

          <c>Adj-SID sub-TLV (5)</c>

          <c><xref target="RFC8666"/></c>

          <c>LAN Adjacency SID</c>

          <c>LAN Adj-SID sub-TLV (6)</c>

          <c><xref target="RFC8666"/></c>

          <c>Prefix SID</c>

          <c>Prefix SID sub-TLV (4)</c>

          <c><xref target="RFC8666"/></c>

          <c>Range</c>

          <c>OSPFv3 Extended Prefix Range TLV (9)</c>

          <c><xref target="RFC8666"/></c>

          <c>SID/Label</c>

          <c>SID/Label sub-TLV (7)</c>

          <c><xref target="RFC8666"/></c>

          <c>Prefix Attribute Flags</c>

          <c>Prefix Option Fields of Prefix TLV types 3,5,6</c>

          <c><xref target="RFC8362"/></c>

          <c>Source OSPF Router Identifier</c>

          <c>Prefix Source Router-ID sub-TLV (27)</c>

          <c><xref target="I-D.ietf-lsr-ospf-prefix-originator"/></c>

          <c>Source OSPF Router-ID</c>

          <c>Prefix Source OSPF Router-ID sub-TLV (28)</c>

          <c><xref target="I-D.ietf-lsr-ospf-prefix-originator"/></c>
        </texttable>
      </section>
    </section>

    <section anchor="IANA" title="IANA Considerations">
      <t>Early allocation of codepoints has been done by IANA for this
      document from the registry "BGP-LS Node Descriptor, Link Descriptor,
      Prefix Descriptor, and Attribute TLVs" under the "BGP-LS Parameters"
      registry based on <xref target="BGPLSCODEPOINTS"/>. The column "IS-IS
      TLV/Sub-TLV" defined in the registry does not require any value and
      should be left empty.</t>

      <section anchor="TLVSUMMARY" title="TLV/Sub-TLV Code Points Summary">
        <t>This section contains the global table of all TLVs/sub-TLVs defined
        in this document.</t>

        <texttable anchor="BGPLSCODEPOINTS"
                   title="Summary Table of TLV/Sub-TLV Codepoints">
          <ttcol align="center">TLV Code Point</ttcol>

          <ttcol align="left">Description</ttcol>

          <ttcol align="right">Reference</ttcol>

          <c>1034</c>

          <c>SR Capabilities</c>

          <c><xref target="SRCAPTLV"/></c>

          <c>1035</c>

          <c>SR Algorithm</c>

          <c><xref target="SRALGOTLV"/></c>

          <c>1036</c>

          <c>SR Local Block</c>

          <c><xref target="SRLB"/></c>

          <c>1037</c>

          <c>SRMS Preference</c>

          <c><xref target="SRMSPREF"/></c>

          <c>1099</c>

          <c>Adjacency SID</c>

          <c><xref target="ADJSIDTLV"/></c>

          <c>1100</c>

          <c>LAN Adjacency SID</c>

          <c><xref target="LANADJSIDTLV"/></c>

          <c>1158</c>

          <c>Prefix SID</c>

          <c><xref target="PREFIXSIDTLV"/></c>

          <c>1159</c>

          <c>Range</c>

          <c><xref target="RANGETLV"/></c>

          <c>1161</c>

          <c>SID/Label</c>

          <c><xref target="SIDLABELTLV"/></c>

          <c>1170</c>

          <c>Prefix Attribute Flags</c>

          <c><xref target="PREFIXATTRFLAGTLV"/></c>

          <c>1171</c>

          <c>Source Router Identifier</c>

          <c><xref target="SOURCEIDTLV"/></c>

          <c>1172</c>

          <c>L2 Bundle Member Attributes</c>

          <c><xref target="L2BUNDLETLV"/></c>

          <c>1174 (suggested)</c>

          <c>Source OSPF Router-ID</c>

          <c><xref target="SOURCEOSPFRIDTLV"/></c>
        </texttable>
      </section>
    </section>

    <section anchor="Manageability" title="Manageability Considerations">
      <t>This section is structured as recommended in <xref
      target="RFC5706"/>.</t>

      <t>The new protocol extensions introduced in this document augment the
      existing IGP topology information that is distributed via <xref
      target="RFC7752"/>. Procedures and protocol extensions defined in this
      document do not affect the BGP protocol operations and management other
      than as discussed in the Manageability Considerations section of <xref
      target="RFC7752"/>. Specifically, the malformed attribute tests for
      syntactic checks in the Fault Management section of <xref
      target="RFC7752"/> now encompass the new BGP-LS Attribute TLVs defined
      in this document. The semantic or content checking for the TLVs
      specified in this document and their association with the BGP-LS NLRI
      types or their BGP-LS Attribute is left to the consumer of the BGP-LS
      information (e.g. an application or a controller) and not the BGP
      protocol.</t>

      <t>A consumer of the BGP-LS information retrieves this information over
      a BGP-LS session (refer Section 1 and 2 of <xref target="RFC7752"/>).
      The handling of semantic or content errors by the consumer would be
      dictated by the nature of its application usage and hence is beyond the
      scope of this document.</t>

      <t>This document only introduces new Attribute TLVs and any syntactic
      error in them would result in the BGP-LS Attribute being discarded with
      an error log. The SR information introduced in BGP-LS by this
      specification, may be used by BGP-LS consumer applications like a SR
      path computation engine (PCE) to learn the SR capabilities of the nodes
      in the topology and the mapping of SR segments to those nodes. This can
      enable the SR PCE to perform path computations based on SR for traffic
      engineering use-cases and to steer traffic on paths different from the
      underlying IGP based distributed best path computation. Errors in the
      encoding or decoding of the SR information may result in the
      unavailability of such information to the SR PCE or incorrect
      information being made available to it. This may result in the SR PCE
      not being able to perform the desired SR based optimization
      functionality or to perform it in an unexpected or inconsistent manner.
      The handling of such errors by applications like SR PCE may be
      implementation specific and out of scope of this document.</t>

      <t>The extensions, specified in this document, do not introduce any new
      configuration or monitoring aspects in BGP or BGP-LS other than as
      discussed in <xref target="RFC7752"/>. The manageability aspects of the
      underlying SR features are covered by <xref
      target="I-D.ietf-spring-sr-yang"/>, <xref
      target="I-D.ietf-isis-sr-yang"/> and <xref
      target="I-D.ietf-ospf-sr-yang"/>.</t>
    </section>

    <section anchor="Security" title="Security Considerations">
      <t>The new protocol extensions introduced in this document augment the
      existing IGP topology information that is distributed via <xref
      target="RFC7752"/>. The advertisement of the SR link attribute
      information defined in this document presents similar risk as associated
      with the existing set of link attribute information as described in
      <xref target="RFC7752"/>. The Security Considerations section of <xref
      target="RFC7752"/> also applies to these extensions. The procedures and
      new TLVs defined in this document, by themselves, do not affect the
      BGP-LS security model discussed in <xref target="RFC7752"/>.</t>

      <t>The TLVs introduced in this document are used to propagate IGP
      defined information (<xref target="RFC8667"/>, <xref target="RFC8665"/>
      and <xref target="RFC8666"/>). These TLVs represent the SR information
      associated with the IGP node, link and prefix. The IGP instances
      originating these TLVs are assumed to support all the required security
      and authentication mechanisms (as described in <xref target="RFC8667"/>,
      <xref target="RFC8665"/> and <xref target="RFC8666"/>) in order to
      prevent any security issue when propagating the TLVs into BGP-LS.</t>

      <t>BGP-LS SR extensions enable traffic engineering use-cases within the
      Segment Routing domain. SR operates within a trusted domain <xref
      target="RFC8402"/> and its security considerations also apply to BGP-LS
      sessions when carrying SR information. The SR traffic engineering
      policies using the SIDs advertised via BGP-LS are expected to be used
      entirely within this trusted SR domain (e.g. between multiple AS/domains
      within a single provider network). Therefore, precaution is necessary to
      ensure that the link-state information (including SR information)
      advertised via BGP-LS sessions is limited to consumers in a secure
      manner within this trusted SR domain. BGP peering sessions for
      address-families other than Link-State may be setup to routers outside
      the SR domain. The isolation of BGP-LS peering sessions is recommended
      to ensure that BGP-LS topology information (including the newly added SR
      information) is not advertised to an external BGP peering session
      outside the SR domain.</t>
    </section>

    <section anchor="Contributors" title="Contributors">
      <t>The following people have substantially contributed to the editing of
      this document:<figure>
          <artwork><![CDATA[Peter Psenak 
Cisco Systems
Email: ppsenak@cisco.com]]></artwork>
        </figure><figure>
          <artwork><![CDATA[Les Ginsberg 
Cisco Systems
Email: ginsberg@cisco.com]]></artwork>
        </figure><figure>
          <artwork><![CDATA[Acee Lindem
Cisco Systems
Email: acee@cisco.com]]></artwork>
        </figure><figure>
          <artwork><![CDATA[Saikat Ray
Individual
Email: raysaikat@gmail.com]]></artwork>
        </figure><figure>
          <artwork><![CDATA[Jeff Tantsura
Apstra Inc.
Email: jefftant.ietf@gmail.com]]></artwork>
        </figure></t>
    </section>

    <section anchor="Acknowledgements" title="Acknowledgements">
      <t>The authors would like to thank Jeffrey Haas, Aijun Wang, Robert
      Raszuk and Susan Hares for their review of this document and their
      comments. The authors would also like to thank Alvaro Retana for his
      extensive review and comments which helped correct issues and improve
      the document.</t>
    </section>
  </middle>

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

      <?rfc include="reference.RFC.8174.xml"?>

      <?rfc include="reference.RFC.4202.xml"?>

      <?rfc include="reference.RFC.7752.xml"?>

      <?rfc include="reference.RFC.7794.xml"?>

      <?rfc include="reference.RFC.5120.xml"?>

      <?rfc include="reference.RFC.5308.xml"?>

      <?rfc include="reference.RFC.7684.xml"?>

      <?rfc include="reference.RFC.5340.xml"?>

      <?rfc include="reference.RFC.8362.xml"?>

      <?rfc include="reference.RFC.8402.xml"?>

      <?rfc include="reference.RFC.8571.xml"?>

      <?rfc include="reference.RFC.8667.xml"?>

      <?rfc include="reference.RFC.8665.xml"?>

      <?rfc include="reference.RFC.8666.xml"?>

      <?rfc include="reference.RFC.8668.xml"?>

      <?rfc include="reference.I-D.ietf-lsr-ospf-prefix-originator.xml"?>
    </references>

    <references title="Informative References">
      <?rfc include="reference.RFC.5706.xml"?>

      <?rfc include="reference.RFC.8661.xml"?>

      <?rfc include="reference.I-D.ietf-spring-sr-yang.xml"?>

      <?rfc include="reference.I-D.ietf-isis-sr-yang.xml"?>

      <?rfc include="reference.I-D.ietf-ospf-sr-yang.xml"?>
    </references>
  </back>
</rfc>
