Add RFC8542 models
[mdsal.git] / model / ietf / rfc8542-ietf-dc-fabric-topology / src / main / yang / ietf-dc-fabric-topology@2019-02-25.yang
1 module ietf-dc-fabric-topology {
2   yang-version 1.1;
3   namespace "urn:ietf:params:xml:ns:yang:ietf-dc-fabric-topology";
4   prefix fabric;
5
6   import ietf-network {
7     prefix nw;
8     reference
9       "RFC 8345: A YANG Data Model for Network Topologies";
10   }
11   import ietf-network-topology {
12     prefix nt;
13     reference
14       "RFC 8345: A YANG Data Model for Network Topologies";
15   }
16   import ietf-dc-fabric-types {
17     prefix fabrictypes;
18     reference
19       "RFC 8542: A YANG Data Model for Fabric Topology in
20        Data-Center Networks";
21   }
22   organization
23     "IETF I2RS (Interface to the Routing System) Working Group";
24   contact
25     "WG Web:    <https://datatracker.ietf.org/wg/i2rs/>
26      WG List:   <mailto:i2rs@ietf.org>
27
28      Editor:    Yan Zhuang
29                 <mailto:zhuangyan.zhuang@huawei.com>
30
31      Editor:    Danian Shi
32                 <mailto:shidanian@huawei.com>";
33   description
34     "This module contains a collection of YANG definitions for
35      fabric.
36
37      Copyright (c) 2019 IETF Trust and the persons identified
38      as authors of the code.  All rights reserved.
39
40      Redistribution and use in source and binary forms, with
41      or without modification, is permitted pursuant to, and
42      subject to the license terms contained in, the Simplified
43      BSD License set forth in Section 4.c of the IETF Trust's
44      Legal Provisions Relating to IETF Documents
45      (https://trustee.ietf.org/license-info).
46
47      This version of this YANG module is part of RFC 8542;
48      see the RFC itself for full legal notices.";
49
50   revision 2019-02-25 {
51     description
52       "Initial revision.";
53     reference
54       "RFC 8542: A YANG Data Model for Fabric Topology
55        in Data-Center Networks";
56   }
57
58   //grouping statements
59
60   grouping fabric-network-type {
61     description
62       "Identify the topology type to be fabric.";
63     container fabric-network {
64       presence "indicates fabric Network";
65       description
66         "The presence of the container node indicates
67          fabric topology";
68     }
69   }
70   grouping fabric-options {
71     description
72       "Options for a fabric";
73     leaf gateway-mode {
74       type enumeration {
75         enum centralized {
76           description
77             "The Fabric uses centralized
78              gateway, in which gateway is deployed on SPINE
79              node.";
80         }
81         enum distributed {
82           description
83             "The Fabric uses distributed
84              gateway, in which gateway is deployed on LEAF
85              node.";
86         }
87       }
88       default "distributed";
89       description
90         "Gateway mode of the fabric";
91     }
92     leaf traffic-behavior {
93       type enumeration {
94         enum normal {
95           description
96             "Normal means no policy is needed
97              for all traffic";
98         }
99         enum policy-driven {
100           description
101             "Policy driven means policy is
102              needed for the traffic; otherwise, the traffic
103              will be discarded.";
104         }
105       }
106       default "normal";
107       description
108         "Traffic behavior of the fabric";
109     }
110     leaf-list capability-supported {
111       type fabrictypes:service-capabilities;
112       description
113         "It provides a list of supported services of the
114          fabric.  The service-capabilities is defined as
115          identity-ref.  Users can define more services
116          by defining new identities.";
117     }
118   }
119
120   grouping device-attributes {
121     description
122       "device attributes";
123     leaf device-ref {
124       type fabrictypes:node-ref;
125       description
126         "The device that the fabric includes that refers
127          to a node in another topology.";
128     }
129     leaf-list role {
130       type fabrictypes:device-role;
131       default "fabrictypes:leaf";
132       description
133         "It is a list of device roles to represent the roles
134          that a device plays within a POD, such as SPINE,
135          LEAF, Border, or Border-Leaf.
136          The device role is defined as identity-ref.  If more
137          than 2 stages are used for a POD, users can
138          define new identities for the device role.";
139     }
140   }
141
142   grouping link-attributes {
143     description
144       "Link attributes";
145     leaf link-ref {
146       type fabrictypes:link-ref;
147       description
148         "The link that the fabric includes that refers to
149          a link in another topology.";
150     }
151   }
152
153   grouping port-attributes {
154     description
155       "Port attributes";
156     leaf port-ref {
157       type fabrictypes:tp-ref;
158       description
159         "The port that the fabric includes that refers to
160          a termination-point in another topology.";
161     }
162     leaf port-type {
163       type fabrictypes:port-type;
164       description
165         "Port type is defined as identity-ref.  The current
166          types include ethernet or serial.  If more types
167          are needed, developers can define new identities.";
168     }
169     leaf bandwidth {
170       type fabrictypes:bandwidth;
171       description
172         "Bandwidth of the port.  It is defined as identity-ref.
173          If more speeds are introduced, developers can define
174          new identities for them.  Current speeds include 1M, 10M,
175          100M, 1G, 10G, 25G, 40G, 100G, and 400G.";
176     }
177   }
178
179   grouping fabric-attributes {
180     description
181       "Attributes of a fabric";
182     leaf fabric-id {
183       type fabrictypes:fabric-id;
184       description
185         "An identifier for a fabric in a topology.
186          This identifier can be generated when composing a fabric.
187          The composition of a fabric can be achieved by defining an
188          RPC, which is left for vendor-specific implementation and
189          not provided in this model.";
190     }
191     leaf name {
192       type string;
193       description
194         "Name of the fabric";
195     }
196     leaf type {
197       type fabrictypes:underlay-network-type;
198       description
199         "The type of physical network that implements this
200          fabric.  Examples are VLAN and TRILL.";
201     }
202     container vni-capacity {
203       description
204         "The range of the VXLAN Network Identifier
205          (VNI) defined in RFC 7348 that the POD uses.";
206       leaf min {
207         type int32;
208         description
209           "The lower-limit VNI.";
210       }
211       leaf max {
212         type int32;
213         description
214           "The upper-limit VNI.";
215       }
216     }
217     leaf description {
218       type string;
219       description
220         "Description of the fabric";
221     }
222     container options {
223       description
224         "Options of the fabric";
225       uses fabric-options;
226     }
227     list device-nodes {
228       key "device-ref";
229       description
230         "Device nodes that are included in a fabric.";
231       uses device-attributes;
232     }
233     list device-links {
234       key "link-ref";
235       description
236         "Links that are included within a fabric.";
237       uses link-attributes;
238     }
239     list device-ports {
240       key "port-ref";
241       description
242         "Ports that are included in the fabric.";
243       uses port-attributes;
244     }
245   }
246
247   // augment statements
248
249   augment "/nw:networks/nw:network/nw:network-types" {
250     description
251       "Introduce a new network type for fabric-based topology";
252     uses fabric-network-type;
253   }
254
255   augment "/nw:networks/nw:network/nw:node" {
256     when '/nw:networks/nw:network/nw:network-types/'
257        + 'fabric:fabric-network' {
258       description
259         "Augmentation parameters apply only for networks
260          with fabric topology";
261     }
262     description
263       "Augmentation for fabric nodes created by
264        fabric topology.";
265     container fabric-attributes {
266       description
267         "Attributes for a fabric network";
268       uses fabric-attributes;
269     }
270   }
271
272   augment "/nw:networks/nw:network/nw:node/nt:termination-point" {
273     when '/nw:networks/nw:network/nw:network-types/'
274        + 'fabric:fabric-network' {
275       description
276         "Augmentation parameters apply only for networks
277          with fabric topology";
278     }
279     description
280       "Augmentation for port on fabric.";
281     container fport-attributes {
282       config false;
283       description
284         "Attributes for fabric ports";
285       uses fabrictypes:fabric-port;
286     }
287   }
288 }