# Causality causality helps idenfy sequenal and

This preview shows page 1. Sign up to view the full content.

This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: ived: T1 Cris\an’s Algorithm •  The client sets \me to T1 − T0 TNew = TServer + 2 T −T Error bound < = 1 0 2 The Berkeley Algorithm •  Gusella & Zar, 1989 •  Assumes no machine has an accurate \me source •  Obtains average from par\cipa\ng computers •  Synchronizes all clocks to average –  Can discard outliers Berkeley Algorithm •  Machines run \me dæmon •  Process that implements protocol •  One machine is elected (or designated) as the server (master) •  Others are slaves •  Algorithm has provisions for ignoring readings from clocks whose skew is too great –  Compute a fault- tolerant average •  If master fails –  Any slave can take over Network Time Protocol, NTP •  •  •  •  •  1991, 1992 Internet Standard, version 3: RFC 1305 Synchroniza\on similar to Cris\an’s alg. All messages delivered unreliably with UDP Use a stratum structure NTP – An example •  Columbia NTP server –  Stratum Two Problems with Real Synchroniza\on •  Clocks are never exactly synchronized •  More oven than not, distributed systems do not need real \me, but *some* \me that every machine in a protocol agrees upon! Logical Time •  What does “Concurrent” Mean? •  Happening at the same \me? NO. •  There is nothing called simultaneous in the physical world. •  Concurrency means the absence of causal order. Sequen\al and Concurrent Events •  Sequen\al = Totally ordered in \me. –  Total ordering is feasible in a single process that has only one clock. This is not true in a distributed system. •  Two issues are important here: –  How to synchronize physical clocks ? –  Can we deﬁne sequen\al and concurrent events without using physical clocks? Causality •  Causality helps iden\fy sequen\al and concurrent events without using physical clocks. –  Joke → Re: joke –  → implies causally ordered before or happened before Causality •  Rule 1. –  If a, b are two events in a single process P, and the \me of a is less than the \me of b then a→ b. •  Rule 2. –  If a = sending a message, and b = receipt of that message, then a → b. •  Rule 3. –  a → b ∧ b → c ⇒ a → c Lamport Clocks •  Lamport clock assigns logical \mestamps to events consistent with “happens before” ordering –  All hosts use a counter...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online