Internet                                                        D. Yeung
Internet-Draft                                                    Arrcus
Intended status: Standards Track                                   Y. Qu
Expires: June 22, 2019                                            Huawei
                                                                J. Zhang
                                                        Juniper Networks
                                                                 I. Chen
                                                   The MITRE Corporation
                                                               A. Lindem
                                                           Cisco Systems
                                                       December 19, 2018


                   YANG Data Model for OSPF Protocol
                        draft-ietf-ospf-yang-20

Abstract

   This document defines a YANG data model that can be used to configure
   and manage OSPF.  The model is based on YANG 1.1 as defined in RFC
   7950 and conforms to the Network Management Datastore Architecture
   (NDMA) as described in RFC 8342.

Status of This Memo

   This Internet-Draft is submitted in full conformance with the
   provisions of BCP 78 and BCP 79.

   Internet-Drafts are working documents of the Internet Engineering
   Task Force (IETF).  Note that other groups may also distribute
   working documents as Internet-Drafts.  The list of current Internet-
   Drafts is at http://datatracker.ietf.org/drafts/current/.

   Internet-Drafts are draft documents valid for a maximum of six months
   and may be updated, replaced, or obsoleted by other documents at any
   time.  It is inappropriate to use Internet-Drafts as reference
   material or to cite them other than as "work in progress."

   This Internet-Draft will expire on June 22, 2019.

Copyright Notice

   Copyright (c) 2018 IETF Trust and the persons identified as the
   document authors.  All rights reserved.

   This document is subject to BCP 78 and the IETF Trust's Legal
   Provisions Relating to IETF Documents
   (http://trustee.ietf.org/license-info) in effect on the date of



Yeung, et al.             Expires June 22, 2019                 [Page 1]


Internet-Draft            OSPF YANG Data Model             December 2018


   publication of this document.  Please review these documents
   carefully, as they describe your rights and restrictions with respect
   to this document.  Code Components extracted from this document must
   include Simplified BSD License text as described in Section 4.e of
   the Trust Legal Provisions and are provided without warranty as
   described in the Simplified BSD License.

Table of Contents

   1.  Overview  . . . . . . . . . . . . . . . . . . . . . . . . . .   2
     1.1.  Requirements Language . . . . . . . . . . . . . . . . . .   3
     1.2.  Tree Diagrams . . . . . . . . . . . . . . . . . . . . . .   3
   2.  Design of Data Model  . . . . . . . . . . . . . . . . . . . .   3
     2.1.  OSPF Operational State  . . . . . . . . . . . . . . . . .   3
     2.2.  Overview  . . . . . . . . . . . . . . . . . . . . . . . .   4
     2.3.  OSPFv2 and OSPFv3 . . . . . . . . . . . . . . . . . . . .   5
     2.4.  Optional Features . . . . . . . . . . . . . . . . . . . .   5
     2.5.  OSPF Router Configuration/Operational State . . . . . . .   7
     2.6.  OSPF Area Configuration/Operational State . . . . . . . .  10
     2.7.  OSPF Interface Configuration/Operational State  . . . . .  16
     2.8.  OSPF notification . . . . . . . . . . . . . . . . . . . .  19
     2.9.  OSPF RPC Operations . . . . . . . . . . . . . . . . . . .  22
   3.  OSPF YANG Module  . . . . . . . . . . . . . . . . . . . . . .  23
   4.  Security Considerations . . . . . . . . . . . . . . . . . . . 115
   5.  IANA Considerations . . . . . . . . . . . . . . . . . . . . . 116
   6.  Acknowledgements  . . . . . . . . . . . . . . . . . . . . . . 117
   7.  References  . . . . . . . . . . . . . . . . . . . . . . . . . 117
     7.1.  Normative References  . . . . . . . . . . . . . . . . . . 117
     7.2.  Informative References  . . . . . . . . . . . . . . . . . 122
   Appendix A.  Contributors' Addreses . . . . . . . . . . . . . . . 124
   Authors' Addresses  . . . . . . . . . . . . . . . . . . . . . . . 124

1.  Overview

   YANG [RFC6020][RFC7950] is a data definition language used to define
   the contents of a conceptual data store that allows networked devices
   to be managed using NETCONF [RFC6241].  YANG is proving relevant
   beyond its initial confines, as bindings to other interfaces (e.g.,
   ReST) and encodings other than XML (e.g., JSON) are being defined.
   Furthermore, YANG data models can be used as the basis for
   implementation of other interfaces, such as CLI and programmatic
   APIs.

   This document defines a YANG data model that can be used to configure
   and manage OSPF and it is an augmentation to the core routing data
   model.  If fully conforms to the Network Management Datastore
   Architecture (NDMA) [RFC8342].  A core routing data model is defined
   in [RFC8349], and it provides the basis for the development of data



Yeung, et al.             Expires June 22, 2019                 [Page 2]


Internet-Draft            OSPF YANG Data Model             December 2018


   models for routing protocols.  The interface data model is defined in
   [RFC8343] and is used for referencing interfaces from the routing
   protocol.  The key-chain data model used for OSPF authentication is
   defined in [RFC8177] and provides both a reference to configured key-
   chains and an enumeration of cryptographic algorithms.

   Both OSPFv2 [RFC2328] and OSPFv3 [RFC5340] are supported.  In
   addition to the core OSPF protocol, features described in other OSPF
   RFCs are also supported.  These includes demand circuit [RFC1793],
   traffic engineering [RFC3630], multiple address family [RFC5838],
   graceful restart [RFC3623] [RFC5187], NSSA [RFC3101], and OSPF(v3) as
   a PE-CE Protocol [RFC4577], [RFC6565].  These non-core features are
   optional in the OSPF data model.

1.1.  Requirements Language

   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 [RFC2119] [RFC8174] when, and only when, they appear in all
   capitals, as shown here.

1.2.  Tree Diagrams

   This document uses the graphical representation of data models
   defined in [RFC8340].

2.  Design of Data Model

   Although the basis of OSPF configuration elements like routers,
   areas, and interfaces remains the same, the detailed configuration
   model varies among router vendors.  Differences are observed in terms
   of how the protocol engine is tied to the routing domain, how
   multiple protocol engines are be instantiated among others.

   The goal of this document is to define a data model that provides a
   common user interface to the OSPFv2 and OSPFv3 protocols.  There is
   very little information that is designated as "mandatory", providing
   freedom for vendors to adapt this data model to their respective
   product implementations.

2.1.  OSPF Operational State

   The OSPF operational state is included in the same tree as OSPF
   configuration consistent with Network Management Datastore
   Architecture [RFC8342].  Consequently, only the routing container in
   the ietf-routing model [RFC8349] is augmented.  The routing-state
   container is not augmented.



Yeung, et al.             Expires June 22, 2019                 [Page 3]


Internet-Draft            OSPF YANG Data Model             December 2018


2.2.  Overview

   The OSPF YANG module defined in this document has all the common
   building blocks for the OSPF protocol.

   The OSPF YANG module augments the /routing/control-plane-protocols/
   control-plane-protocol path defined in the ietf-routing module.

   module: ietf-ospf
     augment /rt:routing/rt:control-plane-protocols/
              rt:control-plane-protocol:
       +--rw ospf
             .
             .
          +--rw operation-mode?          identityref
          +--rw af?                      identityref
             .
             .
          +--rw areas
          |  +--rw area* [area-id]
          |     +--rw area-id                   area-id-type
          |        .
          |        .
          |     +--rw virtual-links
          |     |  +--rw virtual-link* [transit-area-id router-id]
          |     |     .
          |     |     .
          |     +--rw sham-links {pe-ce-protocol}?
          |     |  +--rw sham-link* [local-id remote-id]
          |     |     .
          |     |     .
          |     +--rw interfaces
          |        +--rw interface* [name]
          |           .
          |           .
          +--rw topologies {multi-topology}?
             +--rw topology* [name]
                .
                .

   The ospf module is intended to match to the vendor specific OSPF
   configuration construct that is identified by the local identifier
   'name'.  The field 'version' allows support for OSPFv2 and OSPFv3.

   The ospf container includes one OSPF protocol engine instance.  The
   instance includes OSPF router level configuration and operational
   state.




Yeung, et al.             Expires June 22, 2019                 [Page 4]


Internet-Draft            OSPF YANG Data Model             December 2018


   The area and area/interface containers respectively define the OSPF
   configuration and operational state for OSPF areas and interfaces.

   The topologies container defines the OSPF configuration and
   operational state for OSPF topologies when the multi-topology feature
   is supported.

2.3.  OSPFv2 and OSPFv3

   The data model defined herein supports both OSPFv2 and OSPFv3.

   The field 'version' is used to indicate the OSPF version and is
   mandatory.  Based on the configured version, the data model varies to
   accommodate the differences between OSPFv2 and OSPFv3.

2.4.  Optional Features

   Optional features are beyond the basic OSPF configuration and it is
   the responsibility of each vendor to decide whether to support a
   given feature on a particular device.

   This model defines the following optional features:

   1.   multi-topology: Support Multiple-Topolgy Routing (MTR)
        [RFC4915].

   2.   multi-area-adj: Support OSPF multi-area adjacency [RFC5185].

   3.   explicit-router-id: Support explicit per-instance Router-ID
        specification.

   4.   demand-circuit: Support OSPF demand circuits [RFC1793].

   5.   mtu-ignore: Support disabling OSPF Database Description packet
        MTU mismatch checking.

   6.   lls: Support OSPF link-local signaling (LLS) [RFC5613].

   7.   prefix-suppression: Support OSPF prefix advertisement
        suppression [RFC6860].

   8.   ttl-security: Support OSPF Time to Live (TTL) security check
        suppression [RFC5082].

   9.   nsr: Support OSPF Non-Stop Routing (NSR).

   10.  graceful-restart: Support Graceful OSPF Restart [RFC3623],
        [RFC5187].



Yeung, et al.             Expires June 22, 2019                 [Page 5]


Internet-Draft            OSPF YANG Data Model             December 2018


   11.  admin-control: Support Administrative control of the protocol
        state.

   12.  auto-cost: Support OSPF interface cost calculation according to
        reference bandwidth [RFC2328].

   13.  max-ecmp: Support configuration of the maximum number of Equal-
        Cost Multi-Path (ECMP) paths.

   14.  max-lsa: Support configuration of the maximum number of LSAs the
        OSPF instance will accept [RFC1765].

   15.  te-rid: Support configuration of the Traffic Engineering (TE)
        Router-ID, i.e., the Router Address described in Section 2.4.1
        of [RFC3630] or the Router IPv6 Address TLV described in
        Section 3 of [RFC5329].

   16.  ldp-igp-sync: Support LDP IGP synchronization [RFC5443].

   17.  ospfv2-authentication-trailer: Support OSPFv2 Authentication
        trailer as specified in [RFC5709] or [RFC7166].

   18.  ospfv3-authentication-ipsec: Support IPsec for OSPFv3
        authentication [RFC4552].

   19.  ospfv3-authentication-trailer: Support OSPFv3 Authentication
        trailer as specified in [RFC7474].

   20.  fast-reroute: Support IP Fast Reroute (IP-FRR) [RFC5714].

   21.  node-flag: Support node-flag for OSPF prefixes.  [RFC7684].

   22.  node-tag: Support node admin tag for OSPF instances [RFC7777].

   23.  lfa: Support Loop-Free Alternates (LFAs) [RFC5286].

   24.  remote-lfa: Support Remote Loop-Free Alternates (R-LFA)
        [RFC7490].

   25.  stub-router: Support RFC 6987 OSPF Stub Router advertisement
        [RFC6987].

   26.  pe-ce-protocol: Support OSPF as a PE-CE protocol [RFC4577],
        [RFC6565].

   27.  ietf-spf-delay: Support IETF SPF delay algorithm [RFC8405].





Yeung, et al.             Expires June 22, 2019                 [Page 6]


Internet-Draft            OSPF YANG Data Model             December 2018


   28.  bfd: Support BFD detection of OSPF neighbor reachability
        [RFC5880], [RFC5881], and [I-D.ietf-bfd-yang].

   29.  hygrid-interface: Support OSPF Hybrid Broadcast and Point-to-
        Point Interfaces [RFC6845].

   30.  two-part-metric: Support OSPF Two-Part Metric [RFC8042].

   It is expected that vendors will support additional features through
   vendor-specific augmentations.

2.5.  OSPF Router Configuration/Operational State

   The ospf container is the top level container in this data model.  It
   represents an OSPF protocol engine instance and contains the router
   level configuration and operational state.  The operational state
   includes the instance statistics, IETF SPF delay statistics, AS-
   Scoped Link State Database, local RIB, SPF Log, and the LSA log.

   module: ietf-ospf
     augment /rt:routing/rt:control-plane-protocols/
              rt:control-plane-protocol:
       +--rw ospf
          .
          .
          +--rw af                    iana-rt-types:address-family
          +--rw explicit-router-id?   rt-types:router-id
          |                           {explicit-router-id}?
          +--rw preference
          |  +--rw (scope)?
          |     +--:(single-value)
          |     |  +--rw all?          uint8
          |     +--:(multi-values)
          |        +--rw (granularity)?
          |        |  +--:(detail)
          |        |  |  +--rw intra-area?   uint8
          |        |  |  +--rw inter-area?   uint8
          |        |  +--:(coarse)
          |        |     +--rw internal?     uint8
          |        +--rw external?     uint8
          +--rw nsr {nsr}?
          |  +--rw enable?   boolean
          +--rw graceful-restart {graceful-restart}?
          |  +--rw enable?                       boolean
          |  +--rw helper-enable?                boolean
          |  +--rw restart-interval?             uint16
          |  +--rw helper-strict-lsa-checking?   boolean
          +--rw enable?               boolean {admin-control}?



Yeung, et al.             Expires June 22, 2019                 [Page 7]


Internet-Draft            OSPF YANG Data Model             December 2018


          +--rw auto-cost {auto-cost}?
          |  +--rw enable?                boolean
          |  +--rw reference-bandwidth?   uint32
          +--rw spf-control
          |  +--rw paths?            uint16 {max-ecmp}?
          |  +--rw ietf-spf-delay {ietf-spf-delay}?
          |     +--rw initial-delay?   uint16
          |     +--rw short-delay?     uint16
          |     +--rw long-delay?      uint16
          |     +--rw hold-down?       uint16
          |     +--rw time-to-learn?   uint16
          |     +--ro current-state?             enumeration
          |     +--ro remaining-time-to-learn?   uint16
          |     +--ro remaining-hold-down?       uint16
          |     +--ro last-event-received?       yang:timestamp
          |     +--ro next-spf-time?             yang:timestamp
          |     +--ro last-spf-time?             yang:timestamp
          +--rw database-control
          |  +--rw max-lsa?   uint32 {max-lsa}?
          +--rw stub-router {stub-router}?
          |  +--rw (trigger)?
          |     +--:(always)
          |        +--rw always!
          +--rw mpls
          |  +--rw te-rid {te-rid}?
          |  |  +--rw ipv4-router-id?   inet:ipv4-address
          |  |  +--rw ipv6-router-id?   inet:ipv6-address
          |  +--rw ldp
          |     +--rw igp-sync?   boolean {ldp-igp-sync}?
          +--rw fast-reroute {fast-reroute}?
          |  +--rw lfa {lfa}?
          +--ro protected-routes
          |  +--ro af-stats* [af prefix alternate]
          |     +--ro af                    iana-rt-types:address-family
          |     +--ro prefix                string
          |     +--ro alternate             string
          |     +--ro alternate-type?       enumeration
          |     +--ro best?                 boolean
          |     +--ro non-best-reason?      string
          |     +--ro protection-available? bits
          |     +--ro alternate-metric1?    uint32
          |     +--ro alternate-metric2?    uint32
          |     +--ro alternate-metric3?    uint32
          +--ro unprotected-routes
          |  +--ro af-stats* [af prefix]
          |     +--ro af                    iana-rt-types:address-family
          |     +--ro prefix                string
          +--ro protection-statistics* [frr-protection-method]



Yeung, et al.             Expires June 22, 2019                 [Page 8]


Internet-Draft            OSPF YANG Data Model             December 2018


          |  +--ro frr-protection-method string
          |  +--ro af-stats* [af]
          |     +--ro af                    iana-rt-types:address-family
          |     +--ro total-routes?         uint32
          |     +--ro unprotected-routes?   uint32
          |     +--ro protected-routes?     uint32
          |     +--ro linkprotected-routes? uint32
          |     +--ro nodeprotected-routes? uint32
          +--rw node-tags {node-tag}?
          |  +--rw node-tag* [tag]
          |     +--rw tag      uint32
          +--ro router-id?
          +--ro local-rib
          |  +--ro route* [prefix]
          |     +--ro prefix        inet:ip-prefix
          |     +--ro next-hops
          |     |  +--ro next-hop* [next-hop]
          |     |     +--ro outgoing-interface?   if:interface-ref
          |     |     +--ro next-hop              inet:ip-address
          |     +--ro metric?       uint32
          |     +--ro route-type?   route-type
          |     +--ro route-tag?    uint32
          +--ro statistics
          |  +--ro originate-new-lsa-count?   yang:counter32
          |  +--ro rx-new-lsas-count?         yang:counter32
          |  +--ro as-scope-lsa-count?        yang:gauge32
          |  +--ro as-scope-lsa-chksum-sum?   uint32
          |  +--ro database
          |     +--ro as-scope-lsa-type*
          |        +--ro lsa-type?        uint16
          |        +--ro lsa-count?       yang:gauge32
          |        +--ro lsa-cksum-sum?   int32
          +--ro database
          |  +--ro as-scope-lsa-type* [lsa-type]
          |     +--ro as-scope-lsas
          |        +--ro as-scope-lsa* [lsa-id adv-router]
          |           +--ro lsa-id               union
          |           +--ro adv-router           inet:ipv4-address
          |           +--ro decoded-completed?   boolean
          |           +--ro raw-data?            yang:hex-string
          |           +--ro (version)?
          |              +--:(ospfv2)
          |              |  +--ro ospfv2
          .              .
          .              .
          |              +--:(ospfv3)
          |                 +--ro ospfv3
          .



Yeung, et al.             Expires June 22, 2019                 [Page 9]


Internet-Draft            OSPF YANG Data Model             December 2018


          .
          +--ro spf-log
          |  +--ro event* [id]
          |     +--ro id                    uint32
          |     +--ro spf-type?             enumeration
          |     +--ro schedule-timestamp?   yang:timestamp
          |     +--ro start-timestamp?      yang:timestamp
                +--ro end-timestamp?        yang:timestamp
          |     +--ro trigger-lsa*
          |        +--ro area-id?      area-id-type
          |        +--ro link-id?      union
          |        +--ro type?         uint16
          |        +--ro lsa-id?       yang:dotted-quad
          |        +--ro adv-router?   yang:dotted-quad
          |        +--ro seq-num?      uint32
          +--ro lsa-log
          |  +--ro event* [id]
          |     +--ro id                    uint32
          |     +--ro lsa
          |     |  +--ro area-id?      area-id-type
          |     |  +--ro link-id?      union
          |     |  +--ro type?         uint16
          |     |  +--ro lsa-id?       yang:dotted-quad
          |     |  +--ro adv-router?   yang:dotted-quad
          |     |  +--ro seq-num?      uint32
          |     +--ro received-timestamp?   yang:timestamp
          |     +--ro reason?               identityref
          .
          .

2.6.  OSPF Area Configuration/Operational State

   The area container contains OSPF area configuration and the list of
   interface containers representing all the OSPF interfaces in the
   area.  The area operational state includes the area statistics and
   the Area Link State Database (LSDB).

   module: ietf-ospf
     augment /rt:routing/rt:control-plane-protocols/
              rt:control-plane-protocol:
       +--rw ospf
          .
          .
          +--rw areas
          |  +--rw area* [area-id]
          |     +--rw area-id                   area-id-type
          |     +--rw area-type?                identityref
          |     +--rw summary?                  boolean



Yeung, et al.             Expires June 22, 2019                [Page 10]


Internet-Draft            OSPF YANG Data Model             December 2018


          |     +--rw default-cost?             uint32
          |     +--rw ranges
          |     |  +--rw range* [prefix]
          |     |     +--rw prefix       inet:ip-prefix
          |     |     +--rw advertise?   boolean
          |     |     +--rw cost?        uint24
          |     +--ro statistics
          |     |  +--ro spf-runs-count?              yang:counter32
          |     |  +--ro abr-count?                   yang:gauge32
          |     |  +--ro asbr-count?                  yang:gauge32
          |     |  +--ro ar-nssa-translator-event-count?
          |     |                                     yang:counter32
          |     |  +--ro area-scope-lsa-count?        yang:gauge32
          |     |  +--ro area-scope-lsa-cksum-sum?    int32
          |     |  +--ro database
          |     |     +--ro area-scope-lsa-type*
          |     |        +--ro lsa-type?        uint16
          |     |        +--ro lsa-count?       yang:gauge32
          |     |        +--ro lsa-cksum-sum?   int32
          |     +--ro database
          |     |  +--ro area-scope-lsa-type* [lsa-type]
          |     |     +--ro lsa-type           uint16
          |     |     +--ro area-scope-lsas
          |     |        +--ro area-scope-lsa* [lsa-id adv-router]
          |     |           +--ro lsa-id               union
          .     .           .
          .     .           .
          |     |           +--ro (version)?
          |     |              +--:(ospfv2)
          |     |              |  +--ro ospfv2
          |     |              |     +--ro header
          .     .              .     .
          .     .              .     .
          |     |              |     +--ro body
          |     |              |        +--ro router
          .     .              .        .
          .     .              .        .
          |     |              |        +--ro network
          .     .              .        .
          .     .              .        .
          |     |              |        +--ro summary
          .     .              .        .
          .     .              .        .
          |     |              |        +--ro external
          .     .              .        .
          .     .              .        .
          |     |              |        +--ro opaque
          .     .              .        .



Yeung, et al.             Expires June 22, 2019                [Page 11]


Internet-Draft            OSPF YANG Data Model             December 2018


          .     .              .        .
          |     |              +--:(ospfv3)
          |     |                 +--ro ospfv3
          |     |                    +--ro header
          .     .                    .
          .     .                    .
          |     |                    +--ro body
          |     |                       +--ro router
          .     .                       .
          .     .                       .
          |     |                       +--ro network
          .     .                       .
          .     .                       .
          |     |                       +--ro inter-area-prefix
          .     .                       .
          .     .                       .
          |     |                       +--ro inter-area-router
          .     .                       .
          .     .                       .
          |     |                       +--ro as-external
          .     .                       .
          .     .                       .
          |     |                       +--ro nssa
          .     .                       .
          .     .                       .
          |     |                       +--ro link
          .     .                       .
          .     .                       .
          |     |                       +--ro intra-area-prefix
          .     .                       .
          .     .                       .
          |     |                       +--ro router-information
          .     .                       .
          .     .                       .
          |     +--rw virtual-links
          |     |  +--rw virtual-link* [transit-area-id router-id]
          |     |     +--rw transit-area-id       -> ../../../../
          |     |                                    area/area-id
          |     |     +--rw router-id             rt-types:router-id
          |     |     +--rw hello-interval?       uint16
          |     |     +--rw dead-interval?        uint32
          |     |     +--rw retransmit-interval?  uint16
          |     |     +--rw transmit-delay?       uint16
          |     |     +--rw lls?                  boolean {lls}?
          |     |     +--rw ttl-security {ttl-security}?
          |     |     |  +--rw enable?   boolean
          |     |     |  +--rw hops?     uint8
          |     |     +--rw enable?               boolean



Yeung, et al.             Expires June 22, 2019                [Page 12]


Internet-Draft            OSPF YANG Data Model             December 2018


          |     |     |                           {admin-control}?
          |     |     +--rw authentication
          |     |     |  +--rw (auth-type-selection)?
          |     |     |     +--:(ospfv2-auth)
          |     |     |     |  +--rw ospfv2-auth-trailer-rfc?
          |     |     |     |  |       ospfv2-auth-trailer-rfc-version
          |     |     |     |  |        {ospfv2-authentication-trailer}?
          |     |     |     |  +--rw (ospfv2-auth-specification)?
          |     |     |     |     +--:(auth-key-chain) {key-chain}?
          |     |     |     |     |  +--rw ospfv2-key-chain?
          |     |     |     |     |         key-chain:key-chain-ref
          |     |     |     |     +--:(auth-key-explicit)
          |     |     |     |        +--rw ospfv2-key-id?     uint32
          |     |     |     |        +--rw ospfv2-key?        string
          |     |     |     |        +--rw ospfv2-crypto-algorithm?
          |     |     |     |                identityref
          |     |     |     +--:(ospfv3-auth-ipsec)
          |     |     |     |      {ospfv3-authentication-ipsec}?
          |     |     |     |  +--rw sa?                       string
          |     |     |     +--:(ospfv3-auth-trailer)
          |     |     |        |  {ospfv3-authentication-trailer}?
          |     |     |        +--rw (ospfv3-auth-specification)?
          |     |     |           +--:(auth-key-chain) {key-chain}?
          |     |     |           |  +--rw ospfv3-key-chain?
          |     |     |           |          key-chain:key-chain-ref
          |     |     |           +--:(auth-key-explicit)
          |     |     |              +--rw ospfv3-sa-id?        uint16
          |     |     |              +--rw ospfv3-key?          string
          |     |     |              +--rw ospfv3-crypto-algorithm?
          |     |     |                      identityref
          |     |     +--ro cost?                 uint16
          |     |     +--ro state?                if-state-type
          |     |     +--ro hello-timer?          uint32
          |     |     +--ro wait-timer?           uint32
          |     |     +--ro dr-router-id?         rt-types:router-id
          |     |     +--ro dr-ip-addr?           inet:ip-address
          |     |     +--ro bdr-router-id?        rt-types:router-id
          |     |     +--ro bdr-ip-addr?          inet:ip-address
          |     |     +--ro statistics
          |     |     |  +--ro if-event-count?        yang:counter32
          |     |     |  +--ro link-scope-lsa-count?  yang:gauge32
          |     |     |  +--ro link-scope-lsa-cksum-sum?
          |     |     |                               uint32
          |     |     |  +--ro database
          |     |     |     +--ro link-scope-lsa-type*
          |     |     |        +--ro lsa-type?        uint16
          |     |     |        +--ro lsa-count?       yang:gauge32
          |     |     |        +--ro lsa-cksum-sum?   int32



Yeung, et al.             Expires June 22, 2019                [Page 13]


Internet-Draft            OSPF YANG Data Model             December 2018


          |     |     +--ro neighbors
          |     |     |  +--ro neighbor* [neighbor-router-id]
          |     |     |     +--ro neighbor-router-id
          |     |     |                           rt-types:router-id
          |     |     |     +--ro address?        inet:ip-address
          |     |     |     +--ro dr-router-id?   rt-types:router-id
          |     |     |     +--ro dr-ip-addr?     inet:ip-address
          |     |     |     +--ro bdr-router-id?  rt-types:router-id
          |     |     |     +--ro bdr-ip-addr?    inet:ip-address
          |     |     |     +--ro state?          nbr-state-type
          |     |     |     +--ro dead-timer?     uint32
          |     |     |     +--ro statistics
          |     |     |        +--ro nbr-event-count?
          |     |     |                           yang:counter32
          |     |     |        +--ro nbr-retrans-qlen?
          |     |     |                           yang:gauge32
          |     |     +--ro database
          |     |        +--ro link-scope-lsa-type* [lsa-type]
          |     |           +--ro lsa-type           uint16
          |     |           +--ro link-scope-lsas
          .     .
          .     .
          |     +--rw sham-links {pe-ce-protocol}?
          |     |  +--rw sham-link* [local-id remote-id]
          |     |     +--rw local-id               inet:ip-address
          |     |     +--rw remote-id              inet:ip-address
          |     |     +--rw hello-interval?        uint16
          |     |     +--rw dead-interval?         uint32
          |     |     +--rw retransmit-interval?   uint16
          |     |     +--rw transmit-delay?        uint16
          |     |     +--rw lls?                   boolean {lls}?
          |     |     +--rw ttl-security {ttl-security}?
          |     |     |  +--rw enable?   boolean
          |     |     |  +--rw hops?     uint8
          |     |     +--rw enable?             boolean
          |     |     |       {admin-control}?
          |     |     +--rw authentication
          |     |     |  +--rw (auth-type-selection)?
          |     |     |     +--:(ospfv2-auth)
          |     |     |     |  +--rw ospfv2-auth-trailer-rfc?
          |     |     |     |  |       ospfv2-auth-trailer-rfc-version
          |     |     |     |  |        {ospfv2-authentication-trailer}?
          |     |     |     |  +--rw (ospfv2-auth-specification)?
          |     |     |     |     +--:(auth-key-chain) {key-chain}?
          |     |     |     |     |  +--rw ospfv2-key-chain?
          |     |     |     |     |         key-chain:key-chain-ref
          |     |     |     |     +--:(auth-key-explicit)
          |     |     |     |        +--rw ospfv2-key-id?     uint32



Yeung, et al.             Expires June 22, 2019                [Page 14]


Internet-Draft            OSPF YANG Data Model             December 2018


          |     |     |     |        +--rw ospfv2-key?        string
          |     |     |     |        +--rw ospfv2-crypto-algorithm?
          |     |     |     |                identityref
          |     |     |     +--:(ospfv3-auth-ipsec)
          |     |     |     |      {ospfv3-authentication-ipsec}?
          |     |     |     |  +--rw sa?                       string
          |     |     |     +--:(ospfv3-auth-trailer)
          |     |     |        |  {ospfv3-authentication-trailer}?
          |     |     |        +--rw (ospfv3-auth-specification)?
          |     |     |           +--:(auth-key-chain) {key-chain}?
          |     |     |           |  +--rw ospfv3-key-chain?
          |     |     |           |          key-chain:key-chain-ref
          |     |     |           +--:(auth-key-explicit)
          |     |     |              +--rw ospfv3-sa-id?        uint16
          |     |     |              +--rw ospfv3-key?          string
          |     |     |              +--rw ospfv3-crypto-algorithm?
          |     |     |                      identityref
          |     |     +--rw cost?               uint16
          |     |     +--rw mtu-ignore?         boolean
          |     |                               {mtu-ignore}?
          |     |     +--rw prefix-suppression? boolean
          |     |                               {prefix-suppression}?
          |     |     +--rw two-part-metric?    boolean
          |     |                               {two-part-metric}?
          |     |     +--ro state?              if-state-type
          |     |     +--ro hello-timer?        uint32
          |     |     +--ro wait-timer?         uint32
          |     |     +--ro dr-router-id?       rt-types:router-id
          |     |     +--ro dr-ip-addr?         inet:ip-address
          |     |     +--ro bdr-router-id?      rt-types:router-id
          |     |     +--ro bdr-ip-addr?        inet:ip-address
          |     |     +--ro statistics
          |     |     |  +--ro if-event-count?        yang:counter32
          |     |     |  +--ro link-scope-lsa-count?  yang:gauge32
          |     |     |  +--ro link-scope-lsa-cksum-sum?
          |     |     |                               uint32
          |     |     |  +--ro database
          |     |     |     +--ro link-scope-lsa-type*
          |     |     |        +--ro lsa-type?        uint16
          |     |     |        +--ro lsa-count?       yang:gauge32
          |     |     |        +--ro lsa-cksum-sum?   int32
          |     |     +--ro neighbors
          |     |     |  +--ro neighbor* [neighbor-router-id]
          |     |     |     +--ro neighbor-router-id
          |     |     |                           rt-types:router-id
          |     |     |     +--ro address?        inet:ip-address
          |     |     |     +--ro dr-router-id?   rt-types:router-id
          |     |     |     +--ro dr-ip-addr?     inet:ip-address



Yeung, et al.             Expires June 22, 2019                [Page 15]


Internet-Draft            OSPF YANG Data Model             December 2018


          |     |     |     +--ro bdr-router-id?  rt-types:router-id
          |     |     |     +--ro bdr-ip-addr?    inet:ip-address
          |     |     |     +--ro state?          nbr-state-type
          |     |     |     +--ro cost?           uint32
          |     |     |     +--ro dead-timer?     uint32
          |     |     |     +--ro statistics
          |     |     |        +--ro nbr-event-count?
          |     |     |                           yang:counter32
          |     |     |        +--ro nbr-retrans-qlen?
          |     |     |                           yang:gauge32
          |     |     +--ro database
          |     |        +--ro link-scope-lsa-type* [lsa-type]
          |     |           +--ro lsa-type           uint16
          |     |           +--ro link-scope-lsas
          .     .
          .     .

2.7.  OSPF Interface Configuration/Operational State

   The interface container contains OSPF interface configuration and
   operational state.  The interface operational state includes the
   statistics, list of neighbors, and Link-Local Link State Database
   (LSDB).

   module: ietf-ospf
     augment /rt:routing/rt:control-plane-protocols/
              rt:control-plane-protocol:
       +--rw ospf
          .
          .
          +--rw areas
          |  +--rw area* [area-id]
          |     .
          |     .
          |     +--rw interfaces
          |        +--rw interface* [name]
          |           +--rw name                   if:interface-ref
          |           +--rw interface-type?        enumeration
          |           +--rw passive?               boolean
          |           +--rw demand-circuit?        boolean
          |                                        {demand-circuit}?
          |           +--rw priority?              uint8
          |           +--rw multi-areas {multi-area-adj}?
          |           |  +--rw multi-area* [multi-area-id]
          |           |     +--rw multi-area-id      area-id-type
          |           |     +--rw cost?              uint16
          |           +--rw static-neighbors
          |           |  +--rw neighbor* [identifier]



Yeung, et al.             Expires June 22, 2019                [Page 16]


Internet-Draft            OSPF YANG Data Model             December 2018


          |           |     +--rw identifier       inet:ip-address
          |           |     +--rw cost?            uint16
          |           |     +--rw poll-interval?   uint16
          |           |     +--rw priority?        uint8
          |           +--rw node-flag?             boolean
          |                                        {node-flag}?
          |           +--rw bfd {bfd}?
          |           |  +--rw enable?   boolean
          |           +--rw fast-reroute {fast-reroute}?
          |           |  +--rw lfa {lfa}?
          |           |     +--rw candidate-enable?   boolean
          |           |     +--rw enable?             boolean
          |           |     +--rw remote-lfa {remote-lfa}?
          |           |        +--rw enable?   boolean
          |           +--rw hello-interval?        uint16
          |           +--rw dead-interval?         uint32
          |           +--rw retransmit-interval?   uint16
          |           +--rw transmit-delay?        uint16
          |           +--rw lls?                   boolean {lls}?
          |           +--rw ttl-security {ttl-security}?
          |           |  +--rw enable?   boolean
          |           |  +--rw hops?     uint8
          |           +--rw enable?                boolean
          |                                        {admin-control}?
          |           +--rw authentication
          |           |  +--rw (auth-type-selection)?
          |           |     +--:(ospfv2-auth)
          |           |     |  +--rw ospfv2-auth-trailer-rfc?
          |           |     |  |       ospfv2-auth-trailer-rfc-version
          |           |     |  |        {ospfv2-authentication-trailer}?
          |           |     |  +--rw (ospfv2-auth-specification)?
          |           |     |     +--:(auth-key-chain) {key-chain}?
          |           |     |     |  +--rw ospfv2-key-chain?
          |           |     |     |         key-chain:key-chain-ref
          |           |     |     +--:(auth-key-explicit)
          |           |     |        +--rw ospfv2-key-id?     uint32
          |           |     |        +--rw ospfv2-key?        string
          |           |     |        +--rw ospfv2-crypto-algorithm?
          |           |     |                identityref
          |           |     +--:(ospfv3-auth-ipsec)
          |           |     |      {ospfv3-authentication-ipsec}?
          |           |     |  +--rw sa?                       string
          |           |     +--:(ospfv3-auth-trailer)
          |           |        |  {ospfv3-authentication-trailer}?
          |           |        +--rw (ospfv3-auth-specification)?
          |           |           +--:(auth-key-chain) {key-chain}?
          |           |           |  +--rw ospfv3-key-chain?
          |           |           |          key-chain:key-chain-ref



Yeung, et al.             Expires June 22, 2019                [Page 17]


Internet-Draft            OSPF YANG Data Model             December 2018


          |           |           +--:(auth-key-explicit)
          |           |              +--rw ospfv3-sa-id?        uint16
          |           |              +--rw ospfv3-key?          string
          |           |              +--rw ospfv3-crypto-algorithm?
          |           |                      identityref
          |           +--rw cost?               uint16
          |           +--rw mtu-ignore?         boolean
          |           |                         {mtu-ignore}?
          |           +--rw prefix-suppression? boolean
          |           |                         {prefix-suppression}?
          |           +--ro state?                 if-state-type
          |           +--ro hello-timer?        uint32
          |           +--ro wait-timer?         uint32
          |           +--ro dr-router-id?       rt-types:router-id
          |           +--ro dr-ip-addr?         inet:ip-address
          |           +--ro bdr-router-id?      rt-types:router-id
          |           +--ro bdr-ip-addr?        inet:ip-address
          |           +--ro statistics
          |           |  +--ro if-event-count?        yang:counter32
          |           |  +--ro link-scope-lsa-count?  yang:gauge32
          |           |  +--ro link-scope-lsa-cksum-sum?
          |           |                               uint32
          |           |  +--ro database
          |           |     +--ro link-scope-lsa-type*
          |           |        +--ro lsa-type?        uint16
          |           |        +--ro lsa-count?       yang:gauge32
          |           |        +--ro lsa-cksum-sum?   int32
          |           +--ro neighbors
          |           |  +--ro neighbor* [neighbor-router-id]
          |           |     +--ro neighbor-router-id
          |           |                           rt-types:router-id
          |           |     +--ro address?        inet:ip-address
          |           |     +--ro dr-router-id?   rt-types:router-id
          |           |     +--ro dr-ip-addr?     inet:ip-address
          |           |     +--ro bdr-router-id?  rt-types:router-id
          |           |     +--ro bdr-ip-addr?    inet:ip-address
          |           |     +--ro state?          nbr-state-type
          |           |     +--ro dead-timer?     uint32
          |           |     +--ro statistics
          |           |        +--ro nbr-event-count?
          |           |                           yang:counter32
          |           |        +--ro nbr-retrans-qlen?
          |           |                           yang:gauge32
          |           +--ro database
          |           .  +--ro link-scope-lsa-type* [lsa-type]
          |           .     +--ro lsa-type           uint16
          |           .     +--ro link-scope-lsas
          .           .



Yeung, et al.             Expires June 22, 2019                [Page 18]


Internet-Draft            OSPF YANG Data Model             December 2018


          .           .
          |           +--rw topologies {ospf:multi-topology}?
          |           |  +--rw topology* [name]
          |           |     +--rw name  -> ../../../../../../../../
          |           |                    ../../../rt:ribs/rib/name
          |           |     +--rw cost? uint32
          |           +--rw instance-id?           uint8
          .
          .

2.8.  OSPF notification

   This YANG model defines a list of notifications that inform YANG
   clients of important events detected during protocol operation.  The
   defined notifications cover the common set of traps from the OSPFv2
   MIB [RFC4750] and OSPFv3 MIB [RFC5643].

     notifications:
       +---n if-state-change
       |  +--ro routing-protocol-name?
       |  +     -> /rt:routing/control-plane-protocols/
       |  +         control-plane-protocol/name
       |  +--ro af?
       |  +     -> /rt:routing/control-plane-protocols/
       |  +         control-plane-protocol
       |  +         [rt:name=current()/../routing-protocol-name]/
       |  +         ospf:ospf/af
       |  +--ro (if-link-type-selection)?
       |  |  +--:(interface)
       |  |  |  +--ro interface
       |  |  |     +--ro interface?   if:interface-ref
       |  |  +--:(virtual-link)
       |  |  |  +--ro virtual-link
       |  |  |     +--ro transit-area-id?      area-id-type
       |  |  |     +--ro neighbor-router-id?   rt-types:router-id
       |  |  +--:(sham-link)
       |  |     +--ro sham-link
       |  |        +--ro area-id?          area-id-type
       |  |        +--ro local-ip-addr?    inet:ip-address
       |  |        +--ro remote-ip-addr?   inet:ip-address
       |  +--ro state?                   if-state-type
       +---n if-config-error
       |  +--ro routing-protocol-name?
       |  +     -> /rt:routing/control-plane-protocols/
       |  +         control-plane-protocol/name
       |  +--ro af?
       |  +     -> /rt:routing/control-plane-protocols/
       |  +         control-plane-protocol



Yeung, et al.             Expires June 22, 2019                [Page 19]


Internet-Draft            OSPF YANG Data Model             December 2018


       |  +         [rt:name=current()/../routing-protocol-name]/
       |  +         ospf:ospf/af
       |  +--ro (if-link-type-selection)?
       |  |  +--:(interface)
       |  |  |  +--ro interface
       |  |  |     +--ro interface?   if:interface-ref
       |  |  +--:(virtual-link)
       |  |  |  +--ro virtual-link
       |  |  |     +--ro transit-area-id?      area-id-type
       |  |  |     +--ro neighbor-router-id?   rt-types:router-id
       |  |  +--:(sham-link)
       |  |     +--ro sham-link
       |  |        +--ro area-id?          area-id-type
       |  |        +--ro local-ip-addr?    inet:ip-address
       |  |        +--ro remote-ip-addr?   inet:ip-address
       |  +--ro packet-source?           yang:dotted-quad
       |  +--ro packet-type?             packet-type
       |  +--ro error?                   enumeration
       +---n nbr-state-change
       |  +--ro routing-protocol-name?
       |  +     -> /rt:routing/control-plane-protocols/
       |  +         control-plane-protocol/name
       |  +--ro af?
       |  +     -> /rt:routing/control-plane-protocols/
       |  +         control-plane-protocol
       |  +         [rt:name=current()/../routing-protocol-name]/
       |  +         ospf:ospf/af
       |  +--ro (if-link-type-selection)?
       |  |  +--:(interface)
       |  |  |  +--ro interface
       |  |  |     +--ro interface?   if:interface-ref
       |  |  +--:(virtual-link)
       |  |  |  +--ro virtual-link
       |  |  |     +--ro transit-area-id?      area-id-type
       |  |  |     +--ro neighbor-router-id?   rt-types:router-id
       |  |  +--:(sham-link)
       |  |     +--ro sham-link
       |  |        +--ro area-id?          area-id-type
       |  |        +--ro local-ip-addr?    inet:ip-address
       |  |        +--ro remote-ip-addr?   inet:ip-address
       |  +--ro neighbor-router-id?      rt-types:router-id
       |  +--ro neighbor-ip-addr?        yang:dotted-quad
       |  +--ro state?                   nbr-state-type
       +---n nbr-restart-helper-status-change
       |  +--ro routing-protocol-name?
       |  +     -> /rt:routing/control-plane-protocols/
       |  +         control-plane-protocol/name
       |  +--ro af?



Yeung, et al.             Expires June 22, 2019                [Page 20]


Internet-Draft            OSPF YANG Data Model             December 2018


       |  +     -> /rt:routing/control-plane-protocols/
       |  +         control-plane-protocol
       |  +         [rt:name=current()/../routing-protocol-name]/
       |  +         ospf:ospf/af
       |  +--ro (if-link-type-selection)?
       |  |  +--:(interface)
       |  |  |  +--ro interface
       |  |  |     +--ro interface?   if:interface-ref
       |  |  +--:(virtual-link)
       |  |  |  +--ro virtual-link
       |  |  |     +--ro transit-area-id?      area-id-type
       |  |  |     +--ro neighbor-router-id?   rt-types:router-id
       |  |  +--:(sham-link)
       |  |     +--ro sham-link
       |  |        +--ro area-id?          area-id-type
       |  |        +--ro local-ip-addr?    inet:ip-address
       |  |        +--ro remote-ip-addr?   inet:ip-address
       |  +--ro neighbor-router-id?      rt-types:router-id
       |  +--ro neighbor-ip-addr?        yang:dotted-quad
       |  +--ro status?                  restart-helper-status-type
       |  +--ro age?                     uint32
       |  +--ro exit-reason?             restart-exit-reason-type
       +---n if-rx-bad-packet
       |  +--ro routing-protocol-name?
       |  +     -> /rt:routing/control-plane-protocols/
       |  +         control-plane-protocol/name
       |  +--ro af?
       |  +     -> /rt:routing/control-plane-protocols/
       |  +         control-plane-protocol
       |  +         [rt:name=current()/../routing-protocol-name]/
       |  +         ospf:ospf/af
       |  +--ro (if-link-type-selection)?
       |  |  +--:(interface)
       |  |  |  +--ro interface
       |  |  |     +--ro interface?   if:interface-ref
       |  |  +--:(virtual-link)
       |  |  |  +--ro virtual-link
       |  |  |     +--ro transit-area-id?      area-id-type
       |  |  |     +--ro neighbor-router-id?   rt-types:router-id
       |  |  +--:(sham-link)
       |  |     +--ro sham-link
       |  |        +--ro area-id?          area-id-type
       |  |        +--ro local-ip-addr?    inet:ip-address
       |  |        +--ro remote-ip-addr?   inet:ip-address
       |  +--ro packet-source?           yang:dotted-quad
       |  +--ro packet-type?             packet-type
       +---n lsdb-approaching-overflow
       |  +--ro routing-protocol-name?



Yeung, et al.             Expires June 22, 2019                [Page 21]


Internet-Draft            OSPF YANG Data Model             December 2018


       |  +     -> /rt:routing/control-plane-protocols/
       |  +         control-plane-protocol/name
       |  +--ro af?
       |  +     -> /rt:routing/control-plane-protocols/
       |  +         control-plane-protocol
       |  +         [rt:name=current()/../routing-protocol-name]/
       |  +         ospf:ospf/af
       |  +--ro ext-lsdb-limit?          uint32
       +---n lsdb-overflow
       |  +--ro routing-protocol-name?
       |  +     -> /rt:routing/control-plane-protocols/
       |  +         control-plane-protocol/name
       |  +--ro af?
       |  +     -> /rt:routing/control-plane-protocols/
       |  +         control-plane-protocol
       |  +         [rt:name=current()/../routing-protocol-name]/
       |  +         ospf:ospf/af
       |  +--ro ext-lsdb-limit?          uint32
       +---n nssa-translator-status-change
       |  +--ro routing-protocol-name?
       |  +     -> /rt:routing/control-plane-protocols/
       |  +         control-plane-protocol/name
       |  +--ro af?
       |  +     -> /rt:routing/control-plane-protocols/
       |  +         control-plane-protocol
       |  +         [rt:name=current()/../routing-protocol-name]/
       |  +         ospf:ospf/af
       |  +--ro area-id?                 area-id-type
       |  +--ro status?                  nssa-translator-state-type
       +---n restart-status-change
          +--ro routing-protocol-name?
          +     -> /rt:routing/control-plane-protocols/
          +         control-plane-protocol/name
          +--ro af?
          +     -> /rt:routing/control-plane-protocols/
          +         control-plane-protocol
          +         [rt:name=current()/../routing-protocol-name]/
          +         ospf:ospf/af
          +--ro status?                  restart-status-type
          +--ro restart-interval?        uint16
          +--ro exit-reason?             restart-exit-reason-type

2.9.  OSPF RPC Operations

   The "ietf-ospf" module defines two RPC operations:

   o  clear-database: reset the content of a particular OSPF Link State
      Database.



Yeung, et al.             Expires June 22, 2019                [Page 22]


Internet-Draft            OSPF YANG Data Model             December 2018


   o  clear-neighbor: restart a particular set of OSPF neighbor.

     rpcs:
       +---x clear-neighbor
       |  +---w input
       |     +---w routing-protocol-name
       |     +     -> /rt:routing/control-plane-protocols/
       |     +         control-plane-protocol/name
       |     +---w interface?               if:interface-ref
       +---x clear-database
          +---w input
             +---w routing-protocol-name
                   -> /rt:routing/control-plane-protocols/
                       control-plane-protocol/name

3.  OSPF YANG Module

   The following RFCs and drafts are not referenced in the document text
   but are referenced in the ietf-ospf.yang module: [RFC0905],
   [RFC4576], [RFC4973], [RFC5250], [RFC5309], [RFC5642], [RFC5881],
   [RFC6991], [RFC7770], [RFC8294], and [RFC8476].

   <CODE BEGINS> file "ietf-ospf@2018-12-16.yang"
   module ietf-ospf {
     yang-version 1.1;
     namespace "urn:ietf:params:xml:ns:yang:ietf-ospf";

     prefix ospf;

     import ietf-inet-types {
       prefix "inet";
       reference "RFC 6991 - Common YANG Data Types";
     }

     import ietf-yang-types {
       prefix "yang";
       reference "RFC 6991 - Common YANG Data Types";
     }

     import ietf-interfaces {
       prefix "if";
       reference "RFC 8343 - A YANG Data Model for Interface
                  Management (NDMA Version)";
     }

     import ietf-routing-types {
       prefix "rt-types";
       reference "RFC 8294 - Common YANG Data Types for the



Yeung, et al.             Expires June 22, 2019                [Page 23]


Internet-Draft            OSPF YANG Data Model             December 2018


                  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-key-chain {
       prefix "key-chain";
       reference "RFC 8177 - YANG Data Model for Key Chains";
     }

     import ietf-bfd-types {
       prefix "bfd-types";
       reference "RFC YYYY - YANG Data Model for Bidirectional
         Forwarding Detection (BFD). Please replace YYYY with
         published RFC number for draft-ietf-bfd-yang-17.";
     }

     organization
         "IETF LSR - Link State Routing Working Group";

     contact
       "WG Web:   <http://datatracker.ietf.org/group/lsr/>
        WG List:  <mailto:lsr@ietf.org>

        Editor:   Derek Yeung
                  <mailto:derek@arrcus.com>
        Author:   Acee Lindem
                  <mailto:acee@cisco.com>
        Author:   Yingzhen Qu
                  <mailto:yingzhen.qu@huawei.com>
        Author:   Jeffrey Zhang
                  <mailto:zzhang@juniper.net>
        Author:   Ing-Wher Chen
                  <mailto:ingwherchen@mitre.org>
        Author:   Dean Bogdanovic
                  <mailto:ivandean@gmail.com>
        Author:   Kiran Agrahara Sreenivasa
                  <mailto:kk@employees.org";



Yeung, et al.             Expires June 22, 2019                [Page 24]


Internet-Draft            OSPF YANG Data Model             December 2018


     description
        "This YANG module defines the generic configuration and
         operational state for the OSPF protocol common to all
         vendor implementations. It is intended that the module
         will be extended by vendors to define vendor-specific
         OSPF configuration parameters and policies,
         for example route maps or route policies.

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

         Copyright (c) 2018 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 Simplified BSD License
          set forth in Section 4.c of the IETF Trust's Legal Provisions
          Relating to IETF Documents
          (http://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 2018-12-16 {
       description
         "Initial revision.";
       reference
         "RFC XXXX: A YANG Data Model for OSPF.";
     }

     feature multi-topology {
       description
         "Support Multiple-Topology Routing (MTR).";
       reference "RFC 4915 - Multi-Topology Routing";
     }

     feature multi-area-adj {
       description
         "OSPF multi-area adjacency support as in RFC 5185.";
       reference "RFC 5185 - Multi-Area Adjacency";
     }
     feature explicit-router-id {
       description
         "Set Router-ID per instance explicitly.";
     }

     feature demand-circuit {



Yeung, et al.             Expires June 22, 2019                [Page 25]


Internet-Draft            OSPF YANG Data Model             December 2018


       description
         "OSPF demand circuit support as in RFC 1793.";
       reference "RFC 1793 - OSPF Demand Circuits";
     }

     feature mtu-ignore {
       description
         "Disable OSPF Database Description packet MTU
          mismatch checking.";
     }

     feature lls {
       description
         "OSPF link-local signaling (LLS) as in RFC 5613.";
       reference "RFC 5613 - OSPF Link-Local Signaling";
     }

     feature prefix-suppression {
       description
         "OSPF prefix suppression support as in RFC 6860.";
       reference "RFC 6860 - Hide Transit-Only Networks in OSPF";
     }

     feature two-part-metric {
       description
         "OSPF 2-part metric support as described in RFC 8042.";
       reference "RFC 8042 - OSPF Two-Part Metric";
     }

     feature ttl-security {
       description
         "OSPF Time to Live (TTL) security check support.";
       reference "RFC 5082 - The Generalized TTL Security
                  Mechanism (GTSM)";
     }

     feature nsr {
       description
         "Non-Stop-Routing (NSR) support.";
     }

     feature graceful-restart {
       description
         "Graceful OSPF Restart as defined in RFC 3623 and
          RFC 5187.";
       reference "RFC 3623 - Graceful OSPF Restart
                  RFC 5187 - OSPFv3 Graceful Restart";
     }



Yeung, et al.             Expires June 22, 2019                [Page 26]


Internet-Draft            OSPF YANG Data Model             December 2018


     feature admin-control {
       description
         "Administrative control of the protocol state.";
     }

     feature auto-cost {
       description
         "Calculate OSPF interface cost according to
          reference bandwidth.";
        reference "RFC 2328 - OSPF Version 2";
     }

     feature max-ecmp {
       description
         "Setting maximum number of ECMP paths.";
     }

     feature max-lsa {
       description
         "Setting the maximum number of LSAs the OSPF instance
          will accept.";
       reference "RFC 1765 - OSPF Database Overload";
     }

     feature te-rid {
       description
         "Support configuration of the Traffic Engineering (TE)
          Router-ID, i.e., the Router Address described in Section
          2.4.1 of RFC3630 or the Router IPv6 Address TLV described
          in Section 3 of RFC5329.";
       reference "RFC 3630 - Traffic Engineering (TE) Extensions
                  to OSPF Version 2
                  RFC 5329 - Traffic Engineering (TE) Extensions
                  to OSPF Version 3";
     }

     feature ldp-igp-sync {
       description
         "LDP IGP synchronization.";
       reference "RFC 5443 - LDP IGP Synchronization";
     }

     feature ospfv2-authentication-trailer {
       description
         "Use OSPFv2 authentication trailer for OSPFv2
          authentication.";
       reference "RFC 5709 - Supporting Authentication
                  Trailer for OSPFv2



Yeung, et al.             Expires June 22, 2019                [Page 27]


Internet-Draft            OSPF YANG Data Model             December 2018


                  RFC 7474 - Security Extension for OSPFv2 When
                  Using Manual Key Management";
     }

     feature ospfv3-authentication-ipsec {
       description
         "Use IPsec for OSPFv3 authentication.";
       reference "RFC 4552 - Authentication/Confidentiality
                 for OSPFv3";
     }

     feature ospfv3-authentication-trailer {
       description
         "Use OSPFv3 authentication trailer for OSPFv3
          authenticatiom.";
       reference "RFC 7166 - Supporting Authentication
                  Trailer for OSPFv3";
     }

     feature fast-reroute {
      description
        "Support for IP Fast Reroute (IP-FRR).";
      reference "RFC 5714 - IP Fast Reroute Framework";
     }

     feature key-chain {
       description
         "Support of keychain for authentication.";
       reference "RFC8177 - YANG Data Model for Key Chains";
     }

     feature node-flag {
      description
        "Support for node-flag for OSPF prefixes.";
      reference "RFC 7684 - OSPFv2 Prefix/Link Advertisement";
     }

     feature node-tag {
       description
         "Support for node admin tag for OSPF routing instances.";
       reference "RFC 7777 - Advertising Node Administrative
                  Tags in OSPF";
     }

     feature lfa {
      description
        "Support for Loop-Free Alternates (LFAs).";
      reference "RFC 5286 - Basic Specification for IP Fast



Yeung, et al.             Expires June 22, 2019                [Page 28]


Internet-Draft            OSPF YANG Data Model             December 2018


                 Reroute: Loop-Free Alternates";
     }

     feature remote-lfa {
      description
        "Support for Remote Loop-Free Alternates (R-LFA).";
      reference "RFC 7490 - Remote Loop-Free Alternate (LFA)
                 Fast Reroute (FRR)";
     }

     feature stub-router {
       description
         "Support for RFC 6987 OSPF Stub Router Advertisement.";
       reference "RFC 6987 - OSPF Stub Router Advertisement";
     }

     feature pe-ce-protocol {
       description
         "Support for OSPF as a PE-CE protocol";
       reference "RFC 4577 - OSPF as the Provider/Customer Edge
                  Protocol for BGP/MPLS IP Virtual Private
                  Networks (VPNs)
                  RFC 6565 - OSPFv3 as a Provider Edge to Customer
                  Edge (PE-CE) Routing Protocol";
     }

     feature ietf-spf-delay {
       description
         "Support for IETF SPF delay algorithm.";
       reference "RFC 8405 - SPF Back-off algorithm for link
                  state IGPs";
     }

     feature bfd {
       description
         "Support for BFD detection of OSPF neighbor reachability.";
       reference "RFC 5880 - Bidirectional Forwarding Detection (BFD)
                  RFC 5881 - Bidirectional Forwarding Detection
                  (BFD) for IPv4 and IPv6 (Single Hop)";
     }

     feature hybrid-interface {
       description
         "Support for OSPF Hybrid interface type.";
       reference "RFC 6845 - OSPF Hybrid Broadcast and
                  Point-to-Multipoint Interface Type";
     }




Yeung, et al.             Expires June 22, 2019                [Page 29]


Internet-Draft            OSPF YANG Data Model             December 2018


     identity ospf {
       base "rt:routing-protocol";
       description "Any OSPF protocol version";
     }

     identity ospfv2 {
       base "ospf";
       description "OSPFv2 protocol";
     }

     identity ospfv3 {
       base "ospf";
       description "OSPFv3 protocol";
     }

     identity operation-mode {
       description
         "OSPF operation mode.";
     }

     identity area-type {
       description "Base identity for OSPF area type.";
     }

     identity normal-area {
       base area-type;
       description "OSPF normal area.";
     }

     identity stub-nssa-area {
       base area-type;
       description "OSPF stub or NSSA area.";
     }

     identity stub-area {
       base stub-nssa-area;
       description "OSPF stub area.";
     }

     identity nssa-area {
       base stub-nssa-area;
       description "OSPF Not-So-Stubby Area (NSSA).";
       reference "RFC 3101 - The OSPF Not-So-Stubby Area
                  (NSSA) Option";
     }

     identity ospf-lsa-type {
       description



Yeung, et al.             Expires June 22, 2019                [Page 30]


Internet-Draft            OSPF YANG Data Model             December 2018


         "Base identity for OSPFv2 and OSPFv3
          Link State Advertisement (LSA) types";
     }

     identity ospfv2-lsa-type {
       base ospf-lsa-type;
       description
         "OSPFv2 LSA types";
     }

     identity ospfv2-router-lsa {
       base ospfv2-lsa-type;
       description
         "OSPFv2 Router LSA - Type 1";
     }

     identity ospfv2-network-lsa {
       base ospfv2-lsa-type;
       description
         "OSPFv2 Network LSA - Type 2";
     }

     identity ospfv2-summary-lsa-type {
       base ospfv2-lsa-type;
       description
         "OSPFv2 Summary LSA types";
     }

     identity ospfv2-network-summary-lsa {
       base ospfv2-summary-lsa-type;
       description
         "OSPFv2 Network Summary LSA - Type 3";
     }

     identity ospfv2-asbr-summary-lsa {
       base ospfv2-summary-lsa-type;
       description
         "OSPFv2 AS Boundary Router (ASBR) Summary LSA - Type 4";
     }

     identity ospfv2-external-lsa-type {
       base ospfv2-lsa-type;
       description
         "OSPFv2 External LSA types";
     }

     identity ospfv2-as-external-lsa {
       base ospfv2-external-lsa-type;



Yeung, et al.             Expires June 22, 2019                [Page 31]


Internet-Draft            OSPF YANG Data Model             December 2018


       description
         "OSPFv2 AS External LSA - Type 5";
     }

     identity ospfv2-nssa-lsa {
       base ospfv2-external-lsa-type;
       description
         "OSPFv2 Not-So-Stubby-Area (NSSA) LSA - Type 7";
     }

     identity ospfv2-opaque-lsa-type {
       base ospfv2-lsa-type;
       description
         "OSPFv2 Opaque LSA types";
     }

     identity ospfv2-link-scope-opaque-lsa {
       base ospfv2-opaque-lsa-type;
       description
         "OSPFv2 Link-Scoped Opaque LSA - Type 9";
     }

     identity ospfv2-area-scope-opaque-lsa {
       base ospfv2-opaque-lsa-type;
       description
         "OSPFv2 Area-Scoped Opaque LSA - Type 10";
     }

     identity ospfv2-as-scope-opaque-lsa {
       base ospfv2-opaque-lsa-type;
       description
         "OSPFv2 AS-Scoped Opaque LSA - Type 11";
     }

     identity ospfv2-unknown-lsa-type {
       base ospfv2-lsa-type;
       description
         "OSPFv2 Unknown LSA type";
     }

     identity ospfv3-lsa-type {
       base ospf-lsa-type;
       description
         "OSPFv3 LSA types.";
     }

     identity ospfv3-router-lsa {
       base ospfv3-lsa-type;



Yeung, et al.             Expires June 22, 2019                [Page 32]


Internet-Draft            OSPF YANG Data Model             December 2018


       description
         "OSPFv3 Router LSA - Type 0x2001";
     }

     identity ospfv3-network-lsa {
       base ospfv3-lsa-type;
       description
         "OSPFv3 Network LSA - Type 0x2002";
     }

     identity ospfv3-summary-lsa-type {
       base ospfv3-lsa-type;
       description
         "OSPFv3 Summary LSA types";
     }

     identity ospfv3-inter-area-prefix-lsa {
       base ospfv3-summary-lsa-type;
       description
         "OSPFv3 Inter-area Prefix LSA - Type 0x2003";
     }

     identity ospfv3-inter-area-router-lsa {
       base ospfv3-summary-lsa-type;
       description
         "OSPFv3 Inter-area Router LSA - Type 0x2004";
     }

     identity ospfv3-external-lsa-type {
       base ospfv3-lsa-type;
       description
         "OSPFv3 External LSA types";
     }

     identity ospfv3-as-external-lsa {
       base ospfv3-external-lsa-type;
       description
         "OSPFv3 AS-External LSA - Type 0x4005";
     }

     identity ospfv3-nssa-lsa {
       base ospfv3-external-lsa-type;
       description
         "OSPFv3 Not-So-Stubby-Area (NSSA) LSA - Type 0x2007";
     }

     identity ospfv3-link-lsa {
       base ospfv3-lsa-type;



Yeung, et al.             Expires June 22, 2019                [Page 33]


Internet-Draft            OSPF YANG Data Model             December 2018


       description
         "OSPFv3 Link LSA - Type 0x0008";
     }

     identity ospfv3-intra-area-prefix-lsa {
       base ospfv3-lsa-type;
       description
         "OSPFv3 Intra-area Prefix LSA - Type 0x2009";
     }

     identity ospfv3-router-information-lsa {
       base ospfv3-lsa-type;
       description
         "OSPFv3 Router Information LSA - Types 0x800C,
          0xA00C, and 0xC00C";
     }

     identity ospfv3-unknown-lsa-type {
       base ospfv3-lsa-type;
       description
         "OSPFv3 Unknown LSA type";
     }

     identity lsa-log-reason {
       description
         "Base identity for an LSA log reason.";
     }

     identity lsa-refresh {
       base lsa-log-reason;
       description
         "Identity used when the LSA is logged
          as a result of receiving a refresh LSA.";
     }

     identity lsa-content-change {
       base lsa-log-reason;
       description
         "Identity used when the LSA is logged
          as a result of a change in the content
          of the LSA.";
     }

     identity lsa-purge {
       base lsa-log-reason;
       description
         "Identity used when the LSA is logged
          as a result of being purged.";



Yeung, et al.             Expires June 22, 2019                [Page 34]


Internet-Draft            OSPF YANG Data Model             December 2018


     }

     typedef ospf-metric {
       type uint32 {
         range "0 .. 16777215";
       }
       description
         "OSPF Metric - 24-bit unsigned integer.";
     }

     typedef opaque-id {
       type uint32 {
         range "0 .. 16777215";
       }
       description
         "Opaque ID - 24-bit unsigned integer.";
     }

     typedef area-id-type {
       type yang:dotted-quad;
       description
         "Area ID type.";
     }

     typedef route-type {
       type enumeration {
         enum intra-area {
           description "OSPF intra-area route.";
         }
         enum inter-area {
           description "OSPF inter-area route.";
         }
         enum external-1 {
           description "OSPF type 1 external route.";
         }
         enum external-2 {
           description "OSPF type 2 external route.";
         }
         enum nssa-1 {
           description "OSPF type 1 NSSA route.";
         }
         enum nssa-2 {
           description "OSPF type 2 NSSA route.";
         }
       }
       description "OSPF route type.";
     }




Yeung, et al.             Expires June 22, 2019                [Page 35]


Internet-Draft            OSPF YANG Data Model             December 2018


     typedef if-state-type {
       type enumeration {
         enum down {
           value "1";
           description
             "Interface down state.";
         }
         enum loopback {
           value "2";
           description
             "Interface loopback state.";
         }
         enum waiting {
           value "3";
           description
             "Interface waiting state.";
         }
         enum point-to-point {
           value "4";
           description
             "Interface point-to-point state.";
         }
         enum dr {
           value "5";
           description
             "Interface Designated Router (DR) state.";
         }
         enum backup {
           value "6";
           description
             "Interface Backup Designated Router (BDR) state.";
         }
         enum dr-other {
           value "7";
           description
             "Interface Other Designated Router state.";
         }
       }
       description
         "OSPF interface state type.";
     }

     typedef router-link-type {
       type enumeration {
         enum point-to-point-link {
           value "1";
           description
             "Point-to-Point link to Router";



Yeung, et al.             Expires June 22, 2019                [Page 36]


Internet-Draft            OSPF YANG Data Model             December 2018


         }
         enum transit-network-link {
           value "2";
           description
             "Link to transit network identified by
              Designated-Router (DR)";
         }
         enum stub-network-link {
           value "3";
           description
             "Link to stub network identified by subnet";
         }
         enum virtual-link {
           value "4";
           description
             "Virtual link across transit area";
         }
       }
       description
         "OSPF Router Link Type.";
     }

     typedef nbr-state-type {
       type enumeration {
         enum down {
           value "1";
           description
             "Neighbor down state.";
         }
         enum attempt {
           value "2";
           description
             "Neighbor attempt state.";
         }
         enum init {
           value "3";
           description
             "Neighbor init state.";
         }
         enum 2-way {
           value "4";
           description
             "Neighbor 2-Way state.";
         }
         enum exstart {
           value "5";
           description
             "Neighbor exchange start state.";



Yeung, et al.             Expires June 22, 2019                [Page 37]


Internet-Draft            OSPF YANG Data Model             December 2018


         }
         enum exchange {
           value "6";
           description
             "Neighbor exchange state.";
         }
         enum loading {
           value "7";
           description
             "Neighbor loading state.";
         }
         enum full {
           value "8";
           description
             "Neighbor full state.";
         }
       }
       description
         "OSPF neighbor state type.";
     }

     typedef restart-helper-status-type {
       type enumeration {
         enum not-helping {
           value "1";
           description
             "Restart helper status not helping.";
         }
         enum helping {
           value "2";
           description
             "Restart helper status helping.";
         }
       }
       description
         "Restart helper status type.";
     }

     typedef restart-exit-reason-type {
       type enumeration {
         enum none {
           value "1";
           description
             "Restart not attempted.";
         }
         enum in-progress {
           value "2";
           description



Yeung, et al.             Expires June 22, 2019                [Page 38]


Internet-Draft            OSPF YANG Data Model             December 2018


             "Restart in progress.";
         }
         enum completed {
           value "3";
           description
             "Restart successfully completed.";
         }
         enum timed-out {
           value "4";
           description
             "Restart timed out.";
         }
         enum topology-changed {
           value "5";
           description
             "Restart aborted due to topology change.";
         }
       }
       description
         "Describes the outcome of the last attempt at a
          graceful restart, either by itself or acting
          as a helper.";
     }

     typedef packet-type {
       type enumeration {
         enum hello {
           value "1";
           description
             "OSPF Hello packet.";
         }
         enum database-description {
           value "2";
           description
             "OSPF Database Description packet.";
         }
         enum link-state-request {
           value "3";
           description
             "OSPF Link State Request packet.";
         }
         enum link-state-update {
           value "4";
           description
             "OSPF Link State Update packet.";
         }
         enum link-state-ack {
           value "5";



Yeung, et al.             Expires June 22, 2019                [Page 39]


Internet-Draft            OSPF YANG Data Model             December 2018


           description
             "OSPF Link State Acknowledgement packet.";
         }
       }
       description
         "OSPF packet type.";
     }

     typedef nssa-translator-state-type {
       type enumeration {
         enum enabled {
           value "1";
           description
             "NSSA translator enabled state.";
         }
         enum elected {
           description
             "NSSA translator elected state.";
         }
         enum disabled {
           value "3";
           description
             "NSSA translator disabled state.";
         }
       }
       description
         "OSPF NSSA translator state type.";
     }

     typedef restart-status-type {
       type enumeration {
         enum not-restarting {
           value "1";
           description
             "Router is not restarting.";
         }
         enum planned-restart {
           description
             "Router is going through planned restart.";
         }
         enum unplanned-restart {
           value "3";
           description
             "Router is going through unplanned restart.";
         }
       }
       description
         "OSPF graceful restart status type.";



Yeung, et al.             Expires June 22, 2019                [Page 40]


Internet-Draft            OSPF YANG Data Model             December 2018


     }

     typedef fletcher-checksum16-type {
       type string {
          pattern '(0x)?[0-9a-fA-F]{4}';
       }
        description
         "Fletcher 16-bit checksum in hex-string format 0xXXXX.";
        reference "RFC 905 - ISO Transport Protocol specification
                   ISO DP 8073";
     }

     typedef ospfv2-auth-trailer-rfc-version {
       type enumeration {
         enum rfc5709 {
           description
             "Support OSPF Authentication Trailer as
              described in RFC 5709";
           reference "RFC 5709 - OSPFv2 HMAC-SHA Cryptographic
                     Authentication";

         }
         enum rfc7474 {
           description
             "Support OSPF Authentication Trailer as
              described in RFC 7474";
           reference
             "RFC 7474 - Security Extension for OSPFv2
              When Using Manual Key Management Authentication";

         }
       }
       description
         "OSPFv2 Authentication Trailer Support";
     }

     grouping tlv {
       description
         "Type-Length-Value (TLV)";
       leaf type {
         type uint16;
         description "TLV type.";
       }
       leaf length {
         type uint16;
         description "TLV length (octets).";
       }
       leaf value {



Yeung, et al.             Expires June 22, 2019                [Page 41]


Internet-Draft            OSPF YANG Data Model             December 2018


         type yang:hex-string;
         description "TLV value.";
       }
     }

     grouping unknown-tlvs {
       description
         "Unknown TLVs grouping - Used for unknown TLVs or
          unknown sub-TLVs.";
       container unknown-tlvs {
         description "All unknown TLVs.";
         list unknown-tlv {
           description "Unknown TLV.";
           uses tlv;
         }
       }
     }

     grouping node-tag-tlv {
       description "OSPF Node Admin Tag TLV grouping.";
       list node-tag {
         leaf tag {
           type uint32;
           description
             "Node admin tag value.";
         }
         description
           "List of tags.";
       }
     }

     grouping router-capabilities-tlv {
       description "OSPF Router Capabilities TLV grouping.";
       reference "RFC 7770 - OSPF Router Capabilities";
       leaf informational-flags {
         type bits {
           bit graceful-restart-capability {
             description
               "When set, the router is capable of restarting
                gracefully.";
             reference "RFC 3623 - Graceful OSPF Restart
                        RFC 5187 - OSPFv3 Graceful Restart";
           }
           bit graceful-restart-helper {
             description
               "When set, the router is capable of acting as
                a graceful restart helper.";
             reference "RFC 3623 - Graceful OSPF Restart



Yeung, et al.             Expires June 22, 2019                [Page 42]


Internet-Draft            OSPF YANG Data Model             December 2018


                        RFC 5187 - OSPFv3 Graceful Restart";
           }
           bit stub-router {
             description
               "When set, the router is capable of acting as
                an OSPF Stub Router.";
             reference "RFC 6987 - OSPF Stub Router Advertisement";
           }
           bit traffic-engineering {
             description
               "When set, the router is capable of OSPF traffic
                engineering.";
             reference "RFC 3630 - Traffic Engineering (TE) Extensions
                        to OSPF Version 2
                        RFC 5329 - Traffic Engineering (TE) Extensions
                        to OSPF Version 3";
           }
           bit p2p-over-lan {
             description
               "When set, the router is capable of OSPF Point-to-Point
                over LAN.";
             reference "RFC 5309 - Point-to-Point Operation over LAN
                        in Link State Routing Protocols";
           }
           bit experimental-te {
             description
               "When set, the router is capable of OSPF experimental
                traffic engineering.";
             reference
               "RFC 4973 - OSPF-xTE OSPF Experimental Traffic
                Engineering";
           }
           bit two-part-metric {
             description
               "When set, the router is capable of supporting OSPF
                2-part metrics.";
             reference
               "RFC 8042 - OSPF Two-Part Metric";
           }
         }
         description
            "OSPF Router Informational Flag Definitions.";
       }
       list informational-capabilities {
         leaf informational-flag {
           type uint32;
           description
             "Informational flag.";



Yeung, et al.             Expires June 22, 2019                [Page 43]


Internet-Draft            OSPF YANG Data Model             December 2018


         }
         description
           "List of capabilities.";
       }
       list functional-capabilities {
         leaf informational-flag {
           type uint32;
           description
             "Functional flag.";
         }
         description
           "List of functional capabilities.";
       }
     }

     grouping dynamic-hostname-tlv {
       description "Dynamic Hostname TLV";
       reference "RFC 5642 - Dynamic Hostnames for OSPF";
       leaf hostname {
         type string;
         description "Dynamic Hostname";
       }
     }

     grouping sbfd-discriminator-tlv {
       description "Seamless BFD Descriminator TLV";
       reference "RFC 7884 - S-BFD Descriminators in OSPF";
       list sbfd-discriminators {
         leaf sbfd-discriminator {
           type uint32;
           description "Individual S-BFD Discriminator.";
         }
         description
           "List of S-BFD Discriminators";
       }
     }

     grouping maximum-sid-depth-tlv {
       description "Maximum SID Depth (MSD) TLV";
       reference
         "RFC 8476 - Signaling Maximum Segment Depth (MSD)
          using OSPF";
       list msd-type {
         leaf msd-type {
           type uint8;
           description "Maximum Segment Depth (MSD) type";
         }
         leaf msd-value {



Yeung, et al.             Expires June 22, 2019                [Page 44]


Internet-Draft            OSPF YANG Data Model             December 2018


           type uint8;
           description
             "Maximum Segment Depth (MSD) value for the type";
         }
         description
           "List of Maximum Segment Depth (MSD) tuples";
       }
     }

     grouping network-to-router-metric-tlv {
       description "Network to Router Metric TLV";
       reference
         "RFC 8042 - OSPF Two-Part Metric";
       leaf mt-id {
         type uint8;
         description
           "The MT-ID for the topology enabled on
            the link.";
       }
       leaf metric {
         type uint16;
         description "Metric for the topology.";
       }
     }

     grouping ospf-router-lsa-flags {
       leaf flags {
         type bits {
           bit V {
             description
               "When set, the router is an endpoint of one or
                  more virtual links.";
           }
           bit E {
             description
               "When set, the router is an AS Boundary Router
                  (ASBR).";
           }
           bit B {
             description
               "When set, the router is an Area Border
                  Router (ABR).";
           }
           bit Nt {
             description
               "When set, the router is an NSSA border router
                  that is unconditionally translating NSSA LSAs
                  into AS-external LSAs.";



Yeung, et al.             Expires June 22, 2019                [Page 45]


Internet-Draft            OSPF YANG Data Model             December 2018


           }
         }
         description "Router LSA Flags.";
       }
       description
         "Router LSA Flags - Currently common for OSPFv2 and
          OSPFv3 but it may diverge with future augmentations.";
     }

     grouping ospfv2-router-link {
       description "OSPFv2 router link.";
       leaf link-id {
         type union {
           type inet:ipv4-address;
           type yang:dotted-quad;
         }
         description "Router-LSA Link ID";
       }
       leaf link-data {
         type union {
           type inet:ipv4-address;
           type uint32;
         }
         description "Router-LSA Link data.";
       }
       leaf type {
         type router-link-type;
         description "Router-LSA Link type.";
       }
     }

     grouping ospfv2-lsa-body {
       description "OSPFv2 LSA body.";
       container router {
         when "derived-from-or-self(../../header/type, "
             + "'ospf:ospfv2-router-lsa')" {
           description
             "Only applies to Router-LSAs.";
         }
         description
           "Router LSA.";
         uses ospf-router-lsa-flags;
         leaf num-of-links {
           type uint16;
           description "Number of links in Router LSA.";
         }
         container links {
           description "All router Links.";



Yeung, et al.             Expires June 22, 2019                [Page 46]


Internet-Draft            OSPF YANG Data Model             December 2018


           list link {
             description "Router LSA link.";
             uses ospfv2-router-link;
             container topologies {
               description "All topologies for the link.";
               list topology {
                 description
                   "Topology specific information.";
                 leaf mt-id {
                   type uint8;
                   description
                     "The MT-ID for the topology enabled on
                      the link.";
                 }
                 leaf metric {
                   type uint16;
                   description "Metric for the topology.";
                 }
               }
             }
           }
         }
       }
       container network {
         when "derived-from-or-self(../../header/type, "
             + "'ospfv2-network-lsa')" {
           description
             "Only applies to Network LSAs.";
         }
         description
           "Network LSA.";
         leaf network-mask {
           type inet:ipv4-address;
           description
             "The IP address mask for the network.";
         }
         container attached-routers {
           description "All attached routers.";
           leaf-list attached-router {
             type yang:dotted-quad;
             description
               "List of the routers attached to the network.";
           }
         }
       }
       container summary {
         when "derived-from(../../header/type, "
            + "'ospfv2-summary-lsa-type')" {



Yeung, et al.             Expires June 22, 2019                [Page 47]


Internet-Draft            OSPF YANG Data Model             December 2018


           description
             "Only applies to Summary LSAs.";
         }
         description
           "Summary LSA.";
         leaf network-mask {
           type inet:ipv4-address;
           description
             "The IP address mask for the network";
         }
         container topologies {
           description "All topologies for the summary LSA.";
           list topology {
             description
               "Topology specific information.";
             leaf mt-id {
               type uint8;
               description
                 "The MT-ID for the topology enabled for
                  the summary.";
             }
             leaf metric {
               type ospf-metric;
               description "Metric for the topology.";
             }
           }
         }
       }
       container external {
         when "derived-from(../../header/type, "
            + "'ospfv2-external-lsa-type')" {
           description
             "Only applies to AS-external LSAs and NSSA LSAs.";
         }
         description
           "External LSA.";
         leaf network-mask {
           type inet:ipv4-address;
           description
             "The IP address mask for the network";
         }
         container topologies {
           description "All topologies for the external.";
           list topology {
             description
               "Topology specific information.";
             leaf mt-id {
               type uint8;



Yeung, et al.             Expires June 22, 2019                [Page 48]


Internet-Draft            OSPF YANG Data Model             December 2018


               description
                 "The MT-ID for the topology enabled for the
                  external or NSSA prefix.";
             }
             leaf flags {
               type bits {
                 bit E {
                   description
                     "When set, the metric specified is a Type 2
                      external metric.";
                 }
               }
               description "Flags.";
             }
             leaf metric {
               type ospf-metric;
               description "Metric for the topology.";
             }
             leaf forwarding-address {
               type inet:ipv4-address;
               description
                 "Forwarding address.";
             }
             leaf external-route-tag {
               type uint32;
               description
                 "Route tag for the topology.";
             }
           }
         }
       }
       container opaque {
         when "derived-from(../../header/type, "
            + "'ospfv2-opaque-lsa-type')" {
           description
             "Only applies to Opaque LSAs.";
         }
         description
           "Opaque LSA.";

         uses unknown-tlvs;

         container router-capabilities-tlv {
           description
             "Informational and functional router capabilities";
           uses router-capabilities-tlv;
         }




Yeung, et al.             Expires June 22, 2019                [Page 49]


Internet-Draft            OSPF YANG Data Model             December 2018


         container node-tag-tlvs {
           description
             "All node tag TLVs.";
           list node-tag-tlv {
             description
               "Node tag TLV.";
             uses node-tag-tlv;
           }
         }

         container dynamic-hostname-tlv {
           description "OSPF Dynamic Hostname";
           uses dynamic-hostname-tlv;
         }

         container sbfd-discriminator-tlv {
           description "OSPF S-BFD Discriminators";
           uses sbfd-discriminator-tlv;
         }

         container maximum-sid-depth-tlv {
           description "OSPF Maximum SID Depth (MSD) values";
           uses maximum-sid-depth-tlv;
         }

         container router-address-tlv {
           description
             "Router address TLV.";
           leaf router-address {
             type inet:ipv4-address;
             description
               "Router address.";
           }
         }

         container link-tlvs {
           description "All link TLVs in the LSA.";
           list link-tlv {
             description "Link TLV.";
             leaf link-type {
               type router-link-type;
               mandatory true;
               description "Link type.";
             }
             leaf link-id {
               type union {
                 type inet:ipv4-address;
                 type yang:dotted-quad;



Yeung, et al.             Expires June 22, 2019                [Page 50]


Internet-Draft            OSPF YANG Data Model             December 2018


               }
               mandatory true;
               description "Link ID.";
             }
             container local-if-ipv4-addrs {
               description "All local interface IPv4 addresses.";
               leaf-list local-if-ipv4-addr {
                 type inet:ipv4-address;
                 description
                   "List of local interface IPv4 addresses.";
               }
             }
             container remote-if-ipv4-addrs {
               description "All remote interface IPv4 addresses.";
               leaf-list remote-if-ipv4-addr {
                 type inet:ipv4-address;
                 description
                   "List of remote interface IPv4 addresses.";
               }
             }
             leaf te-metric {
               type uint32;
               description "TE metric.";
             }
             leaf max-bandwidth {
               type rt-types:bandwidth-ieee-float32;
               description "Maximum bandwidth.";
             }
             leaf max-reservable-bandwidth {
               type rt-types:bandwidth-ieee-float32;
               description "Maximum reservable bandwidth.";
             }
             container unreserved-bandwidths {
               description "All unreserved bandwidths.";
               list unreserved-bandwidth {
                 leaf priority {
                   type uint8 {
                     range "0 .. 7";
                   }
                   description "Priority from 0 to 7.";
                 }
                 leaf unreserved-bandwidth {
                   type rt-types:bandwidth-ieee-float32;
                   description "Unreserved bandwidth.";
                 }
                 description
                   "List of unreserved bandwidths for different
                    priorities.";



Yeung, et al.             Expires June 22, 2019                [Page 51]


Internet-Draft            OSPF YANG Data Model             December 2018


               }
             }
             leaf admin-group {
               type uint32;
               description
                 "Administrative group/Resource Class/Color.";
             }
             leaf network-to-router-te-metric {
               type uint32;
               description "Network to Router TE metric.";
               reference
                 "RFC 8042 - OSPF Two-Part Metric";
             }
             uses unknown-tlvs;
           }
         }

         container extended-prefix-tlvs {
           description "All extended prefix TLVs in the LSA.";
           list extended-prefix-tlv {
             description "Extended prefix TLV.";
             leaf route-type {
               type enumeration {
                 enum unspecified {
                   value "0";
                   description "Unspecified.";
                 }
                 enum intra-area {
                   value "1";
                   description "OSPF intra-area route.";
                 }
                 enum inter-area {
                   value "3";
                   description "OSPF inter-area route.";
                 }
                 enum external {
                   value "5";
                   description "OSPF External route.";
                 }
                 enum nssa {
                   value "7";
                   description "OSPF NSSA external route.";
                 }
               }
               description "Route type.";
             }
             leaf flags {
               type bits {



Yeung, et al.             Expires June 22, 2019                [Page 52]


Internet-Draft            OSPF YANG Data Model             December 2018


                 bit A {
                   description
                     "Attach flag.";
                 }
                 bit N {
                   description
                     "Node flag.";
                 }
               }
               description "Prefix Flags.";
             }
             leaf prefix {
               type inet:ip-prefix;
               description "Address prefix.";
             }
             uses unknown-tlvs;
           }
         }

         container extended-link-tlvs {
           description "All extended link TLVs in the LSA.";
           list extended-link-tlv {
             description "Extended link TLV.";
             uses ospfv2-router-link;
             container maximum-sid-depth-tlv {
               description "OSPF Maximum SID Depth (MSD) values";
               uses maximum-sid-depth-tlv;
             }
             container network-to-router-metric-tlv {
               description
                 "OSPF two-part metric network-to-router metric";
               uses network-to-router-metric-tlv;
             }
             uses unknown-tlvs;
           }
         }
       }
     }

     grouping ospfv3-lsa-options {
       description "OSPFv3 LSA options";
       leaf options {
         type bits {
           bit AF {
             description
               "When set, the router supprts OSPFv3 Address
                Families as in RFC5838.";
           }



Yeung, et al.             Expires June 22, 2019                [Page 53]


Internet-Draft            OSPF YANG Data Model             December 2018


           bit DC {
             description
               "When set, the router supports demand circuits.";
           }
           bit R {
             description
               "When set, the originator is an active router.";
           }
           bit N {
             description
               "If set, the router is attached to an NSSA";
           }
           bit E {
             description
               "This bit describes the way AS-external LSAs
                are flooded";
           }
           bit V6 {
             description
               "If clear, the router/link should be excluded
                from IPv6 routing calculaton";
           }
         }
         mandatory true;
         description "OSPFv3 LSA options.";
       }
     }

     grouping ospfv3-lsa-prefix {
       description
         "OSPFv3 LSA prefix.";

       leaf prefix {
         type inet:ip-prefix;
         description
           "LSA Prefix.";
       }
       leaf prefix-options {
         type bits {
           bit NU {
             description
               "When set, the prefix should be excluded
                from IPv6 unicast calculations.";
           }
           bit LA {
             description
               "When set, the prefix is actually an IPv6 interface
                address of the Advertising Router.";



Yeung, et al.             Expires June 22, 2019                [Page 54]


Internet-Draft            OSPF YANG Data Model             December 2018


           }
           bit P {
             description
               "When set, the NSSA area prefix should be
                translated to an AS External LSA and readvertised
                by the translating NSSA Border Router.";
           }
           bit DN {
             description
               "When set, the inter-area-prefix LSA or
                AS-external LSA prefix has been advertised as an
                L3VPN prefix.";
           }
         }
         mandatory true;
         description "Prefix options.";
       }
     }

     grouping ospfv3-lsa-external {
       description
         "AS-External and NSSA LSA.";
       leaf metric {
         type ospf-metric;
         description "Metric";
       }

       leaf flags {
         type bits {
           bit E {
             description
               "When set, the metric specified is a Type 2
                external metric.";
           }
           bit F {
             description
               "When set, a Forwarding Address is included
                in the LSA.";
           }
           bit T {
             description
               "When set, an External Route Tag is included
                in the LSA.";
           }
         }
         description "Flags.";
       }




Yeung, et al.             Expires June 22, 2019                [Page 55]


Internet-Draft            OSPF YANG Data Model             December 2018


       leaf referenced-ls-type {
         type identityref {
           base ospf:ospfv3-lsa-type;
         }
         description "Referenced Link State type.";
       }
       leaf unknown-referenced-ls-type {
         type uint16;
         description
           "Value for an unknown Referenced Link State type.";
       }

       uses ospfv3-lsa-prefix;

       leaf forwarding-address {
         type inet:ipv6-address;
         description
           "Forwarding address.";
       }

       leaf external-route-tag {
         type uint32;
         description
           "Route tag.";
       }
       leaf referenced-link-state-id {
         type yang:dotted-quad;
         description
           "Referenced Link State ID.";
       }
     }

     grouping ospfv3-lsa-body {
       description "OSPFv3 LSA body.";
       container router {
         when "derived-from-or-self(../../header/type, "
            + "'ospfv3-router-lsa')" {
           description
             "Only applies to Router LSAs.";
         }
         description "Router LSA.";
         uses ospf-router-lsa-flags;
         uses ospfv3-lsa-options;

         container links {
           description "All router link.";
           list link {
             description "Router LSA link.";



Yeung, et al.             Expires June 22, 2019                [Page 56]


Internet-Draft            OSPF YANG Data Model             December 2018


             leaf interface-id {
               type uint32;
               description "Interface ID for link.";
             }
             leaf neighbor-interface-id {
               type uint32;
               description "Neighbor's Interface ID for link.";
             }
             leaf neighbor-router-id {
               type rt-types:router-id;
               description "Neighbor's Router ID for link.";
             }
             leaf type {
               type router-link-type;
               description "Link type: 1 - Point-to-Point Link
                                       2 - Transit Network Link
                                       3 - Stub Network Link Link
                                       4 - Virtual Link";
             }
             leaf metric {
               type uint16;
                 description "Link Metric.";
             }
           }
         }
       }
       container network {
         when "derived-from-or-self(../../header/type, "
            + "'ospfv3-network-lsa')" {
           description
             "Only applies to Network LSAs.";
         }
         description "Network LSA.";

         uses ospfv3-lsa-options;

         container attached-routers {
           description "All attached routers.";
           leaf-list attached-router {
             type yang:dotted-quad;
             description
               "List of the routers attached to the network.";
           }
         }
       }
       container inter-area-prefix {
         when "derived-from-or-self(../../header/type, "
            + "'ospfv3-inter-area-prefix-lsa')" {



Yeung, et al.             Expires June 22, 2019                [Page 57]


Internet-Draft            OSPF YANG Data Model             December 2018


           description
             "Only applies to Inter-Area-Prefix LSAs.";
         }
         leaf metric {
           type ospf-metric;
           description "Inter-Area Prefix Metric";
         }
         uses ospfv3-lsa-prefix;
         description "Prefix LSA.";
       }
       container inter-area-router {
         when "derived-from-or-self(../../header/type, "
            + "'ospfv3-inter-area-router-lsa')" {
           description
             "Only applies to Inter-Area-Router LSAs.";
         }
         uses ospfv3-lsa-options;
         leaf metric {
           type ospf-metric;
           description "AS Boundary Router (ASBR) Metric.";
         }
         leaf destination-router-id {
           type rt-types:router-id;
           description
             "The Router ID of the ASBR described by the LSA.";
         }
         description "Inter-Area-Router LSA.";
       }
       container as-external {
         when "derived-from-or-self(../../header/type, "
            + "'ospfv3-as-external-lsa')" {
           description
             "Only applies to AS-external LSAs.";
         }

         uses ospfv3-lsa-external;

         description "AS-External LSA.";
       }
       container nssa {
         when "derived-from-or-self(../../header/type, "
            + "'ospfv3-nssa-lsa')" {
           description
             "Only applies to NSSA LSAs.";
         }
         uses ospfv3-lsa-external;

         description "NSSA LSA.";



Yeung, et al.             Expires June 22, 2019                [Page 58]


Internet-Draft            OSPF YANG Data Model             December 2018


       }
       container link {
         when "derived-from-or-self(../../header/type, "
            + "'ospfv3-link-lsa')" {
           description
             "Only applies to Link LSAs.";
         }
         leaf rtr-priority {
           type uint8;
           description "Router Priority for the interface.";
         }
         uses ospfv3-lsa-options;

         leaf link-local-interface-address {
           type inet:ipv6-address;
           description
             "The originating router's link-local
              interface address for the link.";
         }

         leaf num-of-prefixes {
           type uint32;
           description "Number of prefixes.";
         }

         container prefixes {
           description "All prefixes for the link.";
           list prefix {
             description
               "List of prefixes associated with the link.";
             uses ospfv3-lsa-prefix;
           }
         }
         description "Link LSA.";
       }
       container intra-area-prefix {
         when "derived-from-or-self(../../header/type, "
            + "'ospfv3-intra-area-prefix-lsa')" {
           description
             "Only applies to Intra-Area-Prefix LSAs.";
         }
         description "Intra-Area-Prefix LSA.";

         leaf referenced-ls-type {
           type identityref {
             base ospf:ospfv3-lsa-type;
           }
           description "Referenced Link State type.";



Yeung, et al.             Expires June 22, 2019                [Page 59]


Internet-Draft            OSPF YANG Data Model             December 2018


         }
         leaf unknown-referenced-ls-type {
           type uint16;
           description
             "Value for an unknown Referenced Link State type.";
         }
         leaf referenced-link-state-id {
           type yang:dotted-quad;
           description
             "Referenced Link State ID.";
         }
         leaf referenced-adv-router {
           type rt-types:router-id;
           description
             "Referenced Advertising Router.";
         }

         leaf num-of-prefixes {
           type uint16;
           description "Number of prefixes.";
         }
         container prefixes {
           description "All prefixes in this LSA.";
           list prefix {
             description "List of prefixes in this LSA.";
             uses ospfv3-lsa-prefix;
             leaf metric {
               type ospf-metric;
               description "Prefix Metric.";
             }
           }
         }
       }
       container router-information {
         when "derived-from-or-self(../../header/type, "
            + "'ospfv3-router-information-lsa')" {
           description
             "Only applies to Router Information LSAs (RFC7770).";
         }
         container router-capabilities-tlv {
           description
             "Informational and functional router capabilities";
           uses router-capabilities-tlv;
         }
         container node-tag-tlvs {
           description
             "All node tag tlvs.";
           list node-tag-tlv {



Yeung, et al.             Expires June 22, 2019                [Page 60]


Internet-Draft            OSPF YANG Data Model             December 2018


             description
               "Node tag tlv.";
             uses node-tag-tlv;
           }
         }
         container dynamic-hostname-tlv {
           description "OSPF Dynamic Hostname";
           uses dynamic-hostname-tlv;
         }
         container sbfd-discriminator-tlv {
           description "OSPF S-BFD Discriminators";
           uses sbfd-discriminator-tlv;
         }
         description "Router Information LSA.";
         reference "RFC 7770 -Extensions for Advertising Router
                    Capabilities";
       }
     }

     grouping lsa-header {
       description
           "Common LSA for OSPFv2 and OSPFv3";
       leaf age {
         type uint16;
         mandatory true;
         description "LSA age.";
       }
       leaf type {
         type identityref {
           base ospf-lsa-type;
         }
         mandatory true;
         description "LSA type";
       }
       leaf adv-router {
         type rt-types:router-id;
         mandatory true;
         description "LSA advertising router.";
       }
       leaf seq-num {
         type uint32;
         mandatory true;
         description "LSA sequence number.";
       }
       leaf checksum {
         type fletcher-checksum16-type;
         mandatory true;
         description "LSA checksum.";



Yeung, et al.             Expires June 22, 2019                [Page 61]


Internet-Draft            OSPF YANG Data Model             December 2018


       }
       leaf length {
         type uint16;
         mandatory true;
         description "LSA length including the header.";
       }
     }

     grouping ospfv2-lsa {
       description
           "OSPFv2 LSA - LSAs are uniquely identified by
            the <LSA Type, Link-State ID, Advertising Router>
            tuple with the sequence number differentiating
            LSA instances.";
       container header {
         must "(derived-from(type, "
            + "'ospfv2-opaque-lsa-type') and "
            + "opaque-id and opaque-type) or "
            + "(not(derived-from(type, "
            + "'ospfv2-opaque-lsa-type')) "
            + "and not(opaque-id) and not(opaque-type))" {
           description
             "Opaque type and ID only apply to Opaque LSAs.";
         }
         description
           "Decoded OSPFv2 LSA header data.";
         leaf option {
           type bits {
             bit MT {
               description
                 "When set, the router supports multi-topology as
                  in RFC 4915.";
             }
             bit DC {
               description
                 "When set, the router supports demand circuits.";
             }
             bit P {
               description
                 "Only used in type-7 LSA. When set, an NSSA
                  border router should translate the type-7 LSA
                  to a type-5 LSA.";
             }
             bit MC {
               description
                 "When set, the router supports MOSPF.";
             }
             bit E {



Yeung, et al.             Expires June 22, 2019                [Page 62]


Internet-Draft            OSPF YANG Data Model             December 2018


               description
                 "This bit describes the way AS-external LSAs
                  are flooded.";
             }
             bit O {
               description
                 "When set, the router is opaque-capable as in
                  RFC 5250.";
             }
             bit DN {
               description
                 "When a type 3, 5 or 7 LSA is sent from a PE to a CE,
                  the DN bit must be set. See RFC 4576.";
             }
           }
           mandatory true;
           description "LSA options.";
         }
         leaf lsa-id {
           type yang:dotted-quad;
           mandatory true;
           description "Link-State ID.";
         }

         leaf opaque-type {
           type uint8;
           description "Opaque type.";
         }

         leaf opaque-id {
           type opaque-id;
           description "Opaque ID.";
         }

         uses lsa-header;
       }
       container body {
         description
           "Decoded OSPFv2 LSA body data.";
         uses ospfv2-lsa-body;
       }
     }

     grouping ospfv3-lsa {
       description
           "Decoded OSPFv3 LSA.";
       container header {
         description



Yeung, et al.             Expires June 22, 2019                [Page 63]


Internet-Draft            OSPF YANG Data Model             December 2018


           "Decoded OSPFv3 LSA header data.";
         leaf lsa-id {
           type uint32;
           mandatory true;
           description "OSPFv3 LSA ID.";
         }
         uses lsa-header;
       }
       container body {
         description
           "Decoded OSPF LSA body data.";
         uses ospfv3-lsa-body;
       }
     }
     grouping lsa-common {
       description
           "Common fields for OSPF LSA represenation.";
       leaf decoded-completed {
         type boolean;
         description
           "The OSPF LSA body is fully decoded.";
       }
       leaf raw-data {
         type yang:hex-string;
         description
           "The complete LSA in network byte
            order hexadecimal as received or originated.";
       }
     }

     grouping lsa {
       description
           "OSPF LSA.";
       uses lsa-common;
       choice version {
         description
           "OSPFv2 or OSPFv3 LSA body.";
         container ospfv2 {
           description "OSPFv2 LSA";
           uses ospfv2-lsa;
         }
         container ospfv3 {
           description "OSPFv3 LSA";
           uses ospfv3-lsa;
         }
       }
     }




Yeung, et al.             Expires June 22, 2019                [Page 64]


Internet-Draft            OSPF YANG Data Model             December 2018


     grouping lsa-key {
       description
         "OSPF LSA key.";
       leaf lsa-id {
         type union {
           type yang:dotted-quad;
           type uint32;
         }
         description
           "Link-State ID.";
       }
       leaf adv-router {
         type rt-types:router-id;
         description
           "Advertising router.";
       }
     }

     grouping instance-stat {
       description "Per-instance statistics";
       leaf originate-new-lsa-count {
         type yang:counter32;
         description "The number of new LSAs originated.";
       }
       leaf rx-new-lsas-count {
         type yang:counter32;
         description "The number of LSAs received.";
       }
       leaf as-scope-lsa-count {
         type yang:gauge32;
         description "The number of AS-scope LSAs.";
       }
       leaf as-scope-lsa-chksum-sum {
         type uint32;
         description
           "The sum of the LSA checksums for AS-scope LSAs.";
       }
       container database {
         description "Container for per AS-scope LSA statistics.";
         list as-scope-lsa-type {
           description "List of AS-scope LSA statistics";
           leaf lsa-type {
             type uint16;
             description "AS-Scope LSA type.";
           }
           leaf lsa-count {
             type yang:gauge32;
             description "The number of LSAs of the LSA type.";



Yeung, et al.             Expires June 22, 2019                [Page 65]


Internet-Draft            OSPF YANG Data Model             December 2018


           }
           leaf lsa-cksum-sum {
             type uint32;
             description
               "The sum of the LSA checksums of the LSA type.";
           }
         }
       }
       uses instance-fast-reroute-state;
     }

     grouping area-stat {
       description "Per-area statistics.";
       leaf spf-runs-count {
         type yang:counter32;
         description
           "The number of times the intra-area SPF has run.";
       }
       leaf abr-count {
         type yang:gauge32;
         description
           "The total number of Area Border Routers (ABRs)
            reachable within this area.";
       }
       leaf asbr-count {
         type yang:gauge32;
         description
           "The total number of AS Boundary Routers (ASBRs).";
       }
       leaf ar-nssa-translator-event-count {
         type yang:counter32;
         description
           "The number of NSSA translator-state changes.";
       }
       leaf area-scope-lsa-count {
         type yang:gauge32;
         description
           "The number of area-scope LSAs in the area.";
       }
       leaf area-scope-lsa-cksum-sum {
         type uint32;
         description "The sum of the area-scope LSAs checksums.";
       }
       container database {
         description "Container for area-scope LSA type statistics.";
         list area-scope-lsa-type {
           description "List of area-scope LSA statistics";
           leaf lsa-type {



Yeung, et al.             Expires June 22, 2019                [Page 66]


Internet-Draft            OSPF YANG Data Model             December 2018


             type uint16;
             description "Area-scope LSA type.";
           }
           leaf lsa-count {
             type yang:gauge32;
             description "The number of LSAs of the LSA type.";
           }
           leaf lsa-cksum-sum {
             type uint32;
             description
               "The sum of the LSA checksums of the LSA type.";
           }
         }
       }
     }

     grouping interface-stat {
       description "Per-interface statistics";
       leaf if-event-count {
         type yang:counter32;
         description
           "The number of times this interface has changed its
            state or an error has occurred.";
       }
       leaf link-scope-lsa-count {
         type yang:gauge32;
         description "The number of link-scope LSAs.";
       }
       leaf link-scope-lsa-cksum-sum {
         type uint32;
         description "The sum of link-scope LSA checksums.";
       }
       container database {
         description "Container for link-scope LSA type statistics.";
         list link-scope-lsa-type {
           description "List of link-scope LSA statistics";
           leaf lsa-type {
             type uint16;
             description "Link scope LSA type.";
           }
           leaf lsa-count {
             type yang:gauge32;
             description "The number of LSAs of the LSA type.";
           }
           leaf lsa-cksum-sum {
             type uint32;
             description
               "The sum of the LSA checksums of the LSA type.";



Yeung, et al.             Expires June 22, 2019                [Page 67]


Internet-Draft            OSPF YANG Data Model             December 2018


           }
         }
       }
     }

     grouping neighbor-stat {
       description "Per-neighbor statistics.";
       leaf nbr-event-count {
         type yang:counter32;
         description
           "The number of times this neighbor has changed
            state or an error has occurred.";
       }
       leaf nbr-retrans-qlen {
         type yang:gauge32;
         description
           "The current length of the retransmission queue.";
       }
     }

     grouping instance-fast-reroute-config {
       description
         "This group defines global configuration of IP
          Fast ReRoute (FRR).";
       container fast-reroute {
         if-feature fast-reroute;
         description
           "This container may be augmented with global
            parameters for IP-FRR.";
         container lfa {
           if-feature lfa;
           description
             "This container may be augmented with
              global parameters for Loop-Free Alternatives (LFA).
              Container creation has no effect on LFA activation.";
         }
       }
     }

     grouping instance-fast-reroute-state {
       description "IPFRR state data grouping";

       container protected-routes {
         if-feature fast-reroute;
         config false;
         description "Instance protection statistics";

         list address-family-stats {



Yeung, et al.             Expires June 22, 2019                [Page 68]


Internet-Draft            OSPF YANG Data Model             December 2018


           key "address-family prefix alternate";
           description
             "Per Address Family protected prefix information";

           leaf address-family {
             type iana-rt-types:address-family;
             description
               "Address-family";
           }
           leaf prefix {
             type string;
             description
               "Protected prefix.";
           }
           leaf alternate {
             type string;
             description
               "Alternate nexthop for the prefix.";
           }
           leaf alternate-type {
             type enumeration {
               enum equal-cost {
                 description
                   "ECMP alternate.";
               }
               enum lfa {
                 description
                   "LFA alternate.";
               }
               enum remote-lfa {
                 description
                   "Remote LFA alternate.";
               }
               enum tunnel {
                 description
                   "Tunnel based alternate
                    (like RSVP-TE or GRE).";
               }
               enum ti-lfa {
                 description
                   "TI-LFA alternate.";
               }
               enum mrt {
                 description
                   "MRT alternate.";
               }
               enum other {
                 description



Yeung, et al.             Expires June 22, 2019                [Page 69]


Internet-Draft            OSPF YANG Data Model             December 2018


                   "Unknown alternate type.";
               }
             }
             description
               "Type of alternate.";
           }
           leaf best {
             type boolean;
             description
               "Indicates if the alternate is the preferred.";
           }
           leaf non-best-reason {
             type string;
             description
               "Information field to describe why the alternate
                is not best.";
           }
           leaf protection-available {
             type bits {
               bit node-protect {
                 position 0;
                 description
                   "Node protection available.";
               }
               bit link-protect {
                 position 1;
                 description
                   "Link protection available.";
               }
               bit srlg-protect {
                 position 2;
                 description
                   "SRLG protection available.";
               }
               bit downstream-protect {
                 position 3;
                 description
                   "Downstream protection available.";
               }
               bit other {
                 position 4;
                 description
                   "Other protection available.";
               }
             }
             description "Protection provided by the alternate.";
           }
           leaf alternate-metric1 {



Yeung, et al.             Expires June 22, 2019                [Page 70]


Internet-Draft            OSPF YANG Data Model             December 2018


             type uint32;
             description
               "Metric from Point of Local Repair (PLR) to
                destination through the alternate path.";
           }
           leaf alternate-metric2 {
             type uint32;
             description
               "Metric from PLR to the alternate node";
           }
           leaf alternate-metric3 {
             type uint32;
             description
               "Metric from alternate node to the destination";
           }
         }
       }

       container unprotected-routes {
         if-feature fast-reroute;
         config false;
         description "List of prefixes that are not protected";

         list address-family-stats {
           key "address-family prefix";
           description
             "Per Address Family (AF) unprotected prefix statistics.";

           leaf address-family {
             type iana-rt-types:address-family;
             description "Address-family";
           }
           leaf prefix {
             type string;
             description "Unprotected prefix.";
           }
         }
       }

       list protection-statistics {
         key frr-protection-method;
         config false;
         description "List protection method statistics";

         leaf frr-protection-method {
           type string;
           description "Protection method used.";
         }



Yeung, et al.             Expires June 22, 2019                [Page 71]


Internet-Draft            OSPF YANG Data Model             December 2018


         list address-family-stats {
           key address-family;
           description "Per Address Family protection statistics.";

           leaf address-family {
             type iana-rt-types:address-family;
             description "Address-family";
           }
           leaf total-routes {
             type uint32;
             description "Total prefixes.";
           }
           leaf unprotected-routes {
             type uint32;
             description
               "Total prefixes that are not protected.";
           }
           leaf protected-routes {
             type uint32;
             description
               "Total prefixes that are protected.";
           }
           leaf linkprotected-routes {
             type uint32;
             description
               "Total prefixes that are link protected.";
           }
           leaf nodeprotected-routes {
             type uint32;
             description
               "Total prefixes that are node protected.";
           }
         }
       }
     }

     grouping interface-fast-reroute-config {
       description
         "This group defines interface configuration of IP-FRR.";
       container fast-reroute {
         if-feature fast-reroute;
         container lfa {
           if-feature lfa;
           leaf candidate-enable {
             type boolean;
             default true;
             description
               "Enable the interface to be used as backup.";



Yeung, et al.             Expires June 22, 2019                [Page 72]


Internet-Draft            OSPF YANG Data Model             December 2018


           }
           leaf enable {
             type boolean;
             default false;
             description
               "Activates LFA - Per-prefix LFA computation
                is assumed.";
           }
           container remote-lfa {
             if-feature remote-lfa;
             leaf enable {
               type boolean;
               default false;
               description
               "Activates Remote LFA (R-LFA).";
             }
             description
               "Remote LFA configuration.";
           }
           description
             "LFA configuration.";
         }
         description
           "Interface IP Fast-reroute configuration.";
       }
     }

     grouping interface-physical-link-config {
       description
         "Interface cost configuration that only applies to
          physical interfaces (non-virtual) and sham links.";
       leaf cost {
         type uint16 {
           range "1..65535";
         }
         description
           "Interface cost.";
       }
       leaf mtu-ignore {
         if-feature mtu-ignore;
         type boolean;
         description
           "Enable/Disable bypassing the MTU mismatch check in
            Database Description packets.";
       }
       leaf prefix-suppression {
         if-feature prefix-suppression;
         type boolean;



Yeung, et al.             Expires June 22, 2019                [Page 73]


Internet-Draft            OSPF YANG Data Model             December 2018


         description
           "Suppress advertisement of the prefixes associated
            with the interface.";
       }
       leaf two-part-metric {
         if-feature two-part-metric;
         type boolean;
         description
           "Support advertisement and computation of the 2-part
            metric.";
       }
     }

     grouping interface-common-config {
       description
         "Common configuration for all types of interfaces,
          including virtual links and sham links.";

       leaf hello-interval {
         type uint16 {
           range "1..65535";
         }
         description
           "Interval between hello packets (seconds). It must
            be the same for all routers on the same network.
            Different networks, implementations, and deployments
            will use different hello-intervals. A sample value
            for a LAN network would be 10 seconds.";
       }

       leaf dead-interval {
         type uint32 {
           range "1..2147483647";
         }
         units seconds;
         must "../dead-interval > ../hello-interval" {
           error-message "The dead interval must be "
                       + "larger than the hello interval";
           description
             "The value MUST be greater than 'hello-internval'.";
         }
         description
           "Interval after which a neighbor is declared down
            (seconds) if hello packets are not received. It is
            typically 3 or 4 times the hello-interval. A typical
            value for LAN networks is 40 seconds.";
       }




Yeung, et al.             Expires June 22, 2019                [Page 74]


Internet-Draft            OSPF YANG Data Model             December 2018


       leaf retransmit-interval {
         type uint16 {
           range "1..3600";
         }
         units seconds;
         description
           "Interval between retransmitting unacknowledged Link
            State Advertisements (LSAs) (seconds). This should
            be well over the round-trip transmit delay for
            any two routers on the network. A sample value
            would be 5 seconds.";
       }

       leaf transmit-delay {
         type uint16 {
           range "1..3600";
         }
         units seconds;
         description
           "Estimated time needed to transmit Link State Update
            (LSU) packets on the interface (seconds). LSAs have
            their age incremented by this amount on advertised
            on the interface. A sample value would be 1 second.";
       }

       leaf lls {
         if-feature lls;
         type boolean;
         description
           "Enable/Disable link-local signaling (LLS) support.";
       }

       container ttl-security {
         if-feature ttl-security;
         description "Time to Live (TTL) security check.";
         leaf enable {
           type boolean;
           description
             "Enable/Disable TTL security check.";
         }
         leaf hops {
           type uint8 {
             range "1..254";
           }
           description
             "Maximum number of hops that an OSPF packet may
              have traversed before reception.";
         }



Yeung, et al.             Expires June 22, 2019                [Page 75]


Internet-Draft            OSPF YANG Data Model             December 2018


       }
       leaf enable {
         if-feature admin-control;
         type boolean;
         default true;
         description
           "Enable/disable OSPF protocol on the interface.";
       }

       container authentication {
         description "Authentication configuration.";
         choice auth-type-selection {
           description
             "Options for OSPFv2/OSPFv3 authentication
              configuration.";
           case ospfv2-auth {
             when "derived-from-or-self(../../../../../../rt:type, "
               +  "'ospf:ospfv2')" {
               description "Applied to OSPFv2 only.";
             }
             leaf ospfv2-auth-trailer-rfc {
               if-feature ospfv2-authentication-trailer;
               type ospfv2-auth-trailer-rfc-version;
               description
                 "Version of OSFPv2 authentication trailer support -
                  RFC 5709 or RFC 7474";
             }
             choice ospfv2-auth-specification {
               description
                 "Key chain or explicit key parameter specification";
               case auth-key-chain {
                 if-feature key-chain;
                 leaf ospfv2-key-chain {
                   type key-chain:key-chain-ref;
                   description
                     "key-chain name.";
                 }
               }
               case auth-key-explicit {
                 leaf ospfv2-key-id {
                   type uint32;
                   description
                     "Key Identifier";
                 }
                 leaf ospfv2-key {
                   type string;
                   description
                     "Key string in ASCII format.";



Yeung, et al.             Expires June 22, 2019                [Page 76]


Internet-Draft            OSPF YANG Data Model             December 2018


                 }
                 leaf ospfv2-crypto-algorithm {
                   type identityref {
                     base key-chain:crypto-algorithm;
                   }
                   description
                     "Cryptographic algorithm associated with key.";
                 }
               }
             }
           }
           case ospfv3-auth-ipsec {
             when "derived-from-or-self(../../../../../../rt:type, "
               +  "'ospf:ospfv3')" {
               description "Applied to OSPFv3 only.";
             }
             if-feature ospfv3-authentication-ipsec;
             leaf sa {
                 type string;
                 description
                   "Security Association (SA) name.";
             }
           }
           case ospfv3-auth-trailer {
             when "derived-from-or-self(../../../../../../rt:type, "
               +  "'ospf:ospfv3')" {
               description "Applied to OSPFv3 only.";
             }
             if-feature ospfv3-authentication-trailer;
             choice ospfv3-auth-specification {
               description
                 "Key chain or explicit key parameter specification";
               case auth-key-chain {
                 if-feature key-chain;
                 leaf ospfv3-key-chain {
                   type key-chain:key-chain-ref;
                   description
                     "key-chain name.";
                 }
               }
               case auth-key-explicit {
                 leaf ospfv3-sa-id {
                   type uint16;
                   description
                     "Security Association (SA) Identifier";
                 }
                 leaf ospfv3-key {
                   type string;



Yeung, et al.             Expires June 22, 2019                [Page 77]


Internet-Draft            OSPF YANG Data Model             December 2018


                   description
                     "Key string in ASCII format.";
                 }
                 leaf ospfv3-crypto-algorithm {
                   type identityref {
                     base key-chain:crypto-algorithm;
                   }
                   description
                     "Cryptographic algorithm associated with key.";
                 }
               }
             }
           }
         }
       }
     }

     grouping interface-config {
       description "Configuration for real interfaces.";

       leaf interface-type {
         type enumeration {
           enum "broadcast" {
             description
               "Specify OSPF broadcast multi-access network.";
           }
           enum "non-broadcast" {
             description
               "Specify OSPF Non-Broadcast Multi-Access
                (NBMA) network.";
           }
           enum "point-to-multipoint" {
             description
               "Specify OSPF point-to-multipoint network.";
           }
           enum "point-to-point" {
             description
               "Specify OSPF point-to-point network.";
           }
           enum "hybrid" {
             if-feature hybrid-interface;
             description
               "Specify OSPF hybrid broadcast/P2MP network.";
           }
         }
         description
           "Interface type.";
       }



Yeung, et al.             Expires June 22, 2019                [Page 78]


Internet-Draft            OSPF YANG Data Model             December 2018


       leaf passive {
         type boolean;
         description
           "Enable/Disable passive interface - a passive interface's
            prefix will be advertised but no neighbor adjacencies
            will be formed on the interface.";
       }

       leaf demand-circuit {
         if-feature demand-circuit;
         type boolean;
         description
           "Enable/Disable demand circuit.";
       }

       leaf priority {
         type uint8;
         description
           "Configure OSPF router priority. On multi-access network
            this value is for Designated Router (DR) election. The
            priority is ignored on other interface types. A value
            of 0 indicates the router is not eligible to become
            Designated Router or Backup Designated Router (BDR).";
       }

       container multi-areas {
         if-feature multi-area-adj;
         description "Container for multi-area config.";
         list multi-area {
           key multi-area-id;
           description
             "Configure OSPF multi-area adjacency.";
           leaf multi-area-id {
             type area-id-type;
             description
               "Multi-area adjacency area ID.";
           }
           leaf cost {
             type uint16;
             description
               "Interface cost for multi-area adjacency.";
           }
         }
       }

       container static-neighbors {
         description "Statically configured neighbors.";




Yeung, et al.             Expires June 22, 2019                [Page 79]


Internet-Draft            OSPF YANG Data Model             December 2018


         list neighbor {
           key "identifier";
           description
             "Specify a static OSPF neighbor.";

           leaf identifier {
             type inet:ip-address;
             description
               "Neighbor Router ID, IPv4 address, or IPv6 address.";
           }

           leaf cost {
             type uint16 {
               range "1..65535";
             }
             description
               "Neighbor cost. Different implementations have different
                default costs with some defaulting to a cost inversely
                proportioal to the interface speed. Others will default
                to 1 equating the cost to a hop count." ;
           }
           leaf poll-interval {
             type uint16 {
               range "1..65535";
             }
             units seconds;
             description
               "Neighbor poll interval (seconds) for sending OSPF
                hello packets to discover the neighbor on NBMA
                networks. This interval dictates the granularity for
                discovery of new neighbors. A sample would be 2 minutes
                for a legacy Packet Data Network (PDN) X.25 network.";
           }
           leaf priority {
             type uint8 {
               range "1..255";
             }
             description "Neighbor priority for DR election.";
           }
         }
       }

       leaf node-flag {
         if-feature node-flag;
         type boolean;
         default false;
         description
           "Set prefix as identifying the advertising router.";



Yeung, et al.             Expires June 22, 2019                [Page 80]


Internet-Draft            OSPF YANG Data Model             December 2018


         reference "RFC 7684 - OSPFv2 Prefix/Link Attribute
                    Advertisement";
       }

       container bfd {
         if-feature bfd;
         description "BFD Client Configuration.";
         uses bfd-types:client-cfg-parms;
         reference "draft-ietf-bfd-yang-xx.txt:
                    YANG Data Model for Bidirectional Forwarding
                    Detection (BFD)";
       }

       uses interface-fast-reroute-config;
       uses interface-common-config;
       uses interface-physical-link-config;
     }

     grouping neighbor-state {
       description
         "OSPF neighbor operational state.";

       leaf address {
         type inet:ip-address;
         config false;
         description
           "Neighbor address.";
       }
       leaf dr-router-id {
         type rt-types:router-id;
         config false;
         description "Neighbor's Designated Router (DR) Router ID.";
       }

       leaf dr-ip-addr {
         type inet:ip-address;
         config false;
         description "Neighbor's Designated Router (DR) IP address.";
       }

       leaf bdr-router-id {
         type rt-types:router-id;
         config false;
         description
           "Neighbor's Backup Designated Router (BDR) Router ID.";
       }

       leaf bdr-ip-addr {



Yeung, et al.             Expires June 22, 2019                [Page 81]


Internet-Draft            OSPF YANG Data Model             December 2018


         type inet:ip-address;
         config false;
         description
           "Neighbor's Backup Designated Router (BDR) IP Address.";
       }
       leaf state {
         type nbr-state-type;
         config false;
         description
           "OSPF neighbor state.";
       }
       leaf cost {
         type uint32;
         config false;
         description "Cost to reach neighbor for Point-to-Multipoint
                      and Hybrid networks";
       }
       leaf dead-timer {
         type uint32;
         units "seconds";
         config false;
         description "This timer tracks the remaining time before
                      the neighbor is declared dead.";
       }
       container statistics {
         config false;
         description "Per-neighbor statistics";
         uses neighbor-stat;
       }
     }

     grouping interface-common-state {
       description
         "OSPF interface common operational state.";
       reference "RFC2328 Section 9";

       leaf state {
         type if-state-type;
         config false;
         description "Interface state.";
       }

       leaf hello-timer {
         type uint32;
         units "seconds";
         config false;
         description "This timer tracks the remaining time before
                      the next hello packet is sent on the



Yeung, et al.             Expires June 22, 2019                [Page 82]


Internet-Draft            OSPF YANG Data Model             December 2018


                      interface.";
       }

       leaf wait-timer {
         type uint32;
         units "seconds";
         config false;
         description "This timer tracks the remaining time before
                      the interface exits the Waiting state.";
       }

       leaf dr-router-id {
         type rt-types:router-id;
         config false;
         description "Designated Router (DR) Router ID.";
       }

       leaf dr-ip-addr {
         type inet:ip-address;
         config false;
         description "Designated Router (DR) IP address.";
       }

       leaf bdr-router-id {
         type rt-types:router-id;
         config false;
         description "Backup Designated Router (BDR) Router ID.";
       }

       leaf bdr-ip-addr {
         type inet:ip-address;
         config false;
         description "Backup Designated Router (BDR) IP Address.";
       }

       container statistics {
         config false;
         description "Per-interface statistics";
         uses interface-stat;
       }

       container neighbors {
         config false;
         description "All neighbors for the interface.";
         list neighbor {
           key "neighbor-router-id";
           description
             "List of interface OSPF neighbors.";



Yeung, et al.             Expires June 22, 2019                [Page 83]


Internet-Draft            OSPF YANG Data Model             December 2018


           leaf neighbor-router-id {
             type rt-types:router-id;
             description
               "Neighbor Router ID.";
           }
           uses neighbor-state;
         }
       }
       container database {
         config false;
         description "Link-scope Link State Database.";
         list link-scope-lsa-type {
           key "lsa-type";
           description
             "List OSPF link-scope LSAs.";
           leaf lsa-type {
             type uint16;
             description "OSPF link-scope LSA type.";
           }
           container link-scope-lsas {
             description
               "All link-scope LSAs of this LSA type.";
             list link-scope-lsa {
               key "lsa-id adv-router";
               description "List of OSPF link-scope LSAs";
               uses lsa-key;
               uses lsa {
                 refine "version/ospfv2/ospfv2" {
                   must "derived-from-or-self( "
                      + "../../../../../../../../../../"
                      + "rt:type, 'ospf:ospfv2')" {
                     description "OSPFv2 LSA.";
                   }
                 }
                 refine "version/ospfv3/ospfv3" {
                   must "derived-from-or-self( "
                      + "../../../../../../../../../../"
                      + "rt:type, 'ospf:ospfv3')" {
                     description "OSPFv3 LSA.";
                   }
                 }
               }
             }
           }
         }
       }
     }




Yeung, et al.             Expires June 22, 2019                [Page 84]


Internet-Draft            OSPF YANG Data Model             December 2018


     grouping interface-state {
       description
         "OSPF interface operational state.";
       reference "RFC2328 Section 9";

       uses interface-common-state;
     }

     grouping virtual-link-config {
       description
         "OSPF virtual link configuration state.";

       uses interface-common-config;
     }

     grouping virtual-link-state {
       description
         "OSPF virtual link operational state.";

       leaf cost {
         type uint16 {
           range "1..65535";
         }
         config false;
         description
           "Virtual link interface cost.";
       }
       uses interface-common-state;
     }

     grouping sham-link-config {
       description
         "OSPF sham link configuration state.";

       uses interface-common-config;
       uses interface-physical-link-config;
     }

     grouping sham-link-state {
       description
         "OSPF sham link operational state.";
       uses interface-common-state;
     }

     grouping address-family-area-config {
       description
         "OSPF address-family specific area config state.";




Yeung, et al.             Expires June 22, 2019                [Page 85]


Internet-Draft            OSPF YANG Data Model             December 2018


       container ranges {
         description "Container for summary ranges";

         list range {
           key "prefix";
           description
             "Summarize routes matching address/mask -
              Applicable to Area Border Routers (ABRs) only.";
           leaf prefix {
             type inet:ip-prefix;
             description
               "IPv4 or IPv6 prefix";
           }
           leaf advertise {
             type boolean;
             description
               "Advertise or hide.";
           }
           leaf cost {
             type ospf-metric {
               range "0..16777214";
             }
             description
               "Advertised cost of summary route.";
           }
         }
       }
     }

     grouping area-common-config {
       description
         "OSPF area common configuration state.";

       leaf summary {
         when "derived-from(../area-type,'ospf:stub-nssa-area')" {
           description
             "Summary advertisement into the stub/NSSA area.";
         }
         type boolean;
         description
           "Enable/Disable summary advertisement into the stub or
            NSSA area.";
       }
       leaf default-cost {
         when "derived-from(../area-type,'ospf:stub-nssa-area')" {
             description
               "Cost for LSA default route advertised into the
                stub or NSSA area.";



Yeung, et al.             Expires June 22, 2019                [Page 86]


Internet-Draft            OSPF YANG Data Model             December 2018


         }
         type ospf-metric;
         description
           "Set the summary default route cost for a
            stub or NSSA area.";
       }
     }

     grouping area-config {
       description
         "OSPF area configuration state.";

       leaf area-type {
         type identityref {
           base area-type;
         }
         default normal-area;
         description
           "Area type.";
       }

       uses area-common-config;
       uses address-family-area-config;
     }

     grouping area-state {
       description
         "OSPF area operational state.";

       container statistics {
         config false;
         description "Per-area statistics";
         uses area-stat;
       }

       container database {
         config false;
         description "Area-scope Link State Database.";
         list area-scope-lsa-type {
           key "lsa-type";
           description "List OSPF area-scope LSAs.";
           leaf lsa-type {
             type uint16;
             description "OSPF area-scope LSA type.";
           }
           container area-scope-lsas {
             description
               "All area-scope LSAs of an area-scope



Yeung, et al.             Expires June 22, 2019                [Page 87]


Internet-Draft            OSPF YANG Data Model             December 2018


                LSA type.";
             list area-scope-lsa {
               key "lsa-id adv-router";
               description "List of OSPF area-scope LSAs";
               uses lsa-key;
               uses lsa {
                 refine "version/ospfv2/ospfv2" {
                   must "derived-from-or-self( "
                      + "../../../../../../../../"
                      + "rt:type, 'ospf:ospfv2')" {
                     description "OSPFv2 LSA.";
                   }
                 }
                 refine "version/ospfv3/ospfv3" {
                   must "derived-from-or-self( "
                      + "../../../../../../../../"
                      + "rt:type, 'ospf:ospfv3')" {
                     description "OSPFv3 LSA.";
                   }
                 }
               }
             }
           }
         }
       }
     }

     grouping local-rib {
       description "Local-rib - RIB for Routes computed by the local
                    OSPF routing instance.";
       container local-rib {
         config false;
         description "Local-rib.";
         list route {
           key "prefix";
           description "Routes";
           leaf prefix {
             type inet:ip-prefix;
             description "Destination prefix.";
           }
           container next-hops {
             description "Next hops for the route.";
             list next-hop {
               key "next-hop";
               description "List of next hops for the route";
               leaf outgoing-interface {
                 type if:interface-ref;
                 description



Yeung, et al.             Expires June 22, 2019                [Page 88]


Internet-Draft            OSPF YANG Data Model             December 2018


                   "Name of the outgoing interface.";
               }
               leaf next-hop {
                type inet:ip-address;
                description "Nexthop address.";
               }
             }
           }
           leaf metric {
             type uint32;
             description "Metric for this route.";
           }
           leaf route-type {
             type route-type;
             description "Route type for this route.";
           }
           leaf route-tag {
             type uint32;
             description "Route tag for this route.";
           }
         }
       }
     }

     grouping ietf-spf-delay {
       leaf initial-delay {
         type rt-types:timer-value-milliseconds;
         description
           "Delay used while in QUIET state (milliseconds).";
       }
       leaf short-delay {
         type rt-types:timer-value-milliseconds;
         description
           "Delay used while in SHORT_WAIT state (milliseconds).";
       }
       leaf long-delay {
         type rt-types:timer-value-milliseconds;
         description
           "Delay used while in LONG_WAIT state (milliseconds).";
       }
       leaf hold-down {
         type rt-types:timer-value-milliseconds;
         description
           "Timer used to consider an IGP stability period
            (milliseconds).";
       }
       leaf time-to-learn {
         type rt-types:timer-value-milliseconds;



Yeung, et al.             Expires June 22, 2019                [Page 89]


Internet-Draft            OSPF YANG Data Model             December 2018


         description
           "Duration used to learn all the IGP events
            related to a single component failure (milliseconds).";
       }
       leaf current-state {
         type enumeration {
           enum "quiet" {
             description "QUIET state";
           }
           enum "short-wait" {
             description "SHORT_WAIT state";
           }
           enum "long-wait" {
             description "LONG_WAIT state";
           }
         }
         config false;
         description
           "Current SPF backoff algorithm state.";
       }
       leaf remaining-time-to-learn {
         type rt-types:timer-value-seconds16;
         config false;
         description
           "Remaining time until time-to-learn timer fires.";
       }
       leaf remaining-hold-down {
         type rt-types:timer-value-seconds16;
         config false;
         description
           "Remaining time until hold-down timer fires.";
       }
       leaf last-event-received {
         type yang:timestamp;
         config false;
         description
           "Time of last SPF triggering event.";
       }
       leaf next-spf-time {
         type yang:timestamp;
         config false;
         description
           "Time when next SPF has been scheduled.";
       }
       leaf last-spf-time {
         type yang:timestamp;
         config false;
         description



Yeung, et al.             Expires June 22, 2019                [Page 90]


Internet-Draft            OSPF YANG Data Model             December 2018


           "Time of last SPF computation.";
         }
       description
         "Grouping for IETF SPF delay configuration and state";
     }

     grouping node-tag-config {
       description
         "OSPF node tag config state.";
       container node-tags {
         if-feature node-tag;
         list node-tag {
           key tag;
           leaf tag {
             type uint32;
               description
                 "Node tag value.";
           }
           description
             "List of tags.";
         }
         description
           "Container for node admin tags.";
       }
     }

     grouping instance-config {
       description
         "OSPF instance config state.";

       leaf explicit-router-id {
         if-feature explicit-router-id;
         type rt-types:router-id;
         description
           "Defined in RFC 2328. A 32-bit number
            that uniquely identifies the router.";
       }

       container preference {
         description "Route preference config state.";
         choice scope {
           description
             "Options for expressing preference
              as single or multiple values.";
           case single-value {
             leaf all {
               type uint8;
               description



Yeung, et al.             Expires June 22, 2019                [Page 91]


Internet-Draft            OSPF YANG Data Model             December 2018


                 "Preference for intra-area, inter-area, and
                  external routes.";
             }
           }
           case multi-values {
             choice granularity {
               description
                 "Options for expressing preference
                  for intra-area and inter-area routes.";
               case detail {
                 leaf intra-area {
                   type uint8;
                   description
                     "Preference for intra-area routes.";
                 }
                 leaf inter-area {
                   type uint8;
                   description
                     "Preference for inter-area routes.";
                 }
               }
               case coarse {
                 leaf internal {
                   type uint8;
                   description
                     "Preference for both intra-area and
                      inter-area routes.";
                 }
               }
             }
             leaf external {
               type uint8;
               description
                 "Preference for AS external routes.";
             }
           }
         }
       }

       container nsr {
         if-feature nsr;
         description
           "Non-Stop Routing (NSR) config state.";
         leaf enable {
           type boolean;
           description
             "Enable/Disable NSR.";
         }



Yeung, et al.             Expires June 22, 2019                [Page 92]


Internet-Draft            OSPF YANG Data Model             December 2018


       }

       container graceful-restart {
         if-feature graceful-restart;
         description
           "Graceful restart config state.";
         reference "RFC 3623 - OSPF Graceful Restart
                    RFC 5187 - OSPFv3 Graceful Restart";
         leaf enable {
           type boolean;
           description
             "Enable/Disable graceful restart as defined in RFC 3623
              for OSPFv2 and RFC 5187 for OSPFv3.";
         }
         leaf helper-enable {
           type boolean;
           description
             "Enable graceful restart helper support for restarting
              routers (RFC 3623 Section 3).";
         }
         leaf restart-interval {
           type uint16 {
             range "1..1800";
           }
           units seconds;
           default "120";
           description
             "Interval to attempt graceful restart prior
              to failing (RFC 3623 Section B.1) (seconds)";
         }
         leaf helper-strict-lsa-checking {
           type boolean;
           description
             "Terminate graceful restart when an LSA topology change
              is detected (RFC 3623 Section B.2).";
         }
       }

       leaf enable {
         if-feature admin-control;
         type boolean;
         default true;
         description
           "Enable/Disable the protocol.";
       }

       container auto-cost {
         if-feature auto-cost;



Yeung, et al.             Expires June 22, 2019                [Page 93]


Internet-Draft            OSPF YANG Data Model             December 2018


         description
           "Interface Auto-cost configuration state.";
         leaf enable {
           type boolean;
           description
             "Enable/Disable interface auto-cost.";
         }
         leaf reference-bandwidth {
           when "../enable = 'true'" {
             description "Only when auto cost is enabled";
           }
           type uint32 {
             range "1..4294967";
           }
           units Mbits;
           description
             "Configure reference bandwidth used to automatically
              determine interface cost (Mbits). The cost is the
              reference bandwidth divided by the interface speed
              with 1 being the minimum cost.";
         }
       }

       container spf-control {
         leaf paths {
           if-feature max-ecmp;
           type uint16 {
             range "1..32";
           }
           description
             "Maximum number of Equal-Cost Multi-Path (ECMP) paths.";
         }
         container ietf-spf-delay {
           if-feature ietf-spf-delay;
           uses ietf-spf-delay;
           description
             "IETF SPF delay algorithm configuration.";
         }
         description "SPF calculation control.";
       }

       container database-control {
         leaf max-lsa {
           if-feature max-lsa;
           type uint32 {
             range "1..4294967294";
           }
           description



Yeung, et al.             Expires June 22, 2019                [Page 94]


Internet-Draft            OSPF YANG Data Model             December 2018


             "Maximum number of LSAs OSPF the router will accept.";
         }
         description "Database maintenance control.";
       }

       container stub-router {
         if-feature stub-router;
         description "Set maximum metric configuration";

         choice trigger {
           description
             "Specific triggers which will enable stub
              router state.";
           container always {
             presence
               "Enables unconditional stub router support";
             description
               "Unconditional stub router state (advertise
                transit links with max metric";
           }
         }
       }

       container mpls {
         description
           "OSPF MPLS config state.";
         container te-rid {
           if-feature te-rid;
           description
             "Stable OSPF Router IP Address used for Traffic
              Engineering (TE)";
           leaf ipv4-router-id {
             type inet:ipv4-address;
             description
               "Explicitly configure the TE IPv4 Router ID.";
           }
           leaf ipv6-router-id {
             type inet:ipv6-address;
             description
               "Explicitly configure the TE IPv6 Router ID.";
           }
         }
         container ldp {
           description
             "OSPF MPLS LDP config state.";
           leaf igp-sync {
             if-feature ldp-igp-sync;
             type boolean;



Yeung, et al.             Expires June 22, 2019                [Page 95]


Internet-Draft            OSPF YANG Data Model             December 2018


             description
               "Enable LDP IGP synchronization.";
           }
         }
       }
       uses instance-fast-reroute-config;
       uses node-tag-config;
     }

     grouping instance-state {
       description
         "OSPF instance operational state.";

       leaf router-id {
         type rt-types:router-id;
         config false;
         description
           "Defined in RFC 2328. A 32-bit number
            that uniquely identifies the router.";
       }

       uses local-rib;

       container statistics {
         config false;
         description "Per-instance statistics";
         uses instance-stat;
       }

       container database {
         config false;
         description "AS-scope Link State Database.";
         list as-scope-lsa-type {
           key "lsa-type";
           description "List OSPF AS-scope LSAs.";
           leaf lsa-type {
             type uint16;
             description "OSPF AS scope LSA type.";
           }
           container as-scope-lsas {
             description "All AS-scope of LSA of this LSA type.";
             list as-scope-lsa {
               key "lsa-id adv-router";
               description "List of OSPF AS-scope LSAs";
               uses lsa-key;
               uses lsa {
                 refine "version/ospfv2/ospfv2" {
                   must "derived-from-or-self( "



Yeung, et al.             Expires June 22, 2019                [Page 96]


Internet-Draft            OSPF YANG Data Model             December 2018


                      + "../../../../../../"
                      + "rt:type, 'ospf:ospfv2')" {
                     description "OSPFv2 LSA.";
                   }
                 }
                 refine "version/ospfv3/ospfv3" {
                   must "derived-from-or-self( "
                      + "../../../../../../"
                      + "rt:type, 'ospf:ospfv3')" {
                     description "OSPFv3 LSA.";
                   }
                 }
               }
             }
           }
         }
       }
       uses spf-log;
       uses lsa-log;
     }

     grouping ospf-config {
       description
         "OSPF top configuration state - currently empty.";
     }

     grouping ospf-state {
       description
         "OSPF top operational state - currently empty.";
     }

     grouping multi-topology-area-common-config {
       description
         "OSPF multi-topology area common configuration state.";
       leaf summary {
         when "derived-from("
            + "../../../../../areas/area[area-id=current()/../area-id]/"
            + "area-type, 'stub-nssa-area')" {
           description
             "Summary advertisement into the stub/NSSA area.";
         }
         type boolean;
         description
           "Enable/Disable summary advertisement into the
            topology in the stub or NSSA area.";
       }
       leaf default-cost {
         when "derived-from("



Yeung, et al.             Expires June 22, 2019                [Page 97]


Internet-Draft            OSPF YANG Data Model             December 2018


            + "../../../../../areas/area[area-id=current()/../area-id]/"
            + "area-type, 'stub-nssa-area')" {
           description
             "Cost for LSA default route advertised into the
              topology into the stub or NSSA area.";
         }
         type ospf-metric;
         description
           "Set the summary default route cost for a
            stub or NSSA area.";
       }
     }

     grouping multi-topology-area-config {
       description
         "OSPF multi-topology area configuration state.";

       uses multi-topology-area-common-config;
       uses address-family-area-config;
     }

     grouping multi-topology-area-state {
       description
         "OSPF multi-topology area operational state.";
     }

     grouping multi-topology-config {
       description
         "OSPF multi-topology configuration state.";
     }

     grouping multi-topology-state {
       description
         "OSPF multi-topology operational state.";

       uses local-rib;
     }

     grouping multi-topology-interface-config {
       description
         "OSPF multi-topology configuration state.";

       leaf cost {
          type uint32;
          description
            "Interface cost for this topology.";
       }
     }



Yeung, et al.             Expires June 22, 2019                [Page 98]


Internet-Draft            OSPF YANG Data Model             December 2018


     grouping multi-topology-interface-state {
       description
         "OSPF multi-topology operational state.";
     }

     grouping ospfv3-interface-config {
       description
         "OSPFv3 interface specific configuration state.";

       leaf instance-id {
         type uint8 {
           range "0 .. 31";
         }
         description
           "OSPFv3 instance ID.";
       }
     }

     grouping ospfv3-interface-state {
       description
         "OSPFv3 interface specific operational state.";

       leaf interface-id {
         type uint16;
         config false;
         description
           "OSPFv3 interface ID.";
       }
     }

     grouping lsa-identifiers {
       description
         "The parameters that uniquely identify an LSA.";
       leaf area-id {
         type area-id-type;
         description
           "Area ID";
       }
       leaf type {
         type uint16;
         description
           "LSA type.";
       }
       leaf lsa-id {
         type yang:dotted-quad;
         description "Link-State ID.";
       }
       leaf adv-router {



Yeung, et al.             Expires June 22, 2019                [Page 99]


Internet-Draft            OSPF YANG Data Model             December 2018


         type rt-types:router-id;
         description
           "LSA advertising router.";
       }
       leaf seq-num {
         type uint32;
         description
           "LSA sequence number.";
       }
     }

     grouping spf-log {
       description
         "Grouping for SPF log.";
       container spf-log {
         config false;
         description
           "This container lists the SPF log.";
         list event {
           key id;
           description
             "List of SPF log entries represented
              as a wrapping buffer.";
           leaf id {
             type uint32;
             description
               "Event identifier - Ppurely internal value.";
           }
           leaf spf-type {
             type enumeration {
               enum full {
                 description
                   "SPF computation was a Full SPF.";
               }
               enum intra {
                 description
                   "SPF computation was only for intra-area routes.";
               }
               enum inter {
                 description
                   "SPF computation was only for inter-area
                    summary routes.";
               }
               enum external {
                 description
                   "SPF computation was only for AS external routes.";
               }
             }



Yeung, et al.             Expires June 22, 2019               [Page 100]


Internet-Draft            OSPF YANG Data Model             December 2018


             description
               "The SPF computation type for the SPF log entry.";
           }
           leaf schedule-timestamp {
             type yang:timestamp;
             description
               "This is the timestamp when the computation was
                scheduled.";
           }
           leaf start-timestamp {
             type yang:timestamp;
             description
               "This is the timestamp when the computation was
                started.";
           }
           leaf end-timestamp {
             type yang:timestamp;
             description
               "This the timestamp when the computation was
                completed.";
           }
           list trigger-lsa {
             description
               "The list of LSAs that triggered the computation.";
             uses lsa-identifiers;
           }
         }
       }
     }

     grouping lsa-log {
       description
         "Grouping for the LSA log.";
       container lsa-log {
         config false;
         description
           "This container lists the LSA log.
            Local LSA modifications are also included
            in the list.";
         list event {
           key id;
           description
             "List of LSA log entries represented
              as a wrapping buffer.";
           leaf id {
             type uint32;
             description
               "Event identifier - purely internal value.";



Yeung, et al.             Expires June 22, 2019               [Page 101]


Internet-Draft            OSPF YANG Data Model             December 2018


           }
           container lsa {
             description
               "This container describes the logged LSA.";
             uses lsa-identifiers;
           }
           leaf received-timestamp {
             type yang:timestamp;
             description
               "This is the timestamp when the LSA was received.
                In case of local LSA update, the timestamp refers
                to the LSA origination time.";
           }
           leaf reason {
             type identityref {
               base lsa-log-reason;
             }
             description
               "This reason for the LSA log entry.";
           }
         }
       }
     }

     augment "/rt:routing/rt:control-plane-protocols/"
           + "rt:control-plane-protocol" {
        when "derived-from(rt:type, 'ospf:ospf-protocol')" {
         description
           "This augmentation is only valid for a routing protocol
            instance of OSPF (type 'ospfv2' or 'ospfv3').";
       }
       description "OSPF protocol ietf-routing module
                    control-plane-protocol augmentation.";

       container ospf {
         description
           "OSPF protocol Instance";

         uses ospf-config;
         uses ospf-state;

         leaf address-family {
           type iana-rt-types:address-family;
           description
             "Address-family of the instance.";
         }

         uses instance-config;



Yeung, et al.             Expires June 22, 2019               [Page 102]


Internet-Draft            OSPF YANG Data Model             December 2018


         uses instance-state;

         container areas {
           description "All areas.";
           list area {
             key "area-id";
             description
               "List of OSPF areas";
             leaf area-id {
               type area-id-type;
               description
                 "Area ID";
             }

             uses area-config;
             uses area-state;

             container virtual-links {
               when "derived-from-or-self(../area-type, 'normal-area') "
                  + "and ../area-id = '0.0.0.0'" {
                 description
                   "Virtual links must be in backbone area.";
                 }
               description "All virtual links.";
               list virtual-link {
                 key "transit-area-id router-id";
                 description
                   "OSPF virtual link";
                 leaf transit-area-id {
                   type leafref {
                     path "../../../../area/area-id";
                   }
                   must "derived-from-or-self("
                     + "../../../../area[area-id=current()]/area-type, "
                     + "'normal-area') and "
                     + "../../../../area[area-id=current()]/area-id != "
                     + "'0.0.0.0'" {
                     error-message "Virtual link transit area must "
                                 + "be non-zero.";
                     description
                       "Virtual-link trasit area must be
                        non-zero area.";
                   }
                   description
                     "Virtual link tranist area ID.";
                 }
                 leaf router-id {
                   type rt-types:router-id;



Yeung, et al.             Expires June 22, 2019               [Page 103]


Internet-Draft            OSPF YANG Data Model             December 2018


                   description
                     "Virtual Link remote endpoint Router ID.";
                 }

                 uses virtual-link-config;
                 uses virtual-link-state;
               }
             }
             container sham-links {
               if-feature pe-ce-protocol;
               description "All sham links.";
               list sham-link {
                 key "local-id remote-id";
                 description
                   "OSPF sham link";
                 leaf local-id {
                   type inet:ip-address;
                   description
                     "Address of the local sham Link endpoint.";
                 }
                 leaf remote-id {
                   type inet:ip-address;
                   description
                     "Address of the remote sham Link endpoint.";
                 }
                 uses sham-link-config;
                 uses sham-link-state;
               }
             }
             container interfaces {
               description "All interfaces.";
               list interface {
                 key "name";
                 description
                   "List of OSPF interfaces.";
                 leaf name {
                   type if:interface-ref;
                   description
                     "Interface name reference.";
                 }
                 uses interface-config;
                 uses interface-state;
               }
             }
           }
         }
       }
     }



Yeung, et al.             Expires June 22, 2019               [Page 104]


Internet-Draft            OSPF YANG Data Model             December 2018


     augment "/rt:routing/rt:control-plane-protocols/"
           + "rt:control-plane-protocol/ospf:ospf" {
       when "derived-from(../rt:type, 'ospf:ospf-protocol')" {
         description
           "This augmentation is only valid for OSPF
            (type 'ospfv2' or 'ospfv3').";
       }
       if-feature multi-topology;
       description
         "OSPF multi-topology instance configuration
          state augmentation.";
       container topologies {
         description "All topologies.";
         list topology {
           key "name";
           description
             "OSPF topology - The OSPF topology address-family
              must coincide with the routing-instance
              address-family.";
           leaf name {
             type leafref {
               path "../../../../../../rt:ribs/rt:rib/rt:name";
             }
             description "RIB name corresponding to the OSPF
                          topology.";
           }

           uses multi-topology-config;
           uses multi-topology-state;

           container areas {
             description "All areas in the topology.";
             list area {
               key "area-id";
               description
                 "List of OSPF areas";
               leaf area-id {
                 type area-id-type;
                 description
                   "Area ID.";
               }
               uses multi-topology-area-config;
               uses multi-topology-area-state;
             }
           }
         }
       }
     }



Yeung, et al.             Expires June 22, 2019               [Page 105]


Internet-Draft            OSPF YANG Data Model             December 2018


     augment "/rt:routing/rt:control-plane-protocols/"
           + "rt:control-plane-protocol/ospf:ospf/"
           + "ospf:areas/ospf:area/ospf:interfaces/ospf:interface" {
       when "derived-from-or-self(../../../../../rt:type, "
          + "'ospf:ospfv2')" {
         description
           "This augmentation is only valid for OSPFv2.";
       }
       if-feature ospf:multi-topology;
       description
         "OSPF multi-topology interface configuration state
          augmentation.";
       container topologies {
         description "All topologies for the interface.";
         list topology {
           key "name";
           description "OSPF interface topology.";
           leaf name {
             type leafref {
               path "../../../../../../../../../../"
                  + "rt:ribs/rt:rib/rt:name";
             }
             description
               "Single topology enabled on this interface.";
           }

           uses multi-topology-interface-config;
           uses multi-topology-interface-state;
         }
       }
     }

     augment "/rt:routing/rt:control-plane-protocols/"
           + "rt:control-plane-protocol/ospf:ospf/"
           + "ospf:areas/ospf:area/ospf:interfaces/ospf:interface" {
       when "derived-from-or-self(../../../../../rt:type, "
          + "'ospf:ospfv3')" {
         description
           "This augmentation is only valid for OSPFv3.";
       }
       description
         "OSPFv3 interface specific configuration state
          augmentation.";
       uses ospfv3-interface-config;
       uses ospfv3-interface-state;
     }

     grouping route-content {



Yeung, et al.             Expires June 22, 2019               [Page 106]


Internet-Draft            OSPF YANG Data Model             December 2018


       description
         "This grouping defines OSPF-specific route attributes.";
       leaf metric {
         type uint32;
         description "OSPF route metric.";
       }
       leaf tag {
         type uint32;
         default "0";
         description "OSPF route tag.";
       }
       leaf route-type {
         type route-type;
         description "OSPF route type";
       }
     }

     augment "/rt:routing/rt:ribs/rt:rib/rt:routes/rt:route" {
       when "derived-from(rt:source-protocol, 'ospf:ospf-protocol')" {
         description
           "This augmentation is only valid for a routes whose
            source protocol is OSPF.";
       }
       description
         "OSPF-specific route attributes.";
       uses route-content;
     }

     /*
      * RPCs
      */

     rpc clear-neighbor {
       description
         "This RPC request clears a particular set of OSPF neighbors.
          If the operation fails for OSPF internal reason, then
          error-tag and error-app-tag should be set to a meaningful
          value.";
       input {
         leaf routing-protocol-name {
           type leafref {
             path "/rt:routing/rt:control-plane-protocols/"
                + "rt:control-plane-protocol/rt:name";
           }
           mandatory "true";
           description
             "OSPF protocol instance which information for neighbors
              are to be cleared.



Yeung, et al.             Expires June 22, 2019               [Page 107]


Internet-Draft            OSPF YANG Data Model             December 2018


              If the referenced OSPF instance doesn't exist, then
              this operation SHALL fail with error-tag 'data-missing'
              and error-app-tag
              'routing-protocol-instance-not-found'.";
         }

         leaf interface {
           type if:interface-ref;
             description
               "Name of the OSPF interface for which neighbors are to
                be cleared.

                If the referenced OSPF interface doesn't exist, then
                this operation SHALL fail with error-tag
                'data-missing'  and error-app-tag
                'ospf-interface-not-found'.";
         }
       }
     }

     rpc clear-database {
       description
         "This RPC request clears a particular OSPF Link State
          Database. If the operation fails for OSPF internal reason,
          then error-tag and error-app-tag should be set to a
          meaningful value.";
       input {
         leaf routing-protocol-name {
           type leafref {
             path "/rt:routing/rt:control-plane-protocols/"
                + "rt:control-plane-protocol/rt:name";
           }
           mandatory "true";
           description
             "OSPF protocol instance whose Link State Database is to
              be cleared.

              If the referenced OSPF instance doesn't exist, then
              this operation SHALL fail with error-tag 'data-missing'
              and error-app-tag
              'routing-protocol-instance-not-found'.";
         }
       }
     }

     /*
      * Notifications
      */



Yeung, et al.             Expires June 22, 2019               [Page 108]


Internet-Draft            OSPF YANG Data Model             December 2018


     grouping notification-instance-hdr {
       description
        "This grouping describes common instance specific
         data for OSPF notifications.";

       leaf routing-protocol-name {
         type leafref {
           path "/rt:routing/rt:control-plane-protocols/"
              + "rt:control-plane-protocol/rt:name";
         }
         must "derived-from( "
           + "/rt:routing/rt:control-plane-protocols/"
           + "rt:control-plane-protocol[rt:name=current()]/"
           + "rt:type, 'ospf:ospf-protocol')";
         description
          "OSPF routing protocol instance name.";
       }

       leaf address-family {
         type leafref {
           path "/rt:routing/"
              + "rt:control-plane-protocols/rt:control-plane-protocol"
              + "[rt:name=current()/../routing-protocol-name]/"
              + "ospf:ospf/address-family";
         }
         description
           "Address family of the OSPF instance.";
       }
     }

     grouping notification-interface {
       description
         "This grouping provides interface information
          for the OSPF interface specific notification.";

       choice if-link-type-selection {
         description
           "Options for link type.";
         container interface {
           description "Normal interface.";
           leaf interface {
             type if:interface-ref;
             description "Interface.";
           }
         }
         container virtual-link {
           description "virtual-link.";
           leaf transit-area-id {



Yeung, et al.             Expires June 22, 2019               [Page 109]


Internet-Draft            OSPF YANG Data Model             December 2018


             type area-id-type;
             description "Area ID.";
           }
           leaf neighbor-router-id {
             type rt-types:router-id;
             description "Neighbor Router ID.";
           }
         }
         container sham-link {
           description "sham link.";
           leaf area-id {
             type area-id-type;
             description "Area ID.";
           }
           leaf local-ip-addr {
             type inet:ip-address;
             description "Sham link local address.";
           }
           leaf remote-ip-addr {
             type inet:ip-address;
             description "Sham link remote address.";
           }
         }
       }
     }

     grouping notification-neighbor {
       description
         "This grouping provides the neighbor information
          for neighbor specific notifications.";

       leaf neighbor-router-id {
         type rt-types:router-id;
         description "Neighbor Router ID.";
       }

       leaf neighbor-ip-addr {
         type yang:dotted-quad;
         description "Neighbor address.";
       }
     }

     notification if-state-change {
       uses notification-instance-hdr;
       uses notification-interface;

       leaf state {
         type if-state-type;



Yeung, et al.             Expires June 22, 2019               [Page 110]


Internet-Draft            OSPF YANG Data Model             December 2018


         description "Interface state.";
       }
       description
         "This notification is sent when an interface
          state change is detected.";
     }

     notification if-config-error {
       uses notification-instance-hdr;
       uses notification-interface;

       leaf packet-source {
         type yang:dotted-quad;
         description "Source address.";
       }

       leaf packet-type {
         type packet-type;
         description "OSPF packet type.";
       }

       leaf error {
         type enumeration {
           enum "bad-version" {
             description "Bad version.";
           }
           enum "area-mismatch" {
             description "Area mistmatch.";
           }
           enum "unknown-nbma-nbr" {
             description "Unknown NBMA neighbor.";
           }
           enum "unknown-virtual-nbr" {
             description "Unknown virtual link neighbor.";
           }
           enum "auth-type-mismatch" {
             description "Auth type mismatch.";
           }
           enum "auth-failure" {
             description "Auth failure.";
           }
           enum "net-mask-mismatch" {
             description "Network mask mismatch.";
           }
           enum "hello-interval-mismatch" {
             description "Hello interval mismatch.";
           }
           enum "dead-interval-mismatch" {



Yeung, et al.             Expires June 22, 2019               [Page 111]


Internet-Draft            OSPF YANG Data Model             December 2018


             description "Dead interval mismatch.";
           }
           enum "option-mismatch" {
             description "Option mismatch.";
           }
           enum "mtu-mismatch" {
             description "MTU mismatch.";
           }
           enum "duplicate-router-id" {
             description "Duplicate Router ID.";
           }
           enum "no-error" {
             description "No error.";
           }
         }
         description "Error code.";
       }
       description
         "This notification is sent when an interface
          config error is detected.";
     }

     notification nbr-state-change {
       uses notification-instance-hdr;
       uses notification-interface;
       uses notification-neighbor;

       leaf state {
         type nbr-state-type;
         description "Neighbor state.";
       }

       description
         "This notification is sent when aa neighbor
          state change is detected.";
     }

     notification nbr-restart-helper-status-change {
       uses notification-instance-hdr;
       uses notification-interface;
       uses notification-neighbor;

       leaf status {
         type restart-helper-status-type;
         description "Restart helper status.";
       }

       leaf age {



Yeung, et al.             Expires June 22, 2019               [Page 112]


Internet-Draft            OSPF YANG Data Model             December 2018


         type uint32;
         units seconds;
         description
           "Remaining time in current OSPF graceful restart
            interval when the router is acting as a restart
            helper for the neighbor.";
       }

       leaf exit-reason {
         type restart-exit-reason-type;
         description
           "Restart helper exit reason.";
       }
       description
         "This notification is sent when a neighbor restart
          helper status change is detected.";
     }

     notification if-rx-bad-packet {
       uses notification-instance-hdr;
       uses notification-interface;

       leaf packet-source {
         type yang:dotted-quad;
         description "Source address.";
       }

       leaf packet-type {
         type packet-type;
         description "OSPF packet type.";
       }

       description
         "This notification is sent when an OSPF packet that
          cannot be parsed is received on an OSPF interface.";
     }

     notification lsdb-approaching-overflow {
       uses notification-instance-hdr;

       leaf ext-lsdb-limit {
         type uint32;
         description
           "The maximum number of non-default AS-external LSAs
            entries that can be stored in the Link State Database.";
       }

       description



Yeung, et al.             Expires June 22, 2019               [Page 113]


Internet-Draft            OSPF YANG Data Model             December 2018


         "This notification is sent when the number of LSAs
          in the router's Link State Database has exceeded
          ninety percent of the AS-external limit (ext-lsdb-limit).";
     }

     notification lsdb-overflow {
       uses notification-instance-hdr;

       leaf ext-lsdb-limit {
         type uint32;
         description
           "The maximum number of non-default AS-external LSAs
            entries that can be stored in the Link State Database.";
       }

       description
         "This notification is sent when the number of LSAs
          in the router's Link State Database has exceeded the
          AS-external limit (ext-lsdb-limit).";
     }

     notification nssa-translator-status-change {
       uses notification-instance-hdr;

       leaf area-id {
         type area-id-type;
         description "Area ID.";
       }

       leaf status {
         type nssa-translator-state-type;
         description
           "NSSA translator status.";
       }

       description
         "This notification is sent when there is a change
          in the router's role in translating OSPF NSSA LSAs
          to OSPF AS-External LSAs.";
     }

     notification restart-status-change {
       uses notification-instance-hdr;

       leaf status {
         type restart-status-type;
         description
           "Restart status.";



Yeung, et al.             Expires June 22, 2019               [Page 114]


Internet-Draft            OSPF YANG Data Model             December 2018


       }

       leaf restart-interval {
         type uint16 {
           range "1..1800";
         }
         units seconds;
         default "120";
         description
           "Restart interval.";
       }

       leaf exit-reason {
         type restart-exit-reason-type;
         description
           "Restart exit reason.";
       }

       description
         "This notification is sent when the graceful restart
          state for the router has changed.";
     }
   }
   <CODE ENDS>

4.  Security Considerations

   The YANG modules specified in this document define a schema for data
   that is designed to be accessed via network management protocols such
   as NETCONF [RFC6241] or RESTCONF [RFC8040].  The lowest NETCONF layer
   is the secure transport layer, and the mandatory-to-implement secure
   transport is Secure Shell (SSH) [RFC6242].  The lowest RESTCONF layer
   is HTTPS, and the mandatory-to-implement secure transport is TLS
   [RFC8446].

   The NETCONF access control model [RFC8341] 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.

   There are a number of data nodes defined in ietf-ospf.yang 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.  For OSPF, the ability to
   modify OSPF configuration will allow the entire OSPF domain to be
   compromised including peering with unauthorized routers to misroute



Yeung, et al.             Expires June 22, 2019               [Page 115]


Internet-Draft            OSPF YANG Data Model             December 2018


   traffic or mount a massive Denial-of-Service (DoS) attack.  The
   security considerations of OSPFv2 [RFC2328] and [RFC5340] apply to
   the ietf-ospf.yang module as well.

   Some of the readable data nodes in the ietf-ospf.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.  The exposure of the Link State
   Database (LSDB) will expose the detailed topology of the network.
   This may be undesirable since both due to the fact that exposure may
   facilitate other attacks.  Additionally, network operators may
   consider their topologies to be sensitive confidential data.

   For OSPF authentication, configuration is supported via the
   specification of key-chains [RFC8177] or the direct specification of
   key and authentication algorithm.  Hence, authentification
   configuration using the "auth-table-trailer" case in the
   "authentication" container inherits the security considerations of
   [RFC8177].  This includes the considerations with respect to the
   local storage and handling of authentication keys.

   Some of the RPC operations in this YANG module may be considered
   sensitive or vulnerable in some network environments.  It is thus
   important to control access to these operations.  The OSPF YANG
   module support the "clear-neighbor" and "clear-database" RPCs.  If
   access too either of these is compromised, they can result in
   temporary network outages be employed to mount DoS attacks.

5.  IANA Considerations

   This document registers a URI in the IETF XML registry [RFC3688].
   Following the format in [RFC3688], the following registration is
   requested to be made:

        URI: urn:ietf:params:xml:ns:yang:ietf-ospf
        Registrant Contact: The IESG.
        XML: N/A, the requested URI is an XML namespace.

   This document registers a YANG module in the YANG Module Names
   registry [RFC6020].

        name: ietf-ospf
        namespace: urn:ietf:params:xml:ns:yang:ietf-ospf
        prefix: ospf
        reference: RFC XXXX






Yeung, et al.             Expires June 22, 2019               [Page 116]


Internet-Draft            OSPF YANG Data Model             December 2018


6.  Acknowledgements

   The authors wish to thank Yi Yang, Alexander Clemm, Gaurav Gupta,
   Ladislav Lhotka, Stephane Litkowski, Greg Hankins, Manish Gupta and
   Alan Davey for their thorough reviews and helpful comments.

   Thanks to Tom Petch for last call review and improvement of the
   document organization.

   This document was produced using Marshall Rose's xml2rfc tool.

   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-3194.

7.  References

7.1.  Normative References

   [I-D.ietf-bfd-yang]
              Rahman, R., Zheng, L., Jethanandani, M., Networks, J., and
              G. Mirsky, "YANG Data Model for Bidirectional Forwarding
              Detection (BFD)", draft-ietf-bfd-yang-17 (work in
              progress), August 2018.

   [RFC1793]  Moy, J., "Extending OSPF to Support Demand Circuits",
              RFC 1793, DOI 10.17487/RFC1793, April 1995,
              <https://www.rfc-editor.org/info/rfc1793>.

   [RFC2119]  Bradner, S., "Key words for use in RFCs to Indicate
              Requirement Levels", BCP 14, RFC 2119,
              DOI 10.17487/RFC2119, March 1997, <https://www.rfc-
              editor.org/info/rfc2119>.

   [RFC2328]  Moy, J., "OSPF Version 2", STD 54, RFC 2328,
              DOI 10.17487/RFC2328, April 1998, <https://www.rfc-
              editor.org/info/rfc2328>.

   [RFC3101]  Murphy, P., "The OSPF Not-So-Stubby Area (NSSA) Option",
              RFC 3101, DOI 10.17487/RFC3101, January 2003,
              <https://www.rfc-editor.org/info/rfc3101>.

   [RFC3623]  Moy, J., Pillay-Esnault, P., and A. Lindem, "Graceful OSPF
              Restart", RFC 3623, DOI 10.17487/RFC3623, November 2003,
              <https://www.rfc-editor.org/info/rfc3623>.



Yeung, et al.             Expires June 22, 2019               [Page 117]


Internet-Draft            OSPF YANG Data Model             December 2018


   [RFC3630]  Katz, D., Kompella, K., and D. Yeung, "Traffic Engineering
              (TE) Extensions to OSPF Version 2", RFC 3630,
              DOI 10.17487/RFC3630, September 2003, <https://www.rfc-
              editor.org/info/rfc3630>.

   [RFC3688]  Mealling, M., "The IETF XML Registry", BCP 81, RFC 3688,
              DOI 10.17487/RFC3688, January 2004, <https://www.rfc-
              editor.org/info/rfc3688>.

   [RFC4552]  Gupta, M. and N. Melam, "Authentication/Confidentiality
              for OSPFv3", RFC 4552, DOI 10.17487/RFC4552, June 2006,
              <https://www.rfc-editor.org/info/rfc4552>.

   [RFC4576]  Rosen, E., Psenak, P., and P. Pillay-Esnault, "Using a
              Link State Advertisement (LSA) Options Bit to Prevent
              Looping in BGP/MPLS IP Virtual Private Networks (VPNs)",
              RFC 4576, DOI 10.17487/RFC4576, June 2006,
              <https://www.rfc-editor.org/info/rfc4576>.

   [RFC4577]  Rosen, E., Psenak, P., and P. Pillay-Esnault, "OSPF as the
              Provider/Customer Edge Protocol for BGP/MPLS IP Virtual
              Private Networks (VPNs)", RFC 4577, DOI 10.17487/RFC4577,
              June 2006, <https://www.rfc-editor.org/info/rfc4577>.

   [RFC4750]  Joyal, D., Ed., Galecki, P., Ed., Giacalone, S., Ed.,
              Coltun, R., and F. Baker, "OSPF Version 2 Management
              Information Base", RFC 4750, DOI 10.17487/RFC4750,
              December 2006, <https://www.rfc-editor.org/info/rfc4750>.

   [RFC4915]  Psenak, P., Mirtorabi, S., Roy, A., Nguyen, L., and P.
              Pillay-Esnault, "Multi-Topology (MT) Routing in OSPF",
              RFC 4915, DOI 10.17487/RFC4915, June 2007,
              <https://www.rfc-editor.org/info/rfc4915>.

   [RFC5082]  Gill, V., Heasley, J., Meyer, D., Savola, P., Ed., and C.
              Pignataro, "The Generalized TTL Security Mechanism
              (GTSM)", RFC 5082, DOI 10.17487/RFC5082, October 2007,
              <https://www.rfc-editor.org/info/rfc5082>.

   [RFC5185]  Mirtorabi, S., Psenak, P., Lindem, A., Ed., and A. Oswal,
              "OSPF Multi-Area Adjacency", RFC 5185,
              DOI 10.17487/RFC5185, May 2008, <https://www.rfc-
              editor.org/info/rfc5185>.

   [RFC5187]  Pillay-Esnault, P. and A. Lindem, "OSPFv3 Graceful
              Restart", RFC 5187, DOI 10.17487/RFC5187, June 2008,
              <https://www.rfc-editor.org/info/rfc5187>.




Yeung, et al.             Expires June 22, 2019               [Page 118]


Internet-Draft            OSPF YANG Data Model             December 2018


   [RFC5250]  Berger, L., Bryskin, I., Zinin, A., and R. Coltun, "The
              OSPF Opaque LSA Option", RFC 5250, DOI 10.17487/RFC5250,
              July 2008, <https://www.rfc-editor.org/info/rfc5250>.

   [RFC5286]  Atlas, A., Ed. and A. Zinin, Ed., "Basic Specification for
              IP Fast Reroute: Loop-Free Alternates", RFC 5286,
              DOI 10.17487/RFC5286, September 2008, <https://www.rfc-
              editor.org/info/rfc5286>.

   [RFC5309]  Shen, N., Ed. and A. Zinin, Ed., "Point-to-Point Operation
              over LAN in Link State Routing Protocols", RFC 5309,
              DOI 10.17487/RFC5309, October 2008, <https://www.rfc-
              editor.org/info/rfc5309>.

   [RFC5329]  Ishiguro, K., Manral, V., Davey, A., and A. Lindem, Ed.,
              "Traffic Engineering Extensions to OSPF Version 3",
              RFC 5329, DOI 10.17487/RFC5329, September 2008,
              <https://www.rfc-editor.org/info/rfc5329>.

   [RFC5340]  Coltun, R., Ferguson, D., Moy, J., and A. Lindem, "OSPF
              for IPv6", RFC 5340, DOI 10.17487/RFC5340, July 2008,
              <https://www.rfc-editor.org/info/rfc5340>.

   [RFC5613]  Zinin, A., Roy, A., Nguyen, L., Friedman, B., and D.
              Yeung, "OSPF Link-Local Signaling", RFC 5613,
              DOI 10.17487/RFC5613, August 2009, <https://www.rfc-
              editor.org/info/rfc5613>.

   [RFC5642]  Venkata, S., Harwani, S., Pignataro, C., and D. McPherson,
              "Dynamic Hostname Exchange Mechanism for OSPF", RFC 5642,
              DOI 10.17487/RFC5642, August 2009, <https://www.rfc-
              editor.org/info/rfc5642>.

   [RFC5643]  Joyal, D., Ed. and V. Manral, Ed., "Management Information
              Base for OSPFv3", RFC 5643, DOI 10.17487/RFC5643, August
              2009, <https://www.rfc-editor.org/info/rfc5643>.

   [RFC5709]  Bhatia, M., Manral, V., Fanto, M., White, R., Barnes, M.,
              Li, T., and R. Atkinson, "OSPFv2 HMAC-SHA Cryptographic
              Authentication", RFC 5709, DOI 10.17487/RFC5709, October
              2009, <https://www.rfc-editor.org/info/rfc5709>.

   [RFC5838]  Lindem, A., Ed., Mirtorabi, S., Roy, A., Barnes, M., and
              R. Aggarwal, "Support of Address Families in OSPFv3",
              RFC 5838, DOI 10.17487/RFC5838, April 2010,
              <https://www.rfc-editor.org/info/rfc5838>.





Yeung, et al.             Expires June 22, 2019               [Page 119]


Internet-Draft            OSPF YANG Data Model             December 2018


   [RFC5880]  Katz, D. and D. Ward, "Bidirectional Forwarding Detection
              (BFD)", RFC 5880, DOI 10.17487/RFC5880, June 2010,
              <https://www.rfc-editor.org/info/rfc5880>.

   [RFC5881]  Katz, D. and D. Ward, "Bidirectional Forwarding Detection
              (BFD) for IPv4 and IPv6 (Single Hop)", RFC 5881,
              DOI 10.17487/RFC5881, June 2010, <https://www.rfc-
              editor.org/info/rfc5881>.

   [RFC6020]  Bjorklund, M., Ed., "YANG - A Data Modeling Language for
              the Network Configuration Protocol (NETCONF)", RFC 6020,
              DOI 10.17487/RFC6020, October 2010, <https://www.rfc-
              editor.org/info/rfc6020>.

   [RFC6241]  Enns, R., Ed., Bjorklund, M., Ed., Schoenwaelder, J., Ed.,
              and A. Bierman, Ed., "Network Configuration Protocol
              (NETCONF)", RFC 6241, DOI 10.17487/RFC6241, June 2011,
              <https://www.rfc-editor.org/info/rfc6241>.

   [RFC6242]  Wasserman, M., "Using the NETCONF Protocol over Secure
              Shell (SSH)", RFC 6242, DOI 10.17487/RFC6242, June 2011,
              <https://www.rfc-editor.org/info/rfc6242>.

   [RFC6565]  Pillay-Esnault, P., Moyer, P., Doyle, J., Ertekin, E., and
              M. Lundberg, "OSPFv3 as a Provider Edge to Customer Edge
              (PE-CE) Routing Protocol", RFC 6565, DOI 10.17487/RFC6565,
              June 2012, <https://www.rfc-editor.org/info/rfc6565>.

   [RFC6845]  Sheth, N., Wang, L., and J. Zhang, "OSPF Hybrid Broadcast
              and Point-to-Multipoint Interface Type", RFC 6845,
              DOI 10.17487/RFC6845, January 2013, <https://www.rfc-
              editor.org/info/rfc6845>.

   [RFC6860]  Yang, Y., Retana, A., and A. Roy, "Hiding Transit-Only
              Networks in OSPF", RFC 6860, DOI 10.17487/RFC6860, January
              2013, <https://www.rfc-editor.org/info/rfc6860>.

   [RFC6991]  Schoenwaelder, J., Ed., "Common YANG Data Types",
              RFC 6991, DOI 10.17487/RFC6991, July 2013,
              <https://www.rfc-editor.org/info/rfc6991>.

   [RFC7166]  Bhatia, M., Manral, V., and A. Lindem, "Supporting
              Authentication Trailer for OSPFv3", RFC 7166,
              DOI 10.17487/RFC7166, March 2014, <https://www.rfc-
              editor.org/info/rfc7166>.






Yeung, et al.             Expires June 22, 2019               [Page 120]


Internet-Draft            OSPF YANG Data Model             December 2018


   [RFC7474]  Bhatia, M., Hartman, S., Zhang, D., and A. Lindem, Ed.,
              "Security Extension for OSPFv2 When Using Manual Key
              Management", RFC 7474, DOI 10.17487/RFC7474, April 2015,
              <https://www.rfc-editor.org/info/rfc7474>.

   [RFC7490]  Bryant, S., Filsfils, C., Previdi, S., Shand, M., and N.
              So, "Remote Loop-Free Alternate (LFA) Fast Reroute (FRR)",
              RFC 7490, DOI 10.17487/RFC7490, April 2015,
              <https://www.rfc-editor.org/info/rfc7490>.

   [RFC7684]  Psenak, P., Gredler, H., Shakir, R., Henderickx, W.,
              Tantsura, J., and A. Lindem, "OSPFv2 Prefix/Link Attribute
              Advertisement", RFC 7684, DOI 10.17487/RFC7684, November
              2015, <https://www.rfc-editor.org/info/rfc7684>.

   [RFC7770]  Lindem, A., Ed., Shen, N., Vasseur, JP., Aggarwal, R., and
              S. Shaffer, "Extensions to OSPF for Advertising Optional
              Router Capabilities", RFC 7770, DOI 10.17487/RFC7770,
              February 2016, <https://www.rfc-editor.org/info/rfc7770>.

   [RFC7777]  Hegde, S., Shakir, R., Smirnov, A., Li, Z., and B.
              Decraene, "Advertising Node Administrative Tags in OSPF",
              RFC 7777, DOI 10.17487/RFC7777, March 2016,
              <https://www.rfc-editor.org/info/rfc7777>.

   [RFC7950]  Bjorklund, M., Ed., "The YANG 1.1 Data Modeling Language",
              RFC 7950, DOI 10.17487/RFC7950, August 2016,
              <https://www.rfc-editor.org/info/rfc7950>.

   [RFC8040]  Bierman, A., Bjorklund, M., and K. Watsen, "RESTCONF
              Protocol", RFC 8040, DOI 10.17487/RFC8040, January 2017,
              <https://www.rfc-editor.org/info/rfc8040>.

   [RFC8042]  Zhang, Z., Wang, L., and A. Lindem, "OSPF Two-Part
              Metric", RFC 8042, DOI 10.17487/RFC8042, December 2016,
              <https://www.rfc-editor.org/info/rfc8042>.

   [RFC8174]  Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC
              2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174,
              May 2017, <https://www.rfc-editor.org/info/rfc8174>.

   [RFC8177]  Lindem, A., Ed., Qu, Y., Yeung, D., Chen, I., and J.
              Zhang, "YANG Data Model for Key Chains", RFC 8177,
              DOI 10.17487/RFC8177, June 2017, <https://www.rfc-
              editor.org/info/rfc8177>.






Yeung, et al.             Expires June 22, 2019               [Page 121]


Internet-Draft            OSPF YANG Data Model             December 2018


   [RFC8294]  Liu, X., Qu, Y., Lindem, A., Hopps, C., and L. Berger,
              "Common YANG Data Types for the Routing Area", RFC 8294,
              DOI 10.17487/RFC8294, December 2017, <https://www.rfc-
              editor.org/info/rfc8294>.

   [RFC8340]  Bjorklund, M. and L. Berger, Ed., "YANG Tree Diagrams",
              BCP 215, RFC 8340, DOI 10.17487/RFC8340, March 2018,
              <https://www.rfc-editor.org/info/rfc8340>.

   [RFC8341]  Bierman, A. and M. Bjorklund, "Network Configuration
              Access Control Model", STD 91, RFC 8341,
              DOI 10.17487/RFC8341, March 2018, <https://www.rfc-
              editor.org/info/rfc8341>.

   [RFC8342]  Bjorklund, M., Schoenwaelder, J., Shafer, P., Watsen, K.,
              and R. Wilton, "Network Management Datastore Architecture
              (NMDA)", RFC 8342, DOI 10.17487/RFC8342, March 2018,
              <https://www.rfc-editor.org/info/rfc8342>.

   [RFC8343]  Bjorklund, M., "A YANG Data Model for Interface
              Management", RFC 8343, DOI 10.17487/RFC8343, March 2018,
              <https://www.rfc-editor.org/info/rfc8343>.

   [RFC8349]  Lhotka, L., Lindem, A., and Y. Qu, "A YANG Data Model for
              Routing Management (NMDA Version)", RFC 8349,
              DOI 10.17487/RFC8349, March 2018, <https://www.rfc-
              editor.org/info/rfc8349>.

   [RFC8405]  Decraene, B., Litkowski, S., Gredler, H., Lindem, A.,
              Francois, P., and C. Bowers, "Shortest Path First (SPF)
              Back-Off Delay Algorithm for Link-State IGPs", RFC 8405,
              DOI 10.17487/RFC8405, June 2018, <https://www.rfc-
              editor.org/info/rfc8405>.

   [RFC8446]  Rescorla, E., "The Transport Layer Security (TLS) Protocol
              Version 1.3", RFC 8446, DOI 10.17487/RFC8446, August 2018,
              <https://www.rfc-editor.org/info/rfc8446>.

   [RFC8476]  Tantsura, J., Chunduri, U., Aldrin, S., and P. Psenak,
              "Signaling Maximum SID Depth (MSD) Using OSPF", RFC 8476,
              DOI 10.17487/RFC8476, December 2018, <https://www.rfc-
              editor.org/info/rfc8476>.

7.2.  Informative References

   [RFC0905]  "ISO Transport Protocol specification ISO DP 8073",
              RFC 905, DOI 10.17487/RFC0905, April 1984,
              <https://www.rfc-editor.org/info/rfc905>.



Yeung, et al.             Expires June 22, 2019               [Page 122]


Internet-Draft            OSPF YANG Data Model             December 2018


   [RFC1765]  Moy, J., "OSPF Database Overflow", RFC 1765,
              DOI 10.17487/RFC1765, March 1995, <https://www.rfc-
              editor.org/info/rfc1765>.

   [RFC4973]  Srisuresh, P. and P. Joseph, "OSPF-xTE: Experimental
              Extension to OSPF for Traffic Engineering", RFC 4973,
              DOI 10.17487/RFC4973, July 2007, <https://www.rfc-
              editor.org/info/rfc4973>.

   [RFC5443]  Jork, M., Atlas, A., and L. Fang, "LDP IGP
              Synchronization", RFC 5443, DOI 10.17487/RFC5443, March
              2009, <https://www.rfc-editor.org/info/rfc5443>.

   [RFC5714]  Shand, M. and S. Bryant, "IP Fast Reroute Framework",
              RFC 5714, DOI 10.17487/RFC5714, January 2010,
              <https://www.rfc-editor.org/info/rfc5714>.

   [RFC6987]  Retana, A., Nguyen, L., Zinin, A., White, R., and D.
              McPherson, "OSPF Stub Router Advertisement", RFC 6987,
              DOI 10.17487/RFC6987, September 2013, <https://www.rfc-
              editor.org/info/rfc6987>.






























Yeung, et al.             Expires June 22, 2019               [Page 123]


Internet-Draft            OSPF YANG Data Model             December 2018


Appendix A.  Contributors' Addreses


   Dean Bogdanovic
   Volta Networks, Inc.

   EMail: dean@voltanet.io


   Kiran Koushik Agrahara Sreenivasa
   Verizon
   500 W Dove Rd
   Southlake, TX 76092
   USA

   EMail: kk@employees.org


Authors' Addresses

   Derek Yeung
   Arrcus

   EMail: derek@arrcus.com


   Yingzhen Qu
   Huawei
   2330 Central Expressway
   Santa Clara, CA  95050
   USA

   EMail: yingzhen.qu@huawei.com


   Jeffrey Zhang
   Juniper Networks
   10 Technology Park Drive
   Westford, MA  01886
   USA

   EMail: zzhang@juniper.net


   Ing-Wher Chen
   The MITRE Corporation

   EMail: ingwherchen@mitre.org



Yeung, et al.             Expires June 22, 2019               [Page 124]


Internet-Draft            OSPF YANG Data Model             December 2018


   Acee Lindem
   Cisco Systems
   301 Midenhall Way
   Cary, NC 27513

   EMail: acee@cisco.com













































Yeung, et al.             Expires June 22, 2019               [Page 125]