Refactor folder structure.
[sim/o1-interface.git] / ntsimulator / yang / o-ran / ru-fh / o-ran-sync.yang
1 module o-ran-sync {
2   yang-version 1.1;
3   namespace "urn:o-ran:sync:1.0";
4   prefix "o-ran-sync";
5
6   import ietf-interfaces {
7     prefix "if";
8   }
9
10   import o-ran-interfaces {
11     prefix "o-ran-int";
12   }
13
14   organization "O-RAN Alliance";
15
16   contact
17     "www.o-ran.org";
18
19   description
20     "This module defines synchronization mechanism for the O-RAN Equipment.
21
22     Copyright 2019 the O-RAN Alliance.
23
24     THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS'
25     AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26     IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27     ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
28     LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
29     CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
30     SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
31     INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
32     CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
33     ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34     POSSIBILITY OF SUCH DAMAGE.
35
36     Redistribution and use in source and binary forms, with or without
37     modification, are permitted provided that the following conditions are met:
38
39     * Redistributions of source code must retain the above copyright notice,
40     this list of conditions and the above disclaimer.
41     * Redistributions in binary form must reproduce the above copyright notice,
42     this list of conditions and the above disclaimer in the documentation
43     and/or other materials provided with the distribution.
44     * Neither the Members of the O-RAN Alliance nor the names of its
45     contributors may be used to endorse or promote products derived from
46     this software without specific prior written permission.";
47
48   revision "2019-03-06" {
49     description
50       "version 1.0.1
51
52       1) backward compatible changes to introduce groupings.";
53
54     reference "ORAN-WG4.M.0-v01.00";
55   }
56
57   revision "2019-02-04" {
58     description
59       "version 1.0.0
60
61       1) imported model from xRAN
62       2) changed namespace and reference from xran to o-ran";
63
64     reference "ORAN-WG4.M.0-v01.00";
65   }
66
67   typedef geographic-coordinate-degree {
68            type decimal64 {
69              fraction-digits 8;
70            }
71            description
72              "Decimal degree (DD) used to express latitude and longitude
73               geographic coordinates.";
74        }
75
76   feature GNSS {
77     description
78       "This feature indicates that the equipment supports integrated GNSS functionality.";
79   }
80
81   feature ANTI-JAM {
82     description
83       "This feature indicates that the equipment supports Anti-jam fuctionality";
84   }
85
86   grouping sync-group {
87     container sync-status {
88       config false;
89
90       description
91         "Object of this class provides synchronization state of the module.";
92
93       leaf sync-state {
94         type enumeration {
95           enum LOCKED {
96             description
97               "equipment is in the locked mode, as defined in ITU-T G.810";
98           }
99           enum HOLDOVER {
100             description
101               "equipment clock is in holdover mode";
102           }
103           enum FREERUN {
104             description
105               "equipment clock isn't locked to an input reference, and is not in the holdover mode";
106           }
107         }
108         mandatory true;
109         description
110           "State of DU synchronization";
111       }
112
113       list supported-reference-types {
114         key item;
115         min-elements 1;
116         description
117           "Type of a synchronization supported source.";
118         leaf item {
119           type enumeration {
120             enum GNSS {
121               description
122                 "GPS can be taken as a synchronization source";
123             }
124             enum PTP {
125               description
126                 "Precision Time Protocol can be taken as a synchronization source";
127             }
128             enum SYNCE {
129               description
130                 "Synchronous Ethernet can be taken as a synchronization source";
131             }
132           }
133           mandatory true;
134
135           description
136             "supported reference-type";
137         }
138       }
139     }
140
141     container sync-capability {
142       config false;
143
144       description
145         "Object of this class provides synchronization capabilities of the module.";
146
147       leaf sync-t-tsc {
148         type enumeration {
149           enum CLASS_B {
150             description
151               "Standard class B accuracy for synchronization is supported by the device";
152           }
153           enum ENCHANCED {
154             description
155               "Enchanced accuracy for synchronization is supported by the device";
156           }
157         }
158         mandatory true;
159         description
160           "This will provide information about T-TSC capability";
161
162         reference "IEEE 802.1CM";
163       }
164     }
165
166     container ptp-config {
167       description
168         "This MO defines configuration of Precise Time Protocol.";
169       leaf domain-number {
170         type uint8;
171         default 24;
172         description
173           "This parameter indicates Domain Number for PTP announce messages.";
174       }
175
176       list accepted-clock-classes {
177         key clock-classes;
178         leaf clock-classes {
179           type uint8;
180           description
181             "PTP Clock Class accepted by the O-RU";
182         }
183         description
184           "Contains list of PTP acceptable Clock Classes, sorted in the descending order.";
185       }
186
187       leaf ptp-profile {
188         type enumeration {
189           enum G_8275_1 {
190             description
191               "Usage of multicast over ethernet";
192           }
193
194           enum G_8275_2 {
195             description
196               "Usage of unicast over IP";
197           }
198         }
199         default "G_8275_1";
200         description
201           "Type of profile to be used in ptp setting";
202       }
203
204         container g-8275-1-config {
205           when "../ptp-profile='G_8275_1'";
206
207           description
208             "Container allowing for configuration of G8275.1";
209
210           leaf multicast-mac-address {
211             type enumeration {
212               enum FORWARDABLE {
213                 description
214                   "means, that PTP shall use 01-1B-19-00-00-00 destination MAC address";
215               }
216               enum NONFORWARDABLE {
217                 description
218                   "means, that PTP shall use 01-80-C2-00-00-0E destination MAC address";
219               }
220             }
221             default FORWARDABLE;
222             description
223               "The parameter defines destination MAC address, used by the DU in the egress PTP messages.";
224           }
225
226           leaf delay-asymmetry {
227             type int16 {
228               range -10000..10000;
229             }
230             default 0;
231             description
232               "Defines static phase error in the recovered PTP timing signal to be compensated at the O-RU.
233               The error is defined in units of nanoseconds in the range Â±10 000 ns.";
234           }
235         }
236
237       container g-8275-2-config {
238         when "../ptp-profile='G_8275_2'";
239
240         description
241           "Container used for configuration of G8275.2 profile";
242
243         leaf local-ip-port {
244           type leafref {
245             path "/if:interfaces/if:interface/if:name";
246           }
247           description
248             "Reference to interface name corresponding to IP interface
249             used for G.8275.2";
250         }
251
252         list master-ip-configuration {
253           key local-priority;
254           description
255             "The parameter defines list of ip configuration of devices acting as ptp signal source.";
256           leaf local-priority {
257             type uint8;
258             description
259               "The parameter defines local priority or underlying master IP address.";
260           }
261
262           leaf ip-address {
263             type string;
264             description
265               "the parameter defines master IP address.";
266           }
267         }
268
269         leaf log-inter-sync-period {
270           type int8 {
271             range "-7..0";
272           }
273
274           description
275             "The parameter defines number of sync message during 1 second";
276         }
277
278         leaf log-inter-announce-period {
279           type int8 {
280             range "-3..0";
281           }
282
283           description
284             "The parameter defines number of announce message during 1 second";
285         }
286       }
287     }
288
289     container ptp-status {
290       description
291         "ptp status container";
292       leaf reporting-period {
293         type uint8;
294         default 10;
295         description
296           "This parameter defines minimum period in seconds between reports,
297           sent by the NETCONF Client, for parameters in this container.";
298       }
299       leaf lock-state {
300         type enumeration {
301           enum LOCKED {
302             description
303               "The integrated ordinary clock is synchronizing to the reference, recovered from PTP flow";
304           }
305           enum UNLOCKED {
306             description
307               "The integrated ordinary clock is not synchronizing to the reference, recovered from PTP flow";
308           }
309         }
310         config false;
311         description
312           "This parameter indicates, whether the integrated ordinary clock is
313           synchronizing to the reference, recovered from PTP signal.
314           The exact definition when to indicate locked or unlocked is up to specific
315           implementation.";
316       }
317
318       leaf clock-class {
319         type uint8;
320         config false;
321         description
322           "This parameter contains the clock class of the clock, controlled by the O-RU";
323       }
324
325       leaf clock-identity {
326         type string {
327           length 18;
328           pattern "0[xX][0-9a-fA-F]{16}";
329         }
330         config false;
331         description
332           "This parameter contains identity of the clock,
333             according to IEEE 1588-2008 defintion, controlled by the O-RU.
334           The string shall be formatted as an 8-octet hex value with the '0x' prefix.";
335       }
336
337       leaf partial-timing-supported {
338         type boolean;
339         config false;
340         description
341           "Provides information wheter G.8275.2 (partial timing support from network) is supported.";
342       }
343
344       list sources {
345         key local-port-number;
346         config false;
347
348         description
349           "Synchronisation sources";
350
351         leaf local-port-number {
352           type leafref {
353             path "/if:interfaces/if:interface/o-ran-int:port-reference/o-ran-int:port-number";
354           }
355           description
356             "This is reference to portNumber of ExternalEthernetPort to identify the port,
357             where the PTP signal is located.";
358         }
359
360         leaf state {
361           type enumeration {
362             enum PARENT {
363               description
364                 "Indicates that this source is the current master clock, i.e. the clock,
365                 which the clock, controlled by the Netconf Server, is synchronized to";
366             }
367             enum OK {
368               description
369                 "Indicates that this source is an alternate master, which the clock,
370                 controlled by the Netconf Server, can potentially synchronize to,
371                 i.e. clock class and priority, announced by the master clock is lower,
372                 compared to those of the clock, controlled by the Netconf Server,
373                 and and the clock class is accepted";
374             }
375             enum NOK {
376               description
377                 "Indicates that this source is an alternate master, which the clock,
378                 controlled by the Netconf Server, has an operational connection to,
379                 but the class or priority of the master clock is higher or equal
380                 to those of the clock, controlled by the Netconf Server,
381                 or the clock class is not accepted";
382             }
383             enum DISABLED {
384               description
385                 "Indicates that this source is an alternate master, which the clock,
386                 controlled by the Netconf Server, has no operational connection to";
387             }
388           }
389           description
390             "This parameter indicates status of the PTP source";
391         }
392
393         leaf two-step-flag {
394           type boolean;
395           description
396             "This parameter reflects status of the twoStepFlag attribute in Sync messages,
397             received from the PTP source.";
398         }
399
400         leaf leap61 {
401           type boolean;
402           description
403             "This parameter reflects status of the leap61 flag in Announce messages,
404             received from the PTP source.
405             When true, the last minute of the current UTC day contains 61 seconds.";
406         }
407
408         leaf leap59 {
409           type boolean;
410           description
411             "This parameter reflects status of the leap59 flag in Announce messages,
412             received from the PTP source.
413             When true, the last minute of the current UTC day contains 59 seconds.";
414         }
415
416         leaf current-utc-offset-valid {
417           type boolean;
418           description
419             "This parameter reflects status of the currentUtcOffsetValid flag in
420             Announce messages, received from the PTP source.
421             When true, the current UTC offset is valid.";
422         }
423
424         leaf ptp-timescale {
425           type boolean;
426           description
427             "This parameter reflects status of the ptpTimescale flag in Announce
428             messages, received from the PTP source.
429
430             When set, the clock timescale of the grandmaster clock is PTP;
431             otherwise, the timescale is ARB (arbitrary)";
432         }
433
434         leaf time-traceable {
435           type boolean;
436           description
437             "This parameter reflects status of the timeTraceable flag in Announce
438             messages, received from the PTP source.
439
440             When true, the timescale and the currentUtcOffset are traceable to a
441             primary reference";
442         }
443
444         leaf frequency-traceable {
445           type boolean;
446           description
447             "This parameter reflects status of the frequencyTraceable flag in
448             Announce messages, received from the PTP source.
449
450             When true, the frequency determining the timescale is traceable to a
451             primary reference";
452         }
453
454         leaf source-clock-identity {
455           type string {
456             length 18;
457             pattern "0[xX][0-9a-fA-F]{16}";
458           }
459           description
460             "This parameter reflects value of the sourceClockIdentity attribute in
461             Announce messages, received from the PTP source.
462
463             The string shall be formatted as an 8-octet hex value with the '0x'
464             prefix.";
465         }
466
467         leaf source-port-number {
468           type uint16;
469           description
470             "This parameter reflects value of the sourcePortNumber attribute in
471             Announce messages, received from the PTP source.";
472         }
473
474         leaf current-utc-offset {
475           type int16;
476           description
477             "The offset between TAI and UTC when the epoch of the PTP system is
478             the PTP epoch, i.e., when ptp-timescale is TRUE; otherwise, the value
479             has no meaning";
480         }
481
482         leaf priority1 {
483           type uint8;
484           description
485             "This parameter reflects value of the priority1 attribute in Announce
486             messages, received from the PTP source.";
487         }
488
489         leaf clock-class {
490           type uint8;
491           description
492             "This parameter reflects value of the clockClass attribute in
493             Announce messages, received from the PTP source.";
494         }
495
496         leaf clock-accuracy {
497           type uint8;
498           description
499             "This parameter reflects value of the clockAccuracy attribute in
500             Announce messages, received from the PTP source.";
501         }
502
503         leaf offset-scaled-log-variance {
504           type uint16;
505           description
506             "This parameter reflects value of the offsetScaledLogVariance
507             attribute in Announce messages, received from the PTP source.";
508         }
509
510         leaf priority2 {
511           type uint8;
512           description
513             "This parameter reflects value of the priority2 attribute in Announce
514             messages, received from the PTP source.";
515         }
516
517         leaf grandmaster-clock-identity {
518           type string {
519             length 18;
520             pattern "0[xX][0-9a-fA-F]{16}";
521           }
522           description
523             "This parameter reflects value of the grandmasterClockIdentity
524             attribute in Announce messages, received from the PTP source.
525
526             The string shall be formatted as an 8-octet hex value with the '0x'
527             prefix.";
528         }
529
530         leaf steps-removed {
531           type uint16;
532           description
533             "This parameter reflects value of the stepsRemoved attribute in
534             Announce messages, received from the PTP source.
535
536             It indicates the number of communication paths traversed
537             between the local clock and the grandmaster clock.";
538         }
539
540         leaf time-source {
541           type uint8;
542           description
543             "This parameter reflects value of the timeSource attribute in
544             Announce messages, received from the PTP source.";
545         }
546       }
547     }
548
549     container synce-config {
550       description
551         "This container defines the configuration of SyncE";
552
553       leaf-list acceptance-list-of-ssm {
554         type enumeration {
555           enum PRC {
556             description
557               "PRC";
558           }
559           enum PRS {
560             description
561               "PRS";
562           }
563           enum SSU_A {
564             description
565               "SSU_A";
566           }
567           enum SSU_B {
568             description
569               "SSU_B";
570           }
571           enum ST2 {
572             description
573               "ST2";
574           }
575           enum ST3 {
576             description
577               "ST3";
578           }
579           enum ST3E {
580             description
581               "ST3E";
582           }
583           enum EEC1 {
584             description
585               "EEC1";
586           }
587           enum EEC2 {
588             description
589               "EEC2";
590           }
591           enum DNU {
592             description
593               "DNU";
594           }
595           enum NONE {
596             description
597               "NONE";
598           }
599         }
600
601         default "PRC";
602
603         description
604           "The parameter contains the list of SyncE acceptable SSMs.";
605       }
606
607       leaf ssm-timeout {
608         type uint16;
609
610         description
611           "The parameter contains the value of maximum duration in seconds for which the actual SSM value may be different than configured values.";
612       }
613     }
614
615     container synce-status {
616       description
617         "SyncE status container";
618
619       leaf reporting-period {
620           type uint8;
621           default 10;
622           description
623             "This parameter defines minimum period in seconds between reports,
624              sent by the NETCONF client, for parameters in this container.";
625       }
626
627       leaf lock-state {
628         type enumeration {
629           enum LOCKED {
630             description
631               "The integrated ordinary clock is synchronizing to the reference, recovered from SyncE signal";
632           }
633           enum UNLOCKED {
634             description
635               "The integrated ordinary clock is not synchronizing to the reference, recovered from SyncE signal";
636           }
637         }
638         config false;
639         description
640           "This parameter indicates, whether the integrated ordinary clock is
641           synchronizing to the reference, recovered from SyncE signal.
642
643           The exact definition when to indicate locked or unlocked is up to
644           specific implementation.";
645       }
646
647       list sources {
648         key local-port-number;
649         config false;
650         leaf local-port-number {
651           type leafref {
652             path "/if:interfaces/if:interface/o-ran-int:port-reference/o-ran-int:port-number";
653           }
654           description
655             "This is reference to portNumber of ExternalEthernetPort to identify
656             the port, where the SyncE signal is located.";
657         }
658
659         leaf state {
660           type enumeration {
661             enum PARENT {
662               description
663                 "Indicates that this source is the current master clock, i.e. the clock,
664                 which the clock, controlled by the Netconf Server, is synchronized to";
665             }
666             enum OK {
667               description
668                 "Indicates that this source is an alternate master, which the clock,
669                 controlled by the Netconf Server, can potentially synchronize to,
670                 i.e. clock class and priority, announced by the master clock is lower,
671                 compared to those of the clock, controlled by the Netconf Server,
672                 and and the clock class is accepted";
673             }
674             enum NOK {
675               description
676                 "Indicates that this source is an alternate master, which the clock,
677                 controlled by the Netconf Server, has an operational connection to,
678                 but the class or priority of the master clock is higher or equal
679                 to those of the clock, controlled by the Netconf Server,
680                 or the clock class is not accepted";
681             }
682             enum DISABLED {
683               description
684                 "Indicates that this source is an alternate master, which the clock,
685                 controlled by the Netconf Server, has no operational connection to";
686             }
687           }
688           description
689             "This parameter indicates status of the SyncE source";
690         }
691
692         leaf quality-level {
693           type uint8 {
694             range 0..15;
695           }
696           description
697             "This parameter contains value of the SSM clock quality level,
698             received in SSM messages from the SyncE source.";
699         }
700         min-elements 1;
701         description
702           "This parameter contains characteristics of SyncE sources of the clock, controlled by the O-RU.";
703       }
704     }
705
706     container gnss-config {
707       if-feature GNSS;
708       description
709         "This container defines the configuration of Global Navigation Satellite System (GNSS).";
710
711       leaf enable {
712         type boolean;
713
714         description
715           "This parameter defines if GNSS receiver shall be enabled or not.";
716       }
717
718       leaf-list satellite-constelation-list {
719         type enumeration {
720           enum GPS {
721             description
722               "GPS";
723           }
724           enum GLONASS {
725             description
726               "GLONASS should not be used alone but always along with GPS or BEIDOU because of missing leap second information";
727           }
728           enum GALILEO {
729             description
730               "GALILEO";
731           }
732           enum BEIDOU {
733             description
734               "BEIDOU";
735           }
736         }
737
738         description
739           "This parameter defines list of constellations to be used to acquire synchronization.";
740       }
741
742       leaf polarity {
743         type enumeration {
744           enum POSITIVE {
745             description
746               "POSITIVE";
747           }
748           enum NEGATIVE {
749             description
750               "NEGATIVE";
751           }
752         }
753         default POSITIVE;
754
755         description
756           "This parameter defines pulse polarity";
757       }
758
759       leaf cable-delay {
760         type uint16 {
761           range "0..1000";
762         }
763         default 5;
764
765         description
766           "This parameter is used to compensate cable delay.";
767       }
768
769       leaf anti-jam-enable {
770         if-feature ANTI-JAM;
771         type boolean;
772         default false;
773         description
774           "This parameter is used to enable or disable anti-jamming.";
775       }
776     }
777
778     container gnss-status {
779       if-feature GNSS;
780       description
781         "Provides information about state of gps receiver";
782       leaf reporting-period {
783         type uint8;
784         default 10;
785         description
786           "This parameter defines minimum period in seconds between reports,
787           sent by the NETCONF Client, for parameters in this container.";
788       }
789       leaf name {
790         type string {
791           length "1..255";
792         }
793         config false;
794         description
795         "A name that is unique that identifies a GNSS instance.
796         This name may be used in fault management to refer to a
797         fault source or affected object";
798       }
799       leaf gnss-sync-status {
800         type enumeration {
801           enum SYNCHRONIZED {
802             description "GNSS functionality is synchronized";
803           }
804           enum ACQUIRING-SYNC {
805             description "GNSS functionality is acquiring sync";
806           }
807           enum ANTENNA-DISCONNECTED {
808             description "GNSS functionality has its antenna disconnected";
809           }
810           enum BOOTING {
811             description "GNSS functionality is booting";
812           }
813           enum ANTENNA-SHORT-CIRCUIT {
814             description "GNSS functionality has an antenna short circuit";
815           }
816         }
817         config false;
818         description "when available, indicates the status of the gnss receiver.";
819       }
820       container gnss-data {
821         when "../gnss-sync-status='SYNCHRONIZED'";
822         config false;
823         description
824           "GPS data contained";
825         leaf satellites-tracked {
826           type uint8;
827           description "Number of satellites tracked";
828         }
829         container location {
830           description
831             "Containes information about geo location";
832           leaf altitude {
833             type int64;
834             units millimeter;
835             description
836               "Distance above the sea level.";
837           }
838           leaf latitude {
839             type geographic-coordinate-degree {
840               range "-90..90";
841             }
842             description
843               "Relative position north or south on the Earth's surface.";
844           }
845           leaf longitude {
846             type geographic-coordinate-degree {
847               range "-180..180";
848             }
849             description
850               "Angular distance east or west on the Earth's surface.";
851           }
852         }
853       }
854     }
855   }
856
857   container sync {
858     description
859       "Main containter for sync related parameters";
860
861     uses sync-group;
862   }
863
864   //notification statement
865   notification synchronization-state-change {
866     description
867       "Notification used to inform about synchronization state change";
868
869     leaf sync-state {
870       type leafref {
871         path "/sync/sync-status/sync-state";
872       }
873       description
874         "State of equipment synchronization is notified at state change";
875     }
876   }
877
878   notification ptp-state-change {
879     description
880       "Notification used to inform about ptp synchronization state change";
881
882     leaf ptp-state{
883       type leafref{
884         path "/sync/ptp-status/lock-state";
885       }
886       description
887         "ptp-state-change notification is signalled from equipment at state change";
888     }
889   }
890   notification synce-state-change {
891     description
892       "Notification used to inform about synce synchronization state change";
893
894     leaf synce-state{
895       type leafref{
896         path "/sync/synce-status/lock-state";
897       }
898       description
899         "synce-state change notification is signalled from equipment at state change";
900     }
901   }
902   notification gnss-state-change {
903     if-feature GNSS;
904     description
905       "Notification used to inform about gnss synchronization state change";
906
907     leaf gnss-state{
908       type leafref{
909         path "/sync/gnss-status/gnss-sync-status";
910       }
911       description
912         "gnss-state-change notification is signalled from equipment at state change";
913     }
914   }
915
916 }