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 Device Types
The following clocks are common PTP devices:
Communicates with the network based on a single physical port, similar to an end host. An ordinary clock can function as a grandmaster 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.
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.
PTP operates only in boundary clock mode. Cisco recommends deployment of a Grand Master Clock (GMC) 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.
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 it was received.
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 slave uses these timestamps to adjust its clock to the time of its master.
Stateful restarts are not supported for PTP.
Licensing Requirements for PTP
PTP requires no license. Any feature not included in a license package is bundled with the Cisco NX-OS system images and is provided at no extra charge to you. For a complete explanation of the Cisco NX-OS licensing scheme, see the Cisco NX-OS Licensing Guide.
Guidelines and Limitations for PTP
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.
All management messages are forwarded on ports on which PTP is enabled. Handling management messages is 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.
Cisco Nexus 3000 series switches should be synchronized from the neighboring master using a synchronization log interval that ranges from --2 to --5.
Do not enable PTP on more than 10 ports if the synchronization log interval is set to -3 or lower on all of those ports.
Default Settings for PTP
The following table lists the default settings for PTP parameters.
Table 1 Default PTP Parameters
PTP priority 1 value when advertising the clock
PTP priority 2 value when advertising the clock
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
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.
Command or Action
switch# configure terminal
Enters global configuration mode.
[no] feature ptp
switch(config) # feature ptp
Enables or disables PTP on the device.
Enabling PTP on the switch does not enable PTP on each interface.
[no] ptp sourceip-address [vrf vrf]
switch(config) # ptp source 192.0.2.1
Configures the source IP address for all PTP packets.
The ip-address can be in IPv4 or IPv6 format.
[no] ptp domainnumber
switch(config) # ptp domain 1
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.
[no] ptp priority1value
switch(config) # ptp priority1 10
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.
[no] ptp priority2value
switch(config) # ptp priority2 20
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.
Saves the change persistently through reboots and restarts by copying the running configuration to the startup configuration.
This example shows how to configure PTP on an interface and configure the intervals for the announce, delay-request, and synchronization messages:
switch# config t
switch(config)# interface ethernet 2/1
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
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
Verifying the PTP Configuration
To display the PTP configuration, perform one of the following tasks:
Table 2 PTP Show Commands
show ptp brief
Displays the PTP status.
show ptp clock
Displays the properties of the local clock, including clock identity.
show ptp clocks 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 interfaceethernetslot/port
Displays the status of the PTP port on the switch.
show ptp clocks foreign-masters-record interface ethernetslot/port