Outline Theoretical Foundations

Slides:



Advertisements
Similar presentations
Synchronization Chapter clock synchronization * 5.2 logical clocks * 5.3 global state * 5.4 election algorithm * 5.5 mutual exclusion * 5.6 distributed.
Advertisements

Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED.
Dr. Kalpakis CMSC 621, Advanced Operating Systems. Logical Clocks and Global State.
Distributed Systems Spring 2009
1. Explain why synchronization is so important in distributed systems by giving an appropriate example When each machine has its own clock, an event that.
Synchronization Clock Synchronization Logical Clocks Global State Election Algorithms Mutual Exclusion.
Time, Clocks and the Ordering of Events in a Distributed System - by Leslie Lamport.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED SYSTEMS.
EEC-681/781 Distributed Computing Systems Lecture 10 Wenbing Zhao Cleveland State University.
EEC-681/781 Distributed Computing Systems Lecture 10 Wenbing Zhao Cleveland State University.
Lecture 12 Synchronization. EECE 411: Design of Distributed Software Applications Summary so far … A distributed system is: a collection of independent.
Computer Science Lecture 10, page 1 CS677: Distributed OS Last Class: Clock Synchronization Physical clocks Clock synchronization algorithms –Cristian’s.
Time, Clocks, and the Ordering of Events in a Distributed System Leslie Lamport (1978) Presented by: Yoav Kantor.
1 Synchronization Part 1 REK’s adaptation of Claypool’s adaptation of Tanenbaum’s Distributed Systems Chapter 5.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED SYSTEMS.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED SYSTEMS.
Chapter 5.
Donghyun (David) Kim Department of Mathematics and Physics North Carolina Central University 1 Project Reference Some slides are in courtesy of Dr. Erciyes,
© Oxford University Press 2011 DISTRIBUTED COMPUTING Sunita Mahajan Sunita Mahajan, Principal, Institute of Computer Science, MET League of Colleges, Mumbai.
Computer Science Lecture 10, page 1 CS677: Distributed OS Last Class: Naming Name distribution: use hierarchies DNS X.500 and LDAP.
Synchronization. Why we need synchronization? It is important that multiple processes do not access shared resources simultaneously. Synchronization in.
Logical Clocks. Topics Logical clocks Totally-Ordered Multicasting Vector timestamps.
Lamport’s Logical Clocks & Totally Ordered Multicasting.
Synchronization Chapter 5. Outline 1.Clock synchronization 2.Logical clocks 3.Global state 4.Election algorithms 5.Mutual exclusion 6.Distributed transactions.
Synchronization Chapter 5.
Communication & Synchronization Why do processes communicate in DS? –To exchange messages –To synchronize processes Why do processes synchronize in DS?
Time, Clocks, and the Ordering of Events in a Distributed System Leslie Lamport Massachusetts Computer Associates,Inc. Presented by Xiaofeng Xiao.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED SYSTEMS.
Synchronization CSCI 4900/6900. Importance of Clocks & Synchronization Avoiding simultaneous access of resources –Cooperate to grant exclusive access.
DISTRIBUTED SYSTEMS Principles and Paradigms Second Edition ANDREW S
Feb 15, 2001CSCI {4,6}900: Ubiquitous Computing1 Announcements.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED SYSTEMS.
Logical Clocks. Topics r Logical clocks r Totally-Ordered Multicasting.
Event Ordering. CS 5204 – Operating Systems2 Time and Ordering The two critical differences between centralized and distributed systems are: absence of.
Synchronization Chapter 5. Clock Synchronization When each machine has its own clock, an event that occurred after another event may nevertheless be assigned.
Ordering of Events in Distributed Systems UNIVERSITY of WISCONSIN-MADISON Computer Sciences Department CS 739 Distributed Systems Andrea C. Arpaci-Dusseau.
CS533 Concepts of Operating Systems Class 8 Time, Clocks, and the Ordering of Events in a Distributed System By Constantia Tryman.
COMP 655: Distributed/Operating Systems Summer 2011 Dr. Chunbo Chu Week 6: Synchronyzation 3/5/20161 Distributed Systems - COMP 655.
6.2 Logical Clocks Kranthi Koya09/23/2015. Overview Introduction Lamport’s Logical Clocks Vector Clocks Research Areas Conclusion.
Synchronization Chapter 5. Clock Synchronization When each machine has its own clock, an event that occurred after another event may nevertheless be assigned.
Lecture on Synchronization Submitted by
11-Jun-16CSE 542: Operating Systems1 Distributed systems Time, clocks, and the ordering of events in a distributed system Leslie Lamport. Communications.
Ordering of Events in Distributed Systems UNIVERSITY of WISCONSIN-MADISON Computer Sciences Department CS 739 Distributed Systems Andrea C. Arpaci-Dusseau.
Chapter 10 Time and Global States
Logical time Causality between events is fundamental to the design of parallel and distributed systems. In distributed systems, it is not possible to have.
Prof. Leonardo Mostarda University of Camerino
Time, Clocks, and Global State Part-2
Distributed Computing
CSC 8320 Advanced Operating System
CSE 486/586 Distributed Systems Logical Time
SYNCHORNIZATION Logical Clocks.
EECS 498 Introduction to Distributed Systems Fall 2017
Outline Communication Primitives - continued Theoretical Foundations
Distributed Systems CS
Outline Theoretical Foundations - continued Vector clocks - review
DISTRIBUTED SYSTEMS Principles and Paradigms Second Edition ANDREW S
Logical Clocks and Casual Ordering
Outline Theoretical Foundations - continued Lab 1
Event Ordering.
Outline Theoretical Foundations
CS 425 / ECE 428  2013, I. Gupta, K. Nahrtstedt, S. Mitra, N. Vaidya, M. T. Harandi, J. Hou.
Chapter 5 Synchronization
TIME, CLOCKS AND THE ORDERING OF EVENTS IN A DISTRIBUTED SYSTEM
Distributed Systems CS
Chapter 5 (through section 5.4)
Outline Theoretical Foundations - continued
Distributed algorithms
CSE 486/586 Distributed Systems Logical Time
CSE 542: Operating Systems
Last Class: Naming Name distribution: use hierarchies DNS
Presentation transcript:

Outline Theoretical Foundations Fundamental limitations of distributed systems Logical clocks 10/30/2019 COP5611

Distributed Systems A distributed system is a collection of independent computers that appears to its users as a single coherent system Independent computers mean that they do not share memory or clock The computers communicate with each other by exchanging messages over a communication network The messages are delivered after an arbitrary transmission delay 10/30/2019 COP5611

Inherent Limitations of a Distributed System Absence of a global clock In a centralized system, time is unambiguous In a distributed system, there exists no system wide common clock In other words, the notion of global time does not exist Impact of the absence of global time Difficult to reason about temporal order of events Makes it harder to collect up-to-date information on the state of the entire system 10/30/2019 COP5611

Absence of Global Time When each machine has its own clock, an event that occurred after another event may nevertheless be assigned an earlier time. 10/30/2019 COP5611

Inherent Limitations of a Distributed System Absence of shared memory An up-to-date state of the entire system is not available to any individual process This information, however, is necessary to reason about the system’s behavior, debugging, recovering from failures 10/30/2019 COP5611

Absence of Shared Memory – cont. 10/30/2019 COP5611

Two Approaches for a Global Clock First approach is to physically synchronize the clocks on different computers Synchronize them to a common server Synchronize them to an average of the clocks Second approach is to establish what is known as logical clock They can be used to reason about the temporal ordering of events But they are not related to the physical clock 10/30/2019 COP5611

Physical Clocks 10/30/2019 COP5611

Physical Clocks – cont. TAI seconds are of constant length, unlike solar seconds. Leap seconds are introduced when necessary to keep in phase with the sun. 10/30/2019 COP5611

Clock Synchronization Algorithms The relation between clock time and UTC when clocks tick at different rates. 10/30/2019 COP5611

Cristian's Algorithm Getting the current time from a time server. 10/30/2019 COP5611

The Berkeley Algorithm The time daemon asks all the other machines for their clock values The machines answer The time daemon tells everyone how to adjust their clock 10/30/2019 COP5611

Logical Clocks There are technical issues with the clock synchronization approaches Due to unpredictable message transmission delays, two processes can observe a global clock value at different instants The physical clocks can drift from the physical time and thus we cannot have a system of perfectly synchronized clocks For many purposes, it is sufficient that all machines agree on the same time 10/30/2019 COP5611

Lamport’s Logical Clocks For a wide of algorithms, what matters is the internal consistency of clocks, not whether they are close to the real time For these algorithms, the clocks are often called logical locks Lamport proposed a scheme to order events in a distributed system using logical clocks 10/30/2019 COP5611

Lamport’s Logical Clocks – cont. Definitions Happened before relation Happened before relation () captures the causal dependencies between events It is defined as follows a  b, if a and b are events in the same process and a occurred before b. a  b, if a is the event of sending a message m in a process and b is the event of receipt of the same message m by another process If a  b and b  c, then a  c, i.e., “” is transitive 10/30/2019 COP5611

Lamport’s Logical Clocks – cont. Definitions – continued Causally related events Event a causally affects event b if a  b Concurrent events Two distinct events a and b are said to be concurrent (denoted by a || b) if a  b and b  a For any two events, either a  b, b  a, or a || b 10/30/2019 COP5611

Lamport’s Logical Clocks – cont. 10/30/2019 COP5611

Lamport’s Logical Clocks – cont. There is a clock at each process Pi in the system Which is a function that assigns a number to any event a, called the timestamp of event a at Pi The numbers assigned by the system of the clocks have no relation to physical time The logical clocks take monotonically increasing values and can be implemented as counters 10/30/2019 COP5611

Lamport’s Logical Clocks – cont. Conditions satisfied by the system of clocks For any two events, if a  b, then C(a) < C(b) [C1] For any two events a and b in a process Pi, if a occurs before b, then Ci(a) < Ci(b) [C2] If a is the event of sending a message m in process Pi and b is the event of receiving the same message m at process Pj, then Ci(a) < Cj(b) 10/30/2019 COP5611

Lamport’s Logical Clocks – cont. Implementation rules [IR1] Clock Ci is incremented between any two successive events in process Pi Ci := Ci + d ( d > 0) [IR2] If event a is the sending of message m by process Pi, then message m is assigned a timestamp tm = Ci(a). On receiving the same message m by process Pj, Cj is set to Cj := max(Cj, tm + d) 10/30/2019 COP5611

An Example 10/30/2019 COP5611

Clocks with Different Rates 10/30/2019 COP5611

Total Ordering Using Lamport’s Clocks If a is any event at process Pi and b is any event at process Pj, then a => b if and only if either Where is any arbitrary relation that totally orders the processes to break ties 10/30/2019 COP5611

Example: Totally-Ordered Multicasting Updating a replicated database and leaving it in an inconsistent state. 10/30/2019 COP5611

A Limitation of Lamport’s Clocks In Lamport’s system of logical clocks If a  b, then C(a) < C(b) The reverse if not necessarily true if the events have occurred on different processes 10/30/2019 COP5611

A Limitation of Lamport’s Clocks 10/30/2019 COP5611

Vector Clocks Implementation rules [IR1] Clock Ci is incremented between any two successive events in process Pi Ci[i] := Ci[i] + d ( d > 0) [IR2] If event a is the sending of message m by process Pi, then message m is assigned a timestamp tm = Ci(a). On receiving the same message m by process Pj, Cj is set to Cj[k] := max(Cj[k], tm[k]) 10/30/2019 COP5611

Vector Clocks – cont. 10/30/2019 COP5611

Vector Clocks – cont. 10/30/2019 COP5611

Vector Clocks – cont. Assertion At any instant, Events a and b are casually related if ta < tb or tb < ta. Otherwise, these events are concurrent In a system of vector clocks, 10/30/2019 COP5611