Article View: fj.mail-lists.parallel
Article #393time problem
From: clump
Date: Thu, 03 Sep 1992 17:53
Date: Thu, 03 Sep 1992 17:53
37 lines
1759 bytes
1759 bytes
----------------------------------------------------------------------------
- A Solution -
----------------------------------------------------------------------------
Let the local time of A be tA, and the local time of B be tB.
Further, let tAB be the lag between messages going from A to B,
and let tBA be the symmetric value. Since both time pieces
are presumable ticking at the same rate, let tB = tA + C for some
constant C. If we can determine C, then they can synchronize their
watches.
1) A asks B the time. As s/he does, s/he notes how long it
takes to hear the response from B. If B answers promptly,
A will now know 3 things:
(tA) (local time)
(tAB + tBA) (total delay)
(tA + C + tAB) (time told to A by B)
2) A subtracts the last value from the first two:
(tA) + (tAB + tBA) - (tA + C + tAB) = (tBA - C)
3) B now asks A the time. A hears the request at time
tA', notes this time and responds. B now knows:
(tA' + tBA) (time told to B by A)
4) B tells A the value of (tA' + tBA). A can now calculate:
(tA') + (tBA - C) - (tA' + tBA) = -C
5) A adds -C to his/her watch. Now both watches are in synch.
Of course this algorithm can only be as accurate as the
reaction time of the participants. It also assumes
that tAB and tBA are constant.
Clark Verbrugge
clump@binkley.cs.mcgill.ca
Technical Details
Message-ID:
<314886@nttlab.ntt.JP>Path:
arc1-ca.pugleaf.net!sparky!uunet!sun-barr!sh.wide!wnoc-snd-ss2!akiu!hakata!kyu-cs!lab!nttlab!daemonShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!sun-barr!sh.wide!wnoc-snd-ss2!akiu!hakata!kyu-cs!lab!nttlab!daemon From: clump@asparagus.cs.mcgill.ca Newsgroups: fj.mail-lists.parallel Subject: time problem Message-ID: <314886@nttlab.ntt.JP> Date: 3 Sep 92 17:53:16 GMT Sender: news@nttlab.ntt.JP Distribution: fj Lines: 37 Approved: news@nttlab.ntt