Chapter 3: Logical Time
Ajay Kshemkalyani and Mukesh Singhal
Distributed Computing: Principles, Algorithms, and Systems
Cambridge University Press
- A. Kshemkalyani and M. Singhal (Distributed Computing)
Logical Time CUP 2008 1 / 67
Chapter 3: Logical Time Ajay Kshemkalyani and Mukesh Singhal - - PowerPoint PPT Presentation
Chapter 3: Logical Time Ajay Kshemkalyani and Mukesh Singhal Distributed Computing: Principles, Algorithms, and Systems Cambridge University Press A. Kshemkalyani and M. Singhal (Distributed Computing) Logical Time CUP 2008 1 / 67
Distributed Computing: Principles, Algorithms, and Systems
Logical Time CUP 2008 1 / 67
Distributed Computing: Principles, Algorithms, and Systems
Logical Time CUP 2008 2 / 67
Distributed Computing: Principles, Algorithms, and Systems
Logical Time CUP 2008 3 / 67
Distributed Computing: Principles, Algorithms, and Systems
Logical Time CUP 2008 4 / 67
Distributed Computing: Principles, Algorithms, and Systems
◮ A local logical clock, denoted by lci, that helps process pi measure its own
Logical Time CUP 2008 5 / 67
Distributed Computing: Principles, Algorithms, and Systems
◮ A logical global clock, denoted by gci, that is a representation of process pi’s
Logical Time CUP 2008 6 / 67
Distributed Computing: Principles, Algorithms, and Systems
Logical Time CUP 2008 7 / 67
Distributed Computing: Principles, Algorithms, and Systems
◮ Ci := max(Ci, Cmsg) ◮ Execute R1. ◮ Deliver the message.
Logical Time CUP 2008 8 / 67
Distributed Computing: Principles, Algorithms, and Systems
p 1 p 2 p 3 1 2 3 3 10 11 5 6 7 2 7 9 4 b 1 8 9 4 5 1
Logical Time CUP 2008 9 / 67
Distributed Computing: Principles, Algorithms, and Systems
Logical Time CUP 2008 10 / 67
Distributed Computing: Principles, Algorithms, and Systems
Logical Time CUP 2008 11 / 67
Distributed Computing: Principles, Algorithms, and Systems
Logical Time CUP 2008 12 / 67
Distributed Computing: Principles, Algorithms, and Systems
Logical Time CUP 2008 13 / 67
Distributed Computing: Principles, Algorithms, and Systems
Logical Time CUP 2008 14 / 67
Distributed Computing: Principles, Algorithms, and Systems
◮ Update its global logical time as follows:
◮ Execute R1. ◮ Deliver the message m.
Logical Time CUP 2008 15 / 67
Distributed Computing: Principles, Algorithms, and Systems
Logical Time CUP 2008 16 / 67
Distributed Computing: Principles, Algorithms, and Systems
3 p p 1 2 3 4 3 4 1 2 2 3 2 4 2 3 4 5 3 4 5 6 4 1 2 3 3 2 3 4 2 p 2 3 2 2 2 3 2 1 5 3 4 5 5 4
Logical Time CUP 2008 17 / 67
Distributed Computing: Principles, Algorithms, and Systems
Logical Time CUP 2008 18 / 67
Distributed Computing: Principles, Algorithms, and Systems
Logical Time CUP 2008 19 / 67
Distributed Computing: Principles, Algorithms, and Systems
Logical Time CUP 2008 20 / 67
Distributed Computing: Principles, Algorithms, and Systems
Logical Time CUP 2008 21 / 67
Distributed Computing: Principles, Algorithms, and Systems
Logical Time CUP 2008 22 / 67
Distributed Computing: Principles, Algorithms, and Systems
Logical Time CUP 2008 23 / 67
Distributed Computing: Principles, Algorithms, and Systems
◮ LSi[1..n] (‘Last Sent’):
◮ LUi[1..n] (‘Last Update’):
Logical Time CUP 2008 24 / 67
Distributed Computing: Principles, Algorithms, and Systems
Logical Time CUP 2008 25 / 67
Distributed Computing: Principles, Algorithms, and Systems
Logical Time CUP 2008 26 / 67
Distributed Computing: Principles, Algorithms, and Systems
p 1 p 2 p 3 p 4
1 1 1 1 3 2 1 2 1 2 3 1 4 1 1 1 4 4 1 1 {(1,1)} {(3,1)} {(3,2)} {(3,4),(4,1)} {(4,1)}
Logical Time CUP 2008 27 / 67
Distributed Computing: Principles, Algorithms, and Systems
Logical Time CUP 2008 28 / 67
Distributed Computing: Principles, Algorithms, and Systems
◮ Update its global logical time as follows:
◮ Execute R1. ◮ Deliver message m.
Logical Time CUP 2008 29 / 67
Distributed Computing: Principles, Algorithms, and Systems
k and e2 k which are the x1 k -th and x2 k -th event at process pk, and e1 j and e2 j
j -th and x2 j -th events at pj.
k is the last event of pk that causally precedes e, therefore, we
k.
j . The last event of pk known by pj, to the
k; therefore, mte[j, k]=x1 k.
j .
Logical Time CUP 2008 30 / 67
Distributed Computing: Principles, Algorithms, and Systems
j
2 k
k
p p p k j i
2 3 4 e e e e 1
Logical Time CUP 2008 31 / 67
Distributed Computing: Principles, Algorithms, and Systems
◮ If this is true, it is clear that process pi knows that all other processes know
◮ In many applications, this implies that processes will no longer require from pl
Logical Time CUP 2008 32 / 67
Distributed Computing: Principles, Algorithms, and Systems
Logical Time CUP 2008 33 / 67
Distributed Computing: Principles, Algorithms, and Systems
Logical Time CUP 2008 34 / 67
Distributed Computing: Principles, Algorithms, and Systems
Logical Time CUP 2008 35 / 67
Distributed Computing: Principles, Algorithms, and Systems
Logical Time CUP 2008 36 / 67
Distributed Computing: Principles, Algorithms, and Systems
◮ Rule 1: Virtual send time of each message < virtual receive time of that
◮ Rule 2: Virtual time of each event in a process < Virtual time of next event in
Logical Time CUP 2008 37 / 67
Distributed Computing: Principles, Algorithms, and Systems
Logical Time CUP 2008 38 / 67
Distributed Computing: Principles, Algorithms, and Systems
Logical Time CUP 2008 39 / 67
Distributed Computing: Principles, Algorithms, and Systems
1
2
3
4
5
Logical Time CUP 2008 40 / 67
Distributed Computing: Principles, Algorithms, and Systems
Logical Time CUP 2008 41 / 67
Distributed Computing: Principles, Algorithms, and Systems
Logical Time CUP 2008 42 / 67
Distributed Computing: Principles, Algorithms, and Systems
Logical Time CUP 2008 43 / 67
Distributed Computing: Principles, Algorithms, and Systems
Logical Time CUP 2008 44 / 67
Distributed Computing: Principles, Algorithms, and Systems
Logical Time CUP 2008 45 / 67
Distributed Computing: Principles, Algorithms, and Systems
Logical Time CUP 2008 46 / 67
Distributed Computing: Principles, Algorithms, and Systems
Logical Time CUP 2008 47 / 67
Distributed Computing: Principles, Algorithms, and Systems
Logical Time CUP 2008 48 / 67
Distributed Computing: Principles, Algorithms, and Systems
Logical Time CUP 2008 49 / 67
Distributed Computing: Principles, Algorithms, and Systems
Logical Time CUP 2008 50 / 67
Distributed Computing: Principles, Algorithms, and Systems
Logical Time CUP 2008 51 / 67
Distributed Computing: Principles, Algorithms, and Systems
Logical Time CUP 2008 52 / 67
Distributed Computing: Principles, Algorithms, and Systems
Logical Time CUP 2008 53 / 67
Distributed Computing: Principles, Algorithms, and Systems
Logical Time CUP 2008 54 / 67
Distributed Computing: Principles, Algorithms, and Systems
Logical Time CUP 2008 55 / 67
Distributed Computing: Principles, Algorithms, and Systems
◮ The time of the day at which an event happened on a specific machine in the
◮ The time interval between two events that happened on different machines in
◮ The relative ordering of events that happened on different machines in the
Logical Time CUP 2008 56 / 67
Distributed Computing: Principles, Algorithms, and Systems
Logical Time CUP 2008 57 / 67
Distributed Computing: Principles, Algorithms, and Systems
′
a(t).
a(t) − C ′ b(t)). If the skew is bounded by ρ, then as per Equation (1),
a (t). The drift of clock Ca relative to clock
a (t) − C ′′ b (t).
Logical Time CUP 2008 58 / 67
Distributed Computing: Principles, Algorithms, and Systems
Logical Time CUP 2008 59 / 67
Distributed Computing: Principles, Algorithms, and Systems
Clock time, C UTC, t Fast Clock dC/dt > 1 Perfect Clock dC/dt = 1 Slow Clock dC/dt < 1
Logical Time CUP 2008 60 / 67
Distributed Computing: Principles, Algorithms, and Systems
◮ The primary server at the root synchronizes with the UTC. ◮ The next level contains secondary servers, which act as a backup to the
◮ At the lowest level is the synchronization subnet which has the clients.
Logical Time CUP 2008 61 / 67
Distributed Computing: Principles, Algorithms, and Systems
Logical Time CUP 2008 62 / 67
Distributed Computing: Principles, Algorithms, and Systems
Logical Time CUP 2008 63 / 67
Distributed Computing: Principles, Algorithms, and Systems
Logical Time CUP 2008 64 / 67
Distributed Computing: Principles, Algorithms, and Systems
Logical Time CUP 2008 65 / 67
Distributed Computing: Principles, Algorithms, and Systems
Logical Time CUP 2008 66 / 67
Distributed Computing: Principles, Algorithms, and Systems
Logical Time CUP 2008 67 / 67