The ptp clock-source command sets clock source parameters.
The undo ptp clock-source command restores default clock source parameters.
For information about default values, see the Value column in the "Parameters" part.
ptp clock-source local { time-source time-source-value | clock-accuracy clock-accuracy-value | clock-class clock-class-value | priority1 priority1-value | priority2 priority2-value }
undo ptp clock-source local { time-source | clock-accuracy | clock-class | priority1 | priority2 }
ptp clock-source bits1 { time-source time-source-value | clock-accuracy clock-accuracy-value | clock-class clock-class-value | priority1 priority1-value | priority2 priority2-value | grandmaster-clockid clockid-value | offsetscaled-logvariance offsetscaled-value }
undo ptp clock-source bits1 { time-source | clock-accuracy | clock-class | priority1 | priority2 | grandmaster-clockid | offsetscaled-logvariance }
Parameter | Description | Value |
---|---|---|
bits1 |
External reference source bit1. |
- |
time-source time-source-value |
Specifies the value of a time source attribute. This parameter is configured only for the grandmaster. |
The value is a 2-character hexadecimal number. The default value is 8. The mapping between time source attributes and their values is as follows:
|
clock-accuracy clock-accuracy-value |
Specifies the accuracy value of a clock source. |
The value is a 2-character hexadecimal number. The default value is 0x20 for a BITS source. The mapping between clock accuracy attributes and their values is as following:
The default value is 0x31 for a local source in 1588v2 mode. The mapping between clock accuracy attributes and their values in 1588v2 mode is the same as the preceding information. The default value is 0xFE (unknown time accuracy) for a local source in G.8275.1 mode and CU-106 mode. The value cannot be configured. |
clock-class clock-class-value |
Specifies a clock class. |
The value is an integer ranging from 0 to 255. The default value is 6 for a BITS source. The mapping between clock class attributes and their values is as follows:
The default value is 187 for a local source in 1588v2 mode. The mapping between clock class attributes and their values in 1588v2 mode is the same as the preceding information. The default value is 248 for a local source in G.8275.1 mode and CU-106 mode. clock-class-value cannot be configured. If a device lost its tracked T-GM, clock-class-value becomes 165. The mapping between clock class attributes and their values G.8275.1 mode and CU-106 mode is as follows:
|
priority1 priority1-value |
Specifies the value of clock signal priority1. |
The value is an integer ranging from 0 to 255. The default value is 128. A smaller value indicates a higher priority. The G.8275.1 mode and CU-106 mode do not support priority1. |
priority2 priority2-value |
Specifies the value of clock signal priority2. |
The value is an integer ranging from 0 to 255. The default value is 128. A smaller value indicates a higher priority. |
grandmaster-clockid clockid-value |
Grand master clockid. |
The value is a string of 16 characters. The value is a string of 0 to 9, a to f, and A to F. |
offsetscaled-logvariance offsetscaled-value |
Offset scaled log variance. |
1: 0xFFFF 2: 0x4E5D 3: 0x4B32, the default is 1:0xFFFF. |
local |
Indicates the type of a clock source:
|
- |
Usage Scenario
The best master clock (BMC) algorithm enables dynamic 1588v2, G.8275.1, or CU-106 devices to automatically select the grandmaster and master clocks. To set parameters used by the BMC algorithm, run the ptp clock-source command.
Precautions
This command is supported only on the admin VS.
When a 1588v2-enabled Router uses the BMC algorithm to dynamically select a clock source, the device compares the following parameters in sequence: priority1> clock-class> clock-accuracy> priority2. The clock source with the highest priority is selected as the master clock. When G.8275.1 or CU-106 uses the BMC algorithm to select a master clock, candidate clocks are first compared by clock-class, then clock-accuracy, and finally priority2. The clock with the highest priority will be selected as the master clock.<HUAWEI> system-view [~HUAWEI] ptp enable [*HUAWEI] ptp clock-source local time-source 1
<HUAWEI> system-view [~HUAWEI] ptp enable [*HUAWEI] ptp clock-source local priority1 1
<HUAWEI> system-view [~HUAWEI] ptp enable [*HUAWEI] ptp clock-source local priority2 1
<HUAWEI> system-view [~HUAWEI] ptp enable [*HUAWEI] ptp clock-source local clock-accuracy 31
<HUAWEI> system-view [~HUAWEI] ptp enable [*HUAWEI] ptp clock-source local clock-class 10