Related Documentation
Example: Configuring Precision Time Protocol
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 3D Universal Edge Routers 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 master clock and the slave clock. PTP also supports boundary clock.
![]() | Note: You can set the values for each parameter according to your requirement. The values given in this example are for illustration purposes only. |
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 protocols ptp clock-mode boundary priority1 1 priority2 2 domain 0 unicast-negotiation
set protocols ptp slave announce-timeout 2 delay-request –4 frequency-only
set protocols ptp slave interface ge-1/2/3.0 unicast-mode transport ipv4
set protocols ptp slave interface ge-1/2/3.0 unicast-mode clock-source 2.2.2.2 local-ip-address 3.3.3.3
set protocols ptp master announce-interval 0 clock-step one-step sync-interval 0
set protocols ptp master interface ge-1/2/0.3 unicast-mode transport ipv4
set protocols ptp master interface ge-1/2/0.3 unicast-mode clock-client 10.10.1.1 local-ip-address 100.1.1.1
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 Junos OS CLI User Guide .
For step-by-step configuration, see Configuring Precision Time Protocol.
To configure PTP, perform the following tasks:
- 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 announce timeout, delay request, interface
IP address, and encapsulation type for the slave.[edit protocols ptp slave]user@host# set announce-timeout 2 delay-request 0 interface ge-1/2/3.0 unicast-mode transport ipv4
- Configure the clock master option and the local-ip-address option for the slave node.[edit protocols ptp slave interface ge-1/2/3.0 unicast-mode]user@host# set clock-source 2.2.2.2 local-ip-address 3.3.3.3
- Configure the announce interval, clock step, synchronous
interval, interface IP address, and encapsulation type for the master.[edit protocols ptp master]user@host# set announce-interval 0 clock-step one-step sync-interval 0 interface ge-1/2/3.0 unicast-mode transport ipv4
- Configure the clock client for the master.[edit protocols ptp master interface ge-1/2/3.0 unicast-mode]user@host# set clock-client10.10.1.1 local-ip-address 100.1.1.1
Results
Display the results of the configuration:
Verification
Confirm that the configuration is working properly.
- Verifying the PTP Clock Details
- Verifying the Lock Status of the Slave
- Verifying the PTP Options on the Slave
- Verifying the PTP Options and the Current Status of the Master
- Verifying the Number and Status of the PTP Ports
Verifying the 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 in the Junos OS System Basics and Services Command Reference .
Verifying the Lock Status of the Slave
Purpose
Verify that the slave clock is aligned to the master clock by checking the lock status of the slave.
Action
In operational mode, enter the run show ptp lock-status command to display the lock status of the slave.
Meaning
The output displays information about the lock status of the slave. The output shows whether the slave is aligned to the master clock or not. For more information about the run show ptp lock-status operational command, see show ptp lock-status in the Junos OS System Basics and Services Command Reference .
Verifying the PTP Options on the Slave
Purpose
Verify the PTP options that are set on the slave and its current status.
Action
In operational mode, enter the run show ptp slave command to display the configured slave.
Meaning
The output displays information about the configured slave and the status of the slave. For more information about the run show ptp slave operational command, see show ptp slave in the Junos OS System Basics and Services Command Reference .
Verifying the PTP Options and the Current Status of the Master
Purpose
Verify the PTP options that are set for the master and its current status.
Action
In operational mode, enter the run show ptp master command to display the configured options for the master.
Meaning
The output displays information about the configured master and the current status of the master. For more information about the run show ptp master operational command, see show ptp master in the Junos OS System Basics and Services Command Reference .
Verifying 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 in the Junos OS System Basics and Services Command Reference .