Skip to main content

A YANG Data Model for Layer 3 Topologies
RFC 8346

Document Type RFC - Proposed Standard (March 2018)
Authors Alexander Clemm , Jan Medved , Robert Varga , Xufeng Liu , Hariharan Ananthakrishnan , Nitin Bahadur
Last updated 2022-12-08
RFC stream Internet Engineering Task Force (IETF)
Formats
Additional resources Mailing list discussion
IESG Responsible AD Alia Atlas
Send notices to (None)
RFC 8346
quot;Augmentation parameters apply only for networks with
           L3 Unicast topology";
       }
       description
           "L3 Unicast node-level attributes ";
       uses l3t:l3-node-attributes;
     }
     augment "/nw-s:networks/nw-s:network/nt-s:link" {
       when "../nw-s:network-types/l3t-s:l3-unicast-topology" {
         description
           "Augmentation parameters apply only for networks with
           L3 Unicast topology";
       }
       description
         "Augments topology link attributes";
       uses l3t:l3-link-attributes;
     }
     augment "/nw-s:networks/nw-s:network/nw-s:node/"
            +"nt-s:termination-point" {
       when "../../nw-s:network-types/l3t-s:l3-unicast-topology" {
         description
           "Augmentation parameters apply only for networks with
           L3 Unicast topology";
       }

Clemm, et al.                Standards Track                   [Page 22]
RFC 8346            YANG Data Model for L3 Topologies         March 2018

       description "Augments topology termination point configuration";
       uses l3t:l3-termination-point-attributes;
     }
     notification l3-node-event {
       description
         "Notification event for L3 node";
       leaf l3-event-type {
         type l3t:l3-event-type;
         description
           "Event type";
       }
       uses nw-s:node-ref;
       uses l3t:l3-unicast-topology-type;
       uses l3t:l3-node-attributes;
     }
     notification l3-link-event {
       description
         "Notification event for L3 link";
       leaf l3-event-type {
         type l3t:l3-event-type;
         description
           "Event type";
       }
       uses nt-s:link-ref;
       uses l3t:l3-unicast-topology-type;
       uses l3t:l3-link-attributes;
     }
     notification l3-prefix-event {
       description
         "Notification event for L3 prefix";
       leaf l3-event-type {
         type l3t:l3-event-type;
         description
           "Event type";
       }
       uses nw-s:node-ref;
       uses l3t:l3-unicast-topology-type;
       container prefix {
         description
           "Contains L3 prefix attributes";
         uses l3t:l3-prefix-attributes;
       }
     }
     notification termination-point-event {
       description
         "Notification event for L3 termination point";
       leaf l3-event-type {
         type l3t:l3-event-type;

Clemm, et al.                Standards Track                   [Page 23]
RFC 8346            YANG Data Model for L3 Topologies         March 2018

         description
           "Event type";
       }
       uses nt-s:tp-ref;
       uses l3t:l3-unicast-topology-type;
       uses l3t:l3-termination-point-attributes;
     }
   }

   <CODE ENDS>

Appendix B.  Extending the Model

   The model can be extended for specific Layer 3 Unicast types.
   Examples include OSPF and IS-IS topologies.  This appendix introduces
   a YANG module that defines a simple topology model for OSPF.  This
   module is intended to serve as an example that illustrates how the
   general topology model can be refined across multiple levels.  It
   does not constitute a full-fledged OSPF topology model, which may be
   more comprehensive and refined than the model that is described here.

B.1.  Example OSPF Topology

B.1.1.  Model Overview

   The following model shows how the Layer 3 Unicast topology model can
   be extended, in this case, to cover OSPF topologies.  For this
   purpose, a set of augmentations are introduced in a separate YANG
   module, "example-ospf-topology", whose structure is depicted in the
   following diagram.  As before, the notation syntax follows [RFC8340].
   Note that one of the lines has been wrapped to adhere to the
   72-character line limitation of RFCs.

Clemm, et al.                Standards Track                   [Page 24]
RFC 8346            YANG Data Model for L3 Topologies         March 2018

   module: example-ospf-topology
   augment /nw:networks/nw:network/nw:network-types/
     l3t:l3-unicast-topology:
     +--rw ospf!
   augment /nw:networks/nw:network/l3t:l3-topology-attributes:
     +--rw ospf-topology-attributes
        +--rw area-id?   area-id-type
   augment /nw:networks/nw:network/nw: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
   augment /nw:networks/nw:network/nt:link/l3t:l3-link-attributes:
     +--rw ospf-link-attributes
   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
   augment /l3t:l3-link-event:
     +---- ospf!
     +---- ospf-link-attributes

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

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

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

