5 namespace "urn:ietf:params:xml:ns:yang:ietf-routing";
9 import ietf-yang-types {
13 import ietf-interfaces {
18 "IETF NETMOD (NETCONF Data Modeling Language) Working Group";
21 "WG Web: <https://datatracker.ietf.org/wg/netmod/>
22 WG List: <mailto:netmod@ietf.org>
24 <mailto:lberger@labn.net>
26 <mailto:kwatsen@juniper.net>
27 Editor: Ladislav Lhotka
28 <mailto:lhotka@nic.cz>
30 <mailto:acee@cisco.com>";
33 "This YANG module defines essential components for the management
34 of a routing subsystem.
35 Copyright (c) 2016 IETF Trust and the persons identified as
36 authors of the code. All rights reserved.
37 Redistribution and use in source and binary forms, with or
38 without modification, is permitted pursuant to, and subject to
39 the license terms contained in, the Simplified BSD License set
40 forth in Section 4.c of the IETF Trust's Legal Provisions
41 Relating to IETF Documents
42 (http://trustee.ietf.org/license-info).
43 The key words 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL', 'SHALL
44 NOT', 'SHOULD', 'SHOULD NOT', 'RECOMMENDED', 'MAY', and
45 'OPTIONAL' in the module text are to be interpreted as described
47 This version of this YANG module is part of RFC 8022;
48 see the RFC itself for full legal notices.";
54 "RFC 8022: A YANG Data Model for Routing Management";
59 feature multiple-ribs {
61 "This feature indicates that the server supports user-defined
63 Servers that do not advertise this feature SHOULD provide
64 exactly one system-controlled RIB per supported address family
65 and make it also the default RIB. This RIB then appears as an
66 entry of the list /routing-state/ribs/rib.";
71 "This feature indicates that the server supports configuration
72 of an explicit 32-bit router ID that is used by some routing
74 Servers that do not advertise this feature set a router ID
75 algorithmically, usually to one of the configured IPv4
76 addresses. However, this algorithm is implementation
82 identity address-family {
84 "Base identity from which identities describing address
85 families are derived.";
91 "This identity represents IPv4 address family.";
97 "This identity represents IPv6 address family.";
100 identity control-plane-protocol {
102 "Base identity from which control-plane protocol identities are
106 identity routing-protocol {
107 base control-plane-protocol;
109 "Identity from which Layer 3 routing protocol identities are
114 base routing-protocol;
116 "Routing pseudo-protocol that provides routes to directly
117 connected networks.";
121 base routing-protocol;
123 "Static routing pseudo-protocol.";
126 /* Type Definitions */
128 typedef route-preference {
131 "This type is used for route preferences.";
136 grouping address-family {
138 "This grouping provides a leaf identifying an address
140 leaf address-family {
152 "This grouping provides router ID.";
154 type yang:dotted-quad;
156 "A 32-bit number in the form of a dotted quad that is used by
157 some routing protocols identifying a router.";
159 "RFC 2328: OSPF Version 2.";
163 grouping special-next-hop {
165 "This grouping provides a leaf with an enumeration of special
167 leaf special-next-hop {
171 "Silently discard the packet.";
175 "Discard the packet and notify the sender with an error
176 message indicating that the destination host is
181 "Discard the packet and notify the sender with an error
182 message indicating that the communication is
183 administratively prohibited.";
187 "The packet will be received by the local system.";
191 "Options for special next hops.";
195 grouping next-hop-content {
197 "Generic parameters of next hops in static routes.";
198 choice next-hop-options {
201 "Options for next hops in static routes.
202 It is expected that further cases will be added through
203 augments from other modules.";
204 case simple-next-hop {
206 "This case represents a simple next hop consisting of the
207 next-hop address and/or outgoing interface.
208 Modules for address families MUST augment this case with a
209 leaf containing a next-hop address of that address
211 leaf outgoing-interface {
212 type if:interface-ref;
214 "Name of the outgoing interface.";
217 case special-next-hop {
218 uses special-next-hop;
221 container next-hop-list {
223 "Container for multiple next-hops.";
227 "An entry of a next-hop list.
228 Modules for address families MUST augment this list
229 with a leaf containing a next-hop address of that
234 "A user-specified identifier utilized to uniquely
235 reference the next-hop entry in the next-hop list.
236 The value of this index has no semantic meaning
237 other than for referencing the entry.";
239 leaf outgoing-interface {
240 type if:interface-ref;
242 "Name of the outgoing interface.";
250 grouping next-hop-state-content {
252 "Generic parameters of next hops in state data.";
253 choice next-hop-options {
256 "Options for next hops in state data.
257 It is expected that further cases will be added through
258 augments from other modules, e.g., for recursive
260 case simple-next-hop {
262 "This case represents a simple next hop consisting of the
263 next-hop address and/or outgoing interface.
264 Modules for address families MUST augment this case with a
265 leaf containing a next-hop address of that address
267 leaf outgoing-interface {
268 type if:interface-state-ref;
270 "Name of the outgoing interface.";
273 case special-next-hop {
274 uses special-next-hop;
277 container next-hop-list {
279 "Container for multiple next hops.";
282 "An entry of a next-hop list.
283 Modules for address families MUST augment this list
284 with a leaf containing a next-hop address of that
286 leaf outgoing-interface {
287 type if:interface-state-ref;
289 "Name of the outgoing interface.";
297 grouping route-metadata {
299 "Common route metadata.";
300 leaf source-protocol {
302 base routing-protocol;
306 "Type of the routing protocol from which the route
312 "Presence of this leaf indicates that the route is preferred
313 among all routes in the same RIB that have the same
314 destination prefix.";
317 type yang:date-and-time;
319 "Time stamp of the last modification of the route. If the
320 route was never modified, it is the time when the route was
321 inserted into the RIB.";
327 container routing-state {
330 "State data of the routing subsystem.";
334 It may be either configured or assigned algorithmically by
335 the implementation.";
337 container interfaces {
339 "Network-layer interfaces used for routing.";
340 leaf-list interface {
341 type if:interface-state-ref;
343 "Each entry is a reference to the name of a configured
344 network-layer interface.";
347 container control-plane-protocols {
349 "Container for the list of routing protocol instances.";
350 list control-plane-protocol {
353 "State data of a control-plane protocol instance.
354 An implementation MUST provide exactly one
355 system-controlled instance of the 'direct'
356 pseudo-protocol. Instances of other control-plane
357 protocols MAY be created by configuration.";
360 base control-plane-protocol;
363 "Type of the control-plane protocol.";
368 "The name of the control-plane protocol instance.
369 For system-controlled instances this name is persistent,
370 i.e., it SHOULD NOT change across reboots.";
376 "Container for RIBs.";
381 "Each entry represents a RIB identified by the 'name' key.
382 All routes in a RIB MUST belong to the same address
384 An implementation SHOULD provide one system-controlled
385 default RIB for each supported address family.";
389 "The name of the RIB.";
393 if-feature "multiple-ribs";
397 "This flag has the value of 'true' if and only if the RIB
398 is the default RIB for the given address family.
399 By default, control-plane protocols place their routes
400 in the default RIBs.";
404 "Current content of the RIB.";
407 "A RIB route entry. This data node MUST be augmented
408 with information specific for routes of each address
410 leaf route-preference {
411 type route-preference;
413 "This route attribute, also known as administrative
414 distance, allows for selecting the preferred route
415 among routes with the same destination prefix. A
416 smaller value means a more preferred route.";
420 "Route's next-hop attribute.";
421 uses next-hop-state-content;
426 action active-route {
428 "Return the active RIB route that is used for the
430 Address-family-specific modules MUST augment input
431 parameters with a leaf named 'destination-address'.";
435 "The active RIB route for the specified destination.
436 If no route exists in the RIB for the destination
437 address, no output is returned.
438 Address-family-specific modules MUST augment this
439 container with appropriate route contents.";
442 "Route's next-hop attribute.";
443 uses next-hop-state-content;
453 /* Configuration Data */
457 "Configuration parameters for the routing subsystem.";
459 if-feature "router-id";
461 "Configuration of the global router ID. Routing protocols
462 that use router ID can use this parameter or override it
463 with another value.";
465 container control-plane-protocols {
467 "Configuration of control-plane protocol instances.";
468 list control-plane-protocol {
471 "Each entry contains configuration of a control-plane
475 base control-plane-protocol;
478 "Type of the control-plane protocol - an identity derived
479 from the 'control-plane-protocol' base identity.";
484 "An arbitrary name of the control-plane protocol
490 "Textual description of the control-plane protocol
493 container static-routes {
494 when "derived-from-or-self(../type, 'rt:static')" {
496 "This container is only valid for the 'static' routing
500 "Configuration of the 'static' pseudo-protocol.
501 Address-family-specific modules augment this node with
502 their lists of routes.";
508 "Configuration of RIBs.";
512 "Each entry contains configuration for a RIB identified by
514 Entries having the same key as a system-controlled entry
515 of the list /routing-state/ribs/rib are used for
516 configuring parameters of that entry. Other entries
517 define additional user-controlled RIBs.";
521 "The name of the RIB.
522 For system-controlled entries, the value of this leaf
523 must be the same as the name of the corresponding entry
525 For user-controlled entries, an arbitrary name can be
528 uses address-family {
530 "Address family of the RIB.
531 It is mandatory for user-controlled RIBs. For
532 system-controlled RIBs it can be omitted; otherwise, it
533 must match the address family of the corresponding state
535 refine "address-family" {
542 "Textual description of the RIB.";