Why PTP?
PTP is a time synchronization protocol defined in IEEE 1588 version 2 (ITU-T G.8275.1) for devices across a network. Using PTP, you can synchronize distributed clocks with nanoseconds accuracy. The clocks in the PTP-enabled devices follow a master-slave hierarchy. The slaves are synchronized to their masters. The top-level master is called the grandmaster. The grandmaster clock is synchronized with a Global Positioning System (GPS).
The master will send a synchronization message to the slave. In turn, the slave sends a delay request to the master and the master reverts with a delay response. Thus, the delay is measured and the clock of the slave is synchronized with the master. This is also called as the one-step synchronization.
PTP-enabled devices can have the following clock modes:
• | Ordinary clock— A clock that has only one PTP-enabled port and maintains the timescale used in the domain. It can serve either as a master or a slave. |
• | Boundary clock—A clock that has multiple PTP-enabled ports and maintains the timescale used in the domain. The ports can serve either as a master or a slave. |
The Best Master Clock (BMC) algorithm that is run on every clock is used to determine the best clock in a distributed network. The algorithm compares the attributes from two different clocks to determine the data that describes the better clock. The algorithm is used to determine which of the clocks described in the announce messages received by a local clock port is the best clock. It is also used to determine whether a newly discovered clock, which is a foreign master, is better than a local clock. For more information on the BMC algorithm, refer to the ITU-T G.8275.1 standard.
Figure 1: PTP Deployment shows an example of a distributed network, in which the PTP-enabled devices work in a master-slave hierarchy.
Figure 122 | PTP Deployment |
In this example, you have node 1, which is a top-level device that acts as a grandmaster. This device is linked to node 2 and node 3, which are boundary clocks. Node 3, in turn is linked to node 4, which is an ordinary clock. All these devices are synchronized in a master-slave hierarchy. Node 3 is synchronized with the grandmaster through the network port, 3/1/c1, which acts as a slave. The other port 3/1/c2 on node 3 is in passive state. When the link between the grandmaster and node 3 goes down, the network port, 3/1/c2, which was in the passive state transitions to slave state. This will ensure that node 3 as well as node 4 remain synchronized with the grandmaster through node 2 (refer to Figure 2: PTP State Transition).
Figure 123 | PTP State Transition |