Commit 105e1524 authored by Peter Waher's avatar Peter Waher

Clock synchronization

parent e4f4ecae
......@@ -29,8 +29,15 @@ Process
------------------------
The Synchronization namespace only defines one simple element: `clock`, which is an element of the simple type `xs:dateTime`. The client sends its time
(in UTC) to the clock source, who immediately responds with a `clock` element of its own, with its time (in UTC). When the client receives the response,
it notes its own time again (in UTC).
(in UTC) ct<sub>1</sub> to the clock source, who immediately responds with a `clock` element of its own, with its time (in UTC) st. When the client receives the response,
it notes its own time again (in UTC) ct<sub>2</sub>.
![Clock Synchronization](Diagrams/Synchronization.png)
Δt<sub>1</sub>=st-ct<sub>1</sub> is given variation in the network and operating system processes approximately
equal to the latency in the network l plus the difference between the client and souce clocks Δt. The response, which travels in the other direction, can be used to
to calculate Δt<sub>2</sub>=ct<sub>2</sub>-st which is approximately equal to the latency in the network l minus the difference between the client and souce clocks Δt.
The latency l is therefore approximately half of Δt<sub>1</sub>+Δt<sub>2</sub>. The difference in clocks Δt is therefore approximately Δt<sub>1</sub>-Δt<sub>2</sub>.
To decrease the variation of network and process activity, an average value over a time window should be used. The internal clocks of the client and server can be
considered much more stable than the latency in the network. The bulk of the variance in the measured l and Δt can therefore be attributed to variance in the network,
as well as concurrent processes and loads on the client and clock source.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment