<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE rfc [
<!ENTITY nbsp    "&#160;">
<!ENTITY zwsp   "&#8203;">
<!ENTITY nbhy   "&#8209;">
<!ENTITY wj     "&#8288;">
]>
<?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-ospf-sr-yang-31"
ipr="trust200902" obsoletes="" updates="" submissionType="IETF" xml:lang="en" tocInclude="true"
symRefs="true" sortRefs="true" consensus="true" version="3">
<!-- xml2rfc v2v3 conversion 3.16.0 -->
<!-- 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 SR MPLS YANG" >
    A YANG Data Model for OSPF Segment Routing for the MPLS Data Plane
  </title>
  <seriesInfo name="Internet-Draft" value="draft-ietf-ospf-sr-yang-31"/>
  <!-- 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>
        <street>2330 Central Expressway</street>
        <!-- Reorder these if your country does things differently -->

        <city>Santa Clara</city>
        <region>CA</region>
        <code>95050</code>
        <country>USA</country>
      </postal>
      <phone/>
      <email>yingzhen.ietf@gmail.com</email>
      <!-- uri and facsimile elements may also be added -->
    </address>
  </author>
  <author fullname="Acee Lindem" initials="A." surname="Lindem">
    <organization>LabN Consulting, L.L.C.</organization>
    <address>
      <postal>
        <street>301 Midenhall Way</street>
        <city>Cary, NC 27513</city>
      </postal>
      <email>acee.ietf@gmail.com</email>
    </address>
  </author>
  <author fullname="Jeffrey Zhang" initials="J" surname="Zhang">
    <organization>Juniper Networks</organization>
    <address>
      <postal>
        <street>10 Technology Park Drive</street>
        <!-- Reorder these if your country does things differently -->

        <city>Westford</city>
        <region>MA</region>
        <code>01886</code>
        <country>USA</country>
      </postal>
      <phone/>
      <email>zzhang@juniper.net</email>
      <!-- uri and facsimile elements may also be added -->
    </address>
  </author>
  <author fullname="Ing-Wher Chen" initials="I." surname="Chen">
    <organization>The MITRE Corporation</organization>
    <address>
      <email>ingwherchen@mitre.org</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 module that can be
    used to configure and manage OSPF Extensions for Segment Routing for the MPLS data plane.
    </t>
  </abstract>
