END-TO-END TRANSPARENT CLOCKS AND METHODS OF ESTIMATING SKEW IN END-TO-END TRANSPARENT CLOCKS
20200021378 ยท 2020-01-16
Inventors
Cpc classification
H04J3/0673
ELECTRICITY
International classification
Abstract
This invention relates to end-to-end transparent clocks and methods of estimating skew in end-to-end 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 an end-to-end 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: exchanging timing messages between the master device and the slave device over the network, the timing messages passing through said transparent clock device; recording times of sending and receiving 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 and receiving 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; recording the times of sending by the transparent clock device of timing messages sent from the slave device to the master device; extracting, in the transparent clock device, from the timing messages, the residence time of the timing messages 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.
2. A method according to claim 1, further including the step of syntonizing the local clock 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 master device and transparent clock device are capable of hardware timestamping arriving and outgoing timing messages, and the step of extracting the residence time includes: extracting the residence time recorded in the timing messages sent from the master device to the slave device on arrival in the transparent clock device; and extracting the residence time recorded in the timing messages sent from the slave device to the master device on departure from the transparent clock device and the total residence time recorded between the slave device and the masterdevice.
5. A method according to claim 1, wherein the master device and transparent clock device are not capable of hardware timestamping the arriving and outgoing timing messages, the method further including the steps of: for each first timing message sent from the master device to the slave device, sending a first further timing message from the master device to the slave device which contains the time of sending of the respective first timing message by the master device, and to which is cumulatively added, by each transparent clock that the further timing message passes through, a first residence time being the time taken for the respective first timing message to pass through each said transparent clock device; and for each second timing message sent from the slave device to the master device, sending a second further timing message from the master device to the slave device which contains the time of receipt of the respective second timing message by the master device, and to which is cumulatively added, by each transparent clock that the second further timing message passes through, a second residence time being the time taken for the respective second timing message to pass through each said transparent clock device, and wherein the step of extracting the residence time includes: extracting the first residence time recorded in one of said first further timing messages; and extracting the second residence time recorded in one of said second further timing messages on receipt of the second further timing message at the transparent clock device.
6. A method according to claim 1 wherein the step of estimating the skew of the local clock includes: calculating a component .sub.1 of the skew in the forward direction from master device to slave device as: is the departure time of the nth timing message sent from the master device to the slave device,
is the arrival time of the nth timing message sent from the master device to the slave device at the transparent clock device and
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, p1 calculating a component .sub.2 of the skew in the reverse direction from slave device to master device as:
is the arrival time of the nth timing message sent from the slave device to the master device,
is the departure time of the nth timing message sent from the slave device to the master device from the transparent clock device and
is the cumulative residence time of the nth timing message sent from the slave device to the master device in other transparent clock devices whilst travelling between the transparent clock device and the master device, and estimating the skew as the average of .sub.1 and .sub.2.
7. 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 is the departure time of the nth timing message sent from the master device to the slave device,
is the arrival time of the nth timing message sent from the master device to the slave device at the transparent clock device
is the arrival time of the nth timing message sent from the slave device to the master device,
is the departure time of the nth timing message sent from the slave device to the master device from the transparent clock device,
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,
is the cumulative residence time of the nth timing message sent from the slave device to the master device in other transparent clock devices whilst travelling between the transparent clock device and the master device,
and
are the fixed delays in the directions from master device to slave device and slave device to master devices respectively, y.sub.n (T.sub.1,n T.sub.2TC,n) (T.sub.4,n T.sub.3TC,n) (d.sub.f d.sub.r) (r.sub.ftotal,n r.sub.rtotal,n) is a scalar, n is a nonnegative time index, D.sub.n [2 0] is a 12 matrix, X.sub.n.sup.T [.sub.n .sub.n] is a vector, and v.sub.n (.sub.n .sub.n) is the measurement noise, and using the state equation:
8. An end-to-end 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 in both directions between the master device and 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 and receiving 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; record the times of re-transmission by the transparent clock device of timing messages sent from the slave device to the master device; extract, from the timing messages, the residence time of the timing messages 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.
9. A transparent clock device according to claim 8 wherein the processor is further arranged to syntonize the local clock to the master clock.
10. A transparent clock device according to claim 8 wherein the processor is further arranged to compute modified residence times in the transparent clock device using the estimated skew of the local clock.
11. A transparent clock device according to claim 8, wherein the transparent clock device is capable of hardware timestamping arriving and outgoing timing messages, and the processor is arranged to extract the residence time by: extracting the residence time recorded in the timing messages sent from the master device to the slave device on arrival in the transparent clock device; and extracting the residence time recorded in the timing messages sent from the slave device to the master device on departure from the transparent clock device and the total residence time recorded between the slave device and the masterdevice.
12. A transparent clock device according to claim 8, wherein the transparent clock device is not capable of hardware timestamping the arriving and outgoing timing messages, wherein: for each first timing message sent from the master device to the slave device, sending a first further timing message from the master device to the slave device which contains the time of sending of the respective first timing message by the master device, and to which is cumulatively added, by each transparent clock that the further timing message passes through, a first residence time being the time taken for the respective first timing message to pass through each said transparent clock device; and for each second timing message sent from the slave device to the master device, sending a second further timing message from the master device to the slave device which contains the time of receipt of the respective second timing message by the master device, and to which is cumulatively added, by each transparent clock that the second further timing message passes through, a second residence time being the time taken for the respective second timing message to pass through each said transparent clock device, and wherein the processor is arranged to extract the residence time by: extracting the first residence time recorded in one of said first further timing messages; and extracting the second residence time recorded in one of said second further timing messages on receipt of the second further timing message at the transparent clock device.
13. A transparent clock device according to claim 8 wherein the processor is arranged to estimate the skew of the local clock by: calculating a component .sub.1 of the skew in the forward direction from master device to slave device as: is the departure time of the nth timing message sent from the master device to the slave device,
is the arrival time of the nth timing message sent from the master device to the slave device at the transparent clock device and
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, calculating a component .sub.2 of the skew in the reverse direction from slave device to master device as:
is the arrival time of the nth timing message sent from the slave device to the master device,
is the departure time of the nth timing message sent from the slave device to the master device from the transparent clock device and
is the cumulative residence time of the nth timing message sent from the slave device to the master device in other transparent clock devices whilst travelling between the transparent clock device and the master device, and estimating the skew as the average of .sub.1 and .sub.2.
14. A transparent clock device according to claim 8 wherein the processor is arranged to estimate the skew of the local clock by operating a Kalman filter using the measurement equation is the departure time of the nth timing message sent from the master device to the slave device,
is the arrival time of the nth timing message sent from the master device to the slave device at the transparent clock device
is the arrival time of the nth timing message sent from the slave device to the master device,
is the departure time of the nth timing message sent from the slave device to the master device from the transparent clock device,
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,
is the cumulative residence time of the nth timing message sent from the slave device to the master device in other transparent clock devices whilst travelling between the transparent clock device and the master device,
and
are the fixed delays in the directions from master device to slave device and slave device to master devices respectively, y.sub.n (T.sub.1,n T.sub.2TC,n) (T.sub.4,n T.sub.3TC,n) (d.sub.f d.sub.r) (r.sub.ftotal,n r.sub.rtotal,n) is a scalar, n is a nonnegative time index, D.sub.n [2 0] is a 12 matrix, X.sub.n.sup.T [.sub.n .sub.n] is a vector, and v.sub.n (.sub.n .sub.n) is the measurement noise, and using the state equation:
15. 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 an end-to-end transparent clock device located in the network between the master device and the slave device and having a local clock, wherein: the master device and slave device are arranged to exchange timing messages over the network, the timing messages passing through said transparent clock device; the master device is arranged to record times of sending and receiving 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 and receiving 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; record the times of sending by the transparent clock device of timing messages sent from the slave device to the master device; extract, from the timing messages, the residence time of the timing messages 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.
16. A networked time system according to claim 15, wherein the processor is further arranged to syntonize the local clock to the master clock.
17. A networked time system according to claim 15, wherein the processor is further arranged to compute modified residence times in the transparent clock device using the estimated skew of the local clock.
18. A networked time system according to claim 15, wherein the master device and transparent clock device are capable of hardware timestamping arriving and outgoing timing messages, the processor is arranged to extract the residence time by: extracting the residence time recorded in the timing messages sent from the master device to the slave device on arrival in the transparent clock device; and extracting the residence time recorded in the timing messages sent from the slave device to the master device on departure from the transparent clock device and the total residence time recorded between the slave device and the masterdevice.
19. A networked time system according to claim 15, wherein the master device and transparent clock device are not capable of hardware timestamping the arriving and outgoing timing messages, wherein the master device is further arranged to: for each first timing message sent from the master device to the slave device, send a first further timing message from the master device to the slave device which contains the time of sending of the respective first timing message by the master device, and to which is cumulatively added, by each transparent clock that the further timing message passes through, a first residence time being the time taken for the respective first timing message to pass through each said transparent clock device; and for each second timing message sent from the slave device to the master device, send a second further timing message from the master device to the slave device which contains the time of receipt of the respective second timing message by the master device, and to which is cumulatively added, by each transparent clock that the second further timing message passes through, a second residence time being the time taken for the respective second timing message to pass through each said transparent clock device, and wherein the processor is further arranged to: extract the first residence time recorded in one of said first further timing messages; and extract the second residence time recorded in one of said second further timing messages on receipt of the second further timing message at the transparent clock device.
20. A networked time system according to claim 15 wherein the processor is arranged to estimate the skew of the local clock by: calculating a component .sub.1 of the skew in the forward direction from master device to slave device as: is the departure time of the nth timing message sent from the master device to the slave device,
is the arrival time of the nth timing message sent from the master device to the slave device at the transparent clock device and
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, calculating a component .sub.2 of the skew in the reverse direction from slave device to master device as:
is the arrival time of the nth timing message sent from the slave device to the master device,
is the departure time of the nth timing message sent from the slave device to the master device from the transparent clock device and
is the cumulative residence time of the nth timing message sent from the slave device to the master device in other transparent clock devices whilst travelling between the transparent clock device and the master device, and estimating the skew as the average of .sub.1 and .sub.2.
21. A networked time system according to claim 15 wherein the processor is further arranged to estimate the skew of the local clock by operating a Kalman filter using the measurement equation is the departure time of the nth timing message sent from the master device to the slave device,
is the arrival time of the nth timing message sent from the master device to the slave device at the transparent clock device
is the arrival time of the nth timing message sent from the slave device to the master device,
is the departure time of the nth timing message sent from the slave device to the master device from the transparent clock device,
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,
is the cumulative residence time of the nth timing message sent from the slave device to the master device in other transparent clock devices whilst travelling between the transparent clock device and the master device,
and
are the fixed delays in the directions from master device to slave device and slave device to master devices respectively, y.sub.n (T.sub.1,n T.sub.2TC,n) (T.sub.4,n T.sub.3TC,n) (d.sub.f d.sub.r) (r.sub.ftotal,n r.sub.rtotal,n) is a scalar, n is a nonnegative time index, D.sub.n [2 0] is a 12 matrix, X.sub.n.sup.T [.sub.n .sub.n] is a vector, and v.sub.n (.sub.n .sub.n) is the measurement noise, and using the state equation:
Description
BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Embodiments of the invention will now be described by way of example with reference to the accompanying drawings in which:
[0040]
[0041]
[0042]
[0043]
[0044]
[0045]
[0046]
DETAILED DESCRIPTION
[0047] At their broadest, aspects of the present invention provide for methods and systems for estimating the skew of a local clock in an end-to-end transparent clock device using information from timing messages passing between a master and slave device through that transparent clock device.
[0048] A first aspect of the present invention provides a method of estimating the skew of a local clock in an end-to-end 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: exchanging timing messages between the master device and the slave device over the network, the timing messages passing through said transparent clock device; recording times of sending and receiving 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 and receiving 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; recording the times of sending by the transparent clock device of timing messages sent from the slave device to the master device; extracting, in the transparent clock device, from the timing messages, the residence time of the timing messages 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.
[0049] 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.
[0050] Further, by taking account of the message flows in both the forward (master to slave) and reverse (slave to master) direction, a more accurate estimation of the skew of the local clock may be obtained.
[0051] Preferably the timing messages are messages under the IEEE 1588PTP.
[0052] 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.
[0053] 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. 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.
[0054] Preferably the step of computing modified residence times uses a filtered value of the skew, for example using an exponentially weighted moving average filter.
[0055] In certain embodiments the master device and transparent clock device are capable of hardware timestamping arriving and outgoing timing messages, and the step of extracting the residence time includes: extracting the residence time recorded in the timing messages sent from the master device to the slave device on arrival in the transparent clock device; and extracting the residence time recorded in the timing messages sent from the slave device to the master device on departure from the transparent clock device and the total residence time recorded between the slave device and the masterdevice.
[0056] In such one-step clock arrangements, the residence time in transparent clocks between the master device and the transparent clock device itself in the forward direction between the master and the slave can be determined from the residence time recorded in a timing message when it arrives at the transparent clock. The residence time in the same transparent clocks in the reverse direction (slave to master) is the difference between the residence time for all transparent clocks between the slave and the message leaving the transparent clock device itself and the total residence time for the entire journey from slave to master.
[0057] In certain embodiments the master device and transparent clock device are not capable of hardware timestamping the arriving and outgoing timing messages, the method further including the steps of: for each first timing message (e.g. an IEEE 1588 PTP Sync message) sent from the master device to the slave device, sending a first further timing message (e.g. an IEEE 1588 PTP Follow_Up message) from the master device to the slave device which contains the time of sending of the respective first timing message by the master device, and to which is cumulatively added, by each transparent clock that the further timing message passes through, a first residence time being the time taken for the respective first timing message to pass through each said transparent clock device; and for each second timing message sent from the slave device to the master device (e.g. an IEEE 1588 PTP Delay_Req message), sending a second further timing message (e.g. an IEEE 1588 PTP Delay_Resp message) from the master device to the slave device which contains the time of receipt of the respective second timing message by the master device, and to which is cumulatively added, by each transparent clock that the second further timing message passes through, a second residence time being the time taken for the respective second timing message to pass through each said transparent clock device, and wherein the step of extracting the residence time includes: extracting the first residence time recorded in one of said first further timing messages; and extracting the second residence time recorded in one of said second further timing messages on receipt of the second further timing message at the transparent clock device.
[0058] In such two-step clock arrangements, the residence time in transparent clocks between the master device and the transparent clock device itself in the forward direction between the master and the slave can be determined from the residence time recorded in the first further timing message (e,g. Follow_Up message) when it arrives at the transparent clock. The residence time in the same transparent clocks in the reverse direction (slave to master) is recorded by the transparent clocks as the message (e.g. Delay_Req message) passes through those transparent clocks, but is added to the second further timing message (e.g. Delay_Resp message) when it is returned to the slave.
[0059] 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 a component .sub.1 of the skew in the forward direction from master device to slave device as:
wherein is the departure time of the nth timing message sent from the master device to the slave device,
is the arrival time of the nth timing message sent from the master device to the slave device at the transparent clock device and
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, calculating a component .sub.2 of the skew in the reverse direction from slave device to master device as:
wherein is the arrival time of the nth timing message sent from the slave device to the master device,
is the departure time of the nth timing message sent from the slave device to the master device from the transparent clock device and
is the cumulative residence time of the nth timing message sent from the slave device to the master device in other transparent clock devices whilst travelling between the transparent clock device and the master device, and estimating the skew as the average of .sub.1 and .sub.2.
[0060] 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
wherein .sub.n and .sub.n are the total offset and skew during the nth exchange of timing messages, is the departure time of the nth timing message sent from the master device to the slave device,
is the arrival time of the nth timing message sent from the master device to the slave device at the transparent clock device
is the arrival time of the nth timing message sent from the slave device to the master device,
is the departure time of the nth timing message sent from the slave device to the master device from the transparent clock device,
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,
is the cumulative residence time of the nth timing message sent from the slave device to the master device in other transparent clock devices whilst travelling between the transparent clock device and the master device,
and
are the fixed delays in the directions from master device to slave device and slave device to master devices respectively, y.sub.n(T.sub.1,n T.sub.2TC,n) (T.sub.4,n T.sub.3TC,n) (d.sub.f d.sub.r) (r.sub.ftotal,n r.sub.rtotal,n) is a scalar, n is a nonnegative time index, D.sub.n [2 0] is a 12 matrix, X.sub.n.sup.T [.sub.n .sub.n] is a vector, and v.sub.n (.sub.n .sub.n) is the measurement noise, [0061] and using the state equation:
where w.sub.n.sup.T [w.sub.,n w.sub.,n] is a process noise vector.
[0062] Embodiments using a Kalman filter such as that above can also estimate the offset of the local clock compared to the master clock.
[0063] The method of the present aspect may include any combination of some, all or none of the above described preferred and optional features.
[0064] 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.
[0065] 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.
[0066] A second aspect of the present invention provides an end-to-end 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 in both directions between the master device and 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 and receiving 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; record the times of re-transmission by the transparent clock device of timing messages sent from the slave device to the master device; extract, from the timing messages, the residence time of the timing messages 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.
[0067] 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.
[0068] Further, by taking account of the message flows in both the forward (master to slave) and reverse (slave to master) direction, a more accurate estimation of the skew of the local clock may be obtained.
[0069] Preferably the timing messages are messages under the IEEE 1588PTP.
[0070] 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.
[0071] 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.
[0072] Preferably the step of computing modified residence times uses a filtered value of the skew, for example using an exponentially weighted moving average filter.
[0073] In certain embodiments the transparent clock device is capable of hardware timestamping arriving and outgoing timing messages, and the processor is arranged to extract the residence time by: extracting the residence time recorded in the timing messages sent from the master device to the slave device on arrival in the transparent clock device; and extracting the residence time recorded in the timing messages sent from the slave device to the master device on departure from the transparent clock device and the total residence time recorded between the slave device and the master device.
[0074] In such one-step clock arrangements, the residence time in transparent clocks between the master device and the transparent clock device itself in the forward direction between the master and the slave can be determined from the residence time recorded in a timing message when it arrives at the transparent clock. The residence time in the same transparent clocks in the reverse direction (slave to master) is the difference between the residence time for all transparent clocks between the slave and the message leaving the transparent clock device itself and the total residence time for the entire journey from slave to master.
[0075] In certain embodiments the transparent clock device is not capable of hardware timestamping the arriving and outgoing timing messages, wherein: for each first timing message (e.g. an IEEE 1588 PTP Sync message) sent from the master device to the slave device, sending a first further timing message (e.g. an IEEE 1588 PTP Follow_Up message) from the master device to the slave device which contains the time of sending of the respective first timing message by the master device, and to which is cumulatively added, by each transparent clock that the further timing message passes through, a first residence time being the time taken for the respective first timing message to pass through each said transparent clock device; and for each second timing message (e.g. an IEEE 1588 PTP Delay_Req message) sent from the slave device to the master device, sending a second further timing message (e.g. an IEEE 1588 PTP Delay_Resp message) from the master device to the slave device which contains the time of receipt of the respective second timing message by the master device, and to which is cumulatively added, by each transparent clock that the second further timing message passes through, a second residence time being the time taken for the respective second timing message to pass through each said transparent clock device, and wherein the processor is arranged to extract the residence time by: extracting the first residence time recorded in one of said first further timing messages; and extracting the second residence time recorded in one of said second further timing messages on receipt of the second further timing message at the transparent clock device.
[0076] In such two-step clock arrangements, the residence time in transparent clocks between the master device and the transparent clock device itself in the forward direction between the master and the slave can be determined from the residence time recorded in the first further timing message (e,g. Follow_Up message) when it arrives at the transparent clock. The residence time in the same transparent clocks in the reverse direction (slave to master) is recorded by the transparent clocks as the message (e.g. Delay_Req message) passes through those transparent clocks, but is added to the second further timing message (e.g. Delay_Resp message) when it is returned to the slave.
[0077] 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 a component .sub.1 of the skew in the forward direction from master device to slave device as:
wherein is the departure time of the nth timing message sent from the master device to the slave device,
is the arrival time of the nth timing message sent from the master device to the slave device at the transparent clock device and
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, calculating a component .sub.2 of the skew in the reverse direction from slave device to master device as:
wherein is the arrival time of the nth timing message sent from the slave device to the master device,
is the departure time of the nth timing message sent from the slave device to the master device from the transparent clock device and
is the cumulative residence time of the nth timing message sent from the slave device to the master device in other transparent clock devices whilst travelling between the transparent clock device and the master device, and estimating the skew as the average of .sub.1 and .sub.2.
[0078] 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
wherein .sub.n and .sub.n are the total offset and skew during the nth exchange of timing messages, is the departure time of the nth timing message sent from the master device to the slave device,
is the arrival time of the nth timing message sent from the master device to the slave device at the transparent clock device
is the arrival time of the nth timing message sent from the slave device to the master device,
is the departure time of the nth timing message sent from the slave device to the master device from the transparent clock device,
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,
is the cumulative residence time of the nth timing message sent from the slave device to the master device in other transparent clock devices whilst travelling between the transparent clock device and the master device,
and
are the fixed delays in the directions from master device to slave device and slave device to master devices respectively, y.sub.n (T.sub.1,n T.sub.2TC,n) (T.sub.4,n T.sub.3TC,n) (d.sub.f d.sub.r) (r.sub.ftotal,n r.sub.rtotal,n) is a scalar, n is a nonnegative time index, D.sub.n [2 0] is a 12 matrix, X.sub.n.sup.T [.sub.n .sub.n] is a vector, and v.sub.n (.sub.n .sub.n) is the measurement noise, [0079] and using the state equation:
where w.sub.n.sup.T [w.sub.,n w.sub.,n] is a process noise vector.
[0080] Embodiments using a Kalman filter such as that above can also estimate the offset of the local clock compared to the master clock.
[0081] The device of the present aspect may include any combination of some, all or none of the above described preferred and optional features.
[0082] 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 an end-to-end transparent clock device located in the network between the master device and the slave device and having a local clock, wherein: the master device and slave device are arranged to exchange timing messages over the network, the timing messages passing through said transparent clock device; the master device is arranged to record times of sending and receiving 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 and receiving 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; record the times of sending by the transparent clock device of timing messages sent from the slave device to the master device; extract, from the timing messages, the residence time of the timing messages 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.
[0083] 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.
[0084] Further, by taking account of the message flows in both the forward (master to slave) and reverse (slave to master) direction, a more accurate estimation of the skew of the local clock may be obtained.
[0085] Preferably the timing messages are messages under the IEEE 1588PTP.
[0086] 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.
[0087] 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.
[0088] Preferably the step of computing modified residence times uses a filtered value of the skew, for example using an exponentially weighted moving average filter.
[0089] In certain embodiments the master device and transparent clock device are capable of hardware timestamping arriving and outgoing timing messages, the processor is arranged to extract the residence time by: extracting the residence time recorded in the timing messages sent from the master device to the slave device on arrival in the transparent clock device; and extracting the residence time recorded in the timing messages sent from the slave device to the master device on departure from the transparent clock device and the total residence time recorded between the slave device and the masterdevice.
[0090] In such one-step clock arrangements, the residence time in transparent clocks between the master device and the transparent clock device itself in the forward direction between the master and the slave can be determined from the residence time recorded in a timing message when it arrives at the transparent clock. The residence time in the same transparent clocks in the reverse direction (slave to master) is the difference between the residence time for all transparent clocks between the slave and the message leaving the transparent clock device itself and the total residence time for the entire journey from slave to master.
[0091] In certain embodiments the master device and transparent clock device are not capable of hardware timestamping the arriving and outgoing timing messages, wherein the master device is further arranged to: for each first timing message (e.g. an IEEE 1588 PTP Sync message) sent from the master device to the slave device, send a first further timing message (e.g. an IEEE 1588 PTP Follow_Up message) from the master device to the slave device which contains the time of sending of the respective first timing message by the master device, and to which is cumulatively added, by each transparent clock that the further timing message passes through, a first residence time being the time taken for the respective first timing message to pass through each said transparent clock device; and for each second timing message (e.g. an IEEE 1588 PTP Delay_Req message) sent from the slave device to the master device, send a second further timing message (e.g. an IEEE 1588 PTP Delay_Resp message) from the master device to the slave device which contains the time of receipt of the respective second timing message by the master device, and to which is cumulatively added, by each transparent clock that the second further timing message passes through, a second residence time being the time taken for the respective second timing message to pass through each said transparent clock device, and wherein the processor is further arranged to: extract the first residence time recorded in one of said first further timing messages; and extract the second residence time recorded in one of said second further timing messages on receipt of the second further timing message at the transparent clock device.
[0092] In such two-step clock arrangements, the residence time in transparent clocks between the master device and the transparent clock device itself in the forward direction between the master and the slave can be determined from the residence time recorded in the first further timing message (e,g. Follow_Up message) when it arrives at the transparent clock. The residence time in the same transparent clocks in the reverse direction (slave to master) is recorded by the transparent clocks as the message (e.g. Delay_Req message) passes through those transparent clocks, but is added to the second further timing message (e.g. Delay_Resp message) when it is returned to the slave.
[0093] 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 a component .sub.1 of the skew in the forward direction from master device to slave device as:
wherein is the departure time of the nth timing message sent from the master device to the slave device,
is the arrival time of the nth timing message sent from the master device to the slave device at the transparent clock device and
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, calculating a component .sub.2 of the skew in the reverse direction from slave device to master device as:
wherein is the arrival time of the nth timing message sent from the slave device to the master device,
is the departure time of the nth timing message sent from the slave device to the master device from the transparent clock device and
is the cumulative residence time of the nth timing message sent from the slave device to the master device in other transparent clock devices whilst travelling between the transparent clock device and the master device, and estimating the skew as the average of .sub.1 and .sub.2.
[0094] 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
[0095] wherein .sub.nand .sub.n are the total offset and skew during the nth exchange of timing messages, is the departure time of the nth timing message sent from the master device to the slave device,
is the arrival time of the nth timing message sent from the master device to the slave device at the transparent clock device
is the arrival time of the nth timing message sent from the slave device to the master device,
is the departure time of the nth timing message sent from the slave device to the master device from the transparent clock device,
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,
is the cumulative residence time of the nth timing message sent from the slave device to the master device in other transparent clock devices whilst travelling between the transparent clock device and the master device,
and
are the fixed delays in the directions from master device to slave device and slave device to master devices respectively, y.sub.n (T.sub.1,n T.sub.2TC,n) (T.sub.4,n T.sub.3TC,n) (d.sub.f d.sub.r) (r.sub.ftotal,n r.sub.rtotal,n) is a scalar, n is a nonnegative time index, D.sub.n [2 0] is a 12 matrix, X.sub.n.sup.T [.sub.n .sub.n] is a vector, and v.sub.n (.sub.n .sub.n) is the measurement noise, [0096] and using the state equation:
where w.sub.n.sup.T [w.sub.,n w.sub.,n] is a process noise vector.
[0097] Embodiments using a Kalman filter such as that above can also estimate the offset of the local clock compared to the master clock.
[0098] The system of the present aspect may include any combination of some, all or none of the above described preferred and optional features.
[0099] Clock Skew Estimation and Residence Time Measurement Correction at the End-to-End Transparent Clocks
[0100] 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.
[0101] Basic Clock Model
[0102] 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
S(t) (1 )C(t) .sub.in, (2)
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.
[0103] Equation (2) can further be expressed as
S(t) C(t) (t) C(t) .sub.in, (3)
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.
[0104] Mechanism for Intercepting and Capturing Timestamps at the End-to-End Transparent Clock
[0105] TCs are capable of intercepting PTP messages and capturing embedded and external TC triggered timestamps. That is, a TC is capable of snooping on PTP messages passing through it. Assume there are K TCs 6 between the GM 1 and the slave 3. The following process takes place at the kth TC, l k K:
[0106] For Sync Messages: [0107] 1. TC 6 captures its ingress timestamp T.sub.2TC of the arriving Sync message sent from GM 1 to slave 3. [0108] 2. TC 6 captures the embedded correctionFieldvalue r.sub.ftotal in the Sync/Follow_Up message sent from GM 1 to slave 3. The total residence time r.sub.ftotal does not include the residence time of the TC under consideration. [0109] 3. TC 6 captures the embedded T.sub.1 timestamp in the Sync or Follow_Up message sent from GM 1 to slave 3, [0110] a. For the one-step clock: [0111] T.sub.1 is in the originTimestamp field of Sync message and residence time r.sub.ftotal is in correctionField field of Sync message. [0112] b. For the two-step clock: [0113] T.sub.1 is in the preciseOriginTimestamp field of Follow_Up message and residence time r.sub.ftotal is in correctionField field of Follow_Up message.
[0114] For Delay_Req Messages: [0115] 1. TC 6 captures its egress timestamp T.sub.3TC of the departing Delay_Req message sent from slave 3 to GM 1. [0116] 2. TC 6 captures the embedded T.sub.4 timestamp in the arriving Delay_Resp message sent from GM 1 to slave 3. [0117] 3. Capture of correctionFieldvalue: [0118] a. For the one-step clock: [0119] Note that the residence time at a TC is added to the correctionField of the Delay_Req message by the egress port of the TC clock as the Delay_Req message is being transmitted. [0120] So the TC 6 captures (at the egress port) the embedded correctionFieldvalue r.sub.a in Delay_Req message sent from slave 3 to GM 1. TC 6 also captures the embedded correctionFieldvalue r.sub.b in Delay_Resp message sent from GM 1 to slave 3. Note that the Delay_Resp message carries the total path residence time (r.sub.b) experienced by the Delay_Req message from slave 3 to GM 1. Thus the GM to TC total residence time is r.sub.rtotal r.sub.b r.sub.a. The total residence time r.sub.b does not include the residence time of the TC under consideration. [0121] b. For the two-step clock: [0122] The received Delay_Req message at the TC 6 is transmitted from the egress port. The residence time is added to the correctionField of the Delay_Resp message associated with the Delay_Req message prior to transmission of the Delay_Resp message on the egress port. [0123] TC 6 captures (at the ingress port) the embedded correctionFieldvalue r.sub.rtotal in Delay_Resp message sent from GM 1 to slave 3. The value in this field reflects only the total GM to TC residence time. The total residence time r.sub.rtotal does not include the residence time of the TC under consideration.
[0124] The embedded and TC triggered timestamps captured at the TC 6 (as shown in
[0125] Basic Network Synchronization Models
[0126] 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 E2E TCs 6 from GM 1 to slave 3.
[0127] Assume the nth Sync message travelling from the GM 1 to the kth TC 6 experiences a fixed physical link (or propagation) delay of plus variable cumulative residence time of r.sub.ftotal,n. Similarly, it is assumed the nth Delay_Req message traveling from the kth TC 6 to the GM 1 experiences a fixed delay of d.sub.r plus variable cumulative residence time of r.sub.rtotal,n.
[0128] The GM 1 and slave 3 exchange messages using the delay-request delay-response mechanism described above and illustrated in
(T.sub.1,n d.sub.f r.sub.ftotal,n) (1 )T.sub.2TC,n .sub.in (4)
[0129] For the nth Delay_Req message which departs the kth TC 6 with timestamp T.sub.3TC,n C(t) and arrives at the GM 1 with timestamp T.sub.4,n S(t) after having experienced delays of d.sub.r and r.sub.rtotal,n, the following expression is obtained
(T.sub.4,n d.sub.r r.sub.rtotal,n) (1 )T.sub.3TC,n .sub.in (5)
[0130] 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 tor n) and skew can be assumed constant over that period. Two possible techniques for computing the offsets , .sub.in and skew using the Sync and Delay_Req message exchanges are set out in more detail below.
[0131] 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 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).
[0132] Simple Linear Approximation Technique Skew Estimation at the E2E TCs
[0133] Adding equations (4) and (5) and rearranging gives the clock offset .sub.in as
[0134] If the physical links between the GM and the kth TC are symmetric, then d.sub.f d.sub.r and
[0135] As discussed above, since the focus of this method is syntonization, the aim is to estimate the skew using the Sync and Delay_Req messages. Let .sub.1 denote the component of the skew that can be estimated from the Sync message exchange. For the (n-1) and nth Sync message exchange equation (4) above gives the following:
(T.sub.1,n 1 d.sub.f r.sub.ftotal,n 1) (1 .sub.1)T.sub.2TC,n 1 .sub.in (8)
(T.sub.1,n r.sub.ftotal,n) (1 .sub.1)T.sub.2TC,n .sub.in (9)
[0136] Subtracting (8) from (9) gives:
[0137] Let .sub.2 denote the component of the skew that can be estimated from the Delay_Req message exchange. For the (n-1) and nth Delay_Req message exchange equation (5) above gives the following:
(T.sub.4,n 1 d.sub.r r.sub.rtotal,n 1) (1 .sub.2)T.sub.3TC,n 1 .sub.in (12)
(T.sub.4,n d.sub.r r.sub.rtotal,n) (1 .sub.2)T.sub.3TC,n .sub.in (13)
[0138] Subtracting (12) from (13) gives:
[0139] The skew can then be estimated from .sub.1 and .sub.2 as
[0140] If desired, the estimated skew 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 and offset .sub.in can be used to estimate the server time S.sub.n corresponding to a local clock value C.sub.n.
[0141] The residence times can be estimated given the computed skew and the ingress and egress timestamps generated upon PTP 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 PTP 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. Using (2), the following relationships can be derived:
S.sub.in (1 )C.sub.in .sub.in (17)
S.sub.eg (1 )C.sub.eg .sub.in (18)
[0142] 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 idea) residence times at the TC as follows,
r.sub.mod S.sub.eg S.sub.in (1 )(C.sub.eg C.sub.in) (19)
[0143] 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) (20)
[0144] However, it can be seen from (19) 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 (21)
[0145] 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 (22)
[0146] 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 EWMA filter 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.
[0147] Kalman Filter Based Technique for Skew Estimation at the E2E TCs
[0148] 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.
[0149] 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 modeled 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, (23)
Measurement Equation: y.sub.n D.sub.nX.sub.n v.sub.n, (24)
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.nN(0,Q.sub.n), y.sub.n is the measurement, D.sub.n is a known 1m-dimensional measurement matrix which maps the true state space into the measurement space, v.sub.s 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.nN(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, . . . , v.sub.n, . . . , v.sub.n} are mutually independent.
[0150] 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 are most often conceptualized as two distinct phases: Predict and Update as described below.
[0151] Predict Phase:
[0152] The predict phase uses the state estimate from the previous time step to produce an estimate of the state at the current time step. [0153] Predicted (a priori) state estimate:
{circumflex over (X)}.sub.n,n 1 A.sub.n{circumflex over (X)}.sub.n 1,n 1 (25) [0154] 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. [0155] Predicted (a priori) estimate covariance:
P.sub.n,m 1 A.sub.nP.sub.n 1,n 1A.sub.n.sup.T Q.sub.n (26)
[0156] Update Phase:
[0157] 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. [0158] Innovation or measurement residual:
{circumflex over (z)}.sub.n y.sub.n D.sub.n{circumflex over (X)}.sub.n,n 1 (27) [0159] Innovation (or residual) covariance:
S.sub.n D.sub.nP.sub.n,n 1D.sub.n.sup.T R.sub.n (28) [0160] 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 (29) [0161] Updated (a posteriori) 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) (30)
[0162] 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 the 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 not much credibility would be given 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 a lot of credibility will be given to the measurement when computing the next {circumflex over (X)}. [0163] Updated (a posteriori) estimate covariance:
P.sub.n,n (I K.sub.nD.sub.n)P.sub.n,n 1 (31)
[0164] This is the a posteriori error covariance matrix (a measure of the estimated accuracy of the state estimate).
[0165] 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.
[0166] Development of the Measurement Equation
[0167] Assume a Sync message travelling from a GM 1 to the kth TC 6 experiences a fixed delay d, variable cumulative residence time r.sub.ftotal, plus a stochastic delay (to account for all other delay components in the system). Similarly, assume a Delay_Req message leaving the TC 6 to the GM 1 experiences a fixed delay of d, variable cumulative residence time r.sub.rtotal, and a variable stochastic delay y. It is assumed, for the moment, that the fixed delay components in both directions are equal, d.sub.f d.sub.r d (symmetric communication paths) but the messages experience variables delays such queuing delays. The variables .sub.n and .sub.n are the total offset and skew during the nth Sync message exchange. Equations (4) and (5) above can be rewritten to account for the above conditions with the following equations
(T.sub.1,n d r.sub.ftotal,n .sub.n) (1 .sub.n)T.sub.2TC,n .sub.in (32)
(T.sub.4,n d r.sub.rtotal,n .sub.n) (1 .sub.n)T.sub.3TC,n .sub.in (33)
[0168] It can be seen from equation (3) above that for a given reading of C.sub.n, the total offset is .sub.n .sub.nC.sub.n .sub.in. A key assumption here is the total offset .sub.n stays constant between Sync message exchanges as stated earlier above. With this and assuming further that the T.sub.2TC,n C(t) and T.sub.3TC,n C(t) timestamps are captured closer together within any two Sync message exchanges, the total offset .sub.n in that interval can be defined as
.sub.n .sub.nT.sub.2TC,n .sub.in .sub.nT.sub.3TC,n .sub.in (34)
[0169] With the above definitions in mind,
(T.sub.1,n d r.sub.ftotal,n .sub.n) T.sub.2TC,n .sub.n (35)
(T.sub.4,n d r.sub.rtotal,n .sub.n) T.sub.3TC,n .sub.n (36)
[0170] Adding (35) and (36) gives the measurement equation as
(T.sub.1,n T.sub.4,n) (r.sub.ftotal,n r.sub.rtotal,n) (.sub.n .sub.n) (T.sub.2TC,n T.sub.3TC,n) 2.sub.n (T.sub.1,n T.sub.2TC,n) (T.sub.4,n T.sub.3TC,n) (r.sub.flotal,n r.sub.rtotal,n) 2.sub.n (.sub.n .sub.n) (37)
[0171] The measurement equation above can be rewritten as
where
[0172] n is a nonnegative time index,
[0173] y.sub.n (T.sub.1,n T.sub.2TC,n) (T.sub.4,n T.sub.3TC,n) (r.sub.ftotal,n r.sub.rtotal,n) is a scalar,
[0174] D.sub.n [2 0] is a 12 matrix,
[0175] X.sub.n.sup.T [.sub.n .sub.n] is a vector, and
[0176] v.sub.n (.sub.n .sub.n) is the measurement noise.
[0177] Alternatively, in the case where the forward delay d.sub.f and reverse delay d.sub.r are unequal but are known (see equations (4) and (5)), the measurement equation can be obtained as
where y.sub.n (T.sub.i,n T.sub.2TC,n) (T.sub.4,n T.sub.3TC,n) (d.sub.f d.sub.r) (r.sub.ftotal,n r.sub.rtotal,n) is a scalar. The quantity (d.sub.f d.sub.r) accounts for the fixed delay asymmetry in the system. The above more general equation allows for known delays and asymmetries to be accounted for in the Kalman Filter formulation.
[0178] The nth sampling interval is considered to be the period in which the nth Sync and nth Delay_Req messages exchanges occur.
[0179] Development of the State (Process) Equation
[0180] 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
[0181] 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,n T.sub.2,n 1) w.sub.,n .sub.n .sub.n 1 w.sub.,n (41)
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.n w.sub.n.sup.T]. The system can be described by the following two-state dynamic model
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.2TC,n T.sub.2TC,n 1) t is a constant term, and
[0182] In reality, A.sub.n is not a fixed matrix because of the variable message delays experienced in the system, thus making (42) 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 (19). To achieve time synchronization or equivalently find the server time estimate S.sub.n (although not required in this context), the estimate .sub.n from the Kalman Filter can be used in (3) to obtain S.sub.n, that is, S.sub.n C.sub.n .sub.n.
[0183] 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.
[0184] 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.
[0185] 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.
[0186] 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.
[0187] 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.
[0188] 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 methodsrespectively.
REFERENCES
[0189] [1]. R. E. Kalman, A New Approach to Linear Filtering and Prediction Problems, Transaction of the ASMEJournal of Basic Engineering, March 1960, pp. 35-45.
[0190] All references referred to above are hereby incorporated by reference.