Refactor folder structure.
[sim/o1-interface.git] / ntsimulator / yang / o-ran / ru-fh / o-ran-processing-element.yang
1 module o-ran-processing-element {
2   yang-version 1.1;
3   namespace "urn:o-ran:processing-element:1.0";
4   prefix "o-ran-elements";
5
6   import ietf-yang-types {
7     prefix yang;
8   }
9
10   import ietf-inet-types {
11     prefix "inet";
12   }
13
14   import ietf-interfaces {
15     prefix "if";
16   }
17
18   import ietf-ip {
19     prefix "ip";
20   }
21
22   import o-ran-interfaces {
23     prefix "o-ran-int";
24   }
25
26   organization "O-RAN Alliance";
27
28   contact
29     "www.o-ran.org";
30
31   description
32     "This module defines the YANG definitions for mapping of transport flows to
33     processing elements. Three options are supported:
34     i) virtual MAC based mapping
35     ii) MAC addrress + VLAN-ID based mapping
36     iii) UDP/IP based mapping
37
38     Copyright 2019 the O-RAN Alliance.
39
40     THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS'
41     AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
42     IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
43     ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
44     LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
45     CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
46     SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
47     INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
48     CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
49     ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
50     POSSIBILITY OF SUCH DAMAGE.
51
52     Redistribution and use in source and binary forms, with or without
53     modification, are permitted provided that the following conditions are met:
54
55     * Redistributions of source code must retain the above copyright notice,
56     this list of conditions and the above disclaimer.
57     * Redistributions in binary form must reproduce the above copyright notice,
58     this list of conditions and the above disclaimer in the documentation
59     and/or other materials provided with the distribution.
60     * Neither the Members of the O-RAN Alliance nor the names of its
61     contributors may be used to endorse or promote products derived from
62     this software without specific prior written permission.";
63
64   revision "2019-02-04" {
65     description
66       "version 1.0.0
67
68       1) imported model from xRAN
69       2) changed namespace and reference from xran to o-ran";
70
71     reference "ORAN-WG4.M.0-v01.00";
72   }
73
74 // groupings
75
76   grouping pe-group {
77     leaf transport-session-type {
78       type enumeration {
79         enum ETH-INTERFACE {
80           description "VLAN based CUS Transport ";
81         }
82         enum UDPIP-INTERFACE {
83           description "UDP/IP based CUS Transport ";
84         }
85         enum ALIASMAC-INTERFACE{
86           description "Alias MAC address based CUS Transport ";
87         }
88       }
89       default ETH-INTERFACE;
90       description
91         "the type of transport session used for identifying different processing
92         elements";
93     }
94     container enhanced-uplane-mapping {
95       presence "indicates that enhanced uplane mapping is used";
96       description "a mapping table for enhanced user plane marking";
97       list uplane-mapping {
98         key "up-marking-name";
99         description
100           "a mapping between up-link name and o-ran-interfaces:up-marking-name";
101         leaf up-marking-name {
102           type string;
103           description "a unique up marking name that is used for enhanced up marking";
104         }
105         choice up-markings {
106           description
107             "U-Plane markings";
108           case ethernet {
109             when "(../../transport-session-type = 'ALIASMAC-INTERFACE') or
110             (../../transport-session-type = 'ETH-INTERFACE')";
111             leaf up-cos-name {
112               type leafref {
113                 path "/if:interfaces/if:interface/o-ran-int:class-of-service/o-ran-int:enhanced-uplane-markings/o-ran-int:up-marking-name";
114               }
115               description "the Ethernet U-plane transport marking as defined in o-ran-interfaces";
116             }
117           }
118           case ipv4 {
119             when "(../../transport-session-type = 'UDPIP-INTERFACE')";
120             leaf upv4-dscp-name {
121               type leafref {
122                 path "/if:interfaces/if:interface/ip:ipv4/o-ran-int:diffserv-markings/o-ran-int:enhanced-uplane-markings/o-ran-int:up-marking-name";
123               }
124               description "the IPv4 U-plane transport marking as defined in o-ran-interfaces";
125             }
126           }
127           case ipv6 {
128             when "(../../transport-session-type = 'UDPIP-INTERFACE')";
129             leaf upv6-dscp-name {
130               type leafref {
131                 path "/if:interfaces/if:interface/ip:ipv6/o-ran-int:diffserv-markings/o-ran-int:enhanced-uplane-markings/o-ran-int:up-marking-name";
132               }
133               description "the IPv6 U-plane transport marking as defined in o-ran-interfaces";
134             }
135           }
136         }
137       }
138     }
139     list ru-elements {
140       key "name";
141       description
142         "the list of transport definitions for each processing element";
143       leaf name {
144         type string {
145           length "1..255";
146         }
147         description
148           "A name that is unique across the O-RU that identifies a processing
149           element instance.
150
151           This name may be used in fault management to refer to a fault source
152           or affected object";
153       }
154       container transport-flow {
155         description
156           "container for the transport-flow used for CU plane";
157         leaf interface-name {
158           type leafref {
159             path "/if:interfaces/if:interface/if:name";
160           }
161           description "the interface name ";
162         }
163         container aliasmac-flow {
164           when "../../../transport-session-type = 'ALIASMAC-INTERFACE'";
165           if-feature o-ran-int:ALIASMAC-BASED-CU-PLANE;
166           description "leafs for virtual mac type data flows";
167           leaf ru-aliasmac-address {
168             type leafref {
169               path "/if:interfaces/if:interface[if:name = current()/../../interface-name]/o-ran-int:alias-macs";
170             }
171             mandatory true;
172             description
173               "O-RU's alias MAC address used for alias MAC based flow";
174           }
175           leaf vlan-id {
176             type leafref {
177               path "/if:interfaces/if:interface[if:name = current()/../../interface-name]/o-ran-int:vlan-id";
178             }
179             description
180               "O-RU's VLAN-ID used for alias MAC based flow";
181           }
182           leaf o-du-mac-address {
183             type yang:mac-address;
184             mandatory true;
185             description
186               "O-DU's MAC address used for alias MAC based flow";
187           }
188         }
189         container eth-flow {
190           when "../../../transport-session-type = 'ETH-INTERFACE'";
191           description "leafs for mac + vlan-id type data flows";
192           leaf ru-mac-address {
193             type leafref {
194               path "/if:interfaces/if:interface[if:name = current()/../../interface-name]/o-ran-int:mac-address";
195             }
196             mandatory true;
197             description
198               "O-RU's MAC address used for Ethernet based flow";
199           }
200           leaf vlan-id {
201             type leafref {
202               path "/if:interfaces/if:interface[if:name = current()/../../interface-name]/o-ran-int:vlan-id";
203             }
204             mandatory true;
205             description
206               "O-RU's VLAN-ID used for Ethernet based flow";
207           }
208           leaf o-du-mac-address {
209             type yang:mac-address;
210             mandatory true;
211             description
212               "O-DU's MAC address used for Ethernet based flow";
213           }
214         }
215         container udpip-flow {
216           when "../../../transport-session-type = 'UDPIP-INTERFACE'";
217           description "leafs for UDP/IP type data flows";
218           choice address {
219             leaf ru-ipv4-address {
220               type leafref {
221                 path "/if:interfaces/if:interface[if:name = current()/../../interface-name]/ip:ipv4/ip:address/ip:ip";
222               }
223               description "O-RU's IPv4 address";
224             }
225             leaf ru-ipv6-address {
226               type leafref {
227                 path "/if:interfaces/if:interface[if:name = current()/../../interface-name]/ip:ipv6/ip:address/ip:ip";
228               }
229               description "O-RU's IPv6 address";
230             }
231             mandatory true;
232             description "choice of O-RU IPv4 or IPv6 address";
233           }
234           leaf o-du-ip-address {
235             type inet:ip-address;
236             mandatory true;
237             description "O-DU's IPv address";
238           }
239           leaf ru-ephemeral-udp-port {
240             type inet:port-number;
241             mandatory true;
242             description
243               "ephemeral port used by O-RU";
244           }
245           leaf o-du-ephemeral-udp-port {
246             type inet:port-number;
247             mandatory true;
248             description
249               "ephemeral port used by O-DU";
250           }
251           leaf ecpri-destination-udp {
252             type inet:port-number;
253             mandatory true;
254             description "the well known UDP port number used by eCPRI";
255             // fixme - add in a default when allocated by IANA
256           }
257         }
258       }
259     }
260   }
261
262 // top level container
263
264   container processing-elements {
265     description
266       "a model defining the mapping between transport flows and arbitrary
267       O-RAN processing elements. A processing element may be then defined for
268       handling connectivity or delay procedures, or defined with a corresponding
269       eaxcid for CU plane operations";
270     uses pe-group;
271   }
272 }