</front>
<middle>
  <section numbered="true" toc="default">
    <name>Overview</name>
    <t>
      This document defines a YANG data model <xref target="RFC7950" format="default"/> that can be used
      to configure and manage OSPFv2 extensions for Segment Routing <xref target="RFC8665" format="default"/>
      and OSPFv3 extensions for Segment Routing <xref target="RFC8666" format="default"/>
      for the MPLS data plane.
      It is an augmentation to the OSPF YANG data model <xref target="RFC9129" format="default"/>.
    </t>
    <t>
      The YANG module in this document conforms to the Network Management
      Datastore Architecture (NMDA) <xref target="RFC8342" format="default"/>.
    </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" format="default"/> <xref target="RFC8174" format="default"/>
        when, and only when, they appear in all capitals, as shown here.
     </t>
    </section>
    <section numbered="true" toc="default">
      <name>Tree Diagrams</name>
      <t>This document uses the graphical representation of data models
      defined in <xref target="RFC8340" format="default"/>.</t>
    </section>
  </section>
  <section numbered="true" toc="default">
    <name>OSPF Segment Routing</name>
    <t>
      This document defines a model for OSPF Segment Routing Extensions
      for both OSPFv2 <xref target="RFC8665" format="default"/> and
      OSPFv3 <xref target="RFC8666" format="default"/>. It is an
      augmentation of the OSPF base model.
    </t>
    <t>
      The OSPF SR YANG module requires support for the base segment
      routing module <xref target="RFC9020" format="default"/>,
      which defines the global segment routing configuration independent
      of any specific routing protocol configuration, and support of OSPF base
      model <xref target="RFC9129" format="default"/> which defines basic
      OSPF configuration and state.
    </t>
    <artwork align="left" name="" type="" alt=""><![CDATA[
module: ietf-ospf-sr-mpls

  augment /rt:routing/rt:control-plane-protocols
            /rt:control-plane-protocol/ospf:ospf:
    +--rw segment-routing
    |  +--rw enabled?    boolean
    |  +--rw bindings {mapping-server}?
    |     +--rw advertise
    |     |  +--rw policies*   leafref
    |     +--rw receive?     boolean
    +--rw protocol-srgb {sr-mpls:protocol-srgb}?
       +--rw srgb* [lower-bound upper-bound]
          +--rw lower-bound    uint32
          +--rw upper-bound    uint32
  augment /rt:routing/rt:control-plane-protocols
            /rt:control-plane-protocol/ospf:ospf/ospf:areas
            /ospf:area/ospf:interfaces/ospf:interface:
    +--rw segment-routing
       +--rw adjacency-sid
          +--rw adj-sids* [value]
          |  +--rw value-type?    enumeration
          |  +--rw value          uint32
          |  +--rw protected?     boolean
          |  +--rw weight?        uint8
          |  +--rw neighbor-id    inet:ip-address
          +--rw advertise-adj-group-sid* [group-id]
          |  +--rw group-id    uint32
          +--rw advertise-protection?      enumeration
  augment /rt:routing/rt:control-plane-protocols
            /rt:control-plane-protocol/ospf:ospf/ospf:areas
            /ospf:area/ospf:interfaces/ospf:interface
            /ospf:fast-reroute/ospf:lfa:
    +--rw ti-lfa {ti-lfa}?
       +--rw enabled?                  boolean
       +--rw selection-tie-breakers
          +--rw node-protection!
          |  +--rw priority?   uint8
          +--rw srlg-disjoint!
             +--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:fast-reroute/ospf:lfa/ospf:remote-lfa:
    +--rw use-segment-routing-path?   boolean {remote-lfa-sr}?
  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:
    +--ro extended-prefix-range-tlvs
       +--ro extended-prefix-range-tlv* []
          +--ro prefix-length?                 uint8
          +--ro af?
          |       iana-rt-types:address-family
          +--ro range-size?                    uint16
          +--ro extended-prefix-range-flags
          |  +--ro flags*   identityref
          +--ro prefix?                        inet:ipv4-prefix
          +--ro prefix-sid-sub-tlvs
          |  +--ro prefix-sid-sub-tlv* []
          |     +--ro prefix-sid-flags
          |     |  +--ro flags*   identityref
          |     +--ro mt-id?              uint8
          |     +--ro algorithm?          identityref
          |     +--ro sid?                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:extended-prefix-opaque:
    +--ro extended-prefix-range-tlvs
       +--ro extended-prefix-range-tlv* []
          +--ro prefix-length?                 uint8
          +--ro af?
          |       iana-rt-types:address-family
          +--ro range-size?                    uint16
          +--ro extended-prefix-range-flags
          |  +--ro flags*   identityref
          +--ro prefix?                        inet:ipv4-prefix
          +--ro prefix-sid-sub-tlvs
          |  +--ro prefix-sid-sub-tlv* []
          |     +--ro prefix-sid-flags
          |     |  +--ro flags*   identityref
          |     +--ro mt-id?              uint8
          |     +--ro algorithm?          identityref
          |     +--ro sid?                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:extended-prefix-opaque:
    +--ro extended-prefix-range-tlvs
       +--ro extended-prefix-range-tlv* []
          +--ro prefix-length?                 uint8
          +--ro af?
          |       iana-rt-types:address-family
          +--ro range-size?                    uint16
          +--ro extended-prefix-range-flags
          |  +--ro flags*   identityref
          +--ro prefix?                        inet:ipv4-prefix
          +--ro prefix-sid-sub-tlvs
          |  +--ro prefix-sid-sub-tlv* []
          |     +--ro prefix-sid-flags
          |     |  +--ro flags*   identityref
          |     +--ro mt-id?              uint8
          |     +--ro algorithm?          identityref
          |     +--ro sid?                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 prefix-sid-sub-tlvs
       +--ro prefix-sid-sub-tlv* []
          +--ro prefix-sid-flags
          |  +--ro flags*   identityref
          +--ro mt-id?              uint8
          +--ro algorithm?          identityref
          +--ro sid?                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 prefix-sid-sub-tlvs
       +--ro prefix-sid-sub-tlv* []
          +--ro prefix-sid-flags
          |  +--ro flags*   identityref
          +--ro mt-id?              uint8
          +--ro algorithm?          identityref
          +--ro sid?                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 prefix-sid-sub-tlvs
       +--ro prefix-sid-sub-tlv* []
          +--ro prefix-sid-flags
          |  +--ro flags*   identityref
          +--ro mt-id?              uint8
          +--ro algorithm?          identityref
          +--ro sid?                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-link-opaque/ospf:extended-link-tlv:
    +--ro adj-sid-sub-tlvs
    |  +--ro adj-sid-sub-tlv* []
    |     +--ro adj-sid-flags
    |     |  +--ro flags*   identityref
    |     +--ro mt-id?           uint8
    |     +--ro weight?          uint8
    |     +--ro sid?             uint32
    +--ro lan-adj-sid-sub-tlvs
       +--ro lan-adj-sid-sub-tlv* []
          +--ro lan-adj-sid-flags
          |  +--ro flags*   identityref
          +--ro mt-id?                uint8
          +--ro weight?               uint8
          +--ro neighbor-router-id?   rt-types:router-id
          +--ro sid?                  uint32
  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 sr-algorithm-tlv
    |  +--ro sr-algorithm*   identityref
    +--ro sid-range-tlvs
    |  +--ro sid-range-tlv* []
    |     +--ro range-size?    rt-types:uint24
    |     +--ro sid-sub-tlv
    |        +--ro length?   uint16
    |        +--ro sid?      uint32
    +--ro local-block-tlvs
    |  +--ro local-block-tlv* []
    |     +--ro range-size?    rt-types:uint24
    |     +--ro sid-sub-tlv
    |        +--ro length?   uint16
    |        +--ro sid?      uint32
    +--ro srms-preference-tlv
       +--ro preference?   uint8
  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 sr-algorithm-tlv
    |  +--ro sr-algorithm*   identityref
    +--ro sid-range-tlvs
    |  +--ro sid-range-tlv* []
    |     +--ro range-size?    rt-types:uint24
    |     +--ro sid-sub-tlv
    |        +--ro length?   uint16
    |        +--ro sid?      uint32
    +--ro local-block-tlvs
    |  +--ro local-block-tlv* []
    |     +--ro range-size?    rt-types:uint24
    |     +--ro sid-sub-tlv
    |        +--ro length?   uint16
    |        +--ro sid?      uint32
    +--ro srms-preference-tlv
       +--ro preference?   uint8
  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 sr-algorithm-tlv
    |  +--ro sr-algorithm*   identityref
    +--ro sid-range-tlvs
    |  +--ro sid-range-tlv* []
    |     +--ro range-size?    rt-types:uint24
    |     +--ro sid-sub-tlv
    |        +--ro length?   uint16
    |        +--ro sid?      uint32
    +--ro local-block-tlvs
    |  +--ro local-block-tlv* []
    |     +--ro range-size?    rt-types:uint24
    |     +--ro sid-sub-tlv
    |        +--ro length?   uint16
    |        +--ro sid?      uint32
    +--ro srms-preference-tlv
       +--ro preference?   uint8
  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 sr-algorithm-tlv
    |  +--ro sr-algorithm*   identityref
    +--ro sid-range-tlvs
    |  +--ro sid-range-tlv* []
    |     +--ro range-size?    rt-types:uint24
    |     +--ro sid-sub-tlv
    |        +--ro length?   uint16
    |        +--ro sid?      uint32
    +--ro local-block-tlvs
    |  +--ro local-block-tlv* []
    |     +--ro range-size?    rt-types:uint24
    |     +--ro sid-sub-tlv
    |        +--ro length?   uint16
    |        +--ro sid?      uint32
    +--ro srms-preference-tlv
       +--ro preference?   uint8
  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 sr-algorithm-tlv
    |  +--ro sr-algorithm*   identityref
    +--ro sid-range-tlvs
    |  +--ro sid-range-tlv* []
    |     +--ro range-size?    rt-types:uint24
    |     +--ro sid-sub-tlv
    |        +--ro length?   uint16
    |        +--ro sid?      uint32
    +--ro local-block-tlvs
    |  +--ro local-block-tlv* []
    |     +--ro range-size?    rt-types:uint24
    |     +--ro sid-sub-tlv
    |        +--ro length?   uint16
    |        +--ro sid?      uint32
    +--ro srms-preference-tlv
       +--ro preference?   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:ospfv3/ospf:ospfv3/ospf:body
            /ospf:router-information:
    +--ro sr-algorithm-tlv
    |  +--ro sr-algorithm*   identityref
    +--ro sid-range-tlvs
    |  +--ro sid-range-tlv* []
    |     +--ro range-size?    rt-types:uint24
    |     +--ro sid-sub-tlv
    |        +--ro length?   uint16
    |        +--ro sid?      uint32
    +--ro local-block-tlvs
    |  +--ro local-block-tlv* []
    |     +--ro range-size?    rt-types:uint24
    |     +--ro sid-sub-tlv
    |        +--ro length?   uint16
    |        +--ro sid?      uint32
    +--ro srms-preference-tlv
       +--ro preference?   uint8
  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-intra-area-prefix:
    +--ro ospfv3-extended-prefix-range-tlvs
       +--ro extended-prefix-range-tlv* []
          +--ro prefix-length?         uint8
          +--ro af?
          |       iana-rt-types:address-family
          +--ro range-size?            uint16
          +--ro prefix?                inet:ip-prefix
          +--ro prefix-sid-sub-tlvs
          |  +--ro prefix-sid-sub-tlv* []
          |     +--ro ospfv3-prefix-sid-flags
          |     |  +--ro flags*   identityref
          |     +--ro algorithm?                 identityref
          |     +--ro sid?                       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
            /ospfv3-e-lsa:e-inter-area-prefix:
    +--ro ospfv3-extended-prefix-range-tlvs
       +--ro extended-prefix-range-tlv* []
          +--ro prefix-length?         uint8
          +--ro af?
          |       iana-rt-types:address-family
          +--ro range-size?            uint16
          +--ro prefix?                inet:ip-prefix
          +--ro prefix-sid-sub-tlvs
          |  +--ro prefix-sid-sub-tlv* []
          |     +--ro ospfv3-prefix-sid-flags
          |     |  +--ro flags*   identityref
          |     +--ro algorithm?                 identityref
          |     +--ro sid?                       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/ospfv3-e-lsa:e-as-external:
    +--ro ospfv3-extended-prefix-range-tlvs
       +--ro extended-prefix-range-tlv* []
          +--ro prefix-length?         uint8
          +--ro af?
          |       iana-rt-types:address-family
          +--ro range-size?            uint16
          +--ro prefix?                inet:ip-prefix
          +--ro prefix-sid-sub-tlvs
          |  +--ro prefix-sid-sub-tlv* []
          |     +--ro ospfv3-prefix-sid-flags
          |     |  +--ro flags*   identityref
          |     +--ro algorithm?                 identityref
          |     +--ro sid?                       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
            /ospfv3-e-lsa:e-nssa:
    +--ro ospfv3-extended-prefix-range-tlvs
       +--ro extended-prefix-range-tlv* []
          +--ro prefix-length?         uint8
          +--ro af?
          |       iana-rt-types:address-family
          +--ro range-size?            uint16
          +--ro prefix?                inet:ip-prefix
          +--ro prefix-sid-sub-tlvs
          |  +--ro prefix-sid-sub-tlv* []
          |     +--ro ospfv3-prefix-sid-flags
          |     |  +--ro flags*   identityref
          |     +--ro algorithm?                 identityref
          |     +--ro sid?                       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/ospfv3-e-lsa:e-link
            /ospfv3-e-lsa:e-link-tlvs
            /ospfv3-e-lsa:intra-prefix-tlv/ospfv3-e-lsa:sub-tlvs:
    +--ro prefix-sid-sub-tlvs
       +--ro prefix-sid-sub-tlv* []
          +--ro ospfv3-prefix-sid-flags
          |  +--ro flags*   identityref
          +--ro algorithm?                 identityref
          +--ro sid?                       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-intra-area-prefix
            /ospfv3-e-lsa:e-intra-prefix-tlvs
            /ospfv3-e-lsa:intra-prefix-tlv/ospfv3-e-lsa:sub-tlvs:
    +--ro prefix-sid-sub-tlvs
       +--ro prefix-sid-sub-tlv* []
          +--ro ospfv3-prefix-sid-flags
          |  +--ro flags*   identityref
          +--ro algorithm?                 identityref
          +--ro sid?                       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/ospfv3-e-lsa:sub-tlvs:
    +--ro prefix-sid-sub-tlvs
       +--ro prefix-sid-sub-tlv* []
          +--ro ospfv3-prefix-sid-flags
          |  +--ro flags*   identityref
          +--ro algorithm?                 identityref
          +--ro sid?                       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
            /ospfv3-e-lsa:sub-tlvs:
    +--ro prefix-sid-sub-tlvs
       +--ro prefix-sid-sub-tlv* []
          +--ro ospfv3-prefix-sid-flags
          |  +--ro flags*   identityref
          +--ro algorithm?                 identityref
          +--ro sid?                       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-nssa
            /ospfv3-e-lsa:e-external-tlvs
            /ospfv3-e-lsa:external-prefix-tlv
            /ospfv3-e-lsa:sub-tlvs:
    +--ro prefix-sid-sub-tlvs
       +--ro prefix-sid-sub-tlv* []
          +--ro ospfv3-prefix-sid-flags
          |  +--ro flags*   identityref
          +--ro algorithm?                 identityref
          +--ro sid?                       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-router/ospfv3-e-lsa:e-router-tlvs
            /ospfv3-e-lsa:link-tlv/ospfv3-e-lsa:sub-tlvs:
    +--ro adj-sid-sub-tlvs
    |  +--ro adj-sid-sub-tlv* []
    |     +--ro adj-sid-flags
    |     |  +--ro flags*   identityref
    |     +--ro weight?          uint8
    |     +--ro sid?             uint32
    +--ro lan-adj-sid-sub-tlvs
       +--ro lan-adj-sid-sub-tlv* []
          +--ro lan-adj-sid-flags
          |  +--ro flags*   identityref
          +--ro weight?               uint8
          +--ro neighbor-router-id?   rt-types:router-id
          +--ro sid?                  uint32
    ]]></artwork>
    
