Add supoprt for D release use-case.
[sim/o1-interface.git] / ntsimulator / deploy / o-ran-ru-fh / yang / o-ran-interfaces@2020-12-10.yang
1 module o-ran-interfaces {
2   yang-version 1.1;
3   namespace "urn:o-ran:interfaces:1.0";
4   prefix "o-ran-int";
5
6
7   import ietf-inet-types {
8     prefix "inet";
9   }
10
11   import iana-if-type {
12     prefix "ianaift";
13   }
14
15   import ietf-interfaces {
16     prefix "if";
17   }
18
19   import ietf-ip {
20     prefix "ip";
21   }
22
23   import ietf-hardware {
24     prefix "hw";
25   }
26
27   import ietf-yang-types {
28     prefix "yang";
29   }
30
31   import iana-hardware {
32     prefix "ianahw";
33   }
34
35   organization "O-RAN Alliance";
36
37   contact
38     "www.o-ran.org";
39
40   description
41     "This module defines the YANG definitions for managng the O-RAN
42      interfaces.
43
44     Copyright 2020 the O-RAN Alliance.
45
46     THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS'
47     AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
48     IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
49     ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
50     LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
51     CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
52     SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
53     INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
54     CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
55     ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
56     POSSIBILITY OF SUCH DAMAGE.
57
58     Redistribution and use in source and binary forms, with or without
59     modification, are permitted provided that the following conditions are met:
60
61     * Redistributions of source code must retain the above copyright notice,
62     this list of conditions and the above disclaimer.
63     * Redistributions in binary form must reproduce the above copyright notice,
64     this list of conditions and the above disclaimer in the documentation
65     and/or other materials provided with the distribution.
66     * Neither the Members of the O-RAN Alliance nor the names of its
67     contributors may be used to endorse or promote products derived from
68     this software without specific prior written permission.";
69
70   revision "2020-12-10" {
71     description
72       "version 5.0.0
73
74       1) new functionality to describe over subscribed resources";
75
76     reference "ORAN-WG4.M.0-v05.00";
77   }
78
79   revision "2020-04-17" {
80     description
81       "version 1.2.0
82
83       1) updated descriptions to clarify operation when vlan-tagging is false";
84
85     reference "ORAN-WG4.M.0-v03.00";
86   }
87   revision "2019-07-03" {
88     description
89       "version 1.1.0
90
91       1) increasing max elements for user plane DSCP markings to 64
92       2) re-organizing layout to facilitate cross-WG adoption, whilst ensuring
93       nodes are syntactically and semantically equivalent";
94
95     reference "ORAN-WG4.M.0-v01.00";
96   }
97
98   revision "2019-02-04" {
99     description
100       "version 1.0.0
101
102       1) imported model from xRAN
103       2) changed namespace and reference from xran to o-ran";
104
105     reference "ORAN-WG4.M.0-v01.00";
106   }
107
108   feature UDPIP-BASED-CU-PLANE {
109     description
110       "This feature indicates that the RU supports the UDP/IP based transport
111       for the CU plane.";
112   }
113
114   feature ALIASMAC-BASED-CU-PLANE {
115     description
116       "This feature indicates that the RU supports the alias MAC address
117        based transport for the CU plane.";
118   }
119
120   typedef pcp {
121     type uint8 {
122       range "0..7";
123     }
124     description
125       "Priority Code Point. PCP is a 3-bit field that refers to the
126       class of service applied to a VLAN tagged frame.  The
127       field specifies a priority value between 0 and 7, these values
128       can be used by quality of service (QoS) to prioritize
129       different classes of traffic.";
130     reference
131      "IEEE 802.1Q-2014: Virtual Bridged Local Area Networks";
132   }
133
134   grouping cos-marking {
135     description
136       "Configuration data for CU Plane ethernet CoS marking.
137       This grouping is only applicable to an interface when vlan-tagging is
138       set to TRUE for that interface. In other cases, it may be ignored.";
139     container class-of-service {
140       description
141         "CoS Configuration";
142       leaf u-plane-marking {
143         type pcp;
144         default 7;
145         description
146           "Marking used for default u-plane flows.
147           7 represents highest priority for u-plane marking";
148       }
149       leaf c-plane-marking {
150         type pcp;
151         default 7;
152         description "7 represents highest priority for c-plane marking";
153       }
154       leaf m-plane-marking {
155         type pcp;
156         default 2;
157         description "2 represents highest excellent effort for m-plane marking";
158       }
159       leaf s-plane-marking {
160         type pcp;
161         default 7;
162         description "7 represents highest priority for s-plane marking";
163       }
164       leaf other-marking {
165         type pcp;
166         default 1;
167         description "1 represents best effort for other marking";
168       }
169       list enhanced-uplane-markings{
170         key "up-marking-name";
171         max-elements 4;
172         description
173           "list of mappings for enhanced (non-default) u-plane markings";
174         leaf up-marking-name {
175           type string;
176           description "The name of the marking";
177         }
178         leaf enhanced-marking {
179           type pcp;
180           description "the enhanced u-plane marking";
181         }
182       }
183     }
184   }
185
186   grouping dscp-marking {
187     description
188       "Configuration data for CU Plane DSCP marking";
189     container diffserv-markings {
190       description
191         "DSCP Configuration";
192       leaf u-plane-marking {
193         type inet:dscp;
194         default 46;
195         description
196           "Marking used for default u-plane flows.
197           46 represents expedited forwarding";
198       }
199       leaf c-plane-marking {
200         type inet:dscp;
201         default 46;
202         description "46 represents expedited forwarding";
203       }
204       leaf s-plane-marking {
205         type inet:dscp;
206         default 46;
207         description "46 represents expedited forwarding";
208       }
209       leaf other-marking {
210         type inet:dscp;
211         default 0;
212         description "0 represents best effort forwarding";
213       }
214       list enhanced-uplane-markings{
215         key up-marking-name;
216         max-elements 64;
217         description
218           "list of mappings for enhanced (non-default) u-plane markings";
219         leaf up-marking-name {
220           type string;
221           description "The name of the marking";
222         }
223         leaf enhanced-marking {
224           type inet:dscp;
225           description "the enhanced u-plane marking";
226         }
227       }
228     }
229   }
230
231 // Cross Working Group Augmentations Follow
232
233 // Cross Working Group augmentations for basic Ethernet leafs
234
235   augment "/if:interfaces/if:interface" {
236     when "if:type = 'ianaift:ethernetCsmacd'" {
237       description "Applies to Ethernet interfaces";
238     }
239     description
240       "Augment the interface model with parameters for
241       base Ethernet interface";
242
243     leaf l2-mtu {
244       type uint16 {
245         range "64 .. 65535";
246       }
247       units bytes;
248       default 1500;
249       description
250         "The maximum size of layer 2 frames that may be transmitted
251         or received on the interface (excluding any FCS overhead).
252         For Ethernet interfaces it also excludes the
253         4-8 byte overhead of any known (i.e. explicitly matched by
254         a child sub-interface) 801.1Q VLAN tags.";
255     }
256     leaf vlan-tagging {
257       type boolean;
258       default true;
259       description
260         "Indicates if VLAN tagging is used.
261         Default true is used to enable equipment to autonomously discover that
262         it is connected to a trunk port.
263
264         This may be set to false, for example, when the O-RU is directly
265         connected to the O-DU. In such cases, native Ethernet frames may be
266         used across the O-RAN interface, i.e., any PCP markings defined
267         in the cos-markings grouping are NOT used by the O-RU and any default
268         value or configured value using those leafs may be ignored by the O-RAN
269         equipment.";
270     }
271     uses cos-marking;
272
273 // interface-grouping insert - begin;
274
275     leaf-list interface-groups-id {
276       type leafref {
277         path "/if:interfaces/o-ran-int:interface-grouping/o-ran-int:interfaces-groups/o-ran-int:interface-group-id";
278       }
279       config false;
280       description
281         "an optional leaf used when the sustained rate able to be supported by an interface
282         is less than nominal bit rate indicated by o-ran-transceiver.yang
283
284         Identifies interface grouping particular physical hardware MAC address belongs to.";
285     }
286
287 // interface-grouping insert - end;
288
289   }
290
291 // Cross Working Group augmentation for l2vlan interfaces for VLAN definition
292
293   augment "/if:interfaces/if:interface" {
294     when "if:type = 'ianaift:l2vlan'";
295     description "augments for VLAN definition";
296     leaf base-interface {
297       type if:interface-ref;
298       must "/if:interfaces/if:interface[if:name = current()]"
299             + "/o-ran-int:vlan-tagging = 'true'" {
300         description
301           "The base interface must have VLAN tagging enabled.";
302       }
303       description
304         "The base interface for the VLAN sub-interafce.";
305     }
306     leaf vlan-id {
307       type uint16 {
308         range "1..4094";
309       }
310       description
311         "The VLAN-ID.";
312     }
313   }
314
315 // Cross Working Group augmention for both ethernetCsmacd and l2vlan interfaces
316
317   augment "/if:interfaces/if:interface" {
318     when "(if:type = 'ianaift:ethernetCsmacd') or
319           (if:type = 'ianaift:l2vlan')" {
320       description "Applies to ethernetCsmacd and l2vlan interfaces";
321     }
322     description
323       "Augment the interface model with parameters for all
324       both ethernetCsmacd and l2vlan interfaces.";
325     leaf last-cleared {
326       type yang:date-and-time;
327       config false;
328       description
329         "Timestamp of the last time the interface counters were
330         cleared.";
331     }
332   }
333
334 // Cross Working Group augmention to ietf-ip covering DSCP for M-Plane
335
336 augment "/if:interfaces/if:interface/ip:ipv4" {
337   description "augments for IPv4 based M-Plane transport";
338   leaf m-plane-marking {
339     type inet:dscp;
340     default 18;
341     description "18 represents AF21 or 'immediate traffic'";
342   }
343 }
344 augment "/if:interfaces/if:interface/ip:ipv6" {
345   description "augments for IPv6 based M-Plane transport";
346   leaf m-plane-marking {
347     type inet:dscp;
348     default 18;
349     description "18 represents AF21 or 'immediate traffic'";
350   }
351 }
352
353 // WG4 Specific Augmentations Follow
354
355 // WG4 Augmentation for basic Ethernet leafs
356
357   augment "/if:interfaces/if:interface" {
358     if-feature ALIASMAC-BASED-CU-PLANE;
359     when "if:type = 'ianaift:ethernetCsmacd'" {
360       description
361         "Applies to WG4 Ethernet interfaces for alias MAC based CU-Plane";
362     }
363     description
364       "Augment the interface model with parameters for
365       base Ethernet interface";
366
367     leaf-list alias-macs {
368       type yang:mac-address;
369
370       description
371         "Augments interfaces with range of alias MAC addresses.";
372     }
373
374   }
375
376 // WG4 Augmention for both ethernetCsmacd and l2vlan interfaces
377
378   augment "/if:interfaces/if:interface" {
379     when "(if:type = 'ianaift:ethernetCsmacd') or
380           (if:type = 'ianaift:l2vlan')" {
381       description "Applies to ethernetCsmacd and l2vlan interfaces";
382     }
383     description
384       "Augment the interface model with parameters for all
385       both ethernetCsmacd and l2vlan interfaces.";
386     leaf mac-address {
387       type yang:mac-address;
388
389       description
390         "The MAC address of the interface.";
391     }
392
393     container port-reference {
394       description
395         "a port reference used by other O-RAN modules";
396       leaf port-name {
397         type leafref {
398           path '/hw:hardware/hw:component/hw:name';
399         }
400         must "derived-from-or-self(deref(current())/../hw:class, 'ianahw:port')";
401 // TAKE NOTE - depending on version of pyang, this may generate various
402 // warnings, e.g., warning: XPath for "port-name" does not exist
403         description
404           "O-RAN interfaces use a reference to a physical port component.
405
406           In this case, the component name referenced must be of class type
407           port, i.e., when /hw:hardware/hw:component/hw:class is derived from
408           ianahw:port";
409       }
410       leaf port-number {
411         type uint8;
412         description
413           "A number allocated by the server which identifies a port.
414           Port number value is 0 to N-1 where N is number of ports
415           in the device.
416
417           This value is fixed for the lifetime of the equipment, i.e., cannot be
418           changed during equipment reboots.";
419       }
420     }
421   }
422
423 // WG4 specific augmention to ietf-ip covering DSCP for CUS Plane
424
425   augment "/if:interfaces/if:interface/ip:ipv4" {
426     if-feature UDPIP-BASED-CU-PLANE;
427     description "augments for IPv4 based CUS transport";
428     uses dscp-marking;
429   }
430   augment "/if:interfaces/if:interface/ip:ipv6" {
431     if-feature UDPIP-BASED-CU-PLANE;
432     description "augments for IPv6 based CUS transport";
433     uses dscp-marking;
434   }
435
436 // Other Working Group Specific Augmentations Follow Here
437
438 // interface-grouping insert - begin;
439
440   augment "/if:interfaces" {
441     description "augments interfaces for groupings of physical hardware addresses that can be used to group Ethernet ports";
442
443     container interface-grouping {
444
445       presence
446         "indicates maximum sustained throughput of an O-RU is less than the combined bandwidth of all physical ports";
447
448       config false;
449
450       description
451         "A container used by an O-RU where the maximum sustained throughput
452         of an O-RU is less than the combined bandwidth of all physical ports";
453
454       list interfaces-groups {
455         key interface-group-id;
456         description "List of interface groups.";
457
458         leaf interface-group-id {
459           type uint8;
460           description "interface group identifier.";
461         }
462
463         leaf max-sustainable-ingress-bandwidth {
464           type uint32;
465           units Mbps;
466           description
467             "Maximum sustainable ingress bandwidth the interface group can handle. The sustainable bandwidth is calculated
468             over one radio frame.
469
470             The peak ingress bandwidth may exceed the sustainable bandwidth for periods shorter than a radio frame period.";
471         }
472
473         leaf max-sustainable-egress-bandwidth {
474           type uint32;
475           units Mbps;
476           description
477             "Maximum sustainable egress bandwidth the interface group can handle. The sustainable bandwidth is calculated
478             over one radio frame.";
479         }
480       }
481     }
482   }
483 // interface-grouping insert - end;
484
485
486   rpc reset-interface-counters {
487     description
488       "Management plane triggered restart of the interface counters.";
489   }
490 }