SlideShare a Scribd company logo
2
Most read
6
Most read
7
Most read
DISTRIBUTED SYSTEM
Lamppost’s& vectors logical
clocks
BY-PINKI KUMARI SONI
LOGICAL CLOCK
• A logical clock is a mechanism for capturing chronological and causal
relationships in a distributed system. Distributed systems may have no
physically synchronous global clock, so a logical clock allows global
ordering on events from different processes in such systems.
• Note- chronological: the relation of a serial to its predecessors and successors
• Casual-Causation indicates that one event is the result of the occurrence of the other event;
i.e. there is a causal relationship between the two events.
Distributed system lamport's and vector algorithm
LOGICAL CLOCK USE AND
ALGORITHMS
• Logical clocks are useful in computation analysis, distributed algorithm design,
individual event tracking, and exploring computational progress.
• Some noteworthy logical clock algorithms are:
• Lamport’s timestamps, which are monotonically increasing software counters.
• Vector clocks, that allow for partial ordering of events in a distributed system.
Timestamp-a digital record of the time of occurrence of a particular event.
LAMPORT’S
• Lamport’s clocks are a simple technique used for determining the order of
events in a distributed system.
• This clock was proposed by Leslie Lamport , a Lamport clock maintains order
of operations by incrementing a counter contained in the events
• By simply adding a counter value to events as they are received and
incrementing this value based on the last seen value,
• Lamport clocks provide a partial ordering of events – specifically “happened-
before” ordering.
LAMPORT’S ALGORITHM FOLLOWS
SOME SIMPLE RULES:
• A process increments its counter before each event in that process;
• When a process sends a message, it includes its counter value with the message;
• On receiving a message, the counter of the recipient is updated, if necessary, to the greater
of its current counter and the timestamp in the received message. The counter is then
incremented by 1 before the message is considered received.
The algorithm for sending:
• time = time+1;
• time_stamp = time;
• send(message, time_stamp);
The algorithm for reciving:
• (message, time_stamp) = receive();
• time = max(time_stamp, time)+1;
Distributed system lamport's and vector algorithm
VECTOR CLOCK
• A vector clock is an algorithm for generating a partial ordering of events in a
distributed system and detecting causality violations. Just as in Lamport
timestamps, interprocess messages contain the state of the sending
process'slogical clock.
VECTOR CLOCK ALGORITHM
• Initially, all vectors [0,0,…,0]
• For event on process i, increment own ci
• Label message sent with local vector
• When process j receives message with vector [d1, d2, …, dn]:
• Set local each local entry k to max(ck, dk)
• Increment value of cj
Distributed system lamport's and vector algorithm
IMPORTANT POINTS
• Physical Clocks
• Can keep closely synchronized, but never perfect
• Logical Clocks
• Encode causality relationship
• Lamport’s clocks provide only one-way encoding
• Vector clocks provide exact causality information
• Causality – If a b then event a can affect event b
• Concurrency – If neither a  b nor b a then one event cannot affect the other
• Partial Ordering – Causal events are sequenced
• Total Ordering – All events are sequenced
Distributed system lamport's and vector algorithm

More Related Content

What's hot (20)

PPTX
Message and Stream Oriented Communication
Dilum Bandara
 
PPTX
Replication in Distributed Systems
Kavya Barnadhya Hazarika
 
DOC
Distributed Mutual exclusion algorithms
MNM Jain Engineering College
 
PDF
8. mutual exclusion in Distributed Operating Systems
Dr Sandeep Kumar Poonia
 
PPTX
Vector clock algorithm
S. Anbu
 
PPTX
Distributed Mutual Exclusion and Distributed Deadlock Detection
SHIKHA GAUTAM
 
PPT
File replication
Klawal13
 
PPTX
Critical section problem in operating system.
MOHIT DADU
 
PPTX
Database , 12 Reliability
Ali Usman
 
PPT
Types of Load distributing algorithm in Distributed System
DHIVYADEVAKI
 
PPTX
Scheduling
pradeepa velmurugan
 
