home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / parallel / 2038 < prev    next >
Encoding:
Text File  |  1992-09-03  |  5.4 KB  |  120 lines

  1. Newsgroups: comp.parallel
  2. Path: sparky!uunet!gatech!hubcap!fpst
  3. From: leichter@zodiac.rutgers.edu
  4. Subject: Re: Synchonizing watches
  5. Message-ID: <1992Sep3.201859.25262@hubcap.clemson.edu>
  6. Sender: news@igor.rutgers.edu
  7. Nntp-Posting-Host: cancer.rutgers.edu
  8. Organization: Rutgers University Department of Computer Science
  9. References: <1992Sep3.123226.14205@hubcap.clemson.edu>
  10. Date: 3 Sep 92 18:53:36 GMT
  11. Approved: parallel@hubcap.clemson.edu
  12. Lines: 106
  13.  
  14.  
  15. In article <1992Sep3.123226.14205@hubcap.clemson.edu>, steve@hubcap.clemson.edu ("Steve" Stevenson) writes:
  16. | [I saw this on sci.logic. I thought it was a nice problem for this group.
  17. |   steve]
  18. |>From: dougs@tvnews.tv.tek.com (Doug Stevens)
  19. |>Message-ID: <1992Sep1.234452.26917@tvnews.tv.tek.com>
  20. | [....]
  21. | A and B are two people at two ends of a very slow telephone connection. 
  22. | They are both completely cut off from the world except for their connection 
  23. | with each other.  In particular, they have no idea what time it is in the 
  24. | real world.
  25. | There is a delay AB in the transmission of what is being said by
  26. | A to B, and a delay BA in the transmission of what is being said
  27. | by B to A. The delay AB does not equal the delay BA. The delays, for the
  28. | purpose of this problem, are on the order of minutes in each direction.
  29. | Both A and B have watches. Before they begin to talk, the watches are not
  30. | set to the correct time, nor are they set to the same time.
  31. | The problem is to devise a procedure such that A and B can, via their 
  32. | telephone connection only, accurately synchronize their watches (to
  33. | within a few seconds). The watches do not have to reflect time in the
  34. | real world, but must match each other. Both A and B will know the procedure 
  35. | before the call begins, and each will know whether he is A or B.
  36.  
  37. No such algorithm can exist, given some simple assumptions about A, B, and
  38. the watchs - e.g., that only a fixed number of messages can be sent or can
  39. arrive between successive ticks of a watch.
  40.  
  41. The proof is by contradiction.  We assume that SOME synchronization algorithm
  42. exists.
  43.  
  44. Without loss of generality, we assume that A's watch initially reads 0;
  45. B's watch might be set to anything.
  46.  
  47. Lemma:  An algorithm exists in which B has no watch.
  48.  
  49. Proof:  Suppose we wish to synchronize to watches (including a simulated watch
  50. on B) to with delta seconds.  Every delta seconds on its watch, A sends a
  51. "tick" message to B.  (If A wants to send B a message at exactly the same
  52. time, it piggy-backs a "tick" message on it.)  Whenever B receives a "tick"
  53. message, it increments a local counter.  Once AB seconds have gone by, B's
  54. counter will be indistinguishable from a watch; it will have a maximum error
  55. of delta just before the next "tick" arrives.  (The problem statement is vague
  56. on what assumptions we can make about the timing resolution of the watches.
  57. Clearly, the resolution must be at most delta.  If the algorithm requires a
  58. finer resolution, A can send "tick" messages more often.)
  59.  
  60.  
  61. Lemma:  An algorithm exists in which A sends the first message, and B sends
  62. nothing until after it has received the first message.
  63.  
  64. Proof:  Clear, since nothing in the problem specification allows us to AVOID
  65. this situation with certainty, and the algorithm must still work.  So we
  66. simply require it.
  67.  
  68.  
  69. Lemma:  An algorithm exists in which each machine responds to every message
  70. it receives.  (In particular, this means that the receiver of a message can
  71. always tell which of its own messages it was in response to, with no extra
  72. information.)
  73.  
  74. Proof:  Clear, since we can always send extra messages (or piggyback respon-
  75. ses onto messages to keep the total number between ticks down).
  76.  
  77.  
  78. Lemma:  An algorithm exists in which every message from B to A consists only
  79. of the value of B's watch.
  80.  
  81. Proof:  Consider the computation that B goes through to determine its message.
  82. The only inputs are its initial state, all the messages it has already
  83. received, and its local watch.  We can assume that A knows B's initial state,
  84. since if there is any implementation, giving A more data can't break it; and A
  85. certainly knows what messages it sent, and by the previous lemma, exactly
  86. which ones B has seen before constructing this response.  Hence, given only
  87. the value of B's watch, A can simulate B and reconstruct the message.
  88.  
  89.  
  90. Lemma:  B doesn't even have to send the value of its watch!
  91.  
  92. Proof:  By the first lemma, B doesn't need a watch, only a counter of ticks
  93. it has received.  If B ack's every tick, A will know exactly what B's counter
  94. contains at the time it constructs any response message.
  95.  
  96. Lemma:  We can replace B by a machine that sends just an "ack" message in
  97. immediate response to every message it receives from A.
  98.  
  99. Proof:  Clear.
  100.  
  101.  
  102. But now consider the world from A's point of view.  It sends some messages,
  103. and receives in response a series of indistinguishable ack's.  The only
  104. thing that can vary is the interval from the moment A sends a message until
  105. it receives that message's ack.  However, that interval depends only on the
  106. round-trip time; it will be exactly the same in the cases AB=2, BA=0 and
  107. AB=BA=1.  This information is insufficient for A to calculate the difference
  108. between its watch value an B's.  As a result, the messages A sends out must
  109. be the same in both situations.  This means B sees exactly the same messages
  110. at exactly the same times in both cases, too.  So it can't distinguish these
  111. two cases either.  Hence B doesn't can't reset its watch effectively either.
  112.  
  113.                             -- Jerry
  114.  
  115.