Configuring Precision Time Protocol
You can configure the master clock and the slave clock for Precision Time Protocol (PTP) to help synchronize clocks in a distributed system. This time synchronization is achieved through packets that are transmitted and received in a session between the master clock and the slave clock.
Configuring Precision Time Protocol and its Options
This topic includes the following tasks:
Configuring PTP Options
To configure PTP options:
- In configuration mode, go to the [edit protocols ptp] hierarchy level:[edit]user@host# edit protocols ptp
- Configure the clock mode as either boundary or ordinary.
This attribute is mandatory and has no default value.
The boundary option signifies that the clock can be both a master clock and a slave clock. The ordinary option signifies that the clock is either a master clock or a slave clock.
[edit protocols ptp]user@host# set clock-mode (boundary | ordinary) - Configure the PTP domain option with values from 0 through
127. The default value is 0.[edit protocols ptp]user@host# set domain domain-value
- Configure the priority1 option with values
from 0 through 254. The default value is 128.
The priority1 value determines the best master clock. The priority1-value is also advertised in the master clock’s announce message to other slaves.
[edit protocols ptp]user@host# set priority1 priority1-value - Configure the priority2 option with values
from 0 through 255. The default value is 128.
The priority2 value differentiates and prioritizes the master clock to avoid confusion when priority1-value is the same for different master clocks in a network.
[edit protocols ptp]user@host# set priority2 priority2-value - Configure the unicast-negotiation option to
enable unicast negotiation.
Unicast negotiation is a method by which the announce, sync, and delay response packet rates are negotiated between the master clock and the slave clock before a PTP session is established.
[edit protocols ptp]user@host# set unicast-negotiationNote: Unicast negotiation, when enabled, does not allow you to commit any packet rate–related configuration.
Configuring Slave Clock Options
Configure the following options after the aforementioned PTP options have been set.
- Configure the slave clock.[edit protocols ptp]user@host# edit slave
- Configure the announce-timeout option in the
slave node with values from 2 through 10. The default value is 3.
The announce timeout value signifies the number of times an announce interval message has to pass through the slave without receiving the announce message—that is, the timeout period for announce messages.
[edit protocols ptp slave]user@host# set announce-timeout announce-timeout-value - Configure the delay-request option in the slave
node with values from –6 through 6. The default value is –4.
The delay request value is the logarithmic mean interval in seconds between the delay request messages sent by the slave to the master.
[edit protocols ptp slave]user@host# set delay-request delay-request-value - Configure the frequency-only option to enable
only frequency synchronization in the slave.[edit protocols ptp slave]user@host# set frequency-only
Note: This option is configured only when PTP is used for frequency synchronization and not for phase synchronization. Also, note that this option can only be set for an ordinary clock acting as slave.
- Configure the interface for the slave.[edit protocols ptp slave]user@host# edit interface interface-name
- Configure the unicast-mode option for the slave.
You can set this option when PTP unicast mode of messaging is needed.[edit protocols ptp slave interface interface-name]user@host# edit unicast-mode
- Configure the transport option in unicast mode
as IPv4.
The encapsulation type for PTP packet transport is IPv4.
[edit protocols ptp slave interface interface-name unicast-mode]user@host# set transport ipv4 - Configure the IP address of the master.[edit protocols ptp slave interface interface-name unicast-mode]user@host# edit clock-source ip-address
- Configure the IP address of the interface acting as the
local PTP slave port.[edit protocols ptp slave interface interface-name unicast-mode clock-source ip-address]user@host# set local-ip-address local-ip-address
Note: You must configure this IP address at the [edit interfaces interface-name] hierarchy level.
Configuring Master Clock Options
Configure the following options after the aforementioned PTP options and slave clock options have been set.
- Configure the master clock.[edit protocols ptp]user@host# edit master
- Configure the announce interval option for
the master with values from 0 through 4. The default value is 1.
The announce interval is the logarithmic mean interval between announce messages that is sent by the master. By default, one announce message is sent in every two seconds.
[edit protocols ptp master]user@host# set announce-interval announce-interval-value - Configure the clock step option as either one-step
or two-step for the master. The default value is one-step.
The clock step determines whether the timing information is sent along with the sync message only (one-step) or a subsequent follow-up message (two-step) is sent corresponding to the previous sync message.
[edit protocols ptp master]user@host# set clock-step (one-step | two-step) - Configure the sync interval option for the
master clock with values from –6 through 6. The default value
is –6.
The sync interval is the logarithmic mean interval between synchronous messages that is sent by the master. By default, 64 synchronous interval messages are sent per second.
[edit protocols ptp master]user@host# set sync-interval sync-interval-value - Configure the interface for the master.[edit protocols ptp master]user@host# edit interface interface-name
- Configure the unicast mode option for the master. You
can set this option when PTP unicast mode of messaging is needed.[edit protocols ptp master interface interface-name]user@host# edit unicast-mode
- Configure the transport option in unicast mode
as IPv4.
The encapsulation type for PTP packet transport is IPv4.
[edit protocols ptp master interface interface-name unicast-mode]user@host# set transport ipv4 - Configure the IP address for the slave.[edit protocols ptp master interface interface-name unicast-mode]user@host# edit clock-client ip-address
- Configure the IP address of the interface acting as the
local PTP master port.[edit protocols ptp master interface interface-name unicast-mode clock-client ip-address]user@host# set local-ip-address local-ip-address