Apocalypse 1: Offset correction and PTP
cota@braap.org>
Author: Emilio G. Cota <Date: 12 May 2010
Last Modified: 27 May 2010
[ Note: by PTP we mean PTPv2, as defined in IEEE 1588-2008. ]
IEEE1588 is the only standard currently available for performing high precision time synchronisation for networked systems. As one would expect from an IEEE standard, it treats the problem in a most generic way. A node joining a 1588 network doesn't have any previous knowledge about the network. The node is armed solely with a PTP state machine, whose changes of state are triggered by the exchange of PTP messages with other nodes in the network. IEEE1588 also assumes that each node has a local clock. In case this clock is of poorer quality than that of other clocks present in the network, the local clock is adjusted based on messages coming from these other higher-quality clocks.
A White Rabbit network differs from a canonical 1588 network in two fundamental ways. First, a slave is, timing-wise, connected to one and only one master. In a reciprocal manner, this master only sees the mentioned slave. Second, local clocks on slave nodes are virtually identical (in phase and frequency) to those on their masters.
The result of these differences is that the implementation of the state machine required to synchronise two White Rabbit nodes becomes trivial: since the clocks on master and slave are virtually equal, a single PTP exchange to adjust the offset of the slave would suffice to keep the two nodes synchronised. Note that no clock adjustment block would be needed from the protocol on the slave, since its clock is an identical copy of that on the master. (footnote: clock recovery is treated on Apocalypse X.)
Should we use a full-blown PTP state machine for our nodes or develop our own? The right choice is probably somewhere in the middle of the two options. At first glance it seems reasonable to try to remain compatible with PTP because that would enforce us to have a clear separation between clock recovery and offset adjustment, which is quite elegant, and would allow us to use White Rabbit slave nodes on pure PTP networks. However we cannot yet see how an eventual implementation following this approach would look like; this needs to be addressed before making a final decision.
[ TODO: Inspect closely the 1588 standard. Look particularly for any provisions to simplify the implementation of the standard when applied to networks like White Rabbit. ]