IMPLEMENTATION OF LAMPORT’S SCALAR CLOCKS
Surekha Busa
Contents
Introduction Implementation Rule Experimental Setup Result Analysis Observation Future Work
INTRODUCTION
To show casualty in distributed system Each process Pi has a logical clock Ci assigned with
an integer the assigned value is the timestamp of this event,
denoted C(a) The timestamps are monotonically increasing consistency condition
consistency: if ab, then C(a) C(b) if event a happens before event b, then the clock value
(timestamp) of a should be less than the clock value of b strong consistency: if C(a)C(b) then ab
scalar clocks are not strongly consistent
IMPLEMENTATION RULE
Outgoing messages tagged with Sender’s clock value
Upon receive of message: myclock = MAX(message, myclock)
EXPERIMENTAL SETUP
Base Algorithm : Random Flood. Whenever the clock of the receiver take the value
of the clock of the message we say the clock is updated.
Total No. of updates per process(number of updates/no of processes) is calculated by increasing the number of processes from 10-100.
P1e11
(1)
e12
(2)
e13 e14
(4)
e15
(5)
P2e21
(1)
e22
(2)
e23
(4)
(3)
Clock is Updated
Clock is not Updated
RESULT ANALYSIS: No. Of Updates and Messages Varying No. Of Processes
RESULT ANALYSIS: No. Of Updates and Messages Per Process Varying No. Of Processes
RESULT ANALYSIS: No. Of Messages Versus No. Of Clock Updates
No. Of Processes
No. Of Updates
No. Of Messages
Updates Per Process
Messages Per Process
10 13 46 1.3 4
20 41 197 2.05 9
30 65 442 2.17 14
40 95 829 2.37 20
50 131 1230 2.62 24
60 169 1724 2.81 28
70 206 2509 2.94 35
80 240 3238 3 40
90 278 4081 3.08 45
100 319 4938 3.19 49
OBSERVATION
No. Updates and messages per process increases with increase in No. of Processes.
No. of clock updates increase with increase in No. of Messages.
FUTURE WORK
To observe its performance over various topologies.
To test my program with much larger no. of processes.
Test my program on a real distributed network.
REFERENCE
[1] Leslie Lamport (1978). ”Time, clocks, and the ordering of events in a distributed system”. Communications of the ACM 2 (7): 558-565.
[2] Mukesh Singhal,Niranjan G. Shivaratri.“Advanced Topics in Operating Systems”. McGRAW-Hill international edition:Chapter 5.
Code Defence
THANK YOU..!!