summaryrefslogtreecommitdiffstats
path: root/sdnr/model/yang/ietf-ptp-dataset@2017-02-08.yang
blob: d899e569276da7bd2df00f866f48c3d43fa51f89 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
   module ietf-ptp-dataset{
     namespace "urn:ietf:params:xml:ns:yang:ietf-ptp-dataset";
     prefix "ptp-dataset";
     organization "IETF TICTOC Working Group";
     contact
         "WG Web:   http://tools.ietf.org/wg/tictoc/
          WG List:  <mailto:tictoc@ietf.org>
          WG Chair: Karen O'Donoghue
                    <mailto:odonoghue@isoc.org>
          WG Chair: Yaakov Stein
                    <mailto: Yaakov_s@rad.com>
          Editor:   Yuanlong Jiang
                    <mailto:jiangyuanlong@huawei.com>
          Editor:   Rodney Cummings
                    <mailto:rodney.cummings@ni.com>";
     description
       "This YANG module defines a data model for the configuration
       of IEEE 1588-2008 clocks, and also for retrieval of the state
       data of IEEE 1588-2008 clocks.";

     revision "2017-02-08" {
       description "Version 4.0";
       reference "draft-ietf-tictoc-1588v2-yang";
      }

     typedef delay-mechanism-enumeration {
       type enumeration {
         enum E2E {
           value 1;
           description
             "The port uses the delay request-response
              mechanism.";
         }
         enum P2P {
           value 2;
           description
             "The port uses the peer delay mechanism.";
         }
         enum DISABLED {
           value 254;
           description
             "The port does not implement any delay
              mechanism.";
         }
       }
       description
         "The propagation delay measuring option used by the
         port. Values for this enumeration are specified
         by the IEEE 1588 standard exclusively.";
       reference
         "IEEE Std 1588-2008: 8.2.5.4.4";
     }

     typedef port-state-enumeration {
       type enumeration {
         enum INITIALIZING {
           value 1;
           description
             "The port is initializing its data sets, hardware, and
             communication facilities.";
         }
         enum FAULTY {
           value 2;
           description
             "The port is in the fault state.";
         }
         enum DISABLED {
           value 3;
           description
             "The port is disabled, and is not communicating PTP
             messages (other than possibly PTP management
             messages).";
         }
         enum LISTENING {
           value 4;
           description
             "The port is listening for an Announce message.";
         }
         enum PRE_MASTER {
           value 5;
           description
             "The port is in the pre-master state.";
         }
         enum MASTER {
           value 6;
           description
             "The port is behaving as a master port.";
         }
         enum PASSIVE {
           value 7;
           description
             "The port is in the passive state.";
         }
         enum UNCALIBRATED {
           value 8;
           description
             "A master port has been selected, but the port is still
             in the uncalibrated state.";
         }
         enum SLAVE {
           value 9;
           description
             "The port is synchronizing to the selected
             master port.";
         }
       }
       description
         "The current state of the protocol engine associated
         with the port.  Values for this enumeration are specified
         by the IEEE 1588 standard exclusively.";
       reference
         "IEEE Std 1588-2008: 8.2.5.3.1, 9.2.5";
     }

     typedef time-interval-type {
       type int64;
       description
         "Derived data type for time interval,
         represented in units of nanoseconds and
         multipled by 2^16";
       reference
         "IEEE Std 1588-2008: 5.3.2";
     }

     typedef clock-identity-type {
       type binary {
         length "8";
       }
       description
         "Derived data type to identify a clock";
       reference
         "IEEE Std 1588-2008: 5.3.4";
     }

     grouping port-identity-grouping {
       description
         "Derived data type to identify a port, which contains
         two members: clockIdentity and portNumber.";
       reference
         "IEEE Std 1588-2008: 5.3.5";

       leaf clock-identity {
         type clock-identity-type;
         description
           "Identity of the clock";
       }

       leaf port-number {
         type uint16;
         description
           "Port number";
       }
     }

     grouping clock-quality-grouping {
       description
         "Derived data type for quality of a clock, which contains
         clockClass, clockAccuracy and offsetScaledLogVariance.";
       reference
         "IEEE Std 1588-2008: 5.3.7";

       leaf clock-class {
         type uint8;
         default 248;
         description
           "The clockClass denotes the traceability of the time
           or frequency distributed by the clock.";
       }

       leaf clock-accuracy {
         type uint8;
         description
           "The clockAccuracy indicates the expected accuracy
            of the clock.";
       }

       leaf offset-scaled-log-variance {
         type uint16;
         description
           "The offsetScaledLogVariance provides an
           estimate of the variations of the clock
           from a linear timescale when it is not synchronized
           to another clock using the protocol.";
       }
     }

     grouping default-ds-entry {
       description
         "Collection of members of the default data set.";

       leaf two-step-flag {
         type boolean;
         description
               "When set, the clock is a two-step clock; otherwise,
               the clock is a one-step clock.";
       }

       leaf clock-identity {
         type clock-identity-type;
         description
           "The clockIdentity of the local clock";
       }

       leaf number-ports {
         type uint16;
         description
           "The number of PTP ports on the device.";
       }

       container clock-quality {
         description
           "The clockQuality of the local clock.";

         uses clock-quality-grouping;
       }

       leaf priority1 {
         type uint8;
         description
           "The priority1 attribute of the local clock.";
       }

       leaf priority2{
         type uint8;
         description
           "The priority2 attribute of the local clock. ";
       }

       leaf domain-number {
         type uint8;
         description
                "The domain number of the current syntonization
               domain.";
       }

       leaf slave-only {
         type boolean;
         description
           "When set, the clock is a slave-only clock.";
       }
     }

     grouping current-ds-entry {
       description
         "Collection of members of current data set.";

       leaf steps-removed {
         type uint16;
         default 0;
         description
           "The number of communication paths traversed
           between the local clock and the grandmaster clock.";
       }
       leaf offset-from-master {
         type time-interval-type;
         description
           "The current value of the time difference between
           a master and a slave clock as computed by the slave.";
       }

       leaf mean-path-delay {
         type time-interval-type;
         description
           "The current value of the mean propagation time between
           a master and a slave clock as computed by the slave.";

       }
     }

     grouping parent-ds-entry {
       description
         "Collection of members of the parent data set.";

       container parent-port-identity {
         description
           "The portIdentity of the port on the master";
         uses port-identity-grouping;
       }
       leaf parent-stats {
         type boolean;
         default false;
         description
           "When set, the values of
            observedParentOffsetScaledLogVariance and
            observedParentClockPhaseChangeRate of parentDS
            have been measured and are valid.";
       }
       leaf observed-parent-offset-scaled-log-variance {
         type uint16;
         default 0xFFFF;
         description
           "An estimate of the parent clock's PTP variance
            as observed by the slave clock.";
       }
       leaf observed-parent-clock-phase-change-rate {
         type int32;
         description
           "An estimate of the parent clock's phase change rate
            as observed by the slave clock.";
       }
       leaf grandmaster-identity {
         type binary{
           length "8";
         }

         description
          "The clockIdentity attribute of the grandmaster clock.";

       }
       container grandmaster-clock-quality {
         description
           "The clockQuality of the grandmaster clock.";
         uses clock-quality-grouping;
       }
       leaf grandmaster-priority1 {
         type uint8;
         description
           "The priority1 attribute of the grandmaster clock.";
       }
       leaf grandmaster-priority2 {
         type uint8;
         description
           "The priority2 attribute of the grandmaster clock.";
       }
     }

     grouping time-properties-ds-entry {
       description
         "Collection of members of the timeProperties data set.";
       leaf current-utc-offset-valid {
         type boolean;
         description
           "When set, the current UTC offset is valid.";
       }
       leaf current-utc-offset {
         type int16;
         description
           "The offset between TAI and UTC when the epoch of the
            PTP system is the PTP epoch, i.e., when ptp-timescale
            is TRUE; otherwise, the value has no meaning.";
       }
       leaf leap59 {
         type boolean;
         description
               "When set, the last minute of the current UTC day
               contains 59 seconds.";
       }
       leaf leap61 {
         type boolean;
         description
               "When set, the last minute of the current UTC day
               contains 61 seconds.";
       }
       leaf time-traceable {
         type boolean;
         description
           "When set, the timescale and the currentUtcOffset are
               traceable to a primary reference.";
       }
       leaf frequency-traceable {
         type boolean;
         description
           "When set, the frequency determining the timescale
            is traceable to a primary reference.";
       }
       leaf ptp-timescale {
         type boolean;
         description
           "When set, the clock timescale of the grandmaster
                clock is PTP; otherwise, the timescale is ARB
               (arbitrary).";
       }
       leaf time-source {
         type uint8;
         description
           "The source of time used by the grandmaster clock.";

       }
     }

     grouping port-ds-entry {
       description
         "Collection of members of the port data set.";

       container port-identity {
         description
           "The portIdentity attribute of the local port.";
         uses port-identity-grouping;
       }

       leaf port-state {
         type port-state-enumeration;
         default "INITIALIZING";
         description
           "Current state associated with the port.";
       }

       leaf log-min-delay-req-interval {
         type int8;
         description
           "The base-two logarithm of the minDelayReqInterval
            (the minimum permitted mean time interval between
            successive Delay_Req messages).";
       }

       leaf peer-mean-path-delay {
         type time-interval-type;
         default 0;
         description
           "An estimate of the current one-way propagation delay
            on the link when the delayMechanism is P2P; otherwise,
            it is zero.";
       }

       leaf log-announce-interval {
         type int8;
         description
           "The base-two logarithm of the mean
            announceInterval (mean time interval between
            successive Announce messages).";
       }

       leaf announce-receipt-timeout {
         type uint8;
         description
           "The number of announceInterval that have to pass
            without receipt of an Announce message before the
            occurrence of the event ANNOUNCE_RECEIPT_TIMEOUT_
            EXPIRES.";
       }

       leaf log-sync-interval {
         type int8;
         description
           "The base-two logarithm of the mean SyncInterval
            for multicast messages.  The rates for unicast
            transmissions are negotiated separately on a per port
            basis and are not constrained by this attribute.";
       }

       leaf delay-mechanism {
         type delay-mechanism-enumeration;
         description
           "The propagation delay measuring option used by the
            port in computing meanPathDelay.";
       }

       leaf log-min-pdelay-req-interval {
         type int8;
         description
           "The base-two logarithm of the
            minPdelayReqInterval (minimum permitted mean time
            interval between successive Pdelay_Req messages).";

       }

       leaf version-number {
         type uint8;
         description
           "The PTP version in use on the port.";
       }
     }

     grouping transparent-clock-default-ds-entry {
       description
         "Collection of members of the transparentClockDefault data
           set (default data set for a transparent clock).";

       leaf clock-identity {
         type clock-identity-type;
         description
           "The clockIdentity of the transparent clock.";
       }
       leaf number-ports {
         type uint16;
         description
           "The number of PTP ports on the device.";
       }
       leaf delay-mechanism {
         type delay-mechanism-enumeration;
         description
           "The propagation delay measuring option
            used by the transparent clock.";
       }
       leaf primary-domain {
         type uint8;
         default 0;
         description
          "The domainNumber of the primary syntonization domain.";

       }
     }

     grouping transparent-clock-port-ds-entry {
       description
         "Collection of members of the transparentClockPort data
          set (port data set for a transparent clock).";

       container port-identity {
         description
           "The portIdentity of the local port.";

         uses port-identity-grouping;
       }
       leaf log-min-pdelay-req-interval {
         type int8;
         description
           "The logarithm to the base 2 of the
            minPdelayReqInterval (minimum permitted mean time
            interval between successive Pdelay_Req messages).";
       }
       leaf faulty-flag {
         type boolean;
         default false;
         description
           "When set, the port is faulty.";
       }
       leaf peer-mean-path-delay {
         type time-interval-type;
         default 0;
         description
           "An estimate of the current one-way propagation delay
            on the link when the delayMechanism is P2P; otherwise,
            it is zero.";
       }
     }

     list instance-list {

       key "instance-number";

       description
         "List of one or more PTP datasets in the device, one for
         each domain (see IEEE 1588-2008 subclause 6.3).
         Each PTP dataset represents a distinct instance of
         PTP implementation in the device (i.e. distinct
         Ordinary Clock or Boundary Clock).";

       leaf instance-number {
         type uint16;
         description
           "The instance number of the current PTP instance";
       }
        container default-ds {
          description
            "The default data set of the clock.";
          uses default-ds-entry;
        }

        container current-ds {
          description
            "The current data set of the clock.";
          uses current-ds-entry;
        }

        container parent-ds {
          description
            "The parent data set of the clock.";
          uses parent-ds-entry;
        }

        container time-properties-ds {
          description
            "The timeProperties data set of the clock.";
          uses time-properties-ds-entry;
        }

        list port-ds-list {
          key "port-number";
          description
            "List of port data sets of the clock.";
          leaf port-number{
            type leafref{
              path "../port-identity/port-number";
            }
            description
              "Refers to the portNumber memer of
              portDS.portIdentity.";
          }
          uses port-ds-entry;
        }
     }

     container transparent-clock-default-ds {
       description
         "The members of the transparentClockDefault Data Set";
       uses transparent-clock-default-ds-entry;
     }

     list transparent-clock-port-ds-list {
       key "port-number";
       description
         "List of transparentClockPort data sets
          of the transparent clock.";
       leaf port-number {
         type leafref {
           path "../port-identity/port-number";
         }
          description
            "Refers to the portNumber memer
             of transparentClockPortDS.portIdentity.";
        }
        uses transparent-clock-port-ds-entry;
      }
   }