CIS825 Lecture 2. Model Processors Communication medium.

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

CS542 Topics in Distributed Systems Diganta Goswami.
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
SES Algorithm SES: Schiper-Eggli-Sandoz Algorithm. No need for broadcast messages. Each process maintains a vector V_P of size N - 1, N the number of processes.
Token-Dased DMX Algorithms n LeLann’s token ring n Suzuki-Kasami’s broadcast n Raymond’s tree.
Synchronization Chapter clock synchronization * 5.2 logical clocks * 5.3 global state * 5.4 election algorithm * 5.5 mutual exclusion * 5.6 distributed.
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.
Distributed Systems Spring 2009
CS 582 / CMPE 481 Distributed Systems
Ordering and Consistent Cuts Presented By Biswanath Panda.
Group Communications Group communication: one source process sending a message to a group of processes: Destination is a group rather than a single process.
EEC-681/781 Distributed Computing Systems Lecture 11 Wenbing Zhao Cleveland State University.
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.
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.
Distributed Systems Foundations Lecture 1. Main Characteristics of Distributed Systems Independent processors, sites, processes Message passing No shared.
Dr. Kalpakis CMSC 621, Advanced Operating Systems. Fall 2003 URL: Logical Clocks and Global State.
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.
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.
Donghyun (David) Kim Department of Mathematics and Physics North Carolina Central University 1 Project Reference Some slides are in courtesy of Dr. Erciyes,
Distributed Mutex EE324 Lecture 11.
Logical Clocks n event ordering, happened-before relation (review) n logical clocks conditions n scalar clocks condition implementation limitation n vector.
Issues with Clocks. Context The tree correction protocol was based on the idea of local detection and correction. Protocols of this type are complex to.
CS425 /CSE424/ECE428 – Distributed Systems – Fall 2011 Material derived from slides by I. Gupta, M. Harandi, J. Hou, S. Mitra, K. Nahrstedt, N. Vaidya.
1 Distributed Process Management Chapter Distributed Global States Operating system cannot know the current state of all process in the distributed.
Presenter: Long Ma Advisor: Dr. Zhang 4.5 DISTRIBUTED MUTUAL EXCLUSION.
Vector Clock Each process maintains an array of clocks –vc.j.k denotes the knowledge that j has about the clock of k –vc.j.j, thus, denotes the clock of.
Synchronization Chapter 5.
Event Ordering Greg Bilodeau CS 5204 November 3, 2009.
Studying Different Problems from Distributed Computing Several of these problems are motivated by trying to use solutiions used in `centralized computing’
Time, Clocks, and the Ordering of Events in a Distributed System Leslie Lamport Massachusetts Computer Associates,Inc. Presented by Xiaofeng Xiao.
9/14/20051 Time, Clocks, and the Ordering of Events in a Distributed System by L. Lamport CS 5204 Operating Systems Vladimir Glina Fall 2005.
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
Distributed Systems Topic 5: Time, Coordination and Agreement
D ISTRIBUTED S YSTEM UNIT-2 Theoretical Foundation for Distributed Systems Prepared By: G.S.Mishra.
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.
Page 1 Mutual Exclusion & Election Algorithms Paul Krzyzanowski Distributed Systems Except as otherwise noted, the content.
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.
Lecture 12-1 Computer Science 425 Distributed Systems CS 425 / CSE 424 / ECE 428 Fall 2012 Indranil Gupta (Indy) October 4, 2012 Lecture 12 Mutual Exclusion.
Lecture 7- 1 CS 425/ECE 428/CSE424 Distributed Systems (Fall 2009) Lecture 7 Distributed Mutual Exclusion Section 12.2 Klara Nahrstedt.
COMP 655: Distributed/Operating Systems Summer 2011 Dr. Chunbo Chu Week 6: Synchronyzation 3/5/20161 Distributed Systems - COMP 655.
CIS 825 Review session. P1: Assume that processes are arranged in a ring topology. Consider the following modification of the Lamport’s mutual exclusion.
CS3771 Today: Distributed Coordination  Previous class: Distributed File Systems Issues: Naming Strategies: Absolute Names, Mount Points (logical connection.
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 Mutex EE324 Lecture 11.
SYNCHORNIZATION Logical Clocks.
Distributed Systems CS
Outline Theoretical Foundations - continued Vector clocks - review
Logical Clocks and Casual Ordering
Outline Theoretical Foundations - continued Lab 1
Outline Distributed Mutual Exclusion Introduction Performance measures
Event Ordering.
Outline Theoretical Foundations
CS 425 / ECE 428  2013, I. Gupta, K. Nahrtstedt, S. Mitra, N. Vaidya, M. T. Harandi, J. Hou.
Distributed Systems CS
Outline Theoretical Foundations - continued
Distributed Systems CS
Distributed algorithms
Distributed Systems and Concurrency: Synchronization in Distributed Systems Majeed Kassis.
COT 5611 Operating Systems Design Principles Spring 2014
Outline Theoretical Foundations
Presentation transcript:

CIS825 Lecture 2

Model Processors Communication medium

Asynchronous Model Processes may run at different speed. Clocks are not synchronized Messages may take arbitrary time

Synchronous model All processes execute in steps Each step begins and ends at the same time at each processor In each step, a processor receives a message, performs some computation and sends a message Messages sent in step i are received at the beginning of round i + 1

Semi-synchronous model Synchronized clocks Processor speed assumptions Message delay assumptions

“Paint on the forehead” problem Each of you can see other’s forehead but not your own. I announce “some of you have paint on your forehead”. Rounds will start at 5pm and will last one minute. At the beginning of the round, if you know you have paint on your forehead, send to everyone, which will reach before the end of the round You all depart to your offices

Round 1: no is received Round 2: no is received Round 3: no is received Round 4: no is received Round 5: no is received Round 6: 6 s are received Assumptions: Synchronized clocks, all can reason perfectly, everyone knows that everyone else can reason perfectly

Message passing primitives Send(destination, message) Receive(source, message)

A: amount of synchronization and Buffering

Minimal synchronization: 1 Non-blocking send: Blocking send: Reliable blocking send: Synchronous send:

Event Ordering The execution of a process is characterized by a sequence of events (a) internal events (b) send events (c) receive events

Happened Before Relation Let a and b be events - If a and b are events in the same process and a occurred before b then a  b - If a is an event of sending a message M in one process and b is the event of receiving M in another process, then a  b - if a  b and b  c then a  c

Happened Before Relation Relation  defines an irreflexive, transitive relation among the events Irreflexsive: for all a, not (a  a) Transitive: for a, b and c, a  b and b  c then a  c Antisymmetric: for all a and b, a  b implies not (b  a)

Causality Event a causally affects b if a  b. Two events a and b are concurrent (||) if not (a  b) and not (b  a). An event a can influence another event b only if a causally precedes b.

Detecting Event ordering Lamport’s Logical Clocks - Each process P i has a clock C i. - Each event e at P i is assigned a clock value T(e): timestamp of e - Clock condition: If e1  e2 then T(e1) < T(e2)

Implementation of Clocks Each processor P i increments C i between two successive events If a = send(m) at then P i assigns a timestamp T(m) = T(a) to m and this timestamp is sent along with the message On receiving m, P j does the following: C j = max( T(m) + 1, C j )

Total ordering The set of all events can be totally ordered as follows: Let a and b be events at site i and j respectively. Then, a  b iff either T(a) < T(b) or T(a) = T(b) and i < j

Limitations of Lamport’s Clock If a  b then T(a) < T(b) If T(a) < T(b) then If T(a) = T(b) then

Mutual Exclusion Algorithm Single resource that can be held by at most one process at a time. Each site issues a request to acquire permission to access the resource. Use Lamport’s clock to define the order in which the resource will be accessed.

Mutual Exclusion Algorithm Let req1 and req2 be two request events. If req1  req2 then req1 must be satisfied before req2. Otherwise, the requests are concurrent and can be satisfied in any order.

Algorithm Each site P i maintains a request queue RQ i. RQ i stores requests sorted according to the timestamps. Asynchronous message passing model. FIFO channel. Types of messages: Request, Reply, Release. All messages carry the timestamp.

Algorithm When P i wants to enter its CS, it sends Request(ts i,i) message to all sites, where ts i is the timestamp of the request event. It also places the messages in Rq i. When P j receives Request(ts i,i), it returns a message Reply(ts j,j) and places the request in RQ j.

Algorithm P i can enter its CS if the following conditions hold: - P i has received a message with timestamp larger than (ts i,I) from all sites. - P i ’s request is at the front of RQ i. On exiting CS, P i sends Release message to all sites. On the reception of the release message, the entry is removed from the queue.

Vector Clocks Each process Pi maintains a clock vector C i [0..N-1]. C i [i] is incremented before assigning the timestamp to an event; Let a = send(M) at P i and b be the receive of M at P j. The vector clock is sent along with the message

Vector Clocks On receiving M, P j first increments C j [j] and then updates C j as follows: for all k, C j [k] = max(C j [k], tm[k]), where tm denotes the vector in M.

Vector Clocks Assertion: for all i, for all j, C i [i] >= C j [i]. Comparison of vector clocks Ta = Tb iff for all i, Ta[i] = T[i] Ta < Tb iff for all i, Ta[i] <= Tb[i] and there exists j such that Ta[j] < Tb[j] Ta || Tb iff not(Ta < Tb) and not(Tb < Ta)

Vector Clocks a  b iff Ta < Tb a || b iff Ta || Tb

Broadcast Message is addressed to all processes in a group. Several messages may be sent concurrently to processes in a group.

Causal ordering If send(m1)  send(m2) then every recipient of both m1 and m2 must receive m1 before m2. Point-to-point asynchronous complete network.

Algorithm Birman, Schiper and Stephenson All communication is assumed to be broadcast in nature. Each process P i maintains a vector clock VT i VT i [i] = number of messages P i has broadcast so far

To broadcast M, increments VT i [i] and assigns the timestamp to M. On receiving M with timestamp MT from P i, P j delays its delivery until: VT j [i] = MT[i] - 1 for all k != i, VT j [k] >= MT[k]

Algorithm When M is delivered, P j updates VT j as follows: for all k, VT j [k] = max(VT j [k], MT[k])

Matrix Clocks Vector clocks: VT i [j] = x implies that i has knowledge of x messages from j. Matrix clocks VT i [j,k]: number of messages that i knows that j knows from k