Distributed Computing 5. Synchronization Shmuel Zaks ©

Slides:



Advertisements
Similar presentations
Chapter 5: Tree Constructions
Advertisements

ON THE COMPLEXITY OF ASYNCHRONOUS GOSSIP Presented by: Tamar Aizikowitz, Spring 2009 C. Georgiou, S. Gilbert, R. Guerraoui, D. R. Kowalski.
Distributed Leader Election Algorithms in Synchronous Ring Networks
Impossibility of Distributed Consensus with One Faulty Process
Chapter 6 - Convergence in the Presence of Faults1-1 Chapter 6 Self-Stabilization Self-Stabilization Shlomi Dolev MIT Press, 2000 Shlomi Dolev, All Rights.
Lecture 8: Asynchronous Network Algorithms
Distributed Computing 1. Lower bound for leader election on a complete graph Shmuel Zaks ©
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.
Distributed Computing 2. Leader Election – ring network Shmuel Zaks ©
Gossip and its application Presented by Anna Kaplun.
Distributed Computing 8. Impossibility of consensus Shmuel Zaks ©
Lecture 7: Synchronous Network Algorithms
Computer Science 425 Distributed Systems CS 425 / ECE 428 Consensus
Outline. Theorem For the two processor network, Bit C(Leader) = Bit C(MaxF) = 2[log 2 ((M + 2)/3.5)] and Bit C t (Leader) = Bit C t (MaxF) = 2[log 2 ((M.
Minimum Spanning Trees
Distributed Computing 8. Impossibility of consensus Shmuel Zaks ©
CS4231 Parallel and Distributed Algorithms AY 2006/2007 Semester 2 Lecture 7 Instructor: Haifeng YU.
Byzantine Generals Problem: Solution using signed messages.
Consensus Algorithms Willem Visser RW334. Why do we need consensus? Distributed Databases – Need to know others committed/aborted a transaction to avoid.
Università degli Studi dell’Aquila Academic Year 2009/2010 Course: Algorithms for Distributed Systems Instructor: Prof. Guido Proietti Time: Monday:
1 Complexity of Network Synchronization Raeda Naamnieh.
CPSC 668Set 2: Basic Graph Algorithms1 CPSC 668 Distributed Algorithms and Systems Spring 2008 Prof. Jennifer Welch.
CPSC 668Set 3: Leader Election in Rings1 CPSC 668 Distributed Algorithms and Systems Spring 2008 Prof. Jennifer Welch.
Chapter 4 - Self-Stabilizing Algorithms for Model Conservation4-1 Chapter 4: roadmap 4.1 Token Passing: Converting a Central Daemon to read/write 4.2 Data-Link.
CPSC 668Set 10: Consensus with Byzantine Failures1 CPSC 668 Distributed Algorithms and Systems Fall 2006 Prof. Jennifer Welch.
1 Fault-Tolerant Consensus. 2 Failures in Distributed Systems Link failure: A link fails and remains inactive; the network may get partitioned Crash:
Idit Keidar, Principles of Reliable Distributed Systems, Technion EE, Spring Principles of Reliable Distributed Systems Lecture 5: Synchronous Uniform.
Leader Election in Rings
Distributed systems Module 2 -Distributed algorithms Teaching unit 1 – Basic techniques Ernesto Damiani University of Bozen Lesson 4 – Consensus and reliable.
A Distributed Algorithm for Minimum-Weight Spanning Trees by R. G. Gallager, P.A. Humblet, and P. M. Spira ACM, Transactions on Programming Language and.
DANSS Colloquium By Prof. Danny Dolev Presented by Rica Gonen
Maximal Independent Set Distributed Algorithms for Multi-Agent Networks Instructor: K. Sinan YILDIRIM.
Raeda Naamnieh 1. The Partition Algorithm Intuitively, the idea of the following algorithm is to choose each cluster as a maximal subset of nodes whose.
Efficient Algorithms to Implement Failure Detectors and Solve Consensus in Distributed Systems Mikel Larrea Departamento de Arquitectura y Tecnología de.
Chapter 14 Synchronizers. Synchronizers : Introduction Simulate a synchronous network over an asynchronous underlying network Possible in the absence.
Election Algorithms and Distributed Processing Section 6.5.
Paxos Made Simple Jinghe Zhang. Introduction Lock is the easiest way to manage concurrency Mutex and semaphore. Read and write locks. In distributed system:
Broadcast & Convergecast Downcast & Upcast
Synchronous Algorithms I Barrier Synchronizations and Computing LBTS.
Selected topics in distributed computing Shmuel Zaks
Lecture 8-1 Computer Science 425 Distributed Systems CS 425 / CSE 424 / ECE 428 Fall 2010 Indranil Gupta (Indy) September 16, 2010 Lecture 8 The Consensus.
Lecture #12 Distributed Algorithms (I) CS492 Special Topics in Computer Science: Distributed Algorithms and Systems.
Consensus and Its Impossibility in Asynchronous Systems.
Distributed Computing 3. Leader Election – lower bound for ring networks Shmuel Zaks ©
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.
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.
Leader Election (if we ignore the failure detection part)
DISTRIBUTED ALGORITHMS Spring 2014 Prof. Jennifer Welch Set 2: Basic Graph Algorithms 1.
Vertex Coloring Distributed Algorithms for Multi-Agent Networks
Impossibility of Distributed Consensus with One Faulty Process By, Michael J.Fischer Nancy A. Lynch Michael S.Paterson.
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.
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.
Fault tolerance and related issues in distributed computing Shmuel Zaks GSSI - Feb
Fault tolerance and related issues in distributed computing Shmuel Zaks GSSI - Feb
Fault tolerance and related issues in distributed computing Shmuel Zaks GSSI - Feb
CIS 825 Review session. P1: Assume that processes are arranged in a ring topology. Consider the following modification of the Lamport’s mutual exclusion.
CSE 486/586 CSE 486/586 Distributed Systems Leader Election Steve Ko Computer Sciences and Engineering University at Buffalo.
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 ::
Distributed Processing Election Algorithm
Lecture 9: Asynchronous Network Algorithms
Leader Election (if we ignore the failure detection part)
Parallel and Distributed Algorithms
Lecture 8: Synchronous Network Algorithms
CSCE 668 DISTRIBUTED ALGORITHMS AND SYSTEMS
Leader Election Ch. 3, 4.1, 15.1, 15.2 Chien-Liang Fok 4/29/2019
Presentation transcript:

Distributed Computing 5. Synchronization Shmuel Zaks ©

 I. Impact of synchronization  II. Synchronizer general bounded delay  III. Communication-time trade-off

I. Impact of synchronization In asynchronous network, if I do not receive a message I cannot conclude anything. In a synchronous network, if I do not receive a message at time t, I know it was not sent at time t-1.

This influences computability and complexity. Computability: Impossible to reach consensus in an asynchronous network (cannot distinguish between a slow and a dead processor) Complexity: In a synchronous system we can trade time for messages (see later, in III in this lecture)

Suppose we have a synchronous algorithm. In this algorithm, messages are sent at rounds 0,1,2,… A message sent from P to Q at round t (of P) will be received before round t+1 (of Q). (a stronger assumption will be that all clocks are synchronized) We want to run it on an asynchronous network II. Synchronizers

Synchronous algorithm Asynchronous algorithm Synchronizer + =

There exists a clock at each processor, that generates pulses. M sent from processor P to processor Q at pulse t (of P) arrives at Q before its t+1 st pulse 1. General network

Given a synchronous protocol, we first add to it a mechanism of acknowledgements: whenever Q receives a message from P it first sends an acknowledgement to it, and then proceeds with its other operation. Note: this will double the overall message complexity But: in many protocols a form of acknowledgements already exists - implicitly or explicitly (e.g., PIF)

eventually a node knows when all of its messages, sent in its current pulse t, have been received by its neighbors. safe. We term such a node safe. safe In order to start pulse t+1, it is not sufficient for a node to be safe; it must make sure that all the messages sent to it by its neighbors at their pulse t have been received. safe if a node learns that all of its neighbors are safe, it can move to its next pulse. safe It thus remains to ensure a mechanism that will let a node know that all of its neighbors are safe.

We describe two such synchronizers. 1: local, highly-distributed, where pulses are generated fast, but cost a lot of messages. 2: global, centralized,where pulses are generated slowly, which results in saving of messages.

Synchronizer safe When a node knows that all of its messages of the current pulse have been received, it notifies all of its neighbors that it is safe. safe When a node receives safe messages from all of its neighbors, it moves to its next pulse.

Synchronizer has the property of being expensive in messages – it uses O(|E|) messages per pulse - and cheap in time - clearly O(1), on a network G = (V,E)

Synchronizer Given a rooted spanning tree in the network. Each node knows its parent and children in the tree. The root initiates a pulse, and sends it down the tree. When a node learns that it is safe and all of its children are safe, it sends a safe message to its parent. (this process starts at the leaves. When the root learns that all the nodes are safe, it initiates the next pulse, etc

Synchronizer has the property of being expensive in time - it takes O(|V|) units of time for generating each pulse - and cheap in messages - only O(|V|) messages are sent per each pulse, on a network G = (V,E).

2. Bounded delay network Assumption: a message is delivered within a delay d < 1. Recall: we have a synchronous algorithm. In this algorithm, messages are sent at rounds 0,1,2,… A message sent from P to Q at round t (of P) will be received before round t+1 (of Q). We design a synchronizer for this network.

Initially, nodes set their local timer to 0, using PI. Denote by the global time when node P sets its timer to 0. the actual values of is not known to the processors

By the nature of the PI algorithm: for every two neighboring nodes P and Q. PQ

Each node, upon receiving the first init message, resets its timer to 0 and starts counting time. Its time slot m will begin at time and end before time for will be determined later [ ) [ [ ) )

Message sent by P at pulse m is received by q at time PQ

Send messages at start of a time slot The message of phase m of P will be sent at the beginning of its m-th time slot. That is, at time

Message sent at time Recall: message sent by P at pulse m is received by q at time

Choose: Namely: send messages at times 0,2,4,6,… (rather than 0,1,2,3,…) We want

However… Namely, message received by q after the start of time slot m-1 [)

If we choose - namely, we send the messages at times 0,2,4,6,… (rather than 0,1,2,3,…), then we have to add one bit to each message (0,1,0,1,…), so that we know how exactly to simulate the synchronous algorithm. If we do not want to use this extra bit …

Send messages after delay Message sent at time Recall: message sent by P at pulse m is received by q at time

Choose:

III. Communication-time trade-off In a synchronous system we can trade time for messages. In asynchronous network, if I do not receive a message I cannot conclude anything. In a synchronous network, if I do not receive a message at time t, I know it was not sent at time t-1.

Recall: Example days, 1 professor3 days, 2 professor

Theorem: In a synchronous network, where id’s are integers >0, n known, and smallest id is I, We can find smallest id in time using bits, for any integer b > 0.

If all identities are > x, then all processors become “undecided” and 0 bits are sent. Otherwise, all processors become “decided”, and n bits are sent. (this is for a unidirectional ring of size n)

X>5 ? X>2 ? X>6 ? 67 X>1 ?X>3 ? No Yes 5 X>4 ?

Find the minimum, knowing it is between 1 and 7, using at most 3n bits, and in time at most 4n. X>5 ? X>2 ? X>6 ? 67 X>1 ?X>3 ? No Yes 5 X>4 ?

f(t,b) : largest integer s.t. a minimum in the range 1..f(t,b) can be found using at most t questions and b overestimtes. 1 st problem: Given t, and b, determine N.

54321 b t

Proof: by induction.

X>? ? X>1? X>2 ? לא כן 2 X>1? X>3 ? f(3,2) f(2,1) = 3 f(2,2) = 4 = 3 + 4=7

X>3 ? X>1? X>5 ? 67 X>2 ? לא כן 5 X>4? X>6 ? f(3,2) f(2,1) = 3 f(2,2) = 4 = 3 + 4=7

Optimal and unique tree. Proof: by induction

1 st problem: Given t, and b, determine N. 2 nd problem: Given N and b, determine t.

Proof: hw.

1 st problem: Given t, and b, determine N. 2 nd problem: Given N and b, determine i. 3 rd problem: Given b, determine i

b= b t questions, 1 overestimate

b= b t questions, 1 overestimate 4 questions, 2 overestimate total: 9 questions, 3 overestimate

References B. Awerbuch, An efficient network synchronization protocol 16th STOC, 1984, pp.

References C.T. Chou, I. Cidon, I. Gopal and S. Zaks, Synchronizing Asynchronous Bounded- Delay Networks IEEE Transactions on Communications Vol. 38, No. 2, February 1990, pp

References G. N. Frederickson and N. A. Lynch, The impact of synchronous communicationon the problem of electing a leader in a ring, Proceedings of the 16th ACM Symposium on Theory of Computing(STOC),Washington, D.C., 1984,pp.

References J. van Leeuwen, N. Santoro, J. Urrutia and S. Zaks, Guessing Games and Distributed Computationsin Synchronous Networks Proceedings of the 14th International Colloquium on Automata,Languages and Programming (ICALP), Germany, July 1987, Springer-VerlagLecture Notes in Computer Science No. 267, pp