Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

Example: Configure Precision Time Protocol

You can configure the timeTransmitter clock and the timeReceiver 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 timeTransmitter clock and the timeReceiver clock.

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 timeTransmitter clock and the timeReceiver 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.

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

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.

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:

  1. Configure two interfaces and assign IP addresses to it.

  2. Configure the clock mode, priorities, domain, and unicast negotiation options for PTP.

  3. Configure the timeReceiver interface

  4. Configure the announce timeout, delay request, and frequency synchronization parameters for the timeReceiver.

  5. Assign the IP address of the remote timeTransmitter using the clock-source option and the IP address of the local interface acting as the timeReceiver.

  6. Configure the timeTransmitter interface

  7. Configure the announce interval, clock step, and synchronous interval parameters for the timeTransmitter.

  8. Configure the remote PTP host that will receive time from the PTP timeTransmitter using the clock-client option and the IP address of the local interface acting as timeTransmitter.

Result

Display the results of the configuration:

Verification

Confirm that the configuration is working properly.

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 timeReceiver clock is aligned to the timeTransmitter clock by checking the lock status of the timeReceiver.

Action

In operational mode, enter the run show ptp lock-status command to display the lock status of the timeReceiver.

Meaning

The output displays information about the lock status of the timeReceiver. The output shows whether the timeReceiver is aligned to the timeTransmitter 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 timeReceiver and its current status.

Action

In operational mode, enter the run show ptp slave command to display the configured timeReceiver.

Meaning

The output displays information about the configured timeReceiver and the status of the timeReceiver. 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 timeTransmitter.

Meaning

The output displays information about the configured timeTransmitter and the current status of the timeTransmitter. 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.