University of Makeni (Unimak) Sylvanus Koroma

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 14

UNIVERSITY OF

MAKENI(UNIMAK) SYLVANUS
KOROMA CAMPUS YONI
ASSIGNMENT
ON INTRUDUCTION AND DISTRIBUTED EXCLUSION IN COORDINATION
AND AGREEMENT IN DISTRIBUTED SYSTEM
GROUP MEMBERS
• JULIUS LAGGAH(ID 5203)
• ADEWOLE DAVIES(4837)
• SULAIMAN KAMANDA(4866)
• ALFRED J KAJUE(5154)
• VANESSA RUTH JENGO(4391)
• MOHAMED B BAH (5085)
• ANTONY RAYMOND DOUGLAS(5194)
INTRODUCTION
COORDINATION AND AGREEMENT IN DISTRIBUTED SYSTEM
• We start by addressing the question of why process need to coordinate
their actions and agree on values in various scenarios.
• Consider a mission critical application that requires several computers
to communicate and decide whether to proceed with or abort a
mission. Clearly, all must come to agreement about the fate of the
mission.
• Consider the Berkeley algorithm for time synchronization. One of the
participate computers serves as the coordinator. Suppose that
coordinator fails. The remaining computers must elect a new
coordinator.
COORDINATION AND AGREEMENT IN DISTRIBUTED
SYSTEM

• Broadcast networks like Ethernet and wireless must agree on which nodes
can send at any given time. If they do not agree, the result is a collision
and no message is transmitted successfully.
• Like other broadcast networks, sensor networks face the challenging of
agreeing which nodes will send at any given time. In addition, many sensor
network algorithms require that nodes elect coordinators that take on a
server-like responsibility. Choosing these nodes is particularly challenging
in sensor networks because of the battery constraints of the nodes.
• Many applications, such as banking, require that nodes coordinate their
access of a shared resource. For example, a bank balance should only be
accessed and updated by one computer at a time.
Failure Assumptions and Detection

• Coordination in a synchronous system with no failures is comparatively easy. We'll


look at some algorithms targeted toward this environment. However, if a system is
asynchronous, meaning that messages may be delayed an indefinite amount of time,
or failures may occur, then coordination and agreement become much more
challenging.
• A correct process "is one that exhibits no failures at any point in the execution under
consideration." If a process fails, it can fail in one of two ways: a crash failure or a
byzantine failure. A crash failure implies that a node stops working and does not
respond to any messages. A byzantine failure implies that a node exhibits arbitrary
behavior. For example, it may continue to function but send incorrect values.
FAILURE DETECTION

• Failure Detection
• One possible algorithm for detecting failures is as follows:
• Every t seconds, each process sends an "I am alive" message to all other processes.
• Process p knows that process q is either unsuspected, suspected, or failed.
• If p sees q's message, it sets q's status to unsuspected.
• This seems ok if there are no failures. What happens if a failure occurs? In this
case, q will not send a message. In a synchronous system, p waits for d seconds
(where d is the maximum delay in message delivery) and if it does not hear
from q then it knows that q has failed. In an asynchronous system, q can be
suspected of failure after a timeout, but there is no guarantee that a failure has
occurred.
MUTUAL EXCLUSION IN DISTRIBUTED
SYSTEM

• Mutual exclusion is a concurrency control property which is introduced to prevent race


conditions. It is the requirement that a process can not enter its critical section while another
concurrent process is currently present or executing in its critical section i.e only one process is
allowed to execute the critical section at any given instance of time.
• Mutual exclusion in single computer system Vs. distributed system:
In single computer system, memory and other resources are shared between different
processes. The status of shared resources and the status of users is easily available in the shared
memory so with the help of shared variable (For example: Semaphores) mutual exclusion
problem can be easily solved.
• In Distributed systems, we neither have shared memory nor a common physical clock and there
for we can not solve mutual exclusion problem using shared variables. To eliminate the mutual
exclusion problem in distributed system approach based on message passing is used.
• A site in distributed system do not have complete information of state of the system due to lack
of shared memory and a common physical clock.
A RING BASED ELECTION IN
PROGRESS
Requirements of Mutual exclusion
Algorithm:
• No Deadlock:
Two or more site should not endlessly wait for any message that will never arrive.
• No Starvation:
Every site who wants to execute critical section should get an opportunity to execute it in
finite time. Any site should not wait indefinitely to execute critical section while other
site are repeatedly executing critical section
• Fairness:
Each site should get a fair chance to execute critical section. Any request to execute
critical section must be executed in the order they are made i.e Critical section execution
requests should be executed in the order of their arrival in the system.
• Fault Tolerance:
In case of failure, it should be able to recognize it by itself in order to continue
functioning without any disruption.
Solution to distributed mutual exclusion:
• As we know shared variables or a local kernel can not be used to
implement mutual exclusion in distributed systems. Message passing
is a way to implement mutual exclusion. Below are the three
approaches based on message passing to implement mutual exclusion
in distributed systems:
Solution to distributed mutual exclusion
• Token Based Algorithm:A unique token is shared among all the sites.
• If a site possesses the unique token, it is allowed to enter its critical
section
• This approach uses sequence number to order requests for the critical
section.
• Each requests for critical section contains a sequence number. This
sequence number is used to distinguish old and current requests.
• This approach insures Mutual exclusion as the token is unique
Solution to distributed mutual exclusion
• Non-token based approach:A site communicates with other sites in order
to determine which sites should execute critical section next. This requires
exchange of two or more successive round of messages among sites.
• This approach use timestamps instead of sequence number to order
requests for the critical section.
• When ever a site make request for critical section, it gets a timestamp.
Timestamp is also used to resolve any conflict between critical section
requests.
• All algorithm which follows non-token based approach maintains a logical
clock. Logical clocks get updated according to Lamport’s scheme
Solution to distributed mutual exclusion
• Quorum based approach:Instead of requesting permission to execute
the critical section from all other sites, Each site requests only a
subset of sites which is called a quorum.
• Any two subsets of sites or Quorum contains a common site.
• This common site is responsible to ensure mutual exclusion
.
• END

You might also like