<section numbered="true" toc="default">
  <name>OSPF Segment Routing YANG Module</name>
  <t>
    <xref target="RFC2328"/>, <xref target="RFC4750"/>, <xref target="RFC4915"/>,
    <xref target="RFC5340"/>,
    <xref target="RFC5643"/>, <xref target="RFC5838"/>, <xref target="RFC6991"/>,
    <xref target="RFC8102"/>, <xref target="RFC8294"/>, <xref target="RFC8343"/>,
    <xref target="RFC8476"/>, <xref target="RFC8349"/>, <xref target="RFC9587"/>, and
    <xref target="I-D.ietf-rtgwg-segment-routing-ti-lfa" format="default"/>
    are referenced in the YANG data model.
  </t>
  <figure>
    <artwork><![CDATA[
<CODE BEGINS> file "ietf-ospf-sr-mpls@2024-06-19.yang"
module ietf-ospf-sr-mpls {
  yang-version 1.1;
  namespace "urn:ietf:params:xml:ns:yang:ietf-ospf-sr-mpls";
  prefix ospf-sr-mpls;

  import ietf-inet-types {
    prefix inet;
    reference
      "RFC 6991 - Common YANG Data Types";
  }
  import ietf-routing-types {
    prefix rt-types;
    reference
      "RFC 8294 - Common YANG Data Types for the Routing Area";
  }
  import iana-routing-types {
    prefix iana-rt-types;
    reference
      "RFC 8294 - Common YANG Data Types for the Routing Area";
  }
  import ietf-routing {
    prefix rt;
    reference
      "RFC 8349 - A YANG Data Model for Routing
                  Management (NMDA Version)";
  }
  import ietf-segment-routing-common {
    prefix sr-cmn;
    reference
      "RFC 9020 - YANG Data Model for Segment Routing";
  }
  import ietf-segment-routing-mpls {
    prefix sr-mpls;
    reference
      "RFC 9020 - YANG Data Model for Segment Routing";
  }
  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 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>
     Author:   Derek Yeung
               <mailto:derek@arrcus.com>
     Author:   Jeffrey Zhang
               <mailto:zzhang@juniper.net>
     Author:   Ing-Wher Chen
               <mailto:ingwherchen@mitre.org>";
  description
    "This YANG module defines the generic configuration
     and operational state for OSPF Segment Routing (SR), which
     is common across all of the vendor implementations. It is
     intended that the module will be extended by vendors to
     define vendor-specific OSPF Segment Routing configuration
     and operational parameters for the MPLS data plane.

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

     Copyright (c) 2023 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
     (https://www.rfc-editor.org/info/rfcXXXX); 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.

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

  revision 2024-06-19 {
    description
      "Initial revision.";
    reference
      "RFC XXXX: A YANG Data Model for OSPF Segment Routing for
       the MPLS Data Plane";
  }

  feature remote-lfa-sr {
    description
      "Enhance rLFA to use SR path.";
    reference
      "RFC 8102: Remote-LFA Node Protection and Manageability";
  }

  feature ti-lfa {
    description
      "Topology-Independent Loop-Free Alternate (TI-LFA)
       computation using segment routing.";
    reference
      "draft-ietf-rtgwg-segment-routing-ti-lfa -
       Topology-Independent Fast Reroute using Segment Routing";
  }

  identity prefix-sid-flag {
    description
      "Base identity for prefix SID sub-TLV flags.";
    reference
      "RFC 8665: OSPF Extensions for Segment Routing
       RFC 8666: OSPFv3 Extensions for Segment Routing";
  }

  identity np-flag {
    base prefix-sid-flag;
    description
      "No-PHP flag.";
  }

  identity m-flag {
    base prefix-sid-flag;
    description
      "Mapping server flag.";
  }

  identity e-flag {
    base prefix-sid-flag;
    description
      "Explicit-NULL flag.";
  }

  identity v-flag {
    base prefix-sid-flag;
    description
      "Value/Index flag.";
  }

  identity l-flag {
    base prefix-sid-flag;
    description
      "Local flag.";
  }

  identity extended-prefix-range-flag {
    description
      "Base identity for extended prefix range TLV flags.";
  }

  identity ia-flag {
    base extended-prefix-range-flag;
    description
      "Inter-Area flag. If set, advertisement is of
       inter-area type.";
    reference
      "RFC 8665: OSPF Extensions for Segment Routing";
  }

  identity adj-sid-flag {
    description
      "Base identity for Adj-SID sub-TLV flags.";
    reference
      "RFC 8665: OSPF Extensions for Segment Routing
       RFC 8666: OSPFv3 Extensions for Segment Routing";
  }

  identity b-flag {
    base adj-sid-flag;
    description
      "Backup flag.";
  }

  identity vi-flag {
    base adj-sid-flag;
    description
      "Value/Index flag.";
  }

  identity lo-flag {
    base adj-sid-flag;
    description
      "Local/Global flag.";
  }

  identity g-flag {
    base adj-sid-flag;
    description
      "Group flag.";
  }

  identity p-flag {
    base adj-sid-flag;
    description
      "Persistent flag.";
  }

  /* Groupings */

  grouping sid-sub-tlv {
    description
      "SID/Label sub-TLV grouping.";
    reference
      "RFC 8665: OSPF Extensions for Segment Routing
       (Section 6)";
    container sid-sub-tlv {
      description
        "Used to advertise the SID/Label associated with a
         prefix or adjacency.";
      leaf length {
        type uint16;
        description
          "Length of the SID value. YANG model specification
           is necessary since it dictates the semantics of the
           SID.";
      }
      leaf sid {
        type uint32;
        description
          "Segment Identifier (SID) - A 20 bit label or
           32 bit SID. If the length is set to 3, then the
           20 rightmost bits represent a label.  If the length
           is set to 4, then the value represents a 32-bit SID.";
      }
    }
  }

  grouping ospfv2-prefix-sid-sub-tlvs {
    description
      "Prefix Segment ID (SID) sub-TLVs.";
    reference
      "RFC 8665: OSPF Extensions for Segment Routing
        (Section 5)";
    container prefix-sid-sub-tlvs {
      description
        "Prefix SID sub-TLV.";
      list prefix-sid-sub-tlv {
        description
          "Prefix SID sub-TLV.";
        container prefix-sid-flags {
          leaf-list flags {
            type identityref {
              base prefix-sid-flag;
            }
            description
              "Prefix SID Sub-TLV flags.";
          }
          description
            "Segment Identifier (SID) Flags.";
        }
        leaf mt-id {
          type uint8;
          description
            "Multi-topology ID. Topologies range from 0-127 and
             return of any other value would indicate an error.";
          reference
            "RFC 4915 - Multi-Topology (MT) Routing in OSPF";
        }
        leaf algorithm {
          type identityref {
            base sr-cmn:prefix-sid-algorithm;
          }
          description
            "Algorithm associated with the prefix-SID.";
        }
        leaf sid {
          type uint32;
          description
            "Segment Identifier (SID) - A 20 bit label or
             an index into the SID/Label space.

             If the  V-Flag is set to 0 and L-Flag is set to 0:
             The SID/Index/Label field is a 4-octet index defining
             the offset in the SID/Label space advertised by this
             router.

             If V-Flag is set to 1 and L-Flag is set to 1: The
             SID/Index/Label field is a 3-octet local label where
             the 20 rightmost bits are used for encoding the label
             value.";
        }
      }
    }
  }

  grouping ospfv2-extended-prefix-range-tlvs {
    description
      "Extended prefix range TLV grouping.";
    reference
      "RFC 8665: OSPF Extensions for Segment Routing
       (Section 4)";
    container extended-prefix-range-tlvs {
      description
        "List of range of prefixes.";
      list extended-prefix-range-tlv {
        description
          "Range of prefixes.";
        leaf prefix-length {
          type uint8;
          description
            "Length of prefix in bits.";
        }
        leaf af {
          type iana-rt-types:address-family;
          description
            "Address family for the prefix.";
        }
        leaf range-size {
          type uint16;
          description
            "Number of prefixes covered by the
             advertisement.";
        }
        container extended-prefix-range-flags {
          leaf-list flags {
            type identityref {
              base extended-prefix-range-flag;
            }
            description
              "Extended prefix range TLV flags.";
          }
          description
            "Extended Prefix Range TLV flags.";
        }
        leaf prefix {
          type inet:ipv4-prefix;
          description
            "IPv4 prefix.";
        }
        uses ospfv2-prefix-sid-sub-tlvs;
        uses ospf:unknown-tlvs;
      }
    }
  }

  grouping sr-algorithm-tlv {
    description
      "SR algorithm TLV grouping.";
    reference
      "RFC 8665: OSPF Extensions for Segment Routing
       (Section 3.1)";
    container sr-algorithm-tlv {
      description
        "All SR algorithm TLVs.";
      leaf-list sr-algorithm {
        type identityref {
          base sr-cmn:prefix-sid-algorithm;
        }
        description
          "Segment Routing (SR) algorithms that the router is
           currently using.";
      }
    }
  }

  grouping sid-range-tlvs {
    description
      "SID Range TLV grouping.";
    reference
      "RFC 8665: OSPF Extensions for Segment Routing
       (Section 3.2)";
    container sid-range-tlvs {
      description
        "List of SID range TLVs.";
      list sid-range-tlv {
        description
          "SID range TLV.";
        leaf range-size {
          type rt-types:uint24;
          description
            "SID range.";
        }
        uses sid-sub-tlv;
      }
    }
  }

  grouping local-block-tlvs {
    description
      "The SR local block TLV contains the
       range of labels reserved for local SIDs.";
    reference
      "RFC 8665: OSPF Extensions for Segment Routing
       (Section 3.3)";
    container local-block-tlvs {
      description
        "List of SRLB TLVs.";
      list local-block-tlv {
        description
          "SRLB TLV.";
        leaf range-size {
          type rt-types:uint24;
          description
            "SID range. The return of a zero value would indicate
             an error.";
        }
        uses sid-sub-tlv;
      }
    }
  }

  grouping srms-preference-tlv {
    description
      "The SR Mapping Server (SRMS) preference TLV is
       used to advertise a preference associated with
       the node that acts as an SR Mapping Server. SR
       Mapping Server advertisements with a higher
       preference value are preferred over those with
       a lower preference value.";
    reference
      "RFC 8665: OSPF Extensions for Segment Routing
       (Section 3.4)";
    container srms-preference-tlv {
      description
        "SRMS Preference TLV.";
      leaf preference {
        type uint8;
        description
          "SRMS preference TLV, value from 0 to 255 with
           255 being the most preferred.";
      }
    }
  }

  grouping ospfv3-prefix-sid-sub-tlvs {
    description
      "Prefix Segment ID (SID) sub-TLVs.";
    reference
      "RFC 8666: OSPFv3 Extensions for Segment Routing
       (Section 6)";
    container prefix-sid-sub-tlvs {
      description
        "Prefix SID sub-TLV.";
      list prefix-sid-sub-tlv {
        description
          "Prefix SID sub-TLV.";
        container ospfv3-prefix-sid-flags {
          leaf-list flags {
            type identityref {
              base prefix-sid-flag;
            }
            description
              "Prefix SID sub-TLV flags.";
          }
          description
            "Segment Identifier (SID) Flags.";
        }
        leaf algorithm {
          type identityref {
            base sr-cmn:prefix-sid-algorithm;
          }
          description
            "Algorithm associated with the prefix-SID.";
        }
        leaf sid {
          type uint32;
          description
            "Segment Identifier (SID) - A 20 bit label or
             an index into the SID/Label space.

             If the  V-Flag is set to 0 and L-Flag is set to 0:
             The SID/Index/Label field is a 4-octet index defining
             the offset in the SID/Label space advertised by this
             router.

             If V-Flag is set to 1 and L-Flag is set to 1: The
             SID/Index/Label field is a 3-octet local label where
             the 20 rightmost bits are used for encoding the label
             value.";
        }
      }
    }
  }

  grouping ospfv3-extended-prefix-range-tlvs {
    description
      "Extended prefix range TLV grouping.";
    reference
      "RFC 8666: OSPFv3 Extensions for Segment Routing
       (Section 5)";
    container ospfv3-extended-prefix-range-tlvs {
      description
        "List of extended prefix range TLVs.";
      list extended-prefix-range-tlv {
        description
          "Range of prefixes.";
        leaf prefix-length {
          type uint8;
          description
            "Length of prefix in bits.";
        }
        leaf af {
          type iana-rt-types:address-family;
          description
            "Address family for the prefix.";
        }
        leaf range-size {
          type uint16;
          description
            "Number of prefixes covered by the advertisement.
             The return of a value of zero would indicate an error.";
        }
        leaf prefix {
          type inet:ip-prefix;
          description
            "IPv4 or IPv6 prefix.";
        }
        uses ospfv3-prefix-sid-sub-tlvs;
        uses ospf:unknown-tlvs;
      }
    }
  }

  grouping ospfv3-adj-sid-sub-tlvs {
    description
      "Adj-SID sub-TLV grouping.";
    reference
      "RFC 8666: OSPFv3 Extensions for Segment Routing
       (Section 7)";
    container adj-sid-sub-tlvs {
      description
        "Adj-SID optional sub-TLVs.";
      list adj-sid-sub-tlv {
        description
          "List of Adj-SID sub-TLVs.";
        container adj-sid-flags {
          leaf-list flags {
            type identityref {
              base adj-sid-flag;
            }
            description
              "Adj-SID sub-tlv flags.";
          }
          description
            "Adj-sid sub-tlv flags.";
        }
        leaf weight {
          type uint8;
          description
            "Weight used for load-balancing.";
        }
        leaf sid {
          type uint32;
          description
            "Segment Identifier (SID) - A 20 bit label or
             an index into the SID/Label space.

             If the  V-Flag is set to 0 and L-Flag is set to 0:
             The SID/Index/Label field is a 4-octet index defining
             the offset in the SID/Label space advertised by this
             router.

             If V-Flag is set to 1 and L-Flag is set to 1: The
             SID/Index/Label field is a 3-octet local label where
             the 20 rightmost bits are used for encoding the label
             value.";
        }
      }
    }
  }

  grouping ospfv3-lan-adj-sid-sub-tlvs {
    description
      "LAN Adj-SID sub-TLV grouping.";
    reference
      "RFC 8666: OSPFv3 Extensions for Segment Routing
       (Section 7)";
    container lan-adj-sid-sub-tlvs {
      description
        "LAN Adj-SID optional sub-TLVs.";
      list lan-adj-sid-sub-tlv {
        description
          "List of LAN Adj-SID sub-TLVs.";
        container lan-adj-sid-flags {
          leaf-list flags {
            type identityref {
              base adj-sid-flag;
            }
            description
              "LAN Adj-SID sub-TLV flags.";
          }
          description
            "LAN Adj-SID sub-TLV flags.";
        }
        leaf weight {
          type uint8;
          description
            "Weight used for load-balancing.";
        }
        leaf neighbor-router-id {
          type rt-types:router-id;
          description
            "Neighbor router ID.";
        }
        leaf sid {
          type uint32;
          description
            "Segment Identifier (SID) - A 20 bit label or
             an index into the SID/Label space.

             If the  V-Flag is set to 0 and L-Flag is set to 0:
             The SID/Index/Label field is a 4-octet index defining
             the offset in the SID/Label space advertised by this
             router.

             If V-Flag is set to 1 and L-Flag is set to 1: The
             SID/Index/Label field is a 3-octet local label where
             the 20 rightmost bits are used for encoding the label
             value.";
        }
      }
    }
  }

  /* Configuration */

  augment "/rt:routing/rt:control-plane-protocols"
        + "/rt:control-plane-protocol/ospf:ospf" {
    when "derived-from(/rt:routing/rt:control-plane-protocols/"
       + "rt:control-plane-protocol/rt:type, 'ospf:ospf')" {
      description
        "This augments the OSPF routing protocol when used.";
    }
    description
      "This augments the OSPF protocol configuration
       with segment routing for the MPLS data plane.";
    uses sr-mpls:sr-control-plane;
    container protocol-srgb {
      if-feature "sr-mpls:protocol-srgb";
      uses sr-cmn:srgb;
      description
        "Per-protocol SRGB.";
    }
  }

  augment "/rt:routing/rt:control-plane-protocols/"
        + "rt:control-plane-protocol/ospf:ospf/"
        + "ospf:areas/ospf:area/ospf:interfaces/ospf:interface" {
    when "derived-from(/rt:routing/rt:control-plane-protocols/"
       + "rt:control-plane-protocol/rt:type, 'ospf:ospf')" {
      description
        "This augments the OSPF interface configuration
         when used.";
    }
    description
      "This augments the OSPF protocol interface
       configuration with segment routing.";
    uses sr-mpls:igp-interface {
      augment "segment-routing/adjacency-sid/adj-sids" {
        when "((../../../ospf:interface-type = 'broadcast') or
              (../../../ospf:interface-type = 'non-broadcast'))" {
          description
            "This augments broadcast and non-broadcast multi-access
             interface.";
        }
        description
          "This augments LAN interface adj-sid with neighbor-id.";
        leaf neighbor-id {
          type inet:ip-address;
          mandatory true;
          description
            "Neighbor's Router ID, IPv4 address, or IPv6 address.
             Specification is optional and, if specified, SHOULD
             specify a neighbor reachable via the interface.";
        }
      }
    }
  }

  augment "/rt:routing/rt:control-plane-protocols/"
        + "rt:control-plane-protocol/ospf:ospf/"
        + "ospf:areas/ospf:area/ospf:interfaces/ospf:interface/"
        + "ospf:fast-reroute/ospf:lfa" {
    when "derived-from(/rt:routing/rt:control-plane-protocols/"
       + "rt:control-plane-protocol/rt:type, 'ospf:ospf')" {
      description
        "This augments the OSPF routing protocol when used.";
    }
    description
      "This augments the OSPF protocol IP-FRR with TI-LFA.";
    container ti-lfa {
      if-feature "ti-lfa";
      leaf enabled {
        type boolean;
        default "false";
        description
          "Enable TI-LFA computation.";
      }
      container selection-tie-breakers {
        container node-protection {
          presence "Presence of container enables the node
                    protection tie-breaker.";
          leaf priority {
            type uint8;
            default "128";
            description
              "Priority for node protection tie-breaker with
               a lower priority being more preferred.";
          }
          description
            "Enable node protection as a TI-LFA path
             selection tie-breaker. A path providing node
             protection will be selected over one that
             doesn't provide node protection.";
        }
        container srlg-disjoint {
          presence "Presence of container enables the SRLG
                    disjoint tie-breaker";
          leaf priority {
            type uint8;
            default "128";
            description
              "Priority for SRLG disjoint tie-breaker with
               a lower priority being more preferred.";
          }
          description
            "Enable SRLG (Shared Resource Link Group)
             disjoint  as a TI-LFA path selection tie-breaker.
             A path providing node a disjoint path for SRLG
             links from the primary path will be selected over
             one that doesn't provide an SRLG disjoint path.";
        }
        description
          "Configure path selection tie-breakers and their
           respective priorities for the TI-LFA computation.
           multiple tie-breakers and priorities configured may
           be configured.";
      }
      description
        "Topology-Independent Loop Free Alternate
         (TI-LFA) support.";
      reference
        "draft-ietf-rtgwg-segment-routing-ti-lfa -
         Topology-Independent Fast Reroute using Segment Routing";
    }
  }

  augment "/rt:routing/rt:control-plane-protocols/"
        + "rt:control-plane-protocol/ospf:ospf/"
        + "ospf:areas/ospf:area/ospf:interfaces/ospf:interface/"
        + "ospf:fast-reroute/ospf:lfa/ospf:remote-lfa" {
    when "derived-from(/rt:routing/rt:control-plane-protocols/"
       + "rt:control-plane-protocol/rt:type, 'ospf:ospf')" {
      description
        "This augments the OSPF routing protocol when used.";
    }
    description
      "This augments the OSPF protocol IP-FRR with remote LFA.";
    leaf use-segment-routing-path {
      if-feature "remote-lfa-sr";
      type boolean;
      default "false";
      description
        "Force remote LFA to use segment routing path instead of LDP
         path. The value of this leaf is in effect only when
         remote-lfa is enabled.";
    }
  }

  /* 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:extended-prefix-opaque" {
    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
      "SR-specific TLVs for OSPFv2 extended prefix LSA
       in type 9 opaque LSA.";
    uses ospfv2-extended-prefix-range-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" {
    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
      "SR-specific TLVs for OSPFv2 extended prefix LSA
       in type 10 opaque LSA.";
    uses ospfv2-extended-prefix-range-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" {
    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
      "SR-specific TLVs for OSPFv2 extended prefix LSA
       in type 11 opaque LSA.";
    uses ospfv2-extended-prefix-range-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 "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
      "SR-specific TLVs for OSPFv2 extended prefix TLV
       in type 9 opaque LSA.";
    uses ospfv2-prefix-sid-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 "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
      "SR-specific TLVs for OSPFv2 extended prefix TLV
       in type 10 opaque LSA.";
    uses ospfv2-prefix-sid-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 "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
      "SR-specific TLVs for OSPFv2 extended prefix TLV
       in type 11 opaque LSA.";
    uses ospfv2-prefix-sid-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-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
      "SR-specific TLVs for OSPFv2 extended link TLV
       in type 10 opaque LSA.";
    container adj-sid-sub-tlvs {
      description
        "Adj-SID optional sub-TLVs.";
      list adj-sid-sub-tlv {
        description
          "List of Adj-SID sub-TLVs.";
        container adj-sid-flags {
          leaf-list flags {
            type identityref {
              base adj-sid-flag;
            }
            description
              "Adj-SID sub-TLV flags.";
          }
          description
            "Adj-sid sub-TLV flags.";
        }
        leaf mt-id {
          type uint8;
          description
            "Multi-topology ID. Topologies range from 0-127 and
             return of any other value would indicate an error.";
          reference
            "RFC 4915 - Multi-Topology (MT) Routing in OSPF";
        }
        leaf weight {
          type uint8;
          description
            "Weight used for load-balancing.";
        }
        leaf sid {
          type uint32;
          description
            "Segment Identifier (SID) - A 20 bit label or
             an index into the SID/Label space.

             If the  V-Flag is set to 0 and L-Flag is set to 0:
             The SID/Index/Label field is a 4-octet index defining
             the offset in the SID/Label space advertised by this
             router.

             If V-Flag is set to 1 and L-Flag is set to 1: The
             SID/Index/Label field is a 3-octet local label where
             the 20 rightmost bits are used for encoding the label
             value.";
        }
      }
    }
    container lan-adj-sid-sub-tlvs {
      description
        "LAN Adj-SID optional sub-TLVs.";
      list lan-adj-sid-sub-tlv {
        description
          "List of LAN Adj-SID sub-TLVs.";
        container lan-adj-sid-flags {
          leaf-list flags {
            type identityref {
              base adj-sid-flag;
            }
            description
              "LAN Adj-SID sub-TLV flags.";
          }
          description
            "LAN Adj-SID sub-TLV flags.";
        }
        leaf mt-id {
          type uint8;
          description
            "Multi-topology ID. Topologies range from 0-127 and
             return of any other value would indicate an error.";
          reference
            "RFC 4915 - Multi-Topology (MT) Routing in OSPF";
        }
        leaf weight {
          type uint8;
          description
            "Weight used for load-balancing.";
        }
        leaf neighbor-router-id {
          type rt-types:router-id;
          description
            "Neighbor router ID.";
        }
        leaf sid {
          type uint32;
          description
            "Segment Identifier (SID) - A 20 bit label or
             an index into the SID/Label space.

             If the  V-Flag is set to 0 and L-Flag is set to 0:
             The SID/Index/Label field is a 4-octet index defining
             the offset in the SID/Label space advertised by this
             router.

             If V-Flag is set to 1 and L-Flag is set to 1: The
             SID/Index/Label field is a 3-octet local label where
             the 20 rightmost bits are used for encoding the label
             value.";
        }
      }
    }
  }

  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 "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
      "SR-specific TLVs for OSPFv2 type 9 opaque LSA.";
    uses sr-algorithm-tlv;
    uses sid-range-tlvs;
    uses local-block-tlvs;
    uses srms-preference-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:ospfv2/"
        + "ospf:ospfv2/ospf:body/ospf:opaque/ospf:ri-opaque" {
    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
      "SR-specific TLVs for OSPFv2 type 10 opaque LSA.";
    uses sr-algorithm-tlv;
    uses sid-range-tlvs;
    uses local-block-tlvs;
    uses srms-preference-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:ospfv2/"
        + "ospf:ospfv2/ospf:body/ospf:opaque/ospf:ri-opaque" {
    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
      "SR-specific TLVs for OSPFv2 type 11 opaque LSA.";
    uses sr-algorithm-tlv;
    uses sid-range-tlvs;
    uses local-block-tlvs;
    uses srms-preference-tlv;
  }

  /* Segment Routing Capabilities */

  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 "derived-from(/rt:routing/rt:control-plane-protocols/"
       + "rt:control-plane-protocol/rt:type, 'ospf:ospfv3')" {
      description
        "This augmentation is only valid for OSPFv3.";
    }
    description
      "SR-specific TLVs for OSPFv3 Router Information
       opaque LSA.";
    uses sr-algorithm-tlv;
    uses sid-range-tlvs;
    uses local-block-tlvs;
    uses srms-preference-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/ospf:router-information" {
    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.";
    }
    description
      "SR-specific TLVs for OSPFv3 Router Information LSA.";
    uses sr-algorithm-tlv;
    uses sid-range-tlvs;
    uses local-block-tlvs;
    uses srms-preference-tlv;
  }

  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 "derived-from(/rt:routing/rt:control-plane-protocols/"
       + "rt:control-plane-protocol/rt:type, 'ospf:ospfv3')" {
      description
        "This augmentation is only valid for OSPFv3.";
    }
    description
      "SR-specific TLVs for OSPFv3 Router Information LSA.";
    uses sr-algorithm-tlv;
    uses sid-range-tlvs;
    uses local-block-tlvs;
    uses srms-preference-tlv;
  }

  /* OSPFv3 Extended Prefix Range 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-intra-area-prefix" {
    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";
    }
    uses ospfv3-extended-prefix-range-tlvs;
    description
      "OSPFv3 Area-Scoped E-Intra-Area-Prefix 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:ospfv3/"
        + "ospf:ospfv3/ospf:body/ospfv3-e-lsa:e-inter-area-prefix" {
    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";
    }
    uses ospfv3-extended-prefix-range-tlvs;
    description
      "OSPFv3 Area-Scoped E-Inter-Area-Prefix LSA.";
  }

  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" {
    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.";
    }
    uses ospfv3-extended-prefix-range-tlvs;
    description
      "OSPFv3 AS-Scoped E-AS-External 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:ospfv3/"
        + "ospf:ospfv3/ospf:body/ospfv3-e-lsa:e-nssa" {
    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.";
    }
    uses ospfv3-extended-prefix-range-tlvs;
    description
      "OSPFv3 Area-Scoped E-NSSA LSA.";
  }

  /* Prefix SID Sub-TLV in Intra-Area Prefix TLV */

  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/ospfv3-e-lsa:e-link/"
        + "ospfv3-e-lsa:e-link-tlvs/ospfv3-e-lsa:intra-prefix-tlv/"
        + "ospfv3-e-lsa:sub-tlvs" {
    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";
    }
    uses ospfv3-prefix-sid-sub-tlvs;
    description
      "OSPFv3 Link-Scoped Intra-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-intra-area-prefix/"
        + "ospfv3-e-lsa:e-intra-prefix-tlvs/"
        + "ospfv3-e-lsa:intra-prefix-tlv/"
        + "ospfv3-e-lsa:sub-tlvs" {
    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";
    }
    uses ospfv3-prefix-sid-sub-tlvs;
    description
      "OSPFv3 Area-Scoped Intra-Area Prefix TLV.";
  }

  /* Prefix SID Sub-TLV in 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/"
        + "ospfv3-e-lsa:sub-tlvs" {
    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";
    }
    uses ospfv3-prefix-sid-sub-tlvs;
    description
      "OSPFv3 Area-Scoped Inter-Area Prefix TLV.";
  }

  /* Prefix SID Sub-TLV in 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/"
        + "ospfv3-e-lsa:sub-tlvs" {
    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.";
    }
    uses ospfv3-prefix-sid-sub-tlvs;
    description
      "OSPFv3 AS-Scoped External 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-nssa/"
        + "ospfv3-e-lsa:e-external-tlvs/"
        + "ospfv3-e-lsa:external-prefix-tlv/"
        + "ospfv3-e-lsa:sub-tlvs" {
    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.";
    }
    uses ospfv3-prefix-sid-sub-tlvs;
    description
      "OSPFv3 Area-Scoped External Prefix TLV.";
  }

  /* Adj-SID sub-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-router/"
        + "ospfv3-e-lsa:e-router-tlvs/ospfv3-e-lsa:link-tlv/"
        + "ospfv3-e-lsa:sub-tlvs" {
    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";
    }
    uses ospfv3-adj-sid-sub-tlvs;
    uses ospfv3-lan-adj-sid-sub-tlvs;
    description
      "OSPFv3 Area-Scoped Adj-SID Sub-TLV.";
  }
}
<CODE ENDS>
]]></artwork>
</figure>
</section>
</section>
    <!-- Possibly a 'Contributors' section ... -->

    <section anchor="Security" numbered="true" toc="default">
      <name>Security Considerations</name>
      <t>
        The YANG module specified in this document define a schema for
        data that is designed to be accessed via network
        management protocols such as NETCONF <xref target="RFC6241" format="default"/> or
        RESTCONF <xref target="RFC8040" format="default"/>. The lowest NETCONF layer is
        the secure transport layer, and the mandatory-to-implement secure transport is
        Secure Shell (SSH) <xref target="RFC6242" format="default"/>. The lowest RESTCONF
        layer is HTTPS, and the
        mandatory-to-implement secure transport is TLS <xref target="RFC8446" format="default"/>.
      </t>
      <t>
        The NETCONF Configuration Access Control model (NACM)
        <xref target="RFC8341" format="default"/> provides the
        means to restrict access for particular NETCONF or RESTCONF users to a
        pre-configured subset of all available NETCONF or RESTCONF protocol
        operations and content.
      </t>
      <t>
        There are a number of data nodes defined in the module
        that are writable/creatable/deletable (i.e., config true, which is the default).
        These data nodes may be considered sensitive or vulnerable in some network
        environments. Write operations (e.g., edit-config) to these data nodes without
        proper protection can have a negative effect on network operations.
        These are the subtrees and data nodes and their sensitivity/vulnerability:
      </t>
      <ul empty="true" spacing="normal">
        <li>
          /ospf:ospf/segment-routing/enabled - Modification to the
          enablement for SR could result in a Denial-of-Service (Dos)
          attack. If an attacker disables SR, it will cause traffic disruption.
        </li>
        <li>
          /ospf:ospf/segment-routing/bindings - Modification to the local
          bindings could result in a Denial-of-Service (Dos) attack.
        </li>
        <li>
          /ospf:ospf/protocol-srgb - Modification of the protocol SRGB
          could be used to mount a DoS attack. For example, if the protocol
          SRBG size is reduced to a very small value, a lot of existing
          segments could no longer be installed leading to a traffic disruption.
        </li>
        <li>
          /ospf:interfaces/ospf:interface/segment-routing - Modification of the
          Adjacency Segment Identifier (Adj-SID) could be used to mount a
          DoS attack. Change of an Adj-SID could be used to redirect traffic.
        </li>
        <li>
          /ospf:interfaces/ospf:interface/ospf:fast-reroute/ti-lfa - Modification
          of the TI-LFA enablement could lead to traffic disruption.
        </li>
      </ul>
      <t>
        Some of the readable data nodes in the 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.
      </t>
      <t>
        The module ietf-ospf-sr-mpls augments base OSPF module data base with
        various TLVs. Knowledge of these data nodes can be used to attack other
        routers in the OSPF domain.
      </t>
    </section>
    <section anchor="Acknowledgements" numbered="true" toc="default">
      <name>Acknowledgements</name>
      <t>The authors wish to thank Yi Yang, Alexander Clemm,
      Gaurav Gupta, Ladislav Lhotka, Stephane Litkowski,
      Greg Hankins, Manish Gupta, Alan Davey, Divakaran Baskaran, Reshad Rahman, and Tom Petch for their thorough reviews
      and helpful comments.</t>
      <t>
        The authors wish to thank Julien Meuric for a very meticulous Routing Directorate review.
      </t>
      <t>Author affiliation with The MITRE Corporation is provided for
      identification purposes only, and is not intended to convey or imply MITRE's
      concurrence with, or support for, the positions, opinions or viewpoints
      expressed.  MITRE has approved this document for Public Release,
      Distribution Unlimited, with Public Release Case Number 18-3281.</t>
    </section>
    <section anchor="IANA" toc="default" numbered="true">
      <name>IANA Considerations</name>
      <t>
        This document registers a URI in the IETF XML registry
        <xref target="RFC3688" format="default"/>.  Following the format in <xref
        target="RFC3688" format="default"/>,
        the following registration is requested to be made:
      </t>
      <artwork name="" type="" align="left" alt=""><![CDATA[
      URI: urn:ietf:params:xml:ns:yang:ietf-ospf-sr-mpls
      Registrant Contact: The IESG.
      XML: N/A, the requested URI is an XML namespace.
      ]]></artwork>
      <t>
        This document registers a YANG module in the YANG Module Names
        registry <xref target="RFC6020" format="default"/>.
      </t>
      <artwork name="" type="" align="left" alt=""><![CDATA[
      name: ietf-ospf-sr-mpls
      namespace: urn:ietf:params:xml:ns:yang:ietf-ospf-sr-mpls
      prefix: ospf-sr-mpls
      reference: RFC XXXX
      ]]></artwork>
    </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>
        <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.2328.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.4750.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.4915.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.5340.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.5643.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.5838.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.6242.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.6991.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.8102.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.8294.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.8343.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.8476.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.8666.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.9020.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.9587.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml3/reference.I-D.ietf-rtgwg-segment-routing-ti-lfa.xml"/>
      </references>
      <references>
        <name>Informative References</name>
        <!-- Here we use entities that we defined at the beginning. -->
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8340.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8342.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8792.xml"/>
      </references>
    </references>
    <section numbered="true" toc="default">
        <name>A Configuration Example</name>
        <t>The following is an XML example using the OSPF SR YANG module,
           and RFC 9020.</t>
        <t>Note: '\' line wrapping per <xref target="RFC8792" format="default"/>. </t>
        <artwork name="" type="" align="left" alt=""><![CDATA[
<?xml version='1.0' encoding='UTF-8'?>
  <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>
              <interfaces>
                <interface>
                  <name>eth0</name>
                  <segment-routing xmlns="urn:ietf:params:xml:ns\
                    :yang:ietf-ospf-sr-mpls">
                    <adjacency-sid>
                      <adj-sids>
                        <value>3888</value>
                      </adj-sids>
                    </adjacency-sid>
                  </segment-routing>
                </interface>
              </interfaces>
            </area>
          </areas>
          <segment-routing xmlns="urn:ietf:params:xml:ns:yang:\
            ietf-ospf-sr-mpls">
            <enabled>true</enabled>
          </segment-routing>
          <protocol-srgb xmlns="urn:ietf:params:xml:ns:yang:\
            ietf-ospf-sr-mpls">
            <srgb>
              <lower-bound>4000</lower-bound>
              <upper-bound>5000</upper-bound>
            </srgb>
          </protocol-srgb>
        </ospf>
      </control-plane-protocol>
    </control-plane-protocols>
  </routing>
  ]]></artwork>
      <t>The following is the same example using JSON format.</t>
      <artwork name="" type="" align="left" alt=""><![CDATA[
{
  "routing": {
    "router-id": "1.1.1.1",
    "control-plane-protocols": {
      "control-plane-protocol": {
        "type": "ospf:ospfv2",
        "name": "OSPFv2",
        "ospf": {
          "areas": {
            "area": {
              "area-id": "0.0.0.0",
              "interfaces": {
                "interface": {
                  "name": "eth0",
                  "segment-routing": {
                    "adjacency-sid": {
                      "adj-sids": {
                        "value": 3888
                      }
                    }
                  }
                }
              }
            }
          },
          "segment-routing": {
            "enabled": true
          },
          "protocol-srgb": {
            "srgb": {
              "lower-bound": 4000,
              "upper-bound": 5000
            }
          }
        }
      }
    }
  }
}
  ]]></artwork>

    </section>
    <section numbered="true" toc="default">
      <name>Contributors' Addreses</name>
      <artwork name="" type="" align="left" alt=""><![CDATA[

Dean Bogdanovic
Alef

EMail: ivandean@gmail.com


Kiran Koushik Agrahara Sreenivasa
Verizon Wireless
Austin, TX  78681
USA

EMail: KiranKoushik.AgraharaSreenivasa@verisonwireless.com

   ]]></artwork>
    </section>
  </back>
</rfc>
