Configuring PTP

This chapter describes how to configure the Precision Time Protocol (PTP) on Cisco NX-OS devices.

This chapter includes the following sections:

About PTP

PTP is a time synchronization protocol defined in IEEE 1588 for nodes distributed across a network. With PTP, it is possible to synchronize distributed clocks with an accuracy of less than 1 microsecond via Ethernet networks.

A PTP system can consist of a combination of PTP and non-PTP devices. PTP devices include ordinary clocks, boundary clocks, and transparent clocks. Non-PTP devices include ordinary network switches, routers, and other infrastructure devices.

PTP is a distributed protocol that specifies how real-time PTP clocks in the system synchronize with each other. These clocks are organized into a master-slave synchronization hierarchy with the grandmaster clock, which is the clock at the top of the hierarchy, determining the reference time for the entire system. Synchronization is achieved by exchanging PTP timing messages, with the members using the timing information to adjust their clocks to the time of their master in the hierarchy. PTP operates within a logical scope called a PTP domain.

PTP supports the following functionality:

  • Multicast PTP transport—In the multicast transport mode, PTP uses multicast destination IP address 224.0.1.129 as per IEEE 1588 standards for communication between devices. For the source IP address, it uses the user configurable global IP address under the PTP domain.

  • PTP multicast configuration is supported only under physical interface for L2 or L3. PTP is not supported for virtual interfaces such as Port-channel, SVI, and tunnel.

  • PTP encapsulation over UDP over IP—PTP uses UDP as the transport protocol over IP. PTP uses UDP ports 319 for event messages and 320 for general messages communication between devices.

  • PTP profiles—PTP supports default (1588) and SMPTE 2059-2 profiles. They all have different ranges of sync and delay request intervals. For information on the default profile, refer to IEEE 1588. For more information on SMPTE 2059-2, refer to the respective specifications.

  • Path delay measurement—We support delay request and response mechanism to measure the delay between the master and slave devices.

  • Message intervals—You can configure the interval at which the announce, sync, and delay request messages needs to be sent between devices.

  • Best master clock (BMC) selection—BMC algorithm is used to select master, slave, and passive states of the PTP enabled interfaces based on the Announce message received as per 1588 specification.

PTP Device Types

The PTP device type is configurable and can be used to set the clock type.

Clocks

The following clocks are common PTP devices:

Ordinary clock

Communicates with the network based on a single physical port, similar to an end host. An ordinary clock can function as a grandmaster clock.

Boundary clock

Typically has several physical ports, with each port behaving like a port of an ordinary clock. However, each port shares the local clock, and the clock data sets are common to all ports. Each port decides its individual state, either master (synchronizing other ports connected to it) or slave (synchronizing to a downstream port), based on the best clock available to it through all of the other ports on the boundary clock. Messages related to synchronization and establishing the master-slave hierarchy terminate in the protocol engine of a boundary clock and are not forwarded.

Transparent clock

Forwards all PTP messages like an ordinary switch or router but measures the residence time of a packet in the switch (the time that the packet takes to traverse the transparent clock) and in some cases the link delay of the ingress port for the packet. The ports have no state because the transparent clock does not need to synchronize to the grandmaster clock.

There are two kinds of transparent clocks:

End-to-end transparent clock

Measures the residence time of a PTP message and accumulates the times in the correction field of the PTP message or an associated follow-up message.

Peer-to-peer transparent clock

Measures the residence time of a PTP message and computes the link delay between each port and a similarly equipped port on another node that shares the link. For a packet, this incoming link delay is added to the residence time in the correction field of the PTP message or an associated follow-up message.


Note


PTP operates only in boundary clock mode. Cisco recommends deployment of a Grand Master Clock (10 MHz) upstream, with servers containing clocks requiring synchronization connected to the switch.

End-to-end transparent clock and peer-to-peer transparent clock modes are not supported.


Clock Modes

The IEEE 1588 standard specifies two clock modes for the PTP supporting devices to operate in: one-step and two-step.

One-Step Mode:

In one-step mode the clock synchronization messages include the time at which the master port sends the message. The ASIC adds the timestamp to the synchronization message as it leaves the port.

The slave port uses the timestamp that comes as part of the synchronization messages.

Two-Step Mode:

In two-step mode the time at which the synchronization message leaves the port is sent in a subsequent follow-up message. This is the default mode.


Note


Cisco Nexus 3550-T Release 10.2(3t) supports only Two-Step Mode.


PTP Process

