1 module org-openroadm-routing {
2 namespace "http://org/openroadm/routing";
3 prefix org-openroadm-routing;
5 import ietf-yang-types {
7 revision-date 2013-07-15;
9 import org-openroadm-device {
10 prefix org-openroadm-device;
11 revision-date 2020-05-29;
19 "This model defines Yang model for routing.
21 This model reuses data items defined in the IETF YANG model for
22 interfaces described by RFC 8022.
24 Some attributes which are not required in Open ROADM MSA are removed.
25 Yang file included are changed to fit into Open ROADM MSA yang structure.
27 IETF code is subject to the following copyright and license:
28 Copyright (c) IETF Trust and the persons identified as authors of
32 Redistribution and use in source and binary forms, with or without
33 modification, is permitted pursuant to, and subject to the license
34 terms contained in, the Simplified BSD License set forth in
35 Section 4.c of the IETF Trust's Legal Provisions Relating
36 to IETF Documents (http://trustee.ietf.org/license-info).";
66 "RFC XXXX: A YANG Data Model for Routing Management";
69 feature multiple-ribs {
71 "This feature indicates that the server supports user-defined
74 Servers that do not advertise this feature SHOULD provide
75 exactly one system-controlled RIB per routing-instance and
76 supported address family and make them also the default RIBs.
77 These RIBs then appear as entries of the list
78 /routing-state/routing-instance/ribs/rib.";
83 "This feature indicates that the server supports configuration
84 of an explicit 32-bit router ID that is used by some routing
87 Servers that do not advertise this feature set a router ID
88 algorithmically, usually to one of configured IPv4 addresses.
89 However, this algorithm is implementation-specific.";
92 identity address-family {
94 "Base identity from which identities describing address
95 families are derived.";
101 "This identity represents IPv4 address family.";
107 "This identity represents IPv6 address family.";
110 identity routing-instance {
112 "Base identity from which identities describing routing
113 instance types are derived.";
116 identity default-routing-instance {
117 base routing-instance;
119 "This identity represents either a default routing instance, or
120 the only routing instance on systems that do not support
121 multiple instances.";
124 identity vrf-routing-instance {
125 base routing-instance;
127 "This identity represents a VRF routing instance. The type is
128 distinct from the default-routing-instance. There may be
129 multiple vrf-routing-interfaces.";
132 identity routing-protocol {
134 "Base identity from which routing protocol identities are
139 base routing-protocol;
141 "Routing pseudo-protocol that provides routes to directly
142 connected networks.";
146 base routing-protocol;
148 "Static routing pseudo-protocol.";
151 typedef routing-instance-ref {
153 path "/org-openroadm-device:org-openroadm-device/org-openroadm-routing:routing/org-openroadm-routing:routing-instance/org-openroadm-routing:name";
156 "This type is used for leafs that reference a routing instance
160 typedef routing-instance-state-ref {
162 path "/org-openroadm-device:org-openroadm-device/org-openroadm-routing:routing-state/org-openroadm-routing:routing-instance/org-openroadm-routing:name";
165 "This type is used for leafs that reference state data of a
169 typedef route-preference {
172 "This type is used for route preferences.";
175 grouping address-family-group {
177 "This grouping provides a leaf identifying an address
179 leaf address-family {
191 "This grouping provides router ID.";
193 type yang:dotted-quad;
195 "A 32-bit number in the form of a dotted quad that is used by
196 some routing protocols identifying a router.";
198 "RFC 2328: OSPF Version 2.";
202 grouping special-next-hop-group {
204 "This grouping provides a leaf with an enumeration of special
206 leaf special-next-hop {
210 "Silently discard the packet.";
214 "Discard the packet and notify the sender with an error
215 message indicating that the destination host is
220 "Discard the packet and notify the sender with an error
221 message indicating that the communication is
222 administratively prohibited.";
226 "The packet will be received by the local system.";
230 "Special next-hop options.";
234 grouping next-hop-content {
236 "Generic parameters of next-hops in static routes.";
237 choice next-hop-options {
240 "Options for next-hops in static routes.
242 It is expected that other cases will be added through
243 augments from other modules, e.g., for Equal-Cost Multipath
245 case simple-next-hop {
247 "Simple next-hop is specified as an outgoing interface,
248 next-hop address or both.
250 Address-family-specific modules are expected to provide
251 'next-hop-address' leaf via augmentation.";
252 leaf outgoing-interface {
254 path "/org-openroadm-device:org-openroadm-device/org-openroadm-routing:routing/org-openroadm-routing:routing-instance/org-openroadm-routing:interfaces/org-openroadm-routing:interface";
257 "Name of the outgoing interface.";
260 case special-next-hop {
261 uses special-next-hop-group;
266 grouping route-metadata {
268 "Common route metadata.";
269 leaf source-protocol {
271 base routing-protocol;
275 "Type of the routing protocol from which the route
281 "Presence of this leaf indicates that the route is preferred
282 among all routes in the same RIB that have the same
283 destination prefix.";
286 type yang:date-and-time;
288 "Time stamp of the last modification of the route. If the
289 route was never modified, it is the time when the route was
290 inserted into the RIB.";
294 grouping routing-grp {
297 "Configuration parameters for the routing subsystem.";
298 list routing-instance {
301 "Configuration of a routing instance.";
305 "The name of the routing instance.
307 For system-controlled entries, the value of this leaf must
308 be the same as the name of the corresponding entry in
311 For user-controlled entries, an arbitrary name can be
316 base routing-instance;
318 default "org-openroadm-routing:default-routing-instance";
320 "The type of the routing instance.";
326 "Enable/disable the routing instance.
328 If this parameter is false, the parent routing instance is
329 disabled and does not appear in state data, despite any
330 other configuration that might be present.";
333 if-feature "router-id";
335 "Configuration of the global router ID. Routing protocols
336 that use router ID can use this parameter or override it
337 with another value.";
342 "Textual description of the routing instance.";
344 container interfaces {
346 "Assignment of the routing instance's interfaces.";
347 leaf-list interface {
348 type org-openroadm-device:interface-ref;
350 "The name of a configured network layer interface to be
351 assigned to the routing-instance.";
354 container routing-protocols {
356 "Configuration of routing protocol instances.";
357 list routing-protocol {
360 "Each entry contains configuration of a routing protocol
364 base routing-protocol;
367 "Type of the routing protocol - an identity derived
368 from the 'routing-protocol' base identity.";
373 "An arbitrary name of the routing protocol instance.";
378 "Textual description of the routing protocol
381 container static-routes {
382 when "../type='org-openroadm-routing:static'" {
384 "This container is only valid for the 'static'
388 "Configuration of the 'static' pseudo-protocol.
390 Address-family-specific modules augment this node with
391 their lists of routes.";
397 "Configuration of RIBs.";
401 "Each entry contains configuration for a RIB identified
404 Entries having the same key as a system-controlled entry
405 of the list /routing-state/routing-instance/ribs/rib are
406 used for configuring parameters of that entry. Other
407 entries define additional user-controlled RIBs.";
411 "The name of the RIB.
413 For system-controlled entries, the value of this leaf
414 must be the same as the name of the corresponding
417 For user-controlled entries, an arbitrary name can be
420 uses address-family-group {
422 "Address family of the RIB.
424 It is mandatory for user-controlled RIBs. For
425 system-controlled RIBs it can be omitted, otherwise it
426 must match the address family of the corresponding
428 refine "address-family" {
435 "Textual description of the RIB.";
443 augment "/org-openroadm-device:org-openroadm-device" {
447 grouping routing-state-grp {
448 container routing-state {
451 "State data of the routing subsystem.";
452 list routing-instance {
455 "Each list entry is a container for state data of a routing
458 An implementation MUST support routing instance(s) of the
459 type 'rt:default-routing-instance', and MAY support other
460 types. An implementation MAY restrict the number of routing
461 instances of each supported type.
463 An implementation SHOULD create at least one
464 system-controlled instance, and MAY allow the clients to
465 create user-controlled routing instances in
470 "The name of the routing instance.
472 For system-controlled instances the name is persistent,
473 i.e., it SHOULD NOT change across reboots.";
477 base routing-instance;
480 "The routing instance type.";
486 It may be either configured or assigned algorithmically by
487 the implementation.";
489 container routing-protocols {
491 "Container for the list of routing protocol instances.";
492 list routing-protocol {
495 "State data of a routing protocol instance.
497 An implementation MUST provide exactly one
498 system-controlled instance of the type 'direct'. Other
499 instances MAY be created by configuration.";
502 base routing-protocol;
505 "Type of the routing protocol.";
510 "The name of the routing protocol instance.
512 For system-controlled instances this name is
513 persistent, i.e., it SHOULD NOT change across
520 "Container for RIBs.";
525 "Each entry represents a RIB identified by the 'name'
526 key. All routes in a RIB MUST belong to the same address
529 For each routing instance, an implementation SHOULD
530 provide one system-controlled default RIB for each
531 supported address family.";
535 "The name of the RIB.";
537 uses address-family-group;
539 if-feature "multiple-ribs";
543 "This flag has the value of 'true' if and only if the
544 RIB is the default RIB for the given address family.
546 A default RIB always receives direct routes. By
547 default it also receives routes from all routing
552 "Current content of the RIB.";
560 augment "/org-openroadm-device:org-openroadm-device" {
561 uses routing-state-grp;