Lecture 9: Asynchronous Network Algorithms

Slides:



Advertisements
Similar presentations
Chapter 5: Tree Constructions
Advertisements

Distributed Leader Election Algorithms in Synchronous Ring Networks
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.
Uncoordinated Checkpointing The Global State Recording Algorithm Cristian Solano.
Chapter 15 Basic 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.
6.852: Distributed Algorithms Spring, 2008 Class 12.
Time and Global States Part 3 ECEN5053 Software Engineering of Distributed Systems University of Colorado, Boulder.
Termination Detection of Diffusing Computations Chapter 19 Distributed Algorithms by Nancy Lynch Presented by Jamie Payton Oct. 3, 2003.
Lecture 7: Synchronous Network Algorithms
Minimum Spanning Trees
1 Causality. 2 The “happens before” relation happens before (causes)
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.
1 Complexity of Network Synchronization Raeda Naamnieh.
CS 582 / CMPE 481 Distributed Systems
CPSC 668Set 2: Basic Graph Algorithms1 CPSC 668 Distributed Algorithms and Systems Spring 2008 Prof. Jennifer Welch.
CMPT 431 Dr. Alexandra Fedorova Lecture VIII: Time And Global Clocks.
Computer Science Lecture 11, page 1 CS677: Distributed OS Last Class: Clock Synchronization Logical clocks Vector clocks Global state.
EEC-681/781 Distributed Computing Systems Lecture 11 Wenbing Zhao Cleveland State University.
Computer Science Lecture 10, page 1 CS677: Distributed OS Last Class: Clock Synchronization Physical clocks Clock synchronization algorithms –Cristian’s.
Election Algorithms and Distributed Processing Section 6.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 Algorithms 2014 Igor Zarivach A Distributed Algorithm for Minimum Weight Spanning Trees By Gallager, Humblet,Spira (GHS)
DISTRIBUTED ALGORITHMS By Nancy.A.Lynch Chapter 18 LOGICAL TIME By Sudha Elavarti.
Computer Science and Engineering Parallel and Distributed Processing CSE 8380 February 10, 2005 Session 9.
1 Leader Election in Rings. 2 A Ring Network Sense of direction left right.
Lecture #14 Distributed Algorithms (II) CS492 Special Topics in Computer Science: Distributed Algorithms and Systems.
Leader Election (if we ignore the failure detection part)
DISTRIBUTED ALGORITHMS Spring 2014 Prof. Jennifer Welch Set 2: Basic Graph Algorithms 1.
Election Distributed Systems. Algorithms to Find Global States Why? To check a particular property exist or not in distributed system –(Distributed) garbage.
Fault tolerance and related issues in distributed computing Shmuel Zaks GSSI - Feb
1 Chapter 11 Global Properties (Distributed Termination)
CIS 825 Review session. P1: Assume that processes are arranged in a ring topology. Consider the following modification of the Lamport’s mutual exclusion.
Efficient Algorithms for Distributed Snapshots and Global Virtual Time Approximation Author: Friedermann Mattern Presented By: Shruthi Koundinya.
CIS 825 Lecture 9. Minimum Spanning tree construction Each node is a subtree/fragment by itself. Select the minimum outgoing edge of the fragment Send.
Distributed Systems Lecture 6 Global states and snapshots 1.
Distributed Leader Election Krishnendu Mukhopadhyaya Indian Statistical Institute, Kolkata.
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 ::
Global state and snapshot
The Echo Algorithm The echo algorithm can be used to collect and disperse information in a distributed system It was originally designed for learning network.
Advanced Topics in Concurrency and Reactive Programming: Time and State Majeed Kassis.
Global state and snapshot
Lecture 3: State, Detection
CSE 486/586 Distributed Systems Global States
Theoretical Foundations
The Model & Basic Computations
Distributed Snapshots & Termination detection
ITEC452 Distributed Computing Lecture 9 Global State Collection
Distributed Snapshot.
Lecture 7: Introduction to Distributed Computing.
Leader Election (if we ignore the failure detection part)
Alternating Bit Protocol
EECS 498 Introduction to Distributed Systems Fall 2017
Parallel and Distributed Algorithms
湖南大学-信息科学与工程学院-计算机与科学系
Logical Clocks and Casual Ordering
Time And Global Clocks CMPT 431.
Distributed Snapshot Distributed Systems.
Lecture 8: Synchronous Network Algorithms
CSCE 668 DISTRIBUTED ALGORITHMS AND SYSTEMS
ITEC452 Distributed Computing Lecture 8 Distributed Snapshot
Leader Election Ch. 3, 4.1, 15.1, 15.2 Chien-Liang Fok 4/29/2019
Distributed Snapshot.
CSE 486/586 Distributed Systems Global States
Distributed algorithms
CIS825 Lecture 5 1.
Virtual LAN (VLAN).
Distributed Snapshot.
Presentation transcript:

Lecture 9: Asynchronous Network Algorithms Completely asynchronous distributed computational model No assumption for speed of processes. No assumption for transmission delay of communication links. No assumption for speed of local clocks. Nondeterministic caused by asynchronous A C B (1) send m1 (2) send m2 (3) receive m2 (4) send m2 Which one is received first, m1 or m2?

Model of Send/Receive System Let an n-node directed graph G=(V,E) represents an asynchronous network, where nodes are processes and directed edges are communication channels. process i process i process j communication channel process k communication channel Reliable FIFO channel: any message received must have been sent at some earlier time

Problems 1 Leader Election in An asynchronous Ring Assumption of the network Network graph G=(V,E) is a ring, where node set V={1,2,…,n} and edge set E={(i,i+1), where i=1,2,…,n and i is counted mod n}. Each process has a unique distinct identifier (UID). Each node uses only unidirectional communication and knows only its UID (it does not know the size of the ring and its neighbors). Only the leader performs an output. AsychLCR algorithm (informal) At each process there is a FIFO queue of UIDs, initially containing only its own UID. Each process removes and sends the first element of its FIFO queue. (2) When a process receives an incoming identifier, it compares that identifier to its own. If the incoming identifier is greater than its own, it add it into its FIFO queue; if it is less than its own, it discards the incoming identifier; if it is equal to its own, the process declares itself the leader.

Theorem AsynchLCR solves the leader-election problem. Analysis of Complexity of AsychLCR Algorithm Communication complexity: Time complexity:

Problem2 Leader Election in a General asynchronous Network Assumption of the network Undirected connected graph G=(V,E) having n node, where there is bidirectional communication on all the edges. Processes do not know their indices, nor those of their neighbors, but refer to their neighbors by local names. If a process i has the same process j for both incoming and outgoing neighbor, then i knows that the two processes are the same.

AsychFloodMax algorithm (informal) Use FIFO queue for communicational channel. Simulation the rounds of the following synchronous algorithm: Send a round r message to tag that message with its round number r. The recipient waits to receive round r messages from all its neighbors before performing its round r transition. By simulating diam (diameter of the network) round, the algorithm can terminate correctly. Suppose that each process has a unique distinct UID and it knows diam, the diameter of network. Each process maintains a record of the maximum UID it has seen so far (initially its own). At each round, each process propagates it maximum on all of its outgoing edges. After diam rounds, if the maximum value seen is the process’s own UID, the process elects itself the leader; otherwise, it is a non-leader. FloodMax algorithm (informal)

Problem 3 Spanning Tree Construction Assumption of the network Undirected and connected network digraph G=(V,E) having n nodes and a distinguished source note s. Output is the structure of a spanning tree of the network graph with root s in a distributed fashion: each process other than s should have a parent component that gets set to indicate the node that is its parent in the tree. Processes know its neighbors’ indices. They have no knowledge of the size or diameter of the network. No UIDs are needed. AsynchBFS algorithms Use FIFO queue for communicational channel At any point during execution, there is some set of processes that is “marked”, initially just s. Process s sends out a search message, to all of its outgoing neighbors. If an unmarked process receives a search message, it marks itself and chooses one of the processes from which the search has arrived as its parent, then it sends a search message to all of its outgoing neighbors.

Application to Message Broadcast Problem AsynchBFS algorithm can be used to Message Broadcast problem: piggyback the message m on all search messages during the formation of the spanning tree.

Problem 4: Clock of Asynchronous Distributed Systems and Snapshot algorithms Space and Time Diagram space time p1 p2 p3 p4 receive event send event internal event

Causal Relation space time p1 p2 p3 p4 receive event send event internal event

Role of Clock Determining a causal relation for events. Local Clock No use for determining the order of the events of different processes. Two type of clocks: logical clock and vector clock. Condition of Clock

Lamport’s Logical Clock

Property of Lamport’s logical clock Logical clock satisfies the condition of clock Clock condition does not satisfy causal relation space time p1 p2 p3 p4 receive event send event internal event 1 2 3 4 1 1 2 3 5 3 1 4 1 4 2 3 4

Application of Lamport’s Logical Clock: Bank System $10 2 3 $20 $30 $1 P1,2 4 8 1 5 P2,4 $3 P3,1 $2 9 $4 P1,10 6 $5 P3,6 7 10 11 12 P3,8 P1,11 P2,12 P1 P2 P3 CountMoney algorithm Use a predetermined logical time t, assumed to be known to all processes. For each process, determine the value of money after all events with logical times less than or equal to t and before all events with logical times greater than t. 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. t=7.5 $10-$1+$5=$14 $20+$1-$3+2=$20 $30-$2+$3-$5=$26

Problem 5: Global Configuration of Distribute Systems and Snapshot Algorithms Global Configuration of Distributed Systems: states of processes (local memory), states of communication links (message), which are used for Dead lock detection Termination detection Backup at some check point (for recovery from failures) Snapshot Algorithms: Distributed algorithms for finding global configuration

Freeze all the processes and collect the state of each process. $10 2 3 $20 $30 $1 P1,2 4 8 1 5 P2,4 $3 P3,1 $2 9 $4 P1,10 6 $5 P3,6 7 10 11 12 P3,8 P1,11 P2,12 P1 P2 P3 t=7.5 Example: Snapshot at time t=7.5 How to take a snapshot Freeze all the processes and collect the state of each process. ---Inefficient! Using global clock: broadcast the global time t and collect the state of each process at time t. --- Global clock may not exist! Using logical clock.

Chandy and Lamport’s Snapshot Algorithm The algorithm collects the state of each process and the state of each link (the messages in communication) One process finds its own state, then send message <mark> to each of its neighbors. For each process p (a) if p receives <mark> first time, it finds its own state, and then send <mark> to each of its neighbors. (b) p continues to receive message <mark> from all its neighbors as follows: Assuming that t(0) is the time p received the first <mark>, p collect all the message from any neighbor q until p get message <mark> form q. p q m1,m2 m3 mark p q mark m1 m2 p q p q m1,m2,m3 mark Start process mark m1

Exercise (1) Reconsider the banking system. Now suppose that the underlying banking system A allows deposits and withdrawals (modeled as input actions at the user interface of the system ) in addition to transfers. If we apply the same Count Money transformation as before, what can be claimed about the output of the resulting systems?