SlideShare a Scribd company logo
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.
Most read
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;
Most read
7
Distributed system lamport's and vector algorithm
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)

Vector clock algorithm
Vector clock algorithmVector clock algorithm
Vector clock algorithm
S. Anbu
 
Planning in AI(Partial order planning)
Planning in AI(Partial order planning)Planning in AI(Partial order planning)
Planning in AI(Partial order planning)
Vicky Tyagi
 
Distributed Operating System_1
Distributed Operating System_1Distributed Operating System_1
Distributed Operating System_1
Dr Sandeep Kumar Poonia
 
program partitioning and scheduling IN Advanced Computer Architecture
program partitioning and scheduling  IN Advanced Computer Architectureprogram partitioning and scheduling  IN Advanced Computer Architecture
program partitioning and scheduling IN Advanced Computer Architecture
Pankaj Kumar Jain
 
Lamport’s algorithm for mutual exclusion
Lamport’s algorithm for mutual exclusionLamport’s algorithm for mutual exclusion
Lamport’s algorithm for mutual exclusion
Neelamani Samal
 
Logical Clocks (Distributed computing)
Logical Clocks (Distributed computing)Logical Clocks (Distributed computing)
Logical Clocks (Distributed computing)
Sri Prasanna
 
INTER PROCESS COMMUNICATION (IPC).pptx
INTER PROCESS COMMUNICATION (IPC).pptxINTER PROCESS COMMUNICATION (IPC).pptx
INTER PROCESS COMMUNICATION (IPC).pptx
LECO9
 
Clock synchronization in distributed system
Clock synchronization in distributed systemClock synchronization in distributed system
Clock synchronization in distributed system
Sunita Sahu
 
OOAD
OOADOOAD
OOAD
yndaravind
 
8. mutual exclusion in Distributed Operating Systems
8. mutual exclusion in Distributed Operating Systems8. mutual exclusion in Distributed Operating Systems
8. mutual exclusion in Distributed Operating Systems
Dr Sandeep Kumar Poonia
 
Predicate logic
 Predicate logic Predicate logic
Predicate logic
Harini Balamurugan
 
Remote Procedure Call in Distributed System
Remote Procedure Call in Distributed SystemRemote Procedure Call in Distributed System
Remote Procedure Call in Distributed System
PoojaBele1
 
Agreement Protocols, distributed File Systems, Distributed Shared Memory
Agreement Protocols, distributed File Systems, Distributed Shared MemoryAgreement Protocols, distributed File Systems, Distributed Shared Memory
Agreement Protocols, distributed File Systems, Distributed Shared Memory
SHIKHA GAUTAM
 
CS6601 DISTRIBUTED SYSTEMS
CS6601 DISTRIBUTED SYSTEMSCS6601 DISTRIBUTED SYSTEMS
CS6601 DISTRIBUTED SYSTEMS
Kathirvel Ayyaswamy
 
Deadlock in Distributed Systems
Deadlock in Distributed SystemsDeadlock in Distributed Systems
Deadlock in Distributed Systems
Pritom Saha Akash
 
Dynamic interconnection networks
Dynamic interconnection networksDynamic interconnection networks
Dynamic interconnection networks
Prasenjit Dey
 
message passing
 message passing message passing
message passing
Ashish Kumar
 
Physical and Logical Clocks
Physical and Logical ClocksPhysical and Logical Clocks
Physical and Logical Clocks
Dilum Bandara
 
Real-Time Scheduling
Real-Time SchedulingReal-Time Scheduling
Real-Time Scheduling
sathish sak
 
Stream oriented communication
Stream oriented communicationStream oriented communication
Stream oriented communication
Shyama Bhuvanendran
 
Vector clock algorithm
Vector clock algorithmVector clock algorithm
Vector clock algorithm
S. Anbu
 
Planning in AI(Partial order planning)
Planning in AI(Partial order planning)Planning in AI(Partial order planning)
Planning in AI(Partial order planning)
Vicky Tyagi
 
