<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE rfc [
  <!ENTITY nbsp    "&#160;">
  <!ENTITY zwsp   "&#8203;">
  <!ENTITY nbhy   "&#8209;">
  <!ENTITY wj     "&#8288;">
]>
<?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>
<?rfc strict="no" ?>
<?rfc toc="yes" ?>
<?rfc symrefs="yes" ?>
<?rfc sortrefs="yes"?>
<?rfc rfcedstyle="yes" ?>
<?rfc subcompact="no" ?>
<rfc xmlns:xi="http://www.w3.org/2001/XInclude" category="std" docName="draft-ietf-lsr-ospf-flex-algo-yang-06" ipr="trust200902" obsoletes="" updates="" submissionType="IETF" xml:lang="en" tocInclude="true" symRefs="true" sortRefs="true" version="3" consensus="true">
  <!-- xml2rfc v2v3 conversion 3.12.10 -->
  <!-- category values: std, bcp, info, exp, and historic
     ipr values: full3667, noModification3667, noDerivatives3667
     you can add the attributes updates="NNNN" and obsoletes="NNNN"
     they will automatically be output with "(if approved)" -->

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

  <front>
    <!-- The abbreviated title is used in the page header - it is only necessary if the
         full title is longer than 39 characters -->

  <title abbrev="OSPF ASLA and Flex-Algo YANG">YANG Data Model for OSPF Application-Specific Link Attributes and Flexible Algorithm </title>
    <seriesInfo name="Internet-Draft" value="draft-ietf-lsr-ospf-flex-algo-yang-06"/>
    <!-- add 'role="editor"' below for the editors if appropriate -->

    <!-- Another author who claims to be an editor -->
    <author fullname="Yingzhen Qu" initials="Y" surname="Qu">
      <organization>Futurewei Technologies</organization>
      <address>
        <postal>
          <country>USA</country>
        </postal>
        <phone/>
        <email>yingzhen.ietf@gmail.com</email>
      </address>
    </author>
    <author fullname="Acee Lindem" initials="A." surname="Lindem">
      <organization>Arrcus, Inc.</organization>
      <address>
        <postal>
          <country>USA</country>
        </postal>
        <email>acee.ietf@gmail.com</email>
      </address>
    </author>
    <date/>
    <!-- If the month and year are both specified and are the current ones, xml2rfc will fill
         in the current day for you. If only the current year is specified, xml2rfc will fill
   in the current day and month for you. If the year is not the current one, it is
   necessary to specify at least a month (xml2rfc assumes day="1" if not specified for the
   purpose of calculating the expiry date).  With drafts it is normally sufficient to
   specify just the year. -->

    <!-- Meta-data Declarations -->

    <area>General</area>
    <workgroup>Internet</workgroup>
    <!-- WG name at the upperleft corner of the doc,
         IETF is fine for individual submissions.
   If this element is not present, the default is "Network Working Group",
         which is used by the RFC Editor as a nod to the history of the IETF. -->

    <!-- Keywords will be incorporated into HTML output
         files in a meta tag but they have no effect on text or nroff
         output. If you submit your draft to the RFC Editor, the
         keywords will be used for the search engine. -->

    <abstract>
      <t>This document defines a YANG data model to support OSPF Application-Specific
        Link Attributes and Flexible Algorithm.
        It also specifies the initial version of IANA-maintained YANG modules for IGP
        Algorithm Types and IGP Metric-Type. </t>
    </abstract>
  </front>
  <middle>
    <section numbered="true" toc="default">
      <name>Overview</name>
      <t>This document defines YANG <xref target="RFC7950" format="default"/> data modules augmenting the IETF OSPF
      YANG model <xref target="RFC9129" format="default"/>, which itself augments the IETF Routing model
      <xref target="RFC8349" format="default"/>, to provide support for both
      OSPF Flexible Algorithm as defined in <xref target="RFC9350" format="default"/> and
      OSPF Application-Specific Link Attributes as defined in <xref target="RFC9492"/>.
      </t>
      <t>
        Four YANG modules are defined in this document. The first is the initial version of the IANA-maintained YANG module for IGP
        Algorithm Types. The second module is the initial version of the IANA-maintained YANG
        module for IGP Metric-Type. The third module is to support OSPF Application-Specific Link Attributes,
        and the fourth module augments the IETF OSPF YANG data model to support OSPF Flex Algorithm.
      </t>
      <section 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", and
          "OPTIONAL" in this document are to be interpreted as described in
          BCP 14 <xref target="RFC2119"/> <xref target="RFC8174"/> when, and only when, they appear in all
          capitals, as shown here.</t>
      </section>
    </section>

    <section anchor="iana-algo-types" numbered="true" toc="default">
      <name>IANA IGP Algorithm Types Module</name>
      <t>IANA has created a registry titled "IGP Algorithm Types" under the
        "Interior Gateway Protocol (IGP) Parameters" registry group to
        identify Algorithm Types.  Module iana-igp-algo-types is an IANA-maintained
        module, which defines the identities for the Algorithm Types as in the IANA
        "IGP Algorithm Types" registry.</t>
      <t>
        This module is maintained by IANA and will be updated if and when
        there is any change to the registry.</t>
      <t>
        This document defines the initial version of the IANA-maintained YANG
        module for Algorithm Types that mirrors the IANA "IGP Algorithm Types" registry
        <xref target="IANA-IGP-ALGO-Types" format="default" sectionFormat="of" derivedContent="IANA-IGP-ALGO-Types"/>.
      </t>
      <t>
        This YANG module references <xref target="RFC8665"/>.
      </t>
<sourcecode name="iana-igp-algo-types@2026-03-30.yang" type="yang" markers="true">
module iana-igp-algo-types {
  yang-version 1.1;
  namespace "urn:ietf:params:xml:ns:yang:iana-igp-algo-types";
  prefix iana-algo-types;

  organization
    "Internet Assigned Numbers Authority (IANA)";
  contact
    "Internet Assigned Numbers Authority

     ICANN
     12025 Waterfront Drive, Suite 300
     Los Angeles, CA 90094-2536
     United States of America

     Tel:    +1 310 301 5800
      &lt;mailto:iana@iana.org&gt;";
  description
    "The YANG module defines the identities for Interior Gateway
     Protocol (IGP) Algorithm Types.

     This YANG module is maintained by IANA and reflects the 'IGP
     Algorithm Types' registry.

     Copyright (c) 2026 IETF Trust and the persons identified as
     authors of the code.  All rights reserved.

     Redistribution and use in source and binary forms, with or
     without modification, is permitted pursuant to, and subject to
     the license terms contained in, the Revised BSD License set
     forth in Section 4.c of the IETF Trust's Legal Provisions
     Relating to IETF Documents
     (https://trustee.ietf.org/license-info).

     All revisions of IETF and IANA published modules can be found
     at the YANG Parameters registry group
     (https://www.iana.org/assignments/yang-parameters).

     This initial version of this YANG module is part of RFC XXXX
     (https://www.rfc-editor.org/info/rfcXXXX); see the RFC itself
     for full legal notices.

     //RFC Ed.: replace XXXX with actual RFC number and remove
       this note

     The latest version of this YANG module is available at
     https://www.iana.org/assignments/yang-parameters.";

  revision 2026-03-30 {
    description
      "Initial Version";
    reference
      "RFC XXXX: YANG Data Model for OSPF Application-Specific
                 Link Attributes and Flexible Algorithm";
  }

  identity algo-type {
    description
      "Base identity for IGP Algorithm Type. The algorithm types
       are defined in IANA IGP Algorithm Types registry.";
  }

  identity algo-spf {
    base algo-type;
    description
      "Shortest Path First (SPF) algorithm based on link metric.";
    reference
      "RFC 8665: OSPF Extensions for Segment Routing";
  }

  identity algo-strict-spf {
    base algo-type;
    description
      "Strict Shortest Path First (SPF) algorithm based on link
       metric.";
    reference
      "RFC 8665: OSPF Extensions for Segment Routing";
  }
}
</sourcecode>
    </section>

    <section anchor="iana-metric-types" numbered="true" toc="default">
      <name>IANA IGP Metric Types Module</name>
      <t>IANA has created a registry titled "IGP Metric-Type" under the
        "Interior Gateway Protocol (IGP) Parameters" registry group to
        identify Metric Types.  Module iana-igp-metric-types is an IANA-maintained
        module, which defines the identities for the Metric Types as in the IANA
        "IGP Metric-Type" registry.</t>
      <t>
        This module is maintained by IANA and will be updated if and when
        there is any change to the registry.</t>
      <t>
        This document defines the initial version of the IANA-maintained YANG
        module for Algorithm Types that mirrors the IANA "IGP Metric-Type" registry
        <xref target="IANA-IGP-Metric-Types" format="default" sectionFormat="of" derivedContent="IANA-IGP-Metric-Types"/>.
      </t>
      <t>
        This YANG module references <xref target="RFC3630"/>, <xref target="RFC5305"/>,
        <xref target="RFC7471"/>, <xref target="RFC8570"/>, <xref target="RFC9350"/>, and
        <xref target="RFC9843"/>.
      </t>
<sourcecode name="iana-igp-metric-types@2026-03-30.yang" type="yang" markers="true">
module iana-igp-metric-types {
  yang-version 1.1;
  namespace "urn:ietf:params:xml:ns:yang:iana-igp-metric-types";
  prefix iana-metric-types;

  organization
    "Internet Assigned Numbers Authority (IANA)";
  contact
    "Internet Assigned Numbers Authority

     ICANN
     12025 Waterfront Drive, Suite 300
     Los Angeles, CA 90094-2536
     United States of America

     Tel:    +1 310 301 5800
      &lt;mailto:iana@iana.org&gt;";
  description
    "The YANG module defines the identities for Interior Gateway
     Protocol (IGP) Metric-Types.

     This YANG module is maintained by IANA and reflects the 'IGP
     Metric-Type' registry.

     Copyright (c) 2026 IETF Trust and the persons identified as
     authors of the code.  All rights reserved.

     Redistribution and use in source and binary forms, with or
     without modification, is permitted pursuant to, and subject to
     the license terms contained in, the Revised BSD License set
     forth in Section 4.c of the IETF Trust's Legal Provisions
     Relating to IETF Documents
     (https://trustee.ietf.org/license-info).

     All revisions of IETF and IANA published modules can be found
     at the YANG Parameters registry group
     (https://www.iana.org/assignments/yang-parameters).

     This initial version of this YANG module is part of RFC XXXX
     (https://www.rfc-editor.org/info/rfcXXXX); see the RFC itself
     for full legal notices.

     //RFC Ed.: replace XXXX with actual RFC number and remove
       this note

     The latest version of this YANG module is available at
     https://www.iana.org/assignments/yang-parameters.";

  revision 2026-03-30 {
    description
      "Initial Version";
    reference
      "RFC XXXX: YANG Data Model for OSPF Application-Specific
                 Link Attributes and Flexible Algorithm";
  }

  identity metric-type {
    description
      "Base identity for IGP Metric-Type. The metric types
       are defined in IANA IGP Metric-Type registry.";
  }

  identity igp-metric {
    base metric-type;
    description
      "IGP Metric.";
    reference
      "RFC9350: IGP Flexible Algorithm";
  }

  identity min-unidirectional-link-delay {
    base metric-type;
    description
      "Min Unidirectional Link Delay as defined in RFC 8570
       and Section 4.2 and RFC 7471 Section 4.2.";
    reference
      "RFC 7471: OSPF Traffic Engineering (TE) Metric Extensions
       RFC 8570: IS-IS Traffic Engineering (TE) Metric Extensions
       RFC 9350: IGP Flexible Algorithm";
  }

  identity te-default-metric {
    base metric-type;
    description
      "Traffic Engineering Default Metric as defined in RFC 5305
       Section 3.7 and Traffic Engineering Metric as defined in
       RFC3630, Section 2.5.5.";
    reference
      "RFC 3630: OSPF Traffic Engineering
       RFC 5305: IS-IS Traffic Engineering
       RFC 9350: IGP Flexible Algorithm";
  }

  identity bandwidth-metric {
    base metric-type;
    description
      "Bandwidth metric.";
    reference
      "RFC 9843: IGP Flexible Algorithms: Bandwidth, Delay,
                 Metrics, and Constraints";

  }
}
</sourcecode>
    </section>

    <section numbered="true" toc="default">
      <name>YANG Module for OSPF Application-Specific Link Attributes</name>
      <t>This document defined a YANG module for OSPF Application-Specific Link Attributes (ASLA)
        as defined in <xref target="RFC9492"/>.</t>

      <t>The module augments OSPF router configuration with support for
        the ASLA operation mode, enabling interoperability during the
        transition from legacy advertisements to ASLA. In addition,
        both OSPFv2 and OSPFv3 LSAs are augmented to
        include the TLVs defined in<xref target="RFC9492"/>.
      </t>
      <t>
        This YANG module references <xref target="RFC8349"/>, <xref target="RFC9129"/>,
        <xref target="RFC9350"/>, <xref target="RFC9492"/>, and <xref target="RFC9587"/> .
      </t>

      <artwork align="left" name="" type="" alt=""><![CDATA[
module: ietf-ospf-link-attr
  augment /rt:routing/rt:control-plane-protocols
            /rt:control-plane-protocol/ospf:ospf:
    +--rw ospf-link-attr
       +--rw (link-attr-op-mode)
          +--:(legacy)
          |  +--rw legacy?         empty
          +--:(transition)
          |  +--rw transition?     empty
          +--:(app-specific)
             +--rw app-specific?   empty
  augment /rt:routing/rt:control-plane-protocols
            /rt:control-plane-protocol/ospf:ospf/ospf:areas/ospf:area
            /ospf:database/ospf:area-scope-lsa-type
            /ospf:area-scope-lsas/ospf:area-scope-lsa/ospf:version
            /ospf:ospfv2/ospf:ospfv2/ospf:body/ospf:opaque
            /ospf:extended-link-opaque/ospf:extended-link-tlv:
    +--ro app-specific-link-attr-sub-tlvs
       +--ro asla-sub-tlvs* []
          +--ro sabm-length?                    uint8
          +--ro udabm-length?                   uint8
          +--ro sabm
          |  +--ro sabm-bits*   identityref
          +--ro udabm
          +--ro link-attributes-sub-sub-tlvs
             +--ro unknown-tlvs
                +--ro unknown-tlv* []
                   +--ro type?     uint16
                   +--ro length?   uint16
                   +--ro value?    yang:hex-string
  augment /rt:routing/rt:control-plane-protocols
            /rt:control-plane-protocol/ospf:ospf/ospf:areas/ospf:area
            /ospf:database/ospf:area-scope-lsa-type
            /ospf:area-scope-lsas/ospf:area-scope-lsa/ospf:version
            /ospf:ospfv3/ospf:ospfv3/ospf:body/ospfv3-e-lsa:e-router
            /ospfv3-e-lsa:e-router-tlvs/ospfv3-e-lsa:link-tlv:
    +--ro app-specific-link-attr-sub-tlvs
       +--ro asla-sub-tlvs* []
          +--ro sabm-length?                    uint8
          +--ro udabm-length?                   uint8
          +--ro sabm
          |  +--ro sabm-bits*   identityref
          +--ro udabm
          +--ro link-attributes-sub-sub-tlvs
             +--ro unknown-tlvs
                +--ro unknown-tlv* []
                   +--ro type?     uint16
                   +--ro length?   uint16
                   +--ro value?    yang:hex-string

      ]]></artwork>
      <sourcecode name="ietf-ospf-link-attr@2026-03-30.yang" type="" markers="true"><![CDATA[
module ietf-ospf-link-attr {
  yang-version 1.1;
  namespace "urn:ietf:params:xml:ns:yang:ietf-ospf-link-attr";
  prefix ospf-link-attr;

  import ietf-routing {
    prefix rt;
    reference
      "RFC 8349: A YANG Data Model for Routing
                 Management (NMDA Version)";
  }
  import ietf-ospf {
    prefix ospf;
    reference
      "RFC 9129: YANG Data Model for the OSPF Protocol";
  }
  import ietf-ospfv3-extended-lsa {
    prefix ospfv3-e-lsa;
    reference
      "RFC 9587: YANG Data Model for OSPFv3 Extended Link
                 State Advertisements (LSAs)";
  }

  organization
    "IETF LSR - Link State Routing Working Group";
  contact
    "WG Web:   <https://datatracker.ietf.org/wg/lsr/>
     WG List:  <mailto:lsr@ietf.org>

     Author:   Yingzhen Qu
               <mailto:yingzhen.ietf@gmail.com>
     Author:   Acee Lindem
               <mailto:acee.ietf@gmail.com>
    ";
  description
    "This YANG module defines the configuration and operational
     state for OSPF application specific link attributes feature
     as defined in RFC 9492.

     This YANG model conforms to the Network Management
     Datastore Architecture (NMDA) as described in RFC 8342.

     Copyright (c) 2026 IETF Trust and the persons identified as
     authors of the code.  All rights reserved.

     Redistribution and use in source and binary forms, with or
     without modification, is permitted pursuant to, and subject to
     the license terms contained in, the Revised BSD License set
     forth in Section 4.c of the IETF Trust's Legal Provisions
     Relating to IETF Documents
     (https://trustee.ietf.org/license-info).

     This version of this YANG module is part of RFC XXXX;
     see the RFC itself for full legal notices.";

  revision 2026-03-30 {
    description
      "Initial version";
    reference
      "RFC XXXX: YANG Data Model for OSPF Application-Specific
                 Link Attributes and Flexible Algorithm";
  }

  identity sabm-bit {
    description
      "Base identity for SABM bits.";
    reference
      "RFC 9492: OSPF Application-Specific Link Attributes";
  }

  identity rsvp-te-bit {
    base sabm-bit;
    description
      "R bit, RSVP-TE.";
    reference
      "RFC 9492: OSPF Application-Specific Link Attributes";
  }

  identity sr-policy-bit {
    base sabm-bit;
    description
      "S bit, Segment Routing Policy.";
    reference
      "RFC 9492: OSPF Application-Specific Link Attributes";
  }

  identity lfa-bit {
    base sabm-bit;
    description
      "F bit, Loop Free Alternate (LFA). Includes all LFA types.";
    reference
      "RFC 9492: OSPF Application-Specific Link Attributes";
  }

  identity flex-algo-bit {
    base sabm-bit;
    description
      "X bit, flexible algorithm.";
    reference
      "RFC 9350: IGP Flexible Algorithm, Section 12.";
  }

  grouping app-specific-link-attr-sub-tlvs {
    description
      "OSPF Application-Specific Link Attributes (ASLA) sub-TLV.
       The ASLA sub-TLV is a sub-TLV of the OSPFv2 Extended Link
       TLV (RFC7684) and OSPFv3 Router-Link TLV (RFC8362).";
    container app-specific-link-attr-sub-tlvs {
      description
        "Application-Specific Link Attributes sub-TLV.";
      list asla-sub-tlvs {
        leaf sabm-length {
          type uint8;
          description
            "Standard Application Identifier Bit Mask Length in
             octets.";
        }
        leaf udabm-length {
          type uint8;
          description
            "User Defined Application Identifier Bit Mask Length
             in octets.";
        }
        container sabm {
          leaf-list sabm-bits {
            type identityref {
              base sabm-bit;
            }
            description
              "SABM bits list. This list will contain
               identities for the bits which are set in the
               SABA bits.";
          }
          description
            "Standard Application Identifier Bit Mask.";
        }
        container udabm {
          description
            "User Defined Application Identifier Bit Mask.
             This container is to be augmented by user defined
             applications.";
        }
        container link-attributes-sub-sub-tlvs {
          uses ospf:unknown-tlvs;
          description
            "Link Attributes sub-sub-TLVs.";
        }
        description
          "List of application-Specific Link Attributes sub-TLVs.";
      }
    }
    reference
      "RFC 9492: OSPF Application-Specific Link Attributes";
  }

  /* Configuration */

  augment "/rt:routing/rt:control-plane-protocols"
        + "/rt:control-plane-protocol/ospf:ospf" {
    when "../rt:type = 'ospf:ospfv2' or "
       + "../rt:type = 'ospf:ospfv3'" {
      description
        "This augments the OSPF routing protocol when used.";
    }
    description
      "This augments OSPF protocol configuration
       with application-specific link attributes.";
    container ospf-link-attr {
      choice link-attr-op-mode {
        mandatory true;
        leaf legacy {
          type empty;
          description
            "Only send legacy advertisements.";
        }
        leaf transition {
          type empty;
          description
            "Send both application-specific and legacy
             advertisements.";
        }
        leaf app-specific {
          type empty;
          description
            "Only send application-specific advertisements.";
        }
        description
          "Link attributes mode";
      }
      description
        "Link attributes operation mode.";
    }
  }

  /* Database */

  augment "/rt:routing/"
        + "rt:control-plane-protocols/rt:control-plane-protocol/"
        + "ospf:ospf/ospf:areas/"
        + "ospf:area/ospf:database/"
        + "ospf:area-scope-lsa-type/ospf:area-scope-lsas/"
        + "ospf:area-scope-lsa/ospf:version/ospf:ospfv2/"
        + "ospf:ospfv2/ospf:body/ospf:opaque/"
        + "ospf:extended-link-opaque/ospf:extended-link-tlv" {
    when "derived-from(/rt:routing/rt:control-plane-protocols/"
       + "rt:control-plane-protocol/rt:type, 'ospf:ospfv2')" {
      description
        "This augmentation is only valid for OSPFv2.";
    }
    description
      "OSPF Application-Specific Link Attributes (ASLA) sub-TLV is
       a sub-TLV of OSPFv2 Extended Link TLV (RFC7684).";
    uses app-specific-link-attr-sub-tlvs;
  }

  augment "/rt:routing/"
        + "rt:control-plane-protocols/rt:control-plane-protocol/"
        + "ospf:ospf/ospf:areas/ospf:area/ospf:database/"
        + "ospf:area-scope-lsa-type/ospf:area-scope-lsas/"
        + "ospf:area-scope-lsa/ospf:version/ospf:ospfv3/"
        + "ospf:ospfv3/ospf:body/ospfv3-e-lsa:e-router/"
        + "ospfv3-e-lsa:e-router-tlvs/ospfv3-e-lsa:link-tlv" {
    when "derived-from(/rt:routing/rt:control-plane-protocols/"
       + "rt:control-plane-protocol/rt:type, 'ospf:ospfv3')" {
      description
        "This augmentation is only valid for OSPFv3
         E-Router LSAs";
    }
    description
      "Augment OSPFv3 Area scope router-link TLV.";
    uses app-specific-link-attr-sub-tlvs;
  }
}
        ]]></sourcecode>
    </section>


    <section numbered="true" toc="default">
      <name>YANG Module for OSPF Flexible Algorithm</name>
      <t>This document defines a YANG module for OSPF Flexible
      Algorithm as defined in <xref target="RFC9350" format="default"/>. It is an augmentation of the OSPF
      base model. </t>

      <t>The module augments OSPF router configuration with support flexible algorithms. In addition,
        both the OSPFv2 and OSPFv3 link-state databases are augmented to
        include the TLVs defined in<xref target="RFC9350"/>.
      </t>
      <t>
        This YANG module references <xref target="RFC8349"/>, <xref target="RFC9129"/>,
        <xref target="RFC9350"/>, <xref target="RFC9587"/>, and <xref target="I-D.ietf-yang-te"/>.
      </t>
      <artwork align="left" name="" type="" alt=""><![CDATA[
module: ietf-ospf-flex-algo
  augment /rt:routing/rt:control-plane-protocols
            /rt:control-plane-protocol/ospf:ospf:
    +--rw ospf-flex-algo
       +--rw flex-algo* [algo-number]
          +--rw algo-number             uint8
          +--rw advertise-definition?   boolean
          +--rw admin-groups
          |       {te-types:extended-admin-groups,
          |        te-types:named-extended-admin-groups}?
          |  +--rw exclude-admin-groups*       leafref
          |  +--rw include-any-admin-groups*   leafref
          |  +--rw include-all-admin-groups*   leafref
          +--rw exclude-srlgs*
          |       -> /te:te/globals/named-srlgs/named-srlg/name
          |       {te-types:named-srlg-groups}?
          +--rw calc-type?              identityref
          +--rw metric-type?            identityref
          +--rw prefix-metric!
          +--rw priority?               uint8
  augment /rt:routing/rt:control-plane-protocols
            /rt:control-plane-protocol/ospf:ospf/ospf:areas/ospf:area
            /ospf:interfaces/ospf:interface/ospf:database
            /ospf:link-scope-lsa-type/ospf:link-scope-lsas
            /ospf:link-scope-lsa/ospf:version/ospf:ospfv2/ospf:ospfv2
            /ospf:body/ospf:opaque/ospf:ri-opaque:
    +--ro fad-tlvs
       +--ro fad-tlv* []
          +--ro algo-number?            uint8
          +--ro metric-type?            identityref
          +--ro calc-type?              identityref
          +--ro priority?               uint8
          +--ro fa-ex-ag-sub-tlv
          |  +--ro extended-admin-groups*   uint32
          +--ro fa-in-any-ag-sub-tlv
          |  +--ro extended-admin-groups*   uint32
          +--ro fa-in-all-ag-sub-tlv
          |  +--ro extended-admin-groups*   uint32
          +--ro fad-flags-sub-tlv
          |  +--ro fad-flags*   identityref
          +--ro fa-ex-srlg-sub-tlv
          |  +--ro srlgs*   uint32
          +--ro unknown-tlvs
             +--ro unknown-tlv* []
                +--ro type?     uint16
                +--ro length?   uint16
                +--ro value?    yang:hex-string
  augment /rt:routing/rt:control-plane-protocols
            /rt:control-plane-protocol/ospf:ospf/ospf:areas/ospf:area
            /ospf:database/ospf:area-scope-lsa-type
            /ospf:area-scope-lsas/ospf:area-scope-lsa/ospf:version
            /ospf:ospfv2/ospf:ospfv2/ospf:body/ospf:opaque
            /ospf:ri-opaque:
    +--ro fad-tlvs
       +--ro fad-tlv* []
          +--ro algo-number?            uint8
          +--ro metric-type?            identityref
          +--ro calc-type?              identityref
          +--ro priority?               uint8
          +--ro fa-ex-ag-sub-tlv
          |  +--ro extended-admin-groups*   uint32
          +--ro fa-in-any-ag-sub-tlv
          |  +--ro extended-admin-groups*   uint32
          +--ro fa-in-all-ag-sub-tlv
          |  +--ro extended-admin-groups*   uint32
          +--ro fad-flags-sub-tlv
          |  +--ro fad-flags*   identityref
          +--ro fa-ex-srlg-sub-tlv
          |  +--ro srlgs*   uint32
          +--ro unknown-tlvs
             +--ro unknown-tlv* []
                +--ro type?     uint16
                +--ro length?   uint16
                +--ro value?    yang:hex-string
  augment /rt:routing/rt:control-plane-protocols
            /rt:control-plane-protocol/ospf:ospf/ospf:database
            /ospf:as-scope-lsa-type/ospf:as-scope-lsas
            /ospf:as-scope-lsa/ospf:version/ospf:ospfv2/ospf:ospfv2
            /ospf:body/ospf:opaque/ospf:ri-opaque:
    +--ro fad-tlvs
       +--ro fad-tlv* []
          +--ro algo-number?            uint8
          +--ro metric-type?            identityref
          +--ro calc-type?              identityref
          +--ro priority?               uint8
          +--ro fa-ex-ag-sub-tlv
          |  +--ro extended-admin-groups*   uint32
          +--ro fa-in-any-ag-sub-tlv
          |  +--ro extended-admin-groups*   uint32
          +--ro fa-in-all-ag-sub-tlv
          |  +--ro extended-admin-groups*   uint32
          +--ro fad-flags-sub-tlv
          |  +--ro fad-flags*   identityref
          +--ro fa-ex-srlg-sub-tlv
          |  +--ro srlgs*   uint32
          +--ro unknown-tlvs
             +--ro unknown-tlv* []
                +--ro type?     uint16
                +--ro length?   uint16
                +--ro value?    yang:hex-string
  augment /rt:routing/rt:control-plane-protocols
            /rt:control-plane-protocol/ospf:ospf/ospf:areas/ospf:area
            /ospf:interfaces/ospf:interface/ospf:database
            /ospf:link-scope-lsa-type/ospf:link-scope-lsas
            /ospf:link-scope-lsa/ospf:version/ospf:ospfv3/ospf:ospfv3
            /ospf:body/ospf:router-information:
    +--ro fad-tlvs
       +--ro fad-tlv* []
          +--ro algo-number?            uint8
          +--ro metric-type?            identityref
          +--ro calc-type?              identityref
          +--ro priority?               uint8
          +--ro fa-ex-ag-sub-tlv
          |  +--ro extended-admin-groups*   uint32
          +--ro fa-in-any-ag-sub-tlv
          |  +--ro extended-admin-groups*   uint32
          +--ro fa-in-all-ag-sub-tlv
          |  +--ro extended-admin-groups*   uint32
          +--ro fad-flags-sub-tlv
          |  +--ro fad-flags*   identityref
          +--ro fa-ex-srlg-sub-tlv
          |  +--ro srlgs*   uint32
          +--ro unknown-tlvs
             +--ro unknown-tlv* []
                +--ro type?     uint16
                +--ro length?   uint16
                +--ro value?    yang:hex-string
  augment /rt:routing/rt:control-plane-protocols
            /rt:control-plane-protocol/ospf:ospf/ospf:areas/ospf:area
            /ospf:database/ospf:area-scope-lsa-type
            /ospf:area-scope-lsas/ospf:area-scope-lsa/ospf:version
            /ospf:ospfv3/ospf:ospfv3/ospf:body
            /ospf:router-information:
    +--ro fad-tlvs
       +--ro fad-tlv* []
          +--ro algo-number?            uint8
          +--ro metric-type?            identityref
          +--ro calc-type?              identityref
          +--ro priority?               uint8
          +--ro fa-ex-ag-sub-tlv
          |  +--ro extended-admin-groups*   uint32
          +--ro fa-in-any-ag-sub-tlv
          |  +--ro extended-admin-groups*   uint32
          +--ro fa-in-all-ag-sub-tlv
          |  +--ro extended-admin-groups*   uint32
          +--ro fad-flags-sub-tlv
          |  +--ro fad-flags*   identityref
          +--ro fa-ex-srlg-sub-tlv
          |  +--ro srlgs*   uint32
          +--ro unknown-tlvs
             +--ro unknown-tlv* []
                +--ro type?     uint16
                +--ro length?   uint16
                +--ro value?    yang:hex-string
  augment /rt:routing/rt:control-plane-protocols
            /rt:control-plane-protocol/ospf:ospf/ospf:database
            /ospf:as-scope-lsa-type/ospf:as-scope-lsas
            /ospf:as-scope-lsa/ospf:version/ospf:ospfv3/ospf:ospfv3
            /ospf:body/ospf:router-information:
    +--ro fad-tlvs
       +--ro fad-tlv* []
          +--ro algo-number?            uint8
          +--ro metric-type?            identityref
          +--ro calc-type?              identityref
          +--ro priority?               uint8
          +--ro fa-ex-ag-sub-tlv
          |  +--ro extended-admin-groups*   uint32
          +--ro fa-in-any-ag-sub-tlv
          |  +--ro extended-admin-groups*   uint32
          +--ro fa-in-all-ag-sub-tlv
          |  +--ro extended-admin-groups*   uint32
          +--ro fad-flags-sub-tlv
          |  +--ro fad-flags*   identityref
          +--ro fa-ex-srlg-sub-tlv
          |  +--ro srlgs*   uint32
          +--ro unknown-tlvs
             +--ro unknown-tlv* []
                +--ro type?     uint16
                +--ro length?   uint16
                +--ro value?    yang:hex-string
  augment /rt:routing/rt:control-plane-protocols
            /rt:control-plane-protocol/ospf:ospf/ospf:areas/ospf:area
            /ospf:interfaces/ospf:interface/ospf:database
            /ospf:link-scope-lsa-type/ospf:link-scope-lsas
            /ospf:link-scope-lsa/ospf:version/ospf:ospfv2/ospf:ospfv2
            /ospf:body/ospf:opaque/ospf:extended-prefix-opaque
            /ospf:extended-prefix-tlv:
    +--ro fapm-sub-tlvs
       +--ro fapm-sub-tlv* []
          +--ro algo-number?   uint8
          +--ro fapm-flags*    identityref
          +--ro metric?        uint32
  augment /rt:routing/rt:control-plane-protocols
            /rt:control-plane-protocol/ospf:ospf/ospf:areas/ospf:area
            /ospf:database/ospf:area-scope-lsa-type
            /ospf:area-scope-lsas/ospf:area-scope-lsa/ospf:version
            /ospf:ospfv2/ospf:ospfv2/ospf:body/ospf:opaque
            /ospf:extended-prefix-opaque/ospf:extended-prefix-tlv:
    +--ro fapm-sub-tlvs
       +--ro fapm-sub-tlv* []
          +--ro algo-number?   uint8
          +--ro fapm-flags*    identityref
          +--ro metric?        uint32
  augment /rt:routing/rt:control-plane-protocols
            /rt:control-plane-protocol/ospf:ospf/ospf:database
            /ospf:as-scope-lsa-type/ospf:as-scope-lsas
            /ospf:as-scope-lsa/ospf:version/ospf:ospfv2/ospf:ospfv2
            /ospf:body/ospf:opaque/ospf:extended-prefix-opaque
            /ospf:extended-prefix-tlv:
    +--ro fapm-sub-tlvs
       +--ro fapm-sub-tlv* []
          +--ro algo-number?   uint8
          +--ro fapm-flags*    identityref
          +--ro metric?        uint32
  augment /rt:routing/rt:control-plane-protocols
            /rt:control-plane-protocol/ospf:ospf/ospf:areas/ospf:area
            /ospf:database/ospf:area-scope-lsa-type
            /ospf:area-scope-lsas/ospf:area-scope-lsa/ospf:version
            /ospf:ospfv3/ospf:ospfv3/ospf:body
            /ospfv3-e-lsa:e-inter-area-prefix
            /ospfv3-e-lsa:e-inter-prefix-tlvs
            /ospfv3-e-lsa:inter-prefix-tlv:
    +--ro fapm-sub-tlvs
       +--ro fapm-sub-tlv* []
          +--ro algo-number?   uint8
          +--ro fapm-flags*    identityref
          +--ro metric?        uint32
  augment /rt:routing/rt:control-plane-protocols
            /rt:control-plane-protocol/ospf:ospf/ospf:database
            /ospf:as-scope-lsa-type/ospf:as-scope-lsas
            /ospf:as-scope-lsa/ospf:version/ospf:ospfv3/ospf:ospfv3
            /ospf:body/ospfv3-e-lsa:e-as-external
            /ospfv3-e-lsa:e-external-tlvs
            /ospfv3-e-lsa:external-prefix-tlv:
    +--ro fapm-sub-tlvs
       +--ro fapm-sub-tlv* []
          +--ro algo-number?   uint8
          +--ro fapm-flags*    identityref
          +--ro metric?        uint32
  augment /rt:routing/rt:control-plane-protocols
            /rt:control-plane-protocol/ospf:ospf/ospf:areas/ospf:area
            /ospf:database/ospf:area-scope-lsa-type
            /ospf:area-scope-lsas/ospf:area-scope-lsa/ospf:version
            /ospf:ospfv2/ospf:ospfv2/ospf:body/ospf:opaque:
    +--ro eia-asbr-opaque
       +--ro eia-asbr-tlv
       |  +--ro asbr-rtr-id?     rt-types:router-id
       |  +--ro faam-sub-tlvs
       |  |  +--ro faam-sub-tlv* []
       |  |     +--ro algo-number?   uint8
       |  |     +--ro metric?        uint32
       |  +--ro unknown-tlvs
       |     +--ro unknown-tlv* []
       |        +--ro type?     uint16
       |        +--ro length?   uint16
       |        +--ro value?    yang:hex-string
       +--ro unknown-tlvs
          +--ro unknown-tlv* []
             +--ro type?     uint16
             +--ro length?   uint16
             +--ro value?    yang:hex-string
  augment /rt:routing/rt:control-plane-protocols
            /rt:control-plane-protocol/ospf:ospf/ospf:areas/ospf:area
            /ospf:database/ospf:area-scope-lsa-type
            /ospf:area-scope-lsas/ospf:area-scope-lsa/ospf:version
            /ospf:ospfv3/ospf:ospfv3/ospf:body
            /ospfv3-e-lsa:e-inter-area-router
            /ospfv3-e-lsa:e-inter-router-tlvs
            /ospfv3-e-lsa:inter-router-tlv:
    +--ro faam-sub-tlvs
       +--ro faam-sub-tlv* []
          +--ro algo-number?   uint8
          +--ro metric?        uint32

  notifications:
    +---n flex-algo-not-supported
       +--ro routing-protocol-name?   leafref
       +--ro algo-number?             uint8
      ]]></artwork>
      <sourcecode name="ietf-ospf-flex-algo@2026-03-30.yang" type="" markers="true"><![CDATA[
module ietf-ospf-flex-algo {
  yang-version 1.1;
  namespace "urn:ietf:params:xml:ns:yang:ietf-ospf-flex-algo";
  prefix ospf-flex-algo;

  import ietf-routing {
    prefix rt;
    reference
      "RFC 8349: A YANG Data Model for Routing
       Management (NMDA Version)";
  }
  import ietf-routing-types {
    prefix rt-types;
    reference
      "RFC 8294: Common YANG Data Types for the
       Routing Area";
  }
  import ietf-te-types {
    prefix te-types;
    reference
      "RFC8776: Common YANG Data Types for Traffic Engineering.";
  }
  import ietf-ospf {
    prefix ospf;
    reference
      "RFC 9129: YANG Data Model for the OSPF
       Protocol";
  }
  import ietf-ospfv3-extended-lsa {
    prefix ospfv3-e-lsa;
    reference
      "RFC 9587: YANG Data Model for OSPFv3 Extended Link
       State Advertisements (LSAs)";
  }
  import ietf-te {
    prefix te;
    reference
      "RFC XXXX: A YANG Data Model for Traffic Engineering
                 Tunnels, Label Switched Paths, and Interfaces";
  }
  import iana-igp-algo-types {
    prefix iana-algo-types;
    reference
      "RFC XXXX: YANG Data Model for OSPF Application-Specific
                 Link Attributes and Flexible Algorithm";
  }
  import iana-igp-metric-types {
    prefix iana-metric-type;
    reference
      "RFC XXXX: YANG Data Model for OSPF Application-Specific
                 Link Attributes and Flexible Algorithm";
  }

  organization
    "IETF LSR - Link State Routing Working Group";
  contact
    "WG Web:   <https://datatracker.ietf.org/wg/lsr/>
     WG List:  <mailto:lsr@ietf.org>


     Author:    Yingzhen Qu
               <mailto:yingzhen.ietf@gmail.com>
     Author:    Acee Lindem
               <mailto:acee.ietf@gmail.com>
    ";
  description
    "The YANG module defines the configuration and operational
     state for OSPF Flexible Algorithm as defined in RFC 9350.

     This YANG model conforms to the Network Management
     Datastore Architecture (NMDA) as described in RFC 8342.

     Copyright (c) 2026 IETF Trust and the persons identified as
     authors of the code.  All rights reserved.

     Redistribution and use in source and binary forms, with or
     without modification, is permitted pursuant to, and subject
     to the license terms contained in, the Revised BSD License set
     forth in Section 4.c of the IETF Trust's Legal Provisions
     Relating to IETF Documents
     (https://trustee.ietf.org/license-info).

     This version of this YANG module is part of RFC XXXX;
     see the RFC itself for full legal notices.

     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 (RFC 2119) (RFC 8174) when, and only when,
     they appear in all capitals, as shown here.";

  revision 2026-03-30 {
    description
      "Initial Version";
    reference
      "RFC XXXX: YANG Data Model for OSPF Application-Specific
                 Link Attributes and Flexible Algorithm";
  }

  /* Identities */

  identity fad-flags {
    description
      "Base identity for OSPF FAD flags.";
    reference
      "RFC 9350: IGP Flexible Algorithm";
  }

  identity m-bit {
    base fad-flags;
    description
      "M bit, when set, the flex-algo specific prefix and ASBR
       metric MUST be used for inter-area and external prefix
       calculation.";
    reference
      "RFC 9350: IGP Flexible Algorithm";
  }

  identity fapm-flags {
    description
      "Base identity for OSPF flex-algo prefix metric flags.";
    reference
      "RFC 9350: IGP Flexible Algorithm";
  }

  identity e-bit {
    base fapm-flags;
    description
      "External metric, if set, the metric specified is a
       type 2 external metric.";
    reference
      "RFC 9350: IGP Flexible Algorithm";
  }

  /* Groupings */

  grouping fad-tlvs {
    container fad-tlvs {
      list fad-tlv {
        leaf algo-number {
          type uint8;
          description
            "Flex-algo number - A value not in the inclusive range
             of 128-255 is an invalid FAD TLV specification.";
        }
        leaf metric-type {
          type identityref {
            base iana-metric-type:metric-type;
          }
          description
            "Type of metric to be used during the calculation.";
        }
        leaf calc-type {
          type identityref {
            base iana-algo-types:algo-type;
          }
          description
            "IGP algorithm types, value from 0 to 127 as
             defined under 'Interior Gateway Protocol (IGP)
             Parameter' by IANA.";
        }
        leaf priority {
          type uint8;
          description
            "Priority of the advertisement.";
        }
        container fa-ex-ag-sub-tlv {
          leaf-list extended-admin-groups {
            type uint32;
            description
              "Extended administrative group as defined in
               RFC 7308.";
          }
          description
            "The flex-algo exclude admin group sub-tlv.";
        }
        container fa-in-any-ag-sub-tlv {
          leaf-list extended-admin-groups {
            type uint32;
            description
              "Extended administrative group as defined in
               RFC 7308.";
          }
          description
            "The flex-algo include-any admin group sub-tlv.";
        }
        container fa-in-all-ag-sub-tlv {
          leaf-list extended-admin-groups {
            type uint32;
            description
              "Extended administrative group as defined in
               RFC 7308.";
          }
          description
            "The flex-algo include-all admin group sub-tlv.";
        }
        container fad-flags-sub-tlv {
          leaf-list fad-flags {
            type identityref {
              base fad-flags;
            }
            description
              "Flex-algo definition flags list.";
          }
          description
            "OSPF flex-algo definition flags.";
        }
        container fa-ex-srlg-sub-tlv {
          leaf-list srlgs {
            type uint32;
            description
              "SRLG value as defined in RFC 4203.";
          }
          description
            "The flex-algo exclude SRLG sub-tlv.";
        }
        uses ospf:unknown-tlvs;
        description
          "List of flex-algo definition TLVs.";
      }
      description
        "OSPF Flexible Algorithm Definition TLV.";
    }
    description
      "OSPF Flexible Algorithm Definition (FAD) TLV.";
    reference
      "RFC 9350: IGP Flexible Algorithm";
  }

  grouping fapm-sub-tlvs {
    container fapm-sub-tlvs {
      list fapm-sub-tlv {
        leaf algo-number {
          type uint8;
          description
            "Flex-algo number - A value not in the inclusive range
             of 128-255 is an invalid FAD TLV specification.";
        }
        leaf-list fapm-flags {
          type identityref {
            base fapm-flags;
          }
          description
            "Flex-algo prefix metric flags list.";
        }
        leaf metric {
          type uint32;
          description
            "Prefix metric.";
        }
        description
          "List of flex-algo prefix sub-tlvs.";
      }
      description
        "Flex-algo prefix metric sub-tlvs.";
    }
    description
      "Flexible Algorithm Prefix Metric (FAPM) sub-TLVs.";
    reference
      "RFC 9350: IGP Flexible Algorithm";
  }

  grouping faam-sub-tlvs {
    container faam-sub-tlvs {
      list faam-sub-tlv {
        leaf algo-number {
          type uint8;
          description
            "Flex-algo number - A value not in the inclusive range
             of 128-255 is an invalid FAAM Sub-TLV specification.";
        }
        leaf metric {
          type uint32;
          description
            "Prefix metric.";
        }
        description
          "List of faam sub-tlvs.";
      }
      description
        "Flexible Algorithm ASBR Metric (FAAM) Sub-TLVs.";
    }
    description
      "Flexible Algorithm ASBR Metric (FAAM) Sub-TLVs.";
    reference
      "RFC 9350: IGP Flexible Algorithm";
  }

  /* Configurations */

  augment "/rt:routing/rt:control-plane-protocols"
        + "/rt:control-plane-protocol/ospf:ospf" {
    when "../rt:type = 'ospf:ospfv2' or "
       + "../rt:type = 'ospf:ospfv3'" {
      description
        "This augments the OSPF routing protocol when used.";
    }
    description
      "This augments OSPF protocol with Flexible
       Algorithm.";
    container ospf-flex-algo {
      list flex-algo {
        key "algo-number";
        leaf algo-number {
          type uint8 {
            range "128..255";
          }
          description
            "An identifier associated with the Flexible Algorithm
             Definition.";
        }
        leaf advertise-definition {
          type boolean;
          default "true";
          description
            "Enable to advertise the flex-algo definition.";
        }
        container admin-groups {
          if-feature "te-types:extended-admin-groups";
          if-feature "te-types:named-extended-admin-groups";
          leaf-list exclude-admin-groups {
            type leafref {
              path "/te:te/te:globals/te:named-admin-groups/"
                 + "te:named-admin-group/te:name";
            }
            description
              "Exclude rule used during the flex-algo
               path computation.";
          }
          leaf-list include-any-admin-groups {
            type leafref {
              path "/te:te/te:globals/te:named-admin-groups/"
                 + "te:named-admin-group/te:name";
            }
            description
              "Include-any rule used during the flex-algo
               path computation.";
          }
          leaf-list include-all-admin-groups {
            type leafref {
              path "/te:te/te:globals/te:named-admin-groups/"
                 + "te:named-admin-group/te:name";
            }
            description
              "Include-all rule used during the flex-algo
               path computation.";
          }
          description
            "Specify links for the flex-algo path computation.";
        }
        leaf-list exclude-srlgs {
          if-feature "te-types:named-srlg-groups";
          type leafref {
            path "/te:te/te:globals/te:named-srlgs/te:named-srlg/"
               + "te:name";
          }
          description
            "Shared Risk Link Groups (SRLGs) to be excluded during
             the flex-algo path computation.";
        }
        leaf calc-type {
          type identityref {
            base iana-algo-types:algo-type;
          }
          default "iana-algo-types:algo-spf";
          description
            "Calcuation-type. Value from 0-127 inclusive from the
             IANA 'IGP Algorithm Types' registry defined under the
             'Interior Gateway Protocol (IGP) Parameters' registry.";
        }
        leaf metric-type {
          type identityref {
            base iana-metric-type:metric-type;
          }
          default "iana-metric-type:igp-metric";
          description
            "Type of metric to be used during the calculation.";
        }
        container prefix-metric {
          presence "Use flex-algo specific prefix metric.";
          description
            "Use flex-algo prefix metric.";
        }
        leaf priority {
          type uint8;
          description
            "Priority of the advertisement.";
        }
        description
          "List of flex-algo configurations.";
      }
      description
        "Flexible Algorithm configuration.";
    }
  }

  /* Database */

  augment "/rt:routing/"
        + "rt:control-plane-protocols/rt:control-plane-protocol/"
        + "ospf:ospf/ospf:areas/ospf:area/"
        + "ospf:interfaces/ospf:interface/ospf:database/"
        + "ospf:link-scope-lsa-type/ospf:link-scope-lsas/"
        + "ospf:link-scope-lsa/ospf:version/ospf:ospfv2/"
        + "ospf:ospfv2/ospf:body/ospf:opaque/ospf:ri-opaque" {
    when "../../../../../../../../../../../../../"
       + "rt:type = 'ospf:ospfv2'" {
      description
        "This augmentation is only valid for OSPFv2.";
    }
    description
      "Flex-algo definition TLVs for OSPFv2 type 9 opaque RI LSA.";
    uses fad-tlvs;
  }

  augment "/rt:routing/"
        + "rt:control-plane-protocols/rt:control-plane-protocol/"
        + "ospf:ospf/ospf:areas/"
        + "ospf:area/ospf:database/"
        + "ospf:area-scope-lsa-type/ospf:area-scope-lsas/"
        + "ospf:area-scope-lsa/ospf:version/ospf:ospfv2/"
        + "ospf:ospfv2/ospf:body/ospf:opaque/ospf:ri-opaque" {
    when "../../../../../../../../../../../"
       + "rt:type = 'ospf:ospfv2'" {
      description
        "This augmentation is only valid for OSPFv2.";
    }
    description
      "Flex-algo definition TLVs for OSPFv2 type 10 opaque RI LSA.";
    uses fad-tlvs;
  }

  augment "/rt:routing/"
        + "rt:control-plane-protocols/rt:control-plane-protocol/"
        + "ospf:ospf/ospf:database/"
        + "ospf:as-scope-lsa-type/ospf:as-scope-lsas/"
        + "ospf:as-scope-lsa/ospf:version/ospf:ospfv2/"
        + "ospf:ospfv2/ospf:body/ospf:opaque/ospf:ri-opaque" {
    when "../../../../../../../../../"
       + "rt:type = 'ospf:ospfv2'" {
      description
        "This augmentation is only valid for OSPFv2.";
    }
    description
      "Flex-algo definition TLVs for OSPFv2 type 11 opaque RI LSA.";
    uses fad-tlvs;
  }

  augment "/rt:routing/"
        + "rt:control-plane-protocols/rt:control-plane-protocol/"
        + "ospf:ospf/ospf:areas/ospf:area/"
        + "ospf:interfaces/ospf:interface/ospf:database/"
        + "ospf:link-scope-lsa-type/ospf:link-scope-lsas/"
        + "ospf:link-scope-lsa/ospf:version/ospf:ospfv3/"
        + "ospf:ospfv3/ospf:body/ospf:router-information" {
    when "../../../../../../../../../../../../"
       + "rt:type = 'ospf:ospfv3'" {
      description
        "This augmentation is only valid for OSPFv3.";
    }
    description
      "Flex-algo definition TLVs for OSPFv3 Router
       Information (RI) LSA.";
    uses fad-tlvs;
  }

  augment "/rt:routing/"
        + "rt:control-plane-protocols/rt:control-plane-protocol/"
        + "ospf:ospf/ospf:areas/"
        + "ospf:area/ospf:database/"
        + "ospf:area-scope-lsa-type/ospf:area-scope-lsas/"
        + "ospf:area-scope-lsa/ospf:version/ospf:ospfv3/"
        + "ospf:ospfv3/ospf:body/ospf:router-information" {
    when "../../../../../../../../../../"
       + "rt:type = 'ospf:ospfv3'" {
      description
        "This augmentation is only valid for OSPFv3.";
    }
    description
      "Flex-algo definition TLVs for OSPFv3 Router
       Information (RI) LSA.";
    uses fad-tlvs;
  }

  augment "/rt:routing/"
        + "rt:control-plane-protocols/rt:control-plane-protocol/"
        + "ospf:ospf/ospf:database/"
        + "ospf:as-scope-lsa-type/ospf:as-scope-lsas/"
        + "ospf:as-scope-lsa/ospf:version/ospf:ospfv3/"
        + "ospf:ospfv3/ospf:body/ospf:router-information" {
    when "../../../../../../../../"
       + "rt:type = 'ospf:ospfv3'" {
      description
        "This augmentation is only valid for OSPFv3.";
    }
    description
      "Flex-algo definition TLVs for OSPFv3 Router Information LSA.";
    uses fad-tlvs;
  }

  augment "/rt:routing/"
        + "rt:control-plane-protocols/rt:control-plane-protocol/"
        + "ospf:ospf/ospf:areas/ospf:area/"
        + "ospf:interfaces/ospf:interface/ospf:database/"
        + "ospf:link-scope-lsa-type/ospf:link-scope-lsas/"
        + "ospf:link-scope-lsa/ospf:version/ospf:ospfv2/"
        + "ospf:ospfv2/ospf:body/ospf:opaque/"
        + "ospf:extended-prefix-opaque/ospf:extended-prefix-tlv" {
    when "../../../../../../../../../../../../../../"
       + "rt:type = 'ospf:ospfv2'" {
      description
        "This augmentation is only valid for OSPFv2.";
    }
    description
      "Flex-algo prefix metric sub-TLVs for OSPFv2 extended
       prefix TLV in type 9 opaque LSA.";
    uses fapm-sub-tlvs;
  }

  augment "/rt:routing/"
        + "rt:control-plane-protocols/rt:control-plane-protocol/"
        + "ospf:ospf/ospf:areas/"
        + "ospf:area/ospf:database/"
        + "ospf:area-scope-lsa-type/ospf:area-scope-lsas/"
        + "ospf:area-scope-lsa/ospf:version/ospf:ospfv2/"
        + "ospf:ospfv2/ospf:body/ospf:opaque/"
        + "ospf:extended-prefix-opaque/ospf:extended-prefix-tlv" {
    when "../../../../../../../../../../../../"
       + "rt:type = 'ospf:ospfv2'" {
      description
        "This augmentation is only valid for OSPFv2.";
    }
    description
      "Flex-algo prefix metric sub-TLVs for OSPFv2 extended
       prefix TLV in type 10 opaque LSA.";
    uses fapm-sub-tlvs;
  }

  augment "/rt:routing/"
        + "rt:control-plane-protocols/rt:control-plane-protocol/"
        + "ospf:ospf/ospf:database/"
        + "ospf:as-scope-lsa-type/ospf:as-scope-lsas/"
        + "ospf:as-scope-lsa/ospf:version/ospf:ospfv2/"
        + "ospf:ospfv2/ospf:body/ospf:opaque/"
        + "ospf:extended-prefix-opaque/"
        + "ospf:extended-prefix-tlv" {
    when "../../../../../../../../../../"
       + "rt:type = 'ospf:ospfv2'" {
      description
        "This augmentation is only valid for OSPFv2.";
    }
    description
      "Flex-algo prefix metric sub-TLVs for OSPFv2 extended
       prefix TLV in type 11 opaque LSA.";
    uses fapm-sub-tlvs;
  }

  /* Flex-algo prefix metric Sub-TLV in OSPFv3 Inter-Area
     Prefix TLV */

  augment "/rt:routing/"
        + "rt:control-plane-protocols/rt:control-plane-protocol/"
        + "ospf:ospf/ospf:areas/ospf:area/ospf:database/"
        + "ospf:area-scope-lsa-type/ospf:area-scope-lsas/"
        + "ospf:area-scope-lsa/ospf:version/ospf:ospfv3/"
        + "ospf:ospfv3/ospf:body/ospfv3-e-lsa:e-inter-area-prefix/"
        + "ospfv3-e-lsa:e-inter-prefix-tlvs/"
        + "ospfv3-e-lsa:inter-prefix-tlv" {
    when "../../../../../../../../../../../../"
       + "rt:type = 'ospf:ospfv3'" {
      description
        "This augmentation is only valid for OSPFv3
         E-Router LSAs";
    }
    uses fapm-sub-tlvs;
    description
      "OSPFv3 Area-Scoped Inter-Area Prefix TLV.";
  }

  /* Flex-algo prefix metric Sub-TLV in OSPFv3 External Prefix TLV */

  augment "/rt:routing/"
        + "rt:control-plane-protocols/rt:control-plane-protocol/"
        + "ospf:ospf/ospf:database/"
        + "ospf:as-scope-lsa-type/ospf:as-scope-lsas/"
        + "ospf:as-scope-lsa/ospf:version/ospf:ospfv3/"
        + "ospf:ospfv3/ospf:body/ospfv3-e-lsa:e-as-external/"
        + "ospfv3-e-lsa:e-external-tlvs/"
        + "ospfv3-e-lsa:external-prefix-tlv" {
    when "'ospf:../../../../../../../../../"
       + "rt:type' = 'ospf:ospfv3'" {
      description
        "This augmentation is only valid for OSPFv3.";
    }
    uses fapm-sub-tlvs;
    description
      "OSPFv3 AS-Scoped External Prefix TLV.";
  }

  /* OSPFv2 Extended Inter-Area ASBR LSA */

  augment "/rt:routing/"
        + "rt:control-plane-protocols/rt:control-plane-protocol/"
        + "ospf:ospf/ospf:areas/"
        + "ospf:area/ospf:database/"
        + "ospf:area-scope-lsa-type/ospf:area-scope-lsas/"
        + "ospf:area-scope-lsa/ospf:version/ospf:ospfv2/"
        + "ospf:ospfv2/ospf:body/ospf:opaque" {
    when "../../../../../../../../../../"
       + "rt:type = 'ospf:ospfv2'" {
      description
        "This augmentation is only valid for OSPFv2.";
    }
    description
      "OSPFv2 Extended Inter-Area ASBR LSA in type 10
       opaque LSA.";
    container eia-asbr-opaque {
      container eia-asbr-tlv {
        leaf asbr-rtr-id {
          type rt-types:router-id;
          description
            "The OSPF Router ID of the ASBR.";
        }
        uses faam-sub-tlvs;
        uses ospf:unknown-tlvs;
        description
          "EIA-ASBR TLV, used to advertise additional attributes
           associated with the reachability of an ASBR.";
      }
      uses ospf:unknown-tlvs;
      description
        "OSPFv2 Extended Inter-Area (EIA-ASBR) opaque LSA.";
    }
  }

  /* FAAM Sub-TLV in OSPFv3 Inter-Area-Router TLV */

  augment "/rt:routing/"
        + "rt:control-plane-protocols/rt:control-plane-protocol/"
        + "ospf:ospf/ospf:areas/ospf:area/ospf:database/"
        + "ospf:area-scope-lsa-type/ospf:area-scope-lsas/"
        + "ospf:area-scope-lsa/ospf:version/ospf:ospfv3/"
        + "ospf:ospfv3/ospf:body/ospfv3-e-lsa:e-inter-area-router/"
        + "ospfv3-e-lsa:e-inter-router-tlvs/"
        + "ospfv3-e-lsa:inter-router-tlv" {
    when "../../../../../../../../../../../../"
       + "rt:type = 'ospf:ospfv3'" {
      description
        "This augmentation is only valid for OSPFv3
         Inter-Area-Router TLV.";
    }
    uses faam-sub-tlvs;
    description
      "OSPFv3 Area-Scoped Inter-Area-Router TLV.";
  }

  /* notification */

  notification flex-algo-not-supported {
    leaf routing-protocol-name {
      type leafref {
        path "/rt:routing/rt:control-plane-protocols/"
           + "rt:control-plane-protocol/rt:name";
      }
      description
        "Name of the OSPF instance.";
    }
    leaf algo-number {
      type uint8;
      description
        "Flex-algo identifier which is not supported by the OSPF
         instance. A value not in the inclusive range of 128-255
         is indicative of an invalid FAD algorithm specification.";
    }
    description
      "This notification is sent when an OSPF instance does not
       support this flex-algo.";
  }
}
        ]]></sourcecode>
    </section>

    <section anchor="Security" numbered="true" toc="default">
      <name>Security Considerations</name>
 <t>   The YANG modules defined in this document are
   designed to be accessed via YANG-based management protocols, such as
   NETCONF <xref target="RFC6241"/> and RESTCONF <xref target="RFC8040"/>.
   These protocols have to use a secure transport layer (e.g., SSH
   <xref target="RFC4252"/>, TLS <xref target="RFC8446"/>, and
   QUIC <xref target="RFC9000"/>) and have to use mutual authentication.</t>

 <t>
    The Network Configuration Access Control Model (NACM) <xref target="RFC8341"/>
    provides the means to restrict access for particular NETCONF or
    RESTCONF users to a preconfigured subset of all available NETCONF or
    RESTCONF protocol operations and content.
 </t>
 <t>
   There are a number of data nodes defined in this YANG module that are
   writable/creatable/deletable (i.e., "config true", which is the
   default).  All writable data nodes are likely to be reasonably
   sensitive or vulnerable in some network environments.  Write
   operations (e.g., edit-config) and delete operations to these data
   nodes without proper protection or authentication can have a negative
   effect on network operations.  The following subtrees and data nodes
   have particular sensitivities/vulnerabilities:
 </t>
 <ul empty="true" spacing="normal">
   <li>
    /ospf:ospf/ospf-link-attr/link-attr-op-mode - Modification to the
    protocol operation mode may result in traffic disruption.
   </li>
   <li>
    /ospf:ospf/flex-algo - Modification to flex-algo configuration
    could be used to mount a DoS attack. For example, changing of
    calc-type may result in routing loops.
   </li>
  </ul>

  <t>
    Some of the readable data nodes in this YANG module may be considered
    sensitive or vulnerable in some network environments.  It is thus
    important to control read access (e.g., via get, get-config, or
    notification) to these data nodes. Specifically, the following
    subtrees and data nodes have particular sensitivities/
    vulnerabilities:
 </t>
 <ul empty="true" spacing="normal">
   <li>
    Both module ietf-ospf-flex-algo and module ietf-ospf-link-attr
    augments base OSPF module Link State Database (LSDB) with various
    TLVs. Knowledge of these data nodes can be used to attack other
    routers in the OSPF domain. These attacks are documented in <xref target="RFC9129"/>.
   </li>
  </ul>
    </section>
    <section numbered="true" toc="default">
      <name>IANA Considerations</name>
      <section numbered="true" toc="default">
        <name slugifiedName="name-registering-yang-modules">Registering YANG Modules</name>
      <t>This document registers URIs in the IETF XML registry
   <xref target="RFC3688" format="default"/>.  Following the format in <xref target="RFC3688" format="default"/>,
   the following registrations are requested to be made:
      </t>

      <artwork name="" type="" align="left" alt=""><![CDATA[
   URI: urn:ietf:params:xml:ns:yang:iana-igp-algo-types
   Registrant Contact: The IESG.
   XML: N/A, the requested URI is an XML namespace.
   ]]></artwork>

      <artwork name="" type="" align="left" alt=""><![CDATA[
   URI: urn:ietf:params:xml:ns:yang:iana-igp-metric-types
   Registrant Contact: The IESG.
   XML: N/A, the requested URI is an XML namespace.
   ]]></artwork>

      <artwork name="" type="" align="left" alt=""><![CDATA[
   URI: urn:ietf:params:xml:ns:yang:ietf-ospf-link-attr
   Registrant Contact: The IESG.
   XML: N/A, the requested URI is an XML namespace.
   ]]></artwork>
      <artwork name="" type="" align="left" alt=""><![CDATA[
   URI: urn:ietf:params:xml:ns:yang:ietf-ospf-flex-algo
   Registrant Contact: The IESG.
   XML: N/A, the requested URI is an XML namespace.
   ]]></artwork>

      <t>This document registers the YANG modules in the YANG Module Names
   registry <xref target="RFC6020" format="default"/>.
      </t>


      <artwork name="" type="" align="left" alt=""><![CDATA[
   name: iana-igp-algo-types
   Maintained by IANA?  Y
   namespace: urn:ietf:params:xml:ns:yang:iana-igp-algo-types
   prefix: iana-algo-types
   reference: RFC XXXX
   ]]></artwork>

      <artwork name="" type="" align="left" alt=""><![CDATA[
   name: iana-igp-metric-types
   Maintained by IANA?  Y
   namespace: urn:ietf:params:xml:ns:yang:iana-igp-metric-types
   prefix: iana-metric-types
   reference: RFC XXXX
   ]]></artwork>

      <artwork name="" type="" align="left" alt=""><![CDATA[
   name: ietf-ospf-link-attr
   Maintained by IANA?  N
   namespace: urn:ietf:params:xml:ns:yang:ietf-ospf-link-attr
   prefix: ospf-link-attr
   reference: RFC XXXX
   ]]></artwork>
      <artwork name="" type="" align="left" alt=""><![CDATA[
   name: ietf-ospf-flex-algo
   Maintained by IANA?  N
   namespace: urn:ietf:params:xml:ns:yang:ietf-ospf-flex-algo
   prefix: ospf-flex-algo
   reference: RFC XXXX
   ]]></artwork>
 </section>

      <section numbered="true" toc="default">
        <name slugifiedName="name-iana-algo-types-module">IANA IGP Algorithm Types Module</name>
        <t>This document defines the initial version of the IANA-maintained
          "iana-algo-types" YANG module (<xref target="iana-algo-types"/>).
          The most recent version of the YANG module is available from the "YANG Parameters"
          registry <xref target="IANA-YANG-Parameters"/>.
         </t>
         <t>
          IANA is requested to add this note to the registry:
         </t>
        <blockquote>
          <t indent="0">New values must not be directly added to the "iana-algo-types" YANG
              module.  They must instead be added to the "IGP Algorithm Types" registry in the "Interior Gateway Protocol (IGP) Parameters" registry group.
          </t>
        </blockquote>
        <t>
          When a value is added to the "IGP Algorithm Types" registry, a new "identity"
          statement needs to be added to the "iana-algo-types" YANG module. The name
          of the "identity" MUST be the name as provided in the registry.
          The "identity" statement should have the following
          sub-statements defined:
        </t>
  <artwork>
  "base":          contains "algo-type".
  "description":   Replicates the description from the registry.
  "reference":     Replicates the reference(s) from the registry with
                   the title of the document(s) added.
  </artwork>

  <t>
  When the "iana-algo-types" YANG module is updated, a new "revision"
  statement with a unique revision date must be added in front of the
  existing revision statements. The "revision" statement MUST contain
  both "description" and "reference" substatements as follows.</t>

  <t>
  The "description" substatement captures what changed in the
  revised version. Typically, the description enumerates the changes
  such as udpates to existing entries (e.g., update a description or
  a reference) or notes which identities were added or had their status
  changed (e.g., deprecated, discouraged, or obsoleted).</t>

  <t>
  The "reference" substatement points specifically to the published
  module (i.e., IANA_FOO_URL_With_REV). It may also point to an
  authoritative event triggering the update to the YANG module. In all
  cases, this event is cited from the underlying IANA registry. If the
  update is triggered by an RFC, that RFC must also be included in
  the "reference" substatement.</t>

      <t>
      IANA is requested to add this note to <xref target="IANA-IGP-ALGO-Types" format="default" sectionFormat="of" derivedContent="IANA-IGP-ALGO-Types"/>:</t>
        <blockquote>
          <t indent="0">
         When this registry is modified, the YANG module "iana-algo-types"
         <xref target="iana-algo-types"/> must be updated as defined in RFC XXXX.
         </t>
       </blockquote>
      </section>

      <section numbered="true" toc="default">
        <name slugifiedName="name-iana-metric-types-module">IANA IGP Metric-Type Module</name>
        <t>This document defines the initial version of the IANA-maintained
          "iana-metric-types" YANG module (<xref target="iana-metric-types"/>).
          The most recent version of the YANG module is available from the "YANG Parameters"
          registry <xref target="IANA-YANG-Parameters"/>.
         </t>
         <t>
          IANA is requested to add this note to the registry:
         </t>
        <blockquote>
          <t indent="0">New values must not be directly added to the "iana-metric-types" YANG
            module. They must instead be added to the "IGP Metric-Type" registry in the "Interior Gateway Protocol (IGP) Parameters" registry group.</t>
        </blockquote>
        <t>
          When a value is added to the "IGP Metric-Type" registry, a new "identity"
          statement needs to be added to the "iana-metric-types" YANG module. The name
          of the "identity" MUST be the name as provided in the registry.
          The "identity" statement should have the following
          sub-statements defined:
  </t>
  <artwork>
  "base":          contains "metric-type".
  "description":   Replicates the description from the registry.
  "reference":     Replicates the reference(s) from the registry with
                   the title of the document(s) added.
  </artwork>


  <t>
  When the "iana-metric-types" YANG module is updated, a new "revision"
  statement with a unique revision date must be added in front of the
  existing revision statements. The "revision" statement MUST contain
  both "description" and "reference" substatements as follows.</t>

  <t>
  The "description" substatement captures what changed in the
  revised version. Typically, the description enumerates the changes
  such as udpates to existing entries (e.g., update a description or
  a reference) or notes which identities were added or had their status
  changed (e.g., deprecated, discouraged, or obsoleted).</t>

  <t>
  The "reference" substatement points specifically to the published
  module (i.e., IANA_FOO_URL_With_REV). It may also point to an
  authoritative event triggering the update to the YANG module. In all
  cases, this event is cited from the underlying IANA registry. If the
  update is triggered by an RFC, that RFC must also be included in
  the "reference" substatement.</t>

      <t>
      IANA is requested to add this note to <xref target="IANA-IGP-Metric-Types" format="default" sectionFormat="of" derivedContent="IANA-IGP-Metric-Types"/>:</t>
        <blockquote>
          <t indent="0">
         When this registry is modified, the YANG module "iana-metric-types"
         <xref target="iana-algo-types"/> must be updated as defined in RFC XXXX.
         </t>
       </blockquote>

      </section>

    </section>
    <section anchor="Acknowledgements" numbered="true" toc="default">
      <name>Acknowledgements</name>
      <t>
        Thanks to Dhruv Dhody for his detailed YANG doctors review.
      </t>
      <t>
        Thanks to Adrian Farrel for his OPS directorate review.
      </t>

    </section>
  </middle>
  <!--  *****BACK MATTER ***** -->

  <back>
    <!-- References split into informative and normative -->

    <!-- There are 2 ways to insert reference entries from the citation libraries:
     1. define an ENTITY at the top, and use "ampersand character"RFC2629; here (as shown)
     2. simply use a PI "less than character"?rfc include="reference.RFC.2119.xml"?> here
        (for I-Ds: include="reference.I-D.narten-iana-considerations-rfc2434bis.xml")

     Both are cited textually in the same manner: by using xref elements.
     If you use the PI option, xml2rfc will, by default, try to find included files in the same
     directory as the including file. You can also define the XML_LIBRARY environment variable
     with a value containing a set of directories to search.  These can be either in the local
     filing system or remote ones accessed by http (http://domain/dir/... ).-->

    <references>
      <name>References</name>
    <references>
      <name>Normative References</name>
      <!--?rfc include="http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml"?-->
      <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml"/>
      <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.3630.xml"/>
      <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.3688.xml"/>
      <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.4252.xml"/>
      <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.5305.xml"/>
      <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.6020.xml"/>
      <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.6241.xml"/>
      <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.7471.xml"/>
      <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.7950.xml"/>
      <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8040.xml"/>
      <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8174.xml"/>
      <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8341.xml"/>
      <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8349.xml"/>
      <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8446.xml"/>
      <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8570.xml"/>
      <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8665.xml"/>
      <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.9000.xml"/>
      <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.9492.xml"/>
      <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.9129.xml"/>
      <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.9350.xml"/>
      <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.9587.xml"/>
      <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.9843.xml"/>
      <reference anchor="I-D.ietf-yang-te">
        <front>
          <title>YANG Data Model for Traffic Engineering</title>
          <author>
            <organization>IETF</organization>
          </author>
          <date/>
        </front>
        <seriesInfo name="Internet-Draft" value="draft-ietf-yang-te"/>
      </reference>
      <reference anchor="IANA-IGP-ALGO-Types" target="https://www.iana.org/assignments/igp-parameters" quoteTitle="true" derivedAnchor="IANA-IGP-ALGO-Types">
          <front>
            <title>IGP Algorithm Types</title>
            <author>
              <organization showOnFrontPage="true">IANA</organization>
            </author>
            <date/>
          </front>
        </reference>
      <reference anchor="IANA-IGP-Metric-Types" target="https://www.iana.org/assignments/igp-parameters" quoteTitle="true" derivedAnchor="IANA-IGP-Metric-Types">
          <front>
            <title>IGP Metric-Type</title>
            <author>
              <organization showOnFrontPage="true">IANA</organization>
            </author>
            <date/>
          </front>
        </reference>
        <reference anchor="IANA-YANG-Parameters" target="https://www.iana.org/assignments/yang-parameters" quoteTitle="true" derivedAnchor="IANA-YANG-Parameters">
          <front>
            <title>YANG Module Names</title>
            <author>
              <organization showOnFrontPage="true">IANA</organization>
            </author>
            <date/>
          </front>
        </reference>
    </references>
    <references title="Informative References">
      <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8792.xml"/>
    </references>
  </references>
    <section numbered="false" toc="default">
      <name>Appendix A. Example OSPF Flex-Algo Configuration (XML)</name>
      <t>
        The following is an example configuration for 
        OSPF Flexible Algorithm using the YANG model defined in this document.
      </t>
      <t>
        Note: '\' line wrapping per <xref target="RFC8792"/>.</t>
      <artwork name="Example IS-IS Flex-Algo Configuration" type="xml" align="left" alt=""><![CDATA[
<?xml version='1.0' encoding='UTF-8'?>
  <te xmlns="urn:ietf:params:xml:ns:yang:ietf-te">
    <enable>true</enable>
    <globals>
      <named-admin-groups>
        <named-admin-group>
          <name>blue</name>
        </named-admin-group>
      </named-admin-groups>
    </globals>
  </te>
  <routing xmlns="urn:ietf:params:xml:ns:yang:ietf-routing">
    <router-id>1.1.1.1</router-id>
    <control-plane-protocols>
      <control-plane-protocol>
        <type xmlns:ospf="urn:ietf:params:xml:ns:yang:ietf-ospf">\
          ospf:ospfv2</type>
        <name>OSPFv2</name>
           <ospf xmlns="urn:ietf:params:xml:ns:yang:ietf-ospf">
             <areas>
               <area>
                 <area-id>0.0.0.0</area-id>
               </area>
             </areas>
          <ospf-flex-algo xmlns="urn:ietf:params:xml:ns:yang:\
            ietf-ospf-flex-algo">
            <flex-algo> 
              <algo-number>200</algo-number>
              <admin-groups>
                <exclude-admin-groups>blue</exclude-admin-groups>
              </admin-groups>
              <metric-type xmlns:iana-metric-types=\
                "urn:ietf:params:xml:ns:yang:iana-igp-metric-types">\
                iana-metric-types:igp-metric</metric-type>
              <calc-type xmlns:iana-algo-types=\
                "urn:ietf:params:xml:ns:yang:iana-igp-algo-types">\
                iana-algo-types:algo-spf</calc-type>
              <prefix-metric/>
              <priority>100</priority>
            </flex-algo>
          </ospf-flex-algo>
        </ospf>     
      </control-plane-protocol>
    </control-plane-protocols>
  </routing>
      ]]></artwork>
    </section>

    <section numbered="false" toc="default">
      <name>Appendix B. Example OSPF Flex-Algo Configuration (JSON)</name>
      <t>
        The following is the same example configuration for OSPF 
        Flexible Algorithm as in the previous section in JSON format using the YANG model 
        defined in this document.
      </t>
      <artwork name="Example OSPF Flex-Algo Configuration (JSON)" type="json" align="left" alt=""><![CDATA[
{
  "te": {
    "enable": "true",
    "globals": {
      "named-admin-groups": {
        "named-admin-group": {
          "name": "blue"
        }
      }
    },
    "_xmlns": "urn:ietf:params:xml:ns:yang:ietf-te"
  }
}
{
  "routing": {
    "router-id": "1.1.1.1",
    "control-plane-protocols": {
      "control-plane-protocol": {
        "type": {
          "_xmlns:ospf": "urn:ietf:params:xml:ns:yang:ietf-ospf",
          "__text": "ospf:ospfv2"
        },
        "name": "OSPFv2",
        "ospf": {
          "areas": {
            "area": {
              "area-id": "0.0.0.0"
            }
          },
          "ospf-flex-algo": {
            "flex-algo": {
              "algo-number": "200",
              "admin-groups": {
                "exclude-admin-groups": "blue"
              },
              "metric-type": {
                "_xmlns:iana-metric-types": "urn:ietf:params:xml:ns:\
                yang:iana-igp-metric-types",
                "__text": "iana-metric-types:igp-metric"
              },
              "calc-type": {
                "_xmlns:iana-algo-types": "urn:ietf:params:xml:ns:\
                yang:iana-igp-algo-types",
                "__text": "iana-algo-types:algo-spf"
              },
              "prefix-metric": "",
              "priority": "100"
            },
            "_xmlns": "urn:ietf:params:xml:ns:yang:\
            ietf-ospf-flex-algo"
          },
          "_xmlns": "urn:ietf:params:xml:ns:yang:ietf-ospf"
        }
      }
    },
    "_xmlns": "urn:ietf:params:xml:ns:yang:ietf-routing"
  }
}
      ]]></artwork>
    </section>
  </back>
</rfc>
