demx8as6 | 9872fa0 | 2018-07-06 10:27:37 +0200 | [diff] [blame] | 1 | module ietf-ptp-dataset{ |
| 2 | namespace "urn:ietf:params:xml:ns:yang:ietf-ptp-dataset"; |
| 3 | prefix "ptp-dataset"; |
| 4 | organization "IETF TICTOC Working Group"; |
| 5 | contact |
| 6 | "WG Web: http://tools.ietf.org/wg/tictoc/ |
| 7 | WG List: <mailto:tictoc@ietf.org> |
| 8 | WG Chair: Karen O'Donoghue |
| 9 | <mailto:odonoghue@isoc.org> |
| 10 | WG Chair: Yaakov Stein |
| 11 | <mailto: Yaakov_s@rad.com> |
| 12 | Editor: Yuanlong Jiang |
| 13 | <mailto:jiangyuanlong@huawei.com> |
| 14 | Editor: Rodney Cummings |
| 15 | <mailto:rodney.cummings@ni.com>"; |
| 16 | description |
| 17 | "This YANG module defines a data model for the configuration |
| 18 | of IEEE 1588-2008 clocks, and also for retrieval of the state |
| 19 | data of IEEE 1588-2008 clocks."; |
| 20 | |
| 21 | revision "2017-02-08" { |
| 22 | description "Version 4.0"; |
| 23 | reference "draft-ietf-tictoc-1588v2-yang"; |
| 24 | } |
| 25 | |
| 26 | typedef delay-mechanism-enumeration { |
| 27 | type enumeration { |
| 28 | enum E2E { |
| 29 | value 1; |
| 30 | description |
| 31 | "The port uses the delay request-response |
| 32 | mechanism."; |
| 33 | } |
| 34 | enum P2P { |
| 35 | value 2; |
| 36 | description |
| 37 | "The port uses the peer delay mechanism."; |
| 38 | } |
| 39 | enum DISABLED { |
| 40 | value 254; |
| 41 | description |
| 42 | "The port does not implement any delay |
| 43 | mechanism."; |
| 44 | } |
| 45 | } |
| 46 | description |
| 47 | "The propagation delay measuring option used by the |
| 48 | port. Values for this enumeration are specified |
| 49 | by the IEEE 1588 standard exclusively."; |
| 50 | reference |
| 51 | "IEEE Std 1588-2008: 8.2.5.4.4"; |
| 52 | } |
| 53 | |
| 54 | typedef port-state-enumeration { |
| 55 | type enumeration { |
| 56 | enum INITIALIZING { |
| 57 | value 1; |
| 58 | description |
| 59 | "The port is initializing its data sets, hardware, and |
| 60 | communication facilities."; |
| 61 | } |
| 62 | enum FAULTY { |
| 63 | value 2; |
| 64 | description |
| 65 | "The port is in the fault state."; |
| 66 | } |
| 67 | enum DISABLED { |
| 68 | value 3; |
| 69 | description |
| 70 | "The port is disabled, and is not communicating PTP |
| 71 | messages (other than possibly PTP management |
| 72 | messages)."; |
| 73 | } |
| 74 | enum LISTENING { |
| 75 | value 4; |
| 76 | description |
| 77 | "The port is listening for an Announce message."; |
| 78 | } |
| 79 | enum PRE_MASTER { |
| 80 | value 5; |
| 81 | description |
| 82 | "The port is in the pre-master state."; |
| 83 | } |
| 84 | enum MASTER { |
| 85 | value 6; |
| 86 | description |
| 87 | "The port is behaving as a master port."; |
| 88 | } |
| 89 | enum PASSIVE { |
| 90 | value 7; |
| 91 | description |
| 92 | "The port is in the passive state."; |
| 93 | } |
| 94 | enum UNCALIBRATED { |
| 95 | value 8; |
| 96 | description |
| 97 | "A master port has been selected, but the port is still |
| 98 | in the uncalibrated state."; |
| 99 | } |
| 100 | enum SLAVE { |
| 101 | value 9; |
| 102 | description |
| 103 | "The port is synchronizing to the selected |
| 104 | master port."; |
| 105 | } |
| 106 | } |
| 107 | description |
| 108 | "The current state of the protocol engine associated |
| 109 | with the port. Values for this enumeration are specified |
| 110 | by the IEEE 1588 standard exclusively."; |
| 111 | reference |
| 112 | "IEEE Std 1588-2008: 8.2.5.3.1, 9.2.5"; |
| 113 | } |
| 114 | |
| 115 | typedef time-interval-type { |
| 116 | type int64; |
| 117 | description |
| 118 | "Derived data type for time interval, |
| 119 | represented in units of nanoseconds and |
| 120 | multipled by 2^16"; |
| 121 | reference |
| 122 | "IEEE Std 1588-2008: 5.3.2"; |
| 123 | } |
| 124 | |
| 125 | typedef clock-identity-type { |
| 126 | type binary { |
| 127 | length "8"; |
| 128 | } |
| 129 | description |
| 130 | "Derived data type to identify a clock"; |
| 131 | reference |
| 132 | "IEEE Std 1588-2008: 5.3.4"; |
| 133 | } |
| 134 | |
| 135 | grouping port-identity-grouping { |
| 136 | description |
| 137 | "Derived data type to identify a port, which contains |
| 138 | two members: clockIdentity and portNumber."; |
| 139 | reference |
| 140 | "IEEE Std 1588-2008: 5.3.5"; |
| 141 | |
| 142 | leaf clock-identity { |
| 143 | type clock-identity-type; |
| 144 | description |
| 145 | "Identity of the clock"; |
| 146 | } |
| 147 | |
| 148 | leaf port-number { |
| 149 | type uint16; |
| 150 | description |
| 151 | "Port number"; |
| 152 | } |
| 153 | } |
| 154 | |
| 155 | grouping clock-quality-grouping { |
| 156 | description |
| 157 | "Derived data type for quality of a clock, which contains |
| 158 | clockClass, clockAccuracy and offsetScaledLogVariance."; |
| 159 | reference |
| 160 | "IEEE Std 1588-2008: 5.3.7"; |
| 161 | |
| 162 | leaf clock-class { |
| 163 | type uint8; |
| 164 | default 248; |
| 165 | description |
| 166 | "The clockClass denotes the traceability of the time |
| 167 | or frequency distributed by the clock."; |
| 168 | } |
| 169 | |
| 170 | leaf clock-accuracy { |
| 171 | type uint8; |
| 172 | description |
| 173 | "The clockAccuracy indicates the expected accuracy |
| 174 | of the clock."; |
| 175 | } |
| 176 | |
| 177 | leaf offset-scaled-log-variance { |
| 178 | type uint16; |
| 179 | description |
| 180 | "The offsetScaledLogVariance provides an |
| 181 | estimate of the variations of the clock |
| 182 | from a linear timescale when it is not synchronized |
| 183 | to another clock using the protocol."; |
| 184 | } |
| 185 | } |
| 186 | |
| 187 | grouping default-ds-entry { |
| 188 | description |
| 189 | "Collection of members of the default data set."; |
| 190 | |
| 191 | leaf two-step-flag { |
| 192 | type boolean; |
| 193 | description |
| 194 | "When set, the clock is a two-step clock; otherwise, |
| 195 | the clock is a one-step clock."; |
| 196 | } |
| 197 | |
| 198 | leaf clock-identity { |
| 199 | type clock-identity-type; |
| 200 | description |
| 201 | "The clockIdentity of the local clock"; |
| 202 | } |
| 203 | |
| 204 | leaf number-ports { |
| 205 | type uint16; |
| 206 | description |
| 207 | "The number of PTP ports on the device."; |
| 208 | } |
| 209 | |
| 210 | container clock-quality { |
| 211 | description |
| 212 | "The clockQuality of the local clock."; |
| 213 | |
| 214 | uses clock-quality-grouping; |
| 215 | } |
| 216 | |
| 217 | leaf priority1 { |
| 218 | type uint8; |
| 219 | description |
| 220 | "The priority1 attribute of the local clock."; |
| 221 | } |
| 222 | |
| 223 | leaf priority2{ |
| 224 | type uint8; |
| 225 | description |
| 226 | "The priority2 attribute of the local clock. "; |
| 227 | } |
| 228 | |
| 229 | leaf domain-number { |
| 230 | type uint8; |
| 231 | description |
| 232 | "The domain number of the current syntonization |
| 233 | domain."; |
| 234 | } |
| 235 | |
| 236 | leaf slave-only { |
| 237 | type boolean; |
| 238 | description |
| 239 | "When set, the clock is a slave-only clock."; |
| 240 | } |
| 241 | } |
| 242 | |
| 243 | grouping current-ds-entry { |
| 244 | description |
| 245 | "Collection of members of current data set."; |
| 246 | |
| 247 | leaf steps-removed { |
| 248 | type uint16; |
| 249 | default 0; |
| 250 | description |
| 251 | "The number of communication paths traversed |
| 252 | between the local clock and the grandmaster clock."; |
| 253 | } |
| 254 | leaf offset-from-master { |
| 255 | type time-interval-type; |
| 256 | description |
| 257 | "The current value of the time difference between |
| 258 | a master and a slave clock as computed by the slave."; |
| 259 | } |
| 260 | |
| 261 | leaf mean-path-delay { |
| 262 | type time-interval-type; |
| 263 | description |
| 264 | "The current value of the mean propagation time between |
| 265 | a master and a slave clock as computed by the slave."; |
| 266 | |
| 267 | } |
| 268 | } |
| 269 | |
| 270 | grouping parent-ds-entry { |
| 271 | description |
| 272 | "Collection of members of the parent data set."; |
| 273 | |
| 274 | container parent-port-identity { |
| 275 | description |
| 276 | "The portIdentity of the port on the master"; |
| 277 | uses port-identity-grouping; |
| 278 | } |
| 279 | leaf parent-stats { |
| 280 | type boolean; |
| 281 | default false; |
| 282 | description |
| 283 | "When set, the values of |
| 284 | observedParentOffsetScaledLogVariance and |
| 285 | observedParentClockPhaseChangeRate of parentDS |
| 286 | have been measured and are valid."; |
| 287 | } |
| 288 | leaf observed-parent-offset-scaled-log-variance { |
| 289 | type uint16; |
| 290 | default 0xFFFF; |
| 291 | description |
| 292 | "An estimate of the parent clock's PTP variance |
| 293 | as observed by the slave clock."; |
| 294 | } |
| 295 | leaf observed-parent-clock-phase-change-rate { |
| 296 | type int32; |
| 297 | description |
| 298 | "An estimate of the parent clock's phase change rate |
| 299 | as observed by the slave clock."; |
| 300 | } |
| 301 | leaf grandmaster-identity { |
| 302 | type binary{ |
| 303 | length "8"; |
| 304 | } |
| 305 | |
| 306 | description |
| 307 | "The clockIdentity attribute of the grandmaster clock."; |
| 308 | |
| 309 | } |
| 310 | container grandmaster-clock-quality { |
| 311 | description |
| 312 | "The clockQuality of the grandmaster clock."; |
| 313 | uses clock-quality-grouping; |
| 314 | } |
| 315 | leaf grandmaster-priority1 { |
| 316 | type uint8; |
| 317 | description |
| 318 | "The priority1 attribute of the grandmaster clock."; |
| 319 | } |
| 320 | leaf grandmaster-priority2 { |
| 321 | type uint8; |
| 322 | description |
| 323 | "The priority2 attribute of the grandmaster clock."; |
| 324 | } |
| 325 | } |
| 326 | |
| 327 | grouping time-properties-ds-entry { |
| 328 | description |
| 329 | "Collection of members of the timeProperties data set."; |
| 330 | leaf current-utc-offset-valid { |
| 331 | type boolean; |
| 332 | description |
| 333 | "When set, the current UTC offset is valid."; |
| 334 | } |
| 335 | leaf current-utc-offset { |
| 336 | type int16; |
| 337 | description |
| 338 | "The offset between TAI and UTC when the epoch of the |
| 339 | PTP system is the PTP epoch, i.e., when ptp-timescale |
| 340 | is TRUE; otherwise, the value has no meaning."; |
| 341 | } |
| 342 | leaf leap59 { |
| 343 | type boolean; |
| 344 | description |
| 345 | "When set, the last minute of the current UTC day |
| 346 | contains 59 seconds."; |
| 347 | } |
| 348 | leaf leap61 { |
| 349 | type boolean; |
| 350 | description |
| 351 | "When set, the last minute of the current UTC day |
| 352 | contains 61 seconds."; |
| 353 | } |
| 354 | leaf time-traceable { |
| 355 | type boolean; |
| 356 | description |
| 357 | "When set, the timescale and the currentUtcOffset are |
| 358 | traceable to a primary reference."; |
| 359 | } |
| 360 | leaf frequency-traceable { |
| 361 | type boolean; |
| 362 | description |
| 363 | "When set, the frequency determining the timescale |
| 364 | is traceable to a primary reference."; |
| 365 | } |
| 366 | leaf ptp-timescale { |
| 367 | type boolean; |
| 368 | description |
| 369 | "When set, the clock timescale of the grandmaster |
| 370 | clock is PTP; otherwise, the timescale is ARB |
| 371 | (arbitrary)."; |
| 372 | } |
| 373 | leaf time-source { |
| 374 | type uint8; |
| 375 | description |
| 376 | "The source of time used by the grandmaster clock."; |
| 377 | |
| 378 | } |
| 379 | } |
| 380 | |
| 381 | grouping port-ds-entry { |
| 382 | description |
| 383 | "Collection of members of the port data set."; |
| 384 | |
| 385 | container port-identity { |
| 386 | description |
| 387 | "The portIdentity attribute of the local port."; |
| 388 | uses port-identity-grouping; |
| 389 | } |
| 390 | |
| 391 | leaf port-state { |
| 392 | type port-state-enumeration; |
| 393 | default "INITIALIZING"; |
| 394 | description |
| 395 | "Current state associated with the port."; |
| 396 | } |
| 397 | |
| 398 | leaf log-min-delay-req-interval { |
| 399 | type int8; |
| 400 | description |
| 401 | "The base-two logarithm of the minDelayReqInterval |
| 402 | (the minimum permitted mean time interval between |
| 403 | successive Delay_Req messages)."; |
| 404 | } |
| 405 | |
| 406 | leaf peer-mean-path-delay { |
| 407 | type time-interval-type; |
| 408 | default 0; |
| 409 | description |
| 410 | "An estimate of the current one-way propagation delay |
| 411 | on the link when the delayMechanism is P2P; otherwise, |
| 412 | it is zero."; |
| 413 | } |
| 414 | |
| 415 | leaf log-announce-interval { |
| 416 | type int8; |
| 417 | description |
| 418 | "The base-two logarithm of the mean |
| 419 | announceInterval (mean time interval between |
| 420 | successive Announce messages)."; |
| 421 | } |
| 422 | |
| 423 | leaf announce-receipt-timeout { |
| 424 | type uint8; |
| 425 | description |
| 426 | "The number of announceInterval that have to pass |
| 427 | without receipt of an Announce message before the |
| 428 | occurrence of the event ANNOUNCE_RECEIPT_TIMEOUT_ |
| 429 | EXPIRES."; |
| 430 | } |
| 431 | |
| 432 | leaf log-sync-interval { |
| 433 | type int8; |
| 434 | description |
| 435 | "The base-two logarithm of the mean SyncInterval |
| 436 | for multicast messages. The rates for unicast |
| 437 | transmissions are negotiated separately on a per port |
| 438 | basis and are not constrained by this attribute."; |
| 439 | } |
| 440 | |
| 441 | leaf delay-mechanism { |
| 442 | type delay-mechanism-enumeration; |
| 443 | description |
| 444 | "The propagation delay measuring option used by the |
| 445 | port in computing meanPathDelay."; |
| 446 | } |
| 447 | |
| 448 | leaf log-min-pdelay-req-interval { |
| 449 | type int8; |
| 450 | description |
| 451 | "The base-two logarithm of the |
| 452 | minPdelayReqInterval (minimum permitted mean time |
| 453 | interval between successive Pdelay_Req messages)."; |
| 454 | |
| 455 | } |
| 456 | |
| 457 | leaf version-number { |
| 458 | type uint8; |
| 459 | description |
| 460 | "The PTP version in use on the port."; |
| 461 | } |
| 462 | } |
| 463 | |
| 464 | grouping transparent-clock-default-ds-entry { |
| 465 | description |
| 466 | "Collection of members of the transparentClockDefault data |
| 467 | set (default data set for a transparent clock)."; |
| 468 | |
| 469 | leaf clock-identity { |
| 470 | type clock-identity-type; |
| 471 | description |
| 472 | "The clockIdentity of the transparent clock."; |
| 473 | } |
| 474 | leaf number-ports { |
| 475 | type uint16; |
| 476 | description |
| 477 | "The number of PTP ports on the device."; |
| 478 | } |
| 479 | leaf delay-mechanism { |
| 480 | type delay-mechanism-enumeration; |
| 481 | description |
| 482 | "The propagation delay measuring option |
| 483 | used by the transparent clock."; |
| 484 | } |
| 485 | leaf primary-domain { |
| 486 | type uint8; |
| 487 | default 0; |
| 488 | description |
| 489 | "The domainNumber of the primary syntonization domain."; |
| 490 | |
| 491 | } |
| 492 | } |
| 493 | |
| 494 | grouping transparent-clock-port-ds-entry { |
| 495 | description |
| 496 | "Collection of members of the transparentClockPort data |
| 497 | set (port data set for a transparent clock)."; |
| 498 | |
| 499 | container port-identity { |
| 500 | description |
| 501 | "The portIdentity of the local port."; |
| 502 | |
| 503 | uses port-identity-grouping; |
| 504 | } |
| 505 | leaf log-min-pdelay-req-interval { |
| 506 | type int8; |
| 507 | description |
| 508 | "The logarithm to the base 2 of the |
| 509 | minPdelayReqInterval (minimum permitted mean time |
| 510 | interval between successive Pdelay_Req messages)."; |
| 511 | } |
| 512 | leaf faulty-flag { |
| 513 | type boolean; |
| 514 | default false; |
| 515 | description |
| 516 | "When set, the port is faulty."; |
| 517 | } |
| 518 | leaf peer-mean-path-delay { |
| 519 | type time-interval-type; |
| 520 | default 0; |
| 521 | description |
| 522 | "An estimate of the current one-way propagation delay |
| 523 | on the link when the delayMechanism is P2P; otherwise, |
| 524 | it is zero."; |
| 525 | } |
| 526 | } |
| 527 | |
| 528 | list instance-list { |
| 529 | |
| 530 | key "instance-number"; |
| 531 | |
| 532 | description |
| 533 | "List of one or more PTP datasets in the device, one for |
| 534 | each domain (see IEEE 1588-2008 subclause 6.3). |
| 535 | Each PTP dataset represents a distinct instance of |
| 536 | PTP implementation in the device (i.e. distinct |
| 537 | Ordinary Clock or Boundary Clock)."; |
| 538 | |
| 539 | leaf instance-number { |
| 540 | type uint16; |
| 541 | description |
| 542 | "The instance number of the current PTP instance"; |
| 543 | } |
| 544 | container default-ds { |
| 545 | description |
| 546 | "The default data set of the clock."; |
| 547 | uses default-ds-entry; |
| 548 | } |
| 549 | |
| 550 | container current-ds { |
| 551 | description |
| 552 | "The current data set of the clock."; |
| 553 | uses current-ds-entry; |
| 554 | } |
| 555 | |
| 556 | container parent-ds { |
| 557 | description |
| 558 | "The parent data set of the clock."; |
| 559 | uses parent-ds-entry; |
| 560 | } |
| 561 | |
| 562 | container time-properties-ds { |
| 563 | description |
| 564 | "The timeProperties data set of the clock."; |
| 565 | uses time-properties-ds-entry; |
| 566 | } |
| 567 | |
| 568 | list port-ds-list { |
| 569 | key "port-number"; |
| 570 | description |
| 571 | "List of port data sets of the clock."; |
| 572 | leaf port-number{ |
| 573 | type leafref{ |
| 574 | path "../port-identity/port-number"; |
| 575 | } |
| 576 | description |
| 577 | "Refers to the portNumber memer of |
| 578 | portDS.portIdentity."; |
| 579 | } |
| 580 | uses port-ds-entry; |
| 581 | } |
| 582 | } |
| 583 | |
| 584 | container transparent-clock-default-ds { |
| 585 | description |
| 586 | "The members of the transparentClockDefault Data Set"; |
| 587 | uses transparent-clock-default-ds-entry; |
| 588 | } |
| 589 | |
| 590 | list transparent-clock-port-ds-list { |
| 591 | key "port-number"; |
| 592 | description |
| 593 | "List of transparentClockPort data sets |
| 594 | of the transparent clock."; |
| 595 | leaf port-number { |
| 596 | type leafref { |
| 597 | path "../port-identity/port-number"; |
| 598 | } |
| 599 | description |
| 600 | "Refers to the portNumber memer |
| 601 | of transparentClockPortDS.portIdentity."; |
| 602 | } |
| 603 | uses transparent-clock-port-ds-entry; |
| 604 | } |
| 605 | } |