PTP Overview
The Precision Time Protocol (PTP), defined in the IEEE 1588 standard, achieves synchronization at nanosecond precision of real-time clocks across networked devices. These clocks are structured in a Master-Client hierarchy. PTP identifies the port connected to the device with the most accurate clock, known as the Master clock. All other devices within the network synchronize their clocks with the Master clock, and referred to as members. Ongoing exchange of timing messages ensures continual synchronization. PTP ensures the selection of the best available clock as the time source of the network (referred to as the grandmaster clock), with all other network clocks synchronized to this clock.
Why PTP?
Smart grid power automation applications, such as peak-hour billing, virtual power generators, and outage monitoring and management, require precise time accuracy and stability. Timing precision improves network monitoring accuracy and troubleshooting ability.
In addition to providing time accuracy and synchronization, the PTP message-based protocol can be implemented on packet-based networks, such as Ethernet networks. The benefits of using PTP in an Ethernet network include:
-
Low cost and easy setup in existing Ethernet networks
-
Limited bandwidth requirement for PTP data packets
Routers and Delays
In an IP network, routers provide a full-duplex communication path between network devices. Routers send data packets to packet destinations using an IP address information contained in the packets. When the router attempts to send multiple packets simultaneously, the router buffers some packets so that they aren’t lost before they are sent. When the buffer is full, the router delays sending packets. This delay can cause device clocks on the network to lose synchronization with one another.
More delays can occur when packets entering a router are stored in its local memory while the router searches the address table to verify packet fields. This process causes variations in packet forwarding time latency, and these variations can result in asymmetrical packet delay times.
Adding PTP to a network can compensate for these latency and delay problems by correctly adjusting device clocks so that they stay synchronized with one another. PTP enables network routers to function as PTP devices, including boundary clocks (BCs) and transparent clocks (TCs).
For more information about PTP clock devices and their role in a PTP network, see the PTP Clocks section.
Key Terms and Concepts
PTP Clocks
A PTP network is made up of PTP-enabled devices and devices that aren’t using PTP. The PTP-enabled devices typically consist of the following clock types.
-
Grandmaster (GM)—A network device physically attached to the primary time source, all clocks are synchronized to the grandmaster clock.
-
Ordinary Clock (OC)—An ordinary clock is a 1588 clock with a single PTP port that can operate in one of the following modes:
-
Master mode—Distributes timing information over the network to one or more client clocks, thus allowing the client to synchronize its clock to the master.
-
Slave mode—Synchronizes its clock to a master clock. You can enable the slave mode on up to two interfaces simultaneously in order to connect to two different master clocks.
-
-
Boundary Clock (BC)—The device participates in selecting the best master clock and can act as the master clock if no better clocks are detected.
The boundary clock starts its own PTP session with various downstream client clocks. The boundary clock mitigates the number of network hops and packet delay variations in the packet network between the Grandmaster and Client.
-
Transparent Clock (TC)—A transparent clock is a device or a switch that calculates the time it requires to forward traffic and updates the PTP time correction field to account for the delay, making the device transparent in terms of time calculations.
Port State Machine and Best Master Clock Algorithm
This provides a method to determine the state of the ports in the network that remain passive (neither master nor client), run as a master (providing time to other clocks in the network), or run as secondaries (receiving time from other clocks in the network).
Frequency and Time Selection
The selection of the source to synchronize the device clock frequency is made by frequency synchronization which is described in the Source and Selection Points section of the Frequency Synchronization module in this document. The Announce, Sync, and Delay-request frequencies must be the same on the master and client.
Delay Request-Response Mechanism
The Delay Request-response mechanism (defined in section 11.3 of IEEE Std 1588-2008) lets a client port estimate the difference between its own clock-time and the clock-time of its master. The following options are supported:
-
One-step mechanism - The timestamp for a Sync message is sent in the Sync message itself.
-
Two-step mechanism - The timestamp for a Sync message is sent later in a Follow-up message.
When running a port in Client state, a router can send Delay-request messages and handle incoming Sync, Follow-up, and Delay-response messages. The timeout periods for both Sync and Delay-response messages are individually configurable.
Hybrid Mode
Your router allows the ability to select separate sources for frequency and time-of-day (ToD). Frequency selection can be between any source of frequency available to the router, such as: BITS, GPS, SyncE, or IEEE 1588 PTP. The ToD selection is between the source selected for frequency and PTP, if available (ToD selection is from GPS, or PTP). This is known as hybrid mode, where a physical frequency source (BITS or SyncE) is used to provide frequency synchronization, while PTP is used to provide ToD synchronization.
Frequency selection uses the algorithm described in ITU-T recommendation G.781. The ToD selection is controlled using the time-of-day priority configuration. This configuration is found under the clock interface frequency synchronization configuration mode and under the global PTP configuration mode. It controls the order for which sources are selected for ToD. Values in the range of 1–254 are allowed, with lower numbers indicating higher priority.
The steps involved are detailed in this section Configuring PTP Hybrid Mode of the topic G.8275.1.
Time of Day (ToD) Support
The router receives GPS ToD messages in serial ASCII stream through the RS422 interface in one of the following configurable formats:
-
NTP Type 4
-
Cisco
Port States for PTP
State machine indicates the behavior of each port. The possible states are:
State |
Description |
---|---|
INIT |
Port isn’t ready to participate in PTP. |
LISTENING |
First state when a port becomes ready to participate in PTP: In this state, the port listens to PTP masters for a (configurable) period of time. |
PRE-MASTER |
Port is ready to enter the MASTER state. |
MASTER |
Port provides timestamps for any Client or boundary clocks that are listening. |
UNCALIBRATED |
Port receives timestamps from a Master clock but, the router’s clock isn’t yet synchronized to the Master clock. |
SLAVE |
Port receives timestamps from a Master clock and the router’s clock is synchronized to the Master clock. |
PASSIVE |
Port is aware of a better clock than the one it would advertise if it was in MASTER state and isn’t a Client clock to that Master clock. |
How PTP Works?
Message-Based Synchronization
To ensure clock synchronization, PTP requires an accurate measurement of the communication path delay between the time source (master) and the receiver (client). PTP sends messages between the master and client device to determine the delay measurement. Then, PTP measures the exact message transmit and receive times and uses these times to calculate the communication path delay.
PTP then adjusts current time information contained in network data for the calculated delay, resulting in more accurate time information.
This delay measurement principle determines the path delay between devices on the network. The local clocks are adjusted for this delay using a series of messages sent between masters and clients. The one-way delay time is calculated by averaging the path delay of the transmit and receive messages. This calculation assumes a symmetrical communication path; however, routed networks don’t necessarily have symmetrical communication paths, due to the various asymmetries in the network.
Using transparent clocks, PTP provides a method to measure and account for the delay in a time-interval field in network timing packets. This makes the routers temporarily transparent to the master and client nodes on the network. An end-to-end transparent clock forwards all messages on the network in the same way that a router does.
To read a detailed description of synchronization messages, see the PTP Event Message Sequences section.
PTP Event Message Sequences
This section describes the PTP event message sequences that occur during synchronization.
Synchronizing with Boundary Clocks
The ordinary and boundary clocks configured for the delay request-response mechanism use the following event messages to generate and communicate timing information:
-
Sync
-
Follow_Up
-
Delay_Req
-
Delay_Resp
These messages are sent in the following sequence:
-
The master sends a Sync message to the client and notes the time (t1) at which it was sent.
-
The client receives the Sync message and notes the time of reception (t2).
-
The master conveys to the client the timestamp t1 by embedding the timestamp t1 in a Follow_Up message.
-
The client sends a Delay_Req message to the master and notes the time (t3) at which it was sent.
-
The master receives the Delay_Req message and notes the time of reception (t4).
-
The master conveys to the client the timestamp t4 by embedding it in a Delay_Resp message.
After this sequence, the client possesses all four timestamps. These timestamps can be used to compute the offset of the client clock relative to the master, and the mean propagation time of messages between the two clocks.
The offset calculation is based on the assumption that the time for the message to propagate from master to client is the same as the time required from client to master. This assumption isn’t always valid on an Ethernet/IP network due to asymmetrical packet delay times.
Synchronizing the Local Clock
In an ideal PTP network, the master and client clocks operate at the same frequency. However, drift can occur on the network. Drift is the frequency difference between the master and client clock. You can compensate for drift by using the time stamp information in the device hardware and follow-up messages (intercepted by the router) to adjust the frequency of the local clock to match the frequency of the master clock.
PTP Support Information
This table lists different types of support information related to PTP:
Transport Media |
|
Messages |
|
Transport Modes |
|
Timing Profile and Class Support Matrix
This table provides information about the timing profiles and class that are supported on the Cisco 8000 series routers and line cards.
Hardware Module |
Supported Profile |
Cisco IOS XR Release |
---|---|---|
8711-32FH-M router |
G.8265.1 |
Release 24.3.1 |
G.8273.2 Class C |
||
G.8275.1 |
||
G.8275.2 |
||
88-LC1-52Y8H-EM |
G.8273.2 Class C |
Release 24.3.1 |
G.8275.1 |
||
88-LC1-12TH24FH-E |
G.8273.2 Class C |
Release 24.3.1 |
G.8275.1 |
||
86-MPA-14H2FH-M |
G.8265.1 |
Release 24.3.1 |
G.8273.2 Class C |
Release 24.1.1 |
|
G.8275.1 |
||
G.8275.2 |
Release 24.3.1 |
|
86-MPA-24Z-M |
G.8265.1 |
Release 24.3.1 |
G.8273.2 Class C |
Release 24.1.1 |
|
G.8275.1 |
||
G.8275.2 |
Release 24.3.1 |
|
86-MPA-4FH-M |
G.8265.1 |
Release 24.3.1 |
G.8273.2 Class C |
Release 24.1.1 |
|
G.8275.1 |
||
G.8275.2 |
Release 24.3.1 |
|
Cisco 8608 Router |
G.8265.1 |
Release 24.3.1 |
G.8273.2 Class C |
Release 24.1.1 |
|
G.8275.1 |
||
G.8275.2 |
Release 24.3.1 |
|
|
G.8275.1 |
Release 7.11.1 |
G.8273.2 Class C |
||
|
G.8273.2 Class C |
Release 7.5.2 |
G.8275.1 |
||
|
G.8273.2 Class C |
Release 7.3.3 |
G.8275.1 |
||
|
G.8273.2 Class C |
Release 7.3.1 |
G.8275.1 |
||
G.8265.1 |
||
G.8263 |
PTP Restrictions
The following PTP restrictions apply to the Cisco 8000 Series Router:
-
Sync2 interface is supported only if 10 MHz, 1 Pulse per Second (PPS) and time-of-day (ToD) ports are configured.
-
PTP isn’t supported with global MACSec.
-
PTP isn’t supported with MACSec on the same interface.
However, PTP is supported if MACSec isn’t configured on the interface.
-
PTP isn’t supported with the global MACSec-FIPS-Post.
MACSec-FIPS-Post isn’t available per interface.
-
Transparent Clock isn’t supported. One-step clock is supported. It can receive follow-up PTP packets, that is, it can support a two-step peer primary but it can’t send follow-up PTP packets.
-
When a subinterface is configured with encapsulation default or untag configuration, you must configure PTP on that subinterface, instead of the main interface.
-
PTP is configurable on Gigabit Ethernet interfaces (1G, 10G, 40G, and 100G), Bundle Ethernet interfaces, and subinterfaces. PTP isn’t configurable on LAG Ethernet subinterfaces.
-
PTP is supported over individual bundle member links and not supported on Bundle-Ether interfaces.
PTP Best Practices
In a network that also uses Synchronous Ethernet (SyncE) for frequency synchronization, it’s crucial to avoid timing loops. Timing loops can lead to network instability and erratic behavior, such as the flapping between PHASE-ALIGNED and FREQUENCY-LOCKED states. This can have a detrimental impact on the performance and reliability of the network synchronization.
-
Configuring multiple redundant paths in a network can inadvertently create timing loops. This is particularly true when the paths are arranged in a ring topology.
-
When a node receives synchronization from SyncE and then provides PTP synchronization back into the network, a loop is created.
Here are some best practices to avoid timing loops:
-
Both PTP and SyncE should be traceable back to the same primary clock source. This ensures consistency in the synchronization of the network and prevents discrepancies between different synchronization protocols.
-
Use PTP's local priority settings to align with the priority of SyncE inputs. By doing so, the network can maintain a uniform synchronization hierarchy, where the same clock source that is preferred for SyncE is also preferred for PTP.