|
|
```
|
|
|
module irf-topology {
|
|
|
|
|
|
namespace "http://www.netide.eu/ns/irf-topology";
|
|
|
|
|
|
prefix "irt";
|
|
|
|
|
|
organization
|
|
|
"NetIDE Project.";
|
|
|
|
|
|
contact
|
|
|
"Project Web: <http://www.netide.eu>
|
|
|
|
|
|
Editor: Ladislav Lhotka <lhotka@nic.cz>";
|
|
|
|
|
|
description
|
|
|
"This module is a part of the Intermediate Representation Format
|
|
|
(IRF) data model. It contains YANG definitions for specifying
|
|
|
hierarchical network topology.
|
|
|
|
|
|
Copyright © 2013 NetIDE Project Consortium.
|
|
|
|
|
|
TBD: licence text";
|
|
|
|
|
|
revision 2014-01-31 {
|
|
|
description
|
|
|
"Initial revision.";
|
|
|
}
|
|
|
|
|
|
/* Identities */
|
|
|
|
|
|
identity node-type {
|
|
|
description
|
|
|
"Base identity form which specific node types are derived.";
|
|
|
}
|
|
|
|
|
|
identity host {
|
|
|
base node-type;
|
|
|
description
|
|
|
"This identity represents a host.";
|
|
|
}
|
|
|
|
|
|
identity router {
|
|
|
base node-type;
|
|
|
description
|
|
|
"This identity represents a router.";
|
|
|
}
|
|
|
|
|
|
identity switch {
|
|
|
base node-type;
|
|
|
description
|
|
|
"This identity represents a switch.";
|
|
|
}
|
|
|
|
|
|
identity network {
|
|
|
base node-type;
|
|
|
description
|
|
|
"This identity represents a node which contains a network.";
|
|
|
}
|
|
|
|
|
|
identity link-type {
|
|
|
description
|
|
|
"Base identity form which specific link types are derived.";
|
|
|
}
|
|
|
|
|
|
identity multi-access {
|
|
|
base link-type;
|
|
|
description
|
|
|
"This identity represents a multi-access link.";
|
|
|
}
|
|
|
|
|
|
identity point-to-point {
|
|
|
base link-type;
|
|
|
description
|
|
|
"This identity represents a point-to-point link.";
|
|
|
}
|
|
|
|
|
|
/* Typedefs */
|
|
|
|
|
|
typedef network-ref {
|
|
|
type leafref {
|
|
|
path "/irt:topology/irt:network/irt:name";
|
|
|
}
|
|
|
description
|
|
|
"This type is used for leafs that reference a network.";
|
|
|
}
|
|
|
|
|
|
/* Groupings */
|
|
|
|
|
|
grouping common-data {
|
|
|
description
|
|
|
"Leafs that are common for all objects (networks, nodes, links,
|
|
|
etc.).";
|
|
|
leaf name {
|
|
|
type string;
|
|
|
description
|
|
|
"Name of the object, also serves as a list key.";
|
|
|
}
|
|
|
leaf description {
|
|
|
type string;
|
|
|
description
|
|
|
"Textual description of the object.";
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/* Data */
|
|
|
|
|
|
container topology {
|
|
|
description
|
|
|
"Configuration of a hierarchical network topology.";
|
|
|
list network {
|
|
|
key "name";
|
|
|
description
|
|
|
"Configuration of a network.
|
|
|
|
|
|
Every network consists of a set of nodes and a set of
|
|
|
links.";
|
|
|
uses common-data;
|
|
|
list node {
|
|
|
key "name";
|
|
|
description
|
|
|
"Configuration of a node, which can be a single end system
|
|
|
(host, router, switch) or a network.";
|
|
|
uses common-data;
|
|
|
leaf type {
|
|
|
mandatory "true";
|
|
|
type identityref {
|
|
|
base node-type;
|
|
|
}
|
|
|
description
|
|
|
"Type of the node.";
|
|
|
}
|
|
|
container configuration {
|
|
|
description
|
|
|
"Link to a config file for the node.
|
|
|
|
|
|
This option is only available for end system nodes, not
|
|
|
for networks.";
|
|
|
when "../type='irt:host' or ../type='irt:router' or "
|
|
|
+ "../type='irt:switch'";
|
|
|
leaf url {
|
|
|
type string;
|
|
|
description
|
|
|
"Locator of the config file.";
|
|
|
}
|
|
|
leaf format {
|
|
|
type enumeration {
|
|
|
enum XML;
|
|
|
enum JSON;
|
|
|
}
|
|
|
default "XML";
|
|
|
description
|
|
|
"Format of the config file.";
|
|
|
}
|
|
|
}
|
|
|
leaf network-name {
|
|
|
when "../type='irt:network'";
|
|
|
type network-ref;
|
|
|
description
|
|
|
"Reference to a network that is contained in the ancestor
|
|
|
node.
|
|
|
|
|
|
This option is only valid for nodes of the network
|
|
|
type.";
|
|
|
}
|
|
|
list interface {
|
|
|
key "name";
|
|
|
min-elements "1";
|
|
|
description
|
|
|
"Every node has one or more interfaces.";
|
|
|
uses common-data;
|
|
|
container bind-to {
|
|
|
presence "Bind to an interface from the contained network.";
|
|
|
description
|
|
|
"An interface of a network-type node may be identified
|
|
|
with an interface of a node in the contained network.
|
|
|
|
|
|
This is the glue that joins adjacent layers in the
|
|
|
topology hierarchy.";
|
|
|
when "../../type='irt:network'";
|
|
|
leaf node {
|
|
|
mandatory "true";
|
|
|
type leafref {
|
|
|
path "/topology/network[name=current()/../../../"
|
|
|
+ "network-name]/node/name";
|
|
|
}
|
|
|
description
|
|
|
"Reference to a node in the contained network.";
|
|
|
}
|
|
|
leaf interface {
|
|
|
type leafref {
|
|
|
path "/topology/network[name=current()/../../../"
|
|
|
+ "network-name]/node[name=current()/../node]/"
|
|
|
+ "interface/name";
|
|
|
}
|
|
|
description
|
|
|
"Reference to an interface belonging to the node
|
|
|
specified in the sibling leaf.";
|
|
|
}
|
|
|
}
|
|
|
leaf connection {
|
|
|
type leafref {
|
|
|
path "../../../link/name";
|
|
|
}
|
|
|
description
|
|
|
"The link within the same network to which the
|
|
|
interface is connected.
|
|
|
|
|
|
If this leaf is not present, the interface is
|
|
|
considered unconnected in the current network. I may
|
|
|
be connected via an interface from an upper network
|
|
|
layer that is bound to the present interface.";
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
list link {
|
|
|
key "name";
|
|
|
description
|
|
|
"Each network has zero or more links.";
|
|
|
uses common-data;
|
|
|
leaf type {
|
|
|
mandatory "true";
|
|
|
type identityref {
|
|
|
base link-type;
|
|
|
}
|
|
|
description
|
|
|
"Type of the link.";
|
|
|
}
|
|
|
list connection {
|
|
|
description
|
|
|
"List of nodes/interfaces that are connected to the link.
|
|
|
|
|
|
This is operational state data – the connections are
|
|
|
configured in the configuration of interfaces.";
|
|
|
config "false";
|
|
|
leaf node {
|
|
|
mandatory "true";
|
|
|
type leafref {
|
|
|
path "../../../node/name";
|
|
|
}
|
|
|
description
|
|
|
"The connected node.";
|
|
|
}
|
|
|
leaf interface {
|
|
|
type leafref {
|
|
|
path "../../../node[name=current()/../node]/interface/"
|
|
|
+ "name";
|
|
|
}
|
|
|
description
|
|
|
"The connected interface.";
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
``` |