The PTP Network
The following is a short technical description of the synchronization mechanisms of the Precise Time Protocol based on an Embedded Systems Conference (ESC) presentation in 2007 by Imsys, Systronix and the IEEE 1588 chair John Eidson.
The Purpose of IEEE 1588
The standard was designed to enable synchronization of nodes of distributed system in more or less complex networks.
Objectives of IEEE 1588
- Sub-microsecond synchronization of real-time clocks in components of a networked distributed measurement and control system
- Initially it was intended for relatively localized systems typical of industrial automation and test and measurement environments, this was later revised to include more complex environments in version 2.
- Applicable to local area networks supporting multicast communications (including but not limited to Ethernet). With version 2 the option of using unicast communications was introduced.
- Simple, administration free installation
- Support heterogeneous systems of clocks with varying precision, resolution and stability
- Minimal resource requirements on networks and host components.
IEEE 1588 Synchronization Principles
- The clock hierarchy is established, master-slave relations determined by multicast sync messages
- Each slave synchronizes to its master based on the messages: Sync, Delay_Req, Follow_Up, and Delay_Resp.
Selecting a Master Clock on a Single Subnet
- Self-configuration based on clock characteristics and network topology
- Based on information contained in ‘Sync’messages
- All clocks run an identical ‘Best Master Clock’algorithm
- A clock at startup listens for a time SYNC_RECEIPT_TIMEOUT
- A master clock (clock in the PTP_MASTER state) issues periodic Sync messages (period is called the sync_interval)
- A master clock may receive Sync messages from other clocks (who for the moment think they are master) which it calls ‘foreign masters’
- Each master clock uses the Best Master Clock algorithm to determine whether it should remain master or yield to a foreign master.
- Each non-master clock uses the Best Master Clock algorithm to determine whether it should become a master
Multiple Subnet Synchronization
- Boundary clocks are used to segment the network. Its downstream port becomes an ordinary clock master for the subnetwork and needs to run the best master clock algorithm.
- The boundary clock internally selects the port that sees the ‘best clock’ as the single slave port. This port is a slave in the selected upstreams subnet. All other ports of the boundary clock internally synchronize to this slave port.
- The best clock in the system is the Grand Master clock.
IEEE 1588 Time Scales
- The time base in an IEEE 1588 system is the time base of the Grandmaster Clock which determines the time of date and rate of counting.
- All other clocks synchronize (perhaps via boundary clocks) to the grand master.
- The Grandmaster Clock time base is implementation and application dependent.
- If the Grandmaster Clock maintains a UTC time base, the IEEE 1588 protocol distributes leap second information to the slaves if it is available.