DISTRIBUTED ALGORITHMS By Nancy.A.Lynch Chapter 18 LOGICAL TIME By Sudha Elavarti.

Slides:



Advertisements
Similar presentations
Chapter 12 Message Ordering. Causal Ordering A single message should not be overtaken by a sequence of messages Stronger than FIFO Example of FIFO but.
Advertisements

CS4231 Parallel and Distributed Algorithms AY 2006/2007 Semester 2 Lecture 6 Instructor: Haifeng YU.
Virtual Time “Virtual Time and Global States of Distributed Systems” Friedmann Mattern, 1989 The Model: An asynchronous distributed system = a set of processes.
Lecture 8: Asynchronous Network Algorithms
Distributed Computing 5. Snapshot Shmuel Zaks ©
Logical Time Each event is assigned a logical time from a totally ordered set T The logical times for the events must respect any possible dependencies.
Dr. Kalpakis CMSC 621, Advanced Operating Systems. Logical Clocks and Global State.
1 Complexity of Network Synchronization Raeda Naamnieh.
What we will cover…  Distributed Coordination 1-1.
Ordering and Consistent Cuts Presented By Biswanath Panda.
CS 582 / CMPE 481 Distributed Systems Fault Tolerance.
CMPT 431 Dr. Alexandra Fedorova Lecture VIII: Time And Global Clocks.
Distributed Systems Fall 2009 Logical time, global states, and debugging.
CPSC 668Set 16: Distributed Shared Memory1 CPSC 668 Distributed Algorithms and Systems Fall 2006 Prof. Jennifer Welch.
CPSC 668Set 12: Causality1 CPSC 668 Distributed Algorithms and Systems Fall 2009 Prof. Jennifer Welch.
Slides for Chapter 10: Time and Global State
Distributed Process Management
20101 Synchronization in distributed systems A collection of independent computers that appears to its users as a single coherent system.
Lecture 13 Synchronization (cont). EECE 411: Design of Distributed Software Applications Logistics Last quiz Max: 69 / Median: 52 / Min: 24 In a box outside.
1 Distributed Process Management: Distributed Global States and Distributed Mutual Exclusion.
Lecture 12 Synchronization. EECE 411: Design of Distributed Software Applications Summary so far … A distributed system is: a collection of independent.
Time, Clocks, and the Ordering of Events in a Distributed System Leslie Lamport (1978) Presented by: Yoav Kantor.
Dr. Kalpakis CMSC 621, Advanced Operating Systems. Fall 2003 URL: Logical Clocks and Global State.
Chapter 17 Theoretical Issues in Distributed Systems
Logical Clocks (2). Topics r Logical clocks r Totally-Ordered Multicasting r Vector timestamps.
Chapter 5.
CIS 720 Distributed algorithms. “Paint on the forehead” problem Each of you can see other’s forehead but not your own. I announce “some of you have paint.
Distributed Computing 5. Snapshot Shmuel Zaks ©
1 A Modular Approach to Fault-Tolerant Broadcasts and Related Problems Author: Vassos Hadzilacos and Sam Toueg Distributed Systems: 526 U1580 Professor:
1 Consistent Global States of Distributed Systems: Fundamental Concepts and Mechanisms Author: Ozalp Babaoglu and Keith Marzullo Distributed Systems: 526.
Logical Clocks n event ordering, happened-before relation (review) n logical clocks conditions n scalar clocks condition implementation limitation n vector.
Reliable Communication in the Presence of Failures Based on the paper by: Kenneth Birman and Thomas A. Joseph Cesar Talledo COEN 317 Fall 05.
Page 1 Logical Clocks Paul Krzyzanowski Distributed Systems Except as otherwise noted, the content of this presentation is.
1 Distributed Process Management Chapter Distributed Global States Operating system cannot know the current state of all process in the distributed.
Logical Clocks. Topics Logical clocks Totally-Ordered Multicasting Vector timestamps.
Lamport’s Logical Clocks & Totally Ordered Multicasting.
“Virtual Time and Global States of Distributed Systems”
Communication & Synchronization Why do processes communicate in DS? –To exchange messages –To synchronize processes Why do processes synchronize in DS?
Distributed Systems Fall 2010 Logical time, global states, and debugging.
Event Ordering Greg Bilodeau CS 5204 November 3, 2009.
CSE 486/586, Spring 2013 CSE 486/586 Distributed Systems Global States Steve Ko Computer Sciences and Engineering University at Buffalo.
Time, Clocks, and the Ordering of Events in a Distributed System Leslie Lamport Massachusetts Computer Associates,Inc. Presented by Xiaofeng Xiao.
Real-Time & MultiMedia Lab Synchronization Distributed System Jin-Seung,KIM.
CIS825 Lecture 2. Model Processors Communication medium.
D u k e S y s t e m s Asynchronous Replicated State Machines (Causal Multicast and All That) Jeff Chase Duke University.
Building Dependable Distributed Systems, Copyright Wenbing Zhao
Feb 15, 2001CSCI {4,6}900: Ubiquitous Computing1 Announcements.
Chapter 21 Asynchronous Network Computing with Process Failures By Sindhu Karthikeyan.
CSCE 668 DISTRIBUTED ALGORITHMS AND SYSTEMS Fall 2011 Prof. Jennifer Welch CSCE 668 Set 16: Distributed Shared Memory 1.
Logical Clocks. Topics r Logical clocks r Totally-Ordered Multicasting.
Ordering of Events in Distributed Systems UNIVERSITY of WISCONSIN-MADISON Computer Sciences Department CS 739 Distributed Systems Andrea C. Arpaci-Dusseau.
CSE 486/586 CSE 486/586 Distributed Systems Global States Steve Ko Computer Sciences and Engineering University at Buffalo.
“Distributed Algorithms” by Nancy A. Lynch SHARED MEMORY vs NETWORKS Presented By: Sumit Sukhramani Kent State University.
1 Chapter 11 Global Properties (Distributed Termination)
11-Jun-16CSE 542: Operating Systems1 Distributed systems Time, clocks, and the ordering of events in a distributed system Leslie Lamport. Communications.
Logical Clocks event ordering, happened-before relation (review) logical clocks conditions scalar clocks  condition  implementation  limitation vector.
Distributed Systems Lecture 6 Global states and snapshots 1.
Logical time Causality between events is fundamental to the design of parallel and distributed systems. In distributed systems, it is not possible to have.
CSE 486/586 Distributed Systems Global States
Lecture 9: Asynchronous Network Algorithms
COT 5611 Operating Systems Design Principles Spring 2012
Time And Global Clocks CMPT 431.
Chapter 5 (through section 5.4)
Slides for Chapter 11: Time and Global State
Jenhui Chen Office number:
Distributed algorithms
CIS825 Lecture 5 1.
Slides for Chapter 14: Time and Global States
COT 5611 Operating Systems Design Principles Spring 2014
Presentation transcript:

DISTRIBUTED ALGORITHMS By Nancy.A.Lynch Chapter 18 LOGICAL TIME By Sudha Elavarti

Introduction Logical time is a notion used for simplifying the job of programming an asynchronous network Logical time is an element of some fixed totally ordered set T={t1,t2…..}, which is to be assigned for every execution of an asynchronous network A Logical time of all events should respect all the dependencies among the events within a system A.

Logical Time for Send/Receive Systems If a is an execution of an asynchronous send/receive network, then logical time for a is assigning a value of T={t1.t2…} to every event in a. Assumptions –Only universal reliable FIFO send/receive channels are considered. –No internal events are considered

Properties for assigning Logical time to S/R 1)No two events get assigned the same logical time. 2)The logical times of events at each process are strictly increasing, according to their order of occurrence in a. 3)The logical time of any send event is strictly smaller than that of the corresponding receive event. 4)For any t belongs to T, there are only finite many events that get assigned logical times smaller than t.

Logical time for Broadcast Systems To define logical time for broadcast systems all the events are considered. For any execution a,logical time assignment is assigning a value T to very event in a, in such a way as to satisfy same properties as for S/R systems except property 3 i.e; –The logical time of any bcast event is strictly smaller than that of each corresponding receive event.

Adding Logical Time to Asynchronous Algorithms Logical times are generated for the events of a given asynchronous S/R network algorithm A. The given algorithm A transforms into a new asynchronous S/R algorithm L(A). The transformation works process by process. Whenever a process of L(A) simulates a step of A, it also generates a logical time.

Advancing the clock (1.Lamport-Time Transformation) In this algorithm local clocks are maintained and advanced when messages are received in order to keep them synchronized. Logical time domain T is a set of pairs (c,i) where c is a non-negative integer, i is a process index. The clock variable gets increased by at least 1 at every event that occurs at process i. The logical time of any event is defined to be the value of the clock variable immediately after the event, paired with process index i as a tie breaker

Lamports time transformation contd... Send-The clock value of send event is attached as time stamp to the mesg being sent. Receive-For every receive event, i increases its clock variable larger than its previous value and than the timestamp of the mesg. LamportTime(A) satisfies all the properties of definition of logical time. LamportTime transformation can be easily modified to work in asynchronous broadcast systems.

Delaying Future Events (2.WelchTime Transformation) Clocks are not advanced in response to mesg receipts, but mesg’s that arrive early are delayed. Domain T is a set of triples (c,i,k), where c is a nonnegative real, i process index, k belongs to N +. Logical time of any event is defined to be the value of the clock when the event occurs. Process i maintains a FIFO receive-buffer in order to hold mesg’s whose timestamps are greater than or equal to the local clock value.

WelchTime contd.. For every mesg if timestamp is less than current clock value, mesg is processed, else it is placed in receive-buffer, they are processed in the order in which they appear in the receive-buffer. The unbounded ness of the local clock variables also implies that every mesg in a receive-buffer is eventually processed. WelchTime(A) satisfies all the properties of definition of logical time. WelchTime transformation can be modified to work in asynchronous broadcast systems.

Applications Banking Systems For counting the total amount of money that is transferred between process via mesg. Each process has a local variable that money that contains current amount at that location. CountMoney algorithm transformed from algorithm A finds the local balance

CountMoney Algorithm It has a subroutine with predetermined logical time t belongs to T, assuming t is known, general strategy is 1)For each process of A, determine the value of the money variable after all events with logical times less than or equal to t and before all events with logical times greater than t. 2)For each channel, determine the amount of money in all the messages sent at logical times less than or equal to t but received at logical times strictly greater than t.

$10$30$20 $4 $5 $3 $2 $

Global Snapshots CountMoney generalised to get an instantaneous global snapshot of system state. useful for debugging,in case of failure,or detecting certain global properties. it is possible to get a global snapshot by delaying process and mesg’s till it records all the needed information, but not practical. true global snapshot may not be needed, but a system state that “look-like” global snapshot to all processes is good enough.

LogicalTimeSnapShot algorithm As in CountMoney,it has a subroutine with predetermined logical time t belongs to T, assuming t is known, general strategy is 1)determine the state of each process of A after all events with logical times less than or equal to t and before all events with logical times greater then t. 2)For each channel, determine the sequence of messages sent at logical times less than or equal to t but received at logical times strictly greater then t. --this information is determined by same distributed algo. (CountMoney)

ReplicatedStateMachine Algorithm To simulate single state machine or single shared variable, say x. Consider there are n user processes submitting invocations to x and receiving responses from x. One user process U i at each node i of the network. The network as a whole should be atomic object. ALGO:- Each process A i simply receives invocations from user U i and broadcasts them. Each process has a local copy of x and a local variable invocation- buffer in which it stores all invocations. Process i places local invocation in its invocation-buffer when it performs the broadcast and places remote invocation when it performs the receive for that invocation.

Continued… Process i maintains a vector known-time, which keeps track of largest local time for each process. –Known-time(i)i = logical time of most recent event at process i. –Known-time(j)i = logical time of broadcast event received by i from j. Process i is permitted to apply an invocation pi in its invocation-buffer to its copy of x when following is true. –Invocation pi has the smallest logical time of any invocation in invocation-buffer (i). –For every j, known-time(j)i >= logical time of pi.

Transforming Real-Time Algorithms to Logical-Time Algorithms S/R system A,in which each process Ai has a real-time value Times occurring as arguments in its output event should be nondecreasing and unbounded in any fair execution. It is possible to transform each process Ai into a process Bi without real-time,but with logical time.