netconfcentral logo

ietf-ptp@2017-11-28



  module ietf-ptp {

    yang-version 1;

    namespace
      "urn:ietf:params:xml:ns:yang:ietf-ptp";

    prefix ptp;

    import ietf-interfaces {
      prefix if;
    }

    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-11-28" {
      description "Version 7.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 multiplied 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 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 clock-quality-grouping

    container ptp {
      description
        "The PTP struct containing all attributes of PTP Dataset,
        other optional PTP attributes can be augmented as well.";
      list instance-list {
        key "instance-number";
        description
          "List of one or more PTP datasets in the device (see IEEE
         Std 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 uint32;
          description
            "The instance number of the current PTP instance.
            This instance number is used for management purposes
            only. This instance number does not represent the PTP
            domain number, and is not used in PTP messages.";
        }

        container default-ds {
          description
            "The default data set of the clock (see IEEE Std
           1588-2008 subclause 8.2.1).";
          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 instance.";
          }

          container clock-quality {
            description
              "The clockQuality of the local clock.";
            uses clock-quality-grouping;
          }  // container clock-quality

          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.";
          }
        }  // container default-ds

        container current-ds {
          description
            "The current data set of the clock (see IEEE Std
           1588-2008 subclause 8.2.2).";
          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.";
          }
        }  // container current-ds

        container parent-ds {
          description
            "The parent data set of the clock (see IEEE Std 1588-2008
           subclause 8.2.3).";
          container parent-port-identity {
            description
              "The portIdentity of the port on the master, it
             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";
            }
          }  // container parent-port-identity

          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 '65535';
            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;
          }  // container grandmaster-clock-quality

          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.";
          }
        }  // container parent-ds

        container time-properties-ds {
          description
            "The timeProperties data set of the clock (see
           IEEE Std 1588-2008 subclause 8.2.4).";
          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.";
          }
        }  // container time-properties-ds

        list port-ds-list {
          key "port-number";
          description
            "List of port data sets of the clock (see IEEE Std
           1588-2008 subclause 8.2.5).";
          leaf port-number {
            type uint16;
            description
              "Port number.
             The data sets (i.e. information model) of IEEE Std
             1588-2008 specify a member portDS.portIdentity, which
             uses a typed struct with members clockIdentity and
             portNumber.

             In this YANG data model, portIdentity is not modeled
             in the port-ds-list, however, its members are provided
             as follows:
             portIdentity.portNumber is provided as this port-
             number leaf in port-ds-list; and
             portIdentity.clockIdentity is provided as the clock-
             identity leaf in default-ds of the instance
             (i.e. ../../default-ds /clock-identity).";
          }

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

          leaf underlying-interface {
            type if:interface-ref;
            description
              "Reference to the configured underlying interface that
             is used by this PTP Port (see RFC 7223).";
          }

          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.";
          }
        }  // list port-ds-list
      }  // list instance-list

      container transparent-clock-default-ds {
        description
          "The members of the transparentClockDefault Data Set (see
        IEEE Std 1588-2008 subclause 8.3.2).";
        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 Transparent Clock.";
        }

        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.";
        }
      }  // container transparent-clock-default-ds

      list transparent-clock-port-ds-list {
        key "port-number";
        description
          "List of transparentClockPort data sets of the transparent
        clock (see IEEE Std 1588-2008 subclause 8.3.3).";
        leaf port-number {
          type uint16;
          description
            "Port number.
            The data sets (i.e. information model) of IEEE Std
            1588-2008 specify a member
            transparentClockPortDS.portIdentity, which uses a typed
            struct with members clockIdentity and portNumber.

            In this YANG data model, portIdentity is not modeled in
            the transparent-clock-port-ds-list, however,
            portIdentity.portNumber is provided as this leaf member
            in transparent-clock-port-ds-list.";
        }

        leaf clock-identity {
          type clock-identity-type;
          description
            "clock-identity.
            The data sets (i.e. information model) of IEEE Std
            1588-2008 specify a member
            transparentClockPortDS.portIdentity, which uses a typed
            struct with members clockIdentity and portNumber.

            In this YANG data model, portIdentity is not modeled in
            the transparent-clock-port-ds-list, however,
            portIdentity.clockIdentity is provided as this leaf
            member in transparent-clock-port-ds-list.";
        }

        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 transparent-clock-port-ds-list
    }  // container ptp
  }  // module ietf-ptp