Change artifact groupId
[scp/oam/modeling.git] / data-model / yang / published / xran / xran-sync.yang
1 module xran-sync {
2   yang-version 1.1;
3   namespace "urn:xran:sync:1.0";
4   prefix "xran-sync";
5
6
7   organization "xRAN Forum";
8
9   contact
10     "www.xran.org";
11
12   description
13     "This module defines synchronization mechanism for the xRAN Radio Unit.
14
15     Copyright 2018 the xRAN Forum.
16
17     THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS'
18     AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19     IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20     ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
21     LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22     CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23     SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24     INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25     CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26     ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27     POSSIBILITY OF SUCH DAMAGE.
28
29     Redistribution and use in source and binary forms, with or without
30     modification, are permitted provided that the following conditions are met:
31
32     * Redistributions of source code must retain the above copyright notice,
33     this list of conditions and the above disclaimer.
34     * Redistributions in binary form must reproduce the above copyright notice,
35     this list of conditions and the above disclaimer in the documentation
36     and/or other materials provided with the distribution.
37     * Neither the Members of the xRAN Forum nor the names of its
38     contributors may be used to endorse or promote products derived from
39     this software without specific prior written permission.";
40
41   revision "2018-07-20" {
42     description
43       "version 1.0.0 - First release of the xRAN YANG M-Plane models.
44
45       This version of the model supports v01.00 of the corrsponding xRAN
46       M-Plane Specification.";
47     reference "XRAN-FH.MP.0-v01.00";
48   }
49
50   typedef geographic-coordinate-degree {
51            type decimal64 {
52              fraction-digits 8;
53            }
54            description
55              "Decimal degree (DD) used to express latitude and longitude
56               geographic coordinates.";
57        }
58
59   feature GNSS {
60     description
61       "This feature indicates that the RU supports integrated GNSS functionality.";
62   }
63
64   container sync {
65     description
66       "Main containter for sync related parameters";
67
68     container sync-status {
69       config false;
70
71       description
72         "Object of this class provides synchronization state of the module.";
73
74       leaf sync-state {
75         type enumeration {
76           enum LOCKED {
77             description
78               "RU is in the locked mode, as defined in ITU-T G.810";
79           }
80           enum HOLDOVER {
81             description
82               "RU clock is in holdover mode";
83           }
84           enum FREERUN {
85             description
86               "RU clock isn’t locked to an input reference, and is not in the holdover mode";
87           }
88         }
89         mandatory true;
90         description
91           "State of DU synchronization";
92       }
93
94       list supported-reference-types {
95         key item;
96         min-elements 1;
97         description
98           "Type of a synchronization supported source.";
99         leaf item {
100           type enumeration {
101             enum GNSS {
102               description
103                 "GPS can be taken as a synchronization source";
104             }
105             enum PTP {
106               description
107                 "Precision Time Protocol can be taken as a synchronization source";
108             }
109             enum SYNCE {
110               description
111                 "Synchronous Ethernet can be taken as a synchronization source";
112             }
113           }
114           mandatory true;
115
116           description
117             "supported reference-type";
118         }
119       }
120     }
121
122     container sync-capability {
123       config false;
124
125       description
126         "Object of this class provides synchronization capabilities of the module.";
127
128       leaf sync-t-tsc {
129         type enumeration {
130           enum STANDARD {
131             description
132               "Standard accuracy for synchronization is supported by the device";
133           }
134           enum ENCHANCED {
135             description
136               "Enchanced accuracy for synchronization is supported by the device";
137           }
138         }
139         mandatory true;
140         description
141           "This will provide information about T-TSC capability";
142
143         reference "T-TSC: ITU-T G.8275.1/Y.1369.1";
144       }
145     }
146
147     container ptp-config {
148       description
149         "This MO defines configuration of Precise Time Protocol.";
150       leaf domain-number {
151         type uint8;
152         default 24;
153         description
154           "This parameter indicates Domain Number for PTP announce messages.";
155       }
156
157       leaf multicast-mac-address {
158         type enumeration {
159           enum FORWARDABLE {
160             description
161               "means, that PTP shall use 01-80-C2-00-00-0E destination MAC address";
162           }
163           enum NONFORWARDABLE {
164             description
165               "means, that PTP shall use 01-1B-19-00-00-00 destination MAC address";
166           }
167         }
168         default FORWARDABLE;
169         description
170           "The parameter defines destination MAC address, used by the DU in the egress PTP messages.";
171       }
172
173       list accepted-clock-classes {
174         key clock-classes;
175         leaf clock-classes {
176           type uint8;
177           description
178             "PTP Clock Class accepted by the RU";
179         }
180         description
181           "Contains list of PTP acceptable Clock Classes, sorted in the descending order.";
182       }
183
184       leaf delay-asymmetry {
185         type int16 {
186           range -10000..10000;
187         }
188         default 0;
189         description
190           "Defines static phase error in the recovered PTP timing signal to be compensated at the RU.
191           The error is defined in units of nanoseconds in the range Â±10 000 ns.";
192       }
193     }
194
195     container ptp-status {
196       description
197         "ptp status container";
198       leaf reporting-period {
199         type uint8;
200         default 10;
201         description
202           "This parameter defines minimum period in seconds between reports,
203           sent by the NETCONF Client, for parameters in this container.";
204       }
205       leaf lock-state {
206         type enumeration {
207           enum LOCKED {
208             description
209               "The integrated ordinary clock is synchronizing to the reference, recovered from PTP flow";
210           }
211           enum UNLOCKED {
212             description
213               "The integrated ordinary clock is not synchronizing to the reference, recovered from PTP flow";
214           }
215         }
216         config false;
217         description
218           "This parameter indicates, whether the integrated ordinary clock is
219           synchronizing to the reference, recovered from PTP signal.
220           The exact definition when to indicate locked or unlocked is up to specific
221           implementation.";
222       }
223
224       leaf clock-class {
225         type uint8;
226         config false;
227         description
228           "This parameter contains the clock class of the clock, controlled by the RU";
229       }
230
231       leaf clock-identity {
232         type string {
233           length 18;
234           pattern "0[xX][0-9a-fA-F]";
235         }
236         config false;
237         description
238           "This parameter contains identity of the clock,
239             according to IEEE 1588-2008 defintion, controlled by the RU.
240           The string shall be formatted as an 8-octet hex value with the â€ś0x” prefix.";
241       }
242
243           leaf partial-timing-supported {
244             type boolean;
245
246                 description
247                   "Provides information wheter G.8275.2 (partial timing support from network) is supported.";
248           }
249
250       list sources {
251         key local-port-number;
252         config false;
253
254         description
255           "Synchronisation sources";
256
257         leaf local-port-number {
258           type uint16;
259       // fixme - change to a leafref once interface design is agreed
260           description
261             "This is reference to portNumber of ExternalEthernetPort to identify the port,
262             where the PTP signal is located.";
263         }
264
265         leaf state {
266           type enumeration {
267             enum PARENT {
268               description
269                 "Indicates that this source is the current master clock, i.e. the clock,
270                 which the clock, controlled by the Netconf Server, is synchronized to";
271             }
272             enum OK {
273               description
274                 "Indicates that this source is an alternate master, which the clock,
275                 controlled by the Netconf Server, can potentially synchronize to,
276                 i.e. clock class and priority, announced by the master clock is lower,
277                 compared to those of the clock, controlled by the Netconf Server,
278                 and and the clock class is accepted";
279             }
280             enum NOK {
281               description
282                 "Indicates that this source is an alternate master, which the clock,
283                 controlled by the Netconf Server, has an operational connection to,
284                 but the class or priority of the master clock is higher or equal
285                 to those of the clock, controlled by the Netconf Server,
286                 or the clock class is not accepted";
287             }
288             enum DISABLED {
289               description
290                 "Indicates that this source is an alternate master, which the clock,
291                 controlled by the Netconf Server, has no operational connection to";
292             }
293           }
294           description
295             "This parameter indicates status of the PTP source";
296         }
297
298         leaf two-step-flag {
299           type boolean;
300           description
301             "This parameter reflects status of the twoStepFlag attribute in Sync messages,
302             received from the PTP source.";
303         }
304
305         leaf leap61 {
306           type boolean;
307           description
308             "This parameter reflects status of the leap61 flag in Announce messages,
309             received from the PTP source.
310             When true, the last minute of the current UTC day contains 61 seconds.";
311         }
312
313         leaf leap59 {
314           type boolean;
315           description
316             "This parameter reflects status of the leap59 flag in Announce messages,
317             received from the PTP source.
318             When true, the last minute of the current UTC day contains 59 seconds.";
319         }
320
321         leaf current-utc-offset-valid {
322           type boolean;
323           description
324             "This parameter reflects status of the currentUtcOffsetValid flag in
325             Announce messages, received from the PTP source.
326             When true, the current UTC offset is valid.";
327         }
328
329         leaf ptp-timescale {
330           type boolean;
331           description
332             "This parameter reflects status of the ptpTimescale flag in Announce
333             messages, received from the PTP source.
334
335             When set, the clock timescale of the grandmaster clock is PTP;
336             otherwise, the timescale is ARB (arbitrary)";
337         }
338
339         leaf time-traceable {
340           type boolean;
341           description
342             "This parameter reflects status of the timeTraceable flag in Announce
343             messages, received from the PTP source.
344
345             When true, the timescale and the currentUtcOffset are traceable to a
346             primary reference";
347         }
348
349         leaf frequency-traceable {
350           type boolean;
351           description
352             "This parameter reflects status of the frequencyTraceable flag in
353             Announce messages, received from the PTP source.
354
355             When true, the frequency determining the timescale is traceable to a
356             primary reference";
357         }
358
359         leaf source-clock-identity {
360           type string {
361             length 18;
362             pattern "0[xX][0-9a-fA-F]";
363           }
364           description
365             "This parameter reflects value of the sourceClockIdentity attribute in
366             Announce messages, received from the PTP source.
367
368             The string shall be formatted as an 8-octet hex value with the â€ś0x”
369             prefix.";
370         }
371
372         leaf source-port-number {
373           type uint16;
374           description
375             "This parameter reflects value of the sourcePortNumber attribute in
376             Announce messages, received from the PTP source.";
377         }
378
379         leaf current-utc-offset {
380           type int16;
381           description
382             "The offset between TAI and UTC when the epoch of the PTP system is
383             the PTP epoch, i.e., when ptp-timescale is TRUE; otherwise, the value
384             has no meaning";
385         }
386
387         leaf priority1 {
388           type int8;
389           description
390             "This parameter reflects value of the priority1 attribute in Announce
391             messages, received from the PTP source.";
392         }
393
394         leaf clock-class {
395           type int8;
396           description
397             "This parameter reflects value of the clockClass attribute in
398             Announce messages, received from the PTP source.";
399         }
400
401         leaf clock-accuracy {
402           type int8;
403           description
404             "This parameter reflects value of the clockAccuracy attribute in
405             Announce messages, received from the PTP source.";
406         }
407
408         leaf offset-scaled-log-variance {
409           type uint16;
410           description
411             "This parameter reflects value of the offsetScaledLogVariance
412             attribute in Announce messages, received from the PTP source.";
413         }
414
415         leaf priority2 {
416           type uint8;
417           description
418             "This parameter reflects value of the priority2 attribute in Announce
419             messages, received from the PTP source.";
420         }
421
422         leaf grandmaster-clock-identity {
423           type string;
424           description
425             "This parameter reflects value of the grandmasterClockIdentity
426             attribute in Announce messages, received from the PTP source.
427
428             The string shall be formatted as an 8-octet hex value with the â€ś0x”
429             prefix.";
430         }
431
432         leaf steps-removed {
433           type uint16;
434           description
435             "This parameter reflects value of the stepsRemoved attribute in
436             Announce messages, received from the PTP source.
437
438             It indicates the number of communication paths traversed
439             between the local clock and the grandmaster clock.";
440         }
441
442         leaf time-source {
443           type uint8;
444           description
445             "This parameter reflects value of the timeSource attribute in
446             Announce messages, received from the PTP source.";
447         }
448       }
449     }
450
451     container synce-status {
452       description
453         "SyncE status container";
454
455       leaf reporting-period {
456           type uint8;
457           default 10;
458           description
459             "This parameter defines minimum period in seconds between reports,
460              sent by the NETCONF client, for parameters in this container.";
461       }
462
463       leaf lock-state {
464         type enumeration {
465           enum LOCKED {
466             description
467               "The integrated ordinary clock is synchronizing to the reference, recovered from SyncE signal";
468           }
469           enum UNLOCKED {
470             description
471               "The integrated ordinary clock is not synchronizing to the reference, recovered from SyncE signal";
472           }
473         }
474         config false;
475         description
476           "This parameter indicates, whether the integrated ordinary clock is
477           synchronizing to the reference, recovered from SyncE signal.
478
479           The exact definition when to indicate locked or unlocked is up to
480           specific implementation.";
481       }
482
483       list sources {
484         key local-port-number;
485         config false;
486         leaf local-port-number {
487           type uint16;
488       //fixme - change to leafref once interfaces ae agreed
489           description
490             "This is reference to portNumber of ExternalEthernetPort to identify
491             the port, where the SyncE signal is located.";
492         }
493
494         leaf state {
495           type enumeration {
496             enum PARENT {
497               description
498                 "Indicates that this source is the current master clock, i.e. the clock,
499                 which the clock, controlled by the Netconf Server, is synchronized to";
500             }
501             enum OK {
502               description
503                 "Indicates that this source is an alternate master, which the clock,
504                 controlled by the Netconf Server, can potentially synchronize to,
505                 i.e. clock class and priority, announced by the master clock is lower,
506                 compared to those of the clock, controlled by the Netconf Server,
507                 and and the clock class is accepted";
508             }
509             enum NOK {
510               description
511                 "Indicates that this source is an alternate master, which the clock,
512                 controlled by the Netconf Server, has an operational connection to,
513                 but the class or priority of the master clock is higher or equal
514                 to those of the clock, controlled by the Netconf Server,
515                 or the clock class is not accepted";
516             }
517             enum DISABLED {
518               description
519                 "Indicates that this source is an alternate master, which the clock,
520                 controlled by the Netconf Server, has no operational connection to";
521             }
522           }
523           description
524             "This parameter indicates status of the SyncE source";
525         }
526
527         leaf quality-level {
528           type uint8 {
529             range 0..15;
530           }
531           description
532             "This parameter contains value of the SSM clock quality level,
533             received in SSM messages from the SyncE source.";
534         }
535         min-elements 1;
536         description
537           "This parameter contains characteristics of SyncE sources of the clock, controlled by the RU.";
538       }
539     }
540     container gnss-state {
541       if-feature GNSS;
542       config false;
543       description
544         "Provides information about state of gps receiver";
545       leaf name {
546         type string {
547           length "1..255";
548         }
549         description
550         "A name that is unique across the RU that identifies a GNSS instance.
551         This name may be used in fault management to refer to a
552         fault source or affected object";
553       }
554       leaf gnss-status {
555         type enumeration {
556           enum SYNCHRONIZED {
557             description "GNSS functionality is synchronized";
558           }
559           enum ACQUIRING-SYNC {
560             description "GNSS functionality is acquiring sync";
561           }
562           enum ANTENNA-DISCONNECTED {
563             description "GNSS functionality has its antenna disconnected";
564           }
565           enum BOOTING {
566             description "GNSS functionality is booting";
567           }
568           enum ANTENNA-SHORT-CIRCUIT {
569             description "GNSS functionality has an antenna short circuit";
570           }
571         }
572         description "when available, indicates the status of the gnss receiver.";
573       }
574       container gnss-data {
575         when "../gnss-status='SYNCHRONIZED'";
576         description
577           "GPS data contained";
578         leaf satellites-tracked {
579           type uint8;
580           description "Number of satellites tracked";
581         }
582         container location {
583           description
584             "Containes information about geo location";
585           leaf altitude {
586             type int64;
587             units millimeter;
588             description
589               "Distance above the sea level.";
590           }
591           leaf latitude {
592             type geographic-coordinate-degree {
593               range "-90..90";
594             }
595             description
596               "Relative position north or south on the Earth's surface.";
597           }
598           leaf longitude {
599             type geographic-coordinate-degree {
600               range "-180..180";
601             }
602             description
603               "Angular distance east or west on the Earth's surface.";
604           }
605         }
606       }
607     }
608   }
609
610   //notification statement
611   notification synchronization-state-change {
612     description
613           "Notification used to inform about synchronization state change";
614
615     leaf sync-state {
616       type leafref {
617         path "/sync/sync-status/sync-state";
618       }
619       description
620         "State of RU synchronization is notified at state change";
621     }
622   }
623
624   notification ptp-state-change {
625     description
626           "Notification used to inform about ptp synchronization state change";
627
628     leaf ptp-state{
629       type leafref{
630         path "/sync/ptp-status/lock-state";
631       }
632       description
633         "ptp-state-change notification is signalled from RU at state change";
634     }
635   }
636   notification synce-state-change {
637     description
638           "Notification used to inform about synce synchronization state change";
639
640     leaf synce-state{
641       type leafref{
642         path "/sync/synce-status/lock-state";
643       }
644       description
645         "synce-state change notification is signalled from RU at state change";
646     }
647   }
648   notification gnss-state-change {
649     if-feature GNSS;
650     description
651           "Notification used to inform about gnss synchronization state change";
652
653     leaf gnss-state{
654       type leafref{
655         path "/sync/gnss-state/gnss-status";
656       }
657       description
658         "gnss-state-change notification is signalled from RU at state change";
659     }
660   }
661
662 }