PPT
Group Communication (Distributed computing)
Sri Prasanna
 
PPTX
distributed Computing system model
Harshad Umredkar
 
PPTX
Physical and Logical Clocks
Dilum Bandara
 
PPT
Synchronization in distributed systems
SHATHAN
 
PPT
Distributed Deadlock Detection.ppt
Babar Kamran Ahmed (LION)
 
PPT
remote procedure calls
Ashish Kumar
 
PPTX
Distributed web based systems
Reza Gh
 
PPT
Lamport’s algorithm for mutual exclusion
Neelamani Samal
 
PPTX
Message passing in Distributed Computing Systems
Alagappa Govt Arts College, Karaikudi
 
Message and Stream Oriented Communication
Dilum Bandara
 
Replication in Distributed Systems
Kavya Barnadhya Hazarika
 
Distributed Mutual exclusion algorithms
MNM Jain Engineering College
 
8. mutual exclusion in Distributed Operating Systems
Dr Sandeep Kumar Poonia
 
Vector clock algorithm
S. Anbu
 
Distributed Mutual Exclusion and Distributed Deadlock Detection
SHIKHA GAUTAM
 
File replication
Klawal13
 
Critical section problem in operating system.
MOHIT DADU
 
Database , 12 Reliability
Ali Usman
 
Types of Load distributing algorithm in Distributed System
DHIVYADEVAKI
 
Group Communication (Distributed computing)
Sri Prasanna
 
distributed Computing system model
Harshad Umredkar
 
Physical and Logical Clocks
Dilum Bandara
 
Synchronization in distributed systems
SHATHAN
 
Distributed Deadlock Detection.ppt
Babar Kamran Ahmed (LION)
 
remote procedure calls
Ashish Kumar
 
Distributed web based systems
Reza Gh
 
Lamport’s algorithm for mutual exclusion
Neelamani Samal
 
Message passing in Distributed Computing Systems
Alagappa Govt Arts College, Karaikudi
 

Similar to Distributed system lamport's and vector algorithm (20)

PPTX
Synchronization
Ameena Tijjani
 
PPT
dokumen.tips_synchronization-in-distributed-systems-chapter-6.ppt
samaghorab
 
PPTX
3. syncro. in distributed system
Gd Goenka University
 
PDF
6.Distributed Operating Systems
Dr Sandeep Kumar Poonia
 
PPT
clock synchronization in Distributed System
Harshita Ved
 
PPTX
Synchronization Pradeep K Sinha
Jawwad Rafiq
 
PPTX
Lesson 05 - Time in Distrributed System.pptx
LagamaPasala
 
PPT
Clocks
guesta013ed8
 
PPT
Time-Synchronization-ds14.pptmmmmmmmmmmmmmmmmmmmmmmmmmmm
mrx19732005
 
PPT
Chapter Five Synchonization distributed Sytem.ppt
gadisaAdamu
 
PPT
Chapter Five: Introduction to Syncho.pptduction to Syncho.ppt
gadisaadamu101
 
PPT
Chap 5
suks_87
 
PDF
Synchonization in Distributed Systems.pdf
cAnhTrn53
 
PPT
Chapter 10
AbDul ThaYyal
 
PPTX
Cross cutting concerns should be logically centralized DRY ,but it may appear...
Manonmani40
 
PDF
Clock.pdf
MohdAbdulHaque
 
PPT
Unit i
Mani Kandan K
 
Synchronization
Ameena Tijjani
 
dokumen.tips_synchronization-in-distributed-systems-chapter-6.ppt
samaghorab
 
3. syncro. in distributed system
Gd Goenka University
 
6.Distributed Operating Systems
Dr Sandeep Kumar Poonia
 
clock synchronization in Distributed System
Harshita Ved
 
Synchronization Pradeep K Sinha
Jawwad Rafiq
 
Lesson 05 - Time in Distrributed System.pptx
LagamaPasala
 
Clocks
guesta013ed8
 
Time-Synchronization-ds14.pptmmmmmmmmmmmmmmmmmmmmmmmmmmm
mrx19732005
 
Chapter Five Synchonization distributed Sytem.ppt
gadisaAdamu
 
Chapter Five: Introduction to Syncho.pptduction to Syncho.ppt
gadisaadamu101
 
Chap 5
suks_87
 
Synchonization in Distributed Systems.pdf
cAnhTrn53
 
Chapter 10
AbDul ThaYyal
 
Cross cutting concerns should be logically centralized DRY ,but it may appear...
Manonmani40
 
Clock.pdf
MohdAbdulHaque
 
Ad

Recently uploaded (20)

PPTX
Soil and agriculture microbiology .pptx
Keerthana Ramesh
 
PPTX
Cultivation practice of Litchi in Nepal.pptx
UmeshTimilsina1
 
PDF
The Constitution Review Committee (CRC) has released an updated schedule for ...
nservice241
 
PPTX
ASRB NET 2023 PREVIOUS YEAR QUESTION PAPER GENETICS AND PLANT BREEDING BY SAT...
Krashi Coaching
 
PPT
Talk on Critical Theory, Part II, Philosophy of Social Sciences
Soraj Hongladarom
 
PPTX
SPINA BIFIDA: NURSING MANAGEMENT .pptx
PRADEEP ABOTHU
 
PPTX
How to Set Maximum Difference Odoo 18 POS
Celine George
 
PDF
0725.WHITEPAPER-UNIQUEWAYSOFPROTOTYPINGANDUXNOW.pdf
Thomas GIRARD, MA, CDP
 
PPTX
Stereochemistry-Optical Isomerism in organic compoundsptx
Tarannum Nadaf-Mansuri
 
PDF
CONCURSO DE POESIA “POETUFAS – PASSOS SUAVES PELO VERSO.pdf
Colégio Santa Teresinha
 
PPTX
MENINGITIS: NURSING MANAGEMENT, BACTERIAL MENINGITIS, VIRAL MENINGITIS.pptx
PRADEEP ABOTHU
 
PDF
People & Earth's Ecosystem -Lesson 2: People & Population
marvinnbustamante1
 
PDF
Reconstruct, Restore, Reimagine: New Perspectives on Stoke Newington’s Histor...
History of Stoke Newington
 
PDF
Knee Extensor Mechanism Injuries - Orthopedic Radiologic Imaging
Sean M. Fox
 
PDF
Women's Health: Essential Tips for Every Stage.pdf
Iftikhar Ahmed
 
PDF
CEREBRAL PALSY: NURSING MANAGEMENT .pdf
PRADEEP ABOTHU
 
PDF
Isharyanti-2025-Cross Language Communication in Indonesian Language
Neny Isharyanti
 
PPSX
HEALTH ASSESSMENT (Community Health Nursing) - GNM 1st Year
Priyanshu Anand
 
PDF
DIGESTION OF CARBOHYDRATES,PROTEINS,LIPIDS
raviralanaresh2
 
PDF
Dimensions of Societal Planning in Commonism
StefanMz
 
Soil and agriculture microbiology .pptx
Keerthana Ramesh
 
Cultivation practice of Litchi in Nepal.pptx
UmeshTimilsina1
 
The Constitution Review Committee (CRC) has released an updated schedule for ...
nservice241
 
ASRB NET 2023 PREVIOUS YEAR QUESTION PAPER GENETICS AND PLANT BREEDING BY SAT...
Krashi Coaching
 
Talk on Critical Theory, Part II, Philosophy of Social Sciences
Soraj Hongladarom
 
SPINA BIFIDA: NURSING MANAGEMENT .pptx
PRADEEP ABOTHU
 
How to Set Maximum Difference Odoo 18 POS
Celine George
 
0725.WHITEPAPER-UNIQUEWAYSOFPROTOTYPINGANDUXNOW.pdf
Thomas GIRARD, MA, CDP
 
Stereochemistry-Optical Isomerism in organic compoundsptx
Tarannum Nadaf-Mansuri
 
CONCURSO DE POESIA “POETUFAS – PASSOS SUAVES PELO VERSO.pdf
Colégio Santa Teresinha
 
MENINGITIS: NURSING MANAGEMENT, BACTERIAL MENINGITIS, VIRAL MENINGITIS.pptx
PRADEEP ABOTHU
 
People & Earth's Ecosystem -Lesson 2: People & Population
marvinnbustamante1
 
Reconstruct, Restore, Reimagine: New Perspectives on Stoke Newington’s Histor...
History of Stoke Newington
 
Knee Extensor Mechanism Injuries - Orthopedic Radiologic Imaging
Sean M. Fox
 
Women's Health: Essential Tips for Every Stage.pdf
Iftikhar Ahmed
 
CEREBRAL PALSY: NURSING MANAGEMENT .pdf
PRADEEP ABOTHU
 
Isharyanti-2025-Cross Language Communication in Indonesian Language
Neny Isharyanti
 
HEALTH ASSESSMENT (Community Health Nursing) - GNM 1st Year
Priyanshu Anand
 
DIGESTION OF CARBOHYDRATES,PROTEINS,LIPIDS
raviralanaresh2
 
Dimensions of Societal Planning in Commonism
StefanMz
 
Ad

Distributed system lamport's and vector algorithm

  • 1. DISTRIBUTED SYSTEM Lamppost’s& vectors logical clocks BY-PINKI KUMARI SONI
  • 2. LOGICAL CLOCK • A logical clock is a mechanism for capturing chronological and causal relationships in a distributed system. Distributed systems may have no physically synchronous global clock, so a logical clock allows global ordering on events from different processes in such systems. • Note- chronological: the relation of a serial to its predecessors and successors • Casual-Causation indicates that one event is the result of the occurrence of the other event; i.e. there is a causal relationship between the two events.
  • 4. LOGICAL CLOCK USE AND ALGORITHMS • Logical clocks are useful in computation analysis, distributed algorithm design, individual event tracking, and exploring computational progress. • Some noteworthy logical clock algorithms are: • Lamport’s timestamps, which are monotonically increasing software counters. • Vector clocks, that allow for partial ordering of events in a distributed system. Timestamp-a digital record of the time of occurrence of a particular event.
  • 5. LAMPORT’S • Lamport’s clocks are a simple technique used for determining the order of events in a distributed system. • This clock was proposed by Leslie Lamport , a Lamport clock maintains order of operations by incrementing a counter contained in the events • By simply adding a counter value to events as they are received and incrementing this value based on the last seen value, • Lamport clocks provide a partial ordering of events – specifically “happened- before” ordering.
  • 6. LAMPORT’S ALGORITHM FOLLOWS SOME SIMPLE RULES: • A process increments its counter before each event in that process; • When a process sends a message, it includes its counter value with the message; • On receiving a message, the counter of the recipient is updated, if necessary, to the greater of its current counter and the timestamp in the received message. The counter is then incremented by 1 before the message is considered received. The algorithm for sending: • time = time+1; • time_stamp = time; • send(message, time_stamp); The algorithm for reciving: • (message, time_stamp) = receive(); • time = max(time_stamp, time)+1;
  • 8. VECTOR CLOCK • A vector clock is an algorithm for generating a partial ordering of events in a distributed system and detecting causality violations. Just as in Lamport timestamps, interprocess messages contain the state of the sending process'slogical clock.
  • 9. VECTOR CLOCK ALGORITHM • Initially, all vectors [0,0,…,0] • For event on process i, increment own ci • Label message sent with local vector • When process j receives message with vector [d1, d2, …, dn]: • Set local each local entry k to max(ck, dk) • Increment value of cj
  • 11. IMPORTANT POINTS • Physical Clocks • Can keep closely synchronized, but never perfect • Logical Clocks • Encode causality relationship • Lamport’s clocks provide only one-way encoding • Vector clocks provide exact causality information • Causality – If a b then event a can affect event b • Concurrency – If neither a  b nor b a then one event cannot affect the other • Partial Ordering – Causal events are sequenced • Total Ordering – All events are sequenced