3 namespace "urn:ietf:params:xml:ns:yang:ietf-routing";
7 import ietf-yang-types {
11 import ietf-interfaces {
16 "IETF NETMOD (NETCONF Data Modeling Language) Working Group";
19 "WG Web: <http://tools.ietf.org/wg/netmod/>
20 WG List: <mailto:netmod@ietf.org>
22 WG Chair: Thomas Nadeau
23 <mailto:tnadeau@lucidvision.com>
25 WG Chair: Juergen Schoenwaelder
26 <mailto:j.schoenwaelder@jacobs-university.de>
28 Editor: Ladislav Lhotka
29 <mailto:lhotka@nic.cz>";
32 "This YANG module defines essential components for the management
33 of a routing subsystem.
35 Copyright (c) 2014 IETF Trust and the persons identified as
36 authors of the code. All rights reserved.
38 Redistribution and use in source and binary forms, with or
39 without modification, is permitted pursuant to, and subject to
40 the license terms contained in, the Simplified BSD License set
41 forth in Section 4.c of the IETF Trust's Legal Provisions
42 Relating to IETF Documents
43 (http://trustee.ietf.org/license-info).
45 This version of this YANG module is part of RFC XXXX; see the
46 RFC itself for full legal notices.";
52 "RFC XXXX: A YANG Data Model for Routing Management";
57 feature multiple-ribs {
59 "This feature indicates that the device supports multiple RIBS
60 per address family, and the framework for passing routes
63 Devices that do not support this feature MUST provide exactly
64 one system-controlled RIB per supported address family. These
65 RIBs then appear as entries of the list
66 /routing-state/ribs/rib.";
69 feature multipath-routes {
71 "This feature indicates that the device supports multipath
72 routes that have a list of next-hops.";
77 identity address-family {
79 "Base identity from which identities describing address
80 families are derived.";
86 "This identity represents IPv4 address family.";
92 "This identity represents IPv6 address family.";
95 identity routing-instance-type {
97 "Base identity from which identities describing routing
98 instance types are derived.
100 It is primarily intended for discriminating among different
101 types of logical routers or router virtualization.";
104 identity standard-routing-instance {
105 base routing-instance-type;
107 "This identity represents a default routing instance.";
110 identity routing-protocol {
112 "Base identity from which routing protocol identities are
117 base routing-protocol;
119 "Routing pseudo-protocol which provides routes to directly
120 connected networks.";
124 base routing-protocol;
126 "Static routing pseudo-protocol.";
129 identity route-filter {
131 "Base identity from which all route filters are derived.";
134 identity deny-all-route-filter {
137 "Route filter that blocks all routes.";
140 identity allow-all-route-filter {
143 "Route filter that permits all routes.";
146 /* Type Definitions */
148 typedef routing-instance-ref {
150 path "/rt:routing/rt:routing-instance/rt:name";
153 "This type is used for leafs that reference a routing instance
157 typedef routing-instance-state-ref {
159 path "/rt:routing-state/rt:routing-instance/rt:name";
162 "This type is used for leafs that reference state data of a
168 path "/rt:routing/rt:ribs/rt:rib/rt:name";
171 "This type is used for leafs that reference a RIB
175 typedef rib-state-ref {
177 path "/rt:routing-state/rt:ribs/rt:rib/rt:name";
180 "This type is used for leafs that reference a RIB in state
184 typedef route-filter-ref {
186 path "/rt:routing/rt:route-filters/rt:route-filter/rt:name";
189 "This type is used for leafs that reference a route filter
193 typedef route-filter-state-ref {
195 path "/rt:routing-state/rt:route-filters/rt:route-filter/"
199 "This type is used for leafs that reference a route filter in
205 grouping address-family-grouping {
207 "This grouping provides a leaf identifying an address
209 leaf address-family {
219 grouping state-entry-id {
221 "This grouping defines a unique identifier for entries in
222 several operational state lists.";
226 "Unique numerical identifier of a list entry in operational
227 state. It may be used by protocols or tools that inspect
228 and/or manipulate operational state data and prefer
229 fixed-size integers as list entry handles.
231 These identifiers are always ephemeral, i.e., they may
232 change after a reboot.";
238 "This grouping provides the definition of router ID.";
240 type yang:dotted-quad;
242 "Router ID - 32-bit number in the form of a dotted quad. Some
243 protocols use this parameter for identifying a router to its
248 grouping outgoing-interface {
250 "This grouping defines the outgoing interface for use in
252 leaf outgoing-interface {
254 path "/rt:routing-state/rt:routing-instance/rt:interfaces/"
255 + "rt:interface/rt:name";
258 "Name of the outgoing interface.";
262 // WARNING - renamed due to yang sources generation problem(having same name for grouping and it's leaf ends up in error against Java Language Specification)
263 grouping special-next-hop-grouping {
265 "This grouping provides the leaf for specifying special
267 leaf special-next-hop {
271 "Silently discard the packet.";
275 "Discard the packet and notify the sender with an error
276 message indicating that the destination host is
281 "Discard the packet and notify the sender with an error
282 message indicating that the communication is
283 administratively prohibited.";
287 "The packet will be received by the local network
292 "Special next-hop options.";
296 grouping next-hop-classifiers {
298 "This grouping provides two next-hop classifiers.";
313 "Simple priority for distinguishing between primary and
316 Backup next-hops are used if and only if no primary
317 next-hops are reachable.";
321 must ". = 0 or not(../../next-hop/weight = 0)" {
322 error-message "Illegal combination of zero and non-zero "
323 + "next-hop weights.";
325 "Next-hop weights must be either all zero (equal
326 load-balancing) or all non-zero.";
329 "This parameter specifies the weight of the next-hop for load
330 balancing. The number specifies the relative fraction of the
331 traffic that will use the corresponding next-hop.
333 A value of 0 represents equal load-balancing.
335 If both primary and backup next-hops are present, then the
336 weights for each priority level are used separately.";
340 grouping next-hop-content {
342 "Generic parameters of next-hops in routes.";
343 choice next-hop-options {
346 "Options for expressing the next-hop in routes.";
347 case special-next-hop {
348 uses special-next-hop-grouping;
350 case simple-next-hop {
351 uses outgoing-interface;
354 if-feature multipath-routes;
355 container next-hop-list {
357 "Container for multiple next-hops.";
361 "An entry of a next-hop list.";
363 uses outgoing-interface;
364 uses next-hop-classifiers;
371 grouping route-metadata {
374 leaf source-protocol {
376 base routing-protocol;
380 "Type of the routing protocol from which the route
384 type yang:date-and-time;
386 "Time stamp of the last modification of the route. If the
387 route was never modified, it is the time when the route was
388 inserted into the RIB.";
392 /* Operational state data */
394 container routing-state {
397 "Operational state of the routing subsystem.";
398 list routing-instance {
402 "Each list entry is a container for operational state data of
405 An implementation MAY create one or more system-controlled
406 instances, other user-controlled instances MAY be created by
411 "The name of the routing instance.
413 For system-controlled instances the name is persistent,
414 i.e., it SHOULD NOT change across reboots.";
416 uses state-entry-id {
423 base routing-instance-type;
426 "The routing instance type, primarily intended for
427 discriminating among different types of logical routers,
428 route virtualization, master-slave arrangements etc.,
429 while keeping all routing instances in the same flat
436 An implementation may choose a value if none is
439 Routing protocols that use router ID MAY override this
442 container default-ribs {
444 "Default RIBs used by the routing instance.";
446 key "address-family";
448 "Each list entry specifies the default RIB for one
451 The default RIB is operationally connected to all
452 routing protocols for which a connected RIB has not been
453 explicitly configured.
455 The 'direct' pseudo-protocol is always connected to the
457 uses address-family-grouping;
462 "Name of an existing RIB to be used as the default RIB
463 for the given routing instance and address family.";
467 container interfaces {
469 "Network layer interfaces belonging to the routing
474 "List of network layer interfaces assigned to the routing
477 type if:interface-state-ref;
479 "A reference to the name of a configured network layer
484 container routing-protocols {
486 "Container for the list of routing protocol instances.";
487 list routing-protocol {
490 "Operational state of a routing protocol instance.
492 An implementation MUST provide exactly one
493 system-controlled instance of the type 'direct'. Other
494 instances MAY be created by configuration.";
498 "The name of the routing protocol instance.
500 For system-controlled instances this name is
501 persistent, i.e., it SHOULD NOT change across
506 base routing-protocol;
510 "Type of the routing protocol.";
512 container connected-ribs {
514 "Container for connected RIBs.";
518 "List of RIBs to which the routing protocol instance
519 is connected (at most one RIB per address
524 "Name of an existing RIB.";
527 type route-filter-state-ref;
529 "Reference to a route filter that is used for
530 filtering routes passed from this routing protocol
531 instance to the RIB specified by the 'rib-name'
534 If this leaf is not present, the behavior is
535 protocol-specific, but typically it means that all
536 routes are accepted.";
539 type route-filter-state-ref;
541 "Reference to a route filter that is used for
542 filtering routes passed from the RIB specified by
543 the 'rib-name' sibling node to this routing
546 If this leaf is not present, the behavior is
547 protocol-specific - typically it means that all
550 The 'direct' and 'static' pseudo-protocols accept
551 no routes from any RIB.";
556 //NOTE -added to allow operational state for static-routes
557 container static-routes {
558 when "../type='rt:static'" {
560 "This container is only valid for the 'static'
564 "Configuration of the 'static' pseudo-protocol.
566 Address family specific modules augment this node with
567 their lists of routes.";
574 "Container for RIBs.";
579 "Each entry represents a RIB identified by the 'name' key.
580 All routes in a RIB MUST belong to the same address
583 The server MUST provide a system-controlled default RIB
584 for each address family, and MAY provide other
585 system-controlled RIBs. Additional RIBs MAY be created in
590 "The name of the RIB.";
592 uses state-entry-id {
597 uses address-family-grouping;
600 "Current contents of the RIB.";
604 "A RIB route entry. This data node MUST be augmented
605 with information specific for routes of each address
608 uses next-hop-content;
612 container recipient-ribs {
613 if-feature multiple-ribs;
615 "Container for recipient RIBs.";
619 "List of RIBs that receive routes from this RIB.";
623 "The name of the recipient RIB.";
626 type route-filter-state-ref;
628 "A route filter which is applied to the routes passed
629 to the recipient RIB.";
635 container route-filters {
637 "Container for route filters.";
641 "Route filters are used for filtering and/or manipulating
642 routes that are passed between a routing protocol and a
643 RIB and vice versa, or between two RIBs.
645 It is expected that other modules augment this list with
646 contents specific for a particular route filter type.";
650 "The name of the route filter.";
658 "Type of the route-filter - an identity derived from the
659 'route-filter' base identity.";
665 /* Configuration Data */
669 "Configuration parameters for the routing subsystem.";
670 list routing-instance {
673 "Configuration of a routing instance.";
677 "The name of the routing instance.
679 For system-controlled entries, the value of this leaf must
680 be the same as the name of the corresponding entry in
683 For user-controlled entries, an arbitrary name can be
688 base routing-instance-type;
690 default "rt:standard-routing-instance";
692 "The type of the routing instance.";
698 "Enable/disable the routing instance.
700 If this parameter is false, the parent routing instance is
701 disabled and does not appear in operational state data,
702 despite any other configuration that might be present.";
706 "Configuration of the global router ID.";
711 "Textual description of the routing instance.";
713 container default-ribs {
714 if-feature multiple-ribs;
716 "Configuration of the default RIBs used by the routing
719 The default RIB for an addressed family if by default
720 connected to all routing protocol instances supporting
721 that address family, and always receives direct routes.";
723 must "address-family=/routing/ribs/rib[name=current()/"
724 + "rib-name]/address-family" {
725 error-message "Address family mismatch.";
727 "The entry's address family MUST match that of the
730 key "address-family";
732 "Each list entry configures the default RIB for one
734 uses address-family-grouping;
739 "Name of an existing RIB to be used as the default RIB
740 for the given routing instance and address family.";
744 container interfaces {
746 "Configuration of the routing instance's interfaces.";
750 "List of network layer interfaces assigned to the routing
753 type if:interface-ref;
755 "A reference to the name of a configured network layer
760 container routing-protocols {
762 "Configuration of routing protocol instances.";
763 list routing-protocol {
766 "Each entry contains configuration of a routing protocol
771 "An arbitrary name of the routing protocol instance.";
776 "Textual description of the routing protocol
783 "Enable/disable the routing protocol instance.
785 If this parameter is false, the parent routing
786 protocol instance is disabled and does not appear in
787 operational state data, despite any other
788 configuration that might be present.";
792 base routing-protocol;
796 "Type of the routing protocol - an identity derived
797 from the 'routing-protocol' base identity.";
799 container connected-ribs {
801 "Configuration of connected RIBs.";
803 must "not(/routing/ribs/rib[name=current()/"
804 + "preceding-sibling::connected-rib/"
805 + "rib-name and address-family=/routing/ribs/"
806 + "rib[name=current()/rib-name]/address-family])" {
808 "Duplicate address family for connected RIBs.";
810 "For each address family, there MUST NOT be more
811 than one connected RIB.";
815 "List of RIBs to which the routing protocol instance
816 is connected (at most one RIB per address family).
818 If no connected RIB is configured for an address
819 family, the routing protocol is connected to the
820 default RIB for that address family.";
823 must "../../../type != 'rt:direct' or "
824 + "../../../../../default-ribs/ "
825 + "default-rib/rib-name=." {
826 error-message "The 'direct' protocol can be "
827 + "connected only to a default RIB.";
829 "For the 'direct' pseudo-protocol, the connected
830 RIB must always be a default RIB.";
833 "Name of an existing RIB.";
836 type route-filter-ref;
838 "Configuration of import filter.";
841 type route-filter-ref;
843 "Configuration of export filter.";
847 container static-routes {
848 when "../type='rt:static'" {
850 "This container is only valid for the 'static'
854 "Configuration of the 'static' pseudo-protocol.
856 Address family specific modules augment this node with
857 their lists of routes.";
868 "Each entry represents a configured RIB identified by the
871 Entries having the same key as a system-controlled entry
872 of the list /routing-state/ribs/rib are used for
873 configuring parameters of that entry. Other entries define
874 additional user-controlled RIBs.";
878 "The name of the RIB.
880 For system-controlled entries, the value of this leaf
881 must be the same as the name of the corresponding entry
884 For user-controlled entries, an arbitrary name can be
887 uses address-family-grouping;
891 "Textual description of the RIB.";
893 container recipient-ribs {
894 if-feature multiple-ribs;
896 "Configuration of recipient RIBs.";
898 must "rib-name != ../../name" {
900 "Source and recipient RIBs are identical.";
902 "A RIB MUST NOT appear among its recipient RIBs.";
904 must "/routing/ribs/rib[name=current()/rib-name]/"
905 + "address-family=../../address-family" {
906 error-message "Address family mismatch.";
908 "Address family of the recipient RIB MUST match that
913 "Each entry configures a recipient RIB.";
917 "The name of the recipient RIB.";
920 type route-filter-ref;
922 "A route filter which is applied to the routes passed
923 to the recipient RIB.";
929 container route-filters {
931 "Configuration of route filters.";
935 "Each entry configures a named route filter.";
939 "The name of the route filter.";
944 "Textual description of the route filter.";
952 "Type of the route filter..";
962 "Return the active route that a routing-instance uses for
963 sending packets to a destination address.";
965 leaf routing-instance-name {
966 type routing-instance-state-ref;
969 "Name of the routing instance whose forwarding information
970 base is being queried.
972 If the routing instance with name equal to the value of
973 this parameter doesn't exist, then this operation SHALL
974 fail with error-tag 'data-missing' and error-app-tag
975 'routing-instance-not-found'.";
977 container destination-address {
979 "Network layer destination address.
981 Address family specific modules MUST augment this
982 container with a leaf named 'address'.";
983 uses address-family-grouping;
989 "The active route for the specified destination.
991 If the routing instance has no active route for the
992 destination address, no output is returned - the server
993 SHALL send an <rpc-reply> containing a single element
996 Address family specific modules MUST augment this list
997 with appropriate route contents.";
998 uses address-family-grouping;
999 uses next-hop-content;
1000 uses route-metadata;
1007 "Return the current number of routes in a RIB.";
1015 If the RIB with name equal to the value of this parameter
1016 doesn't exist, then this operation SHALL fail with
1017 error-tag 'data-missing' and error-app-tag
1022 leaf number-of-routes {
1026 "Number of routes in the RIB.";