58b7122a8438bf04fca241b5a52eb56164bd544e
[mdsal.git] / model / ietf / rfc8542-ietf-dc-fabric-types / src / main / yang / ietf-dc-fabric-types@2019-02-25.yang
1 module ietf-dc-fabric-types {
2   yang-version 1.1;
3   namespace "urn:ietf:params:xml:ns:yang:ietf-dc-fabric-types";
4   prefix fabrictypes;
5
6   import ietf-network {
7     prefix nw;
8     reference
9       "RFC 8345: A YANG Data Model for Network Topologies";
10   }
11
12   organization
13     "IETF I2RS (Interface to the Routing System) Working Group";
14   contact
15     "WG Web:    <https://datatracker.ietf.org/wg/i2rs/>
16      WG List:   <mailto:i2rs@ietf.org>
17
18      Editor:    Yan Zhuang
19                 <mailto:zhuangyan.zhuang@huawei.com>
20
21      Editor:    Danian Shi
22                 <mailto:shidanian@huawei.com>";
23   description
24     "This module contains a collection of YANG definitions for
25      fabric.
26
27      Copyright (c) 2019 IETF Trust and the persons identified
28      as authors of the code.  All rights reserved.
29
30      Redistribution and use in source and binary forms, with
31      or without modification, is permitted pursuant to, and
32      subject to the license terms contained in, the Simplified
33      BSD License set forth in Section 4.c of the IETF Trust's
34      Legal Provisions Relating to IETF Documents
35      (https://trustee.ietf.org/license-info).
36
37      This version of this YANG module is part of RFC 8542;
38      see the RFC itself for full legal notices.";
39
40   revision 2019-02-25 {
41     description
42       "Initial revision.";
43     reference
44       "RFC 8542: A YANG Data Model for Fabric Topology
45        in Data-Center Networks";
46   }
47
48   identity fabric-type {
49     description
50       "Base type for fabric networks";
51   }
52
53   identity vxlan-fabric {
54     base fabric-type;
55     description
56       "VXLAN fabric";
57   }
58
59   identity vlan-fabric {
60     base fabric-type;
61     description
62       "VLAN fabric";
63   }
64
65   identity trill-fabric {
66     base fabric-type;
67     description
68       "TRILL fabric";
69   }
70
71   identity port-type {
72     description
73       "Base type for fabric port";
74   }
75
76   identity eth {
77     base port-type;
78     description
79       "Ethernet";
80   }
81
82   identity serial {
83     base port-type;
84     description
85       "Serial";
86   }
87
88   identity bandwidth {
89     description
90       "Base for bandwidth";
91   }
92
93   identity bw-1M {
94     base bandwidth;
95     description
96       "1M";
97   }
98
99   identity bw-10M {
100     base bandwidth;
101     description
102       "10Mbps";
103   }
104
105   identity bw-100M {
106     base bandwidth;
107     description
108       "100Mbps";
109   }
110
111   identity bw-1G {
112     base bandwidth;
113     description
114       "1Gbps";
115   }
116
117   identity bw-10G {
118     base bandwidth;
119     description
120       "10Gbps";
121   }
122
123   identity bw-25G {
124     base bandwidth;
125     description
126       "25Gbps";
127   }
128
129   identity bw-40G {
130     base bandwidth;
131     description
132       "40Gbps";
133   }
134
135   identity bw-100G {
136     base bandwidth;
137     description
138       "100Gbps";
139   }
140
141   identity bw-400G {
142     base bandwidth;
143     description
144       "400Gbps";
145   }
146
147   identity device-role {
148     description
149       "Base for the device role in a fabric.";
150   }
151
152   identity spine {
153     base device-role;
154     description
155       "This is a spine node in a fabric.";
156   }
157
158   identity leaf {
159     base device-role;
160     description
161       "This is a leaf node in a fabric.";
162   }
163
164   identity border {
165     base device-role;
166     description
167       "This is a border node to connect to other
168        fabric/network.";
169   }
170
171   identity fabric-port-role {
172     description
173       "Base for the port's role in a fabric.";
174   }
175
176   identity internal {
177     base fabric-port-role;
178     description
179       "The port is used for devices to access each
180        other within a fabric.";
181   }
182
183   identity external {
184     base fabric-port-role;
185     description
186       "The port is used for a fabric to connect to
187        outside network.";
188   }
189
190   identity access {
191     base fabric-port-role;
192     description
193       "The port is used for an endpoint to connect
194        to a fabric.";
195   }
196
197   identity service-capability {
198     description
199       "Base for the service of the fabric ";
200   }
201
202   identity ip-mapping {
203     base service-capability;
204     description
205       "NAT.";
206   }
207
208   identity acl-redirect {
209     base service-capability;
210     description
211       "ACL redirect, which can provide a Service Function Chain (SFC).";
212   }
213
214   identity dynamic-route-exchange {
215     base service-capability;
216     description
217       "Dynamic route exchange.";
218   }
219
220   /*
221    * Typedefs
222    */
223
224   typedef fabric-id {
225     type nw:node-id;
226     description
227       "An identifier for a fabric in a topology.
228        This identifier can be generated when composing a fabric.
229        The composition of a fabric can be achieved by defining an
230        RPC, which is left for vendor specific implementation
231        and not provided in this model.";
232   }
233
234   typedef service-capabilities {
235     type identityref {
236       base service-capability;
237     }
238     description
239       "Service capability of the fabric";
240   }
241
242   typedef port-type {
243     type identityref {
244       base port-type;
245     }
246     description
247       "Port type: ethernet or serial or others.";
248   }
249
250   typedef bandwidth {
251     type identityref {
252       base bandwidth;
253     }
254     description
255       "Bandwidth of the port.";
256   }
257
258   typedef node-ref {
259     type instance-identifier;
260     description
261       "A reference to a node in topology";
262   }
263
264   typedef tp-ref {
265     type instance-identifier;
266     description
267       "A reference to a termination point in topology";
268   }
269
270   typedef link-ref {
271     type instance-identifier;
272     description
273       "A reference to a link in topology";
274   }
275
276   typedef underlay-network-type {
277     type identityref {
278       base fabric-type;
279     }
280     description
281       "The type of physical network that implements
282        this fabric.  Examples are VLAN and TRILL.";
283   }
284
285   typedef device-role {
286     type identityref {
287       base device-role;
288     }
289     description
290       "Role of the device node.";
291   }
292
293   typedef fabric-port-role {
294     type identityref {
295       base fabric-port-role;
296     }
297     description
298       "Role of the port in a fabric.";
299   }
300
301   typedef fabric-port-type {
302     type enumeration {
303       enum layer2interface {
304         description
305           "L2 interface";
306       }
307       enum layer3interface {
308         description
309           "L3 interface";
310       }
311       enum layer2Tunnel {
312         description
313           "L2 tunnel";
314       }
315       enum layer3Tunnel {
316         description
317           "L3 tunnel";
318       }
319     }
320     description
321       "Fabric port type";
322   }
323
324   grouping fabric-port {
325     description
326       "Attributes of a fabric port.";
327     leaf name {
328       type string;
329       description
330         "Name of the port.";
331     }
332     leaf role {
333       type fabric-port-role;
334       description
335         "Role of the port in a fabric.";
336     }
337     leaf type {
338       type fabric-port-type;
339       description
340         "Type of the port";
341     }
342     leaf device-port {
343       type tp-ref;
344       description
345         "The device port it mapped to.";
346     }
347     choice tunnel-option {
348       description
349         "Tunnel options to connect two fabrics.
350          It could be L2 Tunnel or L3 Tunnel.";
351     }
352   }
353 }