Configuring PTP

This chapter contains the following sections:

Information About PTP

PTP is a time synchronization protocol for nodes distributed across a network. Its hardware timestamp feature provides greater accuracy than other time synchronization protocols such as the Network Time Protocol (NTP).

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 is not supported on Cisco Nexus 3100 switches from release 6.0(2)U3(1) through release 7.0(3)I2(4). However PTP is supported on Cisco Nexus 3100 switches from release 7.0(3)I4(1) and higher.

PTP Device Types

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 that are 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. We recommend that you deploy a Grand Master Clock (10 MHz) upstream. The servers contain clocks that require synchronization and are connected to the switch.

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


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

After the master-slave hierarchy has been established, the clocks are synchronized as follows:

  • The master sends a synchronization message to the slave and notes the time it was sent.

  • The slave receives the synchronization message and notes the time that it was received. For every synchronization message, there is a follow-up message. The number of sync messages should be equal to the number of follow-up messages.

  • The slave sends a delay-request message to the master and notes the time it was sent.

  • The master receives the delay-request message and notes the time it was received.

  • The master sends a delay-response message to the slave. The number of delay request messages should be equal to the number of delay response messages.

  • The slave uses these timestamps to adjust its clock to the time of its master.

High Availability for PTP

Stateful restarts are not supported for PTP.

Guidelines and Limitations for PTP

  • For Cisco Nexus 3000 and 3100 Series switches, PTP clock correction is expected to be in the 3-digit range, from 100 to 999 nanoseconds.

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

  • PTP supports transport over User Datagram Protocol (UDP). Transport over Ethernet is not supported.

  • PTP supports only multicast communication. Negotiated unicast communication is not supported.

  • PTP is limited to a single domain per network.

  • Forwarding PTP management packets is not supported.

  • PTP is supported with sync interval -2 only on Cisco Nexus 36180YC-R switches and Cisco Nexus 3636C-R line cards. Higher sync intervals are not supported.

  • PTP-capable ports do not identify PTP packets and do not time-stamp or redirect those packets unless you enable PTP on those ports.

  • 1 packet per second (1 pps) input is not supported.

  • PTP over IPv6 is not supported.

  • Cisco Nexus switches should be synchronized from the neighboring master using a synchronization log interval that ranges from –2 to –5.

  • One-step PTP is not supported on Cisco Nexus 3000 and 3500 series platform switches.

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 sync interval

– 2 log seconds

PTP announce timeout

3 announce intervals

PTP minimum delay request interval

0 log seconds

PTP VLAN

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.

Procedure

  Command or Action Purpose

Step 1

switch# configure terminal

Enters global configuration mode.

Step 2

switch(config) # [no] feature ptp

Enables or disables PTP on the device.

Note

 

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

Step 3

switch(config) # [no] ptp source ip-address [vrf vrf]

Configures the source IP address for all PTP packets.

The ip-address can be in IPv4 format.

Step 4

(Optional) switch(config) # [no] ptp domain number

(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 128.

Step 5

(Optional) switch(config) # [no] ptp priority1 value

(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 the best master clock selection. Lower values take precedence.

The range for the value is from 0 to 255.

Step 6

(Optional) switch(config) # [no] ptp priority2 value

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

Step 7

(Optional) switch(config) # show ptp brief

(Optional)

Displays the PTP status.

Step 8

(Optional) switch(config) # show ptp clock

(Optional)

Displays the properties of the local clock.

Step 9

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

(Optional)

Saves the change persistently through reboots and restarts by copying the running configuration to the startup configuration.

Example

The following 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:Sun Jul 3 14:13:24 2011
switch(config)#

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

switch# configure terminal

Enters global configuration mode.

Step 2

switch(config) # interface ethernet slot/port

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

Step 3

switch(config-if) # [no] feature ptp

Enables or disables PTP on an interface.

Step 4

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

(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 seconds, and the range for the interval timeout is from 2 to 10.

Step 5

(Optional) switch(config-if) # [no] ptp delay request minimum interval log seconds

(Optional)

Configures the minimum interval allowed between PTP delay-request messages when the port is in the slave state.

The range is from log -1 to -6 seconds. Where, log (-2) = 4 frames per second.

Step 6

(Optional) switch(config-if) # [no] ptp sync interval log seconds

(Optional)

Configures the interval between PTP synchronization messages on an interface.

The range for the PTP synchronization interval for Cisco Nexus 3000 Series switch is from -6 log second to 1 second.

The range for the PTP synchronization interval for Cisco Nexus 3548 Series switch is -3 log second to 1 second.

Step 7

(Optional) switch(config-if) # [no] ptp vlan vlan-id

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

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

(Optional)

Displays the PTP status.

Step 9

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

(Optional)

Displays the status of the PTP port.

Step 10

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

(Optional)

Saves the change persistently through reboots and restarts by copying the running configuration to the startup configuration.

Example

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 2/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 4
switch(config-if)# ptp sync interval -1
switch(config-if)# show ptp brief
PTP port status
-----------------------
Port State
------- --------------
Eth2/1 Master
switch(config-if)# show ptp port interface ethernet 2/1
PTP Port Dataset: Eth2/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
switch(config-if)#

Configuring Multiple PTP Domains

You can configure multiple PTP clocking domains on a single network. Each domain has a priority value associated with it. The default value is 255.

Procedure

  Command or Action Purpose

Step 1

switch# configure terminal

Enters global configuration mode.

Step 2

switch(config) # [no] feature ptp

Enables or disables PTP on the device.

Note

 

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

Step 3

switch(config) # [no] ptp source ip-address [vrf vrf]

Configures the source IP address for all PTP packets.

The ip-address can be in IPv4 format.

Step 4

switch(config) # [no] ptp multi-domain

Enables configuring multi domain feature on the switch. It also allow you to set the attributes such as priority, clock-class threshold , clock-accuracy threshold, transition priorities etc. on the switch.

Step 5

switch(config) # [no] ptp domain value priority value

Specify the values for the domain and priority.

The range for the domain value is from 0 to 127. The default value of the domain is 0

The range for the priority value is from 0 to 255. The default value of the priority is 255

Step 6

switch(config) # [no] ptp domain value clock-class-threshold value

Specify the values for domain and clock class threshold. The default value is 248.

The range for the domain value is from 0 to 127.

The range for the clock-class-threshold value is from 0 to 255.

Note

 

It is not necessary that a clock class threshold value ensure election of the slave clock on any ports. The switch uses this value to determine whether the source clock is traceable. If the clock class value from the peer is higher or equal than the clock class threshold value in a domain, the switch runs BMCA to elect the slave port from a domain. If none of the domains has the clock class below the threshold value, the switch runs BMCA on all the PTP enabled ports to elect the best clock.

Step 7

switch(config) # [no] ptp domain value clock-accuracy-threshold value

Specify the values for domain and clock accuracy threshold. The default value is 254.

The range for the domain value is from 0 to 127.

The range for the clock-accuracy-threshold value is from 0 to 255.

Step 8

switch(config) # [no] ptp multi-domain transition-attributes priority1 value

Sets the domain transition-attributes priority1 value that is used when sending a packet out from this domain to a peer domain. The value of the priority1 in the announce message from the remote port is replaced by the value of domain transition-attributes priority1 when the announce message has to be transmitted to a peer in a domain, that is different from that of the slave interface. The default value is 255.

The range for the transition-attributes priority1 value is from 0 to 255.

Step 9

switch(config) # [no] ptp multi-domain transition-attributes priority2 value

Sets the domain transition-attributes priority2 value that is used when sending a packet out from this domain to a peer domain. The value of the priority2 in the announce message from the remote port is replaced by the value of domain transition-attributes priority2 when the announce message has to be transmitted to a peer in a domain, that is different from that of the slave interface. The default value is 255.

The range for the transition-attributes priority2 value is from 0 to 255.

Step 10

switch(config-if) # [no] ptp domain value

Associates a domain on a PTP enabled interface. If you do not configure the domain specifically on an interface, it takes the default value (0).

The range for the domain value is from 0 to 127.

Example

The following example shows the PTP domains configured on a switch:


switch(config)# show ptp domain data
MULTI DOMAIN : ENABLED
GM CAPABILITY : ENABLED
PTP DEFAULT DOMAIN : 0
PTP TRANSITION PRIORITY1 : 20
PTP TRANSITION PRIORITY2 : 255
PTP DOMAIN PROPERTY
Domain-Number Domain-Priority Clock-Class Clock-Accuracy Ports
0         255        248             254             Eth1/1
1           1         1              254

switch(config)#

The following example shows the domains associated with each PTP enabled interfaces:


switch(config)# show ptp interface domain
PTP port interface domain
--------------------------
Port         Domain
-------  -----------------
Eth1/1        0
      1         1              254

switch(config)#

Configuring clock Identity

You can configure clock identity on a Cisco Nexus 3500 switch. The default clock identity is a unique 8-octet array presented in the form of a character array based on the switch MAC address.

.

Procedure

  Command or Action Purpose

Step 1

switch# configure terminal

Enters global configuration mode.

Step 2

switch(config) # [no] feature ptp

Enables or disables PTP on the device.

Note

 

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

Step 3

switch(config-if) # ptp clock-identity MAC Address

Assigns 6 byte MAC address for PTP clock-identity. Default clock identity is based on the MAC address of the switch. The clock-identity is defined as per IEEE standard (MAC-48 Byte0 | MAC-48 Byte1 | MAC-48 Byte2 | FF | FE | MAC-48 Bytes3-5).

Configuring PTP Cost Interface

You can configure interface cost on each PTP enabled port on a Cisco Nexus 3500 switch. The cost applies to each PTP enabled port if the switch has more than one path to grandmaster clock.

.

Procedure

  Command or Action Purpose

Step 1

switch# configure terminal

Enters global configuration mode.

Step 2

switch(config) # [no] feature ptp

Enables or disables PTP on the device.

Note

 

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

Step 3

switch(config) # [no] ptp source ip-address [vrf vrf]

Configures the source IP address for all PTP packets.

The ip-address can be in IPv4 format.

Step 4

switch(config-if) # [no] feature ptp

Enables or disables PTP on the interface.

Step 5

switch(config-if) # [no] ptp cost value

Associate cost on a PTP enabled interface. The interface having the least cost becomes the slave interface.

The range for the cost is from 0 to 255. The default value is 255.

Example

The following example shows cost that is associated with each PTP enabled interfaces:


switch(config)# show ptp cost
PTP port costs
-----------------------
Port         Cost
-------  --------------
Eth1/1        255
switch(config)#

Configuring the Mean Path Delay Threshold Value

The mean path delay is the last known good value that PTP frames take to travel between the master and slave. You can configure the threshold value that when exceeded, triggers a syslog message. The default value is 1 nanosecond.

Procedure

  Command or Action Purpose

Step 1

switch# configure terminal

Enters global configuration mode.

Step 2

switch(config) # [no] feature ptp

Enables or disables PTP on the device.

Note

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

Step 3

switch(config) # ptp mean-path-delay threshold-value

Example:

switch(config)# ptp mean-path-delay 20
switch(config)# 2018 Jun 18 11:17:23 3548-XL-1 %PTP-2-PTP_HIGH_MEAN_PATH_DELAY: 
PTP mean-path-delay 31 exceeds the threshold. Discarding the value.

Specify the threshold time value in nanoseconds that triggers a syslog message.

The range for the mean-path-delay threshold-value is from 10 to 1000000000.

The default is value is 1000000000 nanosecond .

Example

The following example displays the last few PTP corrections and ther mean-path-delay information:

switch(config)# show ptp corrections 
PTP past corrections
-----------------------------------------------------------------------------------
Slave Port              SUP Time               Correction(ns)    MeanPath Delay(ns)
----------  -------------------------------  ------------------  ------------------
Eth1/2        Fri Dec 15 03:36:33 2017 226753    7                   36                
Eth1/2        Fri Dec 15 03:36:32 2017 975282    -1                  36                
Eth1/2        Fri Dec 15 03:36:32 2017 723901    0                   36                
Eth1/2        Fri Dec 15 03:36:32 2017 472521    0                   36                
Eth1/2        Fri Dec 15 03:36:32 2017 222255    -1                  38                
Eth1/2        Fri Dec 15 03:36:31 2017 971076    -2                  38                
Eth1/2        Fri Dec 15 03:36:31 2017 719685    -8                  38                
Eth1/2        Fri Dec 15 03:36:31 2017 468215    15                  38                
Eth1/2        Fri Dec 15 03:36:31 2017 217020    -2                  35                
Eth1/2        Fri Dec 15 03:36:30 2017 965528    3                   35                
Eth1/2        Fri Dec 15 03:36:30 2017 714151    -4                  35                
Eth1/2        Fri Dec 15 03:36:30 2017 462905    0                   35                
Eth1/2        Fri Dec 15 03:36:30 2017 212015    -1                  39                
Eth1/2        Fri Dec 15 03:36:29 2017 960621    -2                  39                
Eth1/2        Fri Dec 15 03:36:29 2017 709293    0                   39                
Eth1/2        Fri Dec 15 03:36:29 2017 457782    5                   39                
Eth1/2        Fri Dec 15 03:36:29 2017 206421    1                   36                
Eth1/2        Fri Dec 15 03:36:28 2017 954986    1                   36                

The following example displays the configured mean-path-delay value:


switch(config)# show run all | grep mean-path-delay
ptp mean-path-delay 1000000000

Configuring a PTP Interface to Stay in a Master State

This procedure describes how to prevent an endpoint from causing a port to transition to a slave state.

Before you begin

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

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

Procedure

  Command or Action Purpose

Step 1

switch # configure terminal

Enters global configuration mode.

Step 2

switch(config) # interface ethernet slot/port

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

Step 3

switch(config-if) # [no] feature ptp

Enables or disables PTP on an interface.

Step 4

switch(config-if) # ptp multicast master-only

Configures the port to maintain the master state.

Example

This example shows how to configure PTP on an interface and configure the interface to maintain the Master state:

switch(config)# show ptp brief

PTP port status
----------------------------------
Port                  State 
----------------  ----------------
Eth1/1              Slave
switch(config)# interface ethernet 1/1
switch(config-if)# ptp multicast master-only
2001 Jan  7 07:50:03 A3-MTC-CR-1 %$ VDC-1 %$ %PTP-2-PTP_GM_CHANGE: Grandmaster clock has changed
 from 60:73:5c:ff:fe:62:a1:41 to 58:97:bd:ff:fe:0d:54:01 for the PTP protocol
2001 Jan  7 07:50:03 A3-MTC-CR-1 %$ VDC-1 %$ %PTP-2-PTP_STATE_CHANGE: Interface Eth1/1 change from
 PTP_BMC_STATE_SLAVE to PTP_BMC_STATE_PRE_MASTER
2001 Jan  7 07:50:03 A3-MTC-CR-1 %$ VDC-1 %$ %PTP-2-PTP_TIMESYNC_LOST: Lost sync with  master clock
2001 Jan  7 07:50:07 A3-MTC-CR-1 %$ VDC-1 %$ %PTP-2-PTP_STATE_CHANGE: Interface Eth1/1 change from
 PTP_BMC_STATE_PRE_MASTER to PTP_BMC_STATE_MASTER

Verifying the PTP Configuration

Use one of the following commands to verify the configuration:

Table 2. PTP Show Commands
Command Purpose
show ptp brief

Displays the PTP status.

show ptp clock

Displays the properties of the local clock, including the 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 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.