home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / sci / logic / 1342 < prev    next >
Encoding:
Text File  |  1992-09-03  |  3.9 KB  |  100 lines

  1. Newsgroups: sci.logic
  2. Path: sparky!uunet!destroyer!gatech!hubcap!fpst
  3. From: fpst@hubcap.clemson.edu (Steve Stevenson)
  4. Subject: Re: Synchonizing watches
  5. Message-ID: <1992Sep3.172632.10776@hubcap.clemson.edu>
  6. Organization: Clemson University
  7. References: <1992Sep1.234452.26917@tvnews.tv.tek.com>
  8. Distribution: usa
  9. Date: Thu, 3 Sep 1992 17:26:32 GMT
  10. Lines: 88
  11.  
  12. dougs@tvnews.tv.tek.com (Doug Stevens) writes:
  13.  
  14. >------
  15. >A and B are two people at two ends of a very slow telephone connection. 
  16. >They are both completely cut off from the world except for their connection 
  17. >with each other.  In particular, they have no idea what time it is in the 
  18. >real world.
  19.  
  20. >There is a delay AB in the transmission of what is being said by
  21. >A to B, and a delay BA in the transmission of what is being said
  22. >by B to A. The delay AB does not equal the delay BA. The delays, for the
  23. >purpose of this problem, are on the order of minutes in each direction.
  24.  
  25. >Both A and B have watches. Before they begin to talk, the watches are not
  26. >set to the correct time, nor are they set to the same time.
  27.  
  28. >The problem is to devise a procedure such that A and B can, via their 
  29. >telephone connection only, accurately synchronize their watches (to
  30. >within a few seconds). The watches do not have to reflect time in the
  31. >real world, but must match each other. Both A and B will know the procedure 
  32. >before the call begins, and each will know whether he is A or B.
  33.  
  34. I posted this problem to my news group, comp.parallel. Here are two
  35. solutions I've received. The first gives a solution and the second
  36. gives a Thinking Machines Corporation publication which deals with the 
  37. problem
  38.  
  39. =========================== MODERATOR ==============================
  40. Steve Stevenson                            fpst@hubcap.clemson.edu
  41. Administrative address                     steve@hubcap.clemson.edu
  42. Department of Computer Science,            comp.parallel
  43. Clemson University, Clemson, SC 29634-1906 (803)656-5880.mabell
  44. ====================================================================
  45.  
  46. Date: Thu, 3 Sep 92 11:30:41 -0400
  47. From: Clark VERBRUGGE <clump@asparagus.cs.mcgill.ca>
  48. Message-Id: <9209031530.AA01758@asparagus.cs.mcgill.ca>
  49. ----------------------------------------------------------------------------
  50. - A Solution -
  51. ----------------------------------------------------------------------------
  52. Let the local time of A be tA, and the local time of B be tB.
  53. Further, let tAB be the lag between messages going from A to B,
  54. and let tBA be the symmetric value. Since both time pieces
  55. are presumable ticking at the same rate, let tB = tA + C for some
  56. constant C. If we can determine C, then they can synchronize their
  57. watches.
  58.  
  59. 1) A asks B the time. As s/he does, s/he notes how long it
  60.    takes to hear the response from B. If B answers promptly, 
  61.    A will now know 3 things:
  62.       (tA)                 (local time)
  63.       (tAB + tBA)          (total delay)
  64.       (tA + C + tAB)       (time told to A by B)
  65.  
  66. 2) A subtracts the last value from the first two:
  67.       (tA) + (tAB + tBA) - (tA + C + tAB) = (tBA - C)
  68.  
  69. 3) B now asks A the time. A hears the request at time
  70.    tA', notes this time and responds. B now knows:
  71.       (tA' + tBA)          (time told to B by A)
  72.  
  73. 4) B tells A the value of (tA' + tBA). A can now calculate:
  74.       (tA') + (tBA - C) - (tA' + tBA) = -C
  75.  
  76. 5) A adds -C to his/her watch. Now both watches are in synch.
  77.  
  78. Of course this algorithm can only be as accurate as the
  79. reaction time of the participants. It also assumes
  80. that tAB and tBA are constant.
  81.  
  82. Clark Verbrugge
  83. clump@binkley.cs.mcgill.ca
  84.  
  85. ====================================================================
  86. From: Barry Margolin <barmar@Think.COM>
  87.     
  88. Take a look at the algorithms in the Network Time Protocol, RFC 1305.  Or
  89. if the specific algorithms aren't a good match, the references (there are
  90. about 60 of them) at the end of the document should be useful.
  91.  
  92. -- 
  93. Barry Margolin
  94. System Manager, Thinking Machines Corp.
  95.  
  96. barmar@think.com          {uunet,harvard}!think!barmar
  97.  
  98.  
  99.  
  100.