The PTP process consists of two phases: establishing the master-slave hierarchy and synchronizing the clocks.

Within a PTP domain, each port of an ordinary or boundary clock follows this process to determine its state:

  • Examines the contents of all received announce messages (issued by ports in the master state)

  • Compares the data sets of the foreign master (in the announce message) and the local clock for priority, clock class, accuracy, and so on

  • Determines its own state as either master or slave

The ordinary and boundary clocks use Sync , Delay_Req , Follow_Up , Delay_Resp event messages to generate and communicate timing information.

These messages are sent in the following sequence:

  1. The master sends a Sync message to the slave and notes the time, t1 at which it was sent. For one-step Sync message carries the time when the message leaves the master and for two-step this time is sent in the subsequent Follow-Up event message.

  2. The slave receives the Sync message and notes the time of reception, t2.

  3. The master conveys to the slave the timestamp, t1 by embedding the timestamp in a Follow_Up event message.

  4. The slave sends a Delay_Req message to the master and notes the time, t3 at which it was sent.

  5. The master receives the Delay_Req message and notes the time of reception, t4.

  6. The master conveys to the slave the timestamp, t4 by embedding it in a Delay_Resp message.

  7. After this sequence, the slave possesses all four timestamps. These timestamps can be used to compute the offset of the slave clock relative to the master, and the mean propagation time of messages between the two clocks.

    The following figure describes the event messages in the PTP process that generate and communicate timing information.

    Figure 1. PTP Process
    Event messages that generate and communicate timing information

High Availability for PTP

Stateful restarts are not supported for PTP. After a reboot, the running configuration is applied.

Guidelines and Limitations for PTP


Note


For scale information, see the release-specific Cisco Nexus 3550-T Series NX-OS Verified Scalability Guide.


The following are the guidelines and limitations for Cisco Nexus 3550 Series switches for PTP:

  • For PTP to function properly, you must use the latest SUP and line card FPGA versions.

  • PTP domain limits to a single domain per network.

  • PTP transport over User Datagram Protocol (UDP) is supported.

  • PTP supports boundary clock mode. End-to-end transparent clock and peer-to-peer transparent clock modes are not supported.

  • PTP can be enabled on the port-channel member ports.

  • All management messages that are received from a slave port are forwarded to all PTP enabled ports. The management messages that are received from a slave port are not handled.

  • When configuring PTP on Cisco Nexus 3550-T Series switches, set the clock protocol to use PTP through the clock protocol ptp vdc 1 command. NTP cannot coexist with PTP configured to a Cisco Nexus 9000 series switch.

  • The PTP correction-range, PTP correction-range logging, and PTP mean-path-delay commands are supported on the Cisco Nexus 3550-T platform.

  • PTP is not supported for stateful high availability.

  • PTP is not supported for management interfaces.

  • Each port can be individually configured with any of the supported PTP profiles. Different PTP profiles can coexist on an interface. Combination of the default of 1588 and SMPTE-2059-2 profile is supported.

  • Beginning with Cisco NX-OS 3550-T Release 10.2(3t), PTP Media Profile is supported on the Cisco Nexus 3550-T platform switches. A few guidelines and limitations for this platform switches are as follows:

    • IPv4 multicast, two-step mode, and PTPv2 with boundary clock functionality is supported.

    • PTP sync interval and PTP delay-request interval of -3 log seconds is recommended for +-500ns correction range.

    • Other PTP features such as unicast and unicast negotiation are not supported.

Default Settings for PTP

The following table lists the default settings for PTP parameters.

Table 1. Default PTP Parameters
Parameters Default

PTP

Disabled

PTP version

2

PTP domain

0

PTP priority 1 value when advertising the clock

255

PTP priority 2 value when advertising the clock

255

PTP announce interval

1 log second

PTP announce timeout

3 announce intervals

PTP delay-request interval

  • 0 log seconds

PTP sync interval

  • -2 log seconds

PTP VLAN

Default vlan is 1.

Configuring PTP

Configuring PTP Globally

You can enable or disable PTP globally on a device. You can also configure various PTP clock parameters to help determine which clock in the network has the highest priority to be selected as the grandmaster.


Note


You must always set the clock protocol PTP vdc1 for the local clock to be updated by the PTP protocol. You can verify the configuration using the show running-config clock_manager command.

Procedure

  Command or Action Purpose

Step 1

configure terminal

Example:

switch# configure terminal
switch(config)#

Enters global configuration mode.

Step 2