program partitioning and scheduling IN Advanced Computer Architecture
program partitioning and scheduling  IN Advanced Computer Architectureprogram partitioning and scheduling  IN Advanced Computer Architecture
program partitioning and scheduling IN Advanced Computer Architecture
Pankaj Kumar Jain
 
Lamport’s algorithm for mutual exclusion
Lamport’s algorithm for mutual exclusionLamport’s algorithm for mutual exclusion
Lamport’s algorithm for mutual exclusion
Neelamani Samal
 
Logical Clocks (Distributed computing)
Logical Clocks (Distributed computing)Logical Clocks (Distributed computing)
Logical Clocks (Distributed computing)
Sri Prasanna
 
INTER PROCESS COMMUNICATION (IPC).pptx
INTER PROCESS COMMUNICATION (IPC).pptxINTER PROCESS COMMUNICATION (IPC).pptx
INTER PROCESS COMMUNICATION (IPC).pptx
LECO9
 
Clock synchronization in distributed system
Clock synchronization in distributed systemClock synchronization in distributed system
Clock synchronization in distributed system
Sunita Sahu
 
8. mutual exclusion in Distributed Operating Systems
8. mutual exclusion in Distributed Operating Systems8. mutual exclusion in Distributed Operating Systems
8. mutual exclusion in Distributed Operating Systems
Dr Sandeep Kumar Poonia
 
Remote Procedure Call in Distributed System
Remote Procedure Call in Distributed SystemRemote Procedure Call in Distributed System
Remote Procedure Call in Distributed System
PoojaBele1
 
Agreement Protocols, distributed File Systems, Distributed Shared Memory
Agreement Protocols, distributed File Systems, Distributed Shared MemoryAgreement Protocols, distributed File Systems, Distributed Shared Memory
Agreement Protocols, distributed File Systems, Distributed Shared Memory
SHIKHA GAUTAM
 
Deadlock in Distributed Systems
Deadlock in Distributed SystemsDeadlock in Distributed Systems
Deadlock in Distributed Systems
Pritom Saha Akash
 
Dynamic interconnection networks
Dynamic interconnection networksDynamic interconnection networks
Dynamic interconnection networks
Prasenjit Dey
 
Physical and Logical Clocks
Physical and Logical ClocksPhysical and Logical Clocks
Physical and Logical Clocks
Dilum Bandara
 
Real-Time Scheduling
Real-Time SchedulingReal-Time Scheduling
Real-Time Scheduling
sathish sak
 

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

Synchronization
SynchronizationSynchronization
Synchronization
Ameena Tijjani
 
dokumen.tips_synchronization-in-distributed-systems-chapter-6.ppt
dokumen.tips_synchronization-in-distributed-systems-chapter-6.pptdokumen.tips_synchronization-in-distributed-systems-chapter-6.ppt
dokumen.tips_synchronization-in-distributed-systems-chapter-6.ppt
samaghorab
 
3. syncro. in distributed system
3. syncro. in distributed system3. syncro. in distributed system
3. syncro. in distributed system
Gd Goenka University
 
6.Distributed Operating Systems
6.Distributed Operating Systems6.Distributed Operating Systems
6.Distributed Operating Systems
Dr Sandeep Kumar Poonia
 
clock synchronization in Distributed System
clock synchronization in Distributed System clock synchronization in Distributed System
clock synchronization in Distributed System
Harshita Ved
 
Synchronization Pradeep K Sinha
Synchronization Pradeep K SinhaSynchronization Pradeep K Sinha
Synchronization Pradeep K Sinha
Jawwad Rafiq
 
Lesson 05 - Time in Distrributed System.pptx
Lesson 05 - Time in Distrributed System.pptxLesson 05 - Time in Distrributed System.pptx
Lesson 05 - Time in Distrributed System.pptx
LagamaPasala
 
Synch
SynchSynch
Synch
Mohannad Shishani
 
Clocks
ClocksClocks
Clocks
guesta013ed8
 
Shoaib
ShoaibShoaib
Shoaib
Mohammed Shoaib Khan
 
Time-Synchronization-ds14.pptmmmmmmmmmmmmmmmmmmmmmmmmmmm
Time-Synchronization-ds14.pptmmmmmmmmmmmmmmmmmmmmmmmmmmmTime-Synchronization-ds14.pptmmmmmmmmmmmmmmmmmmmmmmmmmmm
Time-Synchronization-ds14.pptmmmmmmmmmmmmmmmmmmmmmmmmmmm
mrx19732005
 
Chapter Five Synchonization distributed Sytem.ppt
Chapter Five Synchonization distributed Sytem.pptChapter Five Synchonization distributed Sytem.ppt
Chapter Five Synchonization distributed Sytem.ppt
gadisaAdamu
 
Chapter Five: Introduction to Syncho.pptduction to Syncho.ppt
Chapter Five: Introduction to Syncho.pptduction to Syncho.pptChapter Five: Introduction to Syncho.pptduction to Syncho.ppt
Chapter Five: Introduction to Syncho.pptduction to Syncho.ppt
gadisaadamu101
 
Chap 5
Chap 5Chap 5
Chap 5
suks_87
 
Synchonization in Distributed Systems.pdf
Synchonization in Distributed Systems.pdfSynchonization in Distributed Systems.pdf
Synchonization in Distributed Systems.pdf
cAnhTrn53
 
Distributed Mutual exclusion algorithms
Distributed Mutual exclusion algorithmsDistributed Mutual exclusion algorithms
Distributed Mutual exclusion algorithms
MNM Jain Engineering College
 
Chapter 10
Chapter 10Chapter 10
Chapter 10
AbDul ThaYyal
 
Cross cutting concerns should be logically centralized DRY ,but it may appear...
Cross cutting concerns should be logically centralized DRY ,but it may appear...Cross cutting concerns should be logically centralized DRY ,but it may appear...
Cross cutting concerns should be logically centralized DRY ,but it may appear...
Manonmani40
 
Shoaib
ShoaibShoaib
Shoaib
Mohammed Shoaib Khan
 
Clock.pdf
Clock.pdfClock.pdf
Clock.pdf
MohdAbdulHaque
 
dokumen.tips_synchronization-in-distributed-systems-chapter-6.ppt
dokumen.tips_synchronization-in-distributed-systems-chapter-6.pptdokumen.tips_synchronization-in-distributed-systems-chapter-6.ppt
dokumen.tips_synchronization-in-distributed-systems-chapter-6.ppt
samaghorab
 
clock synchronization in Distributed System
clock synchronization in Distributed System clock synchronization in Distributed System
clock synchronization in Distributed System
Harshita Ved
 
Synchronization Pradeep K Sinha
Synchronization Pradeep K SinhaSynchronization Pradeep K Sinha
Synchronization Pradeep K Sinha
Jawwad Rafiq
 
Lesson 05 - Time in Distrributed System.pptx
Lesson 05 - Time in Distrributed System.pptxLesson 05 - Time in Distrributed System.pptx
Lesson 05 - Time in Distrributed System.pptx
LagamaPasala
 
Time-Synchronization-ds14.pptmmmmmmmmmmmmmmmmmmmmmmmmmmm
Time-Synchronization-ds14.pptmmmmmmmmmmmmmmmmmmmmmmmmmmmTime-Synchronization-ds14.pptmmmmmmmmmmmmmmmmmmmmmmmmmmm
Time-Synchronization-ds14.pptmmmmmmmmmmmmmmmmmmmmmmmmmmm
mrx19732005
 
Chapter Five Synchonization distributed Sytem.ppt
Chapter Five Synchonization distributed Sytem.pptChapter Five Synchonization distributed Sytem.ppt
Chapter Five Synchonization distributed Sytem.ppt
gadisaAdamu
 
Chapter Five: Introduction to Syncho.pptduction to Syncho.ppt
Chapter Five: Introduction to Syncho.pptduction to Syncho.pptChapter Five: Introduction to Syncho.pptduction to Syncho.ppt
Chapter Five: Introduction to Syncho.pptduction to Syncho.ppt
gadisaadamu101
 
Synchonization in Distributed Systems.pdf
Synchonization in Distributed Systems.pdfSynchonization in Distributed Systems.pdf
Synchonization in Distributed Systems.pdf
cAnhTrn53
 
Cross cutting concerns should be logically centralized DRY ,but it may appear...
Cross cutting concerns should be logically centralized DRY ,but it may appear...Cross cutting concerns should be logically centralized DRY ,but it may appear...
Cross cutting concerns should be logically centralized DRY ,but it may appear...
Manonmani40
 
Ad

Recently uploaded (20)

Search Engine Optimization (SEO) for Website Success
Search Engine Optimization (SEO) for Website SuccessSearch Engine Optimization (SEO) for Website Success
Search Engine Optimization (SEO) for Website Success
Muneeb Rana
 
IDSP(INTEGRATED DISEASE SURVEILLANCE PROGRAMME...
IDSP(INTEGRATED DISEASE SURVEILLANCE PROGRAMME...IDSP(INTEGRATED DISEASE SURVEILLANCE PROGRAMME...
IDSP(INTEGRATED DISEASE SURVEILLANCE PROGRAMME...
SweetytamannaMohapat
 
Artificial intelligence Presented by JM.
Artificial intelligence Presented by JM.Artificial intelligence Presented by JM.
Artificial intelligence Presented by JM.
jmansha170
 
Cloud Computing ..PPT ( Faizan ALTAF )..
Cloud Computing ..PPT ( Faizan ALTAF )..Cloud Computing ..PPT ( Faizan ALTAF )..
Cloud Computing ..PPT ( Faizan ALTAF )..
faizanaltaf231
 
Coleoptera: The Largest Insect Order.pptx
Coleoptera: The Largest Insect Order.pptxColeoptera: The Largest Insect Order.pptx
Coleoptera: The Largest Insect Order.pptx
Arshad Shaikh
 
Swachata Quiz - Prelims - 01.10.24 - Quiz Club IIT Patna
Swachata Quiz - Prelims - 01.10.24 - Quiz Club IIT PatnaSwachata Quiz - Prelims - 01.10.24 - Quiz Club IIT Patna
Swachata Quiz - Prelims - 01.10.24 - Quiz Club IIT Patna
Quiz Club, Indian Institute of Technology, Patna
 
POS Reporting in Odoo 18 - Odoo 18 Slides
POS Reporting in Odoo 18 - Odoo 18 SlidesPOS Reporting in Odoo 18 - Odoo 18 Slides
POS Reporting in Odoo 18 - Odoo 18 Slides
Celine George
 
HUMAN SKELETAL SYSTEM ANATAMY AND PHYSIOLOGY
HUMAN SKELETAL SYSTEM ANATAMY AND PHYSIOLOGYHUMAN SKELETAL SYSTEM ANATAMY AND PHYSIOLOGY
HUMAN SKELETAL SYSTEM ANATAMY AND PHYSIOLOGY
DHARMENDRA SAHU
 
Semisolid_Dosage_Forms.pptx
Semisolid_Dosage_Forms.pptxSemisolid_Dosage_Forms.pptx
Semisolid_Dosage_Forms.pptx
Shantanu Ranjan
 
Diana Enriquez Wauconda - A Wauconda-Based Educator
Diana Enriquez Wauconda - A Wauconda-Based EducatorDiana Enriquez Wauconda - A Wauconda-Based Educator
Diana Enriquez Wauconda - A Wauconda-Based Educator
Diana Enriquez Wauconda
 
LDMMIA Bonus GUEST GRAD Student Check-in
LDMMIA Bonus GUEST GRAD Student Check-inLDMMIA Bonus GUEST GRAD Student Check-in
LDMMIA Bonus GUEST GRAD Student Check-in
LDM & Mia eStudios
 
Uterine Prolapse, causes type and classification,its managment
Uterine Prolapse, causes type and classification,its managmentUterine Prolapse, causes type and classification,its managment
Uterine Prolapse, causes type and classification,its managment
Ritu480198
 
SEM II 3202 STRUCTURAL MECHANICS, B ARCH, REGULATION 2021, ANNA UNIVERSITY, R...
SEM II 3202 STRUCTURAL MECHANICS, B ARCH, REGULATION 2021, ANNA UNIVERSITY, R...SEM II 3202 STRUCTURAL MECHANICS, B ARCH, REGULATION 2021, ANNA UNIVERSITY, R...
SEM II 3202 STRUCTURAL MECHANICS, B ARCH, REGULATION 2021, ANNA UNIVERSITY, R...
RVSPSOA
 
Optimization technique in pharmaceutical product development.pptx
Optimization technique in pharmaceutical product development.pptxOptimization technique in pharmaceutical product development.pptx
Optimization technique in pharmaceutical product development.pptx
UrmiPrajapati3
 
Rose Cultivation Practices by Kushal Lamichhane.pdf
Rose Cultivation Practices by Kushal Lamichhane.pdfRose Cultivation Practices by Kushal Lamichhane.pdf
Rose Cultivation Practices by Kushal Lamichhane.pdf
kushallamichhame
 
Freckle Project April 2025 Survey and report May 2025.pptx
Freckle Project April 2025 Survey and report May 2025.pptxFreckle Project April 2025 Survey and report May 2025.pptx
Freckle Project April 2025 Survey and report May 2025.pptx
EveryLibrary
 
TV Shows and web-series quiz | QUIZ CLUB OF PSGCAS | 13TH MARCH 2025
TV Shows and web-series quiz | QUIZ CLUB OF PSGCAS | 13TH MARCH 2025TV Shows and web-series quiz | QUIZ CLUB OF PSGCAS | 13TH MARCH 2025
TV Shows and web-series quiz | QUIZ CLUB OF PSGCAS | 13TH MARCH 2025
Quiz Club of PSG College of Arts & Science
 
How to Manage Maintenance Request in Odoo 18
How to Manage Maintenance Request in Odoo 18How to Manage Maintenance Request in Odoo 18
How to Manage Maintenance Request in Odoo 18
Celine George
 
State institute of educational technology
State institute of educational technologyState institute of educational technology
State institute of educational technology
vp5806484
 
Forestry Model Exit Exam_2025_Wollega University, Gimbi Campus.pdf
Forestry Model Exit Exam_2025_Wollega University, Gimbi Campus.pdfForestry Model Exit Exam_2025_Wollega University, Gimbi Campus.pdf
Forestry Model Exit Exam_2025_Wollega University, Gimbi Campus.pdf
ChalaKelbessa
 
Search Engine Optimization (SEO) for Website Success
Search Engine Optimization (SEO) for Website SuccessSearch Engine Optimization (SEO) for Website Success
Search Engine Optimization (SEO) for Website Success
Muneeb Rana
 
IDSP(INTEGRATED DISEASE SURVEILLANCE PROGRAMME...
IDSP(INTEGRATED DISEASE SURVEILLANCE PROGRAMME...IDSP(INTEGRATED DISEASE SURVEILLANCE PROGRAMME...
IDSP(INTEGRATED DISEASE SURVEILLANCE PROGRAMME...
SweetytamannaMohapat
 
Artificial intelligence Presented by JM.
Artificial intelligence Presented by JM.Artificial intelligence Presented by JM.
Artificial intelligence Presented by JM.
jmansha170
 
Cloud Computing ..PPT ( Faizan ALTAF )..
Cloud Computing ..PPT ( Faizan ALTAF )..Cloud Computing ..PPT ( Faizan ALTAF )..
Cloud Computing ..PPT ( Faizan ALTAF )..
faizanaltaf231
 
Coleoptera: The Largest Insect Order.pptx
Coleoptera: The Largest Insect Order.pptxColeoptera: The Largest Insect Order.pptx
Coleoptera: The Largest Insect Order.pptx
Arshad Shaikh
 
POS Reporting in Odoo 18 - Odoo 18 Slides
POS Reporting in Odoo 18 - Odoo 18 SlidesPOS Reporting in Odoo 18 - Odoo 18 Slides
POS Reporting in Odoo 18 - Odoo 18 Slides
Celine George
 
HUMAN SKELETAL SYSTEM ANATAMY AND PHYSIOLOGY
HUMAN SKELETAL SYSTEM ANATAMY AND PHYSIOLOGYHUMAN SKELETAL SYSTEM ANATAMY AND PHYSIOLOGY
HUMAN SKELETAL SYSTEM ANATAMY AND PHYSIOLOGY
DHARMENDRA SAHU
 
Semisolid_Dosage_Forms.pptx
Semisolid_Dosage_Forms.pptxSemisolid_Dosage_Forms.pptx
Semisolid_Dosage_Forms.pptx
Shantanu Ranjan
 
Diana Enriquez Wauconda - A Wauconda-Based Educator
Diana Enriquez Wauconda - A Wauconda-Based EducatorDiana Enriquez Wauconda - A Wauconda-Based Educator
Diana Enriquez Wauconda - A Wauconda-Based Educator
Diana Enriquez Wauconda
 
LDMMIA Bonus GUEST GRAD Student Check-in
LDMMIA Bonus GUEST GRAD Student Check-inLDMMIA Bonus GUEST GRAD Student Check-in
LDMMIA Bonus GUEST GRAD Student Check-in
LDM & Mia eStudios
 
Uterine Prolapse, causes type and classification,its managment
Uterine Prolapse, causes type and classification,its managmentUterine Prolapse, causes type and classification,its managment
Uterine Prolapse, causes type and classification,its managment
Ritu480198
 
SEM II 3202 STRUCTURAL MECHANICS, B ARCH, REGULATION 2021, ANNA UNIVERSITY, R...
SEM II 3202 STRUCTURAL MECHANICS, B ARCH, REGULATION 2021, ANNA UNIVERSITY, R...SEM II 3202 STRUCTURAL MECHANICS, B ARCH, REGULATION 2021, ANNA UNIVERSITY, R...
SEM II 3202 STRUCTURAL MECHANICS, B ARCH, REGULATION 2021, ANNA UNIVERSITY, R...
RVSPSOA
 
Optimization technique in pharmaceutical product development.pptx
Optimization technique in pharmaceutical product development.pptxOptimization technique in pharmaceutical product development.pptx
Optimization technique in pharmaceutical product development.pptx
UrmiPrajapati3
 
Rose Cultivation Practices by Kushal Lamichhane.pdf
Rose Cultivation Practices by Kushal Lamichhane.pdfRose Cultivation Practices by Kushal Lamichhane.pdf
Rose Cultivation Practices by Kushal Lamichhane.pdf
kushallamichhame
 
Freckle Project April 2025 Survey and report May 2025.pptx
Freckle Project April 2025 Survey and report May 2025.pptxFreckle Project April 2025 Survey and report May 2025.pptx
Freckle Project April 2025 Survey and report May 2025.pptx
EveryLibrary
 
How to Manage Maintenance Request in Odoo 18
How to Manage Maintenance Request in Odoo 18How to Manage Maintenance Request in Odoo 18
How to Manage Maintenance Request in Odoo 18
Celine George
 
State institute of educational technology
State institute of educational technologyState institute of educational technology
State institute of educational technology
vp5806484
 
Forestry Model Exit Exam_2025_Wollega University, Gimbi Campus.pdf
Forestry Model Exit Exam_2025_Wollega University, Gimbi Campus.pdfForestry Model Exit Exam_2025_Wollega University, Gimbi Campus.pdf
Forestry Model Exit Exam_2025_Wollega University, Gimbi Campus.pdf
ChalaKelbessa
 
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