Clemm, et al.                Standards Track                   [Page 25]
RFC 8346            YANG Data Model for L3 Topologies         March 2018

   o  Additional data objects for nodes are introduced by augmenting the
      l3-node-attributes of the "ietf-l3-unicast-topology" module.  New
      objects include router-type and dr-interface-id for pseudonodes.

   o  Links are augmented with OSPF link attributes.

   In addition, the module extends notifications for events concerning
   Layer 3 nodes and links 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.

B.1.2.  OSPF Topology YANG Module

   The OSPF Topology YANG module is specified below.  As mentioned, the
   module is intended as an example for how the Layer 3 Unicast topology
   model can be extended to cover OSPF topologies, but it is not
   normative.  Accordingly, the module is not delimited with
   <CODE BEGINS> and <CODE ENDS> tags.

  file "example-ospf-topology@2017-12-16.yang"
  module example-ospf-topology {
      yang-version 1.1;
      namespace "urn:example:example-ospf-topology";
      prefix "ex-ospft";
      import ietf-yang-types {
          prefix "yang";
      }
      import ietf-network {
          prefix "nw";
      }
      import ietf-network-topology {
          prefix "nt";
      }
      import ietf-l3-unicast-topology {
          prefix "l3t";
      }
      description
         "This module is intended as an example for how the
          Layer 3 Unicast topology model can be extended to cover
          OSPF topologies.";
      typedef area-id-type {
          type yang:dotted-quad;
          description
              "Area ID type.";
      }
      grouping ospf-topology-type {

Clemm, et al.                Standards Track                   [Page 26]
RFC 8346            YANG Data Model for L3 Topologies         March 2018

          description
              "Identifies the OSPF topology type.";
          container ospf {
              presence "indicates OSPF Topology";
              description
                  "Its presence identifies the OSPF topology type.";
          }
      }
      augment "/nw:networks/nw:network/nw:network-types/"
      + "l3t:l3-unicast-topology" {
          description
              "Defines the OSPF topology type.";
          uses ospf-topology-type;
      }
      augment "/nw:networks/nw:network/l3t:l3-topology-attributes" {
          when "../nw:network-types/l3t:l3-unicast-topology/" +
              "ex-ospft:ospf" {
              description
                  "Augments only for OSPF topology";
              }
          description
              "Augments topology configuration";
          container ospf-topology-attributes {
              description
                  "Contains topology attributes";
              leaf area-id {
                  type area-id-type;
                  description
                      "OSPF area ID";
              }
          }
      }
      augment "/nw:networks/nw:network/nw:node/l3t:l3-node-attributes" {
          when "../../nw:network-types/l3t:l3-unicast-topology/" +
              "ex-ospft:ospf" {
              description
                  "Augments only for OSPF topology";
          }
          description
              "Augments node configuration";
          uses ospf-node-attributes;
      }
      augment "/nw:networks/nw:network/nt:link/l3t:l3-link-attributes" {
          when "../../nw:network-types/l3t:l3-unicast-topology/" +
              "ex-ospft:ospf" {
              description
                  "Augments only for OSPF topology";
          }

Clemm, et al.                Standards Track                   [Page 27]
RFC 8346            YANG Data Model for L3 Topologies         March 2018

          description
              "Augments link configuration";
          uses ospf-link-attributes;
      }
      grouping ospf-node-attributes {
          description
              "OSPF node scope attributes";
          container ospf-node-attributes {
              description
                  "Contains 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 "../pseudonode" {
                      description
                          "Valid only for pseudonode";
                  }
                  type uint32;

Clemm, et al.                Standards Track                   [Page 28]
RFC 8346            YANG Data Model for L3 Topologies         March 2018

                  default "0";
                  description
                      "For pseudonodes, DR interface-id";
              }
          }
      }
      grouping ospf-link-attributes {
          description
              "OSPF link scope attributes";
          container ospf-link-attributes {
              description
                  "Contains OSPF link attributes";
          }
      } // ospf-link-attributes
      augment "/l3t:l3-node-event" {
          description
              "OSPF node event";
          uses ospf-topology-type;
          uses ospf-node-attributes;
      }
      augment "/l3t:l3-link-event" {
          description
              "OSPF link event";
          uses ospf-topology-type;
          uses ospf-link-attributes;
      }
  }

Appendix C.  An Example

   This section contains an example of an instance data tree in JSON
   encoding [RFC7951].  The example instantiates "ietf-l3-unicast-
   topology" for the topology that is depicted in the following diagram.
   There are three nodes: D1, D2, and D3.  D1 has three termination
   points: 1-0-1, 1-2-1, and 1-3-1.  D2 has three termination points as
   well: 2-1-1, 2-0-1, and 2-3-1.  D3 has two termination points: 3-1-1
   and 3-2-1.  In addition, there are six links, two between each pair
   of nodes, with one going in each direction.

Clemm, et al.                Standards Track                   [Page 29]
RFC 8346            YANG Data Model for L3 Topologies         March 2018

                +------------+                   +------------+
                |     D1     |                   |     D2     |
               /-\          /-\                 /-\          /-\
               | | 1-0-1    | |---------------->| | 2-1-1    | |
               | |    1-2-1 | |<----------------| |    2-0-1 | |
               \-/  1-3-1   \-/                 \-/  2-3-1   \-/
                |   /----\   |                   |   /----\   |
                +---|    |---+                   +---|    |---+
                    \----/                           \----/
                     A  |                             A  |
                     |  |                             |  |
                     |  |                             |  |
                     |  |       +------------+        |  |
                     |  |       |     D3     |        |  |
                     |  |      /-\          /-\       |  |
                     |  +----->| | 3-1-1    | |-------+  |
                     +---------| |    3-2-1 | |<---------+
                               \-/          \-/
                                |            |
                                +------------+

                   Figure 2: A Network Topology Example

   The corresponding instance data tree is depicted below.  Note that
   some lines have been wrapped to adhere to the 72-character line
   limitation of RFCs.

   {
     "ietf-network:networks": {
       "network": [
         {
           "network-types": {
             "ietf-l3-unicast-topology:l3-unicast-topology": {}
           },
           "network-id": "l3-topo-example",
           "node": [
             {
               "node-id": "D1",
               "termination-point": [
                 {
                   "tp-id": "1-0-1",
                   "ietf-l3-unicast-topology:
                     l3-termination-point-attributes": {
                     "unnumbered-id:": 101
                   }
                 },
                 {
                   "tp-id": "1-2-1",

Clemm, et al.                Standards Track                   [Page 30]
RFC 8346            YANG Data Model for L3 Topologies         March 2018

                   "ietf-l3-unicast-topology:
                     l3-termination-point-attributes": {
                     "unnumbered-id:": 121
                   }
                 },
                 {
                   "tp-id": "1-3-1",
                   "ietf-l3-unicast-topology:
                     l3-termination-point-attributes": {
                     "unnumbered-id:": 131
                   }
                 }
               ],
               "ietf-l3-unicast-topology:l3-node-attributes": {
                 "router-id": ["203.0.113.1"]
               }
             },
             {
               "node-id": "D2",
               "termination-point": [
                 {
                   "tp-id": "2-0-1",
                   "ietf-l3-unicast-topology:
                     l3-termination-point-attributes": {
                     "unnumbered-id:": 201
                   }
                 },
                 {
                   "tp-id": "2-1-1",
                   "ietf-l3-unicast-topology:
                     l3-termination-point-attributes": {
                     "unnumbered-id:": 211
                   }
                 },
                 {
                   "tp-id": "2-3-1",
                   "ietf-l3-unicast-topology:
                     l3-termination-point-attributes": {
                     "unnumbered-id:": 231
                   }
                 }
               ],
               "ietf-l3-unicast-topology:l3-node-attributes": {
                 "router-id": ["203.0.113.2"]
               }
             },
             {
               "node-id": "D3",

Clemm, et al.                Standards Track                   [Page 31]
RFC 8346            YANG Data Model for L3 Topologies         March 2018

               "termination-point": [
                 {
                   "tp-id": "3-1-1",
                   "ietf-l3-unicast-topology:
                     l3-termination-point-attributes": {
                     "unnumbered-id:": 311
                   }
                 },
                 {
                   "tp-id": "3-2-1",
                   "ietf-l3-unicast-topology:
                     l3-termination-point-attributes": {
                     "unnumbered-id:": 321
                   }
                 }
               ],
               "ietf-l3-unicast-topology:l3-node-attributes": {
                 "router-id": ["203.0.113.3"]
               }
             }
           ],
           "ietf-network-topology:link": [
             {
               "link-id": "D1,1-2-1,D2,2-1-1",
               "source": {
                 "source-node": "D1",
                 "source-tp": "1-2-1"
               }
               "destination": {
                 "dest-node": "D2",
                 "dest-tp": "2-1-1"
               },
               "ietf-l3-unicast-topology:l3-link-attributes": {
                 "metric1": "100"
               }
             },
             {
               "link-id": "D2,2-1-1,D1,1-2-1",
               "source": {
                 "source-node": "D2",
                 "source-tp": "2-1-1"
               }
               "destination": {
                 "dest-node": "D1",
                 "dest-tp": "1-2-1"
               },
               "ietf-l3-unicast-topology:l3-link-attributes": {
                 "metric1": "100"

Clemm, et al.                Standards Track                   [Page 32]
RFC 8346            YANG Data Model for L3 Topologies         March 2018

               }
             },
             {
               "link-id": "D1,1-3-1,D3,3-1-1",
               "source": {
                 "source-node": "D1",
                 "source-tp": "1-3-1"
               }
               "destination": {
                 "dest-node": "D3",
                 "dest-tp": "3-1-1"
               },
               "ietf-l3-unicast-topology:l3-link-attributes": {
                 "metric1": "100"
               }
             },
             {
               "link-id": "D3,3-1-1,D1,1-3-1",
               "source": {
                 "source-node": "D3",
                 "source-tp": "3-1-1"
               }
               "destination": {
                 "dest-node": "D1",
                 "dest-tp": "1-3-1"
               },
               "ietf-l3-unicast-topology:l3-link-attributes": {
                 "metric1": "100"
               }
             },
             {
               "link-id": "D2,2-3-1,D3,3-2-1",
               "source": {
                 "source-node": "D2",
                 "source-tp": "2-3-1"
               }
               "destination": {
                 "dest-node": "D3",
                 "dest-tp": "3-2-1"
               },
               "ietf-l3-unicast-topology:l3-link-attributes": {
                 "metric1": "100"
               }
             },
             {
               "link-id": "D3,3-2-1,D2,2-3-1",
               "source": {
                 "source-node": "D3",

Clemm, et al.                Standards Track                   [Page 33]
RFC 8346            YANG Data Model for L3 Topologies         March 2018

                 "source-tp": "3-2-1"
               }
               "destination": {
                 "dest-node": "D2",
                 "dest-tp": "2-3-1"
               },
               "ietf-l3-unicast-topology:l3-link-attributes": {
                 "metric1": "100"
               }
             }
           ]
         }
       ]
     }
   }

                       Figure 3: Instance Data Tree

Acknowledgments

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

Contributors

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

   o  Vishnu Pavan Beeram, Juniper

   o  Igor Bryskin, Huawei

   o  Ken Gray, Cisco

   o  Aihua Guo, Huawei

   o  Tom Nadeau, Brocade

   o  Tony Tkacik

   o  Aleksandr Zhdankin, Cisco

Clemm, et al.                Standards Track                   [Page 34]
RFC 8346            YANG Data Model for L3 Topologies         March 2018

Authors' Addresses

   Alexander Clemm
   Huawei USA - Futurewei Technologies Inc.
   Santa Clara, CA
   United States of America

   Email: ludwig@clemm.org, alexander.clemm@huawei.com

   Jan Medved
   Cisco

   Email: jmedved@cisco.com

   Robert Varga
   Pantheon Technologies SRO

   Email: robert.varga@pantheon.tech

   Xufeng Liu
   Jabil

   Email: xufeng.liu.ietf@gmail.com

   Hariharan Ananthakrishnan
   Packet Design

   Email: hari@packetdesign.com

   Nitin Bahadur
   Bracket Computing

   Email: nitin_bahadur@yahoo.com

Clemm, et al.                Standards Track                   [Page 35]