Why do we need models? There are many dimensions of variability in distributed systems. Examples: interprocess communication mechanisms, failure classes,

Slides:



Advertisements
Similar presentations
Processes Management.
Advertisements

Impossibility of Distributed Consensus with One Faulty Process
Communication Networks Recitation 3 Bridges & Spanning trees.
Lecture 8: Asynchronous Network Algorithms
Leader Election Let G = (V,E) define the network topology. Each process i has a variable L(i) that defines the leader.  i,j  V  i,j are non-faulty.
Sliding window protocol The sender continues the send action without receiving the acknowledgements of at most w messages (w > 0), w is called the window.
CSCE 668 DISTRIBUTED ALGORITHMS AND SYSTEMS Fall 2011 Prof. Jennifer Welch CSCE 668 Self Stabilization 1.
Time and Clock Primary standard = rotation of earth De facto primary standard = atomic clock (1 atomic second = 9,192,631,770 orbital transitions of Cesium.
Distributed Systems and Algorithms Sukumar Ghosh University of Iowa Spring 2014.
Byzantine Generals Problem: Solution using signed messages.
Failure Detectors. Can we do anything in asynchronous systems? Reliable broadcast –Process j sends a message m to all processes in the system –Requirement:
1 Complexity of Network Synchronization Raeda Naamnieh.
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.
Group Communications Group communication: one source process sending a message to a group of processes: Destination is a group rather than a single process.
© nCode 2000 Title of Presentation goes here - go to Master Slide to edit - Slide 1 Reliable Communication for Highly Mobile Agents ECE 7995: Term Paper.
CPSC 668Self Stabilization1 CPSC 668 Distributed Algorithms and Systems Spring 2008 Prof. Jennifer Welch.
Bit Complexity of Breaking and Achieving Symmetry in Chains and Rings.
Distributed systems Module 2 -Distributed algorithms Teaching unit 1 – Basic techniques Ernesto Damiani University of Bozen Lesson 4 – Consensus and reliable.
Distributed systems Module 2 -Distributed algorithms Teaching unit 1 – Basic techniques Ernesto Damiani University of Bozen Lesson 2 – Distributed Systems.
The importance of switching in communication The cost of switching is high Definition: Transfer input sample points to the correct output ports at the.
1 A Modular Approach to Fault-Tolerant Broadcasts and Related Problems Author: Vassos Hadzilacos and Sam Toueg Distributed Systems: 526 U1580 Professor:
Introduction Distributed Algorithms for Multi-Agent Networks Instructor: K. Sinan YILDIRIM.
CSE 812. Outline What is a distributed system/program? Program Models Program transformation.
Chapter 14 Asynchronous Network Model by Mikhail Nesterenko “Distributed Algorithms” by Nancy A. Lynch.
Consensus and Its Impossibility in Asynchronous Systems.
Ch11 Distributed Agreement. Outline Distributed Agreement Adversaries Byzantine Agreement Impossibility of Consensus Randomized Distributed Agreement.
RAM, PRAM, and LogP models
Computer Science and Engineering Parallel and Distributed Processing CSE 8380 February 10, 2005 Session 9.
3.1 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts Essentials – 9 th Edition Interprocess Communication Processes within a system may be.
The Complexity of Distributed Algorithms. Common measures Space complexity How much space is needed per process to run an algorithm? (measured in terms.
ITEC452 Distributed Computing Lecture 2 – Part 2 Models in Distributed Systems Hwajung Lee.
Sliding window protocol The sender continues the send action without receiving the acknowledgements of at most w messages (w > 0), w is called the window.
Chap 15. Agreement. Problem Processes need to agree on a single bit No link failures A process can fail by crashing (no malicious behavior) Messages take.
Physical clock synchronization Question 1. Why is physical clock synchronization important? Question 2. With the price of atomic clocks or GPS coming down,
Hwajung Lee.  Models are simple abstractions that help understand the variability -- abstractions that preserve the essential features, but hide the.
Hwajung Lee. Well, you need to capture the notions of atomicity, non-determinism, fairness etc. These concepts are not built into languages like JAVA,
Hwajung Lee. Why do we need these? Don’t we already know a lot about programming? Well, you need to capture the notions of atomicity, non-determinism,
Leader Election (if we ignore the failure detection part)
Hwajung Lee.  Models are simple abstractions that help understand the variability -- abstractions that preserve the essential features, but hide the.
Hwajung Lee. Let G = (V,E) define the network topology. Each process i has a variable L(i) that defines the leader.   i,j  V  i,j are non-faulty ::
CSCE 668 DISTRIBUTED ALGORITHMS AND SYSTEMS Spring 2014 Prof. Jennifer Welch CSCE 668 Set 3: Leader Election in Rings 1.
1 Fault tolerance in distributed systems n Motivation n robust and stabilizing algorithms n failure models n robust algorithms u decision problems u impossibility.
ITEC452 Distributed Computing Lecture 2 – Part 2 Models in Distributed Systems Hwajung Lee.
Failure detection The design of fault-tolerant systems will be easier if failures can be detected. Depends on the 1. System model, and 2. The type of failures.
Alternating Bit Protocol S R ABP is a link layer protocol. Works on FIFO channels only. Guarantees reliable message delivery with a 1-bit sequence number.
Ordering of Events in Distributed Systems UNIVERSITY of WISCONSIN-MADISON Computer Sciences Department CS 739 Distributed Systems Andrea C. Arpaci-Dusseau.
Fault tolerance and related issues in distributed computing Shmuel Zaks GSSI - Feb
Introduction to distributed systems description relation to practice variables and communication primitives instructions states, actions and programs synchrony.
Understanding Models. Modeling Communication: A message passing model System topology is a graph G = (V, E), where V = set of nodes ( sequential processes.
Gokul Kishan CS8 1 Inter-Process Communication (IPC)
Distributed Systems and Algorithms Sukumar Ghosh University of Iowa Fall 2011.
ITEC452 Distributed Computing Lecture 2 – Part 3 Models in Distributed Systems Hwajung Lee.
Leader Election Let G = (V,E) define the network topology. Each process i has a variable L(i) that defines the leader.  i,j  V  i,j are non-faulty ::
Model and complexity Many measures Space complexity Time complexity
Understanding Models.
The Model & Basic Computations
Lecture 9: Asynchronous Network Algorithms
CS 5620 Distributed Systems and Algorithms
Time and Clock.
Leader Election (if we ignore the failure detection part)
Alternating Bit Protocol
Inter Process Communication (IPC)
Time and Clock.
Physical clock synchronization
Leader Election Ch. 3, 4.1, 15.1, 15.2 Chien-Liang Fok 4/29/2019
ITEC452 Distributed Computing Lecture 3 Models in Distributed Systems
CS 5620 Distributed Systems and Algorithms
CS 5620 Distributed Systems and Algorithms
Distributed Systems and Algorithms
Presentation transcript:

Why do we need models? There are many dimensions of variability in distributed systems. Examples: interprocess communication mechanisms, failure classes, security mechanisms etc. Models are simple abstractions that help understand the variability -- abstractions that preserve the essential features, but hide the implementation details from observers who view the system at a higher level.

A message passing model System is a graph G = (V, E). V= set of nodes (sequential processes) E = set of edges (links or channels) (bi/unidirectional) Four types of actions by a process: - Internal action - Communication action - Input action - Output action

A reliable FIFO channel Axiom 1. Message m sent  message m received Axiom 2. Message propagation delay is arbitrary but finite. Axiom 3. m1 sent before m2  m1 received before m2. P Q

Life of a process When a message m is received 1. Evaluate a predicate with m and the local variables; 2. if predicate = true then - update internal variables; -send k (k≥0) messages; else skip {do nothing} end if

Synchrony vs. Asynchrony Send & receive can be blocking or non-blocking Postal communication is asynchronous: Telephone communication is synchronous Synchronous communication or not? (1)RPC, (2) Synchronous clocks Local physical clocks synchronized Synchronous processes Lock-step synchrony Synchronous channels Bounded delay Synchronous message-order First-in first-out channels Synchronous communication Communication via handshaking

Shared memory model Here is an implementation of a channel of capacity (max-1) Sender P writes into the circular buffer and increments the pointer (when p ≠ q-1 mod max) Receiver Q reads from the circular buffer and increments the pointer (when q ≠ p) pq

Variations of shared memory models State reading model. Each process can read the states of its neighbors Link register model. Each process can read from and write ts adjacent buffers

Modeling wireless networks Communication via broadcasting Limited range Dynamic topology Collision of broadcasts (handled by CSMA/CA protocol) Low power RTS CTS

Weak vs. Strong Models One object (or operation) of a strong model = More than one objects (or operations) of a weaker model. Often, weaker models are synonymous with fewer restrictions. One can add layers to create a stronger model from weaker one). Examples HLL model is stronger than assembly language model. Asynchronous is weaker than synchronous. Bounded delay is stronger than unbounded delay (channel)

Model transformation Stronger models - simplify reasoning, but - needs extra work to implement Weaker models - are easier to implement. - Have a closer relationship with the real world Can model X be implemented using model Y is an interesting question in computer science. Sample problems Non-FIFO channel to FIFO channel Message passing to shared memory Atomic broadcast to non-atomic broadcast

A resequencing protocol {sender process P}{receiver process Q} var i : integer {initially 0} var k : integer {initially 0} buffer: buffer [0..∞] of msg {initially  k: buffer [k] = emptyrepeat send m[i],i to Q; {STORE} receive m[i],i from P; i := i+1 store m[i] into buffer[i]; forever {DELIVER} while buffer[k] ≠ empty do begin deliver content of buffer [k]; buffer [k] := empty  k := k+1; end forever

Observations (a) Needs Unbounded sequence numbers and (b) Needs Unbounded number of buffer slots This is bad. Now solve the same problem on a model where (a) The propagation delay has a known upper bound of T. (b) The messages are sent r per unit time. (c) The messages are received at a rate faster than r. The buffer requirement drops to r.T. Synchrony pays. Question. How can we solve the problem using bounded buffer space when the propagation delay is arbitrarily large?

Non-atomic to atomic broadcast We now include crash failure as a part of our model. First realize what the difficulty is with a naïve approach: {process i is the sender} for j = 1 to N-1 (j ≠ i) send message m to neighbor[j] What if the sender crashes at the middle? Suggest an algorithm for atomic broadcast.

Other classifications Reactive vs Transformational systems A reactive system never sleeps (like: a server, or a token ring) A transformational (or non-reactive systems) reaches a fixed point after which no further change occurs in the system Named vs Anonymous systems In named systems, process id is a part of the algorithm. In anonymous systems, it is not so. All are equal. (-) Symmetry breaking is often a challenge. (+) Saves log N bits. Easy to switch one process by another with no side effect)

Model and complexity Many measures oSpace complexity oTime complexity oMessage complexity oBit complexity oRound complexity Consider broadcasting in an n-cube (n=3) source

Broadcasting using messages {Process 0} sends m to neighbors {Process i > 0} repeat receive message m {m contains the value}; if m is received for the first time then x[i] := m.value; send x[i] to each neighbor j > I else discard m end if forever What is the (1) message complexity (2) space complexity per process? Each process j has a variable x[j] initially undefined

Broadcasting using shared memory {Process 0} x[0] := v {Process i > 0} repeat if  a neighbor j < i : x[i] ≠ x[j] then x[i] := x[j] {this is a step} else skip end if forever What is the time complexity? How many steps are needed? Can be arbitrarily large! Each process j has a variable x[j] initially undefined

Broadcasting using shared memory Now, use “large atomicity”, where in one step, a process can read the states of ALL its neighbors. What is the time complexity? How many steps are needed? The time complexity is now O(n 2 ) Each process j has a variable x[j] initially undefined

Complexity in rounds Rounds are truly defined for synchronous systems. An asynchronous round consists of a number of steps where every process (including the slowest one) takes at least one step. How many rounds do you need to complete the broadcast? Each process j has a variable x[j] initially undefined

Exercises Consider an anonymous distributed system consisting of N processes. The topology is a completely connected network, and the links are bidirectional. Propose an algorithm using which processes can acquire unique identifiers. (Hint: use coin flipping, and organize the computation in rounds).

Exercises Alice and Bob enter into an agreement: whenever one falls sick, (s)he will call the other person. Since making the agreement, no one called the other person, so both concluded that they are in good health. Assume that the clocks are synchronized, communication links are perfect, and a telephone call requires zero time to reach. What kind of interprocess communication model is this?