CSCE 668 DISTRIBUTED ALGORITHMS AND SYSTEMS Fall 2011 Prof. Jennifer Welch CSCE 668 Set 14: Simulations 1.

Slides:



Advertisements
Similar presentations
Bellwork If you roll a die, what is the probability that you roll a 2 or an odd number? P(2 or odd) 2. Is this an example of mutually exclusive, overlapping,
Advertisements

1 Concurrency: Deadlock and Starvation Chapter 6.
Zhongxing Telecom Pakistan (Pvt.) Ltd
Analysis of Computer Algorithms
Renate Ristov Fachgebiet Softwaretechnik Prof. Dr. Wilhelm Schäfer 17. Juli 2008 Synthesizing State Machines from Live Sequence Charts Software Quality.
© 2005 by Prentice Hall Appendix 3 Object-Oriented Analysis and Design Modern Systems Analysis and Design Fourth Edition Jeffrey A. Hoffer Joey F. George.
Processes and Operating Systems
Jeopardy Q 1 Q 6 Q 11 Q 16 Q 21 Q 2 Q 7 Q 12 Q 17 Q 22 Q 3 Q 8 Q 13
Jeopardy Q 1 Q 6 Q 11 Q 16 Q 21 Q 2 Q 7 Q 12 Q 17 Q 22 Q 3 Q 8 Q 13
Title Subtitle.
Addition Facts
So far Binary numbers Logic gates Digital circuits process data using gates – Half and full adder Data storage – Electronic memory – Magnetic memory –
1 Interprocess Communication 1. Ways of passing information 2. Guarded critical activities (e.g. updating shared data) 3. Proper sequencing in case of.
ZMQS ZMQS
1 © R. Guerraoui Universal constructions R. Guerraoui Distributed Programming Laboratory.
Construction process lasts until coding and testing is completed consists of design and implementation reasons for this phase –analysis model is not sufficiently.
Week 2 The Object-Oriented Approach to Requirements
Time, Clocks, and the Ordering of Events in a Distributed System
Bus arbitration Processor and DMA controllers both need to initiate data transfers on the bus and access main memory. The device that is allowed to initiate.
Testing Workflow Purpose
Data Structures Using C++
ABC Technology Project
1 Lecture 20: Synchronization & Consistency Topics: synchronization, consistency models (Sections )
Chapter 10 Software Testing
3.1 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Process An operating system executes a variety of programs: Batch system.
Executional Architecture
Global Analysis and Distributed Systems Software Architecture Lecture # 5-6.
Chapter 5 Test Review Sections 5-1 through 5-4.
Addition 1’s to 20.
25 seconds left…...
Week 1.
We will resume in: 25 Minutes.
Chapter 11 Component-Level Design
11-1 FRAMING The data link layer needs to pack bits into frames, so that each frame is distinguishable from another. Our postal system practices a type.
Global States.
Modeling Main issues: What do we want to build How do we write this down.
Impossibility of Consensus in Asynchronous Systems (FLP) Ali Ghodsi – UC Berkeley / KTH alig(at)cs.berkeley.edu.
From Model-based to Model-driven Design of User Interfaces.
1. We use models in an attempt to gain understanding and insights about some aspect of the real world. Attempts to model reality assume a priori the existence.
CS542 Topics in Distributed Systems Diganta Goswami.
1 Programming Languages (CS 550) Mini Language Interpreter Jeremy R. Johnson.
1 © R. Guerraoui The Limitations of Registers R. Guerraoui Distributed Programming Laboratory.
DISTRIBUTED SYSTEMS II FAULT-TOLERANT BROADCAST Prof Philippas Tsigas Distributed Computing and Systems Research Group.
CPSC 668Set 14: Simulations1 CPSC 668 Distributed Algorithms and Systems Spring 2008 Prof. Jennifer Welch.
1 Complexity of Network Synchronization Raeda Naamnieh.
CPSC 668Set 1: Introduction1 CPSC 668 Distributed Algorithms and Systems Fall 2006 Prof. Jennifer Welch.
CS 582 / CMPE 481 Distributed Systems Fault Tolerance.
Distributed systems Module 2 -Distributed algorithms Teaching unit 1 – Basic techniques Ernesto Damiani University of Bozen Lesson 3 – Distributed Systems.
CPSC 668Set 3: Leader Election in Rings1 CPSC 668 Distributed Algorithms and Systems Spring 2008 Prof. Jennifer Welch.
CPSC 668Set 15: Broadcast1 CPSC 668 Distributed Algorithms and Systems Fall 2009 Prof. Jennifer Welch.
CPSC 668Set 9: Fault Tolerant Consensus1 CPSC 668 Distributed Algorithms and Systems Spring 2008 Prof. Jennifer Welch.
CPSC 668Set 16: Distributed Shared Memory1 CPSC 668 Distributed Algorithms and Systems Fall 2006 Prof. Jennifer Welch.
CPSC 668Set 15: Broadcast1 CPSC 668 Distributed Algorithms and Systems Fall 2006 Prof. Jennifer Welch.
Aran Bergman, Principles of Reliable Distributed Systems, Technion EE, Spring Principles of Reliable Distributed Systems Recitation 5: Reliable.
Lecture 12 Synchronization. EECE 411: Design of Distributed Software Applications Summary so far … A distributed system is: a collection of independent.
Formal Model for Simulations Instructor: DR. Lê Anh Ngọc Presented by – Group 6: 1. Nguyễn Sơn Hùng 2. Lê Văn Hùng 3. Nguyễn Xuân Hậu 4. Nguyễn Xuân Tùng.
Modeling Process CSCE 668Set 14: Simulations 2 May be several algorithms (processes) runs on each processor to simulate the desired communication system.
Distributed Algorithms – 2g1513 Lecture 9 – by Ali Ghodsi Fault-Tolerance in Distributed Systems.
CSCE 668 DISTRIBUTED ALGORITHMS AND SYSTEMS Fall 2011 Prof. Jennifer Welch CSCE 668 Set 15: Broadcast 1.
Reliable Communication in the Presence of Failures Based on the paper by: Kenneth Birman and Thomas A. Joseph Cesar Talledo COEN 317 Fall 05.
CSCE 668 DISTRIBUTED ALGORITHMS AND SYSTEMS Spring 2014 Prof. Jennifer Welch CSCE 668 Set 1: Introduction 1.
6.852: Distributed Algorithms Spring, 2008 Class 13.
DISTRIBUTED ALGORITHMS AND SYSTEMS Spring 2014 Prof. Jennifer Welch CSCE
Several sets of slides by Prof. Jennifer Welch will be used in this course. The slides are mostly identical to her slides, with some minor changes. Set.
CSCE 668 DISTRIBUTED ALGORITHMS AND SYSTEMS Spring 2014 Prof. Jennifer Welch CSCE 668 Set 3: Leader Election in Rings 1.
CSCE 668 DISTRIBUTED ALGORITHMS AND SYSTEMS Fall 2011 Prof. Jennifer Welch CSCE 668 Set 16: Distributed Shared Memory 1.
DISTRIBUTED ALGORITHMS Spring 2014 Prof. Jennifer Welch Set 9: Fault Tolerant Consensus 1.
CSCE 668 DISTRIBUTED ALGORITHMS AND SYSTEMS
CSCE 668 DISTRIBUTED ALGORITHMS AND SYSTEMS
CSCE 668 DISTRIBUTED ALGORITHMS AND SYSTEMS
Presentation transcript:

CSCE 668 DISTRIBUTED ALGORITHMS AND SYSTEMS Fall 2011 Prof. Jennifer Welch CSCE 668 Set 14: Simulations 1

Motivation CSCE 668Set 14: Simulations 2  Next section of the course focuses on tools and abstractions for simplifying the design of distributed algorithms.  To approach this rigorously, we need to treat specifications and implementations (a.k.a. "simulations") more generally.

Problem Specifications So Far CSCE 668Set 14: Simulations 3  Approach so far has been problem-specific:  put conditions on processor states as they relate to each other and to initial states  for example: consensus, leader election, etc.  Not so convenient when we want to study simulations from one system model to another, with respect to arbitrary problems

New Way to Specify Problems CSCE 668Set 14: Simulations 4 A problem specification  consists of  an interface  set of inputs and  set of outputs  and a set of allowable sequences of inputs and outputs This is how users of a solution to the problem communicate with the solution.

A New Way to Specify Problems CSCE 668Set 14: Simulations 5 P inputs outputs

Mutual Exclusion Example CSCE 668Set 14: Simulations 6  inputs:  T 0, …, T n-1 T i indicates p i wants to try to enter the critical section  E 0,…, E n-1 E i indicates p i wants to exit the critical section  outputs:  C 0,…,C n-1 C i indicates p i may now enter the critical section  R i,…,R n-1 R i indicates p i may now enter the remainder section

Mutual Exclusion Example CSCE 668Set 14: Simulations 7 Mutual Exclusion T1T1 C1C1 E1E1 R1R1 p1p1 p0p0 p2p2 T2T2 C2C2 E2E2 R2R2 T0T0 C0C0 E0E0 R0R0

Mutual Exclusion Example (cont'd) CSCE 668Set 14: Simulations 8  a sequence  of inputs and outputs is allowable iff, for each i,   |i cycles through T i, C i, E i, R i each proc cycles through trying, critical, exit, and remainder sections in that order  whenever C i occurs, most recent preceding input or output for any j ≠ i is not C j only one process is in the critical section at a time

Mutual Exclusion Example (cont'd) CSCE 668Set 14: Simulations 9  T 1 T 2 C 1 T 3 E 1 C 3 R 1 E 3 R 3  allowable  T 1 T 2 C 1 T 3 C 3 E 1 R 1 E 3 R 3  not allowable

Communication Systems So Far CSCE 668Set 14: Simulations 10  So far, we have explicitly modeled the communication system  inbuf and outbuf state components and deliver events for message passing,  explicit shared variables as part of configurations for shared memory  Not so convenient when we want to study how to provide one kind of communication in software, given another kind.

Different Kinds of Communication Systems CSCE 668Set 14: Simulations 11  Message passing vs. shared memory  different interfaces (sends/receives vs. invocations/responses)  Within message passing:  different levels of reliability, ordering  different guarantees on content (when malicious failures are possible)  Within shared memory:  different shared variable semantics

What Kinds of Simulations? CSCE 668Set 14: Simulations 12  How to provide broadcast (with different reliability and ordering guarantees) on top of point-to-point message passing  How to provide shared objects on top of message passing  How to provide one kind of shared objects on top of another kind  How to provide stronger synchrony on top of an asynchronous system  How to provide better-behaved faulty processors on top of worse-behaved ones

New Way to Model Communication Systems CSCE 668Set 14: Simulations 13  Interpose a communication system between the processors  A particular type of communication system is specified using the approach just described  focus on the desired behavior of the communication system, as observed at its interface, instead of the details of how that behavior is provided

Asynchronous Point-to-Point Message Passing Example CSCE 668Set 14: Simulations 14 Interface is:  inputs: send i (M)  models p i sending set of msgs M  each msg indicates sender and recipient (must be consistent with assumed topology)  outputs: recv i (M)  models p i receiving set of msgs M  each msg in M must have p i as its recipient

Asynch MP Example (cont'd) CSCE 668Set 14: Simulations 15  For a sequence of inputs and outputs (sends and receives) to be allowable, there must exist a mapping  from the msgs in recv events to msgs in send events s.t.  each msg in a recv event is mapped to a msg in a preceding send event   is well-defined: every msg received was previously sent (no corruption or spurious msgs)   is one-to-one: no duplicates   is onto: every msg sent is received

Asynchronous Broadcast Example CSCE 668Set 14: Simulations 16  Inputs: bc-send i (m)  an input to the broadcast service  p i wants to use the broadcast service to send m to all the procs  Outputs: bc-recv i (m, j )  an output of the broadcast service  broadcast service is delivering msg m, sent by p j, to p i

Asynch Bcast Example (cont'd) CSCE 668Set 14: Simulations 17  A sequence of inputs and outputs (bc-sends and bc- recvs) is allowable iff there exists a mapping  from each bc-recv i (m,j) event to an earlier bc-send j (m) event s.t.   is well-defined: every msg bc-recv'ed was previously bc- sent   restricted to bc-recv i events, for each i, is one-to-one: no msg is bc-recv'ed more than once at any single proc.   restricted to bc-recv i events, for each i, is onto: every msg bc-sent is received at every proc.

Processes CSCE 668Set 14: Simulations 18  A piece of code (process) runs on each processor to simulate the desired communication system.  No longer accurate to identify "the algorithm" with the processor, because there may be several algorithms (processes) running on the same processor. For example:  one process (algorithm) that uses the broadcast service  another process (algorithm) that implements the broadcast service on top of a point-to-point MP system

Modeling Process Stack at a Node CSCE 668Set 14: Simulations 19 layer 1layer 2layer 3 environment communication system modeled as a problem spec (interface & allowable sequences) modeled as a problem spec (interface & allowable sequences) modeled as state machines communicate via appropriate primitives: shared events

Intra-Node Communication Pattern CSCE 668Set 14: Simulations 20  Activity is initiated by a node input (input coming in from environment on top or communication system at bottom)  Triggers some activity at the top (or bottom) layer, which in turn can trigger some activity at the layer above or below  Chain reaction can continue for some time but must eventually die out  All activity at one node, in response to a single node input, is assumed to execute atomically (w.r.t. other nodes)

Definition of Execution CSCE 668Set 14: Simulations 21 Sequence C 0 e 1 C 1 e 2 C 2 … of alternating configurations and events s.t.  C 0 is an initial configuration  event e i is enabled in C i-1 (there is a transition from the state(s) of the relevant process(es) in C i-1 labeled e i )  state components of processes change according to the transition functions for e i  can chop the execution into pieces so that  each piece starts with a node input  all events in each piece occur at the same node  the next node input does not occur until no events (other than node inputs) are enabled

Definition of Admissible Execution CSCE 668Set 14: Simulations 22  We only require an algorithm to be correct if  each process is given enough opportunities to take steps (called fairness)  the communication system behaves "properly" and  the environment behaves "properly"  Executions satisfying these conditions are admissible.

Proper Behavior of Communication System CSCE 668Set 14: Simulations 23  The restriction of the execution to the events of the interface at the "bottom of the stack" is an allowable sequence for the problem specification corresponding to the underlying communication system  Example: message passing, every message sent is eventually received

Proper Behavior of Environment CSCE 668Set 14: Simulations 24  The environment (user) interacts "properly" with the top layer of the stack (through the interface events) as long as the top layer is also behaving properly.  Mutex example: the user only requests to leave the critical section if it is currently in the critical section.

Simulations CSCE 668Set 14: Simulations 25 System C 1 simulates system C 2 if there is a set of processes, one per node, called Sim s.t. 1. top interface of Sim is the interface of C 2 2. bottom interface of Sim is the interface of C 1 3. For every admissible execution  of Sim, the restriction of  to the interface of C 2 is allowable for C 2 (according to its problem spec).

Simulations CSCE 668Set 14: Simulations 26 Sim Sim 0 C 2 inputs C 2 outputs C 1 inputs C 1 outputs C1C1 Sim n-1 C 2 inputs C 2 outputs C 1 inputs C 1 outputs … C2C2 If user of C 2 behaves properly and if C 1 behaves properly, then Sim ensures that user of C 2 thinks it is really using C 2 (and not C 1 plus a simulation layer)