<?xml version="1.0" encoding="US-ASCII"?> encoding="UTF-8"?>
<!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"?> [
  <!ENTITY nbsp    "&#160;">
  <!ENTITY zwsp   "&#8203;">
  <!ENTITY nbhy   "&#8209;">
  <!ENTITY wj     "&#8288;">
]>

<rfc xmlns:xi="http://www.w3.org/2001/XInclude" submissionType="IETF" category="std" consensus="true" docName="draft-ietf-idr-bgp-ls-flex-algo-12"
     ipr="trust200902"> number="9351" ipr="trust200902" obsoletes="" updates="" xml:lang="en" tocInclude="true" tocDepth="3" symRefs="true" sortRefs="true" version="3">

  <!-- xml2rfc v2v3 conversion 3.14.2 -->
  <front>
    <title abbrev="BGP-LS Extensions for Flexible Algorithm">Flexible Algorithm">Border Gateway Protocol - Link State (BGP-LS) Extensions
   for Flexible Algorithm Advertisement using BGP Link-State</title> Advertisement</title>
    <seriesInfo name="RFC" value="9351"/>
    <author fullname="Ketan Talaulikar" initials="K." role="editor" surname="Talaulikar">
      <organization>Arrcus, Inc</organization>
      <organization>Cisco Systems</organization>
      <address>
        <postal>
          <street/>
          <city/>
          <region/>
          <code/>
          <country>India</country>
        </postal>
        <email>ketant.ietf@gmail.com</email>
      </address>
    </author>
    <author fullname="Peter Psenak" initials="P." surname="Psenak">
      <organization>Cisco Systems</organization>
      <address>
        <postal>
          <street/>
          <city/>
          <region/>
          <code/>
          <country>Slovakia</country>
        </postal>
        <email>ppsenak@cisco.com</email>
      </address>
    </author>
    <author fullname="Shawn Zandi" initials="S" surname="Zandi">
      <organization>LinkedIn</organization>
      <address>
        <postal>
          <street/>
          <city/>
          <code/>

          <country>USA</country>
          <country>United States of America</country>
        </postal>
        <email>szandi@linkedin.com</email>
      </address>
    </author>
    <author fullname="Gaurav Dawra" initials="G" surname="Dawra">
      <organization>LinkedIn</organization>
      <address>
        <postal>
          <street/>
          <city/>
          <code/>

          <country>USA</country>
          <country>United States of America</country>
        </postal>
        <email>gdawra.ietf@gmail.com</email>
      </address>
    </author>
    <date year=""/>

    <area>Routing</area>

    <workgroup>Inter-Domain Routing</workgroup> year="2023" month="February"/>
    <area>rtg</area>
    <workgroup>idr</workgroup>
    <keyword>BGP-LS</keyword>
    <keyword>Segment Routing</keyword>
    <keyword>IS-IS</keyword>
    <keyword>OSPF</keyword>
    <keyword>OSPFv3</keyword>
    <abstract>
      <t>Flexible Algorithm is a solution that allows some routing protocols
      (e.g., OSPF and IS-IS) to compute paths over a network based on
      user-defined (and hence, flexible) constraints and metrics. The
      computation is performed by routers participating in the specific
      network in a distributed manner using a Flexible Algorithm Definition.
      This Definition (FAD).
      This definition is provisioned on one or more routers and propagated
      through the network by OSPF and IS-IS flooding.</t>

      <t>BGP Link-State
      <t>Border Gateway Protocol - Link State (BGP-LS) enables the collection of various
      topology information from the network. This document defines extensions to the
      BGP-LS address family to advertise the Flexible Algorithm Definition FAD as
      a part of the topology information from the network.</t>
    </abstract>
  </front>
  <middle>
    <section anchor="INTRO" title="Introduction"> numbered="true" toc="default">
      <name>Introduction</name>
      <t>The classical IGP (e.g., OSPF and IS-IS) computation of best paths
      over the network is based on the IGP metric assigned to the links in the
      network. Many network deployments use RSVP-TE-based solutions based on RSVP-TE <xref
      target="RFC3209"/> target="RFC3209"
      format="default"/> or Segment Routing (SR) Policy-based Policy <xref
      target="RFC8402"/> solutions target="RFC8402"
      format="default"/> to enforce traffic over a path that is
      computed using different metrics or constraints than the shortest IGP
      path. <xref target="I-D.ietf-lsr-flex-algo"/> target="RFC9350" format="default"/> defines the Flexible
      Algorithm solution that allows IGPs themselves to compute constraint
      based constraint-based paths over the
      network.</t>
      <t>Flexible Algorithm is so called so because it allows a user the
      flexibility to define <list style="symbols">
          <t>the define:</t>
      <ul spacing="normal">
        <li>the type of calculation to be used (e.g., shortest path)</t>

          <t>the path),</li>
        <li>the metric type to be used (e.g., IGP metric or TE metric)</t>

          <t>the metric), and</li>
        <li>the set of constraints to be used (e.g., inclusion or exclusion
          of certain links using affinities)</t>
        </list></t> affinities).</li>
      </ul>
      <t>The operations of the IGP flexible algorithm Flexible Algorithm solution are described
      in detail in <xref target="I-D.ietf-lsr-flex-algo"/>.</t> target="RFC9350" format="default"/>.</t>
      <t>The BGP-LS extensions for SR are defined in <xref target="RFC9085"/> target="RFC9085" format="default"/>
      and <xref target="I-D.ietf-idr-bgpls-srv6-ext"/> target="I-D.ietf-idr-bgpls-srv6-ext" format="default"/> for SR-MPLS and Segment
      Routing over IPv6 (SRv6), respectively. They include the extensions for
      advertisement of SR information including various types of Segment
      Identifiers (SIDs) as below: <list style="symbols">
          <t>SR </t>
      <ul spacing="normal">
        <li>SR Algorithm TLV to indicate the participation of a node in a
          flexible algorithm computation</t>

          <t>Prefix-SID
          Flexible Algorithm computation</li>
        <li>Prefix-SID TLV to indicate the association of the Prefix-SIDs to
          a specific flexible algorithm Flexible Algorithm for SR-MPLS forwarding</t>

          <t>SRv6 forwarding</li>
        <li>SRv6 Locator TLV to indicate the Locator for a specific flexible
          algorithm Flexible
        Algorithm for SRv6 forwarding</t>
        </list></t> forwarding</li>
      </ul>
      <t>This document defines extensions to BGP-LS for the advertisement of
      the Flexible Algorithm Definition (FAD) information to enable learning
      of the mapping of the flexible algorithm Flexible Algorithm number to its Definition definition in
      each area/domain of the underlying IGP. This Definition definition indicates the
      type of computation used and the constraints for a given flexible
      algorithm. Flexible
      Algorithm. This information can then be used for setting up SR Policy
      paths end to end across domains by using the appropriate flexible
      algorithm-specific Flexible-Algorithm-specific
      SIDs in its Segment List segment list <xref target="RFC9256"/>. target="RFC9256" format="default"/>.
      For example, picking the flexible algorithm Prefix SID Flexible Algorithm Prefix-SID (in case of
      SR-MPLS) or End SID (in case of SRv6) of Area Border Routers (ABRs) or
      Autonomous System Border Routers (ASBRs) corresponding to a Definition definition
      that optimizes on the delay metric enables the building of an end to end
      low latency end-to-end
      low-latency path across IGP domains with minimal SIDs in the SID
      list.</t>
      <section title="Requirements Language"> numbered="true" toc="default">
        <name>Requirements Language</name>
        <t>The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
        "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", "<bcp14>MUST</bcp14>", "<bcp14>MUST NOT</bcp14>", "<bcp14>REQUIRED</bcp14>", "<bcp14>SHALL</bcp14>", "<bcp14>SHALL NOT</bcp14>",
        "<bcp14>SHOULD</bcp14>", "<bcp14>SHOULD NOT</bcp14>", "<bcp14>RECOMMENDED</bcp14>", "<bcp14>NOT RECOMMENDED</bcp14>", "<bcp14>MAY</bcp14>", and
        "OPTIONAL"
        "<bcp14>OPTIONAL</bcp14>" in this document are to be interpreted as described in BCP
        14 <xref target="RFC2119"/> target="RFC2119" format="default"/> <xref target="RFC8174"/> target="RFC8174" format="default"/> when, and only
        when, they appear in all capitals, as shown here.</t>
      </section>
    </section>
    <section anchor="FA"
             title="Overview numbered="true" toc="default">
      <name>Overview of BGP-LS Extensions for Flexible Algorithm"> Algorithm</name>
      <t>BGP-LS <xref target="RFC7752"/> target="RFC7752" format="default"/> specifies the Node Network Layer
      Reachability Information (NLRI) for the advertisement of nodes nodes, along
      with their attributes using the BGP-LS Attribute, Attribute; the Link NLRI for the
      advertisement of links links, along with their attributes using the BGP-LS
      Attribute
      Attribute; and the Prefix NLRI for the advertisement of prefixes prefixes, along
      with their attributes using the BGP-LS Attribute.</t>
      <t>The FADs advertised by a node are considered as a node-level
      attribute and advertised as specified in <xref target="FADTLV"/>.</t> target="FADTLV" format="default"/>.</t>
      <t>Various link attributes attributes, like affinities and Shared Risk Link Group
      (SRLG)
      (SRLG), that are used during the Flexible Algorithm route calculations in
      IS-IS and OSPF are advertised in those protocols using the Application
      Specific Application-Specific Link
      Attribute (ASLA) advertisements advertisements, as described in <xref
      target="RFC8919"/>, target="RFC8919" format="default"/>, <xref target="RFC8920"/>, target="RFC8920" format="default"/>, and <xref
      target="I-D.ietf-lsr-flex-algo"/>. target="RFC9350" format="default"/>. The BGP-LS extensions for ASLA
      advertisements are specified in <xref target="RFC9294"/>.</t> target="RFC9294" format="default"/>.</t>
      <t>The Flexible Algorithm Prefix Metric (FAPM) is considered as a prefix
      attribute and advertised as specified in <xref target="FAMETRIC"/>.</t> target="FAMETRIC" format="default"/>.</t>
    </section>
    <section anchor="FADTLV" title="Flexible numbered="true" toc="default">
      <name>Flexible Algorithm Definition TLV"> TLV</name>
      <t>This document defines a new optional BGP-LS Attribute TLV associated
      with the Node NLRI called the Flexible "Flexible Algorithm Definition (FAD) TLV TLV" ("FAD TLV" for short),
      and its format is as follows:</t>

      <t><figure>
      <figure>
	<name>Flexible Algorithm Definition TLV </name>
      <artwork align="center"><![CDATA[ align="center" name="" type="" alt=""><![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            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|   Flex Algo   |   Metric-Type |   Calc-Type   |    Priority   |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                sub-TLVs       ...                            //
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

          Figure 1: Flexible Algorithm Definition TLV

where:
]]></artwork>
        </figure><list style="symbols">
          <t>Type: 1039</t>

          <t>Length:
      </figure>
      <dl newline="true" spacing="normal">
	<dt>where:</dt>
	<dd>
	  <dl newline="false" spacing="normal">
            <dt>Type:</dt><dd> 1039</dd>
            <dt>Length:</dt><dd> The total length of the value field (including any
            sub-TLVs) in octets. The length value MUST <bcp14>MUST</bcp14> be 4 or larger.</t>

          <t>Flexible larger.</dd>
            <dt>Flexible Algorithm (Flex Algo): Algo):</dt><dd> Single octet value carrying the
          flexible algorithm
            Flexible Algorithm number between 128 and 255 inclusive, as defined
            in <xref target="I-D.ietf-lsr-flex-algo"/>.</t>

          <t>Metric-Type: target="RFC9350" format="default"/>.</dd>
            <dt>Metric-Type:</dt><dd> Single octet value carrying the metric type, as
            defined in <xref target="I-D.ietf-lsr-flex-algo"/>.</t>

          <t>Calc-Type: target="RFC9350" format="default"/>.</dd>
            <dt>Calc-Type:</dt><dd> Single octet value carrying the calculation type, as
            defined in <xref target="I-D.ietf-lsr-flex-algo"/>.</t>

          <t>Priority: target="RFC9350" format="default"/>.</dd>
            <dt>Priority:</dt><dd> Single octet value carrying the priority of the FAD
            advertisement, as defined in <xref
          target="I-D.ietf-lsr-flex-algo"/>.</t>

          <t>sub-TLVs: zero target="RFC9350" format="default"/>.</dd>
            <dt>sub-TLVs:</dt><dd> Zero or more sub-TLVs may be included included, as described
            further in this section.</t>
        </list></t> section.</dd>
	  </dl>
	</dd>
      </dl>

      <t>The FAD TLV that is advertised in the BGP-LS Attribute along with the
      Node NLRI of a node is derived from the following IGP protocol-specific
      advertisements:<list style="symbols">
          <t>In
      advertisements:</t>
      <ul spacing="normal">
        <li>in the case of IS-IS, from the IS-IS Flexible Algorithm
          Definition sub-TLV in <xref target="I-D.ietf-lsr-flex-algo"/>.</t>

          <t>In target="RFC9350" format="default"/></li>
        <li>in the case of OSPFv2/OSPFv3, from the OSPF Flexible Algorithm
          Definition TLV in <xref target="I-D.ietf-lsr-flex-algo"/>.</t>
        </list></t> target="RFC9350" format="default"/></li>
      </ul>
      <t>The BGP-LS Attribute associated with a Node NLRI may include one or
      more FAD TLVs corresponding to the FAD for each algorithm that the
      particular node is advertising.</t>
      <t>The following sub-sections subsections define sub-TLVs of the FAD TLV.</t>
      <section anchor="FADAFFINITYEXCLANY"
               title="Flexible numbered="true" toc="default">
        <name>Flexible Algorithm Exclude Any Exclude-Any Affinity Sub-TLV"> Sub-TLV</name>
        <t>The Flexible Algorithm Exclude Any Exclude-Any Affinity sub-TLV is an optional
        sub-TLV that is used to carry the affinity constraints associated with
        the FAD and enable the exclusion of links carrying any of the
        specified affinities from the computation of the specific algorithm algorithm, as
        described in <xref target="I-D.ietf-lsr-flex-algo"/>. target="RFC9350" format="default"/>. The affinity is
        expressed in terms of the Extended Admin Group (EAG) (EAG), as defined in <xref
        target="RFC7308"/>.</t>
	target="RFC7308" format="default"/>.</t>
        <t>The sub-TLV has the following format:<figure align="center"> format:</t>

	<figure>
	  <name>Flexible Algorithm Exclude-Any Affinity Sub-TLV</name>
        <artwork align="left"><![CDATA[ align="left" name="" type="" alt=""><![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           |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|             Exclude-Any EAG (variable)                       //
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

    Figure 2: Flexible Algorithm Exclude Any Affinity sub-TLV

where:
]]></artwork>
          </figure></t>

        <t><list style="symbols">
            <t>Type: 1040</t>

            <t>Length: The
	</figure>
        <dl newline="true" spacing="normal">
	  <dt>where:</dt>
	  <dd>
	    <dl newline="false">
              <dt>Type:</dt><dd>1040</dd>
              <dt>Length:</dt><dd>The total length of the value field in octets dependent
              on the size of the EAG. It MUST <bcp14>MUST</bcp14> be a non-zero value and a multiple
              of 4.</t>

            <t>Exclude-Any EAG: the 4.</dd>
              <dt>Exclude-Any EAG:</dt><dd>The EAG value value, as defined in <xref
            target="I-D.ietf-lsr-flex-algo"/>.</t>
          </list></t> target="RFC9350"
	      format="default"/>.</dd>
            </dl>
	  </dd>
	</dl>
        <t>The information in the Flexible Algorithm Exclude Any Exclude-Any Affinity
        sub-TLV is derived from the IS-IS and OSPF protocol-specific Flexible
        Algorithm Exclude Admin Group sub-TLV sub-TLV, as defined in <xref
        target="I-D.ietf-lsr-flex-algo"/>.</t> target="RFC9350" format="default"/>.</t>
      </section>
      <section anchor="FADAFFINITYINCLANY"
               title="Flexible numbered="true" toc="default">
        <name>Flexible Algorithm Include Any Include-Any Affinity Sub-TLV"> Sub-TLV</name>
        <t>The Flexible Algorithm Include Any Include-Any Affinity sub-TLV is an optional
        sub-TLV that is used to carry the affinity constraints associated with
        the FAD and enable the inclusion of links carrying any of the
        specified affinities in the computation of the specific algorithm algorithm, as
        described in <xref target="I-D.ietf-lsr-flex-algo"/>. target="RFC9350" format="default"/>. The affinity is
        expressed in terms of Extended Admin Group (EAG) the EAG, as defined in <xref
        target="RFC7308"/>.</t>
	target="RFC7308" format="default"/>.</t>
        <t>The sub-TLV has the following format:<figure align="center"> format:</t>
	<figure>
	  <name>Flexible Algorithm Include-Any Affinity Sub-TLV</name>
        <artwork align="left"><![CDATA[ align="left" name="" type="" alt=""><![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           |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|             Include-Any EAG (variable)                       //
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

    Figure 3: Flexible Algorithm Include Any Affinity sub-TLV

where:
]]></artwork>
          </figure></t>

        <t><list style="symbols">
            <t>Type: 1041</t>

            <t>Length: The
	</figure>
        <dl newline="true" spacing="normal">
	  <dt>where:</dt>
	  <dd>
	    <dl newline="false" spacing="normal">
              <dt>Type:</dt><dd>1041</dd>
              <dt>Length:</dt><dd>The total length of the value field in octets dependent
              on the size of the EAG. It MUST <bcp14>MUST</bcp14> be a non-zero value and a multiple
              of 4.</t>

            <t>Include-Any EAG: the 4.</dd>
              <dt>Include-Any EAG:</dt><dd>The EAG value value, as defined in <xref
            target="I-D.ietf-lsr-flex-algo"/>.</t>
          </list></t> target="RFC9350"
	      format="default"/>.</dd>
            </dl>
	  </dd>
	</dl>
        <t>The information in the Flexible Algorithm Include Any Include-Any Affinity
        sub-TLV is derived from the IS-IS and OSPF protocol-specific Flexible
        Algorithm Include-Any Admin Group sub-TLV sub-TLV, as defined in <xref
        target="I-D.ietf-lsr-flex-algo"/>.</t> target="RFC9350" format="default"/>.</t>
      </section>
      <section anchor="FADAFFINITYINCLALL"
               title="Flexible numbered="true" toc="default">
        <name>Flexible Algorithm Include All Include-All Affinity Sub-TLV"> Sub-TLV</name>
        <t>The Flexible Algorithm Include All Include-All Affinity sub-TLV is an optional
        sub-TLV that is used to carry the affinity constraints associated with
        the FAD and enable the inclusion of links carrying all of the
        specified affinities in the computation of the specific algorithm algorithm, as
        described in <xref target="I-D.ietf-lsr-flex-algo"/>. target="RFC9350" format="default"/>. The affinity is
        expressed in terms of Extended Admin Group (EAG) the EAG, as defined in <xref
        target="RFC7308"/>.</t> target="RFC7308" format="default"/>.</t>
        <t>The sub-TLV has the following format:<figure align="center"> format:</t>
	<figure>
	  <name>Flexible Algorithm Include-All Affinity Sub-TLV</name>
        <artwork align="left"><![CDATA[ align="left" name="" type="" alt=""><![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           |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|             Include-All EAG (variable)                       //
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

    Figure 4: Flexible Algorithm Include All Affinity sub-TLV

where:
]]></artwork>
          </figure></t>

        <t><list style="symbols">
            <t>Type: 1042</t>

            <t>Length: The
	</figure>
        <dl newline="true" spacing="normal">
	  <dt>where:</dt>
	  <dd>
	    <dl newline="false" spacing="normal">
              <dt>Type:</dt><dd>1042</dd>
              <dt>Length:</dt><dd>The total length of the value field in octets dependent
              on the size of the EAG. It MUST <bcp14>MUST</bcp14> be a non-zero value and a multiple
              of 4.</t>

            <t>Include-All EAG: the 4.</dd>
              <dt>Include-All EAG:</dt><dd>The EAG value value, as defined in <xref
            target="I-D.ietf-lsr-flex-algo"/>.</t>
          </list></t> target="RFC9350"
	      format="default"/>.</dd>
            </dl>
	  </dd>
	</dl>
        <t>The information in the Flexible Algorithm Include All Include-All Affinity
        sub-TLV is derived from the IS-IS and OSPF protocol-specific Flexible
        Algorithm Include-All Admin Group sub-TLV sub-TLV, as defined in <xref
        target="I-D.ietf-lsr-flex-algo"/>.</t> target="RFC9350" format="default"/>.</t>
      </section>
      <section anchor="FADFLAGS"
               title="Flexible numbered="true" toc="default">
        <name>Flexible Algorithm Definition Flags Sub-TLV"> Sub-TLV</name>
        <t>The Flexible Algorithm Definition Flags sub-TLV is an optional
        sub-TLV that is used to carry the flags associated with the FAD that
        are used in the computation of the specific algorithm algorithm, as described in
        <xref target="I-D.ietf-lsr-flex-algo"/>.</t> target="RFC9350" format="default"/>.</t>
        <t>The sub-TLV has the following format:<figure align="center"> format:</t>
	<figure>
	  <name>Flexible Algorithm Definition Flags Sub-TLV</name>
        <artwork align="left"><![CDATA[ align="left" name="" type="" alt=""><![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)                       //
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

    Figure 5: Flexible Algorithm Definition Flags sub-TLV

where:
]]></artwork>
          </figure></t>

        <t><list style="symbols">
            <t>Type: 1043</t>

            <t>Length: The
	</figure>
        <dl newline="true" spacing="normal">
	  <dt>where:</dt>
	  <dd>
	    <dl newline="false" spacing="normal">
              <dt>Type:</dt><dd>1043</dd>
              <dt>Length:</dt><dd>The total length of the value field in octets dependent
              on the size of the Flags. flags. It MUST <bcp14>MUST</bcp14> be a non-zero value and a
              multiple of 4.</t>

            <t>Flags: the 4.</dd>
              <dt>Flags:</dt><dd>The bitmask used to represent the flags for the FAD, as
              defined in <xref target="I-D.ietf-lsr-flex-algo"/>.</t>
          </list></t> target="RFC9350" format="default"/>.</dd>
            </dl>
	  </dd>
	</dl>
        <t>The information in the Flexible Algorithm Definition Flags sub-TLV
        is derived from the IS-IS and OSPF protocol-specific Flexible
        Algorithm Definition Flags sub-TLV sub-TLV, as defined in <xref
        target="I-D.ietf-lsr-flex-algo"/>.</t> target="RFC9350" format="default"/>.</t>
      </section>
      <section anchor="FADSRLGEXCL"
               title="Flexible numbered="true" toc="default">
        <name>Flexible Algorithm Exclude SRLG Sub-TLV"> Sub-TLV</name>
        <t>The Flexible Algorithm Exclude SRLG sub-TLV is an optional sub-TLV
        that is used to carry the Shared Risk Link Group (SRLG) information
        associated with the FAD and enable the exclusion of links that are
        associated with any of the specified SRLG in the computation of the
        specific algorithm algorithm, as described in <xref
        target="I-D.ietf-lsr-flex-algo"/>. target="RFC9350" format="default"/>. The SRLGs associated with a link
        are carried in the BGP-LS Shared Link Risk Link Group (TLV 1096) <xref
        target="RFC7752"/>.</t> target="RFC7752" format="default"/>.</t>
        <t>The sub-TLV has the following format:<figure align="center"> format:</t>
	<figure>
	  <name>Flexible Algorithm Exclude SRLG Sub-TLV</name>
        <artwork align="left"><![CDATA[ align="left" name="" type="" alt=""><![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           |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|           Shared Risk Link Group Values (variable)           //
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

    Figure 6: Flexible Algorithm Exclude SRLG sub-TLV

where:
]]></artwork>
          </figure></t>

        <t><list style="symbols">
            <t>Type: 1045</t>

            <t>Length: The
	</figure>
        <dl newline="true" spacing="normal">
	  <dt>where:</dt>
	  <dd>
	    <dl newline="false" spacing="normal">
              <dt>Type:</dt><dd>1045</dd>
              <dt>Length:</dt><dd>The total length of the value field in octets dependent
              on the number of SRLG values carried. It MUST <bcp14>MUST</bcp14> be a non-zero value
              and a multiple of 4.</t>

            <t>Shared 4.</dd>
              <dt>Shared Risk Link Group Values: One Values:</dt><dd>One or more SRLG values, each with a
              size of 4 octet size, octets, as defined in <xref
            target="I-D.ietf-lsr-flex-algo"/>.</t>
          </list></t> target="RFC9350" format="default"/>.</dd>
            </dl>
	  </dd>
	</dl>
        <t>The information in the Flexible Algorithm SRLG Exclude SRLG sub-TLV is
        derived from the IS-IS and OSPF protocol-specific Flexible Algorithm
        Exclude SRLG sub-TLV sub-TLV, as defined in <xref
        target="I-D.ietf-lsr-flex-algo"/>.</t> target="RFC9350" format="default"/>.</t>
      </section>
      <section anchor="FADUNK" title="Flexible numbered="true" toc="default">
        <name>Flexible Algorithm Unsupported Sub-TLV"> Sub-TLV</name>
        <t>The OSPF and IS-IS signaling for FAD allows for extensions via new
        sub-TLVs under the respective IGP's Flexible Algorithm Definition TLV.
        As specified in section 5.3 of <xref
        target="I-D.ietf-lsr-flex-algo"/>, target="RFC9350" format="default" sectionFormat="of"
	section="5.3"/>, it is important that the entire FAD
        be understood by anyone using it for computation purpose. purposes. Therefore,
        the FAD is different from most other protocol extensions extensions, where the
        skipping or ignoring of unsupported sub-TLV information does not
        affect the base behavior.</t>
        <t>The Flexible Algorithm Unsupported sub-TLV is an optional sub-TLV
        that is used to indicate the presence of unsupported FAD sub-TLVs. The
        need for this sub-TLV arises when the BGP-LS implementation on the
        advertising node does not support one or more of the FAD sub-TLVs
        present in the IGP advertisement.</t>
        <t>The sub-TLV has the following format:<figure align="center"> format:</t>
	<figure>
	  <name>Flexible Algorithm Unsupported Sub-TLV</name>
        <artwork align="left"><![CDATA[ align="left" name="" type="" alt=""><![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           |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|  Protocol-ID  | sub-TLV types (variable) ...                 //
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

    Figure 7: Flexible Algorithm Unsupported sub-TLV

where:
]]></artwork>
          </figure></t>

        <t><list style="symbols">
            <t>Type: TBD (Note to Editor: The code point allocation, once made
            by IANA, needs to be updated here - refer to <xref
            target="IANA"/>)</t>

            <t>Length:
      </figure>
      <dl newline="true" spacing="normal">
	<dt>where:</dt>
	<dd>
	  <dl newline="false" spacing="normal">
            <dt>Type:</dt><dd>1046</dd>
            <dt>Length:</dt><dd> The total length of the value field in octets
            (including any included sub-TLV types).</t>

            <t>Protocol-ID: types).</dd>
            <dt>Protocol-ID:</dt><dd> Indicates the BGP-LS Protocol-ID of the protocol
            from which the FAD is being advertised via BGP-LS. The values are
            from the IANA "BGP-LS Protocol-IDs" registry
            &lt;https://www.iana.org/assignments/bgp-ls-parameters/bgp-ls-parameters.xhtml#protocol-ids&gt; subregistry
            under the IANA BGP-LS Parameters registry.</t>

            <t>sub-TLV types: "Border Gateway Protocol - Link State (BGP-LS) Parameters"
	    registry <eref target="https://www.iana.org/assignments/bgp-ls-parameters/" brackets="angle"/>.</dd>
          <dt>sub-TLV types:</dt><dd> Zero or more sub-TLV types that are not
            supported by the node originating the BGP-LS advertisement. The
            size of each sub-TLV type depends on the protocol indicated by the
            Protocol-ID field. For example, for IS-IS IS-IS, each sub-TLV type would
            be of size 1 octet in size, while for OSPF OSPF, each sub-TLV type would be of
            size 2 octets.</t>
          </list></t> octets
            in size.</dd>
        </dl>
      </dd>
    </dl>
        <t>The node originating the advertisement MUST <bcp14>MUST</bcp14> include the Flexible
        Algorithm Unsupported sub-TLV when it comes across an unsupported
        sub-TLV in the corresponding FAD in the IS-IS and OSPF advertisement.
        When advertising the Flexible Algorithm Unsupported sub-TLV, the
        protocol-specific sub-TLV types that are not supported SHOULD <bcp14>SHOULD</bcp14> be
        included. This information serves as a diagnostic aid.</t>
        <t>The discussion on the use of the FAD information by the consumers
        of the BGP-LS information is beyond the scope of this document.
        However, it is RECOMMENDED <bcp14>RECOMMENDED</bcp14> that the choice of the node used for
        originating the IGP topology information into BGP-LS be made such that
        the advertising node supports all the FAD extensions in use in its
        part of the network. This avoids the scenario where an incomplete FAD
        gets advertised via BGP-LS.</t>
      </section>
    </section>
    <section anchor="FAMETRIC" title="Flexible numbered="true" toc="default">
      <name>Flexible Algorithm Prefix Metric TLV"> TLV</name>
      <t>This document defines a new optional BGP-LS Attribute TLV associated
      with the Prefix NLRI called the Flexible "Flexible Algorithm Prefix Metric (FAPM) TLV
      ("FAPM TLV" for short), and its format is as follows:</t>

      <t><figure align="center">
      <figure>
	<name>Flexible Algorithm Prefix Metric TLV</name>
      <artwork align="left"><![CDATA[ align="left" name="" type="" alt=""><![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           |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|   Flex Algo   |     Flags     |            Reserved           |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                            Metric                             |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

      Figure 8: Flexible Algorithm Prefix Metric TLV

where:
]]></artwork>
        </figure></t>

      <t><list style="symbols">
          <t>Type: 1044</t>

          <t>Length: 8 octets.</t>

          <t>Flexible
</figure>
      <dl newline="true" spacing="normal">
	<dt>where:</dt>
	<dd>
	  <dl newline="false" spacing="normal">
            <dt>Type:</dt><dd>1044</dd>
            <dt>Length:</dt><dd>8 octets</dd>
            <dt>Flexible Algorithm (Flex Algo): Single Algo):</dt><dd>Single octet value carrying the
          flexible algorithm
            Flexible Algorithm number between 128 and 255 inclusive, as defined
            in <xref target="I-D.ietf-lsr-flex-algo"/>.</t>

          <t>Flags: single target="RFC9350" format="default"/>.</dd>
            <dt>Flags:</dt><dd>Single octet value and only applicable for OSPF OSPF, as defined
            in <xref target="I-D.ietf-lsr-flex-algo"/>. target="RFC9350" format="default"/>. The value MUST <bcp14>MUST</bcp14> be set
	    to 0 for IS-IS.</t>

          <t>Reserved: 2 octet IS-IS.</dd>
            <dt>Reserved:</dt><dd>2-octet value that MUST <bcp14>MUST</bcp14> be set to 0 by the
	    originator and MUST <bcp14>MUST</bcp14> be ignored by the receiver.</t>

          <t>Metric: 4 octets receiver.</dd>
            <dt>Metric:</dt><dd>4-octet field to carry the metric information.</t>
        </list></t> information.</dd>
	  </dl>
	</dd>
      </dl>
      <t>The FAPM TLV that is advertised in the BGP-LS Attribute along with
      the Prefix NLRI from a node is derived from the following IGP
      protocol-specific advertisements:<list style="symbols">
          <t>In advertisements:</t>
      <ul spacing="normal">
        <li>in the case of IS-IS, from the IS-IS Flexible Algorithm Prefix
        Metric sub-TLV in <xref target="I-D.ietf-lsr-flex-algo"/>.</t>

          <t>In target="RFC9350" format="default"/></li>
        <li>in the case of OSPFv2/OSPFv3, from the OSPF Flexible Algorithm
        Prefix Metric sub-TLV in <xref
          target="I-D.ietf-lsr-flex-algo"/>.</t>
        </list></t> target="RFC9350" format="default"/></li>
      </ul>
      <t>The BGP-LS Attribute associated with a Prefix NLRI may include one or
      more FAPM TLVs corresponding to the Flexible Algorithm Prefix Metric for
      each algorithm associated with that particular prefix.</t>
    </section>
    <section anchor="IANA" title="IANA Considerations"> numbered="true" toc="default">
      <name>IANA Considerations</name>
        <t>IANA has allocated code points from in the registry "BGP-LS Node
      Descriptor, Link Descriptor, Prefix Descriptor, and Attribute TLVs"
      &lt;https://www.iana.org/assignments/bgp-ls-parameters/bgp-ls-parameters.xhtml#node-descriptor-link-descriptor-prefix-descriptor-attribute-tlv&gt; registry
      <eref target="https://www.iana.org/assignments/bgp-ls-parameters" brackets="angle"/>
      based on the table below for the TLVs/sub-TLVs introduced by this
      document. This document requests IANA to allocate the pending code point
      for the Flexible
      document.</t>

<table anchor="algorithm">
<name>Flexible Algorithm Unsupported sub-TLV as suggested below. The
      column "IS-IS TLV/Sub-TLV" defined in the registry does not require any
      value and should be left empty.</t>

      <figure>
        <artwork align="center"><![CDATA[
+------------+-----------------------------------------+
| Code Point |         Description                     |
+------------+-----------------------------------------+
| 1039       | Flexible Algorithm Definition           |
| 1040       | Flexible Points</name>
<thead>
<tr>
<th>TLV Code Point</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>1039</td>
<td>Flexible Algorithm Definition</td>
</tr>
<tr>
<td>1040</td>
<td>Flexible Algorithm Exclude Any Affinity |
| 1041       | Flexible Exclude-Any Affinity</td>
</tr>
<tr>
<td>1041</td>
<td>Flexible Algorithm Include Any Affinity |
| 1042       | Flexible Include-Any Affinity</td>
</tr>
<tr>
<td>1042</td>
<td>Flexible Algorithm Include All Affinity |
| 1043       | Flexible Include-All Affinity</td>
</tr>
<tr>
<td>1043</td>
<td>Flexible Algorithm Definition Flags     |
| 1044       | Flexible Flags</td>
</tr>
<tr>
<td>1044</td>
<td>Flexible Algorithm Prefix Metric        |
| 1045       | Flexible Metric</td>
</tr>
<tr>
<td>1045</td>
<td>Flexible Algorithm Exclude SRLG         |
| 1046 (Sugg)| Flexible Algorithm Unsupported          |
+------------+-----------------------------------------+

    Table 1: Flexible Algorithm Code Points

]]></artwork>
      </figure> SRLG</td>
</tr>
<tr>
<td>1046</td>
<td>Flexible Algorithm Unsupported</td>
</tr>
</tbody>
</table>
    </section>
    <section anchor="Manageability" title="Manageability Considerations"> numbered="true" toc="default">
      <name>Manageability Considerations</name>
      <t>The new protocol extensions introduced in this document augment the
      existing IGP topology information that can be distributed via <xref
      target="RFC7752"/>. target="RFC7752" format="default"/>. Procedures and protocol extensions defined in this
      document do not affect the BGP protocol operations and management other
      than as what is discussed in the Manageability Considerations "Manageability Considerations" section of <xref
      target="RFC7752"/>. target="RFC7752" format="default"/>. Specifically, the malformed NLRIs attribute tests in
      the Fault Management "Fault Management" section of <xref target="RFC7752"/> target="RFC7752" format="default"/> now encompass
      the new TLVs for the BGP-LS NLRI in this document.</t>
      <t>The extensions specified in this document do not specify any new
      configuration or monitoring aspects in BGP or BGP-LS. The specification
      of BGP models is an ongoing work based on <xref
      target="I-D.ietf-idr-bgp-model"/>.</t> target="I-D.ietf-idr-bgp-model" format="default"/>.</t>
    </section>
    <section anchor="Security" title="Security Considerations"> numbered="true" toc="default">
      <name>Security Considerations</name>
      <t>Security considerations for acquiring and distributing BGP-LS
      information are discussed in <xref target="RFC7752"/>.</t> target="RFC7752" format="default"/>.</t>
      <t>The TLVs introduced in this document are used to propagate the IGP
      Flexible Algorithm extensions defined in <xref
      target="I-D.ietf-lsr-flex-algo"/>. target="RFC9350" format="default"/>. It is assumed that the IGP instances
      originating these TLVs will support all the required security (as
      described in <xref target="I-D.ietf-lsr-flex-algo"/>) target="RFC9350" format="default"/>) for Flexible
      Algorithm deployment.</t>
      <t>This document specifies extensions for the advertisement of node and
      prefix related flexible algorithm
      prefix-related Flexible Algorithm information. Tampering with this
      flexible algorithm-related
      Flexible-Algorithm-related information may affect applications using it,
      including impacting route calculation and programming. As the
      advertisements defined in this document are related to a specific
      flexible algorithm
      Flexible Algorithm topology, the impact of tampering is similarly
      limited in scope.</t>
    </section>
  </middle>
  <back>

<displayreference target="I-D.ietf-idr-bgpls-srv6-ext" to="IDR-BGPLS-SRV6-EXT"/>
<displayreference target="I-D.ietf-idr-bgp-model" to="IDR-BGP-MODEL"/>

    <references>
      <name>References</name>
      <references>

        <name>Normative References</name>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8174.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.7308.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.7752.xml"/>

<reference anchor='RFC9350' target='https://www.rfc-editor.org/info/rfc9350'>
<front>
<title>IGP Flexible Algorithm</title>
<author initials='P' surname='Psenak' fullname='Peter Psenak' role='editor'>
<organization />
</author>
<author initials='S' surname='Hegde' fullname='Shraddha Hegde'>
<organization />
</author>
<author initials='C' surname='Filsfils' fullname='Clarence Filsfils'>
<organization />
</author>
<author initials='K' surname='Talaulikar' fullname='Ketan Talaulikar'>
<organization />
</author>
<author initials='A' surname='Gulko' fullname='Arkadiy Gulko'>
<organization />
</author>
<date year='2023' month='February'/>
</front>
<seriesInfo name="RFC" value="9350"/>
<seriesInfo name="DOI" value="10.17487/RFC9350"/>
</reference>

      </references>
      <references>
        <name>Informative References</name>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.3209.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8402.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8919.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8920.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.9294.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.9256.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.9085.xml"/>

<reference anchor="I-D.ietf-idr-bgpls-srv6-ext">
<front>
<title>BGP Link State Extensions for SRv6</title>
<author initials='G' surname='Dawra' fullname='Gaurav Dawra'>
  <organization/>
</author>
<author initials='C' surname='Filsfils' fullname='Clarence Filsfils'>
  <organization/>
</author>
<author initials='K' surname='Talaulikar' fullname='Ketan Talaulikar' role='editor'>
  <organization/>
</author>
<author initials='M' surname='Chen' fullname='Mach Chen'>
  <organization/>
</author
><author initials='D' surname='Bernier' fullname='Daniel Bernier'>
  <organization/>
</author>
<author initials='B' surname='Decraene' fullname='Bruno Decraene'>
  <organization/>
</author>
<date month='January' day='14' year='2023'/>
</front>
<seriesInfo name='Internet-Draft' value='draft-ietf-idr-bgpls-srv6-ext-13'/>
<format type='TXT' target='https://www.ietf.org/archive/id/draft-ietf-idr-bgpls-srv6-ext-13.txt'/>
</reference>

        <xi:include href="https://datatracker.ietf.org/doc/bibxml3/reference.I-D.ietf-idr-bgp-model.xml"/>
      </references>
    </references>

    <section anchor="ACK" title="Acknowledgements"> numbered="false" toc="default">
      <name>Acknowledgements</name>
      <t>The authors would like to thank Les Ginsberg, Amalesh Maity, Y F Siu,
      Vijay Gurbani, <contact fullname="Les Ginsberg"/>, <contact
      fullname="Amalesh Maity"/>, <contact fullname="Y. F. Siu"/>,
      <contact fullname="Vijay Gurbani"/>, and Donald <contact fullname="Donald Eastlake III 3rd"/> for
      their reviews and contributions to this work. The authors would like to thank Jie Dong <contact
      fullname="Jie Dong"/> for his shepherd review. The authors would like to thank Alvaro Retana <contact
      fullname="Alvaro Retana"/> for his detailed AD review and suggestions for improving this
      document.</t>
    </section>
  </middle>

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

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

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

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

      <?rfc include='reference.I-D.ietf-lsr-flex-algo'?>
    </references>

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

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

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

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

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

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

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

      <?rfc include='reference.I-D.ietf-idr-bgpls-srv6-ext'?>

      <?rfc include='reference.I-D.ietf-idr-bgp-model'?>
    </references>
  </back>
</rfc>