1 / 16

Proof of liveness: an example

Proof of liveness: an example. 0. Clock phase synchronization System of n clocks ticking at the same rate. Each clock is 3-valued, i,e it ticks as 0, 1, 2, 0, 1, 2… A failure may arbitrarily alter the clock phases. The clocks need to return to the same phase. 1. 2. 3. n-1.

jonessteven
Download Presentation

Proof of liveness: an example

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Proof of liveness: an example 0 Clock phase synchronization System of n clocks ticking at the same rate. Each clock is 3-valued, i,e it ticks as 0, 1, 2, 0, 1, 2… A failure may arbitrarily alter the clock phases. The clocks need to return to the same phase. . 1 2 3 n-1

  2. Clock phase synchronization {Program for each clock} (c[k] = phase of clock k, initially arbitrary) do j: j  N(i) :: c[j] = c[i] +1 mod 3  c[i] := c[i] + 2 mod 3 [] j: j N(i) :: c[j] ≠ c[i] +1 mod 3  c[i] := c[i] + 1 mod 3 od Show that eventually all clocks will return to the same phase (convergence), and continue to be in the same phase (closure) Proof of liveness: an example k: c[k]  {0.1.2} 0 1 2 3 n-1

  3. Let D = d[0] + d[1] + d[2] + … + d[n-1] d[i] = 0 if no arrow points towards clock i; = i + 1 if a pointing towards clock i; n - i if a  pointing towards clock i; = 1 if both  and point towards clock i. By definition, D ≥ 0. Also, D decreases after every step in the system. So the number of arrows must reduce to 0. Proof of convergence 0 1 2 n-1 0 2 2 2 0 1 1 0 1 1 2 2 2 2 2 Understand the game of arrows

  4. Primary standard = rotation of earth De facto primary standard = atomic clock (1 atomic second = 9,192,631,770 orbital transitions of Cesium 133 atom. 86400 atomic sec = 1 solar day – 3 ms (requires leap second correction each year) Coordinated Universal Time (UTC) = GMT ± number of hours in your time zone Time and Clock

  5. Global positioning system: GPS Location and precise time computed by triangulation Right now GPS time is nearly 14 seconds ahead of UTC, since It does not use leap sec. correction Per the theory of relativity, an additional correction is needed. Locally compensate by the Receivers. A system of 32 satellites broadcast accurate spatial corordinates and time maintained by atomic clocks

  6. Simultaneous? Happening at the same time? NO. There is nothing called simultaneous in the physical world. What does “concurrent” mean? Alice Explosion 2 Explosion 1 Bob

  7. Physical clock synchronization Question 1. Why is physical clock synchronization important? Question 2. With the price of atomic clocks or GPS coming down, should we care about physical clock synchronization?

  8. Types of Synchronization External Synchronization Internal Synchronization Phase Synchronization Types of clocks Unbounded 0, 1, 2, 3, . . . Bounded 0,1, 2, . . . M-1, 0, 1, . . . Classification Unbounded clocks are not realistic, but are easier to deal with in the design of algorithms. Real clocks are always bounded.

  9. What are these? Drift rate  Clock skew  Resynchronization interval R Max drift rate  implies: (1- ) ≤ dC/dt < (1+ ) Challenges (Drift is unavoidable) Accounting for propagation delay Accounting for processing delay Faulty clocks Terminologies

  10. Berkeley Algorithm A simple averaging algorithm that guarantees mutual consistency |c(i) - c(j)| <  Step 1. Read every clock in the system. Step 2. Discard outliers and substitute them by the value of the local clock. Step 3. Update the clock using the average of these values. Resynchronization interval will depend on the drift rate. Internal synchronization

  11. Lamport and Melliar-Smith’s averaging algorithm handles byzantine clocks too Assume n clocks, at most t are faulty Step 1. Read every clock in the system. Step 2. Discard outliers and substitute them by the value of the local clock. Step 3. Update the clock using the average of these values. Synchronization is maintained if n > 3t Why? Internal synchronization Bad clock A faulty clocks exhibits 2-faced or byzantine behavior

  12. Lamport & Melliar-Smith’s algorithm (continued) The maximum difference between the averages computed by two non-faulty nodes is (3td / n) To keep the clocks synchronized, 3td / n < d So,3t < n Internal synchronization k B a d c l o c k s

  13. Client pulls data from a time server every R unit of time, where R <  / 2. (why?) For accuracy, clients must compute the round trip time(RTT), and compensate for this delay while adjusting their own clocks. (Too large RTT’s are rejected) Cristian’s method External Synchronization Time server

  14. Tiered architecture Broadcast mode - least accurate Procedure call - medium accuracy Peer-to-peer mode - upper level servers use this for max accuracy Network Time Protocol (NTP) Time server Level 0 Level 1 Level 1 Level 1 Level 2 Level 2 Level 2 The tree can reconfigure itself if some node fails.

  15. Let Q’s time be ahead of P’s time by . Then T2 = T1 + TPQ + T4 = T3 + TQP - y = TPQ + TQP = T2 +T4 -T1 -T3 (RTT)  = (T2 -T4 -T1 +T3) / 2 - (TPQ -TQP) / 2 P2P mode of NTP T2 T3 Q P T1 T4 x Between y/2 and -y/2 So, x- y/2 ≤  ≤ x+ y/2 Ping several times, and obtain the smallest value of y. Use it to calculate 

  16. Problems with Clock adjustment 1. What problems can occur when a clock value is advanced from 171 to 174? 2. What problems can occur when a clock value is moved back from 180 to 175?

More Related