1 / 14

Time, Clocks, and the Ordering of Events in a Distributed System Leslie Lamport

Time, Clocks, and the Ordering of Events in a Distributed System Leslie Lamport. Jaesub kim jskim@sslab.kaist.ac.kr. Contents. Partial Ordering Logical Clocks Total Ordering Anomalous Behavior Strong Clock Condition Physical Clock Condition Upper bound to avoid Anomalous Conclusion.

kioshi
Download Presentation

Time, Clocks, and the Ordering of Events in a Distributed System Leslie Lamport

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. Time, Clocks, and the Ordering of Events in a Distributed SystemLeslie Lamport Jaesub kim jskim@sslab.kaist.ac.kr

  2. Contents • Partial Ordering • Logical Clocks • Total Ordering • Anomalous Behavior • Strong Clock Condition • Physical Clock Condition • Upper bound to avoid Anomalous • Conclusion

  3. “Happened before” relation • Smallest relation satisfying the three conditions: • If a and b are events in the same process and a comes before b, then ab • If a is the sending of a message by a process and b its receipt by another process then ab • If ab and b c then ac. • Logical Concurrency (of Events) • Two events are concurrent if neither can causally affect the other. • I.e. a  b and b  a

  4. “Happened Before” relation example

  5. Logical Clocks • A clock is a way of assigning a number to an event. i.e. just a counter, no actual timing mechanism needed • Verify the clock condition: if ab then C<a> <C<b> and the two subconditions: • if a and b are events in process Pi and a comes before b, then Ci<a> <Ci<b>, • if a is the sending of a message by Pi and b its receipt by Pj then Ci<a><Cj<b>,

  6. Implementation Rule • Each process Pi increments its clock Ci between two consecutive events, • If a is the sending of a message m by Pi then m includes a timestamp Tm = Ci<a> when Pj receives m, it sets its clock to a value greater than or equal to its present value and greater than Tm.

  7. Logical Clock Example

  8. Defining a total order • We can define a total ordering on the set of all system events ab if either Ci<a><Cj<b> or Ci<a>=Cj<b> and Pi<Pj. • Ordering depends on the system of clocks Ci and is not unique

  9. Computer A Computer B Anomalous Behavior • Logical clocks have anomalous behaviorsin the presence of outside interactions • Must use physical clocks d a X X outside interaction b e X X

  10. Strong Clock Condition • Let S be set of all systems events plus the relevant external events • For any events a, b inS, if ab then C<a> <C<b> • The strong clock condition is not satisfied by our logical clocks. We turn to physical clocks

  11. Physical Clock Conditions • There is a constant  << 1 such that for all i: |d Ci(t)/dt - 1| < The clock is neither too fast nor too slow • There is a constant  such that for all i, j: |Ci(t) - Cj(t)| < The clocks are more or less synchronized

  12. How small  and  • To avoid anomalous: For any I, j and t Ci(t + ) –Cj(t) > 0 From PC1 , From PC2 and above condition

  13. Implementation Rule for PC2 • If Pi does not receive a message at time tthen Ci(t) is differentiable and dCi(t)/dt> 0, • If Pi sends message m at time tthen m includes a timestamp Tm = Ci(t) When Pj receives m at time t’,itj sets Cj(t’) to maximum of Cj(t’-0) and Tm+.m,where .m is the minimum transmission delay

  14. Conclusion • Concept of partial ordering and logical clock • Then, extending it to a arbitrary total ordering which is important for synchronization problem • Introduce anomalous behaviors and how to prevent it

More Related