module ietf-routing {
namespace "urn:ietf:params:xml:ns:yang:ietf-routing";
prefix "rt";
import ietf-yang-types {
prefix "yang";
}
import ietf-interfaces {
prefix "if";
}
import iana-afn-safi {
prefix "ianaaf";
}
organization
"IETF NETMOD (NETCONF Data Modeling Language) Working Group";
contact
"WG Web:
WG List:
WG Chair: David Kessens
WG Chair: Juergen Schoenwaelder
Editor: Ladislav Lhotka
";
description
"This YANG module defines essential components for the management
of a routing subsystem.
Copyright (c) 2013 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 RFC XXXX; see the
RFC itself for full legal notices.
";
revision 2013-07-13 {
description
"Initial revision.";
reference
"RFC XXXX: A YANG Data Model for Routing Management";
}
/* Features */
feature user-defined-routing-tables {
description
"Indicates that the device supports additional routing tables
defined by the user.
Devices that do not support this feature MUST provide exactly
one routing table per supported address family. These routing
tables then appear as entries of the list
/routing-state/routing-tables/routing-table.
";
}
/* Identities */
identity router-type {
description
"Base identity from which router type identities are derived.
It is primarily intended for discriminating among different
types of logical routers or router virtualization.
";
}
identity standard-router {
base router-type;
description
"This identity represents a standard router.";
}
identity routing-protocol {
description
"Base identity from which routing protocol identities are
derived.";
}
identity direct {
base routing-protocol;
description
"Routing pseudo-protocol which provides routes to directly
connected networks.";
}
identity static {
base routing-protocol;
description
"Static routing pseudo-protocol.";
}
identity route-filter {
description
"Base identity from which all route filters are derived.";
}
identity deny-all-route-filter {
base route-filter;
description
"Route filter that blocks all routes.";
}
identity allow-all-route-filter {
base route-filter;
description
"Route filter that permits all routes.";
}
/* Type Definitions */
typedef router-ref {
type leafref {
path "/rt:routing/rt:router/rt:name";
}
description
"This type is used for leafs that reference a router instance
configuration.";
}
typedef router-state-ref {
type leafref {
path "/rt:routing-state/rt:router/rt:name";
}
description
"This type is used for leafs that reference state data of a
router instance.";
}
typedef routing-table-ref {
type leafref {
path "/rt:routing/rt:routing-tables/rt:routing-table/rt:name";
}
description
"This type is used for leafs that reference a routing table
configuration.";
}
typedef routing-table-state-ref {
type leafref {
path "/rt:routing-state/rt:routing-tables/rt:routing-table/"
+ "rt:name";
}
description
"This type is used for leafs that reference a routing table in
state data.";
}
typedef route-filter-ref {
type leafref {
path "/rt:routing/rt:route-filters/rt:route-filter/rt:name";
}
description
"This type is used for leafs that reference a route filter
configuration.";
}
typedef route-filter-state-ref {
type leafref {
path "/rt:routing-state/rt:route-filters/rt:route-filter/"
+ "rt:name";
}
description
"This type is used for leafs that reference a route filter in
state data.";
}
/* Groupings */
grouping afn-safi {
description
"This grouping provides two parameters specifying address
family and subsequent address family.";
leaf address-family {
type ianaaf:address-family;
mandatory "true";
description
"Address family.";
}
leaf safi {
type ianaaf:subsequent-address-family;
mandatory "true";
description
"Subsequent address family.";
}
}
grouping router-id {
description
"This grouping provides the definition of router ID.";
leaf router-id {
type yang:dotted-quad;
description
"Router ID - 32-bit number in the form of a dotted quad.";
}
}
grouping route-content {
description
"Generic parameters of static routes (configuration).";
leaf outgoing-interface {
type if:interface-ref;
description
"Outgoing interface.";
}
}
grouping route-state-content {
description
"Generic parameters of routes in state data.";
leaf outgoing-interface {
type if:interface-state-ref;
description
"Outgoing interface.";
}
}
/* RPC Methods */
rpc active-route {
description
"Return the active route (or multiple routes, in the case of
multi-path routing) to a destination address.
Parameters
1. 'router-name',
2. 'destination-address'.
If the router instance with 'router-name' doesn't exist, then
this operation SHALL fail with error-tag 'data-missing' and
error-app-tag 'router-not-found'.
If no active route for 'destination-address' exists, no output
is returned - the server SHALL send an containing
a single element .
";
input {
leaf router-name {
type router-state-ref;
mandatory "true";
description
"Name of the router instance whose forwarding information
base is being queried.";
}
container destination-address {
description
"Network layer destination address.
Address family specific modules MUST augment this
container with a leaf named 'address'.
";
uses afn-safi;
}
}
output {
list route {
description
"List of active routes.
Route contents specific for each address family is
expected be defined through augmenting.
";
uses afn-safi;
uses route-content;
}
}
}
rpc route-count {
description
"Return the current number of routes in a routing table.
Parameters:
1. 'routing-table-name'.
If the routing table with the name specified in
'routing-table-name' doesn't exist, then this operation SHALL
fail with error-tag 'data-missing' and error-app-tag
'routing-table-not-found'.
";
input {
leaf routing-table {
type routing-table-state-ref;
mandatory "true";
description
"Name of the routing table.";
}
}
output {
leaf number-of-routes {
type uint32;
mandatory "true";
description
"Number of routes in the routing table.";
}
}
}
/* Operational state data */
container routing-state {
config "false";
description
"Operational state of the routing subsystem.";
list router {
key "name";
description
"Each list entry is a container for operational state data of
a router instance.
An implementation MAY create one or more instances on its
own, other instances MAY be created by configuration.
";
leaf name {
type string;
description
"The name of the router instance.";
}
leaf type {
type identityref {
base router-type;
}
default "rt:standard-router";
description
"The router type, primarily intended for discriminating
among different types of logical routers, route
virtualization, master-slave arrangements etc., while
keeping all router instances in the same flat list.
";
}
uses router-id {
description
"Global router ID.
An implementation may choose a value if none is
configured.
Routing protocols MAY override this global parameter.
";
}
container default-routing-tables {
description
"Default routing tables used by the router instance.";
list default-routing-table {
key "address-family safi";
description
"Each list entry specifies the default routing table for
one address family.
The default routing table is operationally connected to
all routing protocols for which a connected routing
table has not been explicitly configured.
The 'direct' pseudo-protocol is always connected to the
default routing tables.
";
uses afn-safi;
leaf name {
type routing-table-state-ref;
mandatory "true";
description
"Name of an existing routing table to be used as the
default routing table for the given router instance
and address family.";
}
}
}
container interfaces {
description
"Router interfaces.";
list interface {
key "name";
description
"List of network layer interfaces assigned to the router
instance.";
leaf name {
type if:interface-state-ref;
description
"A reference to the name of a configured network layer
interface.";
}
}
}
container routing-protocols {
description
"Container for the list of routing protocol instances.";
list routing-protocol {
key "name";
description
"Operational state of a routing protocol instance.
";
leaf name {
type string;
description
"The name of the routing protocol instance.";
}
leaf type {
type identityref {
base routing-protocol;
}
mandatory "true";
description
"Type of the routing protocol.";
}
container connected-routing-tables {
if-feature user-defined-routing-tables;
description
"Container for connected routing tables.
";
list connected-routing-table {
key "name";
description
"List of routing tables to which the routing protocol
instance is connected (at most one routing table per
address family).
";
leaf name {
type routing-table-state-ref;
description
"Name of an existing routing table.";
}
leaf import-filter {
type route-filter-state-ref;
description
"Reference to a route filter that is used for
filtering routes passed from this routing protocol
instance to the routing table specified by the
'name' sibling node.
If this leaf is not present, the behavior is
protocol-specific, but typically it means that all
routes are accepted.
";
}
leaf export-filter {
type route-filter-state-ref;
description
"Reference to a route filter that is used for
filtering routes passed from the routing table
specified by the 'name' sibling node to this
routing protocol instance.
If this leaf is not present, the behavior is
protocol-specific - typically it means that all
routes are accepted.
The 'direct' and 'static' pseudo-protocols accept
no routes from any routing table.
";
}
}
}
}
}
}
container routing-tables {
description
"Container for routing tables.";
list routing-table {
key "name";
description
"Each entry represents a routing table identified by the
'name' key. All routes in a routing table MUST belong to
the same address family.
The server MUST create the default routing table for each
address family, and MAY create other routing tables.
Additional routing tables MAY be created in the
configuration.
";
leaf name {
type string;
description
"The name of the routing table.";
}
uses afn-safi;
container routes {
description
"Current contents of the routing table.";
list route {
description
"A routing table entry. This data node MUST be
augmented with information specific for routes of each
address family.";
uses route-state-content;
leaf source-protocol {
type identityref {
base routing-protocol;
}
mandatory "true";
description
"Type of the routing protocol from which the route
originated.";
}
leaf last-updated {
type yang:date-and-time;
description
"Time stamp of the last modification of the route. If
the route was never modified, it is the time when
the route was inserted into the routing table.";
}
}
}
container recipient-routing-tables {
if-feature user-defined-routing-tables;
description
"Container for recipient routing tables.";
list recipient-routing-table {
key "name";
description
"List of routing tables that receive routes from this
routing table.";
leaf name {
type routing-table-state-ref;
description
"The name of the recipient routing table.";
}
leaf filter {
type route-filter-state-ref;
description
"A route filter which is applied to the routes passed
to the recipient routing table.";
}
}
}
}
}
container route-filters {
description
"Container for route filters.";
list route-filter {
key "name";
description
"Route filters are used for filtering and/or manipulating
routes that are passed between a routing protocol and a
routing table and vice versa, or between two routing
tables.
It is expected that other modules augment this list with
contents specific for a particular route filter type.
";
leaf name {
type string;
description
"The name of the route filter.";
}
leaf type {
type identityref {
base route-filter;
}
mandatory "true";
description
"Type of the route-filter - an identity derived from the
'route-filter' base identity.";
}
}
}
}
/* Configuration Data */
container routing {
description
"Configuration parameters for the routing subsystem.";
list router {
key "name";
description
"Configuration of a router instance.
";
leaf name {
type string;
description
"The name of the router instance.
The names for system-created router instances are assigned
by the system. The same name then has to be used in the
configuration.
An arbitrary name may be chosen if the router instance is
created in the configuration.
";
}
leaf type {
type identityref {
base router-type;
}
default "rt:standard-router";
description
"The router type.";
}
leaf enabled {
type boolean;
default "true";
description
"Enable/disable the router instance.
If this parameter is false, the parent router instance is
disabled and does not appear in operational state data,
despite any other configuration that might be present.
";
}
uses router-id {
description
"Configuration of the global router ID.";
}
leaf description {
type string;
description
"Textual description of the router instance.";
}
container default-routing-tables {
if-feature user-defined-routing-tables;
description
"Configuration of the default routing tables used by the
router instance.
The default routing table for an addressed family if by
default connected to all routing protocol instances
supporting that address family, and always receives direct
routes.
";
list default-routing-table {
must "address-family=/routing/routing-tables/"
+ "routing-table[name=current()/name]/"
+ "address-family and safi=/routing/routing-tables/"
+ "routing-table[name=current()/name]/safi" {
error-message "Address family mismatch.";
description
"The entry's address family MUST match that of the
referenced routing table.";
}
key "address-family safi";
description
"Each list entry configures the default routing table for
one address family.";
uses afn-safi;
leaf name {
type string;
mandatory "true";
description
"Name of an existing routing table to be used as the
default routing table for the given router instance
and address family.";
}
}
}
container interfaces {
description
"Configuration of router interface parameters.";
list interface {
key "name";
description
"List of network layer interfaces assigned to the router
instance.";
leaf name {
type if:interface-ref;
description
"A reference to the name of a configured network layer
interface.";
}
}
}
container routing-protocols {
description
"Configuration of routing protocol instances.";
list routing-protocol {
key "name";
description
"Each entry contains configuration of a routing protocol
instance.";
leaf name {
type string;
description
"An arbitrary name of the routing protocol instance.";
}
leaf description {
type string;
description
"Textual description of the routing protocol
instance.";
}
leaf enabled {
type boolean;
default "true";
description
"Enable/disable the routing protocol instance.
If this parameter is false, the parent routing
protocol instance is disabled and does not appear in
operational state data, despite any other
configuration that might be present.
";
}
leaf type {
type identityref {
base routing-protocol;
}
mandatory "true";
description
"Type of the routing protocol - an identity derived
from the 'routing-protocol' base identity.";
}
container connected-routing-tables {
if-feature user-defined-routing-tables;
description
"Configuration of connected routing tables.
";
list connected-routing-table {
must "not(/routing/routing-tables/"
+ "routing-table[name=current()/"
+ "preceding-sibling::connected-routing-table/"
+ "name and address-family=/routing/routing-tables/"
+ "routing-table[name=current()/name]/"
+ "address-family and safi=/routing/routing-tables/"
+ "routing-table[name=current()/name]/safi])" {
error-message "Duplicate address family for "
+ "connected routing tables.";
description
"For each AFN/SAFI pair there MUST NOT be more than
one connected routing table.";
}
key "name";
description
"List of routing tables to which the routing protocol
instance is connected (at most one routing table per
address family).
If no connected routing table is configured for an
address family, the routing protocol is connected to
the default routing table for that address family.
";
leaf name {
type routing-table-ref;
must "../../../type != 'rt:direct' or "
+ "../../../../../default-routing-tables/ "
+ "default-routing-table/name=." {
error-message "The 'direct' protocol can be "
+ "connected only to a default "
+ "routing table.";
description
"For the 'direct' pseudo-protocol, the connected
routing table must always be a default routing
table.";
}
description
"Name of an existing routing table.";
}
leaf import-filter {
type route-filter-ref;
description
"Configuration of import filter.";
}
leaf export-filter {
type route-filter-ref;
description
"Configuration of export filter.";
}
}
}
container static-routes {
when "../type='rt:static'" {
description
"This container is only valid for the 'static'
routing protocol.";
}
description
"Configuration of the 'static' pseudo-protocol.
Address family specific modules augment this node with
their lists of routes.
";
}
}
}
}
container routing-tables {
description
"Configured routing tables.";
list routing-table {
key "name";
description
"Each entry represents a configured routing table
identified by the 'name' key.
Entries having the same key as a system-provided entry of
the list /routing-state/routing-tables/routing-tables are
used for configuring parameters of that entry. Other
entries define additional user-provided routing tables.
";
leaf name {
type string;
description
"The name of the routing table.";
}
uses afn-safi;
leaf description {
type string;
description
"Textual description of the routing table.";
}
container recipient-routing-tables {
if-feature user-defined-routing-tables;
description
"Configuration of recipient routing tables.";
list recipient-routing-table {
must "name != ../../name" {
error-message "Source and recipient routing tables "
+ "are identical.";
description
"A routing table MUST NOT appear among its recipient
routing tables.";
}
must "/routing/routing-tables/"
+ "routing-table[name=current()/name]/"
+ "address-family=../../address-family and /routing/"
+ "routing-tables/routing-table[name=current()/name]/"
+ "safi=../../safi" {
error-message "Address family mismatch.";
description
"Address family of the recipient routing table MUST
match the source table.";
}
key "name";
description
"Each entry configures a recipient routing table.";
leaf name {
type routing-table-ref;
description
"The name of the recipient routing table.";
}
leaf filter {
type route-filter-ref;
description
"A route filter which is applied to the routes passed
to the recipient routing table.";
}
}
}
}
}
container route-filters {
description
"Configuration of route filters.";
list route-filter {
key "name";
description
"Each entry configures a named route filter.";
leaf name {
type string;
description
"The name of the route filter.";
}
leaf description {
type string;
description
"Textual description of the route filter.";
}
leaf type {
type identityref {
base route-filter;
}
mandatory "true";
description
"Type of the route filter..";
}
}
}
}
}