Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Distributed Information Systems Lecture 13 - Mutual Exclusion V1, Lecture notes of Computers and Information technologies

This document about Coordination and Agreement, Mutual exclusion, Elections and agreement, R-Multicast using coordination and agreement, Introduction, Rationale for this lecture.

Typology: Lecture notes

2010/2011

Uploaded on 09/09/2011

rossi46
rossi46 🇬🇧

4.5

(10)

313 documents

1 / 24

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Coordination and
Agreement
Dr Simon Blake
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18

Partial preview of the text

Download Distributed Information Systems Lecture 13 - Mutual Exclusion V1 and more Lecture notes Computers and Information technologies in PDF only on Docsity!

Coordination and

Agreement Dr Simon Blake

Introduction

-^

Mutual exclusion^ – Server algorithm– Ring algorithm– Multicast algorithm

-^

Elections and agreement^ – Functional and non-functional requirements– Bully algorithm– Ring algorithm

-^

R-Multicast using coordination and agreement

The central server algorithm

P3 holds the token

P2 requests access andjoins the server queue

P3 releases the tokenP4 is then granted the tokenP2 is now top of the serverqueue

Central Server Algorithm

• Relies on messaging (performance cost)

  • Clients ask for tokens– Clients are issued the token– Clients release tokens

• Sever can become a bottleneck• Meets three key objectives

  • At most one access– Liveliness– Fairness

Multicast synchronization

Three processes P

, P 1

and P 2

3

P^1

and P

both want access to a critical section at the same time 2

They timestamp their requests using their clocks and multicast to otherprocesses.Only when they get a response from all other process to they enter thecritical section

Multicast synchronization

P^1

and P

both request access 2

concurrently. They multicast their requestto all other processes – sending their timestamps

P^3

does not want access and so says OK to bother request. P

concedes and says 1

OK as it has a higher timestamp. Thus,P^2

enters the critical section. When P

is finished it too says OK, thus 2

P^1

has then received an okay from both process P

and P 1

3

S

M

S

S

S

S

M

S

S

S X

S S

S

S^

M S

S

S

Normal

  1. Master
  2. Slaves
  3. New master

operation

fails

negotiate

elected

-^

Roles^ – Master (coordinator)

  • The role of the master is to coordinate a distributed /

replicated service or application.

  • Slave
    • To monitor the presence of the master.• On detection of its failure, to elect a new master from the

pool of slaves.

Elections

•^

The proportion of time that a master exists should bevery high.

-^

A replacement must be found quickly if the currentmaster is removed.

-^

Multi-master scenarios must be detected and resolvedquickly.

-^

Spurious elections caused by falsely detecting masterfailure should be avoided.

-^

Normal-mode communication complexity must be low.

-^

Election-mode communication complexity must be low.

-^

Communications overhead (the mean totalcommunication bandwidth required by the electionalgorithm) must be low.

Functional requirements

The Bully algorithm

•^

This algorithm using 3 message types:^ – coordinator:

-^

announcement to all processes with lower IDs

  • election: -^

sent to processes with higher IDs

  • answer: -^

answer to “election”

-^

If answer is not received within a time bound then the sender of“election” sends “coordinator” message

-^

Otherwise, the process waits for T’ to receive a “coordinator”message

-^

If no message arrives, it begins a new election.

The Bully Algorithm

Stage 1

Process 4 holds an election – itsends election messages to

processes with higher IDs

Stage 2

Process 5 and Process 6 receivethe messages and responds withanswer messages telling process4 to stop. Process 7 does not

respond as it has crashed.

Stage 3

Process 5 and Process 6 holdelections sending electionmessages to processes with

higher IDs

•^

Similar to the bully algorithm, but the nodes arearranged in logical ring.

-^

Nodes only communicate with their logical neighbours.

-^

When the master is lost, its neighbours will notice (lackof periodic messages).

-^

The nodes pass messages around the ring (in severalrounds) to establish which is the highest numberednode and to ensure consensus.

The Ring Algorithm

S(4) 1. Normaloperation

M(7)

S(2)

S(1)

S(5)

  1. Master

fails S(4)

M(7)

S(2)

S(1)

S(5)^ X

S(4) S(2)

S(1)

S(5)

  1. Node 1notices thefailure.Node 1 startsthe electionrounds.

S(4) S(2)

S(1)

S(5)

  1. This continuesuntil a master is

chosen andconsensus isreached.

S(4) 5. Node 5takes overas master. S(2)

S(1)

M(5)

The Bully Algorithm

Multicast and Agreement

  • multicast communication requires

coordination and agreement

  • Why?• For reliability
    • For 1-1 communication we defined reliable

communication as being a communicationthat guarantees

validity

and

integrity

  • We need reliability in multicasting too

B-multicast

  • lets assume that our reliability comes from

the use of a 1-1 send operation (B-Muliticast)

  • Our multicast involves sending to each

process in groups

  • The receiver sends an acknowledgment

message

  • Can lead to ACK-implosion
    • Too acknowledgements filling receive buffers

leading to resends