Precision Time Protocol
PTP (Precision Time Protocol) | |||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Family: | Internet protocol family | ||||||||||||||||||||||||
Operation area: | Synchronization of clocks in computer systems | ||||||||||||||||||||||||
Ports: | 319 / UDP, 320 / UDP | ||||||||||||||||||||||||
|
|||||||||||||||||||||||||
Standards: | IEEE 1588 |
The Precision Time Protocol ( PTP ) is a network protocol that synchronizes the time settings of several devices in a computer network . In contrast to the Network Time Protocol (NTP), the focus of PTP is on higher accuracy and locally limited networks. PTP can achieve an accuracy in the range of nanoseconds in hardware implementation and in the range of a few microseconds in software implementation . PTP is defined in IEEE 1588 and adopted in IEC 61588.
functionality
Network organization
A PTP network consists of communicating clocks . From these participating devices, the one that gives the most exact time is determined using the Best Master Clock (BMC) algorithm. This device serves as a reference clock and is known as the Grandmaster Clock . In the event of changes in the network topology , the BMC algorithm is carried out again on network segments that may have been cut off by the grandmaster . If a participating device has both the master and the slave role, it is also referred to as a boundary clock .
procedure
In operation, each of the distributed master the time signal to its slaves the so-called to determine delay (engl. Delay ). For this purpose, a time stamp in the form of a sync message is sent from the master reference clock to the slave, which determines the time of receipt of the time stamps based on its own time. In addition, the slave repeatedly sends a delay request message to the master, the time of receipt of which is sent back to the slave as a delay response message by the master .
The master-to-slave delay and the slave-to-master delay are determined from the differences between the four time stamps. These values therefore contain the difference between the two clocks and the message transit time with opposite signs . The mean value of the two quantities thus provides the directed offset to the master, which is ultimately used to synchronize the slave clock.
The compensation of the transit times is based on the assumption that the outward and return routes of synchronization messages have the same average transit times and only change slowly over time. The approach of the slave to the reference time of the master takes place continuously via a control process . In particular, this avoids jumps in the slave time.
Watch types
The Precision Time Protocol knows different types of clocks:
- An ordinary clock (Engl. Ordinary Clock , shortly OC) is the role master either the source or the role slave the recipient of the time, but not both. Simple clocks synchronize directly.
- A 'Boundary Clock' (BC) is a clock that transports time information across a network boundary. So z. B. in a router that connects different 'switched' networks: As a slave, the clock of the router receives the time information and forwards it as a master.
- A transparent, also transparent clock (Engl. Transparent Clock , shortly TC) was recorded in 2008 subsequently in the specification and improved within a network to route timing information by receiving the PTP messages and modified (corrected) forwards.
Send modes
If the PTP master supports the insertion of the sending time on-the-fly , ie it can insert this information independently into the frame to be sent, the protocol can be operated in the 'One Step' mode. In contrast to this, the 'Two Step' operating mode provides an additional message ( Follow Up Message ), which is used to transmit the transmission time that is only known later to the slave.
Implementations
The protocol specification calls for all time stamps to be made as late as possible before sending and as early as possible after receiving messages. This shows the advantage of hardware support compared to the pure software variant. The timekeeping in the processor of the network device delivers significantly more precise values than by the CPU of the computer.
The implementations currently available mostly use Ethernet as the network medium. The protocol specification is not specified with regard to the network medium.
A free implementation of the protocol is realized by the Precision Time Protocol Daemon PTPd .
literature
- The Institute of Electrical and Electronics Engineers, Inc. (Ed.): IEEE Standard for a Precision Clock Synchronization Protocol for Networked Measurement and Control Systems . IEEE Std. 1588-2002. New York 2002, ISBN 0-7381-3369-8 .
- IEC 61588 ed2.0: Precision clock synchronization protocol for networked measurement and control systems (engl.)
- John C. Eidson, Measurement, Control and Communication Using IEEE 1588 , (Springer-Verlag London Limited 2006) (Eng.)
Web links
- Redundancy protocols are used to increase the availability of networks.
- ptpd - PTP Daemon as a free implementation of PTP for Linux on Github
- NIST IEEE1588
- The Linux PTP Project - Open Source PTP (IEEE 1588-2008) implementation with support for hardware timestamping for Linux