time, clocks and the ordering of events

131
Time, clocks and the ordering of events Amir H. Payberah [email protected] Amirkabir University of Technology (Tehran Polytechnic) Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 1 / 67

Upload: amir-payberah

Post on 16-Jul-2015

83 views

Category:

Science


2 download

TRANSCRIPT

Page 1: Time, clocks and the ordering of events

Time, clocks and the ordering of events

Amir H. [email protected]

Amirkabir University of Technology(Tehran Polytechnic)

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 1 / 67

Page 2: Time, clocks and the ordering of events

What is a Distributed System?

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 2 / 67

Page 3: Time, clocks and the ordering of events

Distributed System

A distributed system is one in which the failure of a computer youdidn’t even know existed can render your own computer unusable.

- Leslie Lamport

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 3 / 67

Page 4: Time, clocks and the ordering of events

What is a Distributed System?

I A set of nodes, connected by a network, which appear to its usersas a single coherent system.

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 4 / 67

Page 5: Time, clocks and the ordering of events

Distributed Algorithms

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 5 / 67

Page 6: Time, clocks and the ordering of events

Two Generals’ Problem (1/3)

I Two generals need to coordinate an attack.

• Must agree on time to attack.• They will win only if they attack simultaneously.• Communicate through messengers.• Messengers may be killed on their way.

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 6 / 67

Page 7: Time, clocks and the ordering of events

Two Generals’ Problem (1/3)

I Two generals need to coordinate an attack.• Must agree on time to attack.

• They will win only if they attack simultaneously.• Communicate through messengers.• Messengers may be killed on their way.

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 6 / 67

Page 8: Time, clocks and the ordering of events

Two Generals’ Problem (1/3)

I Two generals need to coordinate an attack.• Must agree on time to attack.• They will win only if they attack simultaneously.

• Communicate through messengers.• Messengers may be killed on their way.

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 6 / 67

Page 9: Time, clocks and the ordering of events

Two Generals’ Problem (1/3)

I Two generals need to coordinate an attack.• Must agree on time to attack.• They will win only if they attack simultaneously.• Communicate through messengers.

• Messengers may be killed on their way.

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 6 / 67

Page 10: Time, clocks and the ordering of events

Two Generals’ Problem (1/3)

I Two generals need to coordinate an attack.• Must agree on time to attack.• They will win only if they attack simultaneously.• Communicate through messengers.• Messengers may be killed on their way.

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 6 / 67

Page 11: Time, clocks and the ordering of events

Two Generals’ Problem (2/3)

I Lets try to solve it for general g1 and g2.

I g1 sends time of attack to g2.

• Problem: how to ensure g2 received message?• Solution: let g2 ack receipt of message.• Problem: how to ensure g1 received ack?• Solution: let g1 ack the receipt of the ack.• ...

I This problem is impossible to solve!

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 7 / 67

Page 12: Time, clocks and the ordering of events

Two Generals’ Problem (2/3)

I Lets try to solve it for general g1 and g2.

I g1 sends time of attack to g2.• Problem: how to ensure g2 received message?

• Solution: let g2 ack receipt of message.• Problem: how to ensure g1 received ack?• Solution: let g1 ack the receipt of the ack.• ...

I This problem is impossible to solve!

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 7 / 67

Page 13: Time, clocks and the ordering of events

Two Generals’ Problem (2/3)

I Lets try to solve it for general g1 and g2.

I g1 sends time of attack to g2.• Problem: how to ensure g2 received message?• Solution: let g2 ack receipt of message.

• Problem: how to ensure g1 received ack?• Solution: let g1 ack the receipt of the ack.• ...

I This problem is impossible to solve!

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 7 / 67

Page 14: Time, clocks and the ordering of events

Two Generals’ Problem (2/3)

I Lets try to solve it for general g1 and g2.

I g1 sends time of attack to g2.• Problem: how to ensure g2 received message?• Solution: let g2 ack receipt of message.• Problem: how to ensure g1 received ack?

• Solution: let g1 ack the receipt of the ack.• ...

I This problem is impossible to solve!

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 7 / 67

Page 15: Time, clocks and the ordering of events

Two Generals’ Problem (2/3)

I Lets try to solve it for general g1 and g2.

I g1 sends time of attack to g2.• Problem: how to ensure g2 received message?• Solution: let g2 ack receipt of message.• Problem: how to ensure g1 received ack?• Solution: let g1 ack the receipt of the ack.

• ...

I This problem is impossible to solve!

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 7 / 67

Page 16: Time, clocks and the ordering of events

Two Generals’ Problem (2/3)

I Lets try to solve it for general g1 and g2.

I g1 sends time of attack to g2.• Problem: how to ensure g2 received message?• Solution: let g2 ack receipt of message.• Problem: how to ensure g1 received ack?• Solution: let g1 ack the receipt of the ack.• ...

I This problem is impossible to solve!

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 7 / 67

Page 17: Time, clocks and the ordering of events

Two Generals’ Problem (2/3)

I Lets try to solve it for general g1 and g2.

I g1 sends time of attack to g2.• Problem: how to ensure g2 received message?• Solution: let g2 ack receipt of message.• Problem: how to ensure g1 received ack?• Solution: let g1 ack the receipt of the ack.• ...

I This problem is impossible to solve!

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 7 / 67

Page 18: Time, clocks and the ordering of events

Two Generals’ Problem (3/3)

I Applicability to distributed systems:

• Two nodes need to agree on a value.• Communicate by messages using an unreliable channel.

I Agreement is a core problem.

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 8 / 67

Page 19: Time, clocks and the ordering of events

Two Generals’ Problem (3/3)

I Applicability to distributed systems:• Two nodes need to agree on a value.

• Communicate by messages using an unreliable channel.

I Agreement is a core problem.

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 8 / 67

Page 20: Time, clocks and the ordering of events

Two Generals’ Problem (3/3)

I Applicability to distributed systems:• Two nodes need to agree on a value.• Communicate by messages using an unreliable channel.

I Agreement is a core problem.

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 8 / 67

Page 21: Time, clocks and the ordering of events

Two Generals’ Problem (3/3)

I Applicability to distributed systems:• Two nodes need to agree on a value.• Communicate by messages using an unreliable channel.

I Agreement is a core problem.

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 8 / 67

Page 22: Time, clocks and the ordering of events

Distributed Algorithms

I Algorithms that are supposed to work in distributed networks or onmultiprocessors.

I Accomplish tasks like:• Data management• Resource management• Consensus• ...

I Must work in difficult settings:• Concurrency: uncertainty of timing, order of events and inputs.• Fault-tolerance: failure and recovery of machines/processors, of

communication channels.

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 9 / 67

Page 23: Time, clocks and the ordering of events

Distributed Algorithms

I Algorithms that are supposed to work in distributed networks or onmultiprocessors.

I Accomplish tasks like:• Data management• Resource management• Consensus• ...

I Must work in difficult settings:• Concurrency: uncertainty of timing, order of events and inputs.• Fault-tolerance: failure and recovery of machines/processors, of

communication channels.

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 9 / 67

Page 24: Time, clocks and the ordering of events

Distributed Algorithms

I Algorithms that are supposed to work in distributed networks or onmultiprocessors.

I Accomplish tasks like:• Data management• Resource management• Consensus• ...

I Must work in difficult settings:• Concurrency: uncertainty of timing, order of events and inputs.• Fault-tolerance: failure and recovery of machines/processors, of

communication channels.

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 9 / 67

Page 25: Time, clocks and the ordering of events

Correctness ofDistributed Algorithms

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 10 / 67

Page 26: Time, clocks and the ordering of events

Correctness

I Always expressed in terms of• Safety and Liveness• B. Alpern and F.B. Schneider, Defining Liveness, Technical Report, 1985

I Safety• Properties that state that nothing bad ever happens.

I Liveness• Properties that state that something good eventually happens.

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 11 / 67

Page 27: Time, clocks and the ordering of events

Correctness

I Always expressed in terms of• Safety and Liveness• B. Alpern and F.B. Schneider, Defining Liveness, Technical Report, 1985

I Safety• Properties that state that nothing bad ever happens.

I Liveness• Properties that state that something good eventually happens.

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 11 / 67

Page 28: Time, clocks and the ordering of events

Correctness

I Always expressed in terms of• Safety and Liveness• B. Alpern and F.B. Schneider, Defining Liveness, Technical Report, 1985

I Safety• Properties that state that nothing bad ever happens.

I Liveness• Properties that state that something good eventually happens.

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 11 / 67

Page 29: Time, clocks and the ordering of events

Correctness Example (1/3)

I Correctness of you in this course :)

I You should never fail the exam: Safety

I You should eventually take the exam: Liveness

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 12 / 67

Page 30: Time, clocks and the ordering of events

Correctness Example (1/3)

I Correctness of you in this course :)

I You should never fail the exam:

Safety

I You should eventually take the exam: Liveness

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 12 / 67

Page 31: Time, clocks and the ordering of events

Correctness Example (1/3)

I Correctness of you in this course :)

I You should never fail the exam: Safety

I You should eventually take the exam: Liveness

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 12 / 67

Page 32: Time, clocks and the ordering of events

Correctness Example (1/3)

I Correctness of you in this course :)

I You should never fail the exam: Safety

I You should eventually take the exam:

Liveness

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 12 / 67

Page 33: Time, clocks and the ordering of events

Correctness Example (1/3)

I Correctness of you in this course :)

I You should never fail the exam: Safety

I You should eventually take the exam: Liveness

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 12 / 67

Page 34: Time, clocks and the ordering of events

Correctness Example (2/3)

I Correctness of traffic lights at intersection.

I Only one direction should have a greenlight: Safety

I Every direction should eventually get agreen light: Liveness

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 13 / 67

Page 35: Time, clocks and the ordering of events

Correctness Example (2/3)

I Correctness of traffic lights at intersection.

I Only one direction should have a greenlight:

Safety

I Every direction should eventually get agreen light: Liveness

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 13 / 67

Page 36: Time, clocks and the ordering of events

Correctness Example (2/3)

I Correctness of traffic lights at intersection.

I Only one direction should have a greenlight: Safety

I Every direction should eventually get agreen light: Liveness

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 13 / 67

Page 37: Time, clocks and the ordering of events

Correctness Example (2/3)

I Correctness of traffic lights at intersection.

I Only one direction should have a greenlight: Safety

I Every direction should eventually get agreen light:

Liveness

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 13 / 67

Page 38: Time, clocks and the ordering of events

Correctness Example (2/3)

I Correctness of traffic lights at intersection.

I Only one direction should have a greenlight: Safety

I Every direction should eventually get agreen light: Liveness

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 13 / 67

Page 39: Time, clocks and the ordering of events

Correctness Example (3/3)

I Correctness of point-to-point message communication.

I A message sent is delivered at most once: Safety

I A message sent is delivered at least once: Liveness

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 14 / 67

Page 40: Time, clocks and the ordering of events

Correctness Example (3/3)

I Correctness of point-to-point message communication.

I A message sent is delivered at most once:

Safety

I A message sent is delivered at least once: Liveness

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 14 / 67

Page 41: Time, clocks and the ordering of events

Correctness Example (3/3)

I Correctness of point-to-point message communication.

I A message sent is delivered at most once: Safety

I A message sent is delivered at least once: Liveness

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 14 / 67

Page 42: Time, clocks and the ordering of events

Correctness Example (3/3)

I Correctness of point-to-point message communication.

I A message sent is delivered at most once: Safety

I A message sent is delivered at least once:

Liveness

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 14 / 67

Page 43: Time, clocks and the ordering of events

Correctness Example (3/3)

I Correctness of point-to-point message communication.

I A message sent is delivered at most once: Safety

I A message sent is delivered at least once: Liveness

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 14 / 67

Page 44: Time, clocks and the ordering of events

More on Safety and Liveness

I Safety• Often involves the word never, at most, cannot, ...

I Liveness• Often involves the word eventually: some point in future• Liveness is often just termination

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 15 / 67

Page 45: Time, clocks and the ordering of events

More on Safety and Liveness

I Safety• Often involves the word never, at most, cannot, ...

I Liveness• Often involves the word eventually: some point in future• Liveness is often just termination

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 15 / 67

Page 46: Time, clocks and the ordering of events

ModelingDistributed Systems

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 16 / 67

Page 47: Time, clocks and the ordering of events

What is a Model?

I Abstraction of relevant system properties.

I Real world is complex, model simplifies it.

I Help solving problems.

I Help analyze problems/solutions.

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 17 / 67

Page 48: Time, clocks and the ordering of events

Modeling Distributed Systems

I What is a distributed system?• Bunch of nodes/processes• Sending messages over a network• To solve a common goal (algorithm)

I How do we model this?

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 18 / 67

Page 49: Time, clocks and the ordering of events

Modeling Distributed Systems

I What is a distributed system?• Bunch of nodes/processes• Sending messages over a network• To solve a common goal (algorithm)

I How do we model this?

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 18 / 67

Page 50: Time, clocks and the ordering of events

Modeling a Node

I A single node has a bunch of neighbors.

I Can send and receive messages.

I Can do local computations.

I Like a state machine: a node is in only one state at a time.

I The state of a node: input buffer, output buffer, and other datarelevant to algorithm

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 19 / 67

Page 51: Time, clocks and the ordering of events

Modeling a Node

I A single node has a bunch of neighbors.

I Can send and receive messages.

I Can do local computations.

I Like a state machine: a node is in only one state at a time.

I The state of a node: input buffer, output buffer, and other datarelevant to algorithm

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 19 / 67

Page 52: Time, clocks and the ordering of events

Modeling a Node

I A single node has a bunch of neighbors.

I Can send and receive messages.

I Can do local computations.

I Like a state machine: a node is in only one state at a time.

I The state of a node: input buffer, output buffer, and other datarelevant to algorithm

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 19 / 67

Page 53: Time, clocks and the ordering of events

Modeling a Node

I A single node has a bunch of neighbors.

I Can send and receive messages.

I Can do local computations.

I Like a state machine: a node is in only one state at a time.

I The state of a node: input buffer, output buffer, and other datarelevant to algorithm

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 19 / 67

Page 54: Time, clocks and the ordering of events

Modeling a Node

I A single node has a bunch of neighbors.

I Can send and receive messages.

I Can do local computations.

I Like a state machine: a node is in only one state at a time.

I The state of a node: input buffer, output buffer, and other datarelevant to algorithm

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 19 / 67

Page 55: Time, clocks and the ordering of events

Single Node Perspective

I This is how computers in a distributed system work:

1 Wait for message.

2 When received message, do some local computation, send somemessages.

3 Goto 1

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 20 / 67

Page 56: Time, clocks and the ordering of events

Single Node to a Distributed System (1/3)

I A configuration is a snapshot of state of all nodes.• C = (s0, s1, · · · , sn−1) where si is state of process pi.

I An initial configuration is a configuration where each si is an initialstate.

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 21 / 67

Page 57: Time, clocks and the ordering of events

Single Node to a Distributed System (2/3)

I The system evolves through events:• Computation event at node i: comp(i)• Delivery event of msg m from i to j: del(i, j,m)

I An execution is an infinite sequence of• config0, event1, config1, event2, config2, ...• config0 is an initial configuration.• event could be comp or del.

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 22 / 67

Page 58: Time, clocks and the ordering of events

Single Node to a Distributed System (2/3)

I The system evolves through events:• Computation event at node i: comp(i)• Delivery event of msg m from i to j: del(i, j,m)

I An execution is an infinite sequence of• config0, event1, config1, event2, config2, ...• config0 is an initial configuration.• event could be comp or del.

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 22 / 67

Page 59: Time, clocks and the ordering of events

Single Node to a Distributed System (3/3)

I Example execution

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 23 / 67

Page 60: Time, clocks and the ordering of events

Synchronous Systems (1/2)

I An execution partitioned into non-overlapping rounds.

I Informally, in each round:• Every process can send a message to each neighbor.• All messages are delivered.• Every process computes based on message received.

I Formally, rounds consist of:• Deliver event for every message in all outbufs.• One computation event on every process.

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 24 / 67

Page 61: Time, clocks and the ordering of events

Synchronous Systems (1/2)

I An execution partitioned into non-overlapping rounds.

I Informally, in each round:• Every process can send a message to each neighbor.• All messages are delivered.• Every process computes based on message received.

I Formally, rounds consist of:• Deliver event for every message in all outbufs.• One computation event on every process.

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 24 / 67

Page 62: Time, clocks and the ordering of events

Synchronous Systems (1/2)

I An execution partitioned into non-overlapping rounds.

I Informally, in each round:• Every process can send a message to each neighbor.• All messages are delivered.• Every process computes based on message received.

I Formally, rounds consist of:• Deliver event for every message in all outbufs.• One computation event on every process.

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 24 / 67

Page 63: Time, clocks and the ordering of events

Synchronous Systems (2/2)

I Time variance is bounded.

I Execution: bounded execution speed and time.

I Communication: bounded transmission delay.

I Clocks: bounded clock drift (and differences in clocks).

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 25 / 67

Page 64: Time, clocks and the ordering of events

Asynchronous Systems

I Time variance is not bounded.

I Execution: different steps can have varying duration.

I Communication: transmission delays vary widely.

I Clocks: arbitrary clock drift.

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 26 / 67

Page 65: Time, clocks and the ordering of events

Time, Clock, andOrder of Events

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 27 / 67

Page 66: Time, clocks and the ordering of events

Time

I Global time• Astronomical time (based on earth’s rotation)• International Atomic Time (IAT)• Coordinated Universal Time (UTC)

I Local time• Not synchronized to a global source

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 28 / 67

Page 67: Time, clocks and the ordering of events

Computer Clocks

I Computer clocks• Crystal oscillates at known frequency• Oscillations cause timer interrupts• Timer interrupts update clock

I Clock skew• Crystals in different computers run at slightly different rates• Clocks get out of sync• Skew: instantaneous difference• Drift: rate of change of skew

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 29 / 67

Page 68: Time, clocks and the ordering of events

Synchronizing Computer Clocks

I Internal synchronization• Clocks synchronize locally• Only synchronized with each other• Berkeley algorithm

I Time server• Server that has the correct time• Server that calculates the correct time• Network Time Protocol (NTP)

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 30 / 67

Page 69: Time, clocks and the ordering of events

Logical Clock

I Event ordering is more important than physical time.

I Events (e.g., state changes) in a single process are ordered.

I Processes need to agree on ordering of causally related events (e.g.,message send and receive).

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 31 / 67

Page 70: Time, clocks and the ordering of events

Logical Clock

I Event ordering is more important than physical time.

I Events (e.g., state changes) in a single process are ordered.

I Processes need to agree on ordering of causally related events (e.g.,message send and receive).

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 31 / 67

Page 71: Time, clocks and the ordering of events

Logical Clock

I Event ordering is more important than physical time.

I Events (e.g., state changes) in a single process are ordered.

I Processes need to agree on ordering of causally related events (e.g.,message send and receive).

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 31 / 67

Page 72: Time, clocks and the ordering of events

Causal Order

I →: causal order relation.• Also called Leslie Lamport’s happened before relation.

I The relation→ on the events of an execution is defined as follows:• If a occurs before b on the same process, then a→ b.• If a produces (comp) m and b delivers m, then a→ b.• If a delivers m and b consumes (comp) m, then a→ b.

I Transitivity: if a→ b and b→ c, then a→ c.

I concurrent events (a||b): if a 6→ b and b 6→ a.

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 32 / 67

Page 73: Time, clocks and the ordering of events

Causal Order

I →: causal order relation.• Also called Leslie Lamport’s happened before relation.

I The relation→ on the events of an execution is defined as follows:• If a occurs before b on the same process, then a→ b.• If a produces (comp) m and b delivers m, then a→ b.• If a delivers m and b consumes (comp) m, then a→ b.

I Transitivity: if a→ b and b→ c, then a→ c.

I concurrent events (a||b): if a 6→ b and b 6→ a.

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 32 / 67

Page 74: Time, clocks and the ordering of events

Causal Order

I →: causal order relation.• Also called Leslie Lamport’s happened before relation.

I The relation→ on the events of an execution is defined as follows:• If a occurs before b on the same process, then a→ b.• If a produces (comp) m and b delivers m, then a→ b.• If a delivers m and b consumes (comp) m, then a→ b.

I Transitivity: if a→ b and b→ c, then a→ c.

I concurrent events (a||b): if a 6→ b and b 6→ a.

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 32 / 67

Page 75: Time, clocks and the ordering of events

Causal Order

I →: causal order relation.• Also called Leslie Lamport’s happened before relation.

I The relation→ on the events of an execution is defined as follows:• If a occurs before b on the same process, then a→ b.• If a produces (comp) m and b delivers m, then a→ b.• If a delivers m and b consumes (comp) m, then a→ b.

I Transitivity: if a→ b and b→ c, then a→ c.

I concurrent events (a||b): if a 6→ b and b 6→ a.

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 32 / 67

Page 76: Time, clocks and the ordering of events

Causal Order Example

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 33 / 67

Page 77: Time, clocks and the ordering of events

Causal Order Example

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 34 / 67

Page 78: Time, clocks and the ordering of events

Equivalence of Executions

I If two executions F and E have the same collection of events, andtheir causal order is preserved, F and E are said to be similar exe-cutions.

I F and E could have different permutation of events as long ascausality is preserved.

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 35 / 67

Page 79: Time, clocks and the ordering of events

Equivalence of Executions

I If two executions F and E have the same collection of events, andtheir causal order is preserved, F and E are said to be similar exe-cutions.

I F and E could have different permutation of events as long ascausality is preserved.

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 35 / 67

Page 80: Time, clocks and the ordering of events

Example of Similar Executions

I Same color ∼ Causally related

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 36 / 67

Page 81: Time, clocks and the ordering of events

I So causality is all that matters ...

I ... how to locally tell if two events are causally related?

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 37 / 67

Page 82: Time, clocks and the ordering of events

I So causality is all that matters ...

I ... how to locally tell if two events are causally related?

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 37 / 67

Page 83: Time, clocks and the ordering of events

Lamport Clocks

I Each process pi has a local logical clock ti.• Initially ti = 0

I Before timestamping a local event pi executes ti := ti + 1.

I Whenever a message m is sent from pi to pj :• pi executes ti := ti + 1 and sends ti with m.• pj receives ti with m and executes tj := max(tj , ti) + 1.

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 38 / 67

Page 84: Time, clocks and the ordering of events

Lamport Clocks

I Each process pi has a local logical clock ti.• Initially ti = 0

I Before timestamping a local event pi executes ti := ti + 1.

I Whenever a message m is sent from pi to pj :• pi executes ti := ti + 1 and sends ti with m.• pj receives ti with m and executes tj := max(tj , ti) + 1.

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 38 / 67

Page 85: Time, clocks and the ordering of events

Lamport Clocks

I Each process pi has a local logical clock ti.• Initially ti = 0

I Before timestamping a local event pi executes ti := ti + 1.

I Whenever a message m is sent from pi to pj :• pi executes ti := ti + 1 and sends ti with m.• pj receives ti with m and executes tj := max(tj , ti) + 1.

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 38 / 67

Page 86: Time, clocks and the ordering of events

Example of Lamport Logical Clock

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 39 / 67

Page 87: Time, clocks and the ordering of events

Lamport Clocks Properties

I a→ b implies t(a) < t(b), where t(a) is Lamport clock of event a.

I t(a) < t(b) does not necessarily imply a→ b

I t(E31) < t(E13), but E31 6→ E13

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 40 / 67

Page 88: Time, clocks and the ordering of events

Shortcoming of Lamport Clocks

I Main shortcoming of Lamport’s clocks:• t(a) < t(b) does not necessarily imply a→ b• We cannot deduce causal dependencies from time stamps.

I Why?• Clocks advance independently or via messages.• There is no history as to where advances come from.

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 41 / 67

Page 89: Time, clocks and the ordering of events

Vector Clocks

I At each process, maintain a clock for every other process.• Each clock Vi is a vector of size N .• Vi[j] contains process pis knowledge about process pj ’s clock.• Initially, Vi[j] := 0 for i, j ∈ {1, · · · , N}.

I Before pi timestamps an event: Vi[i] := Vi[i] + 1.

I Whenever a message m is sent from pi to pj :• pi executes Vi[i] := Vi[i] + 1 and sends Vi with m.• pj receives Vi with m and merges the vector clocks Vi and Vj :

Vj [k] =

{max(Vj [k], Vi[k]) + 1 if j = kmax(Vj [k], Vi[k]) otherwise

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 42 / 67

Page 90: Time, clocks and the ordering of events

Vector Clocks

I At each process, maintain a clock for every other process.• Each clock Vi is a vector of size N .• Vi[j] contains process pis knowledge about process pj ’s clock.• Initially, Vi[j] := 0 for i, j ∈ {1, · · · , N}.

I Before pi timestamps an event: Vi[i] := Vi[i] + 1.

I Whenever a message m is sent from pi to pj :• pi executes Vi[i] := Vi[i] + 1 and sends Vi with m.• pj receives Vi with m and merges the vector clocks Vi and Vj :

Vj [k] =

{max(Vj [k], Vi[k]) + 1 if j = kmax(Vj [k], Vi[k]) otherwise

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 42 / 67

Page 91: Time, clocks and the ordering of events

Vector Clocks

I At each process, maintain a clock for every other process.• Each clock Vi is a vector of size N .• Vi[j] contains process pis knowledge about process pj ’s clock.• Initially, Vi[j] := 0 for i, j ∈ {1, · · · , N}.

I Before pi timestamps an event: Vi[i] := Vi[i] + 1.

I Whenever a message m is sent from pi to pj :• pi executes Vi[i] := Vi[i] + 1 and sends Vi with m.• pj receives Vi with m and merges the vector clocks Vi and Vj :

Vj [k] =

{max(Vj [k], Vi[k]) + 1 if j = kmax(Vj [k], Vi[k]) otherwise

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 42 / 67

Page 92: Time, clocks and the ordering of events

Example of Vector Clock

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 43 / 67

Page 93: Time, clocks and the ordering of events

Comparing Vector Clocks

I V = V ′ iff V [i] = V ′[i] for i ∈ {1, · · · , N}

I V ≤ V ′ iff V [i] ≤ V ′[i] for i ∈ {1, · · · , N}

I V ||V ′ iff V ≤ V ′ ∧ V ′ ≤ V

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 44 / 67

Page 94: Time, clocks and the ordering of events

Vector Clocks Properties

I a→ b implies V (a) < V (b)

I V (a) < V (b) implies a→ b

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 45 / 67

Page 95: Time, clocks and the ordering of events

Logical Clock vs. Vector Clock

I Logical clock• If a→ b then t(a) < t(b)

I Vector clock• If a→ b then V (a) < V (b)• If V (a) < V (b) then a→ b• Sending extra information: vector with size N , for N processes.

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 46 / 67

Page 96: Time, clocks and the ordering of events

Global State

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 47 / 67

Page 97: Time, clocks and the ordering of events

Global State

I Determining global properties

I Distributed checkpoint• What is a correct state of the system to save?

I Distributed garbage collection• Do any references exist to a given object?

I ...

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 48 / 67

Page 98: Time, clocks and the ordering of events

Local History

I N processes pi, i ∈ {1, · · · , N}

I The local history of process pi is a sequence of eventshi = 〈e0i , e1i , · · · 〉

I May be finite or infinite.

I Each event eji is either a local event or a communication event.

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 49 / 67

Page 99: Time, clocks and the ordering of events

Local History

I N processes pi, i ∈ {1, · · · , N}

I The local history of process pi is a sequence of eventshi = 〈e0i , e1i , · · · 〉

I May be finite or infinite.

I Each event eji is either a local event or a communication event.

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 49 / 67

Page 100: Time, clocks and the ordering of events

Local History

I N processes pi, i ∈ {1, · · · , N}

I The local history of process pi is a sequence of eventshi = 〈e0i , e1i , · · · 〉

I May be finite or infinite.

I Each event eji is either a local event or a communication event.

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 49 / 67

Page 101: Time, clocks and the ordering of events

Local History

I N processes pi, i ∈ {1, · · · , N}

I The local history of process pi is a sequence of eventshi = 〈e0i , e1i , · · · 〉

I May be finite or infinite.

I Each event eji is either a local event or a communication event.

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 49 / 67

Page 102: Time, clocks and the ordering of events

Local and Global State

I ski denotes the local state of process pi after execution of event eki .

I The local state ski records all events included in the history hki .

I The global state, S, of a distributed computation is an N -tuple oflocal states (s1, s2, · · · , sN ), one for each process.

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 50 / 67

Page 103: Time, clocks and the ordering of events

Local and Global State

I ski denotes the local state of process pi after execution of event eki .

I The local state ski records all events included in the history hki .

I The global state, S, of a distributed computation is an N -tuple oflocal states (s1, s2, · · · , sN ), one for each process.

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 50 / 67

Page 104: Time, clocks and the ordering of events

Local and Global State

I ski denotes the local state of process pi after execution of event eki .

I The local state ski records all events included in the history hki .

I The global state, S, of a distributed computation is an N -tuple oflocal states (s1, s2, · · · , sN ), one for each process.

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 50 / 67

Page 105: Time, clocks and the ordering of events

Cuts

I hcii is history of pi up to and including event ecii , called partialhistory.

I A cut, C, of a distributed computation is the union of N partialhistories, one for each process: C =

⋃Ni=1 h

cii

I Each cut C has a corresponding global state: S = (s1, s2, · · · , sN ).

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 51 / 67

Page 106: Time, clocks and the ordering of events

Cuts

I hcii is history of pi up to and including event ecii , called partialhistory.

I A cut, C, of a distributed computation is the union of N partialhistories, one for each process: C =

⋃Ni=1 h

cii

I Each cut C has a corresponding global state: S = (s1, s2, · · · , sN ).

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 51 / 67

Page 107: Time, clocks and the ordering of events

Cuts

I hcii is history of pi up to and including event ecii , called partialhistory.

I A cut, C, of a distributed computation is the union of N partialhistories, one for each process: C =

⋃Ni=1 h

cii

I Each cut C has a corresponding global state: S = (s1, s2, · · · , sN ).

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 51 / 67

Page 108: Time, clocks and the ordering of events

Consistent Cuts (1/2)

I A cut C is consistent, if for all events e and e′

(e′ ∈ C) ∧ (e→ e′)⇒ e ∈ C

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 52 / 67

Page 109: Time, clocks and the ordering of events

Consistent Cuts (1/2)

I A cut C is consistent, if for all events e and e′

(e′ ∈ C) ∧ (e→ e′)⇒ e ∈ C

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 52 / 67

Page 110: Time, clocks and the ordering of events

Consistent Cuts (2/2)

I It can be written as two following conditions:

• Condition 1: any message that is sent by a process before recordingits snapshot, must be recorded in the cut.

• Condition 2: any message that is sent by a process after recordingits snapshot, must not be recorded in the cut.

I A global state is consistent if it corresponds to a consistent cut.

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 53 / 67

Page 111: Time, clocks and the ordering of events

Consistent Cuts (2/2)

I It can be written as two following conditions:• Condition 1: any message that is sent by a process before recording

its snapshot, must be recorded in the cut.

• Condition 2: any message that is sent by a process after recordingits snapshot, must not be recorded in the cut.

I A global state is consistent if it corresponds to a consistent cut.

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 53 / 67

Page 112: Time, clocks and the ordering of events

Consistent Cuts (2/2)

I It can be written as two following conditions:• Condition 1: any message that is sent by a process before recording

its snapshot, must be recorded in the cut.• Condition 2: any message that is sent by a process after recording

its snapshot, must not be recorded in the cut.

I A global state is consistent if it corresponds to a consistent cut.

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 53 / 67

Page 113: Time, clocks and the ordering of events

Consistent Cuts (2/2)

I It can be written as two following conditions:• Condition 1: any message that is sent by a process before recording

its snapshot, must be recorded in the cut.• Condition 2: any message that is sent by a process after recording

its snapshot, must not be recorded in the cut.

I A global state is consistent if it corresponds to a consistent cut.

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 53 / 67

Page 114: Time, clocks and the ordering of events

Possible Solutions

I Coordinated blocking

I Coordinated non-blocking

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 54 / 67

Page 115: Time, clocks and the ordering of events

Coordinated Blocking

I At barrier, all processes take their checkpoints.

I Bulk-Synchronous Parallel (BSP)

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 55 / 67

Page 116: Time, clocks and the ordering of events

Coordinated Non-Blocking

I Processes must be coordinated, but do we really need to block?

I Chandy and Lamport’s snapshot

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 56 / 67

Page 117: Time, clocks and the ordering of events

Coordinated Non-Blocking

I Processes must be coordinated, but do we really need to block?

I Chandy and Lamport’s snapshot

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 56 / 67

Page 118: Time, clocks and the ordering of events

Chandy and Lamport’s Snapshot

I Determines a consistent global state.

I Takes care of messages that are in transit.

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 57 / 67

Page 119: Time, clocks and the ordering of events

Model of a Distributed System

I Process: one process initiates taking of global snapshot

I Channels: directed, FIFO, reliable

I Process graph: fixed topology, strongly connected component

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 58 / 67

Page 120: Time, clocks and the ordering of events

Chandy and Lamport’s Snapshot Algorithm (1/3)

I The algorithm can be initiated by any process by executing theMarker Sending Rule, by which it records its local state and sendsa marker on each outgoing channel.

I A process executes the Marker Receiving Rule on receiving a marker.If the process has not yet recorded its local state, it records the stateof the channel on which the marker is received as empty and executesthe Marker Sending Rule to record its local state.

I The algorithm terminates after each process has received a markeron all of its incoming channels.

I All the local snapshots get disseminated to all other processes andall the processes can determine the global state.

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 59 / 67

Page 121: Time, clocks and the ordering of events

Chandy and Lamport’s Snapshot Algorithm (1/3)

I The algorithm can be initiated by any process by executing theMarker Sending Rule, by which it records its local state and sendsa marker on each outgoing channel.

I A process executes the Marker Receiving Rule on receiving a marker.If the process has not yet recorded its local state, it records the stateof the channel on which the marker is received as empty and executesthe Marker Sending Rule to record its local state.

I The algorithm terminates after each process has received a markeron all of its incoming channels.

I All the local snapshots get disseminated to all other processes andall the processes can determine the global state.

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 59 / 67

Page 122: Time, clocks and the ordering of events

Chandy and Lamport’s Snapshot Algorithm (1/3)

I The algorithm can be initiated by any process by executing theMarker Sending Rule, by which it records its local state and sendsa marker on each outgoing channel.

I A process executes the Marker Receiving Rule on receiving a marker.If the process has not yet recorded its local state, it records the stateof the channel on which the marker is received as empty and executesthe Marker Sending Rule to record its local state.

I The algorithm terminates after each process has received a markeron all of its incoming channels.

I All the local snapshots get disseminated to all other processes andall the processes can determine the global state.

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 59 / 67

Page 123: Time, clocks and the ordering of events

Chandy and Lamport’s Snapshot Algorithm (1/3)

I The algorithm can be initiated by any process by executing theMarker Sending Rule, by which it records its local state and sendsa marker on each outgoing channel.

I A process executes the Marker Receiving Rule on receiving a marker.If the process has not yet recorded its local state, it records the stateof the channel on which the marker is received as empty and executesthe Marker Sending Rule to record its local state.

I The algorithm terminates after each process has received a markeron all of its incoming channels.

I All the local snapshots get disseminated to all other processes andall the processes can determine the global state.

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 59 / 67

Page 124: Time, clocks and the ordering of events

Chandy and Lamport’s Snapshot Algorithm (2/3)

I Marker Sending Rule for process pi:• Process pi records its state.• For each outgoing channel c on which a marker has not been sent,pi sends a marker along c before pi sends further messages along c.

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 60 / 67

Page 125: Time, clocks and the ordering of events

Chandy and Lamport’s Snapshot Algorithm (3/3)

I Marker Receiving Rule for process pj on receiving a marker alongchannel c:

• If pj has not recorded its state, it records the state of channel c asthe empty set, and follows the Marker Sending Rule.

• Otherwise, it records the state of c as the set of messages receivedalong c after pj ’s state was recorded and before pj received themarker along c.

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 61 / 67

Page 126: Time, clocks and the ordering of events

Correctness of the Algorithm (1/2)

I Condition 1: any message that is sent by a process before recordingits snapshot, must be recorded in the cut.

I When a process pj receives message mij from pi that precedes themarker on channel cij , it acts as follows: if process pj has nottaken its snapshot yet, then it includes mij in its recorded snapshot.Otherwise, it records mij in the state of the channel cij . Thus,condition Condition 1 is satisfied.

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 62 / 67

Page 127: Time, clocks and the ordering of events

Correctness of the Algorithm (2/2)

I Condition 2: any message that is sent by a process after recordingits snapshot, must not be recorded in the cut.

I Due to FIFO property of channels, it follows that no message sentafter the marker on that channel is recorded in the channel state.Thus, condition Condition 2 is satisfied.

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 63 / 67

Page 128: Time, clocks and the ordering of events

Summary

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 64 / 67

Page 129: Time, clocks and the ordering of events

Summary

I Correctness of distributed algorithms: safety + liveness

I Casual order

I Logical clock and Vector clock

I Global state: Chandy and Lamport’s algorithm

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 65 / 67

Page 130: Time, clocks and the ordering of events

References:

I L. Lamport, Time, clocks, and the ordering of events in a distributedsystem. ACM Communications, 1978

I K.M. Chandy and L. Lamport, Distributed snapshots: determiningglobal states of distributed systems. ACM Transactions on Com-puter Systems, 1985.

I B. Alpern and F.B. Schneider, Defining Liveness. Technical Report,1984.

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 66 / 67

Page 131: Time, clocks and the ordering of events

Questions?

Acknowledgements

Some slides were derived from Seif Haridi slides (KTH University).

Amir H. Payberah (Tehran Polytechnic) Time, clocks and the ordering of events 1393/6/29 67 / 67