[no] feature ptp

Example:

switch(config)# feature ptp

Enables or disables PTP on the device.

Note

 

Enabling PTP on the switch does not enable PTP on each interface.

Step 3

(Optional) [no] ptp domain number

Example:

switch(config)# ptp domain 1
(Optional)

Configures the domain number to use for this clock. PTP domains allow you to use multiple independent PTP clocking subdomains on a single network.

The range for the number is from 0 to 127.

Step 4

(Optional) [no] ptp priority1 value

Example:

switch(config)# ptp priority1 1
(Optional)

Configures the priority1 value to use when advertising this clock. This value overrides the default criteria (clock quality, clock class, and so on) for best master clock selection. Lower values take precedence.

The range for the value is from 0 to 255.

Note

 

For the switch to synchronize with an external Grand Master clock, the local switch PTP priority value must be configured higher than that of external Grand Master Clock priority.

Step 5

(Optional) [no] ptp priority2 value

Example:

switch(config)# ptp priority2 1
(Optional)

Configures the priority2 value to use when advertising this clock. This value is used to decide between two devices that are otherwise equally matched in the default criteria. For example, you can use the priority2 value to give a specific switch priority over other identical switches.

The range for the value is from 0 to 255.

Note

 

For the switch to synchronize with an external Grand Master clock, the local switch PTP priority value must be configured higher than that of external Grand Master Clock priority.

Step 6

[ no ] ptp management

Example:

switch(config)# ptp management
switch(config-ptp-profile)#

Configures support for PTP management packets. This command is enabled by default.

no : Disables support for management packets.

Step 7

(Optional) [no] ptp delay tolerance { mean-path | reverse-path } variation

Example:

switch(config)# ptp delay tolerance mean-path 50.5
switch(config)#
(Optional)

Configures the PTP delay mean path/reverse path tolerance variation.

mean-path : Ignore spikes in Mean Path Delay (MPD) as calculated by the PTP BMC algorithm.

reverse-path : Ignore spikes in (t4-t3) as calculated by the PTP BMC algorithm.

variation : Percentage that defines the tolerance for spikes. Use numeric values with a single decimal. Range is from 1.0 through 100.0.

Step 8

(Optional) copy running-config startup-config

Example:

switch(config)# copy running-config startup-config
(Optional)

Copies the running configuration to the startup configuration.

Configuring PTP on an Interface

After you globally enable PTP, it is not enabled on all supported interfaces by default. You must enable PTP interfaces individually.

Before you begin

Make sure that you have globally enabled PTP on the switch and configured the source IP address for PTP communication.

Procedure

  Command or Action Purpose

Step 1

configure terminal

Example:

switch# configure terminal
switch(config)#

Enters global configuration mode.

Step 2

interface ethernet slot/port

Example:

switch(config)# interface ethernet 1/1
switch(config-if)#

Specifies the interface on which you are enabling PTP and enters the interface configuration mode.

Step 3

[no] ptp

Example:

switch(config-if)# ptp

Enables or disables PTP on an interface.

Step 4

(Optional) [no] ptp announce {interval log-seconds | timeout count}

Example:

switch(config-if)# ptp announce interval 3
(Optional)

Configures the interval between PTP announce messages on an interface or the number of PTP intervals before a timeout occurs on an interface.

The range for the PTP announcement interval is from 0 to 4 log seconds, and the range for the interval timeout is from 2 to 4 intervals.

Step 5

(Optional) [no] ptp delay-request minimum interval log-seconds

Example:

switch(config-if)# ptp delay-request minimum interval -1
(Optional)

Configures the minimum interval allowed between PTP delay messages when the port is in the master state.

The range is from log(–1) to log(6) seconds, where log(–1) = 2 frames every second.

Step 6

(Optional) [no] ptp delay-request minimum interval [smpte-2059-2] log-seconds

Example:

switch(config-if)# ptp delay-request minimum interval smpte-2059-2-1
(Optional)

Configures the minimum interval allowed between PTP delay messages when the port is in the master state.

Table 2. PTP Delay-Request Minimum Interval Range and Default Values

Option

Range

Default Value

smpte-2059-2

–4 to 5 log seconds

0 log seconds

Without the smpte-2059-2 option

–1 to 6 log seconds (where –1 = 2 frames every second)

0 log seconds

Step 7

(Optional) [no] ptp sync interval log-seconds

Example:

switch(config-if)# ptp sync interval 1
(Optional)

