4 * Copyright 2016 RIFT.IO Inc
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
21 module odl-network-topology {
23 namespace "urn:TBD:params:xml:ns:yang:network-topology";
24 // replace with IANA namespace when assigned
27 import ietf-inet-types { prefix "inet"; }
31 contact "WILL-BE-DEFINED-LATER";
34 "This module defines a model for the topology of a network.
35 Key design decisions are as follows:
36 A topology consists of a set of nodes and links.
37 Links are point-to-point and unidirectional.
38 Bidirectional connections need to be represented through
40 Multipoint connections, broadcast domains etc can be represented
41 through a hierarchy of nodes, then connecting nodes at
42 upper layers of the hierarchy.";
52 "An identifier for a topology.";
58 "An identifier for a node in a topology.
59 The identifier may be opaque.
60 The identifier SHOULD be chosen such that the same node in a
61 real network topology will always be identified through the
62 same identifier, even if the model is instantiated in separate
63 datastores. An implementation MAY choose to capture semantics
64 in the identifier, for example to indicate the type of node
65 and/or the type of topology that the node is a part of.";
72 "An identifier for a link in a topology.
73 The identifier may be opaque.
74 The identifier SHOULD be chosen such that the same link in a
75 real network topology will always be identified through the
76 same identifier, even if the model is instantiated in separate
77 datastores. An implementation MAY choose to capture semantics
78 in the identifier, for example to indicate the type of link
79 and/or the type of topology that the link is a part of.";
85 "An identifier for termination points on a node.
86 The identifier may be opaque.
87 The identifier SHOULD be chosen such that the same TP in a
88 real network topology will always be identified through the
89 same identifier, even if the model is instantiated in separate
90 datastores. An implementation MAY choose to capture semantics
91 in the identifier, for example to indicate the type of TP
92 and/or the type of node and topology that the TP is a part of.";
97 path "/network-topology/topology/node/termination-point/tp-id";
100 "A type for an absolute reference to a termination point.
101 (This type should not be used for relative references.
102 In such a case, a relative path should be used instead.)";
104 typedef topology-ref {
106 path "/network-topology/topology/topology-id";
109 "A type for an absolute reference a topology instance.";
114 path "/network-topology/topology/node/node-id";
118 "A type for an absolute reference to a node instance.
119 (This type should not be used for relative references.
120 In such a case, a relative path should be used instead.)";
125 path "/network-topology/topology/link/link-id";
128 "A type for an absolute reference a link instance.
129 (This type should not be used for relative references.
130 In such a case, a relative path should be used instead.)";
133 grouping tp-attributes {
135 "The data objects needed to define a termination point.
136 (This only includes a single leaf at this point, used
137 to identify the termination point.)
138 Provided in a grouping so that in addition to the datastore,
139 the data can also be included in notifications.";
147 "The leaf list identifies any termination points that the
148 termination point is dependent on, or maps onto.
149 Those termination points will themselves be contained
150 in a supporting node.
151 This dependency information can be inferred from
152 the dependencies between links. For this reason,
153 this item is not separately configurable. Hence no
154 corresponding constraint needs to be articulated.
155 The corresponding information is simply provided by the
156 implementing system.";
160 grouping node-attributes {
162 "The data objects needed to define a node.
163 The objects are provided in a grouping so that in addition to
164 the datastore, the data can also be included in notifications
170 "The identifier of a node in the topology.
171 A node is specific to a topology to which it belongs.";
173 list supporting-node {
175 "This list defines vertical layering information for nodes.
176 It allows to capture for any given node, which node (or nodes)
177 in the corresponding underlay topology it maps onto.
178 A node can map to zero, one, or more nodes below it;
179 accordingly there can be zero, one, or more elements in the list.
180 If there are specific layering requirements, for example
181 specific to a particular type of topology that only allows
182 for certain layering relationships, the choice
183 below can be augmented with additional cases.
184 A list has been chosen rather than a leaf-list in order
185 to provide room for augmentations, e.g. for
186 statistics or priorization information associated with
188 // This is not what was published in the initial draft,
189 // added topology-ref leaf and added it to the key
190 key "topology-ref node-ref";
200 grouping link-attributes {
201 // This is a grouping, not defined inline with the link definition itself,
202 // so it can be included in a notification, if needed
206 "The identifier of a link in the topology.
207 A link is specific to a topology to which it belongs.";
214 "Source node identifier, must be in same topology.";
219 "Termination point within source node that terminates the link.";
223 container destination {
228 "Destination node identifier, must be in same topology.";
233 "Termination point within destination node that terminates the link.";
236 list supporting-link {
245 container network-topology {
248 This is the model of an abstract topology.
249 A topology contains nodes and links.
250 Each topology MUST be identified by
251 unique topology-id for reason that a network could contain many
258 It is presumed that a datastore will contain many topologies. To
259 distinguish between topologies it is vital to have UNIQUE
260 topology identifiers.
263 leaf server-provided {
267 Indicates whether the topology is configurable by clients,
268 or whether it is provided by the server. This leaf is
270 populated by the server implementing the model.
271 It is set to false for topologies that are created by a client;
272 it is set to true otherwise. If it is set to true, any
273 attempt to edit the topology MUST be rejected.
276 container topology-types {
278 "This container is used to identify the type, or types
279 (as a topology can support several types simultaneously),
281 Topology types are the subject of several integrity constraints
282 that an implementing server can validate in order to
283 maintain integrity of the datastore.
284 Topology types are indicated through separate data nodes;
285 the set of topology types is expected to increase over time.
286 To add support for a new topology, an augmenting module
287 needs to augment this container with a new empty optional
288 container to indicate the new topology type.
289 The use of a container allows to indicate a subcategorization
291 The container SHALL NOT be augmented with any data nodes
292 that serve a purpose other than identifying a particular
296 list underlay-topology {
301 // a list, not a leaf-list, to allow for potential augmentation
302 // with properties specific to the underlay topology,
303 // such as statistics, preferences, or cost.
305 "Identifies the topology, or topologies, that this topology
310 description "The list of network nodes defined for the topology.";
312 uses node-attributes;
313 must "boolean(../underlay-topology[*]/node[./supporting-nodes/node-ref])";
314 // This constraint is meant to ensure that a referenced node is in fact
315 // a node in an underlay topology.
316 list termination-point {
319 "A termination point can terminate a link.
320 Depending on the type of topology, a termination point could,
321 for example, refer to a port or an interface.";
329 A Network Link connects a by Local (Source) node and
330 a Remote (Destination) Network Nodes via a set of the
331 nodes' termination points.
332 As it is possible to have several links between the same
333 source and destination nodes, and as a link could potentially
334 be re-homed between termination points, to ensure that we
335 would always know to distinguish between links, every link
336 is identified by a dedicated link identifier.
337 Note that a link models a point-to-point link, not a multipoint
339 Layering dependencies on links in underlay topologies are
340 not represented as the layering information of nodes and of
341 termination points is sufficient.
344 uses link-attributes;
345 must "boolean(../underlay-topology/link[./supporting-link])";
346 // Constraint: any supporting link must be part of an underlay topology
347 must "boolean(../node[./source/source-node])";
348 // Constraint: A link must have as source a node of the same topology
349 must "boolean(../node[./destination/dest-node])";
350 // Constraint: A link must have as source a destination of the same topology
351 must "boolean(../node/termination-point[./source/source-tp])";
352 // Constraint: The source termination point must be contained in the source node
353 must "boolean(../node/termination-point[./destination/dest-tp])";
354 // Constraint: The destination termination point must be contained
355 // in the destination node