Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

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:

  1. In configuration mode, go to the [edit protocols ptp] hierarchy level:
  2. 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 primary clock and a client clock. The ordinary option signifies that the clock is either a primary clock or a client clock.

  3. Configure the PTP domain option with values from 0 through 127. The default value is 0.
  4. Configure the priority1 option with values from 0 through 254. The default value is 128.

    The priority1 value determines the best primary clock. The priority1-value is also advertised in the primary clock’s announce message to other slaves.

  5. Configure the priority2 option with values from 0 through 255. The default value is 128.

    The priority2 value differentiates and prioritizes the primary clock to avoid confusion when priority1-value is the same for different primary clocks in a network.

  6. 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 primary clock and the client clock before a PTP session is established.

    Note:

    Unicast negotiation, when enabled, does not allow you to commit any packet rate–related configuration.

Configure Member Clock Options

Configure the following options after the aforementioned PTP options have been set.

  1. Configure the member clock.
  2. Configure the announce-timeout option in the client 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 client without receiving the announce message—that is, the timeout period for announce messages.

  3. Configure the delay-request option in the client 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 client to the primary.

  4. Configure the frequency-only option to enable only frequency synchronization in the client.
    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 client.

  5. Configure the interface for the client.
  6. Configure the unicast-mode option for the client. You can set this option when PTP unicast mode of messaging is needed.
  7. Configure the transport option in unicast mode as IPv4.

    The encapsulation type for PTP packet transport is IPv4.

  8. Configure the IP address of the client.
  9. Configure the IP address of the interface acting as the local PTP client port.
    Note:

    You must configure this IP address at the [edit interfaces interface-name] hierarchy level.

  10. You can configure PTP over IPv4 over a link aggregation group for MPC2E NG, MPC3E NG, MPC5E, MPC6E, MPC7E-10G, MPC7E-MRATE, MPC8E, and MPC9E.

    For each aggregated Ethernet link configured as PTP client, you can specify one member link of the aggregated Ethernet bundle as primary and another as secondary.

  11. You can configure multicast mode option for the client port. In this mode, PTP over Ethernet uses multicast addresses and a client port can automatically start receiving the multicast announce messages transmitted by the primary ports on a network. The client port can start communicating with the primary port with minimal or no configuration.
  12. Configure Ethernet as the encapsulation type of transport for the PTP packets. You can further enable 802.3 Ethernet encapsulation to use a specific set of multicast MAC addresses while transmitting the PTP packets over Ethernet.
    Note:

    It is mandatory to use the transport statement while configuring the multicast-mode for primary and client interfaces.

  13. You can configure PTP over Ethernet over a link aggregation group for MPC5E, MPC6E, MPC7E-10G, MPC7E-MRATE, MPC8E, MPC9E, and MPC10E line cards.

    For each aggregated Ethernet link configured as PTP client, you can specify one member link of the aggregated Ethernet bundle as primary and another as secondary.

Configure Primary Clock Options

Configure the following options after the aforementioned PTP options and client clock options have been set.

  1. Configure the primary clock.
  2. Configure the announce interval option for the primary 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 primary. By default, one announce message is sent in every two seconds.

  3. Configure the clock step option as either one-step or two-step for the primary. 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.

  4. Configure the sync interval option for the primary 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 primary. By default, 64 synchronous interval messages are sent per second.

  5. Configure the interface for the primary.
  6. Configure the unicast mode option for the primary. You can set this option when PTP unicast mode of messaging is needed.
  7. Configure the transport option in unicast mode as IPv4.

    The encapsulation type for PTP packet transport is IPv4.

  8. Configure the IP address for the client.
  9. Configure the IP address of the interface acting as the local PTP primary port.
  10. You can configure PTP over IPv4 over a link aggregation group for MPC2E NG, MPC3E NG, MPC5E, MPC6E, MPC7E-10G, MPC7E-MRATE, MPC8E, and MPC9E.

    For each aggregated Ethernet link configured as PTP primary, you can specify one member link of the aggregated Ethernet bundle as primary and another as secondary.

  11. You can configure multicast mode option for the primary port. In this mode, PTP over Ethernet uses multicast addresses and a client port can automatically start receiving the multicast announce messages transmitted by the primary ports on a network. The client port can start communicating with the primary port with minimal or no configuration.
  12. Configure Ethernet as the encapsulation type of transport for the PTP packets. You can further enable 802.3 Ethernet encapsulation to use a specific set of multicast MAC addresses while transmitting the PTP packets over Ethernet.
    Note:

    It is mandatory to use the transport statement while configuring the multicast-mode for primary and client interfaces.

  13. You can configure PTP over Ethernet over a link aggregation group for MPC5E, MPC6E, MPC7E-10G, MPC7E-MRATE, MPC8E, MPC9E, and MPC10E line cards.

    For each aggregated Ethernet link configured as PTP primary, you can specify one member link of the aggregated Ethernet bundle as primary and another as secondary.

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/24set interfaces ge-0/1/5 unit 0 family inet address 198.51.100.5/24set protocols ptp clock-mode boundary priority1 1 priority2 2 domain 0 unicast-negotiationset protocols ptp slave interface ge-0/1/0.0 unicast-mode transport ipv4set protocols ptp slave announce-timeout 2 delay-request –4 frequency-onlyset protocols ptp slave interface ge-0/1/0.0 unicast-mode clock-source 192.0.2.3 local-ip-address 192.0.2.5set protocols ptp master interface ge-0/1/5.0 unicast-mode transport ipv4set protocols ptp master announce-interval 0 clock-step one-step sync-interval 0set 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:

  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 client interface

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

  5. 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.

  6. Configure the primary interface

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

  8. 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.

Results

Display the results of the configuration:

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.

Note:

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

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.

Note:

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:

  1. Configure physical interfaces with Layer 2 encapsulation and create logical units with VLANs.

    Sample configuration:

  2. Configure physical interfaces on a bridge domain.

    Sample configuration:

  3. Configure a routing instance for the bridge domain where physical interfaces are members of the bridge domain.

    Sample configuration:

  4. Configure an IRB logical interface with IPv4 address.

    Sample configuration:

  5. Configure PTP boundary clock primary on IRB logical interface.

    Sample configuration:

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.