# Maya Haridasan

Document Sample

```					   Time

Maya Haridasan
April 15th
What’s wrong with the clocks?
Why is synchronization so complicated?

Due to variations of transmission delays
each process cannot have an instantaneous
global view of every remote clock value

Presence of drifting rates

Hardest: support faulty elements
External Clock Synchronization

Synchronize clocks with respect to an external
time reference: usually useful in loosely coupled
networks or real-time systems (Ex, NTP)
Internal Clock Synchronization

Synchronize clocks among themselves
Enables a process to measure
the duration of distributed
activities that start on one
processor and terminate on
another one.

Establishes an order between
distributed events in a
manner that closely
approximates their real time
precedence.
Software Clock Synchronization
1. Deterministic  assumes an upper bound
on transmission delays – guarantees some
precision
2. Statistical  expectation and standard
deviation of the delay distributions are
known
3. Probabilistic  no assumptions about
delay distributions
Correct clock - Definition
A correct clock Hp satisfies the bounded drift condition:
(1 – ρ)(t – s) ≤ Hp(t) – Hp(s) ≤ (1 + ρ)(t –
s)
Hp(t) – Hp(s) > (1+ ρ)(t – s) Perfect hardware clock
Hp(t) – Hp(s) = (t – s)
Clock
values

Hp(t) – Hp(s) < (1- ρ)(t – s)

Real time
Failure modes

Crash Failure:
   processor behaves correctly and then stops
executing forever
Performance Failure:
   processor reacts too slowly to a trigger event
Arbitrary Failure (a.k.a Byzantine):
   processor executes uncontrolled computation
The clock synchronization problem

Property 1 (Agreement):
| Lpi(t) – Lpj(t) |  δ,
(δ is the precision of the clock synchronization algorithm)

Property 2 (Accuracy):
(1 – ρv)(t – s) + a ≤ Lp(t) – Lp(s) ≤ (1 + ρv)(t – s) + b

ρv ≠ ρ
What is optimal accuracy?
Optimal accuracy
Drift rate of the synchronized clocks is
bounded by the maximum drift rate of
correct harware clocks
ρv = ρ

(1 – ρ)(t – s) + a ≤ Lp(t) – Lp(s) ≤ (1 + ρ)(t – s) + b
Paper 1: Optimal Clock Synchronization
Claims:

• Accuracy need not be sacrificed in order to
achieve synchronization

• It’s the first synchronization algorithm where
logical clocks have the same accuracy as the
underlying physical clocks

•Unified solution to all models of failure
Authenticated Algorithm
kth resynchronization - Waiting for time kP

synchronize

real time t                 logical time kP
P – logical time between resynchronizations
Authenticated Algorithm

synchronize

logical time kP
P – logical time between resynchronizations
Authenticated Algorithm

synchronize
logical time kP
P – logical time between resynchronizations
Authenticated Algorithm
Kp + 

Synchronize!

logical time kP
P – logical time between resynchronizations
Achieving Optimal Accuracy
Uncertainty of tdelay introduces a difference in the logical
time between resynchronizations
 Reason for non-optimal accuracy

Solution:
   Slow down the logical clocks by a factor of

P
(P -  - )

where  = tdel / 2(1 + )
Authenticated Messages
Correctness:
If at least f + 1 correct processes broadcast messages by
time t, then every correct process accepts the message by
time t + tdel
Unforgeability:
If no correct process broadcasts a message by time t, then
no correct process accepts the message by t or earlier
Relay:
If a correct process accepts the message at time t, then
every correct process does so by time t + tdel
Nonauthenticated Algorithm
Replace signed communication with a
 Primitive relays messages automatically
 Cost of O(n2) messages per resynchronization

New limit on number of faulty processes
allowed:
   n > 3f
distinct
(echo, round k)!

distinct
2
(init, round k)!

distinct
(echo, round k)!
Accept (round k)

(echo, round k)                      3
Initialization and Integration
Same algorithms can be used to achieve
initial synchronization and integrate new
processes into the network
 A process independently starts clock Co
 On accepting a message at real time t, it sets

C0 = α
“Passive” scheme for integration of new
processes
Paper 2: Why try another approach?

synchronization algorithms:
 Assume bounded communication delays
 Require the transmission of at least N2
messages each time N clocks are synchronized
 Bursty exchange of messages within a narrow
re-synchronization real-time interval
Probabilistic ICS
Claims:
Proposes family of fault-tolerant internal clock
synchronization (ICS) protocols
Doesn’t assume unbounded communication
delays
Use of convergence function optimal
accuracy
Their approach
Only requires to send a number of
Staggers the message traffic in time
Uses a new transitive remote clock reading
method
Number of messages in the best case: N + 1
(N time server processes)
q
Basic Idea:

T1

m1                   m2

T0                           T2

p
(T2 – T0)(1 + ) = maximum bound (real time)
min ≤ t(m2) ≤ (T2 – T0)(1 + ) - min
max(m2)(1 + ) + min(m2)(1 - )
Cq = T1 +                     2
q
Basic Idea:

T1

m1                m2

T0                      T2
Maximum
p                  Is error ≤  ?          acceptable clock
(Limit: D)
Staggering Messages
slot

p

q

r

cycle
p slots per cycle
k cycles per round
Can reduce the number of messages per round to N + 1

tp         tq
real time
T
p

T
q
Cq (T,p)

r
Cr (T,p)               Cr (T,q)

Cr (T,q) = Cr arbitrary failures
Cannot be used when(T,p) + T - Cq (T,p) can occur!
Round Message Exchange Protocol
Request Mode
finish messages
Finish Mode
Clock times:
p   q   r        Clock times:
t    ?   ?   ?          p   q   r        Clock times:
err    ?   ?   ?       t 10 11 10           p   q   r
request messages     err ? ? ?           t 10 11 10
reply messages   err 1 1 2
Outline of Algorithms
Round clock Cpk of process p for round k:
Cpk(t) = Hp(t) + Apk

Void synchronizer() {
A = A + cfn(rank(), Clocks, Errors)
T=T+P
}
Convergence Functions
Let I(t) = [L, R] be the interval spanned by
at t by correct clocks. If all processes would
set their virtual clocks at the same time t to
the midpoint of I(t), then all correct clocks
would be exactly synchronized at that point
in time.

Unfortunately, this is not a perfect world!
Convergence Functions
Each correct process makes an approximation Ip
which is guaranteed to be included in a bounded
extension of the interval of correct clocks I:

Ik(t) = [min{Csk (t) - }, max{Csk (t) + }]

Deviation of clocks is bounded by , so length of Ik(t) is
bounded by  + 2
Failure classes

Tolerated        Required          Tolerated types
Algorithm
Failures        Processes           of failures

CSA Crash           F              F+1                  Crash

CSA Arbitrary        F             3F + 1          Arbitrary, Reading

CSA Hybrid      Fc, Fr, Fa   3Fa + 2Fr + Fc + 1   Crash, Read., Arb.
Conclusions – Which one is better?

First Paper (deterministic algorithm)
 Simple algorithm
 Unified solution for different types of failures

 Achieves optimal accuracy

 Assumes bounded comunication

 O(n2) messages

 Bursty communication
Conclusions – Which one is better?
Second Paper (probabilistic algorithm)
 Takes advantage of the current working
conditions, by invoking successive round-trip
exchanges, to reach a tight precision)
 Precision is not guaranteed

 Achieves optimal accuracy

 O(n) messages

If both algorithms achieve optimal accuracy,
Then why is there still work being done?

```
DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
 views: 6 posted: 8/31/2012 language: English pages: 34