< Home

Master-Slave Hierarchy Establishment

During the establishment of the master-slave hierarchy, PTP selects the grandmaster clock (GMC) and determines the master and slave ports.

Process of Establishing the Master-Slave Hierarchy

In PTP, ports receive and send Announce messages to exchange data sets and port state machine information. The best master clock (BMC) algorithm compares the data sets and port state machine information to establish the master-slave hierarchy. The process of establishing the master-slave hierarchy is as follows:

  1. The local device receives and processes the Announce message from the peer port.

  2. The local device uses the BMC algorithm to determine the GMC and recommended state of the local port, namely, master, slave, or passive.

  3. The local device updates data sets based on the recommended port state.

  4. The local device determines the actual port status based on the port state machine and establishes the master-slave hierarchy based on the recommended state and the state decision event. The state decision event includes the Announce message receiving event and the Announce message timeout event. When the interval at which a port receives an Announce message is larger than the Announce message timeout period, the state of the port is set to master.

BMC Algorithm

The BMC algorithm is used to select the GMC and determine port states in a PTP domain. It compares the data sets carried in the Announce messages exchanged between clock nodes to select the GMC and determine the PTP port states.

The BMC algorithm compares the following attributes in Announce messages in sequence:

  • Priority1: indicates clock priority 1. The value is configurable and ranges from 0 to 255. A smaller value indicates a higher priority.
  • ClockClass: defines the traceability of the International Atomic Time (TAI) of the clock time or frequency.
  • ClockAccuracy: defines the accuracy of a clock. A smaller value indicates a higher accuracy.
  • OffsetScaledLogVariance: defines the stability of a clock.
  • Priority2: indicates clock priority 2. The value is configurable and ranges from 0 to 255. A smaller value indicates a higher priority.

When the BMC algorithm is used by a PTP device for GMC selection, Priority1 of each candidate time source is compared first, then ClockClass, ClockAccuracy, OffsetScaledLogVariance, and Priority2. If Priority1 of candidate time sources is the same, ClockClass is compared, and so on. The time source with the highest priority, class, and accuracy is selected as the GMC.

You can change the preceding attributes to influence the way the PTP master clock is selected, and finally select the clock signals to receive. The BMC algorithm can allocate PTP clock sources and implement protective switchover.

Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >