VinodKumarS-Huawei | d81eccb | 2016-06-01 14:30:22 +0530 | [diff] [blame] | 1 | module ietf-network-topology { |
| 2 | yang-version 1; |
| 3 | namespace "urn:ietf:params:xml:ns:yang:ietf-network-topology"; |
| 4 | prefix lnk; |
| 5 | |
| 6 | import ietf-inet-types { |
| 7 | prefix inet; |
| 8 | } |
| 9 | import 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 { |
janani b | ebb143d | 2016-07-14 19:35:22 +0530 | [diff] [blame] | 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 | } |
VinodKumarS-Huawei | d81eccb | 2016-06-01 14:30:22 +0530 | [diff] [blame] | 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 { |
janani b | ebb143d | 2016-07-14 19:35:22 +0530 | [diff] [blame] | 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:termination-point/lnk:tp-id"; |
| 127 | require-instance false; |
| 128 | } |
VinodKumarS-Huawei | d81eccb | 2016-06-01 14:30:22 +0530 | [diff] [blame] | 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 { |
janani b | ebb143d | 2016-07-14 19:35:22 +0530 | [diff] [blame] | 162 | type leafref { |
| 163 | path "../../../nd:node/nd:node-id"; |
| 164 | } |
VinodKumarS-Huawei | d81eccb | 2016-06-01 14:30:22 +0530 | [diff] [blame] | 165 | mandatory true; |
| 166 | description |
| 167 | "Source node identifier, must be in same topology."; |
| 168 | } |
| 169 | leaf source-tp { |
janani b | ebb143d | 2016-07-14 19:35:22 +0530 | [diff] [blame] | 170 | type leafref { |
| 171 | path "../../../nd:node[nd:node-id=current()/../"+ |
| 172 | "source-node]/termination-point/tp-id"; |
| 173 | } |
VinodKumarS-Huawei | d81eccb | 2016-06-01 14:30:22 +0530 | [diff] [blame] | 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 { |
janani b | ebb143d | 2016-07-14 19:35:22 +0530 | [diff] [blame] | 184 | type leafref { |
| 185 | path "../../../nd:node/nd:node-id"; |
| 186 | } |
VinodKumarS-Huawei | d81eccb | 2016-06-01 14:30:22 +0530 | [diff] [blame] | 187 | mandatory true; |
| 188 | description |
| 189 | "Destination node identifier, must be in the same |
| 190 | network."; |
| 191 | } |
| 192 | leaf dest-tp { |
janani b | ebb143d | 2016-07-14 19:35:22 +0530 | [diff] [blame] | 193 | type leafref { |
| 194 | path "../../../nd:node[nd:node-id=current()/../"+ |
| 195 | "dest-node]/termination-point/tp-id"; |
| 196 | } |
VinodKumarS-Huawei | d81eccb | 2016-06-01 14:30:22 +0530 | [diff] [blame] | 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 { |
janani b | ebb143d | 2016-07-14 19:35:22 +0530 | [diff] [blame] | 214 | type leafref { |
| 215 | path "../../../nd:supporting-network/nd:network-ref"; |
| 216 | require-instance false; |
| 217 | } |
VinodKumarS-Huawei | d81eccb | 2016-06-01 14:30:22 +0530 | [diff] [blame] | 218 | description |
| 219 | "This leaf identifies in which underlay topology |
| 220 | supporting link is present."; |
| 221 | } |
| 222 | leaf link-ref { |
janani b | ebb143d | 2016-07-14 19:35:22 +0530 | [diff] [blame] | 223 | type leafref { |
| 224 | path "/nd:networks/nd:network[nd:network-id=current()/"+ |
| 225 | "../network-ref]/link/link-id"; |
| 226 | require-instance false; |
| 227 | } |
VinodKumarS-Huawei | d81eccb | 2016-06-01 14:30:22 +0530 | [diff] [blame] | 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 | augment "/nd:networks/nd:network/nd:node" { |
| 238 | description |
| 239 | "Augment termination points which terminate links. |
| 240 | Termination points can ultimately be mapped to interfaces."; |
| 241 | list termination-point { |
| 242 | key "tp-id"; |
| 243 | description |
| 244 | "A termination point can terminate a link. |
| 245 | Depending on the type of topology, a termination point |
| 246 | could, for example, refer to a port or an interface."; |
| 247 | leaf tp-id { |
| 248 | type tp-id; |
| 249 | description |
| 250 | "Termination point identifier."; |
| 251 | } |
| 252 | list supporting-termination-point { |
| 253 | key "network-ref node-ref tp-ref"; |
| 254 | description |
| 255 | "The leaf list identifies any termination points that |
| 256 | the termination point is dependent on, or maps onto. |
| 257 | Those termination points will themselves be contained |
| 258 | in a supporting node. |
| 259 | This dependency information can be inferred from |
| 260 | the dependencies between links. For this reason, |
| 261 | this item is not separately configurable. Hence no |
| 262 | corresponding constraint needs to be articulated. |
| 263 | The corresponding information is simply provided by the |
| 264 | implementing system."; |
| 265 | leaf network-ref { |
janani b | ebb143d | 2016-07-14 19:35:22 +0530 | [diff] [blame] | 266 | type leafref { |
| 267 | path "../../../nd:supporting-node/nd:network-ref"; |
| 268 | require-instance false; |
| 269 | } |
VinodKumarS-Huawei | d81eccb | 2016-06-01 14:30:22 +0530 | [diff] [blame] | 270 | description |
| 271 | "This leaf identifies in which topology the |
| 272 | supporting termination point is present."; |
| 273 | } |
| 274 | leaf node-ref { |
janani b | ebb143d | 2016-07-14 19:35:22 +0530 | [diff] [blame] | 275 | type leafref { |
| 276 | path "../../../nd:supporting-node/nd:node-ref"; |
| 277 | require-instance false; |
| 278 | } |
VinodKumarS-Huawei | d81eccb | 2016-06-01 14:30:22 +0530 | [diff] [blame] | 279 | description |
| 280 | "This leaf identifies in which node the supporting |
| 281 | termination point is present."; |
| 282 | } |
| 283 | leaf tp-ref { |
janani b | ebb143d | 2016-07-14 19:35:22 +0530 | [diff] [blame] | 284 | type leafref { |
| 285 | path "/nd:networks/nd:network[nd:network-id=current()/"+ |
| 286 | "../network-ref]/nd:node[nd:node-id=current()/../"+ |
| 287 | "node-ref]/termination-point/tp-id"; |
| 288 | require-instance false; |
| 289 | } |
VinodKumarS-Huawei | d81eccb | 2016-06-01 14:30:22 +0530 | [diff] [blame] | 290 | description |
| 291 | "Reference to the underlay node, must be in a |
| 292 | different topology"; |
| 293 | } |
| 294 | } |
| 295 | } |
| 296 | } |
| 297 | } |