Configure Precision Time Protocol (PTP)
SUMMARY You can configure the primary clock and the client clock for Precision Time Protocol (PTP) to help synchronize clocks in a distributed system. The time synchronization is achieved through packets that are transmitted and received in a session between the primary clock and the client clock.
Configure PTP
Configure PTP Options
To configure PTP options:
Configure Member Clock Options
Configure the following options after the aforementioned PTP options have been set.
Configure Primary Clock Options
Configure the following options after the aforementioned PTP options and client clock options have been set.
Example: Configure Precision Time Protocol
Configuration
CLI Quick Configuration
To quickly configure PTP on an interface, copy the following commands, paste them in a text file, remove any line breaks, and then copy and paste the commands into the CLI.
[edit]
set interfaces ge-0/1/0 unit 0 family inet address
192.0.2.5/24
set interfaces ge-0/1/5 unit 0
family inet address 198.51.100.5/24
set
protocols ptp clock-mode boundary priority1 1 priority2 2 domain 0
unicast-negotiation
set protocols ptp slave
interface ge-0/1/0.0 unicast-mode transport
ipv4
set protocols ptp slave announce-timeout 2
delay-request –4 frequency-only
set protocols
ptp slave interface ge-0/1/0.0 unicast-mode clock-source 192.0.2.3
local-ip-address 192.0.2.5
set protocols ptp
master interface ge-0/1/5.0 unicast-mode transport
ipv4
set protocols ptp master announce-interval
0 clock-step one-step sync-interval 0
set
protocols ptp master interface ge-0/1/5.0 unicast-mode clock-client
198.51.100.3 local-ip-address 198.51.100.5
Step-by-Step Procedure
The following example requires you to navigate various levels in the configuration hierarchy. For instructions on how to do that, see Using the CLI Editor in Configuration Mode in the CLI User Guide.
To configure PTP, perform the following tasks:
-
Configure two interfaces and assign IP addresses to it.
[edit] user@host# set interfaces ge-0/1/0 unit 0 family inet address 192.0.2.5/24 user@host# set interfaces ge-0/1/5 unit 0 family inet address 198.51.100.5/24
-
Configure the clock mode, priorities, domain, and unicast negotiation options for PTP.
[edit protocols ptp] user@host# set clock-mode boundary priority1 1 priority2 2 domain 0 unicast-negotiation
-
Configure the client interface
[edit protocols ptp slave] user@host# set interface ge-0/1/0.0 unicast-mode transport ipv4
-
Configure the announce timeout, delay request, and frequency synchronization parameters for the client.
[edit protocols ptp slave] user@host# set announce-timeout 2 delay-request -4 frequency-only
-
Assign the IP address of the remote primary using the
clock-source
option and the IP address of the local interface acting as the client.[edit protocols ptp slave interface ge-0/1/0.0 unicast-mode] user@host# set clock-source 192.0.2.3 local-ip-address 192.0.2.5
-
Configure the primary interface
[edit protocols ptp master] user@host# set interface ge-0/1/5.0 unicast-mode transport ipv4
-
Configure the announce interval, clock step, and synchronous interval parameters for the primary.
[edit protocols ptp master] user@host# set announce-interval 0 clock-step one-step sync-interval 0
-
Configure the remote PTP host that will receive time from the PTP primary using the clock-client option and the IP address of the local interface acting as primary.
[edit protocols ptp master interface ge-0/1/5.0 unicast-mode] user@host# set clock-client 198.51.100.3 local-ip-address 198.51.100.5
Results
Display the results of the configuration:
[edit protocols ptp] user@host# show clock-mode boundary; priority1 1; priority2 2; domain 0; unicast-negotiation; slave { frequency-only; delay-request -4; announce-timeout 2; interface ge-0/1/0.0 { unicast-mode { transport ipv4; clock-source 192.0.2.3 local-ip-address 192.0.2.5; } } } master { announce-interval 0; sync-interval 0; clock-step one-step; interface ge-0/1/5.0 { unicast-mode { transport ipv4; clock-client 198.51.100.3 local-ip-address 198.51.100.5; } } }
Requirements for PTP Configuration
This example uses the following hardware and software components:
-
One MX80, MX240, MX480, or MX960 router
-
Junos OS Release 12.2 or later
Overview
This example shows the configuration of Precision Time Protocol (PTP) on all Ethernet Modular Interface Cards (MICs) on the enhanced Module Port Concentrator (MPCE) MX-MPC2E-3D-P on MX240, MX480, and MX960 routers and on the MX80 Universal Routing Platforms with precision timing support (MX80-P).
PTP synchronizes clocks between nodes in a network, thereby enabling the distribution of an accurate clock over a packet switched network. This synchronization is achieved through packets that are transmitted and received in a session between the primary clock and the client clock. PTP also supports boundary clock.
You can set the values for each parameter according to your requirement. The values given in this example are for illustration purposes only.
Verification
Confirm that the configuration is working properly.
- Verify PTP Clock Details
- Verify the Lock Status of the Member
- Verify the PTP Options on the Member
- Verify the PTP Options and the Current Status of the Primary
- Verify the Number and Status of the PTP Ports
Verify PTP Clock Details
Purpose
Verify that the PTP clock is working as expected.
Action
In operational mode, enter the run show ptp clock
command to display the clock details.
Meaning
The output displays the clock details, which include the parameters
configured on the node. For more information about the run show
ptp clock
operational command, see show ptp clock.
Verify the Lock Status of the Member
Purpose
Verify that the client clock is aligned to the primary clock by checking the lock status of the client.
Action
In operational mode, enter the run show ptp lock-status
command to display the lock status of the client.
Meaning
The output displays information about the lock status of the client. The
output shows whether the client is aligned to the primary clock or not.
For more information about the run show ptp lock-status
operational command, see show ptp lock
status.
Verify the PTP Options on the Member
Purpose
Verify the PTP options that are set on the client and its current status.
Action
In operational mode, enter the run show ptp slave
command to display the configured client.
Meaning
The output displays information about the configured client and the
status of the client. For more information about the run show
ptp slave
operational command, see show ptp slave.
Verify the PTP Options and the Current Status of the Primary
Purpose
Verify the PTP options that are set for the ` and its current status.
Action
In operational mode, enter the run show ptp master
command to display the configured options for the primary.
Meaning
The output displays information about the configured primary and the
current status of the primary. For more information about the
run show ptp master
operational command, see show ptp master.
Verify the Number and Status of the PTP Ports
Purpose
Verify the number of PTP ports and their current status.
Action
In operational mode, enter the run show ptp port
command
to display the configured ports.
Meaning
The output displays information about the number of ports created
according to the configuration and their current status. For each unique
local IP address, one PTP port is created. For more information about
the run show ptp port
operational command, see show ptp port.
Configure PTP Over Integrated Routing and Bridging (IRB)
Junos OS for ACX Series router supports configuring precision time protocol (PTP) over integrated routing and bridging (IRB). You can configure a boundary clock node with PTP (IPv4) over IRB in a primary-only mode across single or multiple IRB logical interfaces.
Starting in Junos OS Release 20.1R1, PTP is supported over IRB on primary
interface configurations for MPC7E line cards. This release also supports the
configuration of aggregated Ethernet over IRB. The
disable-lag-revertive-switchover
command is also added at a
global level. This configuration enables nonrevertive switchover for a LAG.
To configure Precision Time Protocol (PTP) over IRB:
You can use the following commands to monitor and troubleshoot the configuration:
-
show interfaces irb
—View the configured logical IRB interface details. -
show ptp master detail
—View the configured primary and its status along with local and remote client details. -
show bridge domain
—View the configured bridge domain and the associated physical interfaces and IRB routing instance details. -
show ptp lock-status detail
—View the PTP lock status details. -
show ptp port detail
—View the PTP port details. -
show ptp global-information
—View the configured PTP parameters. -
show ptp clock
—View the PTP clock information.