Configures the interval between PTP synchronization messages on an interface.

The range is from log(–3) to log(1) seconds. For the media-related profile information, see the Cisco NX-OS IP Fabric for Medial Solution Guide when configuring PTP for media.

Step 8

(Optional) [no] ptp sync interval [ smpte-2059-2] log-seconds

Example:

switch(config-if)# ptp sync interval smpte-2059-2 -1
(Optional)

Configures the interval between PTP synchronization messages on an interface.

Table 3. PTP Synchronization Interval Range and Default Values

Option

Range

Default Value

smpte-2059-2

–4 to –1 log seconds

–2 log seconds

Without the smpte-2059-2 option

–3 to 1 log seconds

–2 log seconds

Step 9

(Optional) [no] ptp vlan vlan-id

Example:

switch(config-if)# ptp vlan 1
(Optional)

Specifies the VLAN for the interface where PTP is being enabled. You can only enable PTP on one VLAN on an interface.

The range is from 1 to 4094.

Step 10

(Optional) show ptp brief

Example:

switch(config-if)# show ptp brief
(Optional)

Displays the PTP status.

Step 11

(Optional) show ptp port interface interface slot/port

Example:

switch(config-if)# show ptp port interface ethernet 1/1
(Optional)

Displays the status of the PTP port.

Step 12

(Optional) copy running-config startup-config

Example:

switch(config-if)# copy running-config startup-config
(Optional)

Copies the running configuration to the startup configuration.

PTP Profile Defaults

The following table lists the ranges and default values for the commands that are automatically configured when the global command ptp profile is set. You cannot change the range for the affected global commands beyond those allowed by the configured profile. However, in the interface mode, they can be changed if the ptp profile-override command is set.

Table 4. Range and Default Values

Parameter

Scope or Configuration Mode

Default Profile's Supported Range of Values

Default Profile's Default Value

With 'ptp profile-override' Configured on an Interface Supported Range of Values (Default is Based on Configured Profile)

mode

global

none

none

no change

domain

global

0 to 63

0

no change

priority1

global

0 to 255

255

no change

priority2

global

0 to 255

255

no change

cost

interface

Not configurable

Not configurable

0 to 255

transport

interface

ipv4

ipv4

ethernet, ipv4

transmission

interface

multicast

multicast

no change

role

interface

dynamic, master, slave

dynamic

no change

announce interval

interface

0 to 4

-3 to 1 with smpte-2059-2

1

-3 to 4

-3 to 1 with smpte-2059-2

delay-request minimum interval

interface

-1 to 6

-4 to 5 with smpte-2059-2

0

-4 to 6

-4 to 5 with smpte-2059-2

sync interval

interface

-3 to 1

-7 to 0 with smpte-2059-2

-2

-4 to 1

-7 to 0 with smpte-2059-2

Configuring PTP Notifications

Before you begin

You can enable, disable, and customize notifications for the following significant PTP events:

  • Change in the Grand Master (GM) clock

  • Change in the Parent clock

  • Change in the PTP state on a port

  • High PTP clock corrections

The notifications are generated by the DME infrastructure based on information it receives from PTP.

Procedure

  Command or Action Purpose

Step 1

[ no ] ptp notification type gm-change

Example:

switch(config)# ptp notification type gm-change
switch(config)#

Configures the system to send a change notification if the PTP grand master clock changes.

Step 2

[ no ] ptp notification type parent-change

Example:

switch(config)# ptp notification type parent-change
switch(config)#

Configures the system to send a change notification if the PTP parent clock changes.

Step 3

[ no ] ptp notification type port-state-change [ category { all | master-slave-only } ] [ interval { immediate | seconds [ periodic-notification { disable | enable } ] } ]

Example:

switch(config)# ptp notification type port-state-change category master-slave-only
switch(config)#

Configures the system to send a notification if a port state change event occurs.

  • category : Specifies which state changes must occur for a notification to be sent.

    • all : Every port state change is reported.

      Note

       

      Using the all option results in many notifications.

    • master-slave-only : Port state changes from and to the master-slave state are only reported.

  • interval seconds : Port state change notifications are sent at the configured interval: from 1-300 seconds with a granularity of 1 sec.

    • periodic-notification : Determines if periodic notifications are sent even if a port state change has not occurred during the configured interval.

      disable : A port state change notification is reported only if the current state is not the same as the previously reported state. Any intermediate state changes during the configured periodic interval are ignored. For example, if a port is a MASTER at time X, and changes to DISABLED and then back to MASTER by the time X+periodic-interval occurs, then no notification is generated for the intervening events.

      enable : Port state change notifications are sent at the configured interval, irrespective of a change in the port state.

  • interval immediate : A port State Change Notification is sent when the state changes.

Step 4

[ no ] ptp notification type high-correction [ interval { seconds [ periodic-notification { disable | enable } ] | immediate } ]

Example:

switch(config)# ptp notification type high-correction interval immediate
switch(config)#

Configures the system to send a high-correction notification if a PTP high correction event occurs. A high correction event is when the correction exceeds the value that is configured in the ptp correction-range command (see the following optional step).

  • interval seconds : High-correction notifications are sent at the configured interval: 1–300 seconds with a granularity of 1 second.

    • periodic-notification : Determines if periodic notifications are sent even if any high correction has not occurred during the configured interval.

      disable : Send a notification only if high correction events occurred during the configured periodic interval. This is the default setting.

      enable : Send a notifications irrespective of the number of high correction events during the configured periodic interval. If there are no such events, the payload indicates zero high correction events during the periodic interval.

  • interval immediate : Send a notification as soon as a high correction event occurs.

Step 5

(Optional) [ no ] ptp correction-range { nanoseconds | logging }

Example:

switch(config)# ptp correction-range 200000
switch(config)#
(Optional)
Configures a threshold that, once exceeded, indicates that a PTP high correction has occurred. Range is 10–1000000000. The default is 100000 (100 microseconds).

Verifying the PTP Configuration

To display the PTP configuration, perform one of the following tasks:

Table 5. PTP Show Commands
Command Purpose
show ptp brief

Displays the PTP status.

show ptp clock

Displays the properties of the local clock, including clock identity.

show ptp clock foreign-masters-record

Displays the state of foreign masters known to the PTP process. For each foreign master, the output displays the clock identity, basic clock properties, and whether the clock is being used as a grandmaster.

show ptp corrections

Displays the last few PTP corrections.

show ptp counters [all | interface ethernet slot/port]

Displays the PTP packet counters for all interfaces or for a specified interface.

show ptp parent

Displays the properties of the PTP parent.

show ptp port interface ethernet slot/port

Displays the status of the PTP port on the switch.

show ptp time-property

Displays the PTP clock properties.

show running-config ptp [all]

Displays the running configuration for PTP.

clear ptp counters [all | interface ethernet slot/port]

Clears all PTP messages that are received and transmitted on a specific interface or on all interfaces that has PTP enabled.

Configuration Examples for PTP

This example shows how to configure PTP globally on the device, specify the source IP address for PTP communications, and configure a preference level for the clock:

switch# configure terminal
switch(config)# feature ptp
switch(config)# ptp source 10.10.10.1
switch(config)# ptp priority1 1
switch(config)# ptp priority2 1
switch(config)# show ptp brief
PTP port status
-----------------------
Port State
------- --------------
switch(config)# show ptp clock
PTP Device Type: Boundary clock
Clock Identity : 0:22:55:ff:ff:79:a4:c1
Clock Domain: 0
Number of PTP ports: 0
Priority1 : 1
Priority2 : 1
Clock Quality:
  Class : 248
  Accuracy : 254
  Offset (log variance) : 65535
Offset From Master : 0
Mean Path Delay : 0
Steps removed : 0
Local clock time:Mon Dec 22 14:13:24 2014

This example shows how to configure PTP on an interface and configure the intervals for the announce, delay-request, and synchronization messages:

switch# configure terminal
switch(config)# interface Ethernet 1/1
switch(config-if)# ptp
switch(config-if)# ptp announce interval 3
switch(config-if)# ptp announce timeout 2
switch(config-if)# ptp delay-request minimum interval smpte-2059-2 -3
switch(config-if)# ptp sync interval smpte-2059-2 -3
switch(config-if)# no shutdown
switch(config-if)# show ptp brief
PTP port status
-----------------------
Port State
------- --------------
Eth1/1 Master
switch(config-if)# show ptp port interface ethernet 1/1
PTP Port Dataset: Eth1/1
Port identity: clock identity: 0:22:55:ff:ff:79:a4:c1
Port identity: port number: 1028
PTP version: 2
Port state: Master
Delay request interval(log mean): 4
Announce receipt time out: 2
Peer mean path delay: 0
Announce interval(log mean): 3
Sync interval(log mean): 1
Delay Mechanism: End to End
Peer delay request interval(log mean): 0