blob: ae5e953a45dd871e686b363b03af8b738e093acc [file] [log] [blame]
sonugupta-huaweiaa6791e2017-02-09 12:38:43 +05301 module yrt-network-topology {
2 yang-version 1;
3 namespace "urn:ietf:params:xml:ns:yang:yrt-ietf-network-topology";
4 prefix lnk;
5
6 import yrt-ietf-inet-types {
7 prefix inet;
8 }
9 import yrt-ietf-network {
10 prefix nd;
11 }
12
13 organization
14 "IETF I2RS (Interface to the Routing System) Working Group";
15
16 contact
17 "WG Web: <http://tools.ietf.org/wg/i2rs/>
18 WG List: <mailto:i2rs@ietf.org>
19
20 WG Chair: Susan Hares
21 <mailto:shares@ndzh.com>
22
23 WG Chair: Jeffrey Haas
24 <mailto:jhaas@pfrc.org>
25
26 Editor: Alexander Clemm
27 <mailto:alex@cisco.com>
28
29 Editor: Jan Medved
30 <mailto:jmedved@cisco.com>
31
32 Editor: Robert Varga
33 <mailto:rovarga@cisco.com>
34
35 Editor: Tony Tkacik
36 <mailto:ttkacik@cisco.com>
37
38 Editor: Nitin Bahadur
39 <mailto:nitin_bahadur@yahoo.com>
40
41 Editor: Hariharan Ananthakrishnan
42 <mailto:hari@packetdesign.com>";
43
44 description
45 "This module defines a common base model for network topology,
46 augmenting the base network model with links to connect nodes,
47 as well as termination points to terminate links on nodes.
48
49 Copyright (c) 2015 IETF Trust and the persons identified as
50 authors of the code. All rights reserved.
51
52 Redistribution and use in source and binary forms, with or
53 without modification, is permitted pursuant to, and subject
54 to the license terms contained in, the Simplified BSD License
55 set forth in Section 4.c of the IETF Trust's Legal Provisions
56 Relating to IETF Documents
57 (http://trustee.ietf.org/license-info).
58
59 This version of this YANG module is part of
60 draft-ietf-i2rs-yang-network-topo-02;
61 see the RFC itself for full legal notices.
62
63 NOTE TO RFC EDITOR: Please replace above reference to
64 draft-ietf-i2rs-yang-network-topo-02 with RFC
65 number when published (i.e. RFC xxxx).";
66
67 revision 2015-12-08 {
68 description
69 "Initial revision.
70 NOTE TO RFC EDITOR: Please replace the following reference
71 to draft-ietf-i2rs-yang-network-topo-02 with
72 RFC number when published (i.e. RFC xxxx).";
73 reference
74 "draft-ietf-i2rs-yang-network-topo-02.";
75 }
76
77 typedef link-id {
78 type inet:uri;
79 description
80 "An identifier for a link in a topology.
81 The identifier SHOULD be chosen such that the same link in a
82 real network topology will always be identified through the
83 same identifier, even if the model is instantiated in
84 separate datastores. An implementation MAY choose to capture
85 semantics in the identifier, for example to indicate the type
86 of link and/or the type of topology that the link is a part
87 of.";
88 }
89
90 typedef tp-id {
91 type inet:uri;
92 description
93 "An identifier for termination points on a node.
94 The identifier SHOULD be chosen such that the same TP in a
95 real network topology will always be identified through the
96 same identifier, even if the model is instantiated in
97 separate datastores. An implementation MAY choose to capture
98 semantics in the identifier, for example to indicate the type
99 of TP and/or the type of node and topology that the TP is a
100 part of.";
101 }
102 grouping link-ref {
103 description
104 "References a link in a specific network.";
105 leaf link-ref {
106 type leafref {
107 path "/nd:networks/nd:network[nd:network-id=current()/../"+
108 "network-ref]/lnk:link/lnk:link-id";
109 require-instance false;
110 }
111 description
112 "A type for an absolute reference a link instance.
113 (This type should not be used for relative references.
114 In such a case, a relative path should be used instead.)";
115 }
116 uses nd:network-ref;
117 }
118
119 grouping tp-ref {
120 description
121 "References a termination point in a specific node.";
122 leaf tp-ref {
123 type leafref {
124 path "/nd:networks/nd:network[nd:network-id=current()/../"+
125 "network-ref]/nd:node[nd:node-id=current()/../"+
126 "node-ref]/lnk:t-point/lnk:tp-id";
127 require-instance false;
128 }
129 description
130 "A type for an absolute reference to a termination point.
131 (This type should not be used for relative references.
132 In such a case, a relative path should be used instead.)";
133 }
134 uses nd:node-ref;
135 }
136
137 augment "/nd:networks/nd:network" {
138 description
139 "Add links to the network model.";
140 list link {
141 key "link-id";
142 description
143 "A Network Link connects a by Local (Source) node and
144 a Remote (Destination) Network Nodes via a set of the
145 nodes' termination points.
146 As it is possible to have several links between the same
147 source and destination nodes, and as a link could
148 potentially be re-homed between termination points, to
149 ensure that we would always know to distinguish between
150 links, every link is identified by a dedicated link
151 identifier.
152 Note that a link models a point-to-point link, not a
153 multipoint link.
154 Layering dependencies on links in underlay topologies are
155 not represented as the layering information of nodes and of
156 termination points is sufficient.";
157 container source {
158 description
159 "This container holds the logical source of a particular
160 link.";
161 leaf source-node {
162 type leafref {
163 path "../../../nd:node/nd:node-id";
164 }
165 mandatory true;
166 description
167 "Source node identifier, must be in same topology.";
168 }
169 leaf source-tp {
170 type leafref {
171 path "../../../nd:node[nd:node-id=current()/../"+
172 "source-node]/t-point/tp-id";
173 }
174 description
175 "Termination point within source node that terminates
176 the link.";
177 }
178 }
179 container destination {
180 description
181 "This container holds the logical destination of a
182 particular link.";
183 leaf dest-node {
184 type leafref {
185 path "../../../nd:node/nd:node-id";
186 }
187 mandatory true;
188 description
189 "Destination node identifier, must be in the same
190 network.";
191 }
192 leaf dest-tp {
193 type leafref {
194 path "../../../nd:node[nd:node-id=current()/../"+
195 "dest-node]/t-point/tp-id";
196 }
197 description
198 "Termination point within destination node that
199 terminates the link.";
200 }
201 }
202 leaf link-id {
203 type link-id;
204 description
205 "The identifier of a link in the topology.
206 A link is specific to a topology to which it belongs.";
207 }
208 list supporting-link {
209 key "network-ref link-ref";
210 description
211 "Identifies the link, or links, that this link
212 is dependent on.";
213 leaf network-ref {
214 type leafref {
215 path "../../../nd:supporting-network/nd:network-ref";
216 require-instance false;
217 }
218 description
219 "This leaf identifies in which underlay topology
220 supporting link is present.";
221 }
222 leaf link-ref {
223 type leafref {
224 path "/nd:networks/nd:network[nd:network-id=current()/"+
225 "../network-ref]/link/link-id";
226 require-instance false;
227 }
228 description
229 "This leaf identifies a link which is a part
230 of this link's underlay. Reference loops, in which
231 a link identifies itself as its underlay, either
232 directly or transitively, are not allowed.";
233 }
234 }
235 }
236
237 leaf link-id {
238 type link-id;
239 description
240 "The identifier of a link in the topology.
241 A link is specific to a topology to which it belongs.";
242 }
243 }
244 augment "/nd:networks/nd:network/nd:node" {
245 description
246 "Augment termination points which terminate links.
247 Termination points can ultimately be mapped to interfaces.";
248 list t-point {
249 key "tp-id";
250 description
251 "A termination point can terminate a link.
252 Depending on the type of topology, a termination point
253 could, for example, refer to a port or an interface.";
254 leaf tp-id {
255 type tp-id;
256 description
257 "Termination point identifier.";
258 }
259 list supporting-termination-point {
260 key "network-ref node-ref tp-ref";
261 description
262 "The leaf list identifies any termination points that
263 the termination point is dependent on, or maps onto.
264 Those termination points will themselves be contained
265 in a supporting node.
266 This dependency information can be inferred from
267 the dependencies between links. For this reason,
268 this item is not separately configurable. Hence no
269 corresponding constraint needs to be articulated.
270 The corresponding information is simply provided by the
271 implementing system.";
272 leaf network-ref {
273 type leafref {
274 path "../../../nd:supporting-node/nd:network-ref";
275 require-instance false;
276 }
277 description
278 "This leaf identifies in which topology the
279 supporting termination point is present.";
280 }
281 leaf node-ref {
282 type leafref {
283 path "../../../nd:supporting-node/nd:node-ref";
284 require-instance false;
285 }
286 description
287 "This leaf identifies in which node the supporting
288 termination point is present.";
289 }
290 leaf tp-ref {
291 type leafref {
292 path "/nd:networks/nd:network[nd:network-id=current()/"+
293 "../network-ref]/nd:node[nd:node-id=current()/../"+
294 "node-ref]/t-point/tp-id";
295 require-instance false;
296 }
297 description
298 "Reference to the underlay node, must be in a
299 different topology";
300 }
301 }
302 }
303 }
304 }