The ptp clock-source command sets the attributes of the clock source and time source.
The undo ptp clock-source command cancels the settings.
For default values of the parameters, see the parameter description.
ptp clock-source local { clock-accuracy clock-accuracy | clock-class clock-class | priority1 priority1 | priority2 priority2 | time-source time-source } slot slot-id
undo ptp clock-source local { clock-accuracy | clock-class | priority1 | priority2 | time-source } slot slot-id
After G.8275.1 is enabled, only the priority2 priority2 and time-source time-source parameters are supported.
Parameter |
Description |
Value |
---|---|---|
local |
Indicates the local clock. |
- |
clock-accuracy clock-accuracy |
Specifies an attribute defining the accuracy of a clock. |
The value of clock-accuracy is a hexadecimal number that is in the range of 0 to FF. You can set the value to 20-31 or 80-FD. The default accuracy of the local clock is 31. The accuracy values mapping the values of clock-accuracy-value are as follows:
|
clock-class clock-class |
Specifies the attribute of an ordinary or boundary clock denotes the traceability of the time or frequency distributed by the grandmaster clock, that is the capability to trace the International Atomic Time (TAI). |
The value of clock-class is an integer that ranges from 0 to 255. The default value of the local clock is 187. The capabilities to trace the TAI mapping the values of clock-class-value are as follows:
|
priority1 priority1 |
Specifies a user configurable designation that a clock belongs to an ordered set of clocks from which a master is selected. The attribute priority1 is used in the execution of the best master clock algorithm. |
The value of priority1 is an integer that ranges from 0 to 255. The default value is 128. Lower values take precedence. |
priority2 priority2 |
Specifies a user configurable designation that provides finer grained ordering among otherwise equivalent clocks. The attribute priority2 is used in the execution of the best master clock algorithm. |
The value of priority2 is an integer that ranges from 0 to 255. The default value is 128. Lower values take precedence. |
time-source time-source |
Specifies the source of time used by the grandmaster clock. |
The value of time-source is an integer that ranges from 1 to 8. The default value of the local clock is 8 (INTERNAL_OSCILLATOR). The attributes mapping the values of time-source-value are as follows:
|
slot slot |
Specifies the slot ID. |
The value range depends on the device configuration. |
The time-source parameter specifies the clock source attribute used by the grandmaster clock device and the value is set according to the clock source connected to the device.
When the BMC algorithm is used by the PTP device for master clock selection, priority1 > clock-class > clock-accuracy > priority2 of each candidate time source is compared first. If the priority1 of candidate time sources is the same, clock-class is compared, clock-accuracy and priority2. The time source with the highest priority is selected as the master clock.
A smaller clock-class value indicates a higher clock class. When the clock-class of a device is smaller than 128, the device cannot function as a slave clock. Therefore, do not set a high clock-class for a slave clock. Otherwise, the PTP interface of the slave clock cannot enter the slave state, and the device cannot synchronize with the master clock.
# Configure the time source of the local clock to ATOMIC_CLOCK.
<HUAWEI> system-view [HUAWEI] ptp clock-source local time-source 1 slot 0
# Set priority 1 of the local clock to 1.
<HUAWEI> system-view [HUAWEI] ptp clock-source local priority1 1 slot 0
# Set priority 2 of the local clock to 1.
<HUAWEI> system-view [HUAWEI] ptp clock-source local priority2 1 slot 0
# Set the class of the local clock to 10.
<HUAWEI> system-view [HUAWEI] ptp clock-source local clock-class 10 slot 0
# Set the accuracy of the local clock to 31 (accurate to >10s).
<HUAWEI> system-view [HUAWEI] ptp clock-source local clock-accuracy 31 slot 0