Peer-to-peer transparent clocks and methods of estimating skew in peer-to-peer transparent clocks

10979164 · 2021-04-13

Assignee

Inventors

Cpc classification

International classification

Abstract

This invention relates to peer-to-peer transparent clocks and methods of estimating skew in peer-to-peer transparent clocks. Embodiments of the invention relate to techniques for estimating clock skew between a free-running clock in a transparent clock and a master clock, in particular by using the timing information embedded in timing messages passing through the transparent clock. Further embodiments of the invention set out uses of these estimates to modify the residence times computed by the transparent clock and a synchronization network including such transparent clocks.

Claims

1. A method of estimating the skew of a local clock in a peer-to-peer transparent clock device connected in a network between a master device having a master clock and a slave device, the method including the steps of: sending timing messages from the master device to the slave device over the network, the timing messages passing through said transparent clock device; recording times of sending of said timing messages by the master device; extracting, in the transparent clock device, from timing messages sent from the master device to the slave device, the times of sending of said timing messages; recording the times of receipt by the transparent clock device of timing messages sent from the master device to the slave device; extracting, in the transparent clock device, from the timing messages, the total delay experienced by each timing message in passing from the master device to the transparent clock device, including the residence time in other transparent clock devices between the master device and the transparent clock device; with the transparent clock device: measuring message residence time for the transparent clock device, modifying an incoming correction field with at least the measured message residence time and a peer link delay to generate a modified correction field, and sending the modified correction field to the slave device; and estimating, in the transparent clock device, the skew of the local clock in the transparent clock device compared to the master clock using a plurality of each of said extracted and recorded times.

2. A method according to claim 1, further including the steps of syntonizing the local clock in the transparent clock device to the master clock and syntonizing a slave clock in the slave device to the master clock.

3. A method according to claim 1, further including the step of computing modified residence times in the transparent clock device using the estimated skew of the local clock.

4. A method according to claim 1 wherein the step of estimating the skew of the local clock includes: calculating the skew α as: α = ( T 1 , n - T 1 , n - 1 ) + ( d total , n - d total , n - 1 ) ( T 2 TC , n - T 2 TC , n - 1 ) - 1 wherein T.sub.1,n is the departure time of the nth timing message sent from the master device to the slave device, T.sub.2TC,n is the arrival time of the nth timing message sent from the master device to the slave device at the transparent clock device and d.sub.total,n is the total delay experienced by the nth timing message in passing from the master device to the transparent clock device.

5. A method according to claim 1 wherein the step of estimating the skew of the local clock includes operating a Kalman filter using the measurement equation ( T 1 , n - T 2 TC , n ) + d total , n y n = θ n D n X n + v n and the state equation X n = [ θ n α n ] = [ 1 ( T 2 TC , n - T 2 TC , n - 1 ) 0 1 ] [ θ n - 1 α n - 1 ] + [ w θ , n w α , n ] = A n X n - 1 + w n wherein θ.sub.n and α.sub.n are the total offset and skew during the nth exchange of timing messages, T.sub.1,n is the departure time of the nth timing message sent from the master device to the slave device, T.sub.2TC,n is the arrival time of the nth timing message sent from the master device to the slave device at the transparent clock device, d.sub.total,n is the total delay including the cumulative residence time of the nth timing message sent from the master device to the slave device in other transparent clock devices whilst travelling between the master device and the transparent clock device, y=(T.sub.1,n−T.sub.2TC,n)+d.sub.total,n is a scalar, n is a nonnegative time index, D.sub.n=[2 0] is a 1×2 matrix, X.sub.n.sup.T=[θ.sub.n α.sub.n] is a vector, v.sub.n is measurement noise, and w.sub.n.sup.T=[w.sub.θ,n w.sub.α,n] is a process noise vector.

6. A peer-to-peer transparent clock device for use in a network between a master device having a master clock and a slave device, the transparent clock device having: a local clock; and a processor, wherein the transparent clock device is arranged to: receive and re-transmit timing messages sent from the master device to the slave device over the network, and the processor is arranged to: extract, from timing messages sent from the master device to the slave device, the times of sending of said timing messages; record the times of receipt by the transparent clock device of timing messages sent from the master device to the slave device; extract, from the timing messages, the total delay experienced by each timing message in passing from the master device to the transparent clock device, including the residence time in other transparent clock devices between the master device and the transparent clock device; measure message residence time for the transparent clock device, modify an incoming correction field with at least the measured message residence time and a peer link delay to generate a modified correction field, and send the modified correction field to the slave device; and estimate the skew of the local clock in the transparent clock device compared to the master clock using a plurality of each of said extracted and recorded times.

7. A transparent clock device according to claim 6 wherein the processor is further arranged to syntonize the local clock in the transparent clock device to the master clock.

8. A transparent clock device according to claim 6 wherein the processor is further arranged to compute modified residence times in the transparent clock device using the estimated skew of the local clock.

9. A transparent clock device according to claim 6 wherein the processor is arranged to estimate the skew of the local clock by: calculating the skew α as: α = ( T 1 , n - T 1 , n - 1 ) + ( d total , n - d total , n - 1 ) ( T 2 TC , n - T 2 TC , n - 1 ) - 1 wherein T.sub.1,n is the departure time of the nth timing message sent from the master device to the slave device, T.sub.2TC,n is the arrival time of the nth timing message sent from the master device to the slave device at the transparent clock device and d.sub.total,n is the total delay experienced by the nth timing message in passing from the master device to the transparent clock device.

