distributed operating systems: theoretical...

222
Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 1/44 Distributed Operating Systems: Theoretical Foundations Neeraj Mittal Department of Computer Science The University of Texas at Dallas [email protected]

Upload: others

Post on 27-Aug-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 1/44

Distributed Operating Systems:Theoretical Foundations

Neeraj Mittal

Department of Computer Science

The University of Texas at Dallas

[email protected]

Page 2: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

❖ Two Important Characteristics

❖ Absence of Global Clock

❖ Absence of Shared Memory

Ordering of Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 2/44

Two Important Characteristics

■ Absence of Global Clock◆ there is no common notion of time

■ Absence of Shared Memory◆ no process has up-to-date knowledge about the system

Page 3: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

❖ Two Important Characteristics

❖ Absence of Global Clock

❖ Absence of Shared Memory

Ordering of Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 2/44

Two Important Characteristics

■ Absence of Global Clock◆ there is no common notion of time

■ Absence of Shared Memory◆ no process has up-to-date knowledge about the system

Page 4: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

❖ Two Important Characteristics

❖ Absence of Global Clock

❖ Absence of Shared Memory

Ordering of Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 3/44

Absence of Global Clock

■ Different processes may have different notions of time

I invented AIDS cure!

Who did it first?

Patent Officer

I invented AIDS cure!

Earth Mars

Problem: How do we order events on different processes?

Page 5: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

❖ Two Important Characteristics

❖ Absence of Global Clock

❖ Absence of Shared Memory

Ordering of Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 3/44

Absence of Global Clock

■ Different processes may have different notions of time

I invented AIDS cure!I invented AIDS cure!

Earth Mars

I invented AIDS cure!

Who did it first?

Patent Officer

I invented AIDS cure!

Earth Mars

Problem: How do we order events on different processes?

Page 6: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

❖ Two Important Characteristics

❖ Absence of Global Clock

❖ Absence of Shared Memory

Ordering of Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 3/44

Absence of Global Clock

■ Different processes may have different notions of time

I invented AIDS cure!

Who did it first?

Patent Officer

I invented AIDS cure!

Earth Mars

Problem: How do we order events on different processes?

Page 7: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

❖ Two Important Characteristics

❖ Absence of Global Clock

❖ Absence of Shared Memory

Ordering of Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 3/44

Absence of Global Clock

■ Different processes may have different notions of time

I invented AIDS cure!

Who did it first?

Patent Officer

I invented AIDS cure!

Earth Mars

Problem: How do we order events on different processes?

Page 8: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

❖ Two Important Characteristics

❖ Absence of Global Clock

❖ Absence of Shared Memory

Ordering of Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 4/44

Absence of Shared Memory

■ A process does not know current state of other processes

Bob

Harry

What is Harry doingat present?

0

Problem: How do we obtain a coherent view of the system?

Page 9: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

❖ Two Important Characteristics

❖ Absence of Global Clock

❖ Absence of Shared Memory

Ordering of Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 4/44

Absence of Shared Memory

■ A process does not know current state of other processes

Bob

Harry

0

Bob

Harry

What is Harry doingat present?

0

Problem: How do we obtain a coherent view of the system?

Page 10: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

❖ Two Important Characteristics

❖ Absence of Global Clock

❖ Absence of Shared Memory

Ordering of Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 4/44

Absence of Shared Memory

■ A process does not know current state of other processes

Bob

Harry

0

Bob

Harry

What is Harry doingat present?

0

Problem: How do we obtain a coherent view of the system?

Page 11: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

❖ Two Important Characteristics

❖ Absence of Global Clock

❖ Absence of Shared Memory

Ordering of Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 4/44

Absence of Shared Memory

■ A process does not know current state of other processes

Bob

Harry

What is Harry doingat present?

0

Problem: How do we obtain a coherent view of the system?

Page 12: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

❖ Two Important Characteristics

❖ Absence of Global Clock

❖ Absence of Shared Memory

Ordering of Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 4/44

Absence of Shared Memory

■ A process does not know current state of other processes

Bob

Harry

What is Harry doingat present?

0

Problem: How do we obtain a coherent view of the system?

Page 13: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

❖ When is it possible to order

two events?❖ Happened-Before Relation

❖ Concurrent Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 5/44

When is it possible to order two events?

Three cases:

1. Events executed on the same process:

■ if e and f are events on the same process and e

occurred before f , then e happened-before f

2. Communication events of the same message:■ if e is the send event of a message and f is the receive

event of the same message, then e happened-before f

3. Events related by transitivity:■ if event e happened-before event g and event g

happened-before event f , then e happened-before f

Page 14: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

❖ When is it possible to order

two events?❖ Happened-Before Relation

❖ Concurrent Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 5/44

When is it possible to order two events?

Three cases:

1. Events executed on the same process:■ if e and f are events on the same process and e

occurred before f , then e happened-before f

2. Communication events of the same message:■ if e is the send event of a message and f is the receive

event of the same message, then e happened-before f

3. Events related by transitivity:■ if event e happened-before event g and event g

happened-before event f , then e happened-before f

Page 15: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

❖ When is it possible to order

two events?❖ Happened-Before Relation

❖ Concurrent Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 5/44

When is it possible to order two events?

Three cases:

1. Events executed on the same process:■ if e and f are events on the same process and e

occurred before f , then e happened-before f

2. Communication events of the same message:

■ if e is the send event of a message and f is the receiveevent of the same message, then e happened-before f

3. Events related by transitivity:■ if event e happened-before event g and event g

happened-before event f , then e happened-before f

Page 16: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

❖ When is it possible to order

two events?❖ Happened-Before Relation

❖ Concurrent Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 5/44

When is it possible to order two events?

Three cases:

1. Events executed on the same process:■ if e and f are events on the same process and e

occurred before f , then e happened-before f

2. Communication events of the same message:■ if e is the send event of a message and f is the receive

event of the same message, then e happened-before f

3. Events related by transitivity:■ if event e happened-before event g and event g

happened-before event f , then e happened-before f

Page 17: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

❖ When is it possible to order

two events?❖ Happened-Before Relation

❖ Concurrent Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 5/44

When is it possible to order two events?

Three cases:

1. Events executed on the same process:■ if e and f are events on the same process and e

occurred before f , then e happened-before f

2. Communication events of the same message:■ if e is the send event of a message and f is the receive

event of the same message, then e happened-before f

3. Events related by transitivity:

■ if event e happened-before event g and event g

happened-before event f , then e happened-before f

Page 18: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

❖ When is it possible to order

two events?❖ Happened-Before Relation

❖ Concurrent Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 5/44

When is it possible to order two events?

Three cases:

1. Events executed on the same process:■ if e and f are events on the same process and e

occurred before f , then e happened-before f

2. Communication events of the same message:■ if e is the send event of a message and f is the receive

event of the same message, then e happened-before f

3. Events related by transitivity:■ if event e happened-before event g and event g

happened-before event f , then e happened-before f

Page 19: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

❖ When is it possible to order

two events?❖ Happened-Before Relation

❖ Concurrent Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 6/44

Happened-Before Relation

■ Happened-before relation is denoted by →

■ Illustration:

g h i

a b c

d e fP2

P3

P1

◆ Events on the same process:examples: a → b, a → c, d → f

◆ Events of the same message:examples: b → e, f → i

◆ Transitivity:examples: a → e, a → i, e → i

Page 20: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

❖ When is it possible to order

two events?❖ Happened-Before Relation

❖ Concurrent Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 6/44

Happened-Before Relation

■ Happened-before relation is denoted by →

■ Illustration:

g h i

a b c

d e fP2

P3

P1

◆ Events on the same process:examples: a → b, a → c, d → f

◆ Events of the same message:examples: b → e, f → i

◆ Transitivity:examples: a → e, a → i, e → i

Page 21: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

❖ When is it possible to order

two events?❖ Happened-Before Relation

❖ Concurrent Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 6/44

Happened-Before Relation

■ Happened-before relation is denoted by →

■ Illustration:

g h i

a b c

d e fP2

P3

P1

◆ Events on the same process:examples: a → b, a → c, d → f

◆ Events of the same message:examples: b → e, f → i

◆ Transitivity:examples: a → e, a → i, e → i

Page 22: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

❖ When is it possible to order

two events?❖ Happened-Before Relation

❖ Concurrent Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 6/44

Happened-Before Relation

■ Happened-before relation is denoted by →

■ Illustration:

g h i

a b c

d e fP2

P3

P1

◆ Events on the same process:examples: a → b, a → c, d → f

◆ Events of the same message:examples: b → e, f → i

◆ Transitivity:examples: a → e, a → i, e → i

Page 23: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

❖ When is it possible to order

two events?❖ Happened-Before Relation

❖ Concurrent Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 6/44

Happened-Before Relation

■ Happened-before relation is denoted by →

■ Illustration:

g h i

a b c

d e fP2

P3

P1

◆ Events on the same process:examples: a → b, a → c, d → f

◆ Events of the same message:examples: b → e, f → i

◆ Transitivity:examples: a → e, a → i, e → i

Page 24: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

❖ When is it possible to order

two events?❖ Happened-Before Relation

❖ Concurrent Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 7/44

Concurrent Events

■ Events not related by happened-before relation

■ Concurrency relation is denoted by ‖

■ Illustration:

g h i

a b c

d e fP2

P3

P1

◆ Examples: a ‖ d, d ‖ h, c ‖ e

■ Concurrency relation is not transitive:example: a ‖ d and d ‖ c but a ∦ c

Page 25: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

❖ When is it possible to order

two events?❖ Happened-Before Relation

❖ Concurrent Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 7/44

Concurrent Events

■ Events not related by happened-before relation■ Concurrency relation is denoted by ‖

■ Illustration:

g h i

a b c

d e fP2

P3

P1

◆ Examples: a ‖ d, d ‖ h, c ‖ e

■ Concurrency relation is not transitive:example: a ‖ d and d ‖ c but a ∦ c

Page 26: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

❖ When is it possible to order

two events?❖ Happened-Before Relation

❖ Concurrent Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 7/44

Concurrent Events

■ Events not related by happened-before relation■ Concurrency relation is denoted by ‖

■ Illustration:

g h i

a b c

d e fP2

P3

P1

◆ Examples: a ‖ d, d ‖ h, c ‖ e

■ Concurrency relation is not transitive:example: a ‖ d and d ‖ c but a ∦ c

Page 27: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

❖ When is it possible to order

two events?❖ Happened-Before Relation

❖ Concurrent Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 7/44

Concurrent Events

■ Events not related by happened-before relation■ Concurrency relation is denoted by ‖

■ Illustration:

g h i

a b c

d e fP2

P3

P1

◆ Examples: a ‖ d, d ‖ h, c ‖ e

■ Concurrency relation is not transitive:example: a ‖ d and d ‖ c but a ∦ c

Page 28: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

❖ When is it possible to order

two events?❖ Happened-Before Relation

❖ Concurrent Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 7/44

Concurrent Events

■ Events not related by happened-before relation■ Concurrency relation is denoted by ‖

■ Illustration:

g h i

a b c

d e fP2

P3

P1

◆ Examples: a ‖ d, d ‖ h, c ‖ e

■ Concurrency relation is not transitive:example: a ‖ d and d ‖ c but a ∦ c

Page 29: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

❖ Different Kinds of Clocks

❖ Logical Clock

❖ Implementing Logical Clock

❖ Implementing Logical Clock:

An Illustration❖ Limitation of Logical Clock

❖ Vector Clock

❖ Comparing Two Vectors

❖ Implementing Vector Clock

❖ Implementing Vector Clock:

An Illustration❖ Properties of Vector Clock

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 8/44

Different Kinds of Clocks

■ Logical Clocks◆ used to totally order all events

■ Vector Clocks◆ used to track happened-before relation

■ Matrix Clocks◆ used to track what other processes know about other

processes

■ Direct Dependency Clocks◆ used to track direct causal dependencies

Page 30: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

❖ Different Kinds of Clocks

❖ Logical Clock

❖ Implementing Logical Clock

❖ Implementing Logical Clock:

An Illustration❖ Limitation of Logical Clock

❖ Vector Clock

❖ Comparing Two Vectors

❖ Implementing Vector Clock

❖ Implementing Vector Clock:

An Illustration❖ Properties of Vector Clock

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 8/44

Different Kinds of Clocks

■ Logical Clocks◆ used to totally order all events

■ Vector Clocks◆ used to track happened-before relation

■ Matrix Clocks◆ used to track what other processes know about other

processes

■ Direct Dependency Clocks◆ used to track direct causal dependencies

Page 31: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

❖ Different Kinds of Clocks

❖ Logical Clock

❖ Implementing Logical Clock

❖ Implementing Logical Clock:

An Illustration❖ Limitation of Logical Clock

❖ Vector Clock

❖ Comparing Two Vectors

❖ Implementing Vector Clock

❖ Implementing Vector Clock:

An Illustration❖ Properties of Vector Clock

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 8/44

Different Kinds of Clocks

■ Logical Clocks◆ used to totally order all events

■ Vector Clocks◆ used to track happened-before relation

■ Matrix Clocks◆ used to track what other processes know about other

processes

■ Direct Dependency Clocks◆ used to track direct causal dependencies

Page 32: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

❖ Different Kinds of Clocks

❖ Logical Clock

❖ Implementing Logical Clock

❖ Implementing Logical Clock:

An Illustration❖ Limitation of Logical Clock

❖ Vector Clock

❖ Comparing Two Vectors

❖ Implementing Vector Clock

❖ Implementing Vector Clock:

An Illustration❖ Properties of Vector Clock

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 8/44

Different Kinds of Clocks

■ Logical Clocks◆ used to totally order all events

■ Vector Clocks◆ used to track happened-before relation

■ Matrix Clocks◆ used to track what other processes know about other

processes

■ Direct Dependency Clocks◆ used to track direct causal dependencies

Page 33: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

❖ Different Kinds of Clocks

❖ Logical Clock

❖ Implementing Logical Clock

❖ Implementing Logical Clock:

An Illustration❖ Limitation of Logical Clock

❖ Vector Clock

❖ Comparing Two Vectors

❖ Implementing Vector Clock

❖ Implementing Vector Clock:

An Illustration❖ Properties of Vector Clock

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 9/44

Logical Clock

■ Implements the notion of virtual time

■ Can be used to totally order all events

■ Assigns timestamp to each event in a way that isconsistent with the happened-before relation:

e → f ⇒ C(e) < C(f)

C(e): timestamp for event e

C(f): timestamp for event f

Page 34: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

❖ Different Kinds of Clocks

❖ Logical Clock

❖ Implementing Logical Clock

❖ Implementing Logical Clock:

An Illustration❖ Limitation of Logical Clock

❖ Vector Clock

❖ Comparing Two Vectors

❖ Implementing Vector Clock

❖ Implementing Vector Clock:

An Illustration❖ Properties of Vector Clock

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 9/44

Logical Clock

■ Implements the notion of virtual time

■ Can be used to totally order all events

■ Assigns timestamp to each event in a way that isconsistent with the happened-before relation:

e → f ⇒ C(e) < C(f)

C(e): timestamp for event e

C(f): timestamp for event f

Page 35: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

❖ Different Kinds of Clocks

❖ Logical Clock

❖ Implementing Logical Clock

❖ Implementing Logical Clock:

An Illustration❖ Limitation of Logical Clock

❖ Vector Clock

❖ Comparing Two Vectors

❖ Implementing Vector Clock

❖ Implementing Vector Clock:

An Illustration❖ Properties of Vector Clock

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 9/44

Logical Clock

■ Implements the notion of virtual time

■ Can be used to totally order all events

■ Assigns timestamp to each event in a way that isconsistent with the happened-before relation:

e → f ⇒ C(e) < C(f)

C(e): timestamp for event e

C(f): timestamp for event f

Page 36: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

❖ Different Kinds of Clocks

❖ Logical Clock

❖ Implementing Logical Clock

❖ Implementing Logical Clock:

An Illustration❖ Limitation of Logical Clock

❖ Vector Clock

❖ Comparing Two Vectors

❖ Implementing Vector Clock

❖ Implementing Vector Clock:

An Illustration❖ Properties of Vector Clock

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 10/44

Implementing Logical Clock

■ Each process has a local scalar clock, initialized to zero◆ Ci denotes the local clock of process Pi

■ Action depends on the type of the event:

■ Protocol for process Pi:

◆ On executing an interval event:Ci := Ci + 1

◆ On sending a message m:Ci := Ci + 1piggyback Ci on m

◆ On receiving a message m:let tm be the timestamp piggybacked on m

Ci := max{Ci, tm} + 1

Page 37: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

❖ Different Kinds of Clocks

❖ Logical Clock

❖ Implementing Logical Clock

❖ Implementing Logical Clock:

An Illustration❖ Limitation of Logical Clock

❖ Vector Clock

❖ Comparing Two Vectors

❖ Implementing Vector Clock

❖ Implementing Vector Clock:

An Illustration❖ Properties of Vector Clock

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 10/44

Implementing Logical Clock

■ Each process has a local scalar clock, initialized to zero◆ Ci denotes the local clock of process Pi

■ Action depends on the type of the event:

■ Protocol for process Pi:

◆ On executing an interval event:Ci := Ci + 1

◆ On sending a message m:Ci := Ci + 1piggyback Ci on m

◆ On receiving a message m:let tm be the timestamp piggybacked on m

Ci := max{Ci, tm} + 1

Page 38: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

❖ Different Kinds of Clocks

❖ Logical Clock

❖ Implementing Logical Clock

❖ Implementing Logical Clock:

An Illustration❖ Limitation of Logical Clock

❖ Vector Clock

❖ Comparing Two Vectors

❖ Implementing Vector Clock

❖ Implementing Vector Clock:

An Illustration❖ Properties of Vector Clock

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 10/44

Implementing Logical Clock

■ Each process has a local scalar clock, initialized to zero◆ Ci denotes the local clock of process Pi

■ Action depends on the type of the event:

■ Protocol for process Pi:

◆ On executing an interval event:Ci := Ci + 1

◆ On sending a message m:Ci := Ci + 1piggyback Ci on m

◆ On receiving a message m:let tm be the timestamp piggybacked on m

Ci := max{Ci, tm} + 1

Page 39: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

❖ Different Kinds of Clocks

❖ Logical Clock

❖ Implementing Logical Clock

❖ Implementing Logical Clock:

An Illustration❖ Limitation of Logical Clock

❖ Vector Clock

❖ Comparing Two Vectors

❖ Implementing Vector Clock

❖ Implementing Vector Clock:

An Illustration❖ Properties of Vector Clock

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 10/44

Implementing Logical Clock

■ Each process has a local scalar clock, initialized to zero◆ Ci denotes the local clock of process Pi

■ Action depends on the type of the event:

■ Protocol for process Pi:

◆ On executing an interval event:Ci := Ci + 1

◆ On sending a message m:Ci := Ci + 1piggyback Ci on m

◆ On receiving a message m:let tm be the timestamp piggybacked on m

Ci := max{Ci, tm} + 1

Page 40: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

❖ Different Kinds of Clocks

❖ Logical Clock

❖ Implementing Logical Clock

❖ Implementing Logical Clock:

An Illustration❖ Limitation of Logical Clock

❖ Vector Clock

❖ Comparing Two Vectors

❖ Implementing Vector Clock

❖ Implementing Vector Clock:

An Illustration❖ Properties of Vector Clock

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 10/44

Implementing Logical Clock

■ Each process has a local scalar clock, initialized to zero◆ Ci denotes the local clock of process Pi

■ Action depends on the type of the event:

■ Protocol for process Pi:

◆ On executing an interval event:Ci := Ci + 1

◆ On sending a message m:Ci := Ci + 1piggyback Ci on m

◆ On receiving a message m:let tm be the timestamp piggybacked on m

Ci := max{Ci, tm} + 1

Page 41: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

❖ Different Kinds of Clocks

❖ Logical Clock

❖ Implementing Logical Clock

❖ Implementing Logical Clock:

An Illustration❖ Limitation of Logical Clock

❖ Vector Clock

❖ Comparing Two Vectors

❖ Implementing Vector Clock

❖ Implementing Vector Clock:

An Illustration❖ Properties of Vector Clock

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 10/44

Implementing Logical Clock

■ Each process has a local scalar clock, initialized to zero◆ Ci denotes the local clock of process Pi

■ Action depends on the type of the event:

■ Protocol for process Pi:

◆ On executing an interval event:Ci := Ci + 1

◆ On sending a message m:Ci := Ci + 1piggyback Ci on m

◆ On receiving a message m:let tm be the timestamp piggybacked on m

Ci := max{Ci, tm} + 1

Page 42: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

❖ Different Kinds of Clocks

❖ Logical Clock

❖ Implementing Logical Clock

❖ Implementing Logical Clock:

An Illustration❖ Limitation of Logical Clock

❖ Vector Clock

❖ Comparing Two Vectors

❖ Implementing Vector Clock

❖ Implementing Vector Clock:

An Illustration❖ Properties of Vector Clock

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 11/44

Implementing Logical Clock: An Illustration

1

1

P2

P3

P1

a

a: internal event C(a) = 1

1 2 3 4

1 3 4

1 52

2

4

P2

P3

P1

b e

a d

c

Page 43: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

❖ Different Kinds of Clocks

❖ Logical Clock

❖ Implementing Logical Clock

❖ Implementing Logical Clock:

An Illustration❖ Limitation of Logical Clock

❖ Vector Clock

❖ Comparing Two Vectors

❖ Implementing Vector Clock

❖ Implementing Vector Clock:

An Illustration❖ Properties of Vector Clock

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 11/44

Implementing Logical Clock: An Illustration

1

1

1

P2

P3

P1

c

b

a

b and c: internal events C(b) = 1 and C(c) = 1

1 2 3 4

1 3 4

1 52

2

4

P2

P3

P1

b e

a d

c

Page 44: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

❖ Different Kinds of Clocks

❖ Logical Clock

❖ Implementing Logical Clock

❖ Implementing Logical Clock:

An Illustration❖ Limitation of Logical Clock

❖ Vector Clock

❖ Comparing Two Vectors

❖ Implementing Vector Clock

❖ Implementing Vector Clock:

An Illustration❖ Properties of Vector Clock

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 11/44

Implementing Logical Clock: An Illustration

2

1

1 2

1

P2

P3

P1

a d

c

b

d: send event C(d) = 2

1 2 3 4

1 3 4

1 52

2

4

P2

P3

P1

b e

a d

c

Page 45: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

❖ Different Kinds of Clocks

❖ Logical Clock

❖ Implementing Logical Clock

❖ Implementing Logical Clock:

An Illustration❖ Limitation of Logical Clock

❖ Vector Clock

❖ Comparing Two Vectors

❖ Implementing Vector Clock

❖ Implementing Vector Clock:

An Illustration❖ Properties of Vector Clock

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 11/44

Implementing Logical Clock: An Illustration

2

1 3

1 2

1

P2

P3

P1

b e

a d

c

e: receive event C(e) = 3

1 2 3 4

1 3 4

1 52

2

4

P2

P3

P1

b e

a d

c

Page 46: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

❖ Different Kinds of Clocks

❖ Logical Clock

❖ Implementing Logical Clock

❖ Implementing Logical Clock:

An Illustration❖ Limitation of Logical Clock

❖ Vector Clock

❖ Comparing Two Vectors

❖ Implementing Vector Clock

❖ Implementing Vector Clock:

An Illustration❖ Properties of Vector Clock

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 11/44

Implementing Logical Clock: An Illustration

1 2 3 4

1 3 4

1 52

2

4

P2

P3

P1

b e

a d

c

Page 47: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

❖ Different Kinds of Clocks

❖ Logical Clock

❖ Implementing Logical Clock

❖ Implementing Logical Clock:

An Illustration❖ Limitation of Logical Clock

❖ Vector Clock

❖ Comparing Two Vectors

❖ Implementing Vector Clock

❖ Implementing Vector Clock:

An Illustration❖ Properties of Vector Clock

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 12/44

Limitation of Logical Clock

■ Logical clock cannot be used to determine whether twoevents are concurrent

e ‖ f does not imply C(e) = C(f)

Page 48: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

❖ Different Kinds of Clocks

❖ Logical Clock

❖ Implementing Logical Clock

❖ Implementing Logical Clock:

An Illustration❖ Limitation of Logical Clock

❖ Vector Clock

❖ Comparing Two Vectors

❖ Implementing Vector Clock

❖ Implementing Vector Clock:

An Illustration❖ Properties of Vector Clock

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 12/44

Limitation of Logical Clock

■ Logical clock cannot be used to determine whether twoevents are concurrent

e ‖ f does not imply C(e) = C(f)

Page 49: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

❖ Different Kinds of Clocks

❖ Logical Clock

❖ Implementing Logical Clock

❖ Implementing Logical Clock:

An Illustration❖ Limitation of Logical Clock

❖ Vector Clock

❖ Comparing Two Vectors

❖ Implementing Vector Clock

❖ Implementing Vector Clock:

An Illustration❖ Properties of Vector Clock

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 13/44

Vector Clock

■ Captures the happened-before relation

■ Assigns timestamp to each event such that:

e → f ⇐⇒ C(e) < C(f)

C(e): timestamp for event e

C(f): timestamp for event f

Page 50: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

❖ Different Kinds of Clocks

❖ Logical Clock

❖ Implementing Logical Clock

❖ Implementing Logical Clock:

An Illustration❖ Limitation of Logical Clock

❖ Vector Clock

❖ Comparing Two Vectors

❖ Implementing Vector Clock

❖ Implementing Vector Clock:

An Illustration❖ Properties of Vector Clock

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 13/44

Vector Clock

■ Captures the happened-before relation

■ Assigns timestamp to each event such that:

e → f ⇐⇒ C(e) < C(f)

C(e): timestamp for event e

C(f): timestamp for event f

Page 51: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

❖ Different Kinds of Clocks

❖ Logical Clock

❖ Implementing Logical Clock

❖ Implementing Logical Clock:

An Illustration❖ Limitation of Logical Clock

❖ Vector Clock

❖ Comparing Two Vectors

❖ Implementing Vector Clock

❖ Implementing Vector Clock:

An Illustration❖ Properties of Vector Clock

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 14/44

Comparing Two Vectors

■ Vectors are compared component-wise:

◆ Equality:

V = V ′ iff 〈∀i : V [i] = V ′[i]〉

◆ Less Than:

V < V ′ iff 〈∀i : V [i] ≤ V ′[i]〉 ∧ 〈∃i : V [i] < V ′[i]〉

1

2

0

<

2

3

1

and

2

1

1

<

2

3

4

but

1

2

1

6<

2

1

3

Page 52: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

❖ Different Kinds of Clocks

❖ Logical Clock

❖ Implementing Logical Clock

❖ Implementing Logical Clock:

An Illustration❖ Limitation of Logical Clock

❖ Vector Clock

❖ Comparing Two Vectors

❖ Implementing Vector Clock

❖ Implementing Vector Clock:

An Illustration❖ Properties of Vector Clock

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 14/44

Comparing Two Vectors

■ Vectors are compared component-wise:

◆ Equality:

V = V ′ iff 〈∀i : V [i] = V ′[i]〉

◆ Less Than:

V < V ′ iff 〈∀i : V [i] ≤ V ′[i]〉 ∧ 〈∃i : V [i] < V ′[i]〉

1

2

0

<

2

3

1

and

2

1

1

<

2

3

4

but

1

2

1

6<

2

1

3

Page 53: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

❖ Different Kinds of Clocks

❖ Logical Clock

❖ Implementing Logical Clock

❖ Implementing Logical Clock:

An Illustration❖ Limitation of Logical Clock

❖ Vector Clock

❖ Comparing Two Vectors

❖ Implementing Vector Clock

❖ Implementing Vector Clock:

An Illustration❖ Properties of Vector Clock

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 14/44

Comparing Two Vectors

■ Vectors are compared component-wise:

◆ Equality:

V = V ′ iff 〈∀i : V [i] = V ′[i]〉

◆ Less Than:

V < V ′ iff 〈∀i : V [i] ≤ V ′[i]〉 ∧ 〈∃i : V [i] < V ′[i]〉

1

2

0

<

2

3

1

and

2

1

1

<

2

3

4

but

1

2

1

6<

2

1

3

Page 54: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

❖ Different Kinds of Clocks

❖ Logical Clock

❖ Implementing Logical Clock

❖ Implementing Logical Clock:

An Illustration❖ Limitation of Logical Clock

❖ Vector Clock

❖ Comparing Two Vectors

❖ Implementing Vector Clock

❖ Implementing Vector Clock:

An Illustration❖ Properties of Vector Clock

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 14/44

Comparing Two Vectors

■ Vectors are compared component-wise:

◆ Equality:

V = V ′ iff 〈∀i : V [i] = V ′[i]〉

◆ Less Than:

V < V ′ iff 〈∀i : V [i] ≤ V ′[i]〉 ∧ 〈∃i : V [i] < V ′[i]〉

1

2

0

<

2

3

1

and

2

1

1

<

2

3

4

but

1

2

1

6<

2

1

3

Page 55: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

❖ Different Kinds of Clocks

❖ Logical Clock

❖ Implementing Logical Clock

❖ Implementing Logical Clock:

An Illustration❖ Limitation of Logical Clock

❖ Vector Clock

❖ Comparing Two Vectors

❖ Implementing Vector Clock

❖ Implementing Vector Clock:

An Illustration❖ Properties of Vector Clock

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 15/44

Implementing Vector Clock

■ Each process has a local vector clock◆ Ci denotes the local clock of process Pi

■ Action depends on the type of the event:

■ Protocol for process Pi:

◆ On executing an interval event:Ci[i] := Ci[i] + 1

◆ On sending a message m:Ci[i] := Ci[i] + 1piggyback Ci on m

◆ On receiving a message m:let tm be the timestamp piggybacked on m

∀k Ci[k] := max{Ci[k], tm[k]}Ci[i] := Ci[i] + 1

Page 56: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

❖ Different Kinds of Clocks

❖ Logical Clock

❖ Implementing Logical Clock

❖ Implementing Logical Clock:

An Illustration❖ Limitation of Logical Clock

❖ Vector Clock

❖ Comparing Two Vectors

❖ Implementing Vector Clock

❖ Implementing Vector Clock:

An Illustration❖ Properties of Vector Clock

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 15/44

Implementing Vector Clock

■ Each process has a local vector clock◆ Ci denotes the local clock of process Pi

■ Action depends on the type of the event:

■ Protocol for process Pi:

◆ On executing an interval event:Ci[i] := Ci[i] + 1

◆ On sending a message m:Ci[i] := Ci[i] + 1piggyback Ci on m

◆ On receiving a message m:let tm be the timestamp piggybacked on m

∀k Ci[k] := max{Ci[k], tm[k]}Ci[i] := Ci[i] + 1

Page 57: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

❖ Different Kinds of Clocks

❖ Logical Clock

❖ Implementing Logical Clock

❖ Implementing Logical Clock:

An Illustration❖ Limitation of Logical Clock

❖ Vector Clock

❖ Comparing Two Vectors

❖ Implementing Vector Clock

❖ Implementing Vector Clock:

An Illustration❖ Properties of Vector Clock

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 15/44

Implementing Vector Clock

■ Each process has a local vector clock◆ Ci denotes the local clock of process Pi

■ Action depends on the type of the event:

■ Protocol for process Pi:

◆ On executing an interval event:Ci[i] := Ci[i] + 1

◆ On sending a message m:Ci[i] := Ci[i] + 1piggyback Ci on m

◆ On receiving a message m:let tm be the timestamp piggybacked on m

∀k Ci[k] := max{Ci[k], tm[k]}Ci[i] := Ci[i] + 1

Page 58: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

❖ Different Kinds of Clocks

❖ Logical Clock

❖ Implementing Logical Clock

❖ Implementing Logical Clock:

An Illustration❖ Limitation of Logical Clock

❖ Vector Clock

❖ Comparing Two Vectors

❖ Implementing Vector Clock

❖ Implementing Vector Clock:

An Illustration❖ Properties of Vector Clock

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 15/44

Implementing Vector Clock

■ Each process has a local vector clock◆ Ci denotes the local clock of process Pi

■ Action depends on the type of the event:

■ Protocol for process Pi:

◆ On executing an interval event:Ci[i] := Ci[i] + 1

◆ On sending a message m:Ci[i] := Ci[i] + 1piggyback Ci on m

◆ On receiving a message m:let tm be the timestamp piggybacked on m

∀k Ci[k] := max{Ci[k], tm[k]}Ci[i] := Ci[i] + 1

Page 59: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

❖ Different Kinds of Clocks

❖ Logical Clock

❖ Implementing Logical Clock

❖ Implementing Logical Clock:

An Illustration❖ Limitation of Logical Clock

❖ Vector Clock

❖ Comparing Two Vectors

❖ Implementing Vector Clock

❖ Implementing Vector Clock:

An Illustration❖ Properties of Vector Clock

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 15/44

Implementing Vector Clock

■ Each process has a local vector clock◆ Ci denotes the local clock of process Pi

■ Action depends on the type of the event:

■ Protocol for process Pi:

◆ On executing an interval event:Ci[i] := Ci[i] + 1

◆ On sending a message m:Ci[i] := Ci[i] + 1piggyback Ci on m

◆ On receiving a message m:let tm be the timestamp piggybacked on m

∀k Ci[k] := max{Ci[k], tm[k]}Ci[i] := Ci[i] + 1

Page 60: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

❖ Different Kinds of Clocks

❖ Logical Clock

❖ Implementing Logical Clock

❖ Implementing Logical Clock:

An Illustration❖ Limitation of Logical Clock

❖ Vector Clock

❖ Comparing Two Vectors

❖ Implementing Vector Clock

❖ Implementing Vector Clock:

An Illustration❖ Properties of Vector Clock

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 15/44

Implementing Vector Clock

■ Each process has a local vector clock◆ Ci denotes the local clock of process Pi

■ Action depends on the type of the event:

■ Protocol for process Pi:

◆ On executing an interval event:Ci[i] := Ci[i] + 1

◆ On sending a message m:Ci[i] := Ci[i] + 1piggyback Ci on m

◆ On receiving a message m:let tm be the timestamp piggybacked on m

∀k Ci[k] := max{Ci[k], tm[k]}Ci[i] := Ci[i] + 1

Page 61: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

❖ Different Kinds of Clocks

❖ Logical Clock

❖ Implementing Logical Clock

❖ Implementing Logical Clock:

An Illustration❖ Limitation of Logical Clock

❖ Vector Clock

❖ Comparing Two Vectors

❖ Implementing Vector Clock

❖ Implementing Vector Clock:

An Illustration❖ Properties of Vector Clock

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 16/44

Implementing Vector Clock: An Illustration

P2

P3

P1

a[

1

0

0

]

[

0

0

1

]

a: internal event C(a) =

1

0

0

b e

a d

c

P2

P3

P1 [

1

0

0

] [

3

0

0

] [

4

0

0

][

2

0

0

]

[

2

0

0

]

[

2

2

0

][

0

1

0

] [

2

3

0

]

[

2

3

0

]

[

0

0

1

] [

0

0

2

] [

2

3

3

]

Page 62: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

❖ Different Kinds of Clocks

❖ Logical Clock

❖ Implementing Logical Clock

❖ Implementing Logical Clock:

An Illustration❖ Limitation of Logical Clock

❖ Vector Clock

❖ Comparing Two Vectors

❖ Implementing Vector Clock

❖ Implementing Vector Clock:

An Illustration❖ Properties of Vector Clock

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 16/44

Implementing Vector Clock: An Illustration

c

P2

P3

P1

b

a[

1

0

0

]

[

0

1

0

]

[

0

0

1

]

b and c: internal events C(b) =

1

0

0

and C(c) =

0

0

1

b e

a d

c

P2

P3

P1 [

1

0

0

] [

3

0

0

] [

4

0

0

][

2

0

0

]

[

2

0

0

]

[

2

2

0

][

0

1

0

] [

2

3

0

]

[

2

3

0

]

[

0

0

1

] [

0

0

2

] [

2

3

3

]

Page 63: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

❖ Different Kinds of Clocks

❖ Logical Clock

❖ Implementing Logical Clock

❖ Implementing Logical Clock:

An Illustration❖ Limitation of Logical Clock

❖ Vector Clock

❖ Comparing Two Vectors

❖ Implementing Vector Clock

❖ Implementing Vector Clock:

An Illustration❖ Properties of Vector Clock

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 16/44

Implementing Vector Clock: An Illustration

a d

c

P2

P3

P1

b

[

1

0

0

] [

2

0

0

]

[

2

0

0

]

[

0

1

0

]

[

0

0

1

]

d: send event C(d) =

2

0

0

b e

a d

c

P2

P3

P1 [

1

0

0

] [

3

0

0

] [

4

0

0

][

2

0

0

]

[

2

0

0

]

[

2

2

0

][

0

1

0

] [

2

3

0

]

[

2

3

0

]

[

0

0

1

] [

0

0

2

] [

2

3

3

]

Page 64: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

❖ Different Kinds of Clocks

❖ Logical Clock

❖ Implementing Logical Clock

❖ Implementing Logical Clock:

An Illustration❖ Limitation of Logical Clock

❖ Vector Clock

❖ Comparing Two Vectors

❖ Implementing Vector Clock

❖ Implementing Vector Clock:

An Illustration❖ Properties of Vector Clock

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 16/44

Implementing Vector Clock: An Illustration

b e

a d

c

P2

P3

P1 [

1

0

0

] [

2

0

0

]

[

2

0

0

]

[

2

2

0

][

0

1

0

]

[

0

0

1

]

e: receive event C(e) =

2

2

0

b e

a d

c

P2

P3

P1 [

1

0

0

] [

3

0

0

] [

4

0

0

][

2

0

0

]

[

2

0

0

]

[

2

2

0

][

0

1

0

] [

2

3

0

]

[

2

3

0

]

[

0

0

1

] [

0

0

2

] [

2

3

3

]

Page 65: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

❖ Different Kinds of Clocks

❖ Logical Clock

❖ Implementing Logical Clock

❖ Implementing Logical Clock:

An Illustration❖ Limitation of Logical Clock

❖ Vector Clock

❖ Comparing Two Vectors

❖ Implementing Vector Clock

❖ Implementing Vector Clock:

An Illustration❖ Properties of Vector Clock

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 16/44

Implementing Vector Clock: An Illustration

b e

a d

c

P2

P3

P1 [

1

0

0

] [

3

0

0

] [

4

0

0

][

2

0

0

]

[

2

0

0

]

[

2

2

0

][

0

1

0

] [

2

3

0

]

[

2

3

0

]

[

0

0

1

] [

0

0

2

] [

2

3

3

]

Page 66: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

❖ Different Kinds of Clocks

❖ Logical Clock

❖ Implementing Logical Clock

❖ Implementing Logical Clock:

An Illustration❖ Limitation of Logical Clock

❖ Vector Clock

❖ Comparing Two Vectors

❖ Implementing Vector Clock

❖ Implementing Vector Clock:

An Illustration❖ Properties of Vector Clock

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 17/44

Properties of Vector Clock

■ How many comparisons are needed to determine whetheran event e happened-before another event f?

◆ As many as N integers may need to be compared in theworst case, where N is the number of processes

◆ Suppose e and f occurred on processes Pi and Pj

e → f

if and only if

(i = j) ∧ (C(e)[i] < C(f)[i])∨

(i 6= j) ∧ (C(e)[i] ≤ C(f)[i])

Page 67: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

❖ Different Kinds of Clocks

❖ Logical Clock

❖ Implementing Logical Clock

❖ Implementing Logical Clock:

An Illustration❖ Limitation of Logical Clock

❖ Vector Clock

❖ Comparing Two Vectors

❖ Implementing Vector Clock

❖ Implementing Vector Clock:

An Illustration❖ Properties of Vector Clock

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 17/44

Properties of Vector Clock

■ How many comparisons are needed to determine whetheran event e happened-before another event f?

◆ As many as N integers may need to be compared in theworst case, where N is the number of processes

◆ Suppose e and f occurred on processes Pi and Pj

e → f

if and only if

(i = j) ∧ (C(e)[i] < C(f)[i])∨

(i 6= j) ∧ (C(e)[i] ≤ C(f)[i])

Page 68: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

❖ Different Kinds of Clocks

❖ Logical Clock

❖ Implementing Logical Clock

❖ Implementing Logical Clock:

An Illustration❖ Limitation of Logical Clock

❖ Vector Clock

❖ Comparing Two Vectors

❖ Implementing Vector Clock

❖ Implementing Vector Clock:

An Illustration❖ Properties of Vector Clock

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 17/44

Properties of Vector Clock

■ How many comparisons are needed to determine whetheran event e happened-before another event f?

◆ As many as N integers may need to be compared in theworst case, where N is the number of processes

◆ Suppose e and f occurred on processes Pi and Pj

e → f

if and only if

(i = j) ∧ (C(e)[i] < C(f)[i])∨

(i 6= j) ∧ (C(e)[i] ≤ C(f)[i])

Page 69: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

❖ Different Kinds of Clocks

❖ Logical Clock

❖ Implementing Logical Clock

❖ Implementing Logical Clock:

An Illustration❖ Limitation of Logical Clock

❖ Vector Clock

❖ Comparing Two Vectors

❖ Implementing Vector Clock

❖ Implementing Vector Clock:

An Illustration❖ Properties of Vector Clock

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 17/44

Properties of Vector Clock

■ How many comparisons are needed to determine whetheran event e happened-before another event f?

◆ As many as N integers may need to be compared in theworst case, where N is the number of processes

◆ Suppose e and f occurred on processes Pi and Pj

e → f

if and only if

(i = j) ∧ (C(e)[i] < C(f)[i])∨

(i 6= j) ∧ (C(e)[i] ≤ C(f)[i])

Page 70: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

❖ Different Kinds of Clocks

❖ Logical Clock

❖ Implementing Logical Clock

❖ Implementing Logical Clock:

An Illustration❖ Limitation of Logical Clock

❖ Vector Clock

❖ Comparing Two Vectors

❖ Implementing Vector Clock

❖ Implementing Vector Clock:

An Illustration❖ Properties of Vector Clock

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 17/44

Properties of Vector Clock

■ How many comparisons are needed to determine whetheran event e happened-before another event f?

◆ As many as N integers may need to be compared in theworst case, where N is the number of processes

◆ Suppose e and f occurred on processes Pi and Pj

e → f

if and only if

(i = j) ∧ (C(e)[i] < C(f)[i])

(i 6= j) ∧ (C(e)[i] ≤ C(f)[i])

Page 71: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

❖ Different Kinds of Clocks

❖ Logical Clock

❖ Implementing Logical Clock

❖ Implementing Logical Clock:

An Illustration❖ Limitation of Logical Clock

❖ Vector Clock

❖ Comparing Two Vectors

❖ Implementing Vector Clock

❖ Implementing Vector Clock:

An Illustration❖ Properties of Vector Clock

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 17/44

Properties of Vector Clock

■ How many comparisons are needed to determine whetheran event e happened-before another event f?

◆ As many as N integers may need to be compared in theworst case, where N is the number of processes

◆ Suppose e and f occurred on processes Pi and Pj

e → f

if and only if

(i = j) ∧ (C(e)[i] < C(f)[i])∨

(i 6= j) ∧ (C(e)[i] ≤ C(f)[i])

Page 72: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

❖ Ordering of Messages

❖ Useful Notations

❖ Causal Delivery of Messages

❖ A Causally Ordered Delivery

Protocol❖ The BSS Protocol

❖ The BSS Protocol: An

Illustration❖ Another Causally Ordered

Delivery Protocol❖ When to Deliver a Message?

❖ The SES Protocol

❖ The SES Protocol (Continued)

❖ The SES Protocol: An

Illustration

State of a Distributed System

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 18/44

Ordering of Messages

■ For many applications, messages should be delivered incertain order to be interpreted meaningfully

■ Example:

m1: Have you seen the movie “Shrek”?

m2: Yes I have and I liked it

Bob

Alice

Tom

◆ m2 cannot be interpreted until m1 has been received◆ Tom receives m2 before m1: an undesriable behavior

Page 73: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

❖ Ordering of Messages

❖ Useful Notations

❖ Causal Delivery of Messages

❖ A Causally Ordered Delivery

Protocol❖ The BSS Protocol

❖ The BSS Protocol: An

Illustration❖ Another Causally Ordered

Delivery Protocol❖ When to Deliver a Message?

❖ The SES Protocol

❖ The SES Protocol (Continued)

❖ The SES Protocol: An

Illustration

State of a Distributed System

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 18/44

Ordering of Messages

■ For many applications, messages should be delivered incertain order to be interpreted meaningfully

■ Example:

m1: Have you seen the movie “Shrek”?

m2: Yes I have and I liked it

Bob

Alice

Tom

◆ m2 cannot be interpreted until m1 has been received◆ Tom receives m2 before m1: an undesriable behavior

Page 74: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

❖ Ordering of Messages

❖ Useful Notations

❖ Causal Delivery of Messages

❖ A Causally Ordered Delivery

Protocol❖ The BSS Protocol

❖ The BSS Protocol: An

Illustration❖ Another Causally Ordered

Delivery Protocol❖ When to Deliver a Message?

❖ The SES Protocol

❖ The SES Protocol (Continued)

❖ The SES Protocol: An

Illustration

State of a Distributed System

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 19/44

Useful Notations

■ For a message m:◆ src(m): source process of m

◆ dst(m): destination process of m

◆ snd(m): send event of m

◆ rcv(m): send event of m

e

m

dst(m)

f

rcv(m)

snd(m)src(m)

Pi

Pj

Page 75: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

❖ Ordering of Messages

❖ Useful Notations

❖ Causal Delivery of Messages

❖ A Causally Ordered Delivery

Protocol❖ The BSS Protocol

❖ The BSS Protocol: An

Illustration❖ Another Causally Ordered

Delivery Protocol❖ When to Deliver a Message?

❖ The SES Protocol

❖ The SES Protocol (Continued)

❖ The SES Protocol: An

Illustration

State of a Distributed System

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 20/44

Causal Delivery of Messages

■ A message w causally precedes a message m ifsnd(w) → snd(m)

■ An execution of a distributed system is said to be causallyordered if the following holds for every message m:

every message that causally precedes m and isdestined for the same process as m is deliveredbefore m

Mathematically, for every message w:

(snd(w) → snd(m)) ∧ (dst(w) = dst(m))

rcv(w) → rcv(m)

Page 76: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

❖ Ordering of Messages

❖ Useful Notations

❖ Causal Delivery of Messages

❖ A Causally Ordered Delivery

Protocol❖ The BSS Protocol

❖ The BSS Protocol: An

Illustration❖ Another Causally Ordered

Delivery Protocol❖ When to Deliver a Message?

❖ The SES Protocol

❖ The SES Protocol (Continued)

❖ The SES Protocol: An

Illustration

State of a Distributed System

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 20/44

Causal Delivery of Messages

■ A message w causally precedes a message m ifsnd(w) → snd(m)

■ An execution of a distributed system is said to be causallyordered if the following holds for every message m:

every message that causally precedes m and isdestined for the same process as m is deliveredbefore m

Mathematically, for every message w:

(snd(w) → snd(m)) ∧ (dst(w) = dst(m))

rcv(w) → rcv(m)

Page 77: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

❖ Ordering of Messages

❖ Useful Notations

❖ Causal Delivery of Messages

❖ A Causally Ordered Delivery

Protocol❖ The BSS Protocol

❖ The BSS Protocol: An

Illustration❖ Another Causally Ordered

Delivery Protocol❖ When to Deliver a Message?

❖ The SES Protocol

❖ The SES Protocol (Continued)

❖ The SES Protocol: An

Illustration

State of a Distributed System

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 20/44

Causal Delivery of Messages

■ A message w causally precedes a message m ifsnd(w) → snd(m)

■ An execution of a distributed system is said to be causallyordered if the following holds for every message m:

every message that causally precedes m and isdestined for the same process as m is deliveredbefore m

Mathematically, for every message w:

(snd(w) → snd(m)) ∧ (dst(w) = dst(m))

rcv(w) → rcv(m)

Page 78: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

❖ Ordering of Messages

❖ Useful Notations

❖ Causal Delivery of Messages

❖ A Causally Ordered Delivery

Protocol❖ The BSS Protocol

❖ The BSS Protocol: An

Illustration❖ Another Causally Ordered

Delivery Protocol❖ When to Deliver a Message?

❖ The SES Protocol

❖ The SES Protocol (Continued)

❖ The SES Protocol: An

Illustration

State of a Distributed System

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 21/44

A Causally Ordered Delivery Protocol

■ Proposed by Birman, Schiper and Stephenson (BSS)

■ Assumption:

◆ communication is broadcast based: a process sends amessage to every other process

■ Each process maintains a vector with one entry for eachprocess:

◆ let Vi denote the vector for process Pi

◆ the jth entry of Vi refers to the number of messages thathave been broadcast by process Pj that Pi knows of

Page 79: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

❖ Ordering of Messages

❖ Useful Notations

❖ Causal Delivery of Messages

❖ A Causally Ordered Delivery

Protocol❖ The BSS Protocol

❖ The BSS Protocol: An

Illustration❖ Another Causally Ordered

Delivery Protocol❖ When to Deliver a Message?

❖ The SES Protocol

❖ The SES Protocol (Continued)

❖ The SES Protocol: An

Illustration

State of a Distributed System

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 21/44

A Causally Ordered Delivery Protocol

■ Proposed by Birman, Schiper and Stephenson (BSS)

■ Assumption:

◆ communication is broadcast based: a process sends amessage to every other process

■ Each process maintains a vector with one entry for eachprocess:

◆ let Vi denote the vector for process Pi

◆ the jth entry of Vi refers to the number of messages thathave been broadcast by process Pj that Pi knows of

Page 80: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

❖ Ordering of Messages

❖ Useful Notations

❖ Causal Delivery of Messages

❖ A Causally Ordered Delivery

Protocol❖ The BSS Protocol

❖ The BSS Protocol: An

Illustration❖ Another Causally Ordered

Delivery Protocol❖ When to Deliver a Message?

❖ The SES Protocol

❖ The SES Protocol (Continued)

❖ The SES Protocol: An

Illustration

State of a Distributed System

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 21/44

A Causally Ordered Delivery Protocol

■ Proposed by Birman, Schiper and Stephenson (BSS)

■ Assumption:

◆ communication is broadcast based: a process sends amessage to every other process

■ Each process maintains a vector with one entry for eachprocess:

◆ let Vi denote the vector for process Pi

◆ the jth entry of Vi refers to the number of messages thathave been broadcast by process Pj that Pi knows of

Page 81: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

❖ Ordering of Messages

❖ Useful Notations

❖ Causal Delivery of Messages

❖ A Causally Ordered Delivery

Protocol❖ The BSS Protocol

❖ The BSS Protocol: An

Illustration❖ Another Causally Ordered

Delivery Protocol❖ When to Deliver a Message?

❖ The SES Protocol

❖ The SES Protocol (Continued)

❖ The SES Protocol: An

Illustration

State of a Distributed System

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 22/44

The BSS Protocol

■ Protocol for process Pi:

◆ On broadcasting a message m:piggyback Vi on m

Vi[i] := Vi[i] + 1

◆ On arrival of a message m from process Pj :let Vm be the vector piggybacked on m

deliver m once Vi ≥ Vm

◆ On delivery of a message m sent by process Pj :

Vi[j] := Vi[j] + 1

Page 82: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

❖ Ordering of Messages

❖ Useful Notations

❖ Causal Delivery of Messages

❖ A Causally Ordered Delivery

Protocol❖ The BSS Protocol

❖ The BSS Protocol: An

Illustration❖ Another Causally Ordered

Delivery Protocol❖ When to Deliver a Message?

❖ The SES Protocol

❖ The SES Protocol (Continued)

❖ The SES Protocol: An

Illustration

State of a Distributed System

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 22/44

The BSS Protocol

■ Protocol for process Pi:

◆ On broadcasting a message m:piggyback Vi on m

Vi[i] := Vi[i] + 1

◆ On arrival of a message m from process Pj :let Vm be the vector piggybacked on m

deliver m once Vi ≥ Vm

◆ On delivery of a message m sent by process Pj :

Vi[j] := Vi[j] + 1

Page 83: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

❖ Ordering of Messages

❖ Useful Notations

❖ Causal Delivery of Messages

❖ A Causally Ordered Delivery

Protocol❖ The BSS Protocol

❖ The BSS Protocol: An

Illustration❖ Another Causally Ordered

Delivery Protocol❖ When to Deliver a Message?

❖ The SES Protocol

❖ The SES Protocol (Continued)

❖ The SES Protocol: An

Illustration

State of a Distributed System

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 22/44

The BSS Protocol

■ Protocol for process Pi:

◆ On broadcasting a message m:piggyback Vi on m

Vi[i] := Vi[i] + 1

◆ On arrival of a message m from process Pj :let Vm be the vector piggybacked on m

deliver m once Vi ≥ Vm

◆ On delivery of a message m sent by process Pj :

Vi[j] := Vi[j] + 1

Page 84: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

❖ Ordering of Messages

❖ Useful Notations

❖ Causal Delivery of Messages

❖ A Causally Ordered Delivery

Protocol❖ The BSS Protocol

❖ The BSS Protocol: An

Illustration❖ Another Causally Ordered

Delivery Protocol❖ When to Deliver a Message?

❖ The SES Protocol

❖ The SES Protocol (Continued)

❖ The SES Protocol: An

Illustration

State of a Distributed System

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 22/44

The BSS Protocol

■ Protocol for process Pi:

◆ On broadcasting a message m:piggyback Vi on m

Vi[i] := Vi[i] + 1

◆ On arrival of a message m from process Pj :let Vm be the vector piggybacked on m

deliver m once Vi ≥ Vm

◆ On delivery of a message m sent by process Pj :

Vi[j] := Vi[j] + 1

Page 85: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

❖ Ordering of Messages

❖ Useful Notations

❖ Causal Delivery of Messages

❖ A Causally Ordered Delivery

Protocol❖ The BSS Protocol

❖ The BSS Protocol: An

Illustration❖ Another Causally Ordered

Delivery Protocol❖ When to Deliver a Message?

❖ The SES Protocol

❖ The SES Protocol (Continued)

❖ The SES Protocol: An

Illustration

State of a Distributed System

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 23/44

The BSS Protocol: An Illustration

P2

P3

P1[

0

0

0

]

a e

[

0

0

0

]

[

0

0

0

]

[

0

0

0

][

1

1

0

]

P2

P3

P1[

1

0

0

]

[

0

0

0

][

1

1

0

][

1

0

0

]

[

1

0

0

]

[

0

0

0

]

[

0

0

0

]

a e

gf

[

1

0

0

]

cb

[

0

0

0

] [

1

0

0

] [

1

1

0

]

Page 86: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

❖ Ordering of Messages

❖ Useful Notations

❖ Causal Delivery of Messages

❖ A Causally Ordered Delivery

Protocol❖ The BSS Protocol

❖ The BSS Protocol: An

Illustration❖ Another Causally Ordered

Delivery Protocol❖ When to Deliver a Message?

❖ The SES Protocol

❖ The SES Protocol (Continued)

❖ The SES Protocol: An

Illustration

State of a Distributed System

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 23/44

The BSS Protocol: An Illustration

P2

P3

P1[

0

0

0

] [

1

0

0

]

[

0

0

0

]

a

[

0

0

0

]

e

[

0

0

0

]

b

[

0

0

0

]

[

0

0

0

][

1

1

0

]

P2

P3

P1[

1

0

0

]

[

0

0

0

][

1

1

0

][

1

0

0

]

[

1

0

0

]

[

0

0

0

]

[

0

0

0

]

a e

gf

[

1

0

0

]

cb

[

0

0

0

] [

1

0

0

] [

1

1

0

]

Page 87: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

❖ Ordering of Messages

❖ Useful Notations

❖ Causal Delivery of Messages

❖ A Causally Ordered Delivery

Protocol❖ The BSS Protocol

❖ The BSS Protocol: An

Illustration❖ Another Causally Ordered

Delivery Protocol❖ When to Deliver a Message?

❖ The SES Protocol

❖ The SES Protocol (Continued)

❖ The SES Protocol: An

Illustration

State of a Distributed System

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 23/44

The BSS Protocol: An Illustration

P2

P3

P1[

0

0

0

] [

1

0

0

]

[

0

0

0

]

a

[

0

0

0

]

e

[

0

0

0

][

1

0

0

]

b

[

0

0

0

]

[

0

0

0

][

1

1

0

]

P2

P3

P1[

1

0

0

]

[

0

0

0

][

1

1

0

][

1

0

0

]

[

1

0

0

]

[

0

0

0

]

[

0

0

0

]

a e

gf

[

1

0

0

]

cb

[

0

0

0

] [

1

0

0

] [

1

1

0

]

Page 88: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

❖ Ordering of Messages

❖ Useful Notations

❖ Causal Delivery of Messages

❖ A Causally Ordered Delivery

Protocol❖ The BSS Protocol

❖ The BSS Protocol: An

Illustration❖ Another Causally Ordered

Delivery Protocol❖ When to Deliver a Message?

❖ The SES Protocol

❖ The SES Protocol (Continued)

❖ The SES Protocol: An

Illustration

State of a Distributed System

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 23/44

The BSS Protocol: An Illustration

P2

P3

P1[

0

0

0

] [

1

0

0

]

[

0

0

0

][

1

1

0

][

1

0

0

]

[

1

0

0

]

[

1

0

0

]

[

0

0

0

]

a

d

[

0

0

0

]

e

cb

[

0

0

0

]

[

0

0

0

][

1

1

0

]

P2

P3

P1[

1

0

0

]

[

0

0

0

][

1

1

0

][

1

0

0

]

[

1

0

0

]

[

0

0

0

]

[

0

0

0

]

a e

gf

[

1

0

0

]

cb

[

0

0

0

] [

1

0

0

] [

1

1

0

]

Page 89: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

❖ Ordering of Messages

❖ Useful Notations

❖ Causal Delivery of Messages

❖ A Causally Ordered Delivery

Protocol❖ The BSS Protocol

❖ The BSS Protocol: An

Illustration❖ Another Causally Ordered

Delivery Protocol❖ When to Deliver a Message?

❖ The SES Protocol

❖ The SES Protocol (Continued)

❖ The SES Protocol: An

Illustration

State of a Distributed System

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 23/44

The BSS Protocol: An Illustration

[

0

0

0

][

1

1

0

]

P2

P3

P1[

1

0

0

]

[

0

0

0

][

1

1

0

][

1

0

0

]

[

1

0

0

]

[

1

0

0

]

[

0

0

0

]

a e

d

[

0

0

0

]

cb

[

0

0

0

]

[

0

0

0

][

1

1

0

]

P2

P3

P1[

1

0

0

]

[

0

0

0

][

1

1

0

][

1

0

0

]

[

1

0

0

]

[

0

0

0

]

[

0

0

0

]

a e

gf

[

1

0

0

]

cb

[

0

0

0

] [

1

0

0

] [

1

1

0

]

Page 90: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

❖ Ordering of Messages

❖ Useful Notations

❖ Causal Delivery of Messages

❖ A Causally Ordered Delivery

Protocol❖ The BSS Protocol

❖ The BSS Protocol: An

Illustration❖ Another Causally Ordered

Delivery Protocol❖ When to Deliver a Message?

❖ The SES Protocol

❖ The SES Protocol (Continued)

❖ The SES Protocol: An

Illustration

State of a Distributed System

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 23/44

The BSS Protocol: An Illustration

[

0

0

0

][

1

1

0

]

P2

P3

P1[

1

0

0

]

[

0

0

0

][

1

1

0

][

1

0

0

]

[

1

0

0

]

[

1

0

0

]

[

0

0

0

]

[

0

0

0

]

a e

d f

cb

[

0

0

0

]

[

0

0

0

][

1

1

0

]

P2

P3

P1[

1

0

0

]

[

0

0

0

][

1

1

0

][

1

0

0

]

[

1

0

0

]

[

0

0

0

]

[

0

0

0

]

a e

gf

[

1

0

0

]

cb

[

0

0

0

] [

1

0

0

] [

1

1

0

]

Page 91: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

❖ Ordering of Messages

❖ Useful Notations

❖ Causal Delivery of Messages

❖ A Causally Ordered Delivery

Protocol❖ The BSS Protocol

❖ The BSS Protocol: An

Illustration❖ Another Causally Ordered

Delivery Protocol❖ When to Deliver a Message?

❖ The SES Protocol

❖ The SES Protocol (Continued)

❖ The SES Protocol: An

Illustration

State of a Distributed System

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 23/44

The BSS Protocol: An Illustration

[

0

0

0

][

1

1

0

]

P2

P3

P1[

1

0

0

]

[

0

0

0

][

1

1

0

][

1

0

0

]

[

1

0

0

]

[

1

0

0

]

[

0

0

0

]

[

0

0

0

]

a e

d f

cb

[

0

0

0

] [

1

0

0

]

[

0

0

0

][

1

1

0

]

P2

P3

P1[

1

0

0

]

[

0

0

0

][

1

1

0

][

1

0

0

]

[

1

0

0

]

[

0

0

0

]

[

0

0

0

]

a e

gf

[

1

0

0

]

cb

[

0

0

0

] [

1

0

0

] [

1

1

0

]

Page 92: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

❖ Ordering of Messages

❖ Useful Notations

❖ Causal Delivery of Messages

❖ A Causally Ordered Delivery

Protocol❖ The BSS Protocol

❖ The BSS Protocol: An

Illustration❖ Another Causally Ordered

Delivery Protocol❖ When to Deliver a Message?

❖ The SES Protocol

❖ The SES Protocol (Continued)

❖ The SES Protocol: An

Illustration

State of a Distributed System

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 23/44

The BSS Protocol: An Illustration

[

0

0

0

][

1

1

0

]

P2

P3

P1[

1

0

0

]

[

0

0

0

][

1

1

0

][

1

0

0

]

[

1

0

0

]

[

0

0

0

]

[

0

0

0

]

a e

gf

[

1

0

0

]

cb

[

0

0

0

] [

1

0

0

] [

1

1

0

]

Page 93: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

❖ Ordering of Messages

❖ Useful Notations

❖ Causal Delivery of Messages

❖ A Causally Ordered Delivery

Protocol❖ The BSS Protocol

❖ The BSS Protocol: An

Illustration❖ Another Causally Ordered

Delivery Protocol❖ When to Deliver a Message?

❖ The SES Protocol

❖ The SES Protocol (Continued)

❖ The SES Protocol: An

Illustration

State of a Distributed System

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 24/44

Another Causally Ordered Delivery Protocol

■ Proposed by Schiper, Eggli and Sandoz (SES)

■ Assumption:

◆ communication is point-to-point◆ processes are using vector clock algorithm

■ To determine whether a message has arrived out of causalorder:

◆ let Vm denote the vector timestamp of message m

◆ let Vi denote the vector clock of process Pi

Does there exist a message w that causallyprecedes m and destined for Pi such that Vi 6> Vw?

Page 94: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

❖ Ordering of Messages

❖ Useful Notations

❖ Causal Delivery of Messages

❖ A Causally Ordered Delivery

Protocol❖ The BSS Protocol

❖ The BSS Protocol: An

Illustration❖ Another Causally Ordered

Delivery Protocol❖ When to Deliver a Message?

❖ The SES Protocol

❖ The SES Protocol (Continued)

❖ The SES Protocol: An

Illustration

State of a Distributed System

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 24/44

Another Causally Ordered Delivery Protocol

■ Proposed by Schiper, Eggli and Sandoz (SES)

■ Assumption:

◆ communication is point-to-point◆ processes are using vector clock algorithm

■ To determine whether a message has arrived out of causalorder:

◆ let Vm denote the vector timestamp of message m

◆ let Vi denote the vector clock of process Pi

Does there exist a message w that causallyprecedes m and destined for Pi such that Vi 6> Vw?

Page 95: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

❖ Ordering of Messages

❖ Useful Notations

❖ Causal Delivery of Messages

❖ A Causally Ordered Delivery

Protocol❖ The BSS Protocol

❖ The BSS Protocol: An

Illustration❖ Another Causally Ordered

Delivery Protocol❖ When to Deliver a Message?

❖ The SES Protocol

❖ The SES Protocol (Continued)

❖ The SES Protocol: An

Illustration

State of a Distributed System

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 24/44

Another Causally Ordered Delivery Protocol

■ Proposed by Schiper, Eggli and Sandoz (SES)

■ Assumption:

◆ communication is point-to-point◆ processes are using vector clock algorithm

■ To determine whether a message has arrived out of causalorder:

◆ let Vm denote the vector timestamp of message m

◆ let Vi denote the vector clock of process Pi

Does there exist a message w that causallyprecedes m and destined for Pi such that Vi 6> Vw?

Page 96: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

❖ Ordering of Messages

❖ Useful Notations

❖ Causal Delivery of Messages

❖ A Causally Ordered Delivery

Protocol❖ The BSS Protocol

❖ The BSS Protocol: An

Illustration❖ Another Causally Ordered

Delivery Protocol❖ When to Deliver a Message?

❖ The SES Protocol

❖ The SES Protocol (Continued)

❖ The SES Protocol: An

Illustration

State of a Distributed System

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 24/44

Another Causally Ordered Delivery Protocol

■ Proposed by Schiper, Eggli and Sandoz (SES)

■ Assumption:

◆ communication is point-to-point◆ processes are using vector clock algorithm

■ To determine whether a message has arrived out of causalorder:

◆ let Vm denote the vector timestamp of message m

◆ let Vi denote the vector clock of process Pi

Does there exist a message w that causallyprecedes m and destined for Pi such that Vi 6> Vw?

Page 97: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

❖ Ordering of Messages

❖ Useful Notations

❖ Causal Delivery of Messages

❖ A Causally Ordered Delivery

Protocol❖ The BSS Protocol

❖ The BSS Protocol: An

Illustration❖ Another Causally Ordered

Delivery Protocol❖ When to Deliver a Message?

❖ The SES Protocol

❖ The SES Protocol (Continued)

❖ The SES Protocol: An

Illustration

State of a Distributed System

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 24/44

Another Causally Ordered Delivery Protocol

■ Proposed by Schiper, Eggli and Sandoz (SES)

■ Assumption:

◆ communication is point-to-point◆ processes are using vector clock algorithm

■ To determine whether a message has arrived out of causalorder:

◆ let Vm denote the vector timestamp of message m

◆ let Vi denote the vector clock of process Pi

Does there exist a message w that causallyprecedes m and destined for Pi such that Vi 6> Vw?

Page 98: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

❖ Ordering of Messages

❖ Useful Notations

❖ Causal Delivery of Messages

❖ A Causally Ordered Delivery

Protocol❖ The BSS Protocol

❖ The BSS Protocol: An

Illustration❖ Another Causally Ordered

Delivery Protocol❖ When to Deliver a Message?

❖ The SES Protocol

❖ The SES Protocol (Continued)

❖ The SES Protocol: An

Illustration

State of a Distributed System

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 25/44

When to Deliver a Message?

■ A message m destined for process Pi can be delivered if:

◆ for every message w that causally precedes m anddestined for Pi:

Vi > Vw

or, equivalently

◆ let past(m, j) denote the set of all messages thatcausally precede m and are destined for process Pj :

Vi > maxw∈past(m,i)

{Vw}

Page 99: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

❖ Ordering of Messages

❖ Useful Notations

❖ Causal Delivery of Messages

❖ A Causally Ordered Delivery

Protocol❖ The BSS Protocol

❖ The BSS Protocol: An

Illustration❖ Another Causally Ordered

Delivery Protocol❖ When to Deliver a Message?

❖ The SES Protocol

❖ The SES Protocol (Continued)

❖ The SES Protocol: An

Illustration

State of a Distributed System

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 25/44

When to Deliver a Message?

■ A message m destined for process Pi can be delivered if:

◆ for every message w that causally precedes m anddestined for Pi:

Vi > Vw

or, equivalently

◆ let past(m, j) denote the set of all messages thatcausally precede m and are destined for process Pj :

Vi > maxw∈past(m,i)

{Vw}

Page 100: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

❖ Ordering of Messages

❖ Useful Notations

❖ Causal Delivery of Messages

❖ A Causally Ordered Delivery

Protocol❖ The BSS Protocol

❖ The BSS Protocol: An

Illustration❖ Another Causally Ordered

Delivery Protocol❖ When to Deliver a Message?

❖ The SES Protocol

❖ The SES Protocol (Continued)

❖ The SES Protocol: An

Illustration

State of a Distributed System

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 25/44

When to Deliver a Message?

■ A message m destined for process Pi can be delivered if:

◆ for every message w that causally precedes m anddestined for Pi:

Vi > Vw

or, equivalently

◆ let past(m, j) denote the set of all messages thatcausally precede m and are destined for process Pj :

Vi > maxw∈past(m,i)

{Vw}

Page 101: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

❖ Ordering of Messages

❖ Useful Notations

❖ Causal Delivery of Messages

❖ A Causally Ordered Delivery

Protocol❖ The BSS Protocol

❖ The BSS Protocol: An

Illustration❖ Another Causally Ordered

Delivery Protocol❖ When to Deliver a Message?

❖ The SES Protocol

❖ The SES Protocol (Continued)

❖ The SES Protocol: An

Illustration

State of a Distributed System

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 25/44

When to Deliver a Message?

■ A message m destined for process Pi can be delivered if:

◆ for every message w that causally precedes m anddestined for Pi:

Vi > Vw

or, equivalently

◆ let past(m, j) denote the set of all messages thatcausally precede m and are destined for process Pj :

Vi > maxw∈past(m,i)

{Vw}

Page 102: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

❖ Ordering of Messages

❖ Useful Notations

❖ Causal Delivery of Messages

❖ A Causally Ordered Delivery

Protocol❖ The BSS Protocol

❖ The BSS Protocol: An

Illustration❖ Another Causally Ordered

Delivery Protocol❖ When to Deliver a Message?

❖ The SES Protocol

❖ The SES Protocol (Continued)

❖ The SES Protocol: An

Illustration

State of a Distributed System

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 26/44

The SES Protocol

■ Each process maintains a list of tuples with at most onetuple for every other process

◆ let DLi denote the list for process Pi

■ The list is piggybacked on every message a process sends

◆ let DLm denote the list for message m

■ if past(m, j) = ∅, then DLm does not contain a tuplefor process Pj

■ Otherwise, the tuple for process Pj is given by:

(j, maxw∈past(m,j)

{Vw})

Page 103: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

❖ Ordering of Messages

❖ Useful Notations

❖ Causal Delivery of Messages

❖ A Causally Ordered Delivery

Protocol❖ The BSS Protocol

❖ The BSS Protocol: An

Illustration❖ Another Causally Ordered

Delivery Protocol❖ When to Deliver a Message?

❖ The SES Protocol

❖ The SES Protocol (Continued)

❖ The SES Protocol: An

Illustration

State of a Distributed System

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 26/44

The SES Protocol

■ Each process maintains a list of tuples with at most onetuple for every other process

◆ let DLi denote the list for process Pi

■ The list is piggybacked on every message a process sends

◆ let DLm denote the list for message m

■ if past(m, j) = ∅, then DLm does not contain a tuplefor process Pj

■ Otherwise, the tuple for process Pj is given by:

(j, maxw∈past(m,j)

{Vw})

Page 104: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

❖ Ordering of Messages

❖ Useful Notations

❖ Causal Delivery of Messages

❖ A Causally Ordered Delivery

Protocol❖ The BSS Protocol

❖ The BSS Protocol: An

Illustration❖ Another Causally Ordered

Delivery Protocol❖ When to Deliver a Message?

❖ The SES Protocol

❖ The SES Protocol (Continued)

❖ The SES Protocol: An

Illustration

State of a Distributed System

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 26/44

The SES Protocol

■ Each process maintains a list of tuples with at most onetuple for every other process

◆ let DLi denote the list for process Pi

■ The list is piggybacked on every message a process sends

◆ let DLm denote the list for message m

■ if past(m, j) = ∅, then DLm does not contain a tuplefor process Pj

■ Otherwise, the tuple for process Pj is given by:

(j, maxw∈past(m,j)

{Vw})

Page 105: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

❖ Ordering of Messages

❖ Useful Notations

❖ Causal Delivery of Messages

❖ A Causally Ordered Delivery

Protocol❖ The BSS Protocol

❖ The BSS Protocol: An

Illustration❖ Another Causally Ordered

Delivery Protocol❖ When to Deliver a Message?

❖ The SES Protocol

❖ The SES Protocol (Continued)

❖ The SES Protocol: An

Illustration

State of a Distributed System

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 26/44

The SES Protocol

■ Each process maintains a list of tuples with at most onetuple for every other process

◆ let DLi denote the list for process Pi

■ The list is piggybacked on every message a process sends

◆ let DLm denote the list for message m

■ if past(m, j) = ∅, then DLm does not contain a tuplefor process Pj

■ Otherwise, the tuple for process Pj is given by:

(j, maxw∈past(m,j)

{Vw})

Page 106: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

❖ Ordering of Messages

❖ Useful Notations

❖ Causal Delivery of Messages

❖ A Causally Ordered Delivery

Protocol❖ The BSS Protocol

❖ The BSS Protocol: An

Illustration❖ Another Causally Ordered

Delivery Protocol❖ When to Deliver a Message?

❖ The SES Protocol

❖ The SES Protocol (Continued)

❖ The SES Protocol: An

Illustration

State of a Distributed System

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 27/44

The SES Protocol (Continued)

■ Protocol for process Pi:

◆ On sending a message m to process Pj :piggyback DLi on m

remove entry for Pj from DLi, if anyadd (j, Vm) to DLi

◆ On arrival of a message m from process Pj :if DLm does not contain any tuple for Pi then

deliver m

elselet (j, V ) be the tuple for Pi in DLm

deliver m once Vi > V

endif

◆ On delivery of a message m:merge DLi and DLm

Page 107: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

❖ Ordering of Messages

❖ Useful Notations

❖ Causal Delivery of Messages

❖ A Causally Ordered Delivery

Protocol❖ The BSS Protocol

❖ The BSS Protocol: An

Illustration❖ Another Causally Ordered

Delivery Protocol❖ When to Deliver a Message?

❖ The SES Protocol

❖ The SES Protocol (Continued)

❖ The SES Protocol: An

Illustration

State of a Distributed System

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 27/44

The SES Protocol (Continued)

■ Protocol for process Pi:

◆ On sending a message m to process Pj :piggyback DLi on m

remove entry for Pj from DLi, if anyadd (j, Vm) to DLi

◆ On arrival of a message m from process Pj :if DLm does not contain any tuple for Pi then

deliver m

elselet (j, V ) be the tuple for Pi in DLm

deliver m once Vi > V

endif

◆ On delivery of a message m:merge DLi and DLm

Page 108: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

❖ Ordering of Messages

❖ Useful Notations

❖ Causal Delivery of Messages

❖ A Causally Ordered Delivery

Protocol❖ The BSS Protocol

❖ The BSS Protocol: An

Illustration❖ Another Causally Ordered

Delivery Protocol❖ When to Deliver a Message?

❖ The SES Protocol

❖ The SES Protocol (Continued)

❖ The SES Protocol: An

Illustration

State of a Distributed System

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 27/44

The SES Protocol (Continued)

■ Protocol for process Pi:

◆ On sending a message m to process Pj :piggyback DLi on m

remove entry for Pj from DLi, if anyadd (j, Vm) to DLi

◆ On arrival of a message m from process Pj :if DLm does not contain any tuple for Pi then

deliver m

elselet (j, V ) be the tuple for Pi in DLm

deliver m once Vi > V

endif

◆ On delivery of a message m:merge DLi and DLm

Page 109: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

❖ Ordering of Messages

❖ Useful Notations

❖ Causal Delivery of Messages

❖ A Causally Ordered Delivery

Protocol❖ The BSS Protocol

❖ The BSS Protocol: An

Illustration❖ Another Causally Ordered

Delivery Protocol❖ When to Deliver a Message?

❖ The SES Protocol

❖ The SES Protocol (Continued)

❖ The SES Protocol: An

Illustration

State of a Distributed System

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 27/44

The SES Protocol (Continued)

■ Protocol for process Pi:

◆ On sending a message m to process Pj :piggyback DLi on m

remove entry for Pj from DLi, if anyadd (j, Vm) to DLi

◆ On arrival of a message m from process Pj :if DLm does not contain any tuple for Pi then

deliver m

elselet (j, V ) be the tuple for Pi in DLm

deliver m once Vi > V

endif

◆ On delivery of a message m:merge DLi and DLm

Page 110: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

❖ Ordering of Messages

❖ Useful Notations

❖ Causal Delivery of Messages

❖ A Causally Ordered Delivery

Protocol❖ The BSS Protocol

❖ The BSS Protocol: An

Illustration❖ Another Causally Ordered

Delivery Protocol❖ When to Deliver a Message?

❖ The SES Protocol

❖ The SES Protocol (Continued)

❖ The SES Protocol: An

Illustration

State of a Distributed System

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 28/44

The SES Protocol: An Illustration

P1

P2

P3

{}[

0

0

0

]

a

{}

[

0

0

0

]

[

0

0

0

]

{}[

1

0

1

]

P1

P2

P3

[

2

0

0

][

1

0

0

]

{}[

0

0

0

]

a b

[

2

0

0

]

{}

[

1

0

0

]

{(3,

[

1

0

0

]

)}

dc

{(3,

[

1

0

0

]

)}

g f

{(3,

[

1

0

0

]

), (2,

[

2

0

0

]

)}

{}

[

0

0

0

]

{(3,

[

1

0

0

]

)}{(3,

[

1

0

0

]

)}

[

2

1

0

]

[

2

2

0

]{(3,

[

2

2

0

]

))}

[

2

2

0

]

[

0

0

0

]

{} {}[

1

0

1

]

{}[

2

2

2

]

Page 111: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

❖ Ordering of Messages

❖ Useful Notations

❖ Causal Delivery of Messages

❖ A Causally Ordered Delivery

Protocol❖ The BSS Protocol

❖ The BSS Protocol: An

Illustration❖ Another Causally Ordered

Delivery Protocol❖ When to Deliver a Message?

❖ The SES Protocol

❖ The SES Protocol (Continued)

❖ The SES Protocol: An

Illustration

State of a Distributed System

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 28/44

The SES Protocol: An Illustration

P1

P2

P3

[

1

0

0

]

{}[

0

0

0

]

a

{}

[

1

0

0

]

{(3,

[

1

0

0

]

)}

{}

[

0

0

0

]

[

0

0

0

]

{}[

1

0

1

]

P1

P2

P3

[

2

0

0

][

1

0

0

]

{}[

0

0

0

]

a b

[

2

0

0

]

{}

[

1

0

0

]

{(3,

[

1

0

0

]

)}

dc

{(3,

[

1

0

0

]

)}

g f

{(3,

[

1

0

0

]

), (2,

[

2

0

0

]

)}

{}

[

0

0

0

]

{(3,

[

1

0

0

]

)}{(3,

[

1

0

0

]

)}

[

2

1

0

]

[

2

2

0

]{(3,

[

2

2

0

]

))}

[

2

2

0

]

[

0

0

0

]

{} {}[

1

0

1

]

{}[

2

2

2

]

Page 112: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

❖ Ordering of Messages

❖ Useful Notations

❖ Causal Delivery of Messages

❖ A Causally Ordered Delivery

Protocol❖ The BSS Protocol

❖ The BSS Protocol: An

Illustration❖ Another Causally Ordered

Delivery Protocol❖ When to Deliver a Message?

❖ The SES Protocol

❖ The SES Protocol (Continued)

❖ The SES Protocol: An

Illustration

State of a Distributed System

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 28/44

The SES Protocol: An Illustration

P1

P2

P3

[

2

0

0

][

1

0

0

]

{}[

0

0

0

]

a b

[

2

0

0

]

{}

[

1

0

0

]

{(3,

[

1

0

0

]

)}

c

{(3,

[

1

0

0

]

)}{(3,

[

1

0

0

]

), (2,

[

2

0

0

]

)}

{}

[

0

0

0

]

[

0

0

0

]

{}[

1

0

1

]

P1

P2

P3

[

2

0

0

][

1

0

0

]

{}[

0

0

0

]

a b

[

2

0

0

]

{}

[

1

0

0

]

{(3,

[

1

0

0

]

)}

dc

{(3,

[

1

0

0

]

)}

g f

{(3,

[

1

0

0

]

), (2,

[

2

0

0

]

)}

{}

[

0

0

0

]

{(3,

[

1

0

0

]

)}{(3,

[

1

0

0

]

)}

[

2

1

0

]

[

2

2

0

]{(3,

[

2

2

0

]

))}

[

2

2

0

]

[

0

0

0

]

{} {}[

1

0

1

]

{}[

2

2

2

]

Page 113: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

❖ Ordering of Messages

❖ Useful Notations

❖ Causal Delivery of Messages

❖ A Causally Ordered Delivery

Protocol❖ The BSS Protocol

❖ The BSS Protocol: An

Illustration❖ Another Causally Ordered

Delivery Protocol❖ When to Deliver a Message?

❖ The SES Protocol

❖ The SES Protocol (Continued)

❖ The SES Protocol: An

Illustration

State of a Distributed System

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 28/44

The SES Protocol: An Illustration

P1

P2

P3

[

2

0

0

][

1

0

0

]

{}[

0

0

0

]

a b

[

2

0

0

]

{}

[

1

0

0

]

{(3,

[

1

0

0

]

)}

c

{(3,

[

1

0

0

]

)}{(3,

[

1

0

0

]

), (2,

[

2

0

0

]

)}

{}

[

0

0

0

]

{(3,

[

1

0

0

]

)}

[

2

1

0

]

[

0

0

0

]

{}[

1

0

1

]

P1

P2

P3

[

2

0

0

][

1

0

0

]

{}[

0

0

0

]

a b

[

2

0

0

]

{}

[

1

0

0

]

{(3,

[

1

0

0

]

)}

dc

{(3,

[

1

0

0

]

)}

g f

{(3,

[

1

0

0

]

), (2,

[

2

0

0

]

)}

{}

[

0

0

0

]

{(3,

[

1

0

0

]

)}{(3,

[

1

0

0

]

)}

[

2

1

0

]

[

2

2

0

]{(3,

[

2

2

0

]

))}

[

2

2

0

]

[

0

0

0

]

{} {}[

1

0

1

]

{}[

2

2

2

]

Page 114: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

❖ Ordering of Messages

❖ Useful Notations

❖ Causal Delivery of Messages

❖ A Causally Ordered Delivery

Protocol❖ The BSS Protocol

❖ The BSS Protocol: An

Illustration❖ Another Causally Ordered

Delivery Protocol❖ When to Deliver a Message?

❖ The SES Protocol

❖ The SES Protocol (Continued)

❖ The SES Protocol: An

Illustration

State of a Distributed System

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 28/44

The SES Protocol: An Illustration

P1

P2

P3

[

2

0

0

][

1

0

0

]

{}[

0

0

0

]

a b

[

2

0

0

]

{}

[

1

0

0

]

{(3,

[

1

0

0

]

)}

dc

{(3,

[

1

0

0

]

)}

e

{(3,

[

1

0

0

]

), (2,

[

2

0

0

]

)}

{}

[

0

0

0

]

{(3,

[

1

0

0

]

)}

[

2

1

0

] {(3,

[

1

0

0

]

)}

{(3,

[

2

2

0

]

))}

[

2

2

0

]

[

2

2

0

]

[

0

0

0

]

{}[

1

0

1

]

P1

P2

P3

[

2

0

0

][

1

0

0

]

{}[

0

0

0

]

a b

[

2

0

0

]

{}

[

1

0

0

]

{(3,

[

1

0

0

]

)}

dc

{(3,

[

1

0

0

]

)}

g f

{(3,

[

1

0

0

]

), (2,

[

2

0

0

]

)}

{}

[

0

0

0

]

{(3,

[

1

0

0

]

)}{(3,

[

1

0

0

]

)}

[

2

1

0

]

[

2

2

0

]{(3,

[

2

2

0

]

))}

[

2

2

0

]

[

0

0

0

]

{} {}[

1

0

1

]

{}[

2

2

2

]

Page 115: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

❖ Ordering of Messages

❖ Useful Notations

❖ Causal Delivery of Messages

❖ A Causally Ordered Delivery

Protocol❖ The BSS Protocol

❖ The BSS Protocol: An

Illustration❖ Another Causally Ordered

Delivery Protocol❖ When to Deliver a Message?

❖ The SES Protocol

❖ The SES Protocol (Continued)

❖ The SES Protocol: An

Illustration

State of a Distributed System

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 28/44

The SES Protocol: An Illustration

P1

P2

P3

[

2

0

0

][

1

0

0

]

{}[

0

0

0

]

a b

[

2

0

0

]

{}

[

1

0

0

]

{(3,

[

1

0

0

]

)}

dc

{(3,

[

1

0

0

]

)}

ge

{(3,

[

1

0

0

]

), (2,

[

2

0

0

]

)}

{}

[

0

0

0

]

{(3,

[

1

0

0

]

)}

[

2

1

0

] {(3,

[

1

0

0

]

)}

{(3,

[

2

2

0

]

))}

[

2

2

0

]

[

2

2

0

]

[

0

0

0

]

{} {}[

1

0

1

]

P1

P2

P3

[

2

0

0

][

1

0

0

]

{}[

0

0

0

]

a b

[

2

0

0

]

{}

[

1

0

0

]

{(3,

[

1

0

0

]

)}

dc

{(3,

[

1

0

0

]

)}

g f

{(3,

[

1

0

0

]

), (2,

[

2

0

0

]

)}

{}

[

0

0

0

]

{(3,

[

1

0

0

]

)}{(3,

[

1

0

0

]

)}

[

2

1

0

]

[

2

2

0

]{(3,

[

2

2

0

]

))}

[

2

2

0

]

[

0

0

0

]

{} {}[

1

0

1

]

{}[

2

2

2

]

Page 116: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

❖ Ordering of Messages

❖ Useful Notations

❖ Causal Delivery of Messages

❖ A Causally Ordered Delivery

Protocol❖ The BSS Protocol

❖ The BSS Protocol: An

Illustration❖ Another Causally Ordered

Delivery Protocol❖ When to Deliver a Message?

❖ The SES Protocol

❖ The SES Protocol (Continued)

❖ The SES Protocol: An

Illustration

State of a Distributed System

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 28/44

The SES Protocol: An Illustration

P1

P2

P3

[

2

0

0

][

1

0

0

]

{}[

0

0

0

]

a b

[

2

0

0

]

{}

[

1

0

0

]

{(3,

[

1

0

0

]

)}

dc

{(3,

[

1

0

0

]

)}

g f

{(3,

[

1

0

0

]

), (2,

[

2

0

0

]

)}

{}

[

0

0

0

]

{(3,

[

1

0

0

]

)}{(3,

[

1

0

0

]

)}

[

2

1

0

]

[

2

2

0

]{(3,

[

2

2

0

]

))}

[

2

2

0

]

[

0

0

0

]

{} {}[

1

0

1

]

{}[

2

2

2

]

Page 117: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

❖ State of a Distributed System

❖ Events and Local States

❖ When is a Global State

Meaningful?❖ Revisiting Happened-Before

Relation❖ A Consistent Global State

❖ Recording a Consistent

Global Snapshot❖ The CL Protocol

❖ The CL Protocol (Continued)

❖ The CL Protocol: An

Illustration❖ The CL Protocol: An

Illustration (Continued)

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 29/44

State of a Distributed System

■ State of a distributed system is a collection of states of allits processes and channels:

◆ a process state is given by the values of all variables onthe process

◆ a channel state is given by the set of messages in transitin the channel

■ can be determined by examining states of the twoprocesses it connects

■ State of a process is called local state or local snapshot

◆ the textbook refers to local state as cut event

◆ cut event is not same as event

■ State of a distributed system is called global state or globalsnapshot

Page 118: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

❖ State of a Distributed System

❖ Events and Local States

❖ When is a Global State

Meaningful?❖ Revisiting Happened-Before

Relation❖ A Consistent Global State

❖ Recording a Consistent

Global Snapshot❖ The CL Protocol

❖ The CL Protocol (Continued)

❖ The CL Protocol: An

Illustration❖ The CL Protocol: An

Illustration (Continued)

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 29/44

State of a Distributed System

■ State of a distributed system is a collection of states of allits processes and channels:

◆ a process state is given by the values of all variables onthe process

◆ a channel state is given by the set of messages in transitin the channel

■ can be determined by examining states of the twoprocesses it connects

■ State of a process is called local state or local snapshot

◆ the textbook refers to local state as cut event

◆ cut event is not same as event

■ State of a distributed system is called global state or globalsnapshot

Page 119: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

❖ State of a Distributed System

❖ Events and Local States

❖ When is a Global State

Meaningful?❖ Revisiting Happened-Before

Relation❖ A Consistent Global State

❖ Recording a Consistent

Global Snapshot❖ The CL Protocol

❖ The CL Protocol (Continued)

❖ The CL Protocol: An

Illustration❖ The CL Protocol: An

Illustration (Continued)

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 29/44

State of a Distributed System

■ State of a distributed system is a collection of states of allits processes and channels:

◆ a process state is given by the values of all variables onthe process

◆ a channel state is given by the set of messages in transitin the channel

■ can be determined by examining states of the twoprocesses it connects

■ State of a process is called local state or local snapshot

◆ the textbook refers to local state as cut event

◆ cut event is not same as event

■ State of a distributed system is called global state or globalsnapshot

Page 120: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

❖ State of a Distributed System

❖ Events and Local States

❖ When is a Global State

Meaningful?❖ Revisiting Happened-Before

Relation❖ A Consistent Global State

❖ Recording a Consistent

Global Snapshot❖ The CL Protocol

❖ The CL Protocol (Continued)

❖ The CL Protocol: An

Illustration❖ The CL Protocol: An

Illustration (Continued)

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 29/44

State of a Distributed System

■ State of a distributed system is a collection of states of allits processes and channels:

◆ a process state is given by the values of all variables onthe process

◆ a channel state is given by the set of messages in transitin the channel

■ can be determined by examining states of the twoprocesses it connects

■ State of a process is called local state or local snapshot

◆ the textbook refers to local state as cut event

◆ cut event is not same as event

■ State of a distributed system is called global state or globalsnapshot

Page 121: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

❖ State of a Distributed System

❖ Events and Local States

❖ When is a Global State

Meaningful?❖ Revisiting Happened-Before

Relation❖ A Consistent Global State

❖ Recording a Consistent

Global Snapshot❖ The CL Protocol

❖ The CL Protocol (Continued)

❖ The CL Protocol: An

Illustration❖ The CL Protocol: An

Illustration (Continued)

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 29/44

State of a Distributed System

■ State of a distributed system is a collection of states of allits processes and channels:

◆ a process state is given by the values of all variables onthe process

◆ a channel state is given by the set of messages in transitin the channel

■ can be determined by examining states of the twoprocesses it connects

■ State of a process is called local state or local snapshot

◆ the textbook refers to local state as cut event

◆ cut event is not same as event

■ State of a distributed system is called global state or globalsnapshot

Page 122: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

❖ State of a Distributed System

❖ Events and Local States

❖ When is a Global State

Meaningful?❖ Revisiting Happened-Before

Relation❖ A Consistent Global State

❖ Recording a Consistent

Global Snapshot❖ The CL Protocol

❖ The CL Protocol (Continued)

❖ The CL Protocol: An

Illustration❖ The CL Protocol: An

Illustration (Continued)

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 29/44

State of a Distributed System

■ State of a distributed system is a collection of states of allits processes and channels:

◆ a process state is given by the values of all variables onthe process

◆ a channel state is given by the set of messages in transitin the channel

■ can be determined by examining states of the twoprocesses it connects

■ State of a process is called local state or local snapshot

◆ the textbook refers to local state as cut event

◆ cut event is not same as event

■ State of a distributed system is called global state or globalsnapshot

Page 123: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

❖ State of a Distributed System

❖ Events and Local States

❖ When is a Global State

Meaningful?❖ Revisiting Happened-Before

Relation❖ A Consistent Global State

❖ Recording a Consistent

Global Snapshot❖ The CL Protocol

❖ The CL Protocol (Continued)

❖ The CL Protocol: An

Illustration❖ The CL Protocol: An

Illustration (Continued)

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 30/44

Events and Local States

■ Processes change their states by executing events

■ Example:

P2

y = 3y = 2y = 1

P1

x = 0 x = 2 x = 3

a b

dc

◆ Process P1 changes its state from x = 0 to x = 2 onexecuting event a

◆ Process P2 changes its state from y = 2 to y = 3 onexecuting event d

Page 124: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

❖ State of a Distributed System

❖ Events and Local States

❖ When is a Global State

Meaningful?❖ Revisiting Happened-Before

Relation❖ A Consistent Global State

❖ Recording a Consistent

Global Snapshot❖ The CL Protocol

❖ The CL Protocol (Continued)

❖ The CL Protocol: An

Illustration❖ The CL Protocol: An

Illustration (Continued)

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 30/44

Events and Local States

■ Processes change their states by executing events

■ Example:

P2

y = 3y = 2y = 1

P1

x = 0 x = 2 x = 3

a b

dc

◆ Process P1 changes its state from x = 0 to x = 2 onexecuting event a

◆ Process P2 changes its state from y = 2 to y = 3 onexecuting event d

Page 125: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

❖ State of a Distributed System

❖ Events and Local States

❖ When is a Global State

Meaningful?❖ Revisiting Happened-Before

Relation❖ A Consistent Global State

❖ Recording a Consistent

Global Snapshot❖ The CL Protocol

❖ The CL Protocol (Continued)

❖ The CL Protocol: An

Illustration❖ The CL Protocol: An

Illustration (Continued)

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 30/44

Events and Local States

■ Processes change their states by executing events

■ Example:

P2

y = 3y = 2y = 1

P1

x = 0 x = 2 x = 3

a b

dc

◆ Process P1 changes its state from x = 0 to x = 2 onexecuting event a

◆ Process P2 changes its state from y = 2 to y = 3 onexecuting event d

Page 126: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

❖ State of a Distributed System

❖ Events and Local States

❖ When is a Global State

Meaningful?❖ Revisiting Happened-Before

Relation❖ A Consistent Global State

❖ Recording a Consistent

Global Snapshot❖ The CL Protocol

❖ The CL Protocol (Continued)

❖ The CL Protocol: An

Illustration❖ The CL Protocol: An

Illustration (Continued)

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 30/44

Events and Local States

■ Processes change their states by executing events

■ Example:

P2

y = 3y = 2y = 1

P1

x = 0 x = 2 x = 3

a b

dc

◆ Process P1 changes its state from x = 0 to x = 2 onexecuting event a

◆ Process P2 changes its state from y = 2 to y = 3 onexecuting event d

Page 127: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

❖ State of a Distributed System

❖ Events and Local States

❖ When is a Global State

Meaningful?❖ Revisiting Happened-Before

Relation❖ A Consistent Global State

❖ Recording a Consistent

Global Snapshot❖ The CL Protocol

❖ The CL Protocol (Continued)

❖ The CL Protocol: An

Illustration❖ The CL Protocol: An

Illustration (Continued)

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 31/44

When is a Global State Meaningful?

■ Example:

P2

y = 3y = 2y = 1

P1

x = 0 x = 2 x = 3

a b

dc

◆ Is it possible for x to be 0 and y to be 3 at the same time?

◆ Does {s, x} form a meaningful global state?

Page 128: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

❖ State of a Distributed System

❖ Events and Local States

❖ When is a Global State

Meaningful?❖ Revisiting Happened-Before

Relation❖ A Consistent Global State

❖ Recording a Consistent

Global Snapshot❖ The CL Protocol

❖ The CL Protocol (Continued)

❖ The CL Protocol: An

Illustration❖ The CL Protocol: An

Illustration (Continued)

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 31/44

When is a Global State Meaningful?

■ Example:

P2

y = 3y = 2y = 1

P1

x = 0 x = 2 x = 3

a b

dc

◆ Is it possible for x to be 0 and y to be 3 at the same time?

◆ Does {s, x} form a meaningful global state?

Page 129: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

❖ State of a Distributed System

❖ Events and Local States

❖ When is a Global State

Meaningful?❖ Revisiting Happened-Before

Relation❖ A Consistent Global State

❖ Recording a Consistent

Global Snapshot❖ The CL Protocol

❖ The CL Protocol (Continued)

❖ The CL Protocol: An

Illustration❖ The CL Protocol: An

Illustration (Continued)

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 31/44

When is a Global State Meaningful?

■ Example:

P2

y = 3y = 2y = 1

P1

a bs t u

dc xwv

x = 0 x = 2 x = 3

◆ Is it possible for x to be 0 and y to be 3 at the same time?

◆ Does {s, x} form a meaningful global state?

Page 130: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

❖ State of a Distributed System

❖ Events and Local States

❖ When is a Global State

Meaningful?❖ Revisiting Happened-Before

Relation❖ A Consistent Global State

❖ Recording a Consistent

Global Snapshot❖ The CL Protocol

❖ The CL Protocol (Continued)

❖ The CL Protocol: An

Illustration❖ The CL Protocol: An

Illustration (Continued)

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 32/44

Revisiting Happened-Before Relation

■ Typically, happened-before relation is defined on events

■ The relation can be extended to local states as follows:

◆ let s be a local state of process Pi

◆ let t be a local state of process Pj

◆ s → t if there exist events e and f such that:1. Pi executed e after s,

2. Pj executed f before t, and

3. e → f

Page 131: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

❖ State of a Distributed System

❖ Events and Local States

❖ When is a Global State

Meaningful?❖ Revisiting Happened-Before

Relation❖ A Consistent Global State

❖ Recording a Consistent

Global Snapshot❖ The CL Protocol

❖ The CL Protocol (Continued)

❖ The CL Protocol: An

Illustration❖ The CL Protocol: An

Illustration (Continued)

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 32/44

Revisiting Happened-Before Relation

■ Typically, happened-before relation is defined on events

■ The relation can be extended to local states as follows:

◆ let s be a local state of process Pi

◆ let t be a local state of process Pj

◆ s → t if there exist events e and f such that:1. Pi executed e after s,

2. Pj executed f before t, and

3. e → f

Page 132: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

❖ State of a Distributed System

❖ Events and Local States

❖ When is a Global State

Meaningful?❖ Revisiting Happened-Before

Relation❖ A Consistent Global State

❖ Recording a Consistent

Global Snapshot❖ The CL Protocol

❖ The CL Protocol (Continued)

❖ The CL Protocol: An

Illustration❖ The CL Protocol: An

Illustration (Continued)

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 32/44

Revisiting Happened-Before Relation

■ Typically, happened-before relation is defined on events

■ The relation can be extended to local states as follows:

◆ let s be a local state of process Pi

◆ let t be a local state of process Pj

◆ s → t if there exist events e and f such that:1. Pi executed e after s,

2. Pj executed f before t, and

3. e → f

Page 133: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

❖ State of a Distributed System

❖ Events and Local States

❖ When is a Global State

Meaningful?❖ Revisiting Happened-Before

Relation❖ A Consistent Global State

❖ Recording a Consistent

Global Snapshot❖ The CL Protocol

❖ The CL Protocol (Continued)

❖ The CL Protocol: An

Illustration❖ The CL Protocol: An

Illustration (Continued)

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 32/44

Revisiting Happened-Before Relation

■ Typically, happened-before relation is defined on events

■ The relation can be extended to local states as follows:

◆ let s be a local state of process Pi

◆ let t be a local state of process Pj

◆ s → t if there exist events e and f such that:1. Pi executed e after s,

2. Pj executed f before t, and

3. e → f

Page 134: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

❖ State of a Distributed System

❖ Events and Local States

❖ When is a Global State

Meaningful?❖ Revisiting Happened-Before

Relation❖ A Consistent Global State

❖ Recording a Consistent

Global Snapshot❖ The CL Protocol

❖ The CL Protocol (Continued)

❖ The CL Protocol: An

Illustration❖ The CL Protocol: An

Illustration (Continued)

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 32/44

Revisiting Happened-Before Relation

■ Typically, happened-before relation is defined on events

■ The relation can be extended to local states as follows:

◆ let s be a local state of process Pi

◆ let t be a local state of process Pj

◆ s → t if there exist events e and f such that:

1. Pi executed e after s,

2. Pj executed f before t, and

3. e → f

Page 135: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

❖ State of a Distributed System

❖ Events and Local States

❖ When is a Global State

Meaningful?❖ Revisiting Happened-Before

Relation❖ A Consistent Global State

❖ Recording a Consistent

Global Snapshot❖ The CL Protocol

❖ The CL Protocol (Continued)

❖ The CL Protocol: An

Illustration❖ The CL Protocol: An

Illustration (Continued)

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 32/44

Revisiting Happened-Before Relation

■ Typically, happened-before relation is defined on events

■ The relation can be extended to local states as follows:

◆ let s be a local state of process Pi

◆ let t be a local state of process Pj

◆ s → t if there exist events e and f such that:1. Pi executed e after s,

2. Pj executed f before t, and

3. e → f

Page 136: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

❖ State of a Distributed System

❖ Events and Local States

❖ When is a Global State

Meaningful?❖ Revisiting Happened-Before

Relation❖ A Consistent Global State

❖ Recording a Consistent

Global Snapshot❖ The CL Protocol

❖ The CL Protocol (Continued)

❖ The CL Protocol: An

Illustration❖ The CL Protocol: An

Illustration (Continued)

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 32/44

Revisiting Happened-Before Relation

■ Typically, happened-before relation is defined on events

■ The relation can be extended to local states as follows:

◆ let s be a local state of process Pi

◆ let t be a local state of process Pj

◆ s → t if there exist events e and f such that:1. Pi executed e after s,

2. Pj executed f before t, and

3. e → f

Page 137: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

❖ State of a Distributed System

❖ Events and Local States

❖ When is a Global State

Meaningful?❖ Revisiting Happened-Before

Relation❖ A Consistent Global State

❖ Recording a Consistent

Global Snapshot❖ The CL Protocol

❖ The CL Protocol (Continued)

❖ The CL Protocol: An

Illustration❖ The CL Protocol: An

Illustration (Continued)

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 32/44

Revisiting Happened-Before Relation

■ Typically, happened-before relation is defined on events

■ The relation can be extended to local states as follows:

◆ let s be a local state of process Pi

◆ let t be a local state of process Pj

◆ s → t if there exist events e and f such that:1. Pi executed e after s,

2. Pj executed f before t, and

3. e → f

Page 138: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

❖ State of a Distributed System

❖ Events and Local States

❖ When is a Global State

Meaningful?❖ Revisiting Happened-Before

Relation❖ A Consistent Global State

❖ Recording a Consistent

Global Snapshot❖ The CL Protocol

❖ The CL Protocol (Continued)

❖ The CL Protocol: An

Illustration❖ The CL Protocol: An

Illustration (Continued)

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 33/44

A Consistent Global State

■ For a global state G, let G[i] refer to the local state ofprocess Pi in G

■ A global state G is meaningful or consistent if

∀i, j : i 6= j : G[i] ‖ G[j]

Page 139: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

❖ State of a Distributed System

❖ Events and Local States

❖ When is a Global State

Meaningful?❖ Revisiting Happened-Before

Relation❖ A Consistent Global State

❖ Recording a Consistent

Global Snapshot❖ The CL Protocol

❖ The CL Protocol (Continued)

❖ The CL Protocol: An

Illustration❖ The CL Protocol: An

Illustration (Continued)

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 33/44

A Consistent Global State

■ For a global state G, let G[i] refer to the local state ofprocess Pi in G

■ A global state G is meaningful or consistent if

∀i, j : i 6= j : (G[i] 9 G[j]) ∧ (G[j] 9 G[i])

∀i, j : i 6= j : G[i] ‖ G[j]

Page 140: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

❖ State of a Distributed System

❖ Events and Local States

❖ When is a Global State

Meaningful?❖ Revisiting Happened-Before

Relation❖ A Consistent Global State

❖ Recording a Consistent

Global Snapshot❖ The CL Protocol

❖ The CL Protocol (Continued)

❖ The CL Protocol: An

Illustration❖ The CL Protocol: An

Illustration (Continued)

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 33/44

A Consistent Global State

■ For a global state G, let G[i] refer to the local state ofprocess Pi in G

■ A global state G is meaningful or consistent if

∀i, j : i 6= j : G[i] ‖ G[j]

Page 141: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

❖ State of a Distributed System

❖ Events and Local States

❖ When is a Global State

Meaningful?❖ Revisiting Happened-Before

Relation❖ A Consistent Global State

❖ Recording a Consistent

Global Snapshot❖ The CL Protocol

❖ The CL Protocol (Continued)

❖ The CL Protocol: An

Illustration❖ The CL Protocol: An

Illustration (Continued)

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 34/44

Recording a Consistent Global Snapshot

■ Proposed by Chandy and Lamport (CL)

■ Assumptions and Features:

◆ channels satisfy first-in-first-out (FIFO) property◆ channels are not required to be bidirectional◆ communication topology may not be fully connected

■ Messages exchanged by the underlying computation(whose snapshot is being recorded) are called applicationmessages

■ Messages exchanged by the snapshot algorithm are calledcontrol messages

Page 142: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

❖ State of a Distributed System

❖ Events and Local States

❖ When is a Global State

Meaningful?❖ Revisiting Happened-Before

Relation❖ A Consistent Global State

❖ Recording a Consistent

Global Snapshot❖ The CL Protocol

❖ The CL Protocol (Continued)

❖ The CL Protocol: An

Illustration❖ The CL Protocol: An

Illustration (Continued)

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 34/44

Recording a Consistent Global Snapshot

■ Proposed by Chandy and Lamport (CL)

■ Assumptions and Features:

◆ channels satisfy first-in-first-out (FIFO) property

◆ channels are not required to be bidirectional◆ communication topology may not be fully connected

■ Messages exchanged by the underlying computation(whose snapshot is being recorded) are called applicationmessages

■ Messages exchanged by the snapshot algorithm are calledcontrol messages

Page 143: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

❖ State of a Distributed System

❖ Events and Local States

❖ When is a Global State

Meaningful?❖ Revisiting Happened-Before

Relation❖ A Consistent Global State

❖ Recording a Consistent

Global Snapshot❖ The CL Protocol

❖ The CL Protocol (Continued)

❖ The CL Protocol: An

Illustration❖ The CL Protocol: An

Illustration (Continued)

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 34/44

Recording a Consistent Global Snapshot

■ Proposed by Chandy and Lamport (CL)

■ Assumptions and Features:

◆ channels satisfy first-in-first-out (FIFO) property◆ channels are not required to be bidirectional

◆ communication topology may not be fully connected

■ Messages exchanged by the underlying computation(whose snapshot is being recorded) are called applicationmessages

■ Messages exchanged by the snapshot algorithm are calledcontrol messages

Page 144: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

❖ State of a Distributed System

❖ Events and Local States

❖ When is a Global State

Meaningful?❖ Revisiting Happened-Before

Relation❖ A Consistent Global State

❖ Recording a Consistent

Global Snapshot❖ The CL Protocol

❖ The CL Protocol (Continued)

❖ The CL Protocol: An

Illustration❖ The CL Protocol: An

Illustration (Continued)

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 34/44

Recording a Consistent Global Snapshot

■ Proposed by Chandy and Lamport (CL)

■ Assumptions and Features:

◆ channels satisfy first-in-first-out (FIFO) property◆ channels are not required to be bidirectional◆ communication topology may not be fully connected

■ Messages exchanged by the underlying computation(whose snapshot is being recorded) are called applicationmessages

■ Messages exchanged by the snapshot algorithm are calledcontrol messages

Page 145: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

❖ State of a Distributed System

❖ Events and Local States

❖ When is a Global State

Meaningful?❖ Revisiting Happened-Before

Relation❖ A Consistent Global State

❖ Recording a Consistent

Global Snapshot❖ The CL Protocol

❖ The CL Protocol (Continued)

❖ The CL Protocol: An

Illustration❖ The CL Protocol: An

Illustration (Continued)

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 34/44

Recording a Consistent Global Snapshot

■ Proposed by Chandy and Lamport (CL)

■ Assumptions and Features:

◆ channels satisfy first-in-first-out (FIFO) property◆ channels are not required to be bidirectional◆ communication topology may not be fully connected

■ Messages exchanged by the underlying computation(whose snapshot is being recorded) are called applicationmessages

■ Messages exchanged by the snapshot algorithm are calledcontrol messages

Page 146: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

❖ State of a Distributed System

❖ Events and Local States

❖ When is a Global State

Meaningful?❖ Revisiting Happened-Before

Relation❖ A Consistent Global State

❖ Recording a Consistent

Global Snapshot❖ The CL Protocol

❖ The CL Protocol (Continued)

❖ The CL Protocol: An

Illustration❖ The CL Protocol: An

Illustration (Continued)

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 34/44

Recording a Consistent Global Snapshot

■ Proposed by Chandy and Lamport (CL)

■ Assumptions and Features:

◆ channels satisfy first-in-first-out (FIFO) property◆ channels are not required to be bidirectional◆ communication topology may not be fully connected

■ Messages exchanged by the underlying computation(whose snapshot is being recorded) are called applicationmessages

■ Messages exchanged by the snapshot algorithm are calledcontrol messages

Page 147: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

❖ State of a Distributed System

❖ Events and Local States

❖ When is a Global State

Meaningful?❖ Revisiting Happened-Before

Relation❖ A Consistent Global State

❖ Recording a Consistent

Global Snapshot❖ The CL Protocol

❖ The CL Protocol (Continued)

❖ The CL Protocol: An

Illustration❖ The CL Protocol: An

Illustration (Continued)

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 35/44

The CL Protocol

■ Initially: all processes are colored blue

■ Eventually: all processes become red

■ On changing color from blue to red:record local snapshotsend a marker message along all outgoing channels

■ On receiving marker message along incoming channel C:if color is blue then

change color from blue to redendifrecord state of channel C as application messages

received along C since turning red

■ Any process can initiate the snapshot protocol byspontaneously changing its color from blue to red◆ there can be multiple initiators of the snapshot protocol

Page 148: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

❖ State of a Distributed System

❖ Events and Local States

❖ When is a Global State

Meaningful?❖ Revisiting Happened-Before

Relation❖ A Consistent Global State

❖ Recording a Consistent

Global Snapshot❖ The CL Protocol

❖ The CL Protocol (Continued)

❖ The CL Protocol: An

Illustration❖ The CL Protocol: An

Illustration (Continued)

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 35/44

The CL Protocol

■ Initially: all processes are colored blue

■ Eventually: all processes become red

■ On changing color from blue to red:record local snapshotsend a marker message along all outgoing channels

■ On receiving marker message along incoming channel C:if color is blue then

change color from blue to redendifrecord state of channel C as application messages

received along C since turning red

■ Any process can initiate the snapshot protocol byspontaneously changing its color from blue to red◆ there can be multiple initiators of the snapshot protocol

Page 149: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

❖ State of a Distributed System

❖ Events and Local States

❖ When is a Global State

Meaningful?❖ Revisiting Happened-Before

Relation❖ A Consistent Global State

❖ Recording a Consistent

Global Snapshot❖ The CL Protocol

❖ The CL Protocol (Continued)

❖ The CL Protocol: An

Illustration❖ The CL Protocol: An

Illustration (Continued)

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 35/44

The CL Protocol

■ Initially: all processes are colored blue

■ Eventually: all processes become red

■ On changing color from blue to red:record local snapshotsend a marker message along all outgoing channels

■ On receiving marker message along incoming channel C:if color is blue then

change color from blue to redendifrecord state of channel C as application messages

received along C since turning red

■ Any process can initiate the snapshot protocol byspontaneously changing its color from blue to red◆ there can be multiple initiators of the snapshot protocol

Page 150: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

❖ State of a Distributed System

❖ Events and Local States

❖ When is a Global State

Meaningful?❖ Revisiting Happened-Before

Relation❖ A Consistent Global State

❖ Recording a Consistent

Global Snapshot❖ The CL Protocol

❖ The CL Protocol (Continued)

❖ The CL Protocol: An

Illustration❖ The CL Protocol: An

Illustration (Continued)

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 35/44

The CL Protocol

■ Initially: all processes are colored blue

■ Eventually: all processes become red

■ On changing color from blue to red:record local snapshotsend a marker message along all outgoing channels

■ On receiving marker message along incoming channel C:if color is blue then

change color from blue to redendifrecord state of channel C as application messages

received along C since turning red

■ Any process can initiate the snapshot protocol byspontaneously changing its color from blue to red◆ there can be multiple initiators of the snapshot protocol

Page 151: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

❖ State of a Distributed System

❖ Events and Local States

❖ When is a Global State

Meaningful?❖ Revisiting Happened-Before

Relation❖ A Consistent Global State

❖ Recording a Consistent

Global Snapshot❖ The CL Protocol

❖ The CL Protocol (Continued)

❖ The CL Protocol: An

Illustration❖ The CL Protocol: An

Illustration (Continued)

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 35/44

The CL Protocol

■ Initially: all processes are colored blue

■ Eventually: all processes become red

■ On changing color from blue to red:record local snapshotsend a marker message along all outgoing channels

■ On receiving marker message along incoming channel C:if color is blue then

change color from blue to redendifrecord state of channel C as application messages

received along C since turning red

■ Any process can initiate the snapshot protocol byspontaneously changing its color from blue to red

◆ there can be multiple initiators of the snapshot protocol

Page 152: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

❖ State of a Distributed System

❖ Events and Local States

❖ When is a Global State

Meaningful?❖ Revisiting Happened-Before

Relation❖ A Consistent Global State

❖ Recording a Consistent

Global Snapshot❖ The CL Protocol

❖ The CL Protocol (Continued)

❖ The CL Protocol: An

Illustration❖ The CL Protocol: An

Illustration (Continued)

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 35/44

The CL Protocol

■ Initially: all processes are colored blue

■ Eventually: all processes become red

■ On changing color from blue to red:record local snapshotsend a marker message along all outgoing channels

■ On receiving marker message along incoming channel C:if color is blue then

change color from blue to redendifrecord state of channel C as application messages

received along C since turning red

■ Any process can initiate the snapshot protocol byspontaneously changing its color from blue to red◆ there can be multiple initiators of the snapshot protocol

Page 153: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

❖ State of a Distributed System

❖ Events and Local States

❖ When is a Global State

Meaningful?❖ Revisiting Happened-Before

Relation❖ A Consistent Global State

❖ Recording a Consistent

Global Snapshot❖ The CL Protocol

❖ The CL Protocol (Continued)

❖ The CL Protocol: An

Illustration❖ The CL Protocol: An

Illustration (Continued)

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 36/44

The CL Protocol (Continued)

■ Global Snapshot: local snapshots of processes just afterthey turn red

■ In-Transit Messages: blue application messages receivedby processes after they have turned red

■ Why is the global snapshot consistent?◆ Assume an application message has the same color as

its sender◆ Can a blue process receive a red application message?

Page 154: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

❖ State of a Distributed System

❖ Events and Local States

❖ When is a Global State

Meaningful?❖ Revisiting Happened-Before

Relation❖ A Consistent Global State

❖ Recording a Consistent

Global Snapshot❖ The CL Protocol

❖ The CL Protocol (Continued)

❖ The CL Protocol: An

Illustration❖ The CL Protocol: An

Illustration (Continued)

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 36/44

The CL Protocol (Continued)

■ Global Snapshot: local snapshots of processes just afterthey turn red

■ In-Transit Messages: blue application messages receivedby processes after they have turned red

■ Why is the global snapshot consistent?◆ Assume an application message has the same color as

its sender◆ Can a blue process receive a red application message?

Page 155: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

❖ State of a Distributed System

❖ Events and Local States

❖ When is a Global State

Meaningful?❖ Revisiting Happened-Before

Relation❖ A Consistent Global State

❖ Recording a Consistent

Global Snapshot❖ The CL Protocol

❖ The CL Protocol (Continued)

❖ The CL Protocol: An

Illustration❖ The CL Protocol: An

Illustration (Continued)

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 36/44

The CL Protocol (Continued)

■ Global Snapshot: local snapshots of processes just afterthey turn red

■ In-Transit Messages: blue application messages receivedby processes after they have turned red

■ Why is the global snapshot consistent?

◆ Assume an application message has the same color asits sender

◆ Can a blue process receive a red application message?

Page 156: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

❖ State of a Distributed System

❖ Events and Local States

❖ When is a Global State

Meaningful?❖ Revisiting Happened-Before

Relation❖ A Consistent Global State

❖ Recording a Consistent

Global Snapshot❖ The CL Protocol

❖ The CL Protocol (Continued)

❖ The CL Protocol: An

Illustration❖ The CL Protocol: An

Illustration (Continued)

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 36/44

The CL Protocol (Continued)

■ Global Snapshot: local snapshots of processes just afterthey turn red

■ In-Transit Messages: blue application messages receivedby processes after they have turned red

■ Why is the global snapshot consistent?◆ Assume an application message has the same color as

its sender

◆ Can a blue process receive a red application message?

Page 157: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

❖ State of a Distributed System

❖ Events and Local States

❖ When is a Global State

Meaningful?❖ Revisiting Happened-Before

Relation❖ A Consistent Global State

❖ Recording a Consistent

Global Snapshot❖ The CL Protocol

❖ The CL Protocol (Continued)

❖ The CL Protocol: An

Illustration❖ The CL Protocol: An

Illustration (Continued)

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 36/44

The CL Protocol (Continued)

■ Global Snapshot: local snapshots of processes just afterthey turn red

■ In-Transit Messages: blue application messages receivedby processes after they have turned red

■ Why is the global snapshot consistent?◆ Assume an application message has the same color as

its sender◆ Can a blue process receive a red application message?

Page 158: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

❖ State of a Distributed System

❖ Events and Local States

❖ When is a Global State

Meaningful?❖ Revisiting Happened-Before

Relation❖ A Consistent Global State

❖ Recording a Consistent

Global Snapshot❖ The CL Protocol

❖ The CL Protocol (Continued)

❖ The CL Protocol: An

Illustration❖ The CL Protocol: An

Illustration (Continued)

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 37/44

The CL Protocol: An Illustration

■ Three processes: P1, P2 and P3

■ Five channels: C1,2, C1,3, C2,1, C2,3 and C3,1

P1

P2P3

C2,3

C1,2

C2,1

C1,3

C3,1

Page 159: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

❖ State of a Distributed System

❖ Events and Local States

❖ When is a Global State

Meaningful?❖ Revisiting Happened-Before

Relation❖ A Consistent Global State

❖ Recording a Consistent

Global Snapshot❖ The CL Protocol

❖ The CL Protocol (Continued)

❖ The CL Protocol: An

Illustration❖ The CL Protocol: An

Illustration (Continued)

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 38/44

The CL Protocol: An Illustration (Continued)

m3

m1

m4

m5

m2

P1

P2

P3

1. All processes are blue

m3

m1

m4

m5

m2

P1

P2

P3

1. P1 receives the marker message along C3,1

2. P1 records the state of C3,1 as {m2, m3}

Page 160: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

❖ State of a Distributed System

❖ Events and Local States

❖ When is a Global State

Meaningful?❖ Revisiting Happened-Before

Relation❖ A Consistent Global State

❖ Recording a Consistent

Global Snapshot❖ The CL Protocol

❖ The CL Protocol (Continued)

❖ The CL Protocol: An

Illustration❖ The CL Protocol: An

Illustration (Continued)

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 38/44

The CL Protocol: An Illustration (Continued)

m3

m1

m4

m5

m2

P1

P2

P3

1. P1 turns red2. P1 sends a marker message along C1,2 and C1,3

m3

m1

m4

m5

m2

P1

P2

P3

1. P1 receives the marker message along C3,1

2. P1 records the state of C3,1 as {m2, m3}

Page 161: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

❖ State of a Distributed System

❖ Events and Local States

❖ When is a Global State

Meaningful?❖ Revisiting Happened-Before

Relation❖ A Consistent Global State

❖ Recording a Consistent

Global Snapshot❖ The CL Protocol

❖ The CL Protocol (Continued)

❖ The CL Protocol: An

Illustration❖ The CL Protocol: An

Illustration (Continued)

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 38/44

The CL Protocol: An Illustration (Continued)

m3

m1

m4

m5

m2

P1

P2

P3

1. P2 receives the marker message along C1,2 and turns red2. P2 sends a marker message along C2,1 and C2,3

3. P2 records the state of C1,2 as ∅

m3

m1

m4

m5

m2

P1

P2

P3

1. P1 receives the marker message along C3,1

2. P1 records the state of C3,1 as {m2, m3}

Page 162: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

❖ State of a Distributed System

❖ Events and Local States

❖ When is a Global State

Meaningful?❖ Revisiting Happened-Before

Relation❖ A Consistent Global State

❖ Recording a Consistent

Global Snapshot❖ The CL Protocol

❖ The CL Protocol (Continued)

❖ The CL Protocol: An

Illustration❖ The CL Protocol: An

Illustration (Continued)

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 38/44

The CL Protocol: An Illustration (Continued)

m3

m1

m4

m5

m2

P1

P2

P3

1. P3 receives the marker message along C1,3 and turns red2. P3 sends a marker message along C3,1

3. P3 records the state of C1,3 as ∅

m3

m1

m4

m5

m2

P1

P2

P3

1. P1 receives the marker message along C3,1

2. P1 records the state of C3,1 as {m2, m3}

Page 163: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

❖ State of a Distributed System

❖ Events and Local States

❖ When is a Global State

Meaningful?❖ Revisiting Happened-Before

Relation❖ A Consistent Global State

❖ Recording a Consistent

Global Snapshot❖ The CL Protocol

❖ The CL Protocol (Continued)

❖ The CL Protocol: An

Illustration❖ The CL Protocol: An

Illustration (Continued)

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 38/44

The CL Protocol: An Illustration (Continued)

m3

m1

m4

m5

m2

P1

P2

P3

1. P1 receives the marker message along C2,1

2. P1 records the state of C2,1 as {m4, m5}

m3

m1

m4

m5

m2

P1

P2

P3

1. P1 receives the marker message along C3,1

2. P1 records the state of C3,1 as {m2, m3}

Page 164: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

❖ State of a Distributed System

❖ Events and Local States

❖ When is a Global State

Meaningful?❖ Revisiting Happened-Before

Relation❖ A Consistent Global State

❖ Recording a Consistent

Global Snapshot❖ The CL Protocol

❖ The CL Protocol (Continued)

❖ The CL Protocol: An

Illustration❖ The CL Protocol: An

Illustration (Continued)

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 38/44

The CL Protocol: An Illustration (Continued)

m3

m1

m4

m5

m2

P1

P2

P3

1. P3 receives the marker message along C2,3

2. P3 records the state of C2,3 as {m1}

m3

m1

m4

m5

m2

P1

P2

P3

1. P1 receives the marker message along C3,1

2. P1 records the state of C3,1 as {m2, m3}

Page 165: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

❖ State of a Distributed System

❖ Events and Local States

❖ When is a Global State

Meaningful?❖ Revisiting Happened-Before

Relation❖ A Consistent Global State

❖ Recording a Consistent

Global Snapshot❖ The CL Protocol

❖ The CL Protocol (Continued)

❖ The CL Protocol: An

Illustration❖ The CL Protocol: An

Illustration (Continued)

Monitoring a Distributed

System

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 38/44

The CL Protocol: An Illustration (Continued)

m3

m1

m4

m5

m2

P1

P2

P3

1. P1 receives the marker message along C3,1

2. P1 records the state of C3,1 as {m2, m3}

Page 166: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

❖ A Subclass of Distributed

Computation❖ Distributed Computation: An

Illustration❖ Termination Detection

❖ Huang’s Algorithm

❖ Huang’s Algorithm

(Continued)❖ Huang’s Algorithm: An

Illustration

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 39/44

A Subclass of Distributed Computation

■ Many distributed computations obey the followingparadigm:

◆ A process is either in active state or passive state◆ A process can send an application message only when

it is active◆ An active process can become passive at any time◆ A passive process, on receiving an application

message, becomes active

■ Intuitively:

◆ if a process is active, then it is doing some work◆ if process is passive, then it is idle◆ an active process uses an application message to send

a part of its work to another process

Page 167: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

❖ A Subclass of Distributed

Computation❖ Distributed Computation: An

Illustration❖ Termination Detection

❖ Huang’s Algorithm

❖ Huang’s Algorithm

(Continued)❖ Huang’s Algorithm: An

Illustration

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 39/44

A Subclass of Distributed Computation

■ Many distributed computations obey the followingparadigm:

◆ A process is either in active state or passive state

◆ A process can send an application message only whenit is active

◆ An active process can become passive at any time◆ A passive process, on receiving an application

message, becomes active

■ Intuitively:

◆ if a process is active, then it is doing some work◆ if process is passive, then it is idle◆ an active process uses an application message to send

a part of its work to another process

Page 168: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

❖ A Subclass of Distributed

Computation❖ Distributed Computation: An

Illustration❖ Termination Detection

❖ Huang’s Algorithm

❖ Huang’s Algorithm

(Continued)❖ Huang’s Algorithm: An

Illustration

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 39/44

A Subclass of Distributed Computation

■ Many distributed computations obey the followingparadigm:

◆ A process is either in active state or passive state◆ A process can send an application message only when

it is active

◆ An active process can become passive at any time◆ A passive process, on receiving an application

message, becomes active

■ Intuitively:

◆ if a process is active, then it is doing some work◆ if process is passive, then it is idle◆ an active process uses an application message to send

a part of its work to another process

Page 169: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

❖ A Subclass of Distributed

Computation❖ Distributed Computation: An

Illustration❖ Termination Detection

❖ Huang’s Algorithm

❖ Huang’s Algorithm

(Continued)❖ Huang’s Algorithm: An

Illustration

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 39/44

A Subclass of Distributed Computation

■ Many distributed computations obey the followingparadigm:

◆ A process is either in active state or passive state◆ A process can send an application message only when

it is active◆ An active process can become passive at any time

◆ A passive process, on receiving an applicationmessage, becomes active

■ Intuitively:

◆ if a process is active, then it is doing some work◆ if process is passive, then it is idle◆ an active process uses an application message to send

a part of its work to another process

Page 170: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

❖ A Subclass of Distributed

Computation❖ Distributed Computation: An

Illustration❖ Termination Detection

❖ Huang’s Algorithm

❖ Huang’s Algorithm

(Continued)❖ Huang’s Algorithm: An

Illustration

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 39/44

A Subclass of Distributed Computation

■ Many distributed computations obey the followingparadigm:

◆ A process is either in active state or passive state◆ A process can send an application message only when

it is active◆ An active process can become passive at any time◆ A passive process, on receiving an application

message, becomes active

■ Intuitively:

◆ if a process is active, then it is doing some work◆ if process is passive, then it is idle◆ an active process uses an application message to send

a part of its work to another process

Page 171: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

❖ A Subclass of Distributed

Computation❖ Distributed Computation: An

Illustration❖ Termination Detection

❖ Huang’s Algorithm

❖ Huang’s Algorithm

(Continued)❖ Huang’s Algorithm: An

Illustration

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 39/44

A Subclass of Distributed Computation

■ Many distributed computations obey the followingparadigm:

◆ A process is either in active state or passive state◆ A process can send an application message only when

it is active◆ An active process can become passive at any time◆ A passive process, on receiving an application

message, becomes active

■ Intuitively:

◆ if a process is active, then it is doing some work◆ if process is passive, then it is idle◆ an active process uses an application message to send

a part of its work to another process

Page 172: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

❖ A Subclass of Distributed

Computation❖ Distributed Computation: An

Illustration❖ Termination Detection

❖ Huang’s Algorithm

❖ Huang’s Algorithm

(Continued)❖ Huang’s Algorithm: An

Illustration

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 39/44

A Subclass of Distributed Computation

■ Many distributed computations obey the followingparadigm:

◆ A process is either in active state or passive state◆ A process can send an application message only when

it is active◆ An active process can become passive at any time◆ A passive process, on receiving an application

message, becomes active

■ Intuitively:

◆ if a process is active, then it is doing some work

◆ if process is passive, then it is idle◆ an active process uses an application message to send

a part of its work to another process

Page 173: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

❖ A Subclass of Distributed

Computation❖ Distributed Computation: An

Illustration❖ Termination Detection

❖ Huang’s Algorithm

❖ Huang’s Algorithm

(Continued)❖ Huang’s Algorithm: An

Illustration

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 39/44

A Subclass of Distributed Computation

■ Many distributed computations obey the followingparadigm:

◆ A process is either in active state or passive state◆ A process can send an application message only when

it is active◆ An active process can become passive at any time◆ A passive process, on receiving an application

message, becomes active

■ Intuitively:

◆ if a process is active, then it is doing some work◆ if process is passive, then it is idle

◆ an active process uses an application message to senda part of its work to another process

Page 174: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

❖ A Subclass of Distributed

Computation❖ Distributed Computation: An

Illustration❖ Termination Detection

❖ Huang’s Algorithm

❖ Huang’s Algorithm

(Continued)❖ Huang’s Algorithm: An

Illustration

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 39/44

A Subclass of Distributed Computation

■ Many distributed computations obey the followingparadigm:

◆ A process is either in active state or passive state◆ A process can send an application message only when

it is active◆ An active process can become passive at any time◆ A passive process, on receiving an application

message, becomes active

■ Intuitively:

◆ if a process is active, then it is doing some work◆ if process is passive, then it is idle◆ an active process uses an application message to send

a part of its work to another process

Page 175: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

❖ A Subclass of Distributed

Computation❖ Distributed Computation: An

Illustration❖ Termination Detection

❖ Huang’s Algorithm

❖ Huang’s Algorithm

(Continued)❖ Huang’s Algorithm: An

Illustration

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 40/44

Distributed Computation: An Illustration

�����

P2

P3

P1

P2

P3

P1

m1

m2

m3

m4

Page 176: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

❖ A Subclass of Distributed

Computation❖ Distributed Computation: An

Illustration❖ Termination Detection

❖ Huang’s Algorithm

❖ Huang’s Algorithm

(Continued)❖ Huang’s Algorithm: An

Illustration

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 40/44

Distributed Computation: An Illustration

�����

P2

P3

P1

m1

P2

P3

P1

m1

m2

m3

m4

Page 177: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

❖ A Subclass of Distributed

Computation❖ Distributed Computation: An

Illustration❖ Termination Detection

❖ Huang’s Algorithm

❖ Huang’s Algorithm

(Continued)❖ Huang’s Algorithm: An

Illustration

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 40/44

Distributed Computation: An Illustration

�����

�����

P2

P3

P1

m1

P2

P3

P1

m1

m2

m3

m4

Page 178: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

❖ A Subclass of Distributed

Computation❖ Distributed Computation: An

Illustration❖ Termination Detection

❖ Huang’s Algorithm

❖ Huang’s Algorithm

(Continued)❖ Huang’s Algorithm: An

Illustration

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 40/44

Distributed Computation: An Illustration

�����

�����

P2

P3

P1

m1

m2

P2

P3

P1

m1

m2

m3

m4

Page 179: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

❖ A Subclass of Distributed

Computation❖ Distributed Computation: An

Illustration❖ Termination Detection

❖ Huang’s Algorithm

❖ Huang’s Algorithm

(Continued)❖ Huang’s Algorithm: An

Illustration

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 40/44

Distributed Computation: An Illustration

�����

�����

����������

P2

P3

P1

m1

m2

P2

P3

P1

m1

m2

m3

m4

Page 180: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

❖ A Subclass of Distributed

Computation❖ Distributed Computation: An

Illustration❖ Termination Detection

❖ Huang’s Algorithm

❖ Huang’s Algorithm

(Continued)❖ Huang’s Algorithm: An

Illustration

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 40/44

Distributed Computation: An Illustration

�����

�����

����������

P2

P3

P1

m1

m2

m3

P2

P3

P1

m1

m2

m3

m4

Page 181: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

❖ A Subclass of Distributed

Computation❖ Distributed Computation: An

Illustration❖ Termination Detection

❖ Huang’s Algorithm

❖ Huang’s Algorithm

(Continued)❖ Huang’s Algorithm: An

Illustration

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 40/44

Distributed Computation: An Illustration

�����

�����

����������

P2

P3

P1

m1

m2

m3

m4

P2

P3

P1

m1

m2

m3

m4

Page 182: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

❖ A Subclass of Distributed

Computation❖ Distributed Computation: An

Illustration❖ Termination Detection

❖ Huang’s Algorithm

❖ Huang’s Algorithm

(Continued)❖ Huang’s Algorithm: An

Illustration

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 40/44

Distributed Computation: An Illustration

�����

�����

����� ������

P2

P3

P1

m1

m2

m3

m4

P2

P3

P1

m1

m2

m3

m4

Page 183: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

❖ A Subclass of Distributed

Computation❖ Distributed Computation: An

Illustration❖ Termination Detection

❖ Huang’s Algorithm

❖ Huang’s Algorithm

(Continued)❖ Huang’s Algorithm: An

Illustration

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 40/44

Distributed Computation: An Illustration

�����

����� �����

����� ������

���

P2

P3

P1

m1

m2

m3

m4

P2

P3

P1

m1

m2

m3

m4

Page 184: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

❖ A Subclass of Distributed

Computation❖ Distributed Computation: An

Illustration❖ Termination Detection

❖ Huang’s Algorithm

❖ Huang’s Algorithm

(Continued)❖ Huang’s Algorithm: An

Illustration

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 40/44

Distributed Computation: An Illustration

�����

����� �����

����� � �����

���

�����

P2

P3

P1

m1

m2

m3

m4

Page 185: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

❖ A Subclass of Distributed

Computation❖ Distributed Computation: An

Illustration❖ Termination Detection

❖ Huang’s Algorithm

❖ Huang’s Algorithm

(Continued)❖ Huang’s Algorithm: An

Illustration

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 41/44

Termination Detection

■ To detect if the computation has finished doing all the work

◆ all processes have become passive, and◆ all channels have become empty

■ Different types of computations:

◆ diffusing: only one process is active in the beginning◆ non-diffusing: any subset of processes can be active in

the beginning■ no process knows which processes are active and

which processes are passive

Page 186: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

❖ A Subclass of Distributed

Computation❖ Distributed Computation: An

Illustration❖ Termination Detection

❖ Huang’s Algorithm

❖ Huang’s Algorithm

(Continued)❖ Huang’s Algorithm: An

Illustration

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 41/44

Termination Detection

■ To detect if the computation has finished doing all the work

◆ all processes have become passive, and

◆ all channels have become empty

■ Different types of computations:

◆ diffusing: only one process is active in the beginning◆ non-diffusing: any subset of processes can be active in

the beginning■ no process knows which processes are active and

which processes are passive

Page 187: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

❖ A Subclass of Distributed

Computation❖ Distributed Computation: An

Illustration❖ Termination Detection

❖ Huang’s Algorithm

❖ Huang’s Algorithm

(Continued)❖ Huang’s Algorithm: An

Illustration

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 41/44

Termination Detection

■ To detect if the computation has finished doing all the work

◆ all processes have become passive, and◆ all channels have become empty

■ Different types of computations:

◆ diffusing: only one process is active in the beginning◆ non-diffusing: any subset of processes can be active in

the beginning■ no process knows which processes are active and

which processes are passive

Page 188: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

❖ A Subclass of Distributed

Computation❖ Distributed Computation: An

Illustration❖ Termination Detection

❖ Huang’s Algorithm

❖ Huang’s Algorithm

(Continued)❖ Huang’s Algorithm: An

Illustration

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 41/44

Termination Detection

■ To detect if the computation has finished doing all the work

◆ all processes have become passive, and◆ all channels have become empty

■ Different types of computations:

◆ diffusing: only one process is active in the beginning◆ non-diffusing: any subset of processes can be active in

the beginning■ no process knows which processes are active and

which processes are passive

Page 189: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

❖ A Subclass of Distributed

Computation❖ Distributed Computation: An

Illustration❖ Termination Detection

❖ Huang’s Algorithm

❖ Huang’s Algorithm

(Continued)❖ Huang’s Algorithm: An

Illustration

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 41/44

Termination Detection

■ To detect if the computation has finished doing all the work

◆ all processes have become passive, and◆ all channels have become empty

■ Different types of computations:

◆ diffusing: only one process is active in the beginning

◆ non-diffusing: any subset of processes can be active inthe beginning■ no process knows which processes are active and

which processes are passive

Page 190: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

❖ A Subclass of Distributed

Computation❖ Distributed Computation: An

Illustration❖ Termination Detection

❖ Huang’s Algorithm

❖ Huang’s Algorithm

(Continued)❖ Huang’s Algorithm: An

Illustration

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 41/44

Termination Detection

■ To detect if the computation has finished doing all the work

◆ all processes have become passive, and◆ all channels have become empty

■ Different types of computations:

◆ diffusing: only one process is active in the beginning◆ non-diffusing: any subset of processes can be active in

the beginning

■ no process knows which processes are active andwhich processes are passive

Page 191: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

❖ A Subclass of Distributed

Computation❖ Distributed Computation: An

Illustration❖ Termination Detection

❖ Huang’s Algorithm

❖ Huang’s Algorithm

(Continued)❖ Huang’s Algorithm: An

Illustration

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 41/44

Termination Detection

■ To detect if the computation has finished doing all the work

◆ all processes have become passive, and◆ all channels have become empty

■ Different types of computations:

◆ diffusing: only one process is active in the beginning◆ non-diffusing: any subset of processes can be active in

the beginning■ no process knows which processes are active and

which processes are passive

Page 192: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

❖ A Subclass of Distributed

Computation❖ Distributed Computation: An

Illustration❖ Termination Detection

❖ Huang’s Algorithm

❖ Huang’s Algorithm

(Continued)❖ Huang’s Algorithm: An

Illustration

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 42/44

Huang’s Algorithm

■ Assumption: computation is diffusing

◆ the initially active process is called the coordinator■ coordinator is responsible for detecting termination

■ Initially:

◆ coordinator has a weight of 1◆ all other processes have a weight of 0

■ Invariants:

◆ total amount of weight in the system is 1◆ a non-coordinator process has a non-zero weight if and

only if it is active◆ a channel has a non-zero weight if and only if it is

non-empty■ weight of a channel is the sum of the weight of all its

messages

Page 193: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

❖ A Subclass of Distributed

Computation❖ Distributed Computation: An

Illustration❖ Termination Detection

❖ Huang’s Algorithm

❖ Huang’s Algorithm

(Continued)❖ Huang’s Algorithm: An

Illustration

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 42/44

Huang’s Algorithm

■ Assumption: computation is diffusing

◆ the initially active process is called the coordinator

■ coordinator is responsible for detecting termination

■ Initially:

◆ coordinator has a weight of 1◆ all other processes have a weight of 0

■ Invariants:

◆ total amount of weight in the system is 1◆ a non-coordinator process has a non-zero weight if and

only if it is active◆ a channel has a non-zero weight if and only if it is

non-empty■ weight of a channel is the sum of the weight of all its

messages

Page 194: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

❖ A Subclass of Distributed

Computation❖ Distributed Computation: An

Illustration❖ Termination Detection

❖ Huang’s Algorithm

❖ Huang’s Algorithm

(Continued)❖ Huang’s Algorithm: An

Illustration

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 42/44

Huang’s Algorithm

■ Assumption: computation is diffusing

◆ the initially active process is called the coordinator■ coordinator is responsible for detecting termination

■ Initially:

◆ coordinator has a weight of 1◆ all other processes have a weight of 0

■ Invariants:

◆ total amount of weight in the system is 1◆ a non-coordinator process has a non-zero weight if and

only if it is active◆ a channel has a non-zero weight if and only if it is

non-empty■ weight of a channel is the sum of the weight of all its

messages

Page 195: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

❖ A Subclass of Distributed

Computation❖ Distributed Computation: An

Illustration❖ Termination Detection

❖ Huang’s Algorithm

❖ Huang’s Algorithm

(Continued)❖ Huang’s Algorithm: An

Illustration

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 42/44

Huang’s Algorithm

■ Assumption: computation is diffusing

◆ the initially active process is called the coordinator■ coordinator is responsible for detecting termination

■ Initially:

◆ coordinator has a weight of 1◆ all other processes have a weight of 0

■ Invariants:

◆ total amount of weight in the system is 1◆ a non-coordinator process has a non-zero weight if and

only if it is active◆ a channel has a non-zero weight if and only if it is

non-empty■ weight of a channel is the sum of the weight of all its

messages

Page 196: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

❖ A Subclass of Distributed

Computation❖ Distributed Computation: An

Illustration❖ Termination Detection

❖ Huang’s Algorithm

❖ Huang’s Algorithm

(Continued)❖ Huang’s Algorithm: An

Illustration

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 42/44

Huang’s Algorithm

■ Assumption: computation is diffusing

◆ the initially active process is called the coordinator■ coordinator is responsible for detecting termination

■ Initially:

◆ coordinator has a weight of 1

◆ all other processes have a weight of 0

■ Invariants:

◆ total amount of weight in the system is 1◆ a non-coordinator process has a non-zero weight if and

only if it is active◆ a channel has a non-zero weight if and only if it is

non-empty■ weight of a channel is the sum of the weight of all its

messages

Page 197: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

❖ A Subclass of Distributed

Computation❖ Distributed Computation: An

Illustration❖ Termination Detection

❖ Huang’s Algorithm

❖ Huang’s Algorithm

(Continued)❖ Huang’s Algorithm: An

Illustration

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 42/44

Huang’s Algorithm

■ Assumption: computation is diffusing

◆ the initially active process is called the coordinator■ coordinator is responsible for detecting termination

■ Initially:

◆ coordinator has a weight of 1◆ all other processes have a weight of 0

■ Invariants:

◆ total amount of weight in the system is 1◆ a non-coordinator process has a non-zero weight if and

only if it is active◆ a channel has a non-zero weight if and only if it is

non-empty■ weight of a channel is the sum of the weight of all its

messages

Page 198: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

❖ A Subclass of Distributed

Computation❖ Distributed Computation: An

Illustration❖ Termination Detection

❖ Huang’s Algorithm

❖ Huang’s Algorithm

(Continued)❖ Huang’s Algorithm: An

Illustration

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 42/44

Huang’s Algorithm

■ Assumption: computation is diffusing

◆ the initially active process is called the coordinator■ coordinator is responsible for detecting termination

■ Initially:

◆ coordinator has a weight of 1◆ all other processes have a weight of 0

■ Invariants:

◆ total amount of weight in the system is 1◆ a non-coordinator process has a non-zero weight if and

only if it is active◆ a channel has a non-zero weight if and only if it is

non-empty■ weight of a channel is the sum of the weight of all its

messages

Page 199: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

❖ A Subclass of Distributed

Computation❖ Distributed Computation: An

Illustration❖ Termination Detection

❖ Huang’s Algorithm

❖ Huang’s Algorithm

(Continued)❖ Huang’s Algorithm: An

Illustration

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 42/44

Huang’s Algorithm

■ Assumption: computation is diffusing

◆ the initially active process is called the coordinator■ coordinator is responsible for detecting termination

■ Initially:

◆ coordinator has a weight of 1◆ all other processes have a weight of 0

■ Invariants:

◆ total amount of weight in the system is 1

◆ a non-coordinator process has a non-zero weight if andonly if it is active

◆ a channel has a non-zero weight if and only if it isnon-empty■ weight of a channel is the sum of the weight of all its

messages

Page 200: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

❖ A Subclass of Distributed

Computation❖ Distributed Computation: An

Illustration❖ Termination Detection

❖ Huang’s Algorithm

❖ Huang’s Algorithm

(Continued)❖ Huang’s Algorithm: An

Illustration

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 42/44

Huang’s Algorithm

■ Assumption: computation is diffusing

◆ the initially active process is called the coordinator■ coordinator is responsible for detecting termination

■ Initially:

◆ coordinator has a weight of 1◆ all other processes have a weight of 0

■ Invariants:

◆ total amount of weight in the system is 1◆ a non-coordinator process has a non-zero weight if and

only if it is active

◆ a channel has a non-zero weight if and only if it isnon-empty■ weight of a channel is the sum of the weight of all its

messages

Page 201: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

❖ A Subclass of Distributed

Computation❖ Distributed Computation: An

Illustration❖ Termination Detection

❖ Huang’s Algorithm

❖ Huang’s Algorithm

(Continued)❖ Huang’s Algorithm: An

Illustration

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 42/44

Huang’s Algorithm

■ Assumption: computation is diffusing

◆ the initially active process is called the coordinator■ coordinator is responsible for detecting termination

■ Initially:

◆ coordinator has a weight of 1◆ all other processes have a weight of 0

■ Invariants:

◆ total amount of weight in the system is 1◆ a non-coordinator process has a non-zero weight if and

only if it is active◆ a channel has a non-zero weight if and only if it is

non-empty

■ weight of a channel is the sum of the weight of all itsmessages

Page 202: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

❖ A Subclass of Distributed

Computation❖ Distributed Computation: An

Illustration❖ Termination Detection

❖ Huang’s Algorithm

❖ Huang’s Algorithm

(Continued)❖ Huang’s Algorithm: An

Illustration

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 42/44

Huang’s Algorithm

■ Assumption: computation is diffusing

◆ the initially active process is called the coordinator■ coordinator is responsible for detecting termination

■ Initially:

◆ coordinator has a weight of 1◆ all other processes have a weight of 0

■ Invariants:

◆ total amount of weight in the system is 1◆ a non-coordinator process has a non-zero weight if and

only if it is active◆ a channel has a non-zero weight if and only if it is

non-empty■ weight of a channel is the sum of the weight of all its

messages

Page 203: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

❖ A Subclass of Distributed

Computation❖ Distributed Computation: An

Illustration❖ Termination Detection

❖ Huang’s Algorithm

❖ Huang’s Algorithm

(Continued)❖ Huang’s Algorithm: An

Illustration

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 43/44

Huang’s Algorithm (Continued)

■ Actions:

◆ On sending an application message:■ send half of its weight along with the message

◆ On receiving an application message:■ add the weight of the message to the current weight

◆ On becoming passive:■ send the current weight to the coodrinator

■ Coordinator announces termination once:

◆ it has become passive and◆ it has collected all the weight

Page 204: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

❖ A Subclass of Distributed

Computation❖ Distributed Computation: An

Illustration❖ Termination Detection

❖ Huang’s Algorithm

❖ Huang’s Algorithm

(Continued)❖ Huang’s Algorithm: An

Illustration

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 43/44

Huang’s Algorithm (Continued)

■ Actions:

◆ On sending an application message:

■ send half of its weight along with the message

◆ On receiving an application message:■ add the weight of the message to the current weight

◆ On becoming passive:■ send the current weight to the coodrinator

■ Coordinator announces termination once:

◆ it has become passive and◆ it has collected all the weight

Page 205: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

❖ A Subclass of Distributed

Computation❖ Distributed Computation: An

Illustration❖ Termination Detection

❖ Huang’s Algorithm

❖ Huang’s Algorithm

(Continued)❖ Huang’s Algorithm: An

Illustration

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 43/44

Huang’s Algorithm (Continued)

■ Actions:

◆ On sending an application message:■ send half of its weight along with the message

◆ On receiving an application message:■ add the weight of the message to the current weight

◆ On becoming passive:■ send the current weight to the coodrinator

■ Coordinator announces termination once:

◆ it has become passive and◆ it has collected all the weight

Page 206: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

❖ A Subclass of Distributed

Computation❖ Distributed Computation: An

Illustration❖ Termination Detection

❖ Huang’s Algorithm

❖ Huang’s Algorithm

(Continued)❖ Huang’s Algorithm: An

Illustration

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 43/44

Huang’s Algorithm (Continued)

■ Actions:

◆ On sending an application message:■ send half of its weight along with the message

◆ On receiving an application message:

■ add the weight of the message to the current weight

◆ On becoming passive:■ send the current weight to the coodrinator

■ Coordinator announces termination once:

◆ it has become passive and◆ it has collected all the weight

Page 207: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

❖ A Subclass of Distributed

Computation❖ Distributed Computation: An

Illustration❖ Termination Detection

❖ Huang’s Algorithm

❖ Huang’s Algorithm

(Continued)❖ Huang’s Algorithm: An

Illustration

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 43/44

Huang’s Algorithm (Continued)

■ Actions:

◆ On sending an application message:■ send half of its weight along with the message

◆ On receiving an application message:■ add the weight of the message to the current weight

◆ On becoming passive:■ send the current weight to the coodrinator

■ Coordinator announces termination once:

◆ it has become passive and◆ it has collected all the weight

Page 208: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

❖ A Subclass of Distributed

Computation❖ Distributed Computation: An

Illustration❖ Termination Detection

❖ Huang’s Algorithm

❖ Huang’s Algorithm

(Continued)❖ Huang’s Algorithm: An

Illustration

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 43/44

Huang’s Algorithm (Continued)

■ Actions:

◆ On sending an application message:■ send half of its weight along with the message

◆ On receiving an application message:■ add the weight of the message to the current weight

◆ On becoming passive:

■ send the current weight to the coodrinator

■ Coordinator announces termination once:

◆ it has become passive and◆ it has collected all the weight

Page 209: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

❖ A Subclass of Distributed

Computation❖ Distributed Computation: An

Illustration❖ Termination Detection

❖ Huang’s Algorithm

❖ Huang’s Algorithm

(Continued)❖ Huang’s Algorithm: An

Illustration

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 43/44

Huang’s Algorithm (Continued)

■ Actions:

◆ On sending an application message:■ send half of its weight along with the message

◆ On receiving an application message:■ add the weight of the message to the current weight

◆ On becoming passive:■ send the current weight to the coodrinator

■ Coordinator announces termination once:

◆ it has become passive and◆ it has collected all the weight

Page 210: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

❖ A Subclass of Distributed

Computation❖ Distributed Computation: An

Illustration❖ Termination Detection

❖ Huang’s Algorithm

❖ Huang’s Algorithm

(Continued)❖ Huang’s Algorithm: An

Illustration

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 43/44

Huang’s Algorithm (Continued)

■ Actions:

◆ On sending an application message:■ send half of its weight along with the message

◆ On receiving an application message:■ add the weight of the message to the current weight

◆ On becoming passive:■ send the current weight to the coodrinator

■ Coordinator announces termination once:

◆ it has become passive and◆ it has collected all the weight

Page 211: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

❖ A Subclass of Distributed

Computation❖ Distributed Computation: An

Illustration❖ Termination Detection

❖ Huang’s Algorithm

❖ Huang’s Algorithm

(Continued)❖ Huang’s Algorithm: An

Illustration

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 43/44

Huang’s Algorithm (Continued)

■ Actions:

◆ On sending an application message:■ send half of its weight along with the message

◆ On receiving an application message:■ add the weight of the message to the current weight

◆ On becoming passive:■ send the current weight to the coodrinator

■ Coordinator announces termination once:

◆ it has become passive and

◆ it has collected all the weight

Page 212: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

❖ A Subclass of Distributed

Computation❖ Distributed Computation: An

Illustration❖ Termination Detection

❖ Huang’s Algorithm

❖ Huang’s Algorithm

(Continued)❖ Huang’s Algorithm: An

Illustration

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 43/44

Huang’s Algorithm (Continued)

■ Actions:

◆ On sending an application message:■ send half of its weight along with the message

◆ On receiving an application message:■ add the weight of the message to the current weight

◆ On becoming passive:■ send the current weight to the coodrinator

■ Coordinator announces termination once:

◆ it has become passive and◆ it has collected all the weight

Page 213: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

❖ A Subclass of Distributed

Computation❖ Distributed Computation: An

Illustration❖ Termination Detection

❖ Huang’s Algorithm

❖ Huang’s Algorithm

(Continued)❖ Huang’s Algorithm: An

Illustration

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 44/44

Huang’s Algorithm: An Illustration

�����

P2

P3

P1

1

0

0

P2

P3

P1

m1(1

2)

m2(1

4)

1 1

2

1

16

0 1

2

m4(1

16)

m3(1

8)

3

8

1

4

0 1

4

1

8

1

16

3

8

9

16

15

161

0

0

Page 214: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

❖ A Subclass of Distributed

Computation❖ Distributed Computation: An

Illustration❖ Termination Detection

❖ Huang’s Algorithm

❖ Huang’s Algorithm

(Continued)❖ Huang’s Algorithm: An

Illustration

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 44/44

Huang’s Algorithm: An Illustration

�����

P2

P3

P1

m1(1

2)

1 1

2

0

0

P2

P3

P1

m1(1

2)

m2(1

4)

1 1

2

1

16

0 1

2

m4(1

16)

m3(1

8)

3

8

1

4

0 1

4

1

8

1

16

3

8

9

16

15

161

0

0

Page 215: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

❖ A Subclass of Distributed

Computation❖ Distributed Computation: An

Illustration❖ Termination Detection

❖ Huang’s Algorithm

❖ Huang’s Algorithm

(Continued)❖ Huang’s Algorithm: An

Illustration

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 44/44

Huang’s Algorithm: An Illustration

�����

�����

�����

�����

P2

P3

P1

m1(1

2)

1 1

2

0 1

2

0

P2

P3

P1

m1(1

2)

1 1

2

0 1

2

0

P2

P3

P1

m1(1

2)

m2(1

4)

1 1

2

1

16

0 1

2

m4(1

16)

m3(1

8)

3

8

1

4

0 1

4

1

8

1

16

3

8

9

16

15

161

0

0

Page 216: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

❖ A Subclass of Distributed

Computation❖ Distributed Computation: An

Illustration❖ Termination Detection

❖ Huang’s Algorithm

❖ Huang’s Algorithm

(Continued)❖ Huang’s Algorithm: An

Illustration

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 44/44

Huang’s Algorithm: An Illustration

�����

�����

P2

P1

m1(1

2)

m2(1

4)

1 1

2

0 1

2

1

4

0P3

P2

P3

P1

m1(1

2)

m2(1

4)

1 1

2

1

16

0 1

2

m4(1

16)

m3(1

8)

3

8

1

4

0 1

4

1

8

1

16

3

8

9

16

15

161

0

0

Page 217: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

❖ A Subclass of Distributed

Computation❖ Distributed Computation: An

Illustration❖ Termination Detection

❖ Huang’s Algorithm

❖ Huang’s Algorithm

(Continued)❖ Huang’s Algorithm: An

Illustration

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 44/44

Huang’s Algorithm: An Illustration

�����

�����

����������

P2

P3

P1

m1(1

2)

m2(1

4)

1 1

2

0 1

2

1

4

0 1

4

P2

P3

P1

m1(1

2)

m2(1

4)

1 1

2

1

16

0 1

2

m4(1

16)

m3(1

8)

3

8

1

4

0 1

4

1

8

1

16

3

8

9

16

15

161

0

0

Page 218: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

❖ A Subclass of Distributed

Computation❖ Distributed Computation: An

Illustration❖ Termination Detection

❖ Huang’s Algorithm

❖ Huang’s Algorithm

(Continued)❖ Huang’s Algorithm: An

Illustration

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 44/44

Huang’s Algorithm: An Illustration

�����

�����

����������

P2

P3

P1

m1(1

2)

m2(1

4)

1 1

2

0 1

2

m3(1

8)

1

4

0 1

4

1

8

P2

P3

P1

m1(1

2)

m2(1

4)

1 1

2

1

16

0 1

2

m4(1

16)

m3(1

8)

3

8

1

4

0 1

4

1

8

1

16

3

8

9

16

15

161

0

0

Page 219: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

❖ A Subclass of Distributed

Computation❖ Distributed Computation: An

Illustration❖ Termination Detection

❖ Huang’s Algorithm

❖ Huang’s Algorithm

(Continued)❖ Huang’s Algorithm: An

Illustration

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 44/44

Huang’s Algorithm: An Illustration

�����

�����

����������

P2

P3

P1

m1(1

2)

m2(1

4)

1 1

2

0 1

2

m4(1

16)

m3(1

8)

1

4

0 1

4

1

8

1

16

3

8

P2

P3

P1

m1(1

2)

m2(1

4)

1 1

2

1

16

0 1

2

m4(1

16)

m3(1

8)

3

8

1

4

0 1

4

1

8

1

16

3

8

9

16

15

161

0

0

Page 220: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

❖ A Subclass of Distributed

Computation❖ Distributed Computation: An

Illustration❖ Termination Detection

❖ Huang’s Algorithm

❖ Huang’s Algorithm

(Continued)❖ Huang’s Algorithm: An

Illustration

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 44/44

Huang’s Algorithm: An Illustration

�����

�����

����� ������

P2

P3

P1

m1(1

2)

m2(1

4)

1 1

2

0 1

2

m4(1

16)

m3(1

8)

1

4

0 1

4

1

8

1

16

3

8

9

16

P2

P3

P1

m1(1

2)

m2(1

4)

1 1

2

1

16

0 1

2

m4(1

16)

m3(1

8)

3

8

1

4

0 1

4

1

8

1

16

3

8

9

16

15

161

0

0

Page 221: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

❖ A Subclass of Distributed

Computation❖ Distributed Computation: An

Illustration❖ Termination Detection

❖ Huang’s Algorithm

❖ Huang’s Algorithm

(Continued)❖ Huang’s Algorithm: An

Illustration

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 44/44

Huang’s Algorithm: An Illustration

�����

����� �����

����� ������

���

P2

P3

P1

m1(1

2)

m2(1

4)

1 1

2

1

16

0 1

2

m4(1

16)

m3(1

8)

3

8

1

4

0 1

4

1

8

1

16

3

8

9

16

15

16

0

0

P2

P3

P1

m1(1

2)

m2(1

4)

1 1

2

1

16

0 1

2

m4(1

16)

m3(1

8)

3

8

1

4

0 1

4

1

8

1

16

3

8

9

16

15

161

0

0

Page 222: Distributed Operating Systems: Theoretical Foundationsusers.ece.utexas.edu/~garg/sp11/382n-opt3/foundations.pdf · State of a Distributed System Monitoring a Distributed System Department

Inherent Limitations

Ordering of Events

Abstract Clocks

Ordering of Messages

State of a Distributed System

Monitoring a Distributed

System

❖ A Subclass of Distributed

Computation❖ Distributed Computation: An

Illustration❖ Termination Detection

❖ Huang’s Algorithm

❖ Huang’s Algorithm

(Continued)❖ Huang’s Algorithm: An

Illustration

Department of Computer Science, The University of Texas at Dallas CS 6378: Advanced Operating Systems – Chapter 5: Theoretical Foundations Slide 44/44

Huang’s Algorithm: An Illustration

�����

����� �����

����� � �����

���

�����

P2

P3

P1

m1(1

2)

m2(1

4)

1 1

2

1

16

0 1

2

m4(1

16)

m3(1

8)

3

8

1

4

0 1

4

1

8

1

16

3

8

9

16

15

161

0

0