KGiSL Institute of Technology
(Approved by AICTE, New Delhi; Affiliated to Anna University, Chennai)
Recognized by UGC, Accredited by NBA (IT)
365, KGiSL Campus, Thudiyalur Road, Saravanampatti, Coimbatore – 641035.
Department of Artificial Intelligence & Data Science
Name of the Faculty : [Link]
Subject Name & Code : CS3551 / DISTRIBUTED COMPUTING
Branch & Department : [Link] & AI&DS
Year & Semester : III / V
Academic Year :2022-23(ODD)
UNIT I INTRODUCTION 8
Introduction: Definition-Relation to Computer System Components – Motivation – Message - Passing Systems versus Shared
Memory Systems – Primitives for Distributed Communication – Synchronous versus Asynchronous Executions – Design Issues and
Challenges; A Model of Distributed Computations: A Distributed Program – A Model of Distributed Executions – Models of
Communication Networks – Global State of a Distributed System.
UNIT II LOGICAL TIME AND GLOBAL STATE 10
Logical Time: Physical Clock Synchronization: NTP – A Framework for a System of Logical Clocks – Scalar Time – Vector Time;
Message Ordering and Group Communication: Message Ordering Paradigms – Asynchronous Execution with Synchronous
Communication – Synchronous Program Order on Asynchronous System – Group Communication – Causal Order – Total Order;
Global State and Snapshot Recording Algorithms: Introduction – System Model and Definitions – Snapshot Algorithms for FIFO
Channels.
UNIT III DISTRIBUTED MUTEX AND DEADLOCK 10
Distributed Mutual exclusion Algorithms: Introduction – Preliminaries – Lamport’s algorithm – Ricart- Agrawala’s Algorithm –– Token-
Based Algorithms – Suzuki-Kasami’s Broadcast Algorithm; Deadlock Detection in Distributed Systems: Introduction – System Model
– Preliminaries – Models of Deadlocks – Chandy-Misra-Haas Algorithm for the AND model and OR Model.
UNIT IV CONSENSUS AND RECOVERY 10
Consensus and Agreement Algorithms: Problem Definition – Overview of Results – Agreement in a Failure-Free
System(Synchronous and Asynchronous) – Agreement in Synchronous Systems with Failures; Checkpointing and Rollback
Recovery: Introduction – Background and Definitions – Issues in Failure Recovery – Checkpoint-based Recovery – Coordinated
Checkpointing Algorithm - - Algorithm for Asynchronous Checkpointing and Recovery
UNIT V CLOUD COMPUTING 7
Definition of Cloud Computing – Characteristics of Cloud – Cloud Deployment Models – Cloud Service Models – Driving Factors and
Challenges of Cloud – Virtualization – Load Balancing – Scalability and Elasticity – Replication – Monitoring
SYLLABUS
UNIT III DISTRIBUTED MUTEX AND DEADLOCK
Distributed Mutual exclusion Algorithms: Introduction – Preliminaries –
Lamport’s algorithm – Ricart- Agrawala’s Algorithm –– Token-Based
Algorithms – Suzuki-Kasami’s Broadcast Algorithm; Deadlock Detection
in Distributed Systems: Introduction – System Model – Preliminaries –
Models of Deadlocks – Chandy-Misra-Haas Algorithm for the AND model
and OR Model.
Course Outcomes
OUTCOMES:
Upon the completion of this course, the student will be able to
CO1: Explain the foundations of distributed systems (K2)
CO2: Solve synchronization and state consistency problems (K3)
CO3 Use resource sharing techniques in distributed systems (K3)
CO4: Apply working model of consensus and reliability of distributed systems (K3)
CO5: Explain the fundamentals of cloud computing (K2)
RICART- AGRAWALA’S ALGORITHM
Ricart–Agrawala algorithm is an algorithm for mutual exclusion in a distributed system
proposed by Glenn Ricart and Ashok Agrawala. This algorithm is an extension and
optimization of Lamport’s Distributed Mutual Exclusion Algorithm.
Like Lamport’s Algorithm, it also follows permission-based approach to ensure mutual
exclusion.
In this algorithm:
Two type of messages ( REQUEST and REPLY) are used and communication channels are assumed to follow
FIFO order.
A site send a REQUEST message to all other site to get their permission to enter the critical section.
A site send a REPLY message to another site to give its permission to enter the critical section.
A timestamp is given to each critical section request using Lamport’s logical clock.
Timestamp is used to determine priority of critical section requests. Smaller timestamp gets high priority over
larger timestamp.
The execution of critical section request is always in the order of their timestamp.
RICART- AGRAWALA’S ALGORITHM
To enter Critical section:
When a site Si wants to enter the CS, it send a timestamped REQUEST message to all
other sites.
When a site Sj receives a REQUEST message from site Si, It sends a REPLY message to
site Si if and only if
Site Sj is neither requesting nor currently executing the critical section.
In case Site Sj is requesting, the timestamp of Site Si‘s request is smaller than its own request.
To execute the critical section:
Site Si enters the critical section if it has received the REPLY message from all other sites.
To release the critical section:
Upon exiting site Si sends REPLY message to all the deferred requests.
RICART- AGRAWALA’S ALGORITHM
Message Complexity: Ricart–Agrawala algorithm requires invocation of 2(N
– 1) messages per CS execution.
These 2(N – 1) messages involves
(N – 1) request messages
(N – 1) reply messages
Performance:
Synchronization delay is equal to maximum message transmission time
It requires 2(N – 1) messages per Critical section execution
RICART- AGRAWALA’S ALGORITHM
RICART- AGRAWALA’S ALGORITHM
RICART- AGRAWALA’S ALGORITHM
RICART- AGRAWALA’S ALGORITHM
Advantages of the Ricart-Agrawala Algorithm:
Low message complexity: The algorithm has a low message complexity as it
requires only (N-1) messages to enter the critical section, where N is the total
number of nodes in the system.
Scalability: The algorithm is scalable and can be used in systems with a large
number of nodes.
Non-blocking: The algorithm is non-blocking, which means that a node can
continue executing its normal operations while waiting to enter the critical section.
Drawbacks of Ricart–Agrawala algorithm:
Unreliable approach: failure of any one of node in the system can halt the
progress of the system. In this situation, the process will starve forever. The
problem of failure of node can be solved by detecting failure after some timeout.
RICART- AGRAWALA’S ALGORITHM
Difference between Lamport Algorithm & Ricart-Agrawala Algorithm
Both the Ricart & Agrawala and Lamport algorithms are contention-based algorithms.
With Lamport’s algorithm, everyone immediately responds to a mutual exclusion request
message whereas with the Ricart & Agrawala, a process that is using the resource will delay its
response until it is done. This avoids the need to send release messages and reduces messaging
traffic.
The Ricart & Agrawala algorithm requires 2(N–1) messages while the Lamport algorithm
requires 3(N–1) messages.
The decision of whether a process has the lock on the resource is also different. The Lamport
algorithm causes every process to have a replicated request queue and the decision of whether
one has a lock is based on whether one is first (earliest) in that queue.
With Ricart & Agrawala, the decision of whether one has a lock is based on whether
acknowledgements have been received from everyone else in the group.