Understanding Models.

Slides:



Advertisements
Similar presentations
IPC (Interprocess Communication)
Advertisements

Timed Distributed System Models  A. Mok 2014 CS 386C.
Impossibility of Distributed Consensus with One Faulty Process
PROTOCOL VERIFICATION & PROTOCOL VALIDATION. Protocol Verification Communication Protocols should be checked for correctness, robustness and performance,
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.
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.
Broadcasting Protocol for an Amorphous Computer Lukáš Petrů MFF UK, Prague Jiří Wiedermann ICS AS CR.
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 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.
© 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.
1 Principles of Reliable Distributed Systems Lecture 5: Failure Models, Fault-Tolerant Broadcasts and State-Machine Replication Spring 2005 Dr. Idit Keidar.
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.
Why do we need models? There are many dimensions of variability in distributed systems. Examples: interprocess communication mechanisms, failure classes,
Benjamin Gamble. What is Time?  Can mean many different things to a computer Dynamic Equation Variable System State 2.
Wireless TCP Prasun Dewan Department of Computer Science University of North Carolina
CSE 812. Outline What is a distributed system/program? Program Models Program transformation.
Consensus and Its Impossibility in Asynchronous Systems.
Foundations of Communication on Multiple-Access Channel Dariusz Kowalski.
Byzantine fault-tolerance COMP 413 Fall Overview Models –Synchronous vs. asynchronous systems –Byzantine failure model Secure storage with self-certifying.
Computer Science and Engineering Parallel and Distributed Processing CSE 8380 February 10, 2005 Session 9.
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,
Hwajung Lee.  Models are simple abstractions that help understand the variability -- abstractions that preserve the essential features, but hide the.
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.
“Distributed Algorithms” by Nancy A. Lynch SHARED MEMORY vs NETWORKS Presented By: Sumit Sukhramani Kent State University.
Channels. Models for Communications Synchronous communications – E.g. Telephone call Asynchronous communications – E.g. .
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.
Distributed Systems and Algorithms Sukumar Ghosh University of Iowa Fall 2011.
Fundamentals of Fault-Tolerant Distributed Computing In Asynchronous Environments Paper by Felix C. Gartner Graeme Coakley COEN 317 November 23, 2003.
ITEC452 Distributed Computing Lecture 2 – Part 3 Models in Distributed Systems Hwajung Lee.
Last Class: Introduction
Model and complexity Many measures Space complexity Time complexity
When Is Agreement Possible
“Language Mechanism for Synchronization”
Operating System Reliability
The Model & Basic Computations
CS 5620 Distributed Systems and Algorithms
Time and Clock.
Leader Election (if we ignore the failure detection part)
Alternating Bit Protocol
Distributed Consensus
Distributed Systems, Consensus and Replicated State Machines
Time and Clock.
Fault-tolerant Consensus in Directed Networks Lewis Tseng Boston College Oct. 13, 2017 (joint work with Nitin H. Vaidya)
PRESENTATION COMPUTER NETWORKS
Channels.
Physical clock synchronization
Channels.
Channels.
Leader Election Ch. 3, 4.1, 15.1, 15.2 Chien-Liang Fok 4/29/2019
Data Link Control (DLC) Services
ITEC452 Distributed Computing Lecture 3 Models in Distributed Systems
CS 5620 Distributed Systems and Algorithms
CS 5620 Distributed Systems and Algorithms
M. Mock and E. Nett and S. Schemmer
Presentation transcript:

Understanding Models

Implementation of models How models help algorithms models Implementation of models Real hardware

Modeling Communication System topology is a graph G = (V, E), where V = set of nodes (sequential processes) E = set of edges (links or channels, bi/unidirectional). Four types of actions by a process: - internal action - input action - communication action - output action

Example: A Message Passing Model 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 m When a message m is received The process evaluates a predicate with the message m and the local variables; 2. if predicate = true then update zero or more internal variables; send zero or more messages; end if A B D C E

Example: Shared memory model Address spaces of processes overlap M1 M2 Processes 1 3 2 4 Concurrent operations on a shared variable are serialized

Variations of shared memory models 1 2 State reading model Each process can read the states of its neighbors 3 Link register model Each process can read from and write to adjacent registers. The entire local state is not shared. 1 2 3

Modeling wireless networks Communication via broadcast Limited range Dynamic topology Collision of broadcasts (handled by CSMA/CA) Request To Send RTS RTS CTS Request To Send Clear To Send

Synchrony vs. Asynchrony Synchronous clocks Physical clocks are synchronized Synchronous processes Lock-step synchrony Synchronous channels Bounded delay Synchronous message-order First-in first-out channels Synchronous communication Communication via handshaking Send & receive can be blocking or non-blocking Postal communication is asynchronous: Telephone communication is synchronous Synchronous communication or not? Remote Procedure Call, Email Any constraint defines some form of synchrony …

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

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

Non-FIFO to FIFO channel FIFO = First-In-First-Out m2 m3 m4 m1 P Q Sends out m1, m2, m3, m4, … 7 6 5 4 3 2 1 buffer

Non-FIFO to FIFO channel {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] = empty repeat repeat 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]; Needs unbounded buffer buffer [k] := empty k := k+1; & unbounded sequence no end THIS IS BAD forever

Observations 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 out @ r per unit time. (c) The messages are received at a rate faster than r. The buffer requirement drops to r.T. (Lesson) Stronger model helps. Question. Can we solve the problem using bounded buffer space if the propagation delay is arbitrarily large?

Example 1 second window sender First message Last message receiver

Message-passing to Shared memory {Read X by process i}: read x[i] {Write X:= v by process i} - x[i] := v; Atomically broadcast v to every other process j (j ≠ i); After receiving broadcast, process j (j ≠ i) sets x[j] to v. Understand the significance of atomic operations. It is not trivial, but is very important in distributed systems. Atomic = all or nothing This is incomplete and still not correct. There are more pitfalls here.

Non-atomic to atomic broadcast Atomic broadcast = either everybody or nobody receives {process i is the sender} for j = 1 to N-1 (j ≠ i) send message m to neighbor [j] (Easy!) Now include crash failure as a part of our model. What if the sender crashes at the middle? How to implement atomic broadcast in presence of crash?

Mobile-agent based communication Communicates via messengers instead of (or in addition to) messages. Cedar Rapids University of Iowa What is the lowest Price of an iPad in Iowa? Carries both program and data Best Buy

Other classifications of models Reactive vs Transformational systems A reactive system never sleeps (like: a server) A transformational (or non-reactive systems) reaches a fixed point after which no further change occurs in the system (Examples?) 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. (+) Easy to switch one process by another with no side effect. Saves log N bits.

Knowledge based communication 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?

History The paper “Cheating Husbands and Other Stories: A Case Study of Knowledge, Action, and Communication” by Yoram Moses, Danny Dolev, Joseph Halpern (PODC 1985) illustrates how actions are taken and decisions are made without explicit communication using common knowledge. (Adaptation of Gamow and Stern, “Forty unfaithful wives,” Puzzle Math, 1958) (Bidding in the game of cards like bridge is an example of knowledge-based communication)

Observations Knowledge-based communication relies on making deductions from the absence of a signal. It is energy-efficient, something very relevant in today’s context.

Cheating Husband’s puzzle: The Queen read out the following in a meeting at the town square. There are one or more unfaithful husbands in our community. None of you know whether your husband is faithful. But each of you which of the other husbands are unfaithful. Do not discuss this with anyone, but should you discover that your own husband is unfaithful, you should shoot him on the midnight of the day you find out about it.

What happened after this Thirty nine silent nights went by, and on the fortieth night, gunshots were heard. What was going on for 39 nights? How many unfaithful husbands were there? Why did it take so long?

A simple case W2 does not know of any other unfaithful husband. W2 knows that there is at least one (common knowledge) W2 concludes that it must be H2, and kills him on the first night. W1 H1 W2 H2 W3 H3 W4 H4

Theorem If there are N unfaithful H’s, then they will all be killed on the midnight of the Nth day. If you are interested to learn more, then read the original paper.