Support of WG4 OpenFronthaul Management-Plane VES
[scp/oam/modeling.git] / data-model / yang / published / o-ran / ru-fh / o-ran-interfaces@2021-12-01.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 managing the O-RAN
42      interfaces.
43
44     Copyright 2021 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 "2021-12-01" {
71     description
72       "version 5.2.0
73
74       1) typographical corrections in descriptions.";
75
76     reference "ORAN-WG4.M.0-v05.00";
77   }
78
79   revision "2021-03-22" {
80     description
81       "version 5.1.0
82
83       1) typographical corrections in descriptions.";
84
85     reference "ORAN-WG4.M.0-v05.00";
86   }
87
88   revision "2020-12-10" {
89     description
90       "version 5.0.0
91
92       1) new functionality to describe over subscribed resources";
93
94     reference "ORAN-WG4.M.0-v05.00";
95   }
96
97   revision "2020-04-17" {
98     description
99       "version 1.2.0
100
101       1) updated descriptions to clarify operation when vlan-tagging is false";
102
103     reference "ORAN-WG4.M.0-v03.00";
104   }
105   revision "2019-07-03" {
106     description
107       "version 1.1.0
108
109       1) increasing max elements for user plane DSCP markings to 64
110       2) re-organizing layout to facilitate cross-WG adoption, whilst ensuring
111       nodes are syntactically and semantically equivalent";
112
113     reference "ORAN-WG4.M.0-v01.00";
114   }
115
116   revision "2019-02-04" {
117     description
118       "version 1.0.0
119
120       1) imported model from xRAN
121       2) changed namespace and reference from xran to o-ran";
122
123     reference "ORAN-WG4.M.0-v01.00";
124   }
125
126   feature UDPIP-BASED-CU-PLANE {
127     description
128       "This feature indicates that the RU supports the UDP/IP based transport
129       for the CU plane.";
130   }
131
132   feature ALIASMAC-BASED-CU-PLANE {
133     description
134       "This feature indicates that the RU supports the alias MAC address
135        based transport for the CU plane.";
136   }
137
138   typedef pcp {
139     type uint8 {
140       range "0..7";
141     }
142     description
143       "Priority Code Point. PCP is a 3-bit field that refers to the
144       class of service applied to a VLAN tagged frame.  The
145       field specifies a priority value between 0 and 7, these values
146       can be used by quality of service (QoS) to prioritize
147       different classes of traffic.";
148     reference
149      "IEEE 802.1Q-2014: Virtual Bridged Local Area Networks";
150   }
151
152   grouping cos-marking {
153     description
154       "Configuration data for CU Plane ethernet CoS marking.
155       This grouping is only applicable to an interface when vlan-tagging is
156       set to TRUE for that interface. In other cases, it may be ignored.";
157     container class-of-service {
158       description
159         "CoS Configuration";
160       leaf u-plane-marking {
161         type pcp;
162         default 7;
163         description
164           "Marking used for default u-plane flows.
165           7 represents highest priority for u-plane marking";
166       }
167       leaf c-plane-marking {
168         type pcp;
169         default 7;
170         description "7 represents highest priority for c-plane marking";
171       }
172       leaf m-plane-marking {
173         type pcp;
174         default 2;
175         description "2 represents highest excellent effort for m-plane marking";
176       }
177       leaf s-plane-marking {
178         type pcp;
179         default 7;
180         description "7 represents highest priority for s-plane marking";
181       }
182       leaf other-marking {
183         type pcp;
184         default 1;
185         description "1 represents best effort for other marking";
186       }
187       list enhanced-uplane-markings{
188         key "up-marking-name";
189         max-elements 4;
190         description
191           "list of mappings for enhanced (non-default) u-plane markings";
192         leaf up-marking-name {
193           type string;
194           description "The name of the marking";
195         }
196         leaf enhanced-marking {
197           type pcp;
198           description "the enhanced u-plane marking";
199         }
200       }
201     }
202   }
203
204   grouping dscp-marking {
205     description
206       "Configuration data for CU Plane DSCP marking";
207     container diffserv-markings {
208       description
209         "DSCP Configuration";
210       leaf u-plane-marking {
211         type inet:dscp;
212         default 46;
213         description
214           "Marking used for default u-plane flows.
215           46 represents expedited forwarding";
216       }
217       leaf c-plane-marking {
218         type inet:dscp;
219         default 46;
220         description "46 represents expedited forwarding";
221       }
222       leaf s-plane-marking {
223         type inet:dscp;
224         default 46;
225         description "46 represents expedited forwarding";
226       }
227       leaf other-marking {
228         type inet:dscp;
229         default 0;
230         description "0 represents best effort forwarding";
231       }
232       list enhanced-uplane-markings{
233         key up-marking-name;
234         max-elements 64;
235         description
236           "list of mappings for enhanced (non-default) u-plane markings";
237         leaf up-marking-name {
238           type string;
239           description "The name of the marking";
240         }
241         leaf enhanced-marking {
242           type inet:dscp;
243           description "the enhanced u-plane marking";
244         }
245       }
246     }
247   }
248
249   rpc reset-interface-counters {
250     description
251       "Management plane triggered restart of the interface counters.";
252   }
253
254 // Cross Working Group Augmentations Follow
255
256 // Cross Working Group augmentations for basic Ethernet leafs
257
258   augment "/if:interfaces/if:interface" {
259     when "if:type = 'ianaift:ethernetCsmacd'" {
260       description "Applies to Ethernet interfaces";
261     }
262     description
263       "Augment the interface model with parameters for
264       base Ethernet interface";
265
266     leaf l2-mtu {
267       type uint16 {
268         range "64 .. 65535";
269       }
270       units bytes;
271       default 1500;
272       description
273         "The maximum size of layer 2 frames that may be transmitted
274         or received on the interface (excluding any FCS overhead).
275         For Ethernet interfaces it also excludes the
276         4-8 byte overhead of any known (i.e. explicitly matched by
277         a child sub-interface) 801.1Q VLAN tags.";
278     }
279     leaf vlan-tagging {
280       type boolean;
281       default true;
282       description
283         "Indicates if VLAN tagging is used.
284         Default true is used to enable equipment to autonomously discover that
285         it is connected to a trunk port.
286
287         This may be set to false, for example, when the O-RU is directly
288         connected to the O-DU. In such cases, native Ethernet frames may be
289         used across the O-RAN interface, i.e., any PCP markings defined
290         in the cos-markings grouping are NOT used by the O-RU and any default
291         value or configured value using those leafs may be ignored by the O-RAN
292         equipment.";
293     }
294     uses cos-marking;
295
296 // interface-grouping insert - begin;
297
298     leaf-list interface-groups-id {
299       type leafref {
300         path "/if:interfaces/o-ran-int:interface-grouping/o-ran-int:interfaces-groups/o-ran-int:interface-group-id";
301       }
302       config false;
303       description
304         "an optional leaf used when the sustained rate able to be supported by an interface
305         is less than nominal bit rate indicated by o-ran-transceiver.yang
306
307         Identifies interface grouping particular physical hardware MAC address belongs to.";
308     }
309
310 // interface-grouping insert - end;
311
312   }
313
314 // Cross Working Group augmentation for l2vlan interfaces for VLAN definition
315
316   augment "/if:interfaces/if:interface" {
317     when "if:type = 'ianaift:l2vlan'";
318     description "augments for VLAN definition";
319     leaf base-interface {
320       type if:interface-ref;
321       must "/if:interfaces/if:interface[if:name = current()]"
322             + "/o-ran-int:vlan-tagging = 'true'" {
323         description
324           "The base interface must have VLAN tagging enabled.";
325       }
326       description
327         "The base interface for the VLAN sub-interface.";
328     }
329     leaf vlan-id {
330       type uint16 {
331         range "1..4094";
332       }
333       description
334         "The VLAN-ID.";
335     }
336   }
337
338 // Cross Working Group augmentation for both ethernetCsmacd and l2vlan interfaces
339
340   augment "/if:interfaces/if:interface" {
341     when "(if:type = 'ianaift:ethernetCsmacd') or
342           (if:type = 'ianaift:l2vlan')" {
343       description "Applies to ethernetCsmacd and l2vlan interfaces";
344     }
345     description
346       "Augment the interface model with parameters for all
347       both ethernetCsmacd and l2vlan interfaces.";
348     leaf last-cleared {
349       type yang:date-and-time;
350       config false;
351       description
352         "Timestamp of the last time the interface counters were
353         cleared.";
354     }
355   }
356
357 // Cross Working Group augmentation to ietf-ip covering DSCP for M-Plane
358
359 augment "/if:interfaces/if:interface/ip:ipv4" {
360   description "augments for IPv4 based M-Plane transport";
361   leaf m-plane-marking {
362     type inet:dscp;
363     default 18;
364     description "18 represents AF21 or 'immediate traffic'";
365   }
366 }
367 augment "/if:interfaces/if:interface/ip:ipv6" {
368   description "augments for IPv6 based M-Plane transport";
369   leaf m-plane-marking {
370     type inet:dscp;
371     default 18;
372     description "18 represents AF21 or 'immediate traffic'";
373   }
374 }
375
376 // WG4 Specific Augmentations Follow
377
378 // WG4 Augmentation for basic Ethernet leafs
379
380   augment "/if:interfaces/if:interface" {
381     when "if:type = 'ianaift:ethernetCsmacd'" {
382       description
383         "Applies to WG4 Ethernet interfaces for alias MAC based CU-Plane";
384     }
385     if-feature ALIASMAC-BASED-CU-PLANE;
386     description
387       "Augment the interface model with parameters for
388       base Ethernet interface";
389
390     leaf-list alias-macs {
391       type yang:mac-address;
392
393       description
394         "Augments interfaces with range of alias MAC addresses.";
395     }
396
397   }
398
399 // WG4 Augmentation for both ethernetCsmacd and l2vlan interfaces
400
401   augment "/if:interfaces/if:interface" {
402     when "(if:type = 'ianaift:ethernetCsmacd') or
403           (if:type = 'ianaift:l2vlan')" {
404       description "Applies to ethernetCsmacd and l2vlan interfaces";
405     }
406     description
407       "Augment the interface model with parameters for all
408       both ethernetCsmacd and l2vlan interfaces.";
409     leaf mac-address {
410       type yang:mac-address;
411
412       description
413         "The MAC address of the interface.";
414     }
415
416     container port-reference {
417       description
418         "a port reference used by other O-RAN modules";
419       leaf port-name {
420         type leafref {
421           path '/hw:hardware/hw:component/hw:name';
422         }
423         must "derived-from-or-self(deref(current())/../hw:class, 'ianahw:port')";
424 // TAKE NOTE - depending on version of pyang, this may generate various
425 // warnings, e.g., warning: XPath for "port-name" does not exist
426         description
427           "O-RAN interfaces use a reference to a physical port component.
428
429           In this case, the component name referenced must be of class type
430           port, i.e., when /hw:hardware/hw:component/hw:class is derived from
431           ianahw:port";
432       }
433       leaf port-number {
434         type uint8;
435         description
436           "A number allocated by the server which identifies a port.
437           Port number value is 0 to N-1 where N is number of ports
438           in the device.
439
440           This value is fixed for the lifetime of the equipment, i.e., cannot be
441           changed during equipment reboots.";
442       }
443     }
444   }
445
446 // WG4 specific augmentation to ietf-ip covering DSCP for CUS Plane
447
448   augment "/if:interfaces/if:interface/ip:ipv4" {
449     if-feature UDPIP-BASED-CU-PLANE;
450     description "augments for IPv4 based CUS transport";
451     uses dscp-marking;
452   }
453   augment "/if:interfaces/if:interface/ip:ipv6" {
454     if-feature UDPIP-BASED-CU-PLANE;
455     description "augments for IPv6 based CUS transport";
456     uses dscp-marking;
457   }
458
459 // Other Working Group Specific Augmentations Follow Here
460
461 // interface-grouping insert - begin;
462
463   augment "/if:interfaces" {
464     description "augments interfaces for groupings of physical hardware addresses that can be used to group Ethernet ports";
465
466     container interface-grouping {
467
468       presence
469         "indicates maximum sustained throughput of an O-RU is less than the combined bandwidth of all physical ports";
470
471       config false;
472
473       description
474         "A container used by an O-RU where the maximum sustained throughput
475         of an O-RU is less than the combined bandwidth of all physical ports";
476
477       list interfaces-groups {
478         key interface-group-id;
479         description "List of interface groups.";
480
481         leaf interface-group-id {
482           type uint8;
483           description "interface group identifier.";
484         }
485
486         leaf max-sustainable-ingress-bandwidth {
487           type uint32;
488           units Mbps;
489           description
490             "Maximum sustainable ingress bandwidth the interface group can handle. The sustainable bandwidth is calculated
491             over one radio frame.
492
493             The peak ingress bandwidth may exceed the sustainable bandwidth for periods shorter than a radio frame period.";
494         }
495
496         leaf max-sustainable-egress-bandwidth {
497           type uint32;
498           units Mbps;
499           description
500             "Maximum sustainable egress bandwidth the interface group can handle. The sustainable bandwidth is calculated
501             over one radio frame.";
502         }
503       }
504     }
505   }
506 // interface-grouping insert - end;
507
508 }