10. A transparent clock device according to claim 6 wherein the processor is arranged to estimate the skew of the local clock by operating a Kalman filter using the measurement equation ( T 1 , n - T 2 TC , n ) + d total , n y n = θ n D n X n + v n and the state equation X n = [ θ n α n ] = [ 1 ( T 2 TC , n - T 2 TC , n - 1 ) 0 1 ] [ θ n - 1 α n - 1 ] + [ w θ , n w α , n ] = A n X n - 1 + w n wherein θ.sub.n and α.sub.n are the total offset and skew during the nth exchange of timing messages, T.sub.1,n is the departure time of the nth timing message sent from the master device to the slave device, T.sub.2TC,n is the arrival time of the nth timing message sent from the master device to the slave device at the transparent clock device, d.sub.total,n is the total delay including the cumulative residence time of the nth timing message sent from the master device to the slave device in other transparent clock devices whilst travelling between the master device and the transparent clock device, y=(T.sub.1,n−T.sub.2TC,n)+d.sub.total,n is a scalar, n is a nonnegative time index, D.sub.n=[2 0] is a 1×2 matrix, X.sub.n.sup.T=[θ.sub.n α.sub.n] is a vector, v.sub.n is measurement noise, and w.sub.n.sup.T=[w.sub.θ,n w.sub.α,n] is a process noise vector.

11. A networked time system including a master device having a master clock and a slave device, a network connecting the master device to the slave device and a peer-to-peer transparent clock device located in the network between the master device and the slave device and having a local clock, wherein: the master device is arranged to send timing messages over the network, the timing messages passing through said transparent clock device; the master device is arranged to record times of sending of said timing messages at the master device; the transparent clock device includes a local clock and a processor, and the processor is arranged to: extract, from timing messages sent from the master device to the slave device, the times of sending of said timing messages; record the times of receipt by the transparent clock device of timing messages sent from the master device to the slave device; extract, from the timing messages, the total delay experienced by each timing message in passing from the master device to the transparent clock device, including the residence time in other transparent clock devices between the master device and the transparent clock device; and measure message residence time for the transparent clock device, modify an incoming correction field with at least the measured message residence time and a peer link delay to generate a modified correction field, and send the modified correction field to the slave device; and estimate the skew of the local clock in the transparent clock device compared to the master clock using a plurality of each of said extracted and recorded times.

12. A networked time system according to claim 11, wherein the processor is further arranged to syntonize the local clock in the transparent clock device to the master clock.

13. A networked time system according to claim 11, wherein the processor is further arranged to compute modified residence times in the transparent clock device using the estimated skew of the local clock.

14. A networked time system according to claim 11 wherein the processor is arranged to estimate the skew of the local clock by: calculating the skew α as: α = ( T 1 , n - T 1 , n - 1 ) + ( d total , n - d total , n - 1 ) ( T 2 TC , n - T 2 TC , n - 1 ) - 1 wherein T.sub.1n is the departure time of the nth timing message sent from the master device to the slave device, T.sub.2TC,n is the arrival time of the nth timing message sent from the master device to the slave device at the transparent clock device and d.sub.total,n is the total delay experienced by the nth timing message in passing from the master device to the transparent clock device.

15. A networked time system according to claim 11 wherein the processor is further arranged to estimate the skew of the local clock by operating a Kalman filter using the measurement equation ( T 1 , n - T 2 TC , n ) + d total , n y n = θ n D n X n + v n and the state equation X n = [ θ n α n ] = [ 1 ( T 2 TC , n - T 2 TC , n - 1 ) 0 1 ] [ θ n - 1 α n - 1 ] + [ w θ , n w α , n ] = A n X n - 1 + w n wherein θ.sub.n and α.sub.n are the total offset and skew during the nth exchange of timing messages, T.sub.1,n is the departure time of the nth timing message sent from the master device to the slave device, T.sub.2TC,n is the arrival time of the nth timing message sent from the master device to the slave device at the transparent clock device, d.sub.total,n is the total delay including the cumulative residence time of the nth timing message sent from the master device to the slave device in other transparent clock devices whilst travelling between the master device and the transparent clock device, y=(T.sub.1,n−T.sub.2TC,n)+d.sub.total,n is a scalar, n is a nonnegative time index, D.sub.n=[2 0] is a 1×2 matrix, X.sub.n.sup.T=[θ.sub.n α.sub.n] is a vector, v.sub.n is measurement noise, and w.sub.n.sup.T=[w.sub.θ,n w.sub.α,n] is a process noise vector.

Description

BRIEF DESCRIPTION OF THE DRAWINGS

(1) Embodiments of the invention will now be described by way of example with reference to the accompanying drawings in which:

(2) FIG. 1 shows the message flow according to the two-step clock of IEEE 1588 PTP and has already been described;

(3) FIG. 2 shows the operation of the clock corrections in a peer-to-peer (P2P) transparent clock and has already been described;

(4) FIG. 3 shows the message flow through P2P transparent clocks and has already been described;

(5) FIG. 4 shows how P2P transparent clocks measure peer link delays and has already been described;

(6) FIG. 5 shows, schematically, the principles of clock transfer using P2P transparent clocks and has already been described;

(7) FIG. 6 shows the principles of time distribution over a network using P2P transparent clocks and has already been described;

(8) FIG. 7 shows the relationship between GrandMaster and transparent clocks with offset and skew; and

(9) FIG. 8 illustrates the timestamps at the GrandMaster and at a transparent clock on the transmission path.

DETAILED DESCRIPTION

(10) At their broadest, aspects of the present invention provide for methods and systems for estimating the skew of a local clock in an peer-to-peer transparent clock device using information from timing messages passing between a master and slave device through that transparent clock device.

(11) A first aspect of the present invention provides a method of estimating the skew of a local clock in a peer-to-peer transparent clock device connected in a network between a master device having a master clock and a slave device, the method including the steps of: sending timing messages from the master device to the slave device over the network, the timing messages passing through said transparent clock device; recording times of sending of said timing messages by the master device; extracting, in the transparent clock device, from timing messages sent from the master device to the slave device, the times of sending of said timing messages; recording the times of receipt by the transparent clock device of timing messages sent from the master device to the slave device; extracting, in the transparent clock device, from the timing messages, the total delay experienced by each timing message in passing from the master device to the transparent clock device, including the residence time in other transparent clock devices between the master device and the transparent clock device; and estimating the skew of the local clock compared to the master clock using a plurality of each of said extracted and recorded times.

(12) In this way the skew of the local clock can be accurately estimated using the existing pattern of timing messages exchanged between the master and slave devices and without the need for physical synchronization or use of separate timing messages.

(13) Further, by taking account of the delays experienced by messages passing from the master device to the transparent clock device, a more accurate estimation of the skew of the local clock may be obtained.

(14) Preferably the timing messages are messages under the IEEE 1588 PTP.

(15) Preferably the method further includes the step of syntonizing the local clock to the master clock. By syntonizing (synchronizing the frequency) the local clock to the master clock, the timing information provided by the transparent clock can be made more accurate, but without the need for physical syntonization. The syntonization can be achieved by post-processing the output of a free-running local clock.

(16) Preferably the method further includes the step of computing modified residence times in the transparent clock device using the estimated skew of the local clock and/or computing modified delays between the transparent clock device and other upstream devices over the network. By computing more accurate residence times in the transparent clock device, the accuracy of the synchronization of a clock in the slave device to the master clock can be improved as more accurate information regarding the delays in the network between the master and the salve device can be provided. Ideally, all transparent clocks between the master and the slave would compute modified residence times in this manner, but improvements will result even if only one of the transparent clocks operates in this manner.

(17) Preferably the step of computing modified residence times uses a filtered value of the skew, for example using an exponentially weighted moving average filter.

(18) The method may also include the step of the transparent clock device determining the delays between itself and neighbouring transparent clock devices and/or the master device. This may be done by the transparent clock device exchanging timing messages with neighbouring devices over the network.

(19) In certain embodiments, the step of estimating the skew of the local clock is a linear approximation. For example, the step of estimating may include calculating the skew α as:

(20) α = ( T 1 , n - T 1 , n - 1 ) + ( d total , n - d total , n - 1 ) ( T 2 TC , n - T 2 TC , n - 1 ) - 1
wherein T.sub.1,n is the departure time of the nth timing message sent from the master device to the slave device, T.sub.2TC,n is the arrival time of the nth timing message sent from the master device to the slave device at the transparent clock device and d.sub.total,n is the total delay experienced by the nth timing message in passing from the master device to the transparent clock device.

(21) In certain embodiments the step of estimating the skew of the local clock includes operating a Kalman filter. For example a Kalman filter may be operated using the measurement equation

(22) ( T 1 , n - T 2 TC , n ) + d total , n y n = θ n D n X n + v n
and the state equation

(23) X n = [ θ n α n ] = [ 1 ( T 2 TC , n - T 2 TC , n - 1 ) 0 1 ] [ θ n - 1 α n - 1 ] + [ w θ , n w α , n ] = A n X n - 1 + w n
wherein θ.sub.n and α.sub.n are the total offset and skew during the nth exchange of timing messages, T.sub.1,n is the departure time of the nth timing message sent from the master device to the slave device, T.sub.2TC,n is the arrival time of the nth timing message sent from the master device to the slave device at the transparent clock device, d.sub.total,n is the total delay including the cumulative residence time of the nth timing message sent from the master device to the slave device in other transparent clock devices whilst travelling between the master device and the transparent clock device, y=(T.sub.1,n−T.sub.2TC,n)+d.sub.total,n is a scalar, n is a nonnegative time index, D.sub.n=[2 0] is a 1×2 matrix, X.sub.n.sup.T=[θ.sub.n α.sub.n] is a vector, v.sub.n is the measurement noise, and w.sub.n.sup.T=[w.sub.θ,n w.sub.α,n] is a process noise vector.

(24) Embodiments using a Kalman filter such as that above can also estimate the offset of the local clock compared to the master clock.

(25) The method of the present aspect may include any combination of some, all or none of the above described preferred and optional features.

(26) The method of the above aspect is preferably implemented by a transparent clock device according to the second aspect of this invention, or a networked time system according to the third aspect of this invention, as described below, but need not be.

(27) Further aspects of the present invention include computer programs for running on computer systems which carry out the method of the above aspect, including some, all or none of the preferred and optional features of that aspect.

(28) A second aspect of the present invention provides a peer-to-peer transparent clock device for use in a network between a master device having a master clock and a slave device, the transparent clock device having: a local clock; and a processor, wherein the transparent clock device is arranged to: receive and re-transmit timing messages sent from the master device to the slave device over the network, and the processor is arranged to: extract, from timing messages sent from the master device to the slave device, the times of sending of said timing messages; record the times of receipt by the transparent clock device of timing messages sent from the master device to the slave device; extract, from the timing messages, the total delay experienced by each timing message in passing from the master device to the transparent clock device, including the residence time in other transparent clock devices between the master device and the transparent clock device; and estimate the skew of the local clock compared to the master clock using a plurality of each of said extracted and recorded times.

(29) In this way the skew of the local clock can be accurately estimated using the existing pattern of timing messages exchanged between the master and slave devices and without the need for physical synchronization or use of separate timing messages.

(30) Further, by taking account of the delays experienced by messages passing from the master device to the transparent clock device, a more accurate estimation of the skew of the local clock may be obtained.

(31) Preferably the timing messages are messages under the IEEE 1588 PTP.

(32) Preferably the processor is further arranged to syntonize the local clock to the master clock. By syntonizing (synchronizing the frequency) the local clock to the master clock, the timing information provided by the transparent clock can be made more accurate, but without the need for physical syntonization. The syntonization can be achieved by post-processing the output of a free-running local clock.

(33) Preferably the processor is further arranged to compute modified residence times in the transparent clock device using the estimated skew of the local clock. By computing more accurate residence times in the transparent clock device, the accuracy of the synchronization of a clock in the slave device to the master clock can be improved as more accurate information regarding the delays in the network between the master and the salve device can be provided. Ideally, all transparent clocks between the master and the slave would compute modified residence times in this manner, but improvements will result even if only one of the transparent clocks operates in this manner.

(34) Preferably the step of computing modified residence times uses a filtered value of the skew, for example using an exponentially weighted moving average filter.

(35) The transparent clock device may also be arranged to determine the delays between itself and neighbouring transparent clock devices and/or the master device. This may be done by the transparent clock device exchanging timing messages with neighbouring devices over the network.

(36) In certain embodiments the processor is arranged to estimate the skew of the local clock using a linear approximation. For example the estimation made be done by calculating the skew α as:

(37) α = ( T 1 , n - T 1 , n - 1 ) + ( d total , n - d total , n - 1 ) ( T 2 TC , n - T 2 TC , n - 1 ) - 1
wherein T.sub.1,n is the departure time of the nth timing message sent from the master device to the slave device, T.sub.2TC,n is the arrival time of the nth timing message sent from the master device to the slave device at the transparent clock device and d.sub.total,n is the total delay experienced by the nth timing message in passing from the master device to the transparent clock device.

(38) In certain embodiments the processor is arranged to estimate the skew of the local clock by operating a Kalman filter. For example a Kalman filter may be operated using the measurement equation

(39) ( T 1 , n - T 2 TC , n ) + d total , n y n = θ n D n X n + v n
and the state equation

(40) X n = [ θ n α n ] = [ 1 ( T 2 TC , n - T 2 TC , n - 1 ) 0 1 ] [ θ n - 1 α n - 1 ] + [ w θ , n w α , n ] = A n X n - 1 + w n
wherein θ.sub.n and α.sub.n are the total offset and skew during the nth exchange of timing messages, T.sub.1,n is the departure time of the nth timing message sent from the master device to the slave device, T.sub.2TC,n is the arrival time of the nth timing message sent from the master device to the slave device at the transparent clock device, d.sub.total,n is the cumulative residence time of the nth timing message sent from the master device to the slave device in other transparent clock devices whilst travelling between the master device and the transparent clock device, y=(T.sub.1,n−T.sub.2TC,n)+d.sub.total,n is a scalar, n is a nonnegative time index, D.sub.n=[2 0] is a 1×2 matrix, X.sub.n.sup.T=[θ.sub.n α.sub.n] is a vector, v.sub.n is the measurement noise, and w.sub.n.sup.T=[w.sub.θ,n w.sub.α,n] is a process noise vector.

(41) Embodiments using a Kalman filter such as that above can also estimate the offset of the local clock compared to the master clock.

(42) The device of the present aspect may include any combination of some, all or none of the above described preferred and optional features.

(43) A third aspect of the present invention provides a networked time system including a master device having a master clock and a slave device, a network connecting the master device to the slave device and a peer-to-peer transparent clock device located in the network between the master device and the slave device and having a local clock, wherein: the master device is arranged to send timing messages over the network, the timing messages passing through said transparent clock device; the master device is arranged to record times of sending of said timing messages at the master device; the transparent clock device includes a local clock and a processor, and the processor is arranged to: extract, from timing messages sent from the master device to the slave device, the times of sending of said timing messages; record the times of receipt by the transparent clock device of timing messages sent from the master device to the slave device; extract, from the timing messages, the total delay experienced by each timing message in passing from the master device to the transparent clock device, including the residence time in other transparent clock devices between the master device and the transparent clock device; and estimate the skew of the local clock compared to the master clock using a plurality of each of said extracted and recorded times.

(44) In this way the skew of the local clock can be accurately estimated using the existing pattern of timing messages exchanged between the master and slave devices and without the need for physical synchronization or use of separate timing messages.

(45) Further, by taking account of the delays experienced by messages passing from the master device to the transparent clock device, a more accurate estimation of the skew of the local clock may be obtained.

(46) Preferably the timing messages are messages under the IEEE 1588 PTP.

(47) Preferably the processor is further arranged to syntonize the local clock to the master clock. By syntonizing (synchronizing the frequency) the local clock to the master clock, the timing information provided by the transparent clock can be made more accurate, but without the need for physical syntonization. The syntonization can be achieved by post-processing the output of a free-running local clock.

(48) Preferably the processor is further arranged to compute modified residence times in the transparent clock device using the estimated skew of the local clock. By computing more accurate residence times in the transparent clock device, the accuracy of the synchronization of a clock in the slave device to the master clock can be improved as more accurate information regarding the delays in the network between the master and the salve device can be provided. Ideally, all transparent clocks between the master and the slave would compute modified residence times in this manner, but improvements will result even if only one of the transparent clocks operates in this manner.

(49) Preferably the step of computing modified residence times uses a filtered value of the skew, for example using an exponentially weighted moving average filter.

(50) The transparent clock device may also be arranged to determine the delays between itself and neighbouring transparent clock devices and/or the master device. This may be done by the transparent clock device exchanging timing messages with neighbouring devices over the network.

(51) Preferably the network includes a plurality of transparent clock devices which are arranged to syntonizer their local clocks to the master clock and/or compute modified residence times.

(52) In certain embodiments the processor is arranged to estimate the skew of the local clock using a linear approximation. For example, the estimation may be done by calculating the skew α as:

(53) α = ( T 1 , n - T 1 , n - 1 ) + ( d total , n - d total , n - 1 ) ( T 2 TC , n - T 2 TC , n - 1 ) - 1

(54) wherein T.sub.1,n is the departure time of the nth timing message sent from the master device to the slave device, T.sub.2TC,n is the arrival time of the nth timing message sent from the master device to the slave device at the transparent clock device and d.sub.total,n is the total delay experienced by the nth timing message in passing from the master device to the transparent clock device.

(55) In certain embodiments the processor is further arranged to estimate the skew of the local clock by operating a Kalman filter. For example, the Kalman filter may be operated using the measurement equation

(56) ( T 1 , n - T 2 TC , n ) + d total , n y n = θ n D n X n + v n
and the state equation

(57) 0 X n = [ θ n α n ] = [ 1 ( T 2 TC , n - T 2 TC , n - 1 ) 0 1 ] [ θ n - 1 α n - 1 ] + [ w θ , n w α , n ] = A n X n - 1 + w n
wherein θ.sub.n and α.sub.n are the total offset and skew during the nth exchange of timing messages, T.sub.1,n is the departure time of the nth timing message sent from the master device to the slave device, T.sub.2TC,n is the arrival time of the nth timing message sent from the master device to the slave device at the transparent clock device, d.sub.total,n is the cumulative residence time of the nth timing message sent from the master device to the slave device in other transparent clock devices whilst travelling between the master device and the transparent clock device, y=(T.sub.1,n−T.sub.2TC,n)+d.sub.total,n is a scalar, n is a nonnegative time index, D.sub.n=[2 0] is a 1×2 matrix, X.sub.n.sup.T=[θ.sub.n α.sub.n] is a vector, v.sub.n is the measurement noise, and w.sub.n.sup.T=[w.sub.θ,n w.sub.α,n] is a process noise vector.

(58) Embodiments using a Kalman filter such as that above can also estimate the offset of the local clock compared to the master clock.

(59) The system of the present aspect may include any combination of some, all or none of the above described preferred and optional features.

(60) Clock Skew Estimation and Residence Time Measurement Correction at the Peer-to-Peer Transparent Clocks

(61) In the present embodiments it is assumed that a free-running local oscillator is used at a TC. The frequency of this TC local oscillator is not adjusted physically, but it is allowed to free-run. This free-running oscillator drives a counter which is in turn used for timestamping at the TC and for the uncorrected measurement of the residence times of PTP messages.

(62) Basic Clock Model

(63) First a generalized clock offset and skew equation can be defined for the synchronization problem. It is assumed that at any particular time instant, the instantaneous view of the relationship between the GM/master (server) clock with timeline S(t) and the TC (client) clock with timeline C(t), can be described by the well-known simple skew clock model depicted in FIG. 6, and described by the equation,
S(t)=(1+α)C(t)+θ.sub.in,  (3)

(64) where θ.sub.in is the initial time offset and α is the skew (frequency offset) which is a very small quantity in the order of parts-per-million. For example, oscillators used in Ethernet interfaces are required to have skew α of no more than ±100 ppm. This snapshot is an instantaneous view of how well the two clocks are (mis)aligned. FIG. 7 illustrates the influence of θ.sub.in and α on the alignment.

(65) Equation (3) can further be expressed as
S(t)C(t)=θ(t)=αC(t)+θ.sub.in,  (4)

(66) where θ(t)=αC(t)+θ.sub.in is the total offset at any particular time t>0. This time varying offset which reflects the true offset between the two clocks consists of two components, one being θ.sub.in the (fixed) initial offset, and the other αC(t) which is an offset that arises as a result of the non-zero skew between the two clocks. Time synchronization in this sense will require knowing accurately the total offset θ(t) or, equivalently, its constituent components α and θ.sub.in, when given any C(t) value.

(67) Mechanism for Intercepting and Capturing Timestamps at the Peer-to-Peer Transparent Clock

(68) TCs are capable of intercepting PTP messages and capturing embedded and external TC triggered timestamps. That is, a TC is capable of snooping PTP messages passing through it. Assume there are KTCs 6 between the GM 1 and the slave 3. The following takes place at the kth TC, 1≤k≤K:

(69) For Sync messages: 1. TC 6 captures its ingress timestamp T.sub.2TC, of the arriving Sync message sent from GM 1 to slave 3. 2. TC 6 captures embedded correctionField value d.sub.total in Sync/Follow_Up message sent from GM 1 to slave 3. This received total delay d.sub.total does not include the residence time of the TC under consideration. 3. TC 6 captures embedded T timestamp in Sync or Follow_Up message sent from GM 1 to slave 3 a. For the one-step clock: T.sub.1 is in the originTimestamp field of Sync message and the total delay d.sub.total is in correctionField field of Sync message. b. For the two-step clock T.sub.1 is in the preciseOriginTimestamp field of Follow_Up message and the total delay d.sub.total is in correctionField field of Follow_Up message.

(70) The embedded and TC triggered timestamps captured at the TC 6 (as shown in FIG. 8) are used in the computation of the TC clock skew with respect to the GM 1. Techniques for estimating the skew according to embodiments of the present invention are described below.

(71) Basic Network Synchronization Models

(72) The basic clock model above can be extended to account for the case where the GM/master clock 4 and slave clock 5 exchange PTP messages and with messages intercepted and timestamps captured at a particular TC 6 as described above. The communication link between a GM 1 and a TC 6 has with it a fixed and random delay. The PTP messages pass through a network of one or multiple P2P TCs 6 from GM 1 to slave 3.

(73) For the nth Sync message which departs the master 1 with timestamp T.sub.1,n∈S(t) and arrives at the kth TC with timestamp T.sub.2TC,n∈C(t) after having experienced a delay of d.sub.total,n the simple skew clock model above can be extended to account for the travel time to obtain the following expression
(T.sub.1,n+d.sub.total,n)=(1+α)T.sub.2TC,n+θ.sub.in  (5)
or
θ.sub.in=(T.sub.1,n+d.sub.total,n)−(1+α)T.sub.2TC,n  (6)

(74) A key assumption here is that the message exchanges occur over a period of time so small that the total offset θ (omitting here the time index t or n) and skew α can be assumed constant over that period. Two possible techniques for computing the offset θ and skew a using Sync (possibly and Follow_Up) message transmissions are set out in more detail below.

(75) Even though it is possible to compute both the offset and skew, the focus of these methods is syntonizing the TC by accurately estimating the skew. So the most important parameter here is the skew a which will be used to modify the residence time measurements at the TC so that they will be as close as possible to the ideal values (as if accurate TC clock syntonization is achieved).

(76) Simple Linear Approximation Technique Skew Estimation at the P2P TCs

(77) For the (n−1) and nth Sync message exchange equation (5) allows the following to be derived:
(T.sub.1,n−1+d.sub.total,n−1)=(1+α)T.sub.2TC,n−1+θ.sub.in  (7)
(T.sub.1,n+d.sub.total,n)=+(1+α)T.sub.2TC,n+θ.sub.in  (8)

(78) Subtracting (7) from (8) gives

(79) ( T 1 , n - T 1 , n - 1 ) + ( d total , n - d total , n - 1 ) = ( 1 + α ) ( T 2 Tc , n - T 2 TC , n - 1 ) ( 9 ) α = ( T 1 , n - T 1 , n - 1 ) + ( d total , n - d total , n - 1 ) ( T 2 TC , n - T 2 TC , n - 1 ) - 1 ( 10 )

(80) If desired, the estimated skew a is then used to compute the clock offset θ.sub.in as given in (6). If further desired at any given discrete time n, the estimated skew a and offset θ.sub.in can be used to estimate the server time S.sub.n corresponding to a local clock value C.sub.n.

(81) The residence times can be estimated given the computed skew α and the ingress and egress timestamps generated upon Sync message arrivals using the free-running TC clock as follows. Let C.sub.in and C.sub.eg denote, respectively, the ingress and egress timestamps captured by the kth TC upon a Sync message arrival at any time instance. Let θ.sub.in also denote the initial time offset of the TC clock with respect to the GM clock 4. Using (3), the following relationships can be derived,
S.sub.in=(1+α)C.sub.in+θ.sub.in  (11)
S.sub.eg=(1+α)C.sub.eg+θ.sub.in  (12)

(82) In the above equations, the ingress and egress timestamps are mapped to the ideal time reference, which in this case is that of the GM. The mapped timestamps are then used to compute the modified (or close to ideal) residence times at the TC as follows,
r.sub.mod=S.sub.eg−S.sub.in=(1+α)(C.sub.eg−C.sub.in)  (13)

(83) Note that in the above equation the raw uncorrected or skew uncompensated residence time is given by
r.sub.raw=(C.sub.eg−C.sub.in)  (14)

(84) However, it can be seen from (13) that when the skew α=0 (i.e., TC clock is perfectly syntonized to GM), then the raw residence times are the same as the ideal or modified ones, that is,
r.sub.mod=S.sub.eg−S.sub.in=(C.sub.eg−C.sub.in)=r.sub.raw  (15)

(85) To compute the modified residence times (r.sub.mod), filtered values of the skew ({circumflex over (α)}) preferably should be used. The filtering can be done using a simple exponentially weighted moving average (EWMA) filter
{circumflex over (α)}.sub.n=μα.sub.n+(1−μ){circumflex over (α)}.sub.n−1,0<μ<1  (16)

(86) It can be seen from the above discussion that when using a TC with a free-running clock, only knowledge of the estimated skew is important when estimating the ideal residence times. The linear approximation described here is a relatively simple estimating technique for the skew estimation. To improve the residence time estimates, a more advanced filtering scheme based on Kalman Filtering for the skew estimation is set out below.

(87) Kalman Filter Based Technique for Skew Estimation at the P2P TCs

(88) Although, as indicated, the primary interest is in the skew, the models described below can be used with a Kalman filter based technique to estimate the clock offset and skew. The Kalman filter [1] allows the use of measurements of a process observed over time, containing noise and other inaccuracies, to produce values (estimates) that tend to be closer to the true values of the measurements and their associated calculated values. The Kalman filter produces estimates of the true values of measurements and their associated calculated values by predicting a value, estimating the uncertainty of the predicted value, and computing a weighted average of the predicted value and the measured value.

(89) In order to use the Kalman filter to estimate the internal state of a process given only a sequence of noisy observations, the process must be modelled in accordance with the framework of the Kalman filter. Therefore consider a state-space model described by the following pair of equations
State Equation: X.sub.n=A.sub.nX.sub.n−1+w.sub.n,  (17)
Measurement Equation: y.sub.n=D.sub.nX.sub.n+v.sub.n,  (18)

(90) where n is a nonnegative time index, A.sub.n is a known M-by-M state transition matrix, X.sub.n is the M-dimensional state (or parameter) vector, w.sub.n is an M-dimensional process noise vector which is assumed to be drawn from a zero mean multivariate normal distribution with covariance Q.sub.n=E[w.sub.nw.sub.n.sup.T], w.sub.n˜N(0,Q.sub.n), y.sub.n is the measurement, D.sub.n is a known 1×M-dimensional measurement matrix which maps the true state space into the measurement space, v.sub.n is the measurement noise which is assumed to be zero mean Gaussian white noise with covariance R.sub.n=E[v.sub.nv.sub.n.sup.T], v.sub.n˜N(0,R.sub.n), and T denotes transpose. It is assumed in the model that the initial state, and the noise vectors at each step {X.sub.0, w.sub.1, . . . , w.sub.n, v.sub.1, . . . , v.sub.n} are mutually independent.

(91) The notation {circumflex over (X)}.sub.n,m used below represents the estimate of X at time n given observations up to, and including at time m. The Kalman filter equations is most often conceptualized as two distinct phases: Predict and Update as described below.

(92) Predict Phase:

(93) The predict phase uses the state estimate from the previous time step to produce an estimate of the state at the current time step.

(94) Predicted (a prion) state estimate:
{circumflex over (X)}.sub.n,n−1=A.sub.n{circumflex over (X)}.sub.n−1,n−1  (19)

(95) This predicted state estimate is also known as the a priori state estimate because, although it is an estimate of the state at the current time step, it does not include observation information from the current time step.

(96) Predicted (a prion) estimate covariance:
P.sub.n,n−1=A.sub.nP.sub.n−1,n−1A.sub.n.sup.T+Q.sub.n  (20)

(97) Update Phase:

(98) In the update phase, the current a priori prediction is combined with current observation information to refine the state estimate. This improved estimate is termed the a posteriori state estimate. Innovation or measurement residual:
{tilde over (z)}.sub.n=y.sub.n−D.sub.n{circumflex over (X)}.sub.n,n−1  (21) Innovation (or residual) covariance:
S.sub.n=D.sub.nP.sub.n,n−1D.sub.n.sup.TR.sub.n  (22) Optimal Kalman gain:
K.sub.n=P.sub.n,n−1D.sub.n.sup.TS.sub.n.sup.−1=P.sub.n,n−1D.sub.n.sup.T[D.sub.nP.sub.n,n−1D.sub.n.sup.T+R.sub.n].sup.−1  (23) Updated (a posterior) state estimate:
{circumflex over (X)}.sub.n,n={circumflex over (X)}.sub.n,n−1+K.sub.n{tilde over (z)}.sub.n={circumflex over (X)}.sub.n,n−1+K.sub.n(y.sub.n−D.sub.n{circumflex over (X)}.sub.n,n−1)  (24) This is the a posteriori state estimate at time n given observations up to and including at time n. The second term in the above equation is called the correction term and it represents the amount by which to correct the propagated state estimate due to our measurement. Inspection of the Kalman gain equation shows that if the measurement noise is large, R.sub.n will be large, so that K.sub.n will be small and we would not give much credibility to the measurement y when computing the next {circumflex over (X)}. On the other hand, if the measurement noise is small, R.sub.n will be small, so that K.sub.n will be large and we will give a lot of credibility to the measurement when computing the next {circumflex over (X)}. Updated (a posterior) estimate covariance:
P.sub.n,n=(I−K.sub.nD.sub.n)P.sub.n,n−1  (25)

(99) This is the a posteriori error covariance matrix (a measure of the estimated accuracy of the state estimate).

(100) Typically, the two phases alternate, with the prediction advancing the state until the next scheduled observation, and the update incorporating the observation. Practical implementation of the Kalman Filter requires getting a good estimate of the noise covariance matrices Q.sub.n and R.sub.n. The estimation of these noise covariance is discussed in a separate document.

(101) Development of the Measurement Equation

