Refactor folder structure.
[sim/o1-interface.git] / ntsimulator / yang / x-ran / xran-processing-element.yang
1 module xran-processing-element {
2   yang-version 1.1;
3   namespace "urn:xran:processing-element:1.0";
4   prefix "xran-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 xran-interfaces {
23     prefix "xran-int";
24   }
25
26   organization "xRAN Forum";
27
28   contact
29     "www.xran.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 2018 the xRAN Forum.
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 xRAN Forum 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 "2018-07-20" {
65     description
66       "version 1.0.0 - First release of the xRAN YANG M-Plane models.
67
68       This version of the model supports v01.00 of the corrsponding xRAN
69       M-Plane Specification.";
70     reference "XRAN-FH.MP.0-v01.00";
71   }
72
73   identity XRAN-INTERFACE-TYPE {
74     base if:interface-type;
75     description
76       "This identity is used as a base for all interface types
77        defined by xRAN.";
78   }
79
80   identity ALIASMAC-INTERFACE {
81     base XRAN-INTERFACE-TYPE;
82     description
83       "Identity type for alias MAC based CU plane interface,
84       whwere multiple MAC addresses are used on the same Ethernet interface. ";
85   }
86
87   identity ETH-INTERFACE {
88     base XRAN-INTERFACE-TYPE;
89     description
90       "identity type for ethernet plus vlan based CU plane interface. ";
91   }
92
93   identity UDPIP-INTERFACE {
94     base XRAN-INTERFACE-TYPE;
95     description
96       "identity type for UDP/IP based CU plane interface. ";
97   }
98
99   container processing-elements {
100     description
101       "a model defining the mapping between transport flows and arbitrary
102       xRAN processing elements. A processing element may be then defined for
103       handling connectivity or delay procedures, or defined with a corresponding
104       eaxcid for CU plane operations";
105     leaf transport-session-type {
106       type identityref {
107         base XRAN-INTERFACE-TYPE;
108       }
109       description
110         "the type of transport session used for identifying different processing
111         elements";
112     }
113     list ru-elements {
114       key "name";
115       description
116         "the list of transport definitions for each processing element";
117       leaf name {
118         type string {
119           length "1..255";
120         }
121         description
122           "A name that is unique across the RU that identifies a processing
123           element instance.
124
125           This name may be used in fault management to refer to a fault source
126           or affected object";
127       }
128       container transport-flow {
129         description
130           "container for the transport-flow used for CU plane";
131         leaf interface-name {
132           type leafref {
133             path "/if:interfaces/if:interface/if:name";
134           }
135           description "the interface name ";
136         }
137         container aliasmac-flow {
138           when "derived-from(../../../transport-session-type, 'ALIASMAC-INTERFACE')";
139           if-feature xran-int:ALIASMAC-BASED-CU-PLANE;
140           description "leafs for virtual mac type data flows";
141           leaf ru-aliasmac-address {
142             type leafref {
143               path "/if:interfaces/if:interface[if:name = current()/../../interface-name]/xran-int:alias-macs";
144             }
145             config false;
146             mandatory true;
147             description
148               "RU's alias MAC address used for alias MAC based flow";
149           }
150           leaf vlan-id {
151             type leafref {
152               path "/if:interfaces/if:interface[if:name = current()/../../interface-name]/xran-int:vlan-id";
153             }
154             description
155               "RU's VLAN-ID used for alias MAC based flow";
156           }
157           leaf llscu-mac-address {
158             type yang:mac-address;
159             mandatory true;
160             description
161               "lls-CU's MAC address used for alias MAC based flow";
162           }
163         }
164         container eth-flow {
165           when "derived-from(../../../transport-session-type, 'ETH-INTERFACE')";
166           description "leafs for mac + vlan-id type data flows";
167           leaf ru-mac-address {
168             type leafref {
169               path "/if:interfaces/if:interface[if:name = current()/../../interface-name]/xran-int:mac-address";
170             }
171             mandatory true;
172             description
173               "RU's MAC address used for Ethernet based flow";
174           }
175           leaf vlan-id {
176             type leafref {
177               path "/if:interfaces/if:interface[if:name = current()/../../interface-name]/xran-int:vlan-id";
178             }
179             mandatory true;
180             description
181               "RU's VLAN-ID used for Ethernet based flow";
182           }
183           leaf llscu-mac-address {
184             type yang:mac-address;
185             mandatory true;
186             description
187               "lls-CU's MAC address used for alias MAC based flow";
188           }
189         }
190         container udpip-flow {
191           when "derived-from(../../../transport-session-type, 'UDPIP-INTERFACE')";
192           if-feature xran-int:UDPIP-BASED-CU-PLANE;
193           description "leafs for UDP/IP type data flows";
194           choice address {
195             leaf ru-ipv4-address {
196               type leafref {
197                 path "/if:interfaces/if:interface[if:name = current()/../../interface-name]/ip:ipv4/ip:address/ip:ip";
198               }
199               description "RU's IPv4 address";
200             }
201             leaf ru-ipv6-address {
202               type leafref {
203                 path "/if:interfaces/if:interface[if:name = current()/../../interface-name]/ip:ipv6/ip:address/ip:ip";
204               }
205               description "RU's IPv6 address";
206             }
207             mandatory true;
208             description "choice of RU IPv4 or IPv6 address";
209           }
210           leaf llscu-ip-address {
211             type inet:ip-address;
212             mandatory true;
213             description "lls-CU's IPv address";
214           }
215           leaf ru-ephemeral-udp-port {
216             type inet:port-number;
217             mandatory true;
218             description
219               "ephemeral port used by RU";
220           }
221           leaf llscu-ephemeral-udp-port {
222             type inet:port-number;
223             mandatory true;
224             description
225               "ephemeral port used by lls-CU";
226           }
227           leaf destination-udp {
228             type inet:port-number;
229             mandatory true;
230             description "the well known UDP port number used by eCPRI";
231             // fixme - add in a default when allocated by IANA
232           }
233         }
234       }
235     }
236   }
237 }