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