0% found this document useful (0 votes)
13 views43 pages

LM10

Uploaded by

Kanmani K
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views43 pages

LM10

Uploaded by

Kanmani K
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 43

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 : Ms.T.Suganya & Dr. S. Kalpana

Subject Name & Code : CS3551 / DISTRIBUTED COMPUTING

Branch & Department : B.Tech & 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 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.
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)
Physical Clock?
Logical Clock
Lamport Logical clock
Lamport Logical clock
Lamport Logical clock
Lamport Logical clock
SCALAR TIME

 There are different methods for implementing logical clocks in a distributed system, but one
of the simplest is Scalar Time.

 Scalar time is designed by Lamport to synchronize all the events in distributed systems.

 A Lamport logical clock is an incrementing counter maintained in each process.

 This logical clock has meaning only in relation to messages moving between processes.

 When a process receives a message, it resynchronizes its logical clock with that sender
maintaining causal relationship.

 In this implementation, each process keeps a local clock that is initially set to 0.

 There are two rules for updating the local clock −


SCALAR TIME
SCALAR TIME
SCALAR TIME
SCALAR TIME
SCALAR TIME

Basic Properties of Scalar Time:


1.Consistency property - Clearly, scalar clocks satisfy the monotonicity and hence the
consistency property:
for two events ei and ej, ei → ej ⇒ C(ei) < C(ej)

2. Total Reordering- Scalar clocks order the events in distributed systems. The main
problem in totally ordering events is that two or more events at different processes may
have an identical timestamp. Hence a tie breaking mechanism is essential to order the
events.
The tie breaking is done through:
i)Process identifiers are linearly ordered.
ii)The lower the process identifier in the ranking, the higher the priority.
The timestamp of an event is denoted by a tuple (t, i) where t is its time of occurrence
and i is the identity of the process where it occurred.
SCALAR TIME

Basic Properties of Scalar Time:

3. Event counting - If event e has a timestamp h, then h−1 represents the minimum
logical duration, counted in units of events, required before producing the event e. This
is called height of the event e.

4. No strong consistency- The scalar clocks are not strongly consistent that is the
logical local clock and logical global clock of a process are squashed into one, resulting
in the loss causal dependency information among events at different processes.
Limitations of Lamport’s Clock
Limitations of Lamport’s Clock

Issue 1: Partial Ordering


Issue 2: Lamport clock does not capture the
concurrency ie cannot establish concurrent
relation ship between events
Vector Clock
VECTOR TIME

 Vector Time is an algorithm that generates partial ordering of events and detects
causality violations in a distributed system.

 These clocks expand on Scalar time to facilitate a causally consistent view of the
distributed system, they detect whether a contributed event has caused another
event in the distributed system.

 It essentially captures all the causal relationships.

 This algorithm helps us label every process with a vector(a list of integers) with an
integer for each local clock of every process within the system. So for N given
processes, there will be vector/ array of size N.
VECTOR TIME
VECTOR TIME
VECTOR TIME

 Initially, all the clocks are set to zero.

 Every time, an Internal event occurs in a process, the value of the processes’s logical
clock in the vector is incremented by 1

 Also, every time a process sends a message, the value of the processes’s logical
clock in the vector is incremented by 1.

 Every time, a process receives a message, the value of the processes’s logical clock
in the vector is incremented by 1, and moreover, each element is updated by taking
the maximum of the value in its own vector clock and the value in the vector in the
received message (for every element).
VECTOR TIME
VECTOR TIME
VECTOR TIME
VECTOR TIME –calculate clock time of e11
VECTOR TIME –calculate clock time of e12
VECTOR TIME –calculate clock time of e21
VECTOR TIME –calculate clock time of e22
VECTOR TIME –calculate clock time of e23=> calc e31 first
VECTOR TIME –calculate clock time of e23
VECTOR TIME –calculate clock time of e24
VECTOR TIME –calculate clock time of e13
VECTOR TIME –calculate clock time of e32
VECTOR TIME

 Example : Consider a process (P) with a vector size N for each process: the above set of rules
mentioned are to be executed by the vector clock:
VECTOR TIME

 The above example depicts the vector clocks mechanism in which the vector
clocks are updated after execution of internal events, the arrows indicate how the
values of vectors are sent in between the processes (P1, P2, P3).

 To sum up, Vector clocks algorithms are used in distributed systems to provide
a causally consistent ordering of events but the entire Vector is sent to each
process for every message sent, in order to keep the vector clocks in sync.
VECTOR TIME

Basic Properties of Vector Time:

1.Isomorphism -
If events in a distributed system are timestamped using a system of vector clocks,
we have the following property.

If two events x and y have timestamps vh and vk, respectively, then


x → y ⇔ vh < vk
x ║ y ⇔ vh ║vk.

2. Strong consistency –
The system of vector clocks is strongly consistent; thus, by examining the vector
timestamp of two events, we can determine if the events are causally related.
VECTOR TIME

Basic Properties of Vector Time:

3. Event Counting –

If d=1 (in rule R1), then the ith component of vector clock at process pi , vti[i],
denotes the number of events that have occurred at pi until that instant.

You might also like