(102) Assume a Sync message travels from a master 1 to the kth TC 6 experiences a total delay d.sub.total,n plus a stochastic delay v.sub.n (to account for all other delay components in the system). The variables θ.sub.n and α.sub.n are the total offset and skew during the nth Sync message exchange. Equation (5) above can be rewritten to account for the above conditions with the following equations
(T.sub.1,n+d.sub.total,n+v.sub.n)=(1+α.sub.n)T.sub.2TC,n+θ.sub.in  (26)

(103) It can be seen from (4) that θ.sub.n=α.sub.nT.sub.2TC,n+θ.sub.in and which means equation (26) can be expressed as
(T.sub.1,n+d.sub.total,n+v.sub.n)=T.sub.2TC,n+θ.sub.n  (27)

(104) The measurement equation is thus obtained as

(105) ( T 1 , n - T 2 TC , n ) + d total , n y n = θ n D n X n + v n ( 28 )

(106) where

(107) n is a nonnegative time index,

(108) y=(T.sub.1,n−T.sub.2TC,n)+d.sub.total,n is a scalar,

(109) D.sub.n=[1 0] is a 1×2 matrix,

(110) X.sub.n.sup.T=[θ.sub.n α.sub.n] is a vector, and

(111) v.sub.n is the measurement noise.

(112) Development of the State (Process) Equation

(113) Here the TC clock (process) model parameters A.sub.n and w.sub.n are derived. The clock skew over two time points T.sub.2,n and T.sub.2,n−1 can be estimated given two clock offsets θ.sub.n and θ.sub.n−1 as

(114) α n - 1 = θ n - θ n - 1 T 2 , n - T 2 , n - 1 . ( 29 )

(115) The process dynamics for the clock while accounting for process noise can then be expressed as
θ.sub.n=θ.sub.n−1+α.sub.n−1(T.sub.2,nT.sub.2,n−1)+w.sub.θ,n
α.sub.n=α.sub.n−1+w.sub.α,n  (30)

(116) where w.sub.n.sup.T=[w.sub.θ,n w.sub.α,n] is the process noise vector which is assumed to be drawn from a zero mean normal distribution with covariance Q.sub.n=E[w.sub.nw.sub.n.sup.T]. The system can be described by the following two-state dynamic model

(117) X n = [ θ n α n ] = [ 1 ( T 2 , n - T 2 , n - 1 ) 0 1 ] [ θ n - 1 α n - 1 ] + [ w θ , n w α , n ] = A n X n - 1 + w n , ( 31 )

(118) where A.sub.n is the known 2-by-2 state transition matrix. If the time between Sync messages is fixed as would be the case when a constant Sync departure rate is configured at the GM ((T.sub.1,n−T.sub.1,n−1)=Δt), then, ΔT.sub.n=(T.sub.2n−T.sub.2,n−1)=Δt is a constant term, and

(119) A n = A = [ 1 ( T 1 , n - T 1 , n - 1 ) 0 1 ] = [ 1 Δ t 0 1 ] . ( 32 )

(120) In reality, A.sub.n is not a fixed matrix because of the variable message delays experienced in the system, thus making (31) the most appropriate expression to be used at each iteration. The clock skew (α) estimated at the TC using any of the two techniques described above can be used to compute the modified residence times as given by (13). To achieve time synchronization or equivalently find the server time estimate S.sub.n (although not required in this problem context), the estimate θ.sub.n from the Kalman Filter can be used in (4) to obtain S.sub.n, that is, S.sub.n=C.sub.n+θ.sub.n.

(121) The systems and methods of the above embodiments may be implemented in a computer system (in particular in computer hardware or in computer software) in addition to the structural components and user interactions described.

(122) The term “computer system” includes the hardware, software and data storage devices for embodying a system or carrying out a method according to the above described embodiments. For example, a computer system may comprise a central processing unit (CPU), input means, output means and data storage. Preferably the computer system has a monitor to provide a visual output display. The data storage may comprise RAM, disk drives or other computer readable media. The computer system may include a plurality of computing devices connected by a network and able to communicate with each other over that network.

(123) The methods of the above embodiments may be provided as computer programs or as computer program products or computer readable media carrying a computer program which is arranged, when run on a computer, to perform the method(s) described above.

(124) The term “computer readable media” includes, without limitation, any non-transitory medium or media which can be read and accessed directly by a computer or computer system. The media can include, but are not limited to, magnetic storage media such as floppy discs, hard disc storage media and magnetic tape; optical storage media such as optical discs or CD-ROMs; electrical storage media such as memory, including RAM, ROM and flash memory; and hybrids and combinations of the above such as magnetic/optical storage media.

(125) While the invention has been described in conjunction with the exemplary embodiments described above, many equivalent modifications and variations will be apparent to those skilled in the art when given this disclosure. Accordingly, the exemplary embodiments of the invention set forth above are considered to be illustrative and not limiting. Various changes to the described embodiments may be made without departing from the spirit and scope of the invention.

(126) In particular, although the methods of the above embodiments have been described as being implemented on the systems of the embodiments described, the methods and systems of the present invention need not be implemented in conjunction with each other, but can be implemented on alternative systems or using alternative methods respectively.

REFERENCES

(127) [1]. R. E. Kalman, “A New Approach to Linear Filtering and Prediction Problems,”Transaction of the ASME—Journal of Basic Engineering, March 1960, pp. 35-45.

(128) All references referred to above are hereby incorporated by reference.