Network Working Group                                           A. Clemm
Internet-Draft                                                 J. Medved
Intended status: Standards Track                                   Cisco
Expires: December 14, 2016 February 11, 2017                                      R. Varga
                                                               T. Tkacik
                                               Pantheon Technologies SRO
                                                               T. Tkacik

                                                                  X. Liu
                                                     Kuatro Technologies
                                                                Ericsson
                                                              I. Bryskin
                                                                  Huawei
                                                                  A. Guo
                                                            Adva Optical
                                                      H. Ananthakrishnan
                                                           Packet Design
                                                              N. Bahadur
                                                       Bracket Computing
                                                               V. Beeram
                                                        Juniper Networks
                                                           June 12,
                                                         August 10, 2016

                A YANG Data Model for Layer 3 Topologies
                draft-ietf-i2rs-yang-l3-topology-02.txt
                draft-ietf-i2rs-yang-l3-topology-03.txt

Abstract

   This document defines a YANG data model for layer 3 network
   topologies.

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 December 14, 2016. February 11, 2017.

Copyright Notice

   Copyright (c) 2016 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
   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.

   This document may contain material from IETF Documents or IETF
   Contributions published or made publicly available before November
   10, 2008.  The person(s) controlling the copyright in some of this
   material may not have granted the IETF Trust the right to allow
   modifications of such material outside the IETF Standards Process.
   Without obtaining an adequate license from the person(s) controlling
   the copyright in such materials, this document may not be modified
   outside the IETF Standards Process, and derivative works of it may
   not be created outside the IETF Standards Process, except to format
   it for publication as an RFC or to translate it into languages other
   than English.

Table of Contents

   1.  Introduction  . . . . . . . . . . . . . . . . . . . . . . . .   3
   2.  Definitions and Acronyms  . . . . . . . . . . . . . . . . . .   4
   3.  Model overview Structure . . . . . . . . . . . . . . . . . . . . . . .   5
     3.1.   4
   4.  Layer 3 Unicast Topology Model structure Overview . . . . . . . . . . .   5
   5.  Layer 3 Unicast Topology YANG Module  . . . . . . . . . .   5
     3.2.  Layer 3 Unicast - IGP . .   7
   6.  Extending the Model . . . . . . . . . . . . . . . .   6
     3.3. . . . . .  14
     6.1.  Example 1: OSPF Topology  . . . . . . . . . . . . . . . .  14
       6.1.1.  Model Overview  . . . . . . .   7
     3.4.  IS-IS Topology . . . . . . . . . . . .  15
       6.1.2.  OSPF Topology YANG Module . . . . . . . . .   9
   4.  Layer 3 Unicast IGP . . . . .  17
     6.2.  Example 2: IS-IS Topology YANG Module . . . . . . . . . .  10
   5.  OSPF Topology YANG Module . . . . . .  22
       6.2.1.  Model Overview  . . . . . . . . . . . . .  19
   6.  ISIS Topology YANG Module . . . . . .  22
       6.2.2.  IS-IS Topology YANG Module  . . . . . . . . . . . . .  26  23
   7.  Security Considerations . . . . . . . . . . . . . . . . . . .  31  28
   8.  Contributors  . . . . . . . . . . . . . . . . . . . . . . . .  31  28
   9.  Acknowledgements  . . . . . . . . . . . . . . . . . . . . . .  32  28
   10. References  . . . . . . . . . . . . . . . . . . . . . . . . .  32  29
     10.1.  Normative References . . . . . . . . . . . . . . . . . .  32  29
     10.2.  Informative References . . . . . . . . . . . . . . . . .  33  29
   Authors' Addresses  . . . . . . . . . . . . . . . . . . . . . . .  33  30

1.  Introduction

   This document introduces a YANG [RFC6020] [RFC6991]
   [I-D.draft-ietf-netmod-rfc6020bis] data model for Layer 3 network
   topologies.
   topologies, specifically Layer 3 Unicast.  The model allows an
   application to have a holistic view of the topology of a Layer 3
   network, all contained in a single conceptual YANG datastore.

   The data model builds on top of, and augments, the data model for
   network topologies defined in
   [I-D.draft-ietf-i2rs-yang-network-topo].  An earlier revision of that
   Internet Draft contained not just the general model for network
   topologies, but also the model for layer 3 network topologies that is
   being specified here.  However, we decided to "split" the earlier
   draft to separate the truly general aspects of a topology data model,
   which apply to any type of topology, from the application of this
   model to a particular domain, here: a Layer 3 network.

   Specific topology types that are covered in this

   The document include also shows how the model can be further refined to cover
   different Layer 3 Unicast IGP, topology types.  For this purpose, example
   models are introduced that cover IS-IS [RFC1195], [RFC1195] and OSPF [RFC2178].  In
   addition, this documents defines a set of traffic engineering
   extensions.
   Those examples are intended purely for illustrative purposes; we
   expect that full-blown IS-IS and OSPF models will be more
   comprehensive and refined than the examples shown here.

   There are multiple applications for such a topology data model and a model.  A number
   of use cases have been defined in section 6 of
   [I-D.draft-ietf-i2rs-usecase-reqs-summary].  For example, nodes
   within the network can use the data model to capture their
   understanding of the overall network topology and expose it to a
   network controller.  A network controller can then use the
   instantiated topology data to compare and reconcile its own view of
   the network topology with that of the network elements that it
   controls.  Alternatively, nodes within the network could propagate
   this understanding to compare and reconcile this understanding either
   amongst themselves or with help of a controller.  Beyond the network
   element itself, a network controller might even use the data model to
   represent its view of the topology that it controls and expose it to
   applications north of itself.

   There are several reasons to choose YANG to define the data model.
   Data defined using YANG can be exposed by a server to client
   applications and controllers via Netconf [RFC6241] or via a ReST-like
   Interface [I-D.draft-ietf-netconf-restconf]
   [I-D.draft-ietf-netmod-yang-json]. [RFC6241].  The fact that it
   YANG can potentially be used with different protocols and interfaces
   provides for a degree of "future-
   proofing" "future-proofing" of model implementations.
   Also, YANG can serve as the basis for model-driven toolchains, such
   as used in the Open Daylight
   project. project [OpenDaylight].

   The data model is defined in several YANG modules:

   o  Module "ietf-l3-unicast-igp-topology" defines a model for Layer 3 Unicast IGP topologies. topologies defined in this
   document is specified in a YANG module "ietf-l3-unicast-topology".
   To do so, it augments general network topology model defined in
   [I-D.draft-ietf-i2rs-yang-network-topo] with information specific to
   Layer 3 Unicast IGP.  In doing so, it
      also illustrates the extension patterns associated with extending
      respectively augmenting Unicast.  This way, the general topology model is extended to
   be able to meet the needs of a specific topology.

   o  Module "ietf-ospf-topology" defines a topology model for OSPF,
      building on and extending the Layer 3 Unicast IGP topology model.
      It serves as an example of how the general topology model can be
      refined across multiple levels.

   o  Module "ietf-isis-topology" defines a topology model for IS-IS,
      again building on and extending the Layer 3 Unicast IGP topology
      model. topologies.

   Information that is kept in the Traffic Engineering Database (TED) is
   specified in a separate model and outside the scope of this
   specification.

2.  Definitions and Acronyms

   Datastore: A conceptual store of instantiated management information,
   with individual data items represented by data nodes which are
   arranged in hierarchical manner.

   Data subtree: An instantiated data node and the data nodes that are
   hierarchically contained within it.

   HTTP: Hyper-Text Transfer Protocol

   IGP: Interior Gateway Protocol

   IS-IS: Intermediate System to Intermediate System protocol

   LSP: Label Switched Path

   NETCONF: Network Configuration Protocol

   OSPF: Open Shortest Path First, a link state routing protocol

   URI: Uniform Resource Identifier

   ReST: Representational State Transfer, a style of stateless interface
   and protocol that is generally carried over HTTP

   SRLG: Shared Risk Link Group

   TED: Traffic Engineering Database

   YANG: A data definition language for NETCONF

3.  Model overview

   This section provides an overview of the Structure

   The Layer 3 network topology
   model.

3.1.  Model structure

   The network Unicast topology model is defined by the following YANG modules,
   whose module "l3-
   unicast-topology".  The relationship is roughly depicted of this module with other YANG
   modules is roughly depicted in the figure below.  The base
   network topology is included in the diagram for completeness.

           +-----------------------------+
           |  +-----------------------+  |
           |  |      ietf-network     |  |
           |  +----------^------------+  |
           |             |               |
           |  +-----------------------+  |
           |  | ietf-network-topology |  |
           |  +----------+------------+  |
           +-------------^---------------+
                         |
                         |
             +-----------^-------------+
             | l3-unicast-igp-topology   L3-UNICAST-TOPOLOGY   |
             +----+---------------+----+
                  ^               ^
                  |               |
                  |               |
         +--------^-----+   +-----^---------+
         | ospf-topology|   | isis-topology |
         +--------------+   +---------------+

                     Figure 1: Overall model structure

   YANG modules ietf-network "ietf-network" and ietf-network-topology "ietf-network-topology" collectively
   define the basic network topology model.  YANG module ietf-l3-
   unicast-igp-topology "ietf-l3-
   unicast-topology" augments those models with additional definitions
   needed to represent Layer 3 Unicast IGP topologies.  This module in turn is
   can be augmented by YANG modules with additional definitions for
   specific types of Layer 3 Unicast topologies, such as OSPF and for
   IS-IS topologies, ietf-ospf-topology and
   ietf-isis-topology, respectively.

3.2. topologies.

4.  Layer 3 Unicast - IGP Topology Model Overview

   The Layer 3 Unicast IGP topology model is defined by YANG module
   "ietf-l3-unicast-igp-topology".  The model is "ietf-
   l3-unicast-topology" and depicted in the following diagram.  Brackets
   enclose list keys, "rw" means configuration, "ro" operational state
   data, "?" designates optional nodes, "*" designates nodes that can
   have multiple instances.  Parantheses enclose choice and case nodes.  Notifications are not
   depicted.
   The prefix "nt:" "nd:" refers to the YANG module for networks; the prefix
   "lnk:" refers to the YANG module for network topology.  In the
   interest of brevity, notifications are not depicted.

   module: ietf-l3-unicast-igp-topology ietf-l3-unicast-topology
   augment /nw:networks/nw:network/nw:network-types: /nd:networks/nd:network/nd:network-types:
      +--rw l3-unicast-igp-topology! l3-unicast-topology!
   augment /nw:networks/nw:network: /nd:networks/nd:network:
      +--rw igp-topology-attributes l3-topology-attributes
         +--rw name?   string
         +--rw flag*   flag-type   l3-flag-type
   augment /nw:networks/nw:network/nw:node: /nd:networks/nd:network/nd:node:
      +--rw igp-node-attributes l3-node-attributes
         +--rw name?        inet:domain-name
         +--rw flag*        flag-type        node-flag-type
         +--rw router-id*   inet:ip-address
         +--rw prefix* [prefix]
            +--rw prefix    inet:ip-prefix
            +--rw metric?   uint32
            +--rw flag*     flag-type     prefix-flag-type
   augment /nw:networks/nw:network/nt:link: /nd:networks/nd:network/lnk:link:
      +--rw igp-link-attributes l3-link-attributes
         +--rw name?     string
         +--rw flag*     flag-type     link-flag-type
         +--rw metric?   uint32
   augment /nw:networks/nw:network/nw:node/nt:termination-point: /nd:networks/nd:network/nd:node/lnk:termination-point:
      +--rw igp-termination-point-attributes l3-termination-point-attributes
         +--rw (termination-point-type)?
            +--:(ip)
            |  +--rw ip-address*      inet:ip-address
            +--:(unnumbered)
               +--rw unnumbered-id?   uint32

   The module augments the original ietf-network and ietf-network-
   topology modules as follows:

   o  A new network topology type is introduced, l3-unicast-igp-
      topology. l3-unicast-topology.
      The corresponding container augments the network-types of the
      ietf-network module.

   o  Additional topology attributes are introduced, defined in a
      grouping, which augments the "network" list of the network module.
      The attributes include an IGP name, a name for the topology, as well as a set
      of flags (represented through a leaf-list).  Each type of flag is
      represented by a separate identity.  This allows to introduce
      additional flags in augmenting modules that are associated with
      specific IGP topologies, using additional identities
      without needing to revise this module.

   o  Additional data objects for nodes are introduced by augmenting the
      "node" list of the network module.  New objects include again a
      set of flags, as well as a list of prefixes.  Each prefix in turn
      includes an ip prefix, a metric, and a prefix-specific set of
      flags.

   o  Links (in the ietf-network-topology module) are augmented with a
      set of parameters as well, allowing to associate a link with an
      IGP a
      link name, another set of flags, and a link metric.

   o  Termination points (in the ietf-network-topology module as well)
      are augmented with a choice of IP address or identifier.

   In addition, the module defines a set of notifications to alert
   clients of any events concerning links, nodes, prefixes, and
   termination points.  Each notification includes an indication of the
   type of event, the topology from which it originated, and the
   affected node, or link, or prefix, or termination point.  In
   addition, as a convenience to applications, additional data of the
   affected node, or link, or termination point (respectively) is
   included.  While this makes notifications larger in volume than they
   would need to be, it avoids the need for subsequent retrieval of
   context information, which also might have changed in the meantime.

3.3.  OSPF Topology

   OSPF is the next type of topology represented in the model.  OSPF
   represents a particular type of

5.  Layer 3 Unicast IGP.  Accordingly,
   this time Topology YANG Module

   <CODE BEGINS> file "ietf-l3-unicast-topology@2016-08-10.yang"
   module ietf-l3-unicast-topology {
     yang-version 1.1;
     namespace
       "urn:ietf:params:xml:ns:yang:ietf-l3-unicast-topology";
     prefix "l3t";
     import ietf-network {
       prefix "nd";
     }
     import ietf-network-topology {
       prefix "lnk";
     }
     import ietf-inet-types {
       prefix "inet";
     }
     organization
       "IETF I2RS (Interface to the Routing System) Working Group";
     contact
       "WG Web:    <http://tools.ietf.org/wg/i2rs/>
        WG List:   <mailto:i2rs@ietf.org>
        WG Chair:  Susan Hares
                   <mailto:shares@ndzh.com>
        WG Chair:  Russ White
                   <mailto:russ@riw.us>
        Editor:    Alexander Clemm
                   <mailto:alex@cisco.com>
        Editor:    Jan Medved
                   <mailto:jmedved@cisco.com>
        Editor:    Robert Varga
                   <mailto:rovarga@cisco.com>
        Editor:    Tony Tkacik
                   <mailto:tony.tkacik@gmail.com>
        Editor:    Xufeng Liu
                   <mailto:xliu@kuatrotech.com>
        Editor:    Igor Bryskin
                   <mailto:Igor.Bryskin@huawei.com>
        Editor:    Aihua Guo
                   <mailto:aguo@advaoptical.com>
        Editor:    Nitin Bahadur
                   <mailto:nitin_bahadur@yahoo.com>
        Editor:    Hariharan Ananthakrishnan
                   <mailto:hari@packetdesign.com>
        Editor:    Vishnu Pavan Beeram
                   <mailto:vbeeram@juniper.net>";
     description
       "This module defines a model for Layer 3 Unicast IGP topology model needs to be
   extended.  The corresponding extensions are introduced
        topologies.
        Copyright (c) 2016 IETF Trust and the persons identified as
        authors of the code.  All rights reserved.
        Redistribution and use in a separate
   YANG module "ietf-ospf-topology", whose structure source and binary forms, with or
        without modification, is depicted in permitted pursuant to, and subject
        to the
   following diagram.  For the most part, this module augments "ietf-l3-
   unicast-igp-topology".  Like before, brackets enclose list keys, "rw"
   means configuration, "ro" operational state data, "?" designates
   optional nodes, "*" designates nodes that can have multiple
   instances.  Parantheses enclose choice and case nodes.  A "+" at license terms contained in, the
   end Simplified BSD License
        set forth in Section 4.c of a line indicates a line break.  Notifications respectively
   augmentations the IETF Trust's Legal Provisions
        Relating to IETF Documents
        (http://trustee.ietf.org/license-info).
        This version of notifications are not depicted.

   module: ietf-ospf-topology
   augment /nw:networks/nw:network/nw:network-types/+
      |    l3t:l3-unicast-igp-topology:
      +--rw ospf!
   augment /nw:networks/nw:network/l3t:igp-topology-attributes:
      +--rw ospf-topology-attributes
         +--rw area-id?   area-id
   augment /nw:networks/nw:network/nw:node/l3t:igp-node-attributes:
      +--rw ospf-node-attributes
         +--rw (router-type)?
         |  +--:(abr)
         |  |  +--rw abr?                 empty
         |  +--:(asbr)
         |  |  +--rw asbr?                empty
         |  +--:(internal)
         |  |  +--rw internal?            empty
         |  +--:(pseudonode)
         |     +--rw pseudonode?          empty
         +--rw dr-interface-id?     uint32
         +--rw multi-topology-id*   uint8
         +--rw capabilities?        bits
   augment /nw:networks/nw:network/nt:link/l3t:igp-link-attributes:
      +--rw ospf-link-attributes
         +--rw multi-topology-id?   uint8
   augment /nw:networks/nw:network/nw:node/l3t:igp-node-attributes/+
      |    l3t:prefix:
      +--rw ospf-prefix-attributes
         +--rw forwarding-address?   inet:ipv4-address

   The this YANG module augments "ietf-l3-unicast-igp-topology" as follows:

   o  A new topology type for an OSPF topology is introduced.

   o  Additional topology attributes are defined in a new grouping which
      augments igp-topology-attributes part of
        draft-ietf-i2rs-yang-network-topo-03;
        see the ietf-l3-unicast-igp-
      topology module.  The attributes include an OSPF area-id
      identifying the OSPF area.

   o  Additional data objects RFC itself for nodes are introduced by augmenting the
      igp-node-attributes of full legal notices.
        NOTE TO RFC EDITOR: Please replace above reference to
        draft-ietf-i2rs-yang-network-topo-03 with RFC
        number when published (i.e. RFC xxxx).";
     revision "2016-08-10" {
       description
         "Initial revision.
          NOTE TO RFC EDITOR: Please replace the l3-unicast-igp-topology module.  New
      objects include router-type, dr-interface-id for pseudonodes, list
      of multi-topology-ids, ospf node capabilities, and traffic
      engineering attributes.

   o  Links are augmented with a multi-topology-id and traffic
      engineering link attributes.

   o  Prefixes are augmented with OSPF specific forwarding address.

   In addition, the module extends IGP node, link and prefix
   notifications with OSPF attributes.

3.4.  IS-IS Topology

   IS-IS is another type of Layer 3 Unicast IGP.  Like OSPF topology,
   IS-IS topology is defined in a separate module, "ietf-isis-topology",
   which augments "ietf-l3-unicast-igp-topology".  The structure is
   depicted in the following diagram.  Like before, brackets enclose
   list keys, "rw" means configuration, "ro" operational state data, "?"
   designates optional nodes, "*" designates nodes that can have
   multiple instances.  Parantheses enclose choice and case nodes.  A
   "+" at the end of a line indicates a line break.  Notifications are
   not depicted.

   module: ietf-isis-topology
   augment /nw:networks/nw:network/nw:network-types/+
      |    l3t:l3-unicast-igp-topology:
      +--rw isis!
   augment /nw:networks/nw:network/l3t:igp-topology-attributes:
      +--rw isis-topology-attributes
         +--rw net?   iso-net-id
   augment /nw:networks/nw:network/nw:node/l3t:igp-node-attributes:
      +--rw isis-node-attributes
         +--rw iso
         |  +--rw iso-system-id?       iso-system-id
         |  +--rw iso-pseudonode-id?   iso-pseudonode-id
         +--rw net*                 iso-net-id
         +--rw multi-topology-id*   uint8
         +--rw (router-type)?
            +--:(level-2)
            |  +--rw level-2?             empty
            +--:(level-1)
            |  +--rw level-1?             empty
            +--:(level-1-2)
               +--rw level-1-2?           empty
   augment /nw:networks/nw:network/nt:link/l3t:igp-link-attributes:
      +--rw isis-link-attributes
         +--rw multi-topology-id?   uint8

   The module augments the ietf-l3-unicast-igp-topology as follows:

   o  A new topology type is introduced for isis.

   o  Additional topology attributes are introduced in a new grouping
      which augments "igp-topology-attributes" of the ietf-l3-unicast-
      igp-topology module.  The attributes include an ISIS NET-id
      identifying the area.

   o  Additional data objects for nodes are introduced by augmenting
      "igp-node-attributes" of the ietf-l3-unicast-igp-topology module.
      New objects include router-type, iso-system-id to identify the
      router, a list of multi-topology-id, a list of NET ids, and
      traffic engineering attributes.

   o  Links are augmented with multi-topology-id and traffic engineering
      link attributes.

   In addition, the module augments IGP nodes and links with ISIS
   attributes.

4.  Layer 3 Unicast IGP Topology YANG Module

   <CODE BEGINS> file "ietf-l3-unicast-igp-topology@2016-06-12.yang"
   module ietf-l3-unicast-igp-topology {
     yang-version 1.1;
     namespace
       "urn:ietf:params:xml:ns:yang:ietf-l3-unicast-igp-topology";
     prefix "l3t";
     import ietf-network {
       prefix "nw";
     }
     import ietf-network-topology {
       prefix "nt";
     }
     import ietf-inet-types {
       prefix "inet";
     }

     organization
       "IETF I2RS (Interface to the Routing System) Working Group";

     contact
       "WG Web:    <http://tools.ietf.org/wg/i2rs/>
        WG List:   <mailto:i2rs@ietf.org>

        WG Chair:  Susan Hares
                   <mailto:shares@ndzh.com>

        WG Chair:  Russ White
                   <mailto:russ@riw.us>

        Editor:    Alexander Clemm
                   <mailto:alex@cisco.com>

        Editor:    Jan Medved
                   <mailto:jmedved@cisco.com>

        Editor:    Robert Varga
                   <mailto:rovarga@cisco.com>

        Editor:    Tony Tkacik
                   <mailto:ttkacik@cisco.com>

        Editor:    Xufeng Liu
                   <mailto:xliu@kuatrotech.com>

        Editor:    Igor Bryskin
                   <mailto:Igor.Bryskin@huawei.com>

        Editor:    Aihua Guo
                   <mailto:aguo@advaoptical.com>

        Editor:    Nitin Bahadur
                   <mailto:nitin_bahadur@yahoo.com>

        Editor:    Hariharan Ananthakrishnan
                   <mailto:hari@packetdesign.com>

        Editor:    Vishnu Pavan Beeram
                   <mailto:vbeeram@juniper.net>";

     description
       "This module defines a model for Layer 3 Unicast IGP
        topologies.

        Copyright (c) 2016 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
        draft-ietf-i2rs-yang-network-topo-02;
        see the RFC itself for full legal notices.

        NOTE TO RFC EDITOR: Please replace above reference to
        draft-ietf-i2rs-yang-network-topo-02 following reference
          to draft-ietf-i2rs-yang-l3-topology-03 with
          RFC number when published (i.e. RFC xxxx).";

     revision "2016-06-12"
       reference
         "draft-ietf-i2rs-yang-l3-topology-03";
     }

     identity flag-identity {
       description
         "Initial revision.
          NOTE TO RFC EDITOR: Please replace the following reference
          to draft-ietf-i2rs-yang-l3-topology-01 with
          RFC number when published (i.e. RFC xxxx).";
       reference
         "draft-ietf-i2rs-yang-l3-topology-02"; "Base type for flags";

     }

     typedef igp-event-type l3-event-type {
       type enumeration {
         enum "add" {
           value 0;
           description
             "An IGP Layer 3 node or link or prefix or termination-point has
             been added";
         }
         enum "remove" {
           value 1;
           description
             "An IGP Layer 3 node or link or prefix or termination-point has
             been removed";
         }
         enum "update" {
           value 2;
           description
             "An IGP Layer 3 node or link or prefix or termination-point has
             been updated";
         }
       }
       description "IGP "Layer 3 Event type for notifications";
     } // igp-event-type

     identity flag-identity

     typedef prefix-flag-type {
       type identityref {
         base "flag-identity";
       }
       description "Prefix flag attributes";
     }

     typedef node-flag-type {
       type identityref {
         base "flag-identity";
       }
       description "Node flag attributes";
     }

     typedef link-flag-type {
       type identityref {
         base "flag-identity";
       }
       description "Prefix flag attributes";
     }

     typedef l3-flag-type {
       type identityref {
         base "flag-identity";
       }
       description "L3 flag attributes";
     }

     grouping l3-prefix-attributes {
       description
         "L3 prefix attributes";
       leaf prefix {
         type inet:ip-prefix;
         description
           "IP prefix value";
       }
       leaf metric {
         type uint32;
         description
           "Prefix metric";
       }
       leaf-list flag {
         type prefix-flag-type;
         description
           "Prefix flags";
       }
     }
     grouping l3-unicast-topology-type {
       description "Identify the topology type to be L3 unicast.";
       container l3-unicast-topology {
         presence "indicates L3 Unicast Topology";
         description
           "The presence of the container node indicates L3 Unicast
           Topology";
       }
     }
     grouping l3-topology-attributes {
       description "Topology scope attributes";
       container l3-topology-attributes {
         description "Containing topology attributes";
         leaf name {
           type string;
           description
             "Name of the topology";
         }
         leaf-list flag {
           type l3-flag-type;
           description
             "Topology flags";
         }
       }
     }
     grouping l3-node-attributes {
       description "L3 node scope attributes";
       container l3-node-attributes {
         description
           "Containing node attributes";
         leaf name {
           type inet:domain-name;
           description
             "Node name";
         }
         leaf-list flag {
           type node-flag-type;
           description
             "Node flags";
         }
         leaf-list router-id {
           type inet:ip-address;
           description
             "Router-id for the node";
         }
         list prefix {
           key "prefix";
           description
             "A list of prefixes along with their attributes";
           uses l3-prefix-attributes;
         }
       }
     }
     grouping l3-link-attributes {
       description
         "L3 link scope attributes";
       container l3-link-attributes {
         description "Base type for flags";
     }
     identity undefined-flag
           "Containing link attributes";
         leaf name {
       base "flag-identity";
           type string;
           description "Undefined flag";
             "Link Name";
         }

     typedef flag-type
         leaf-list flag {
           type identityref {
         base "flag-identity";
       } link-flag-type;
           description "Type for
             "Link flags";
         }
     grouping network-ref {
       description
         "Grouping for an absolute reference to a network topology
         instance.";
         leaf network-ref metric {
           type leafref {
           path "/nw:networks/nw:network/nw:network-id";
         } uint32;
           description
           "An absolute reference to a network topology instance.";
               "Link Metric";
         }

       }
     }
     grouping link-ref l3-termination-point-attributes {
       description
         "Grouping for an absolute reference to a link instance.";
         uses network-ref;
         leaf link-ref "L3 termination point scope attributes";
       container l3-termination-point-attributes {
           type leafref
         description
           "Containing termination point attributes";
         choice termination-point-type {
             path "/nw:networks/nw:network"
               +"[nw:network-id = current()/../network-ref]"
               +"/nt:link/nt:link-id";
           }
           description
           "An absolute reference to a link instance.";
             "Indicates the termination point type";
           case ip {
             leaf-list ip-address {
               type inet:ip-address;
               description
                 "IPv4 or IPv6 address";
             }
           }

     grouping node-ref
           case unnumbered {
       description
         "Grouping for an absolute reference to a node instance.";
       uses network-ref;
             leaf node-ref unnumbered-id {
               type leafref {
           path "/nw:networks/nw:network"
             +"[nw:network-id = current()/../network-ref]"
             +"/nw:node/nw:node-id";
         } uint32;
               description
           "An absolute reference to a node instance.";
                 "Unnumbered interface identifier";
             }
           }

     grouping tp-ref
         }
       }
     }
     augment "/nd:networks/nd:network/nd:network-types" {
       description
         "Grouping
         "Introduce new network type for an absolute reference to a termination point."; L3 unicast topology";
       uses node-ref;
       leaf tp-ref l3-unicast-topology-type;
     }
     augment "/nd:networks/nd:network" {
         type leafref
       when "nd:network-types/l3-unicast-topology" {
           path "/nw:networks/nw:network"
             +"[nw:network-id = current()/../network-ref]"
             +"/nw:node[nw:node-id = current()/../node-ref]"
             +"/nt:termination-point/nt:tp-id";
         description
           "Augmentation parameters apply only for networks with
           L3 unicast topology";
       }
       description
           "Grouping
           "L3 unicast for an absolute reference to the network as a termination point.";
       } whole";
       uses l3-topology-attributes;
     }

     grouping igp-prefix-attributes
     augment "/nd:networks/nd:network/nd:node" {
       description
         "IGP prefix attributes";
       leaf prefix
       when "../nd:network-types/l3-unicast-topology" {
         type inet:ip-prefix;
         description
           "IP prefix value";
           "Augmentation parameters apply only for networks with
           L3 unicast topology";
       }
       leaf metric {
         type uint32;
       description
           "Prefix metric";
           "L3 unicast node level attributes ";
       uses l3-node-attributes;
     }
       leaf-list flag
     augment "/nd:networks/nd:network/lnk:link" {
       when "../nd:network-types/l3-unicast-topology" {
         type flag-type;
         description
           "Prefix flags";
       }
           "Augmentation parameters apply only for networks with
           L3 unicast topology";
       }

     grouping l3-unicast-igp-topology-type {
       description "Identify the
         "Augment topology type to be L3 unicast.";
       container l3-unicast-igp-topology link attributes";
       uses l3-link-attributes;
     }
     augment "/nd:networks/nd:network/nd:node/"
            +"lnk:termination-point" {
       when "../../nd:network-types/l3-unicast-topology" {
         presence "indicates L3 Unicast IGP Topology";
         description
           "The presence of the container node indicates
           "Augmentation parameters apply only for networks with
           L3 Unicast
           IGP Topology";
       } unicast topology";
       }

     grouping igp-topology-attributes {
       description "Topology scope attributes";
       container igp-topology-attributes {
       description "Containing "Augment topology attributes";
         leaf name termination point configuration";
       uses l3-termination-point-attributes;
     }
     notification l3-node-event {
           type string;
       description
             "Name of the topology";
         }
         leaf-list flag
         "Notification event for L3 node";
       leaf l3-event-type {
         type flag-type; l3-event-type;
         description
             "Topology flags";
         }
           "Event type";
       }
       uses nd:node-ref;
       uses l3-unicast-topology-type;
       uses l3-node-attributes;
     }

     grouping igp-node-attributes {
       description "IGP node scope attributes";
       container igp-node-attributes
     notification l3-link-event {
       description
           "Containing node attributes";
         "Notification event for L3 link";
       leaf name l3-event-type {
         type inet:domain-name; l3-event-type;
         description
             "Node name";
           "Event type";
       }
         leaf-list flag
       uses lnk:link-ref;
       uses l3-unicast-topology-type;
       uses l3-link-attributes;
     }
     notification l3-prefix-event {
           type flag-type;
       description
             "Node operational flags";
         }
         leaf-list router-id
         "Notification event for L3 prefix";
       leaf l3-event-type {
         type inet:ip-address; l3-event-type;
         description
             "Router-id for the node";
           "Event type";
       }
         list
       uses nd:node-ref;
       uses l3-unicast-topology-type;
       container prefix {
           key "prefix";
         description
             "A list of prefixes along with their
           "Containing L3 prefix attributes";
         uses igp-prefix-attributes;
         } l3-prefix-attributes;
       }
     }

     grouping igp-link-attributes {
       description
         "IGP link scope attributes";
       container igp-link-attributes
     notification termination-point-event {
       description
           "Containing link attributes";
         "Notification event for L3 termination point";
       leaf name l3-event-type {
         type string; l3-event-type;
         description
             "Link Name";
           "Event type";
       }
         leaf-list flag {
           type flag-type;
           description
             "Link flags";
       uses lnk:tp-ref;
       uses l3-unicast-topology-type;
       uses l3-termination-point-attributes;
     }
         leaf metric {
           type uint32 {
             range "0..16777215"  {
               description
                 "This
   }

   <CODE ENDS>

6.  Extending the Model

   The model can be extended for specific Layer 3 Unicast types.
   Examples include OSPF and IS-IS topologies.  In the following, two
   additional YANG modules are introduced that define simple topology
   models for OSPF and IS-IS, respectively.  These modules intended to
   serve as examples that illustrate how the general topology model can
   be refined across multiple levels; they do not constitute full-
   fledged OSPF and IS-IS topology models which may be more
   comprehensive and refined than the models that are described here.

6.1.  Example 1: OSPF Topology
6.1.1.  Model Overview

   The following model shows how the Layer 3 Unicast topology model can
   be extended to cover OSFP topologies.  For this purpose, a set of
   augmentations are introduced in a separate YANG module, "ietf-ospf-
   topology", whose structure is a metric depicted in the following diagram.
   Like before, brackets enclose list keys, "rw" means configuration,
   "ro" operational state data, "?" designates optional nodes, "*"
   designates nodes that can take a 3 byte metric,
                  commonly used in OSPF/ISIS";
             }
           }
           description
               "Link Metric";
         }
       }
     }

     grouping igp-termination-point-attributes {
       description "IGP termination point scope attributes";
       container igp-termination-point-attributes {
         description
           "Containing termination point attributes"; have multiple instances.  Parantheses
   enclose choice termination-point-type {
           description
             "Indicates the termination point type";
           case ip {
             leaf-list ip-address {
               type inet:ip-address;
               description
                 "IPv4 or IPv6 address";
             }
           } and case unnumbered {
             leaf unnumbered-id {
               type uint32;
               description
                 "Unnumbered interface identifier";
             }
           }
         }
       }
     } // grouping igp-termination-point-attributes

     augment "/nw:networks/nw:network/nw:network-types" {
       description
         "Introduce new network type for L3 unicast IGP topology";
       uses l3-unicast-igp-topology-type;
     }

     augment "/nw:networks/nw:network" {
       when "nw:network-types/l3-unicast-igp-topology" {
         description
           "Augmentation parameters apply only for networks with
           L3 unicast IGP topology";
       }
       description
           "Configuration parameters for L3 unicast IPG for nodes.  A "+" at the network
           as end of a whole";
       uses igp-topology-attributes;
     } line indicates
   a line break.

module: ietf-ospf-topology
augment "/nw:networks/nw:network/nw:node" {
       when "../nw:network-types/l3-unicast-igp-topology" {
         description
           "Augmentation parameters apply only /nd:networks/nd:network/nd:network-types/l3t:l3-unicast-topology:
   +--rw ospf!
augment /nd:networks/nd:network/l3t:l3-topology-attributes:
   +--rw ospf-topology-attributes
      +--rw area-id?   area-id-type
augment /nd:networks/nd:network/nd:node/l3t:l3-node-attributes:
   +--rw ospf-node-attributes
      +--rw (router-type)?
      |  +--:(abr)
      |  |  +--rw abr?                 empty
      |  +--:(asbr)
      |  |  +--rw asbr?                empty
      |  +--:(internal)
      |  |  +--rw internal?            empty
      |  +--:(pseudonode)
      |     +--rw pseudonode?          empty
      +--rw dr-interface-id?     uint32
      +--rw multi-topology-id*   uint8
augment /nd:networks/nd:network/lnk:link/l3t:l3-link-attributes:
   +--rw ospf-link-attributes
      +--rw multi-topology-id?   uint8
augment /l3t:l3-node-event:
   +---- ospf!
   +---- ospf-node-attributes
      +---- (router-type)?
      |  +--:(abr)
      |  |  +---- abr?                 empty
      |  +--:(asbr)
      |  |  +---- asbr?                empty
      |  +--:(internal)
      |  |  +---- internal?            empty
      |  +--:(pseudonode)
      |     +---- pseudonode?          empty
      +---- dr-interface-id?     uint32
      +---- multi-topology-id*   uint8
augment /l3t:l3-link-event:
   +---- ospf!
   +---- ospf-link-attributes
      +---- multi-topology-id?   uint8

   The module augments "ietf-l3-unicast-topology" as follows:

   o  A new topology type for networks with
           L3 unicast IGP topology";
       }
       description
           "Configuration parameters an OSPF topology is introduced.

   o  Additional topology attributes are defined in a new grouping which
      augments l3-topology-attributes of the ietf-l3-unicast-topology
      module.  The attributes include an OSPF area-id identifying the
      OSPF area.

   o  Additional data objects for L3 unicast IPG at nodes are introduced by augmenting the node
           level";
       uses igp-node-attributes;
     }

     augment "/nw:networks/nw:network/nt:link" {
       when "../nw:network-types/l3-unicast-igp-topology" {
         description
           "Augmentation parameters apply only
      l3-node-attributes of the l3-unicast-topology module.  New objects
      include router-type, dr-interface-id for networks pseudonodes, list of
      multi-topology-ids, ospf node capabilities, and traffic
      engineering attributes.

   o  Links are augmented with
           L3 unicast IGP topology";
       }
       description
         "Augment topology a multi-topology-id and traffic
      engineering link configuration";
       uses igp-link-attributes;
     }

     augment "/nw:networks/nw:network/nw:node/"
            +"nt:termination-point" {
       when "../../nw:network-types/l3-unicast-igp-topology" {
         description
           "Augmentation parameters apply only for networks attributes.

   o  Prefixes are augmented with
           L3 unicast IGP topology";
       }
       description "Augment topology termination point configuration";
       uses igp-termination-point-attributes;
     }

     notification igp-node-event {
       description
         "Notification event for IGP node";
       leaf igp-event-type {
         type igp-event-type;
         description
           "Event type";
       }
       uses node-ref;
       uses l3-unicast-igp-topology-type;
       uses igp-node-attributes;
     }

     notification igp-link-event {
       description
         "Notification event for IGP link";
       leaf igp-event-type {
         type igp-event-type;
         description
           "Event type";
       }
       uses link-ref;
       uses l3-unicast-igp-topology-type;
       uses igp-link-attributes;
     }

     notification igp-prefix-event {
       description
         "Notification event for IGP prefix";
       leaf igp-event-type {
         type igp-event-type;
         description
           "Event type";
       }
       uses node-ref;
       uses l3-unicast-igp-topology-type;
       container prefix {
         description
           "Containing IPG prefix attributes";
         uses igp-prefix-attributes;
       }
     }

     notification termination-point-event {
       description
         "Notification event OSPF specific forwarding address.

   In addition, the module extends notifications for IGP events concerning
   Layer 3 nodes, links, termination point";
       leaf igp-event-type {
         type igp-event-type;
         description
           "Event type";
       }
       uses tp-ref;
       uses l3-unicast-igp-topology-type;
       uses igp-termination-point-attributes;
     }
   }
   <CODE ENDS>

5. points, and prefixes with OSPF
   attributes.

   It should be noted that the model defined here represents topology
   and is intended as an example.  It does not define how to configure
   OSPF routers or interfaces.

6.1.2.  OSPF Topology YANG Module

   <CODE BEGINS> file "ietf-ospf-topology@2016-06-12.yang" "ietf-ospf-topology@2016-08-10.yang"
   module ietf-ospf-topology {
     yang-version 1.1;
     namespace "urn:ietf:params:xml:ns:yang:ietf-ospf-topology";
     prefix "ospf"; "ospft";
     import ietf-inet-types ietf-yang-types {
       prefix "inet"; "yang";
     }
     import ietf-network {
       prefix "nw"; "nd";
     }
     import ietf-network-topology {
       prefix "nt"; "lnk";
     }
     import ietf-l3-unicast-igp-topology ietf-l3-unicast-topology {
       prefix "l3t";
     }
      organization
       "IETF I2RS (Interface to the Routing System) Working Group";
     contact
       "WG Web:    <http://tools.ietf.org/wg/i2rs/>    <>http://tools.ietf.org/wg/i2rs/>
        WG List:   <mailto:i2rs@ietf.org>
        WG Chair:  Susan Hares
                   <mailto:shares@ndzh.com>

        WG Chair:  Russ White
                   <mailto:russ@riw.us>
        Editor:    Alexander Clemm
                   <mailto:alex@cisco.com>
        Editor:    Jan Medved
                   <mailto:jmedved@cisco.com>
        Editor:    Robert Varga
                   <mailto:rovarga@cisco.com>
        Editor:    Tony Tkacik
                   <mailto:ttkacik@cisco.com>
                   <mailto:tony.tkacik@gmail.com>
        Editor:    Xufeng Liu
                   <mailto:xliu@kuatrotech.com>
        Editor:    Igor Bryskin
                   <mailto:Igor.Bryskin@huawei.com>
        Editor:    Aihua Guo
                   <mailto:aguo@advaoptical.com>
        Editor:    Nitin Bahadur
                   <mailto:nitin_bahadur@yahoo.com>
        Editor:    Hariharan Ananthakrishnan
                   <mailto:hari@packetdesign.com>
        Editor:    Vishnu Pavan Beeram
                   <mailto:vbeeram@juniper.net>";
     description
       "This module defines a model for OSPF network topologies.
        Copyright (c) 2016 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
        draft-ietf-i2rs-yang-network-topo-02;
        draft-ietf-i2rs-yang-network-topo-03;
        see the RFC itself for full legal notices.
        NOTE TO RFC EDITOR: Please replace above reference to
        draft-ietf-i2rs-yang-network-topo-02
        draft-ietf-i2rs-yang-network-topo-03 with RFC
        number when published (i.e. RFC xxxx).";
      revision "2016-06-12" "2016-08-10" {
       description
         "Initial revision.
          NOTE TO RFC EDITOR: Please replace the following reference
          to draft-ietf-i2rs-yang-l3-topology-02 draft-ietf-i2rs-yang-l3-topology-03 with
          RFC number when published (i.e. RFC xxxx).";
       reference
         "draft-ietf-i2rs-yang-l3-topology-02";
         "draft-ietf-i2rs-yang-l3-topology-03";
     }
     typedef area-id area-id-type {
       type uint32; yang:dotted-quad;
       description
         "OSPF Area ID";
         "Area ID type.";
     }
     grouping ospf-topology-type {
       description
         "Identifies the OSPF topology type.";
       container ospf {
         presence "indiates OSPF Topology";
         description
           "Its presence identifies the OSPF topology type.";
       }
     }
     augment "/nw:networks/nw:network/nw:network-types/" "/nd:networks/nd:network/nd:network-types/"
       + "l3t:l3-unicast-igp-topology" "l3t:l3-unicast-topology" {
       description
         "Defines the OSPF topology type.";
       uses ospf-topology-type;
     }
     augment "/nw:networks/nw:network/l3t:igp-topology-attributes" "/nd:networks/nd:network/l3t:l3-topology-attributes" {
       when "../nw:network-types/l3t:l3-unicast-igp-topology/ospf" "../nd:network-types/l3t:l3-unicast-topology/ospf" {
         description
           "Augment only for OSPF topology";
       }
       description
         "Augment topology configuration";
       container ospf-topology-attributes {
         description
           "Containing topology attributes";
         leaf area-id {
           type area-id; area-id-type;
           description
             "OSPF area ID";
         }
       }
     }
     augment "/nw:networks/nw:network/nw:node/l3t:igp-node-attributes" "/nd:networks/nd:network/nd:node/l3t:l3-node-attributes" {
       when "../../nw:network-types/l3t:l3-unicast-igp-topology/ospf" "../../nd:network-types/l3t:l3-unicast-topology/ospf" {
         description
           "Augment only for OSPF topology";
       }
       description
         "Augment node configuration";
       uses ospf-node-attributes;
     }
     augment "/nw:networks/nw:network/nt:link/l3t:igp-link-attributes" "/nd:networks/nd:network/lnk:link/l3t:l3-link-attributes" {
       when "../../nw:network-types/l3t:l3-unicast-igp-topology/ospf" "../../nd:network-types/l3t:l3-unicast-topology/ospf" {
         description
           "Augment only for OSPF topology";
       }
       description
         "Augment link configuration";
       uses ospf-link-attributes;
     }

     augment "/nw:networks/nw:network/nw:node/"+
       "l3t:igp-node-attributes/l3t:prefix" {
       when "../../../nw:network-types/l3t:l3-unicast-igp-topology/"
         +"ospf" {
         description
           "Augment only for OSPF topology";
       }
       description
         "Augment prefix";
       uses ospf-prefix-attributes;
     }
     grouping ospf-node-attributes {
       description
         "OSPF node scope attributes";
       container ospf-node-attributes {
         description
           "Containing node attributes";
         choice router-type {
           description
             "Indicates router type";
           case abr {
             leaf abr {
               type empty;
               description
                 "The node is ABR";
             }
           }
           case asbr {
             leaf asbr {
               type empty;
               description
                 "The node is ASBR";
             }
           }
           case internal {
             leaf internal {
               type empty;
               description
                 "The node is internal";
             }
           }
           case pseudonode {
             leaf pseudonode {
               type empty;
               description
                 "The node is pseudonode";
             }
           }
         }
         leaf dr-interface-id {
           when "../router-type/pseudonode" {
             description
               "Valid only for pseudonode";

           }
           type uint32;
           default "0";
           description
             "For pseudonodes, DR interface-id";
         }
         leaf-list multi-topology-id {
           type uint8 {
             range "0..127";
           }
           max-elements "128";
           description
             "List of Multi-Topology Identifier up-to 128 (0-127).
              See RFC 4915";
         }
         leaf capabilities {
           type bits {
             bit graceful-restart-capable {
               position 0;
               description
                 "Graceful restart capable";
             }
             bit graceful-restart-helper {
               position 1;
               description
                 "Graceful restart helper";
             }
             bit stub-router-support {
               position 2;
               description
                 "Stub router support";
             }
             bit traffic-engineering-support {
               position 3;
               description
                 "Traffic engineering support";
             }
             bit point-to-point-over-lan {
               position 4;
               description
                 "Support point to point over LAN";
             }
             bit experimental-te {
               position 5;
               description
                 "Support experimental traffic engineering";
             }
           }
           description
             "OSPF capabilities as bit vector. RFC 4970";
         }
       }
     }
     grouping ospf-link-attributes {
       description
         "OSPF link scope attributes";
       container ospf-link-attributes {
         description
           "Containing OSPF link attributes";
         leaf multi-topology-id {
           type uint8 {
             range "0..127";
           }
           description "Muti "Multi topology ID";
         }
       }
     } // ospf-link-attributes

     grouping ospf-prefix-attributes {
       description
         "OSPF prefix attributes";
       container ospf-prefix-attributes {
         description
           "Containing prefix attributes";
         leaf forwarding-address {
           when "../../l3t:l3-unicast-igp-topology/l3t:ospf/"+
             "l3t:router-type/l3t:asbr" {
             description "Valid only for ABSR";
           }
           type inet:ipv4-address;
           description
             "Forwarding address for ABSR";
         }
       }
     }
     augment "/l3t:igp-node-event" "/l3t:l3-node-event" {
       description
         "OSPF node event";
       uses ospf-topology-type;
       uses ospf:ospf-node-attributes; ospft:ospf-node-attributes;
     }
     augment "/l3t:igp-link-event" "/l3t:l3-link-event" {
       description
         "OSPF link event";
       uses ospf-topology-type;
       uses ospf:ospf-link-attributes;
     }

     augment "/l3t:igp-prefix-event" {
       description
         "OSPF prefix event";
       uses ospf-topology-type;
       uses ospf:ospf-prefix-attributes; ospft:ospf-link-attributes;
     }
   }

   <CODE ENDS>

6.

6.2.  Example 2: IS-IS Topology

6.2.1.  Model Overview

   IS-IS topologies are another type of Layer 3 Unicast topology.  Like
   in the case of OSPF topology, a model for IS-IS topology can be
   defined in a separate module which augments "ietf-l3-unicast-igp-
   topology".  The structure of a corresponding model, "ietf-isis-
   topology", is depicted in the following diagram.  Like before,
   brackets enclose list keys, "rw" means configuration, "ro"
   operational state data, "?" designates optional nodes, "*" designates
   nodes that can have multiple instances.  Parantheses enclose choice
   and case nodes.  A "+" at the end of a line indicates a line break.

module: ietf-isis-topology
augment /nd:networks/nd:network/nd:network-types/l3t:l3-unicast-topology:
   +--rw isis!
augment /nd:networks/nd:network/l3t:l3-topology-attributes:
   +--rw isis-topology-attributes
      +--rw net?   area-address
augment /nd:networks/nd:network/nd:node/l3t:l3-node-attributes:
   +--rw isis-node-attributes
      +--rw iso
      |  +--rw iso-system-id?       system-id
      |  +--rw iso-pseudonode-id?   iso-pseudonode-id
      +--rw net*                 area-address
      +--rw multi-topology-id*   uint16
      +--rw level?               level
augment /nd:networks/nd:network/lnk:link/l3t:l3-link-attributes:
   +--rw isis-link-attributes
      +--rw multi-topology-id?   uint16
augment /l3t:l3-node-event:
   +---- isis!
   +---- isis-node-attributes
      +---- iso
      |  +---- iso-system-id?       system-id
      |  +---- iso-pseudonode-id?   iso-pseudonode-id
      +---- net*                 area-address
      +---- multi-topology-id*   uint16
      +---- level?               level
augment /l3t:l3-link-event:
   +---- isis!
   +---- isis-link-attributes
      +---- multi-topology-id?   uint16

   The module augments the ietf-l3-unicast-topology as follows:

   o  A new topology type is introduced for isis.

   o  Additional topology attributes are introduced in a new grouping
      which augments "topology-attributes" of the ietf-l3-unicast-
      topology module.  The attributes include an ISIS NET-id
      identifying the area.

   o  Additional data objects for nodes are introduced by augmenting
      "node-attributes" of the ietf-l3-unicast-topology module.  New
      objects include router-type, iso-system-id to identify the router,
      a list of multi-topology-id, a list of NET ids, and traffic
      engineering attributes.

   o  Links are augmented with multi-topology-id and traffic engineering
      link attributes.

   In addition, the module augments nodes and links with IS-IS
   attributes.

   Again, it should be noted that the model defined here represents
   topology and is intended as an example.  It does not define how to
   configure IS-IS routers or interfaces.

6.2.2.  IS-IS Topology YANG Module

   <CODE BEGINS> file "ietf-isis-topology@2016-06-12.yang" "ietf-isis-topology@2016-08-10.yang"
   module ietf-isis-topology {
     yang-version 1.1;
     namespace "urn:ietf:params:xml:ns:yang:ietf-isis-topology";
     prefix "isis"; "isist";
     import ietf-network {
       prefix "nw"; "nd";
     }
     import ietf-network-topology {
       prefix "nt"; "lnk";
     }
     import ietf-l3-unicast-igp-topology ietf-l3-unicast-topology {
       prefix "l3t";
     }
      organization
       "IETF I2RS (Interface to the Routing System) Working Group";
     contact
       "WG Web:    <http://tools.ietf.org/wg/i2rs/>    <http://tools.ietf.org/wg/i2rs/>>
        WG List:   <mailto:i2rs@ietf.org>
        WG Chair:  Susan Hares
                   <mailto:shares@ndzh.com>
        WG Chair:  Russ White
                   <mailto:russ@riw.us>

        Editor:    Alexander Clemm
                   <mailto:alex@cisco.com>
        Editor:    Jan Medved
                   <mailto:jmedved@cisco.com>
        Editor:    Robert Varga
                   <mailto:rovarga@cisco.com>
        Editor:    Tony Tkacik
                   <mailto:ttkacik@cisco.com>
                   <mailto:tony.tkacik@gmail.com>
        Editor:    Xufeng Liu
                   <mailto:xliu@kuatrotech.com>
        Editor:    Igor Bryskin
                   <mailto:Igor.Bryskin@huawei.com>
        Editor:    Aihua Guo
                   <mailto:aguo@advaoptical.com>
        Editor:    Nitin Bahadur
                   <mailto:nitin_bahadur@yahoo.com>
        Editor:    Hariharan Ananthakrishnan
                   <mailto:hari@packetdesign.com>
        Editor:    Vishnu Pavan Beeram
                   <mailto:vbeeram@juniper.net>";
     description
       "This module defines a model for IS-IS network topologies.
        Copyright (c) 2016 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
        draft-ietf-i2rs-yang-network-topo-02;
        draft-ietf-i2rs-yang-network-topo-03;
        see the RFC itself for full legal notices.
        NOTE TO RFC EDITOR: Please replace above reference to
        draft-ietf-i2rs-yang-network-topo-02
        draft-ietf-i2rs-yang-network-topo-03 with RFC
        number when published (i.e. RFC xxxx).";
      revision "2016-06-12" "2016-08-10" {
       description
         "Initial revision.
          NOTE TO RFC EDITOR: Please replace the following reference
          to draft-ietf-i2rs-yang-l3-topology-02 draft-ietf-i2rs-yang-l3-topology-03 with
          RFC number when published (i.e. RFC xxxx).";
       reference
         "draft-ietf-i2rs-yang-l3-topology-02";
         draft-ietf-i2rs-yang-l3-topology-03;
     }
     typedef iso-system-id iso-pseudonode-id {
       type string {
         pattern '[0-9a-fA-F]{4}(\.[0-9a-fA-F]{4}){2}'; '[0-9a-fA-F]{2}';

       }
       description
            "ISO System ID. RFC 1237"; pseudonode id for broadcast network.";
     }
     typedef iso-pseudonode-id { area-address{
       type string {
         pattern '[0-9a-fA-F]{2}'; '[0-9A-Fa-f]{2}\.([0-9A-Fa-f]{4}\.){0,3}';
       }
       description
         "ISO pseudonode id for broadcast network";
         "This type defines the area address.";
     }
     typedef iso-net-id system-id {
       type string {
         pattern '[0-9a-fA-F]{2}((\.[0-9a-fA-F]{4}){6})';
          '[0-9A-Fa-f]{4}\.[0-9A-Fa-f]{4}\.[0-9A-Fa-f]{4}';
       }
       description
         "ISO NET ID. RFC 1237";
        "This type defines ISIS system id using a pattern;
         an example of a system id looks like: 0143.0438.AeF0.";
     }
     typedef level {
       type enumeration {
         enum "level-1" {
           description
            "This enum describes L1 only capability.";
         }
         enum "level-2" {
           description
            "This enum describes L2 only capability.";
         }
         enum "level-all" {
           description
            "This enum describes both levels (L1 and L2) capability.";
         }
       }
       default "level-all";
       description
        "This type defines the ISIS level of an object.";
     }
     grouping isis-topology-type {
       description
         "Identifies the ISIS topology type.";
       container isis {
         presence "Indicates ISIS Topology";
         description
           "Its presence identifies the ISIS topology type.";
       }
     }
     augment "/nw:networks/nw:network/nw:network-types/"
       +"l3t:l3-unicast-igp-topology" "/nd:networks/nd:network/nd:network-types/"
       +"l3t:l3-unicast-topology" {
       description
         "Defines the ISIS topology type.";
       uses isis-topology-type;
     }
     augment "/nw:networks/nw:network/l3t:igp-topology-attributes" "/nd:networks/nd:network/l3t:l3-topology-attributes" {
       when "../nw:network-types/l3t:l3-unicast-igp-topology/isis" "../nd:network-types/l3t:l3-unicast-topology/isis" {
         description
           "Augment only for ISIS topology";
       }
       description
         "Augment topology configuration";
       container isis-topology-attributes {
         description
           "Containing topology attributes";
         leaf net {
           type iso-net-id; area-address;
           description
             "ISO NET ID value";
         }
       }
     }
     augment "/nw:networks/nw:network/nw:node/"+
       "l3t:igp-node-attributes" "/nd:networks/nd:network/nd:node/"+
       "l3t:l3-node-attributes" {
       when "../../nw:network-types/l3t:l3-unicast-igp-topology/isis" "../../nd:network-types/l3t:l3-unicast-topology/isis" {
         description
           "Augment only for ISIS topology";
       }
       description
         "Augment node configuration";
       uses isis-node-attributes;
     }
     augment "/nw:networks/nw:network/nt:link/l3t:igp-link-attributes" "/nd:networks/nd:network/lnk:link/l3t:l3-link-attributes" {
       when "../../nw:network-types/l3t:l3-unicast-igp-topology/isis" "../../nd:network-types/l3t:l3-unicast-topology/isis" {
         description
           "Augment only for ISIS topology";
       }
       description
         "Augment link configuration";
       uses isis-link-attributes;
     }
     grouping isis-node-attributes {
       description
         "ISIS node scope attributes";
       container isis-node-attributes {
         description
           "Containing node attributes";

         container iso {
           description
             "Containing ISO atrributes";
           leaf iso-system-id {
             type iso-system-id; system-id;
             description
               "ISO system ID";
           }
           leaf iso-pseudonode-id {
             type iso-pseudonode-id;
             default "00";
             description
               "Pseudonode ID";
           }
         }
         leaf-list net {
           type iso-net-id; area-address;
           max-elements 3;
           description
             "List of ISO NET IDs";
         }
         leaf-list multi-topology-id {
           type uint8 uint16 {
             range "0..127"; "0..4095";
           }
           max-elements "128";
           description
             "List of Multi Topology Identifier upto up to 128 (0-127).
             RFC 4915";
         }
         choice router-type {
           description
             "Indicates router type";
           case level-2 {
             leaf level-2 {
               type empty;
               description
                 "Level-2 only";
             }
           }
           case level-1 {
             leaf level-1 {
               type empty;
               description
                 "Level-1 only";
             }
           }
           case level-1-2 {
         leaf level-1-2 level {
           type empty; level;
           description
                 "Level-1 "Level 1, Level 2 or Level 1 and Level-2";
             }
           } 2";
         }
       }
     }
     grouping isis-link-attributes {
       description
         "ISIS link scope attributes";
       container isis-link-attributes {
         description
           "Containing link attributes";
         leaf multi-topology-id {
           type uint8 uint16 {
             range "0..127"; "0..4095";
           }
           description
             "Multi topology ID";

         }
       }
     }
     augment "/l3t:igp-node-event" "/l3t:l3-node-event" {
       description
         "ISIS node event";
       uses isis-topology-type;
       uses isis-node-attributes;
     }
     augment "/l3t:igp-link-event" "/l3t:l3-link-event" {
       description
         "ISIS link event";
       uses isis-topology-type;
       uses isis-link-attributes;
     }
   }

   <CODE ENDS>

7.  Security Considerations

   The transport protocol used for sending the topology data MUST
   support authentication and SHOULD support encryption.  The data-model
   by itself does not create any security implications.

8.  Contributors

   The model presented in this paper was contributed to by more people
   than can be listed on the author list.  Additional contributors
   include:

   o  Ken Gray, Juniper Networks

   o  Tom Nadeau, Brocade

   o  Aleksandr Zhdankin, Cisco

9.  Acknowledgements

   We wish to acknowledge the helpful contributions, comments, and
   suggestions that were received from Ladislav Lhotka, Andy Bierman,
   Carlos Pignataro, Joel Halpern, Juergen Schoenwaelder, Alia Atlas,
   and
   Susan Hares. Hares, Benoit Claise, and Carl Moberg.

10.  References

10.1.  Normative References

   [I-D.draft-ietf-i2rs-yang-network-topo]
              Clemm, A., Medved, J., Tkacik, T., Varga, R., Bahadur, N.,
              Ananthakrishnan, H., and X. Liu, "A YANG Data Model for
              Network Topologies", I-D draft-ietf-i2rs-yang-network-
              topo-03, June 2016.

   [I-D.draft-ietf-netconf-restconf]
              Bierman, A., Bjorklund, M., and K. Watsen, "RESTCONF
              Protocol", I-D draft-ietf-netconf-restconf-13, April
              topo-05, July 2016.

   [I-D.draft-ietf-netmod-rfc6020bis]
              Bjorklund, M., "The YANG 1.1 Data Modeling Language", I-D
              draft-ietf-netmod-rfc6020bis-13,
              draft-ietf-netmod-rfc6020bis-14, June 2016.

   [I-D.draft-ietf-netmod-yang-json]
              Lhotka, L., "JSON Encoding of Data Modeled with YANG",
              I-D draft-ietf-netmod-yang-json-10, March 2016.

   [RFC1195]  Callon, R., "Use of OSI IS-IS for Routing in TCP/IP and
              Dual Environments", RFC 1195, December 1990.

   [RFC2178]  Moy, J., "OSPF Version 2", RFC 2178, July 1997.

   [RFC6020]  Bjorklund, M., "YANG - A Data Modeling Language for the
              Network Configuration Protocol (NETCONF)", RFC 6020,
              October 2010.

   [RFC6241]  Enns, R., Bjorklund, M., Schoenwaelder, J., and A.
              Bierman, "Network Configuration Protocol (NETCONF)",
              RFC 6241, June 2011.

   [RFC6991]  Schoenwaelder, J., "Common YANG Data Types", RFC 6991,
              July 2013.

   [RFC7223]  Bjorklund, M., "A YANG Data Model for Interface
              Management", RFC 7223, May 2014.

10.2.  Informative References

   [I-D.draft-ietf-i2rs-usecase-reqs-summary]
              Hares, S. and M. Chen, "Summary of I2RS Use Case
              Requirements", I-D draft-ietf-i2rs-usecase-reqs-summary-
              02, March 2016.

   [OpenDaylight]
              Medved, J., Varga, R., Tkacik, T., and K. Gray,
              "OpenDaylight: Towards a Model-Driven SDN Controller
              architecture", IEEE 15th Int. Symposium on World of
              Wireless, Mobile and Multimedia Networks (IEEE WoWMoM
              2014), June 2014.

Authors' Addresses

   Alexander Clemm
   Cisco

   EMail: alex@cisco.com

   Jan Medved
   Cisco

   EMail: jmedved@cisco.com

   Robert Varga
   Pantheon Technologies SRO

   EMail: robert.varga@pantheon.sk

   Tony Tkacik
   Pantheon Technologies SRO

   EMail: tony.tkacik@pantheon.sk tony.tkacik@gmail.com

   Xufeng Liu
   Kuatro Technologies
   Ericsson

   EMail: xliu@kuatrotech.com

   Igor Bryskin
   Huawei

   EMail: Igor.Bryskin@huawei.com

   Aihua Guo
   Adva Optical

   EMail: aguo@advaoptical.com

   Hariharan Ananthakrishnan
   Packet Design

   EMail: hari@packetdesign.com
   Nitin Bahadur
   Bracket Computing

   EMail: nitin_bahadur@yahoo.com

   Vishnu Pavan Beeram
   Juniper Networks

   EMail: vbeeram@juniper.net