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