<?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-lsr-ip-flexalgo-04" ipr="trust200902">
  <front>
    <title abbrev="IP Flex-Algorithm">IGP Flexible Algorithms (Flex-Algorithm)
    In IP Networks</title>

    <author fullname="William Britto" initials="W." surname="Britto">
      <organization>Juniper Networks</organization>

      <address>
        <postal>
          <street>Elnath-Exora Business Park Survey</street>

          <city>Bangalore</city>

          <region>Karnataka</region>

          <code>560103</code>

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

        <email>bwilliam@juniper.net</email>
      </address>
    </author>

    <author fullname="Shraddha Hegde" initials="S." surname="Hegde">
      <organization>Juniper Networks</organization>

      <address>
        <postal>
          <street>Elnath-Exora Business Park Survey</street>

          <city>Bangalore</city>

          <region>Karnataka</region>

          <code>560103</code>

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

        <email>shraddha@juniper.net</email>
      </address>
    </author>

    <author fullname="Parag Kaneriya " initials="P." surname="Kaneriya">
      <organization>Juniper Networks</organization>

      <address>
        <postal>
          <street>Elnath-Exora Business Park Survey</street>

          <city>Bangalore</city>

          <region>Karnataka</region>

          <code>560103</code>

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

        <email>pkaneria@juniper.net</email>
      </address>
    </author>

    <author fullname="Rejesh Shetty" initials="R." surname="Shetty">
      <organization>Juniper Networks</organization>

      <address>
        <postal>
          <street>Elnath-Exora Business Park Survey</street>

          <city>Bangalore</city>

          <region>Karnataka</region>

          <code>560103</code>

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

        <email>mrajesh@juniper.net</email>
      </address>
    </author>

    <author fullname="Ron Bonica" initials="R." surname="Bonica">
      <organization>Juniper Networks</organization>

      <address>
        <postal>
          <street>2251 Corporate Park Drive</street>

          <city>Herndon</city>

          <code>20171</code>

          <region>Virginia</region>

          <country>USA</country>
        </postal>

        <email>rbonica@juniper.net</email>
      </address>
    </author>

    <author fullname="Peter Psenak" initials="P." surname="Psenak">
      <organization>Cisco Systems</organization>

      <address>
        <postal>
          <street>Apollo Business Center</street>

          <city>Mlynske nivy 43</city>

          <region>Bratislava</region>

          <code>82109</code>

          <country>Slovakia</country>
        </postal>

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

    <date day="19" month="December" year="2021"/>

    <area>Routing Area</area>

    <workgroup>LSR Working Group</workgroup>

    <keyword>ISIS</keyword>

    <keyword>Draft</keyword>

    <abstract>
      <t>An IGP Flexible Algorithm (Flex-Algorithm) allows IGP to compute
      constraint-based paths. As currently defined, IGP Flex-Algorithm is used
      with Segment Routing (SR) data planes - SR MPLS and SRv6. Therefore,
      Flex-Algorithm cannot be deployed in the absence of SR.</t>

      <t>This document extends IGP Flex-Algorithm, so that it can be used for
      regular IPv4 and IPv6 prefixes. This allows Flex-Algorithm to be
      deployed in any IP network, even in the absence of SR.</t>
    </abstract>
  </front>

  <middle>
    <section title="Introduction">
      <t>An IGP Flex-Algorithm as specified in <xref
      target="I-D.ietf-lsr-flex-algo"/> computes a constraint-based path to:
      <list style="symbols">
          <t>All Flex-Algorithm specific Prefix Segment Identifiers (SIDs)
          <xref target="RFC8402"/>.</t>

          <t>All Flex-Algorityhm specific SRv6 Locators <xref
          target="RFC8986"/>.</t>
        </list>Therefore, Flex-Algorithm cannot be deployed in the absence of
      SR and SRv6.</t>

      <t>This document extends Flex-Algorithm, allowing it to compute paths
      to:</t>

      <t><list style="symbols">
          <t>An <xref target="RFC0791">IPv4</xref> address.</t>

          <t>An <xref target="RFC8200">IPv6 </xref> address.</t>
        </list>This allows Flex-Algorithm to be deployed in any IP network,
      even in the absence of SR and SRv6.</t>
    </section>

    <section anchor="ReqLang" 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 <xref
      target="RFC2119">BCP 14</xref> <xref target="RFC8174"/> when, and only
      when, they appear in all capitals, as shown here.</t>
    </section>

    <section title="Egress Node Procedures">
      <t>Network operators configure multiple loopback interfaces on an egress
      node. They associate one or more IP addresses with each loopback
      interface and one Flex-Algorithm with each IP address.</t>

      <t>If a packet is sent to a loopback address, and the loopback address
      is not associated with a Flex-Algorithm, the packet follows the IGP
      least-cost path to the egress node. If a packet is sent to a loopback
      address, and the loopback address is associated with a Flex-Algorithm,
      the packet follows the constraint-base path that the Flex-Algorithm
      calculated.</t>
    </section>

    <section title="Advertising Flex-Algorithm Definitions (FAD)">
      <t>To guarantee loop free forwarding, all routers that participate in a
      Flex-Algorithm MUST agree on the Flex-Algorithm Definition (FAD).</t>

      <t>Selected nodes within the IGP domain MUST advertise FADs as described
      in Sections 5, 6 and 7 of <xref target="I-D.ietf-lsr-flex-algo"/>.</t>
    </section>

    <section anchor="PARTICIPATION"
             title="Advertising IP Flex-Algorithm Participation">
      <t>A node may use various algorithms when calculating paths to nodes and
      prefixes. Algorithm values are defined in the <xref
      target="IANA-ALG">IGP Algorithm Type Registry </xref>.</t>

      <t>A node MUST participate in a Flex-Algorithm to be:</t>

      <t><list style="symbols">
          <t>able to compute path for such Flex-Algorithm</t>

          <t>be part of the topology for such Flex-Algorithm</t>
        </list></t>

      <t>Flex-Algorithm participation MUST be advertised for each
      Flex-Algorithm application independently, as specified in Section 10.2
      of <xref target="I-D.ietf-lsr-flex-algo"/>. Using Flex-Algorithm for
      regular IPv4 and IPv6 prefixes represents a new Flex-Algorithm
      application (IP Flex-Algorithm), and as such the Flex-Algorithm
      participation for the IP Flex-Algorithm application MUST be signalled
      independently of any other Flex-Algorithm applications (e.g. SR).</t>

      <t>Following sections describe how the IP Flex-Algorithm participation
      is advertised in IGP protocols.</t>

      <section anchor="ISIS-ALG_TLV" title="The ISIS IP Algorithm Sub-TLV">
        <t>The ISIS IP Algorithm Sub-TLV is a sub-TLV of the ISIS Router
        Capability TLV <xref target="RFC7981"/> and has the following format:
        <figure align="center" anchor="ISISAlg"
            title="ISIS IP Algorithm Sub-TLV">
            <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 2  | Algorithm ... |  Algorithm n  |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

]]></artwork>
          </figure> <list style="symbols">
            <t>Type: IP Algorithm Sub-TLV (Value 29)</t>

            <t>Length: Variable</t>

            <t>Algorithm (1 octet): value from 1 to 255.</t>
          </list></t>

        <t>The IP Algorithm Sub-TLV MUST be propagated throughout the level
        and MUST NOT be advertised across level boundaries. Therefore, the S
        bit in the Router Capability TLV, in which the IP Algorithm Sub-TLV is
        advertised, MUST NOT be set.</t>

        <t>The IP Algorithm Sub-TLV is optional. It MUST NOT be advertised
        more than once at a given level. A router receiving multiple IP
        Algorithm sub-TLVs from the same originator SHOULD select the first
        advertisement in the lowest-numbered LSP and subsequent instances of
        the IP Algorithm Sub-TLV MUST be ignored.</t>

        <t>The IP Algorithm Sub-TLV advertises the participation in
        Flex-Algorithms, and MUST NOT impact the router participation in
        default algorithm 0. The IP Algorithm Sub-TLV could be used to
        advertise support for non-zero standard algorithms, but that is
        outside the scope of this document.</t>

        <t>The IP Flex-Algorithm participation advertised in ISIS IP Algorithm
        Sub-TLV is topology independent. When a router advertises
        participation in ISIS IP Algorithm Sub-TLV, the participation applies
        to all topologies in which the advertising node participates.</t>
      </section>

      <section anchor="OSPF-ALG_TLV" title="The OSPF IP Algorithm TLV">
        <t>The OSPF IP Algorithm TLV is a top-level TLV of the <xref
        target="RFC7770">Router Information Opaque LSA</xref> and has the
        following format: <figure align="center" anchor="OSPFAlg"
            title="OSPF IP Algorithm TLV">
            <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> <list style="symbols">
            <t>Type: IP Algorithm TLV (Value TBD by IANA)</t>

            <t>Length: Variable</t>

            <t>Algorithm (1 octet): value from 1 to 255.</t>
          </list></t>

        <t>The IP Algorithm TLV is optional. It SHOULD only be advertised once
        in the Router Information Opaque LSA.</t>

        <t>When multiple IP Algorithm TLVs are received from a given router,
        the receiver MUST use the first occurrence of the TLV in the Router
        Information Opaque LSA. If the IP Algorithm TLV appears in multiple
        Router Information Opaque LSAs that have different flooding scopes,
        the IP Algorithm TLV in the Router Information Opaque LSA with the
        area-scoped flooding scope MUST be used. If the IP Algorithm TLV
        appears in multiple Router Information Opaque LSAs that have the same
        flooding scope, the IP Algorithm TLV in the Router Information (RI)
        Opaque LSA with the numerically smallest Instance ID MUST be used and
        subsequent instances of the IP Algorithm TLV MUST be ignored.</t>

        <t>The RI LSA can be advertised at any of the defined opaque flooding
        scopes (link, area, or Autonomous System (AS)). For the purpose of IP
        Algorithm TLV advertisement, area-scoped flooding is REQUIRED.</t>

        <t>The IP Algorithm TLV advertises the participation in
        Flex-Algorithms, and MUST NOT impact the router participation in
        default algorithm 0. The IP Algorithm TLV could be used to advertise
        support for non-zero standard algorithms, but that is outside the
        scope of this document.</t>

        <t>The IP Flex-Algorithm participation advertised in OSPF IP Algorithm
        TLV is topology independent. When a router advertises participation in
        OSPF IP Algorithm TLV, the participation applies to all topologies in
        which the advertising node participates.</t>
      </section>
    </section>

    <section anchor="ASSOCIATE"
             title="Advertising IP Flex-Algorthm Reachability">
      <t>To be able to associate the prefix with the Flex-Algorithm, the
      existing prefix reachability advertisements can not be used, because
      they advertise the prefix reachability in default algorithm 0. Instead,
      a new IP Flex-Algorithm reachability advertisements are defined in ISIS
      and OSPF.</t>

      <t>The M-flag in FAD is not applicable to IP Algorithm Prefixes. Any IP
      Algorithm Prefix advertisement includes the Algorithm and Metric fields.
      When IP Algorithm Prefix is advertised between areas or domains, the
      metric field in the IP Algorithm Prefix advertisement MUST be used
      irrespective of the M-flag in the FAD advertisement.</t>

      <t>Two new top-level TLVs are defined in <xref
      target="ISO10589">ISIS</xref> to advertise prefix reachability
      associated with a Flex-Algorithm.</t>

      <t><list style="symbols">
          <t>The IPv4 Algorithm Prefix Reachability TLV</t>

          <t>The IPv6 Algorithm Prefix Reachability TLV</t>
        </list></t>

      <t>New top-level TLV of OSPFv2 Extended Prefix Opaque LSA <xref
      target="RFC7684"/> is defined to advertise prefix reachability
      associated with a Flex-Algorithm in OSPFv2.</t>

      <section anchor="ISIS-IPV4_PFX_TLV"
               title="The ISIS IPv4 Algorithm Prefix Reachability TLV">
        <t>A new top level TLV is defined for advertising IPv4 Flex-Algorithm
        Prefix Reachability in ISIS - IPv4 Algorithm Prefix Reachability
        TLV.</t>

        <t>This new TLV shares the sub-TLV space defined for TLVs 135, 235,
        236 and 237.</t>

        <t>The ISIS IPv4 Algorithm Prefix Reachability TLV has the following
        format: <figure title="ISIS IPv4 Algorithm Prefix Reachability TLV">
            <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    |R|R|R|R|    MTID               |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 ]]></artwork>
          </figure> <list style="symbols">
            <t>Type: IPv4 Algorithm Prefix Reachability TLV (Value 126).</t>

            <t>Length: variable.</t>

            <t>R bits (4 bits): reserved for future use. They MUST be set to
            zero on transmission and MUST be ignored on receipt.</t>

            <t>MTID (12 bits): Multitopology Identifier as defined in
            [RFC5120]. Note that the value 0 is legal.</t>
          </list></t>

        <t>Followed by one or more prefix entries of the form: <figure
            title="ISIS IPv4 Algorithm Prefix Reachability TLV">
            <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
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |                          Metric                               |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |   Flags       |  Algorithm    |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |  Pfx Length   |  Prefix (variable)...
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |  Sub-tlv-len  |         Sub-TLVs (variable) . . .             |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 ]]></artwork>
          </figure> <list style="symbols">
            <t>Metric (4 octets): Metric information.</t>

            <t>Flags (1 octet): <figure>
                <artwork><![CDATA[ 
              0 1 2 3 4 5 6 7
             +-+-+-+-+-+-+-+-+
             |D|  Reserved   |
             +-+-+-+-+-+-+-+-+
            ]]></artwork>
              </figure> <list style="hanging">
                <t>D-flag: When the Prefix is leaked from level-2 to level-1,
                the D bit MUST be set. Otherwise, this bit MUST be clear.
                Prefixes with the D bit set MUST NOT be leaked from level-1 to
                level-2. This is to prevent looping.</t>
              </list></t>

            <t>Algorithm (1 octet): Associated Algorithm from 1 to 255.</t>

            <t>Prefix Len (1 octet): Prefix length measured in bits.</t>

            <t>Prefix (variable length): Prefix mapped to Flex-Algorithm.</t>

            <t>Optional Sub-TLV-length (1 octet): Number of octets used by
            sub-TLVs</t>

            <t>Optional sub-TLVs (variable length).</t>
          </list></t>

        <t>A router receiving multiple IPv4 Algorithm Prefix Reachability
        advertisements for the same prefix, from the same originator, each
        with a different Algorithm, MUST select the first advertisement in the
        lowest-numbered LSP and ignore any subsequent IPv4 Algorithm Prefix
        Reachability advertisements for the same prefix for any other
        Algorithm.</t>

        <t>A router receiving multiple IPv4 Algorithm Prefix Reachability
        advertisements for the same prefix, from different originators, each
        with a different Algorithm, MUST ignore all of them and MUST NOT
        install any forwarding entries based on these advertisements.</t>

        <t>In cases where a prefix advertisement is received in both a IPv4
        Prefix Reachability TLV and an IPv4 Algorithm Prefix Reachability TLV,
        the IPv4 Prefix Reachability advertisement MUST be preferred when
        installing entries in the forwarding plane.</t>
      </section>

      <section anchor="ISIS-IPV6_PFX_TLV"
               title="The ISIS IPv6 Algorithm Prefix Reachability TLV">
        <t>The ISIS IPv6 Algorithm Prefix Reachability TLV is identical to the
        ISIS IPv4 Algorithm Prefix Reachability TLV, except that it has a
        unique type. The type is 127.</t>

        <t>A router receiving multiple IPv6 Algorithm Prefix Reachability
        advertisements for the same prefix, from the same originator, each
        with a different Algorithm, MUST select the first advertisement in the
        lowest-numbered LSP and ignore any subsequent IPv6 Algorithm Prefix
        Reachability advertisements for the same prefix for any other
        Algorithm.</t>

        <t>A router receiving multiple IPv6 Algorithm Prefix Reachability
        advertisements for the same prefix, from different originators, each
        with a different Algorithm, MUST ignore all of them and MUST NOT
        install any forwarding entries based on these advertisements.</t>

        <t>In cases where a prefix advertisement is received in both a IPv6
        Prefix Reachability TLV and an IPv6 Algorithm Prefix Reachability TLV,
        the IPv6 Prefix Reachability advertisement MUST be preferred when
        installing entries in the forwarding plane.</t>
      </section>

      <section anchor="OSPF-IPV4_PFX_TLV"
               title="The OSPFv2 IP Algorithm Prefix Reachability Sub-TLV">
        <t>A new Sub-TLV of OSPFv2 Extended Prefix TLV is defined for
        advertising IP Algorithm Prefix Reachability in OSPFv2 - OSPFv2 IP
        Algorithm Prefix Reachability Sub-TLV.</t>

        <t>The OSPFv2 IP Algorithm Prefix Reachability Sub-TLV has the
        following format:</t>

        <t><figure title="OSPFv2 IP Algorithm Prefix Reachability Sub-TLV">
            <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            |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |       MT-ID   |  Algorithm    |            Reserved           |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                          Metric                               |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

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

        <t><list style="symbols">
            <t>Type (2 octets) : The value is TBD.</t>

            <t>Length (1 octet): 8</t>

            <t>MT-ID (1 octet): Multi-Topology ID as defined in <xref
            target="RFC8402"/></t>

            <t>Algorithm (1 octet): Associated Algorithm from 1 to 255.
            Algorithm values are defined in the IGP Algorithm Type registry.
            If the value of Algorithm is 0 the TLV MUST be ignored.</t>

            <t>Reserved: (2 octets). SHOULD be set to 0 on transmission and
            MUST be ignored on reception.</t>

            <t>Metric (3 octets): The algorithm specific metric value.</t>
          </list></t>

        <t>A OSPFv2 router receiving multiple OSPFv2 IP Algorithm Prefix
        Reachability Sub-TLVs in the same OSPFv2 Extended Prefix TLV, MUST
        select the first advertisement of this Sub-TLV and MUST ignore all
        remaining occurences of this Sub-TLV in the OSPFv2 Extended Prefix
        TLV.</t>

        <t>A OSPFv2 router receiving multiple OSPFv2 IP Algorithm Prefix
        Reachability TLVs for the same prefix, from different originators,
        each with a different Algorithm, MUST ignore all of them and MUST NOT
        install any forwarding entries based on these advertisements.</t>

        <t>In cases where a prefix advertisement is received in any of the
        LSAs advertising the prefix reachability for algorithm 0 (Router-LSA,
        Summary-LSA, AS-external-LSA or NSSA AS-external LSA) and in an OSPFv2
        IP Algorithm Prefix Reachability TLV, only the prefix reachability
        advertisement for algorithm 0 MUST be used and all occurences of the
        OSPFv2 IP Algorithm Prefix Reachability TLV MUST be ignored.</t>
      </section>

      <section anchor="OSPFV3_ALGTLV"
               title="The OSPFv3 IP Algorithm Prefix Reachability Sub-TLV">
        <t>The OSPFv3 IP Algorithm Prefix Reachability Sub-TLV is defined for
        advertisement of the IP Algorithm Prefix Reachability in OSPFv3.</t>

        <t>The OSPFv3 IP Algorithm Prefix Reachability Sub-TLV is a sub-TLV of
        the following OSPFv3 TLVs defined in <xref target="RFC8362"/>: <list
            style="symbols">
            <t>Intra-Area-Prefix TLV</t>

            <t>Inter-Area-Prefix TLV</t>

            <t>External-Prefix TLV</t>
          </list></t>

        <t>The format of OSPFv3 IP Algorithm Prefix Reachability Sub-TLV is
        shown below:</t>

        <t><figure anchor="ALGTLVFMT" title="OSPFv3 Algorithm Prefix Sub-TLV">
            <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    |                 Metric                        |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

]]></artwork>
          </figure>Where:<list>
            <t>Type (2 octets): The value is TBD.</t>

            <t>Length (2 octets): 4.</t>

            <t>Algorithm (1 octet): Associated Algorithm from 1 to 255.
            Algorithm values are defined in the IGP Algorithm Type registry.
            If the value of Algorithm is 0 the TLV MUST be ignored.</t>

            <t>Metric (3 octets): The algorithm specific metric value.</t>
          </list></t>

        <t>When the OSPFv3 IP Algorithm Prefix Reachability Sub-TLV is
        present, the metric value in its parent TLV MUST be set to LSInfinity
        (<xref target="RFC2328"/>). If the metric value in the parent TLV is
        not set to LSInfinity, the OSPFv3 IP Algorithm Prefix Sub-TLV MUST be
        ignored by the receiver.</t>

        <t>A OSPFv3 router receiving multiple OSPFv3 IP Algorithm Prefix
        Reachability Sub-TLVs in the same parent TLV, MUST select the first
        advertisement of this Sub-TLV and MUST ignore all remaining occurences
        of this Sub-TLV in the parent TLV.</t>

        <t>A OSPFv3 router receiving multiple OSPFv3 IP Algorithm Prefix
        Reachability TLVs for the same prefix, from different originators,
        each with a different Algorithm, MUST ignore all of them and MUST NOT
        install any forwarding entries based on these advertisements.</t>

        <t>In cases where a prefix advertisement is received in any of the
        TLVs advertising the prefix reachability for algorithm 0
        (Intra-Area-Prefix TLV, Inter-Area-Prefix TLV, or External-Prefix TLV)
        with metric other then LSInfinity, all OSPFv3 IP Algorithm Prefix TLVs
        received for the prefix MUST be ignored.</t>
      </section>

      <section anchor="IPFAAL"
               title="The OSPF IP Flexible Algorithm ASBR Metric Sub-TLV">
        <t>Section 10.2 of the <xref target="I-D.ietf-lsr-flex-algo"/> defines
        the OSPF Flexible Algorithm ASBR Metric Sub-TLV (FAAM) that is used by
        OSPFv2 and OSPFv3 to advertise Flex-Algorithm specific metric
        associated with a given ASBR reachability advertisement by an ABR.</t>

        <t>As described in section 11 of <xref
        target="I-D.ietf-lsr-flex-algo"/> each application signals the
        participation independently. IP Flex-Algorithm participation is
        signalled independently of the Segment Routing (SR) Flex-Algorithm
        participation. As a result, the calculated topologies for SR and IP
        Flex-Algorithm could be different. Such difference prevents the usage
        of FAAM for the purpose of the IP Flex-Algorithm.</t>

        <t>The OSPF IP Flexible Algorithm ASBR Metric (IPFAAM) Sub-TLV is
        defined for the advertisement of the IP Flex-Algorithm specific metric
        associated with an ASBR by the ABR.</t>

        <t>The IPFAAM Sub-TLV is a Sub-TLV of the: <list style="hanging">
            <t>- OSPFv2 Extended Inter-Area ASBR TLV as defined in <xref
            target="I-D.ietf-lsr-flex-algo"/></t>

            <t>- OSPFv3 Inter-Area-Router TLV defined in <xref
            target="RFC8362"/></t>
          </list></t>

        <t>OSPF IPFAAM Sub-TLV has the following format: <figure>
            <artwork><![CDATA[ 
 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|              Type             |             Length            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|   Algorithm   |                   Reserved                    |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                            Metric                             |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

where:
    ]]></artwork>
          </figure> <list style="hanging">
            <t>Type (2 octets): TBD for OSPFv2, TBD for OSPFv3.</t>

            <t>Length (2 octets): 8.</t>

            <t>Algorithm (1 octet): Associated Algorithm from 1 to 255.
            Algorithm values are defined in the IGP Algorithm Type registry.
            If the value of Algorithm is 0 the TLV MUST be ignored.</t>

            <t>Reserved: (3 octets). SHOULD be set to 0 on transmission and
            MUST be ignored on reception.</t>

            <t>Metric (4 octets): The algorithm specific metric value.</t>
          </list></t>

        <t>The usage of the IPFAAM Sub-TLV is similar to the usage of the FAAM
        Sub-TLV defined in <xref target="I-D.ietf-lsr-flex-algo"/>, but it is
        used to advertise IP Flex-Algorithm metric.</t>

        <t>An OSPF ABR MUST include the OSPF IPFAAM Sub-TLVs as part of the
        ASBR reachability advertisement between areas for every IP
        Flex-Algorithm in which it participates and the ASBR is reachable
        in.</t>

        <t>FAAM Sub-TLV as defined in <xref target="I-D.ietf-lsr-flex-algo"/>
        MUST NOT be used during IP Flex-Algorithm path calculation, IPFAAM
        Sub-TLV MUST be used instead.</t>
      </section>
    </section>

    <section title="Calculating of IP Flex-Algorthm Paths">
      <t>IP Flex-Algorthm is considered as yet another application of the
      Flex-Algorithm as described in Section 10 and Section 12 of the <xref
      target="I-D.ietf-lsr-flex-algo"/>.</t>

      <t>Participation for the IP Flex-Algorithm is signalled as described in
      <xref target="PARTICIPATION"/> and is specific to the IP Flex-Algorithm
      application.</t>

      <t>Calculation of IP Flex-Algorithm paths follows the Section 12 of
      <xref target="I-D.ietf-lsr-flex-algo"/>. This computation uses the IP
      Flex-Algorithm participation and is independent of the Flex-Algorithm
      calculation done for any other Flex-Algorithm applications (e.g. SR,
      SRv6).</t>

      <t>IP Flex-Algorithm application only considers participating nodes
      during the Flex-Algorithm calculation. When computing paths for a given
      Flex-Algorithm, all nodes that do not advertise participation for IP
      Flex-Algorithm, as described in <xref target="PARTICIPATION"/>, MUST be
      pruned from the topology.</t>
    </section>

    <section title="IP Flex-Algorthm Forwarding">
      <t>IP Algorithm Prefix Reachability advertisement as described in <xref
      target="PARTICIPATION"/> includes the MTID value that associates the
      prefix with a specific topology. Algorithm Prefix Reachability
      advertisement also includes an Algorithm value that explicitly
      associates the prefix with a specific Flex-Algorithm. The paths to the
      prefix MUST be calculated using the specified Flex-Algorithm in the
      associated topology.</t>

      <t>Forwarding entries for the IP Flex-Algorithm prefixes advertised in
      IGPs MUST be installed in the forwarding plane of the receiving IP
      Flex-Algorithm prefix capable routers when they participate in the
      associated topology and algorithm. Forwarding entries for IP
      Flex-Algorithm prefixes associated with Flex-Algorithms in which the
      node is not participating MUST NOT be installed in the forwarding
      plane.</t>

      <t>When the IP Flex-Algorithm prefix is associated with a
      Flex-Algorithm, LFA paths to the prefix MUST be calculated using such
      Flex-Algorithm in the associated topology, to guarantee that they follow
      the same constraints as the calculation of the primary paths.</t>
    </section>

    <section title="Deployment Considerations">
      <t>IGP Flex-Algorithm can be used by many applications. Original
      specification was done for SR and SRv6, this specification adds IP as
      another application that can use IGP Flex-Algorithm. Other applications
      may be defined in the future. This section provides some details about
      the coexistence of the various applications of the IGP
      Flex-Algorithm.</t>

      <t>Flex-Algorithm definition (FAD), as described in <xref
      target="I-D.ietf-lsr-flex-algo"/>, is application independent and is
      used by all Flex-Algorithm applications.</t>

      <t>Participation in the Flex-Algorithm, as described in <xref
      target="I-D.ietf-lsr-flex-algo"/>, is application specific.</t>

      <t>Calculation of the flex-algo paths is application specific and uses
      application specific participation advertisements.</t>

      <t>Application specific participation and calculation guarantee that the
      forwarding of the traffic over the Flex-Algorithm application specific
      paths is consistent between all nodes over which the traffic is being
      forwarded.</t>

      <t>Multiple application can use the same Flex-Algorithm value at the
      same time and and as such share the FAD for it. For example SR-MPLS and
      IP can both use such common Flex-Algorithm. Traffic for SR-MPLS will be
      forwarded based on Flex-algorithm specific SR SIDs. Traffic for IP
      Flex-Algorithm will be forwarded based on Flex-Algorithm specific prefix
      reachability announcements.</t>
    </section>

    <section title="Protection">
      <t>In many networks where IGP Flexible Algorithms are deployed, IGP
      restoration will be fast and additional protection mechanisms will not
      be required. IGP restoration may be enhanced by Equal Cost Multipath
      (ECMP).</t>

      <t>In other networks, operators can deploy additional protection
      mechanisms. The following are examples:</t>

      <t><list style="symbols">
          <t><xref target="RFC5286">Loop Free Alternates (LFA)</xref></t>

          <t><xref target="RFC7490">Remote Loop Free Alternates (R-LFA)
          </xref></t>
        </list>LFA and R-LFA computations MUST be restricted to the flex-algo
      topology and the computed backup nexthops should be programmed for the
      IP flex-algo prefixes.</t>
    </section>

    <section anchor="IANA" title="IANA Considerations">
      <t>This specification updates the OSPF Router Information (RI) TLVs
      Registry as follows:</t>

      <t/>

      <texttable>
        <ttcol>Value</ttcol>

        <ttcol>TLV Name</ttcol>

        <ttcol>Reference</ttcol>

        <c>TBD</c>

        <c>IP Algorithm TLV</c>

        <c>This Document <xref target="OSPF-ALG_TLV"/></c>
      </texttable>

      <t>This document also updates the "Sub-TLVs for TLV 242" registry as
      follows:</t>

      <t/>

      <texttable>
        <ttcol>Value</ttcol>

        <ttcol>TLV Name</ttcol>

        <ttcol>Reference</ttcol>

        <c>29</c>

        <c>IP Algorithm Sub-TLV</c>

        <c>This Document <xref target="ISIS-ALG_TLV"/></c>
      </texttable>

      <t>This document also updates the "ISIS TLV Codepoints Registry"
      registry as follows:</t>

      <t/>

      <texttable>
        <ttcol>Value</ttcol>

        <ttcol>TLV Name</ttcol>

        <ttcol>IIH</ttcol>

        <ttcol>LSP</ttcol>

        <ttcol>SNP</ttcol>

        <ttcol>Purge</ttcol>

        <ttcol>Reference</ttcol>

        <c>126</c>

        <c>IPv4 Algorithm Prefix Reachability TLV</c>

        <c>N</c>

        <c>Y</c>

        <c>N</c>

        <c>N</c>

        <c>This document, <xref target="ISIS-IPV4_PFX_TLV"/></c>

        <c>127</c>

        <c>IPv6 Algorithm Prefix Reachability TLV</c>

        <c>N</c>

        <c>Y</c>

        <c>N</c>

        <c>N</c>

        <c>This document, <xref target="ISIS-IPV6_PFX_TLV"/></c>
      </texttable>

      <t>This document updates the "OSPFv2 Extended Prefix TLV Sub-TLVs"
      registry as follows:</t>

      <t/>

      <texttable>
        <ttcol>Value</ttcol>

        <ttcol>TLV Name</ttcol>

        <ttcol>Reference</ttcol>

        <c>TBD</c>

        <c>OSPFv2 IP Algorithm Prefix Reachability TLV</c>

        <c>This Document, <xref target="OSPF-IPV4_PFX_TLV"/></c>
      </texttable>

      <t>This document updates the "OSPFv3 Extended-LSA Sub-TLVs" registry as
      follows:</t>

      <t/>

      <texttable>
        <ttcol>Value</ttcol>

        <ttcol>TLV Name</ttcol>

        <ttcol>Reference</ttcol>

        <c>TBD</c>

        <c>OSPFv3 IP Algorithm Prefix Reachability Sub-TLV</c>

        <c>This Document, <xref target="OSPFV3_ALGTLV"/></c>

        <c>TBD</c>

        <c>OSPFv3 IP Flexible Algorithm ASBR Metric Sub-TLV</c>

        <c>This Document, <xref target="IPFAAL"/></c>
      </texttable>

      <t>This document updates the "OSPFv2 Extended Inter-Area ASBR Sub-TLVs"
      registry as follows:</t>

      <t/>

      <texttable>
        <ttcol>Value</ttcol>

        <ttcol>TLV Name</ttcol>

        <ttcol>Reference</ttcol>

        <c>2</c>

        <c>OSPF IP Flexible Algorithm ASBR Metric Sub-TLV</c>

        <c>This Document, <xref target="IPFAAL"/></c>
      </texttable>
    </section>

    <section anchor="Security" title="Security Considerations">
      <t>This document inherits security considerations from <xref
      target="I-D.ietf-lsr-flex-algo"/>.</t>
    </section>

    <section anchor="Acknowledgements" title="Acknowledgements">
      <t>Thanks to Bruno Decraene for his contributions to this document.
      Special thanks to Petr Bonbon Adamec of Cesnet for supporting
      interoperability testing.</t>
    </section>
  </middle>

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      <reference anchor="ISO10589" target="ISO/IEC 10589:2002">
        <front>
          <title>Intermediate system to Intermediate system routing
          information exchange protocol for use in conjunction with the
          Protocol for providing the Connectionless-mode Network Service (ISO
          8473)</title>

          <author fullname="ISO" initials="" surname="">
            <organization>IANA</organization>
          </author>

          <date month="August" year="1987"/>
        </front>
      </reference>
    </references>

    <references title="Informative References">
      <reference anchor="IANA-ALG"
                 target="https://www.iana.org/assignments/igp-parameters/igp-parameters.xhtml#igp-algorithm-types">
        <front>
          <title>Sub-TLVs for TLV 242 (IS-IS Router CAPABILITY TLV)</title>

          <author fullname="" initials="" surname="">
            <organization>IANA</organization>
          </author>

          <date month="August" year="1987"/>
        </front>
      </reference>

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

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

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

      <?rfc include='reference.RFC.8986'?>
    </references>
  </back>
</rfc>
