Lamport's Scalar clocks and Singhal-Kshemkalyani’s VC Algorithms

Slides:



Advertisements
Similar presentations
Chapter 12 Message Ordering. Causal Ordering A single message should not be overtaken by a sequence of messages Stronger than FIFO Example of FIFO but.
Advertisements

SES Algorithm SES: Schiper-Eggli-Sandoz Algorithm. No need for broadcast messages. Each process maintains a vector V_P of size N - 1, N the number of processes.
Gossip and its application Presented by Anna Kaplun.
Time and Global States Part 3 ECEN5053 Software Engineering of Distributed Systems University of Colorado, Boulder.
Naive Vector Clocks and Singhal & Kshemkalyani's Vector Clocks Presented by: :: Abdulkareem Alali ::
Efficient Solutions to the Replicated Log and Dictionary Problems
Distributed Systems Spring 2009
A Parallel Computational Model for Heterogeneous Clusters Jose Luis Bosque, Luis Pastor, IEEE TRASACTION ON PARALLEL AND DISTRIBUTED SYSTEM, VOL. 17, NO.
Ordering and Consistent Cuts Presented By Biswanath Panda.
Beneficial Caching in Mobile Ad Hoc Networks Bin Tang, Samir Das, Himanshu Gupta Computer Science Department Stony Brook University.
CPSC 668Set 12: Causality1 CPSC 668 Distributed Algorithms and Systems Fall 2009 Prof. Jennifer Welch.
EEC 688/788 Secure and Dependable Computing Lecture 12 Wenbing Zhao Department of Electrical and Computer Engineering Cleveland State University
Chapter 3: System design. System design Creating system components Three primary components – designing data structure and content – create software –
Lecture 13 Synchronization (cont). EECE 411: Design of Distributed Software Applications Logistics Last quiz Max: 69 / Median: 52 / Min: 24 In a box outside.
Code and Decoder Design of LDPC Codes for Gbps Systems Jeremy Thorpe Presented to: Microsoft Research
Chapter Resynchsonous Stabilizer Chapter 5.1 Resynchsonous Stabilizer Self-Stabilization Shlomi Dolev MIT Press, 2000 Draft of Jan 2004, Shlomi.
EEC-681/781 Distributed Computing Systems Lecture 11 Wenbing Zhao Cleveland State University.
Time, Clocks and the Ordering of Events in a Distributed System - by Leslie Lamport.
1 Information System Security AABFS-Jordan Summer 2006 Digital Signature and Hashing Functions Prepared by: Maher Abu Hamdeh & Adel Hamdan Supervised by:
Lecture 12 Synchronization. EECE 411: Design of Distributed Software Applications Summary so far … A distributed system is: a collection of independent.
Computer Science Lecture 10, page 1 CS677: Distributed OS Last Class: Clock Synchronization Physical clocks Clock synchronization algorithms –Cristian’s.
Time, Clocks, and the Ordering of Events in a Distributed System Leslie Lamport (1978) Presented by: Yoav Kantor.
Distributed Systems Foundations Lecture 1. Main Characteristics of Distributed Systems Independent processors, sites, processes Message passing No shared.
TIME, CLOCKS AND THE ORDERING OF EVENTS IN A DISTRIBUTED SYSTEM L. Lamport Computer Science Laboratory SRI International.
CSE 597E Fall 2001 PennState University1 Digital Signature Schemes Presented By: Munaiza Matin.
Logical Clocks (2). Topics r Logical clocks r Totally-Ordered Multicasting r Vector timestamps.
Chapter 5.
CSE 486/586, Spring 2013 CSE 486/586 Distributed Systems Logical Time Steve Ko Computer Sciences and Engineering University at Buffalo.
Distributed Mutex EE324 Lecture 11.
Logical Clocks n event ordering, happened-before relation (review) n logical clocks conditions n scalar clocks condition implementation limitation n vector.
Performance Measurement. A Quantitative Basis for Design n Parallel programming is an optimization problem. n Must take into account several factors:
DISTRIBUTED ALGORITHMS By Nancy.A.Lynch Chapter 18 LOGICAL TIME By Sudha Elavarti.
1 M. Tudruj, J. Borkowski, D. Kopanski Inter-Application Control Through Global States Monitoring On a Grid Polish-Japanese Institute of Information Technology,
Synchronization. Why we need synchronization? It is important that multiple processes do not access shared resources simultaneously. Synchronization in.
Logical Clocks. Topics Logical clocks Totally-Ordered Multicasting Vector timestamps.
Lamport’s Logical Clocks & Totally Ordered Multicasting.
“Virtual Time and Global States of Distributed Systems”
Event Ordering Greg Bilodeau CS 5204 November 3, 2009.
Time, Clocks, and the Ordering of Events in a Distributed System Leslie Lamport Massachusetts Computer Associates,Inc. Presented by Xiaofeng Xiao.
Distributed Coordination. Turing Award r The Turing Award is recognized as the Nobel Prize of computing r Earlier this term the 2013 Turing Award went.
CIS825 Lecture 2. Model Processors Communication medium.
D u k e S y s t e m s Asynchronous Replicated State Machines (Causal Multicast and All That) Jeff Chase Duke University.
Building Dependable Distributed Systems, Copyright Wenbing Zhao
D ISTRIBUTED S YSTEM UNIT-2 Theoretical Foundation for Distributed Systems Prepared By: G.S.Mishra.
CS 3471 CS 347: Parallel and Distributed Data Management Notes13: Time and Clocks.
Feb 15, 2001CSCI {4,6}900: Ubiquitous Computing1 Announcements.
Logical Clocks. Topics r Logical clocks r Totally-Ordered Multicasting.
Event Ordering. CS 5204 – Operating Systems2 Time and Ordering The two critical differences between centralized and distributed systems are: absence of.
Ordering of Events in Distributed Systems UNIVERSITY of WISCONSIN-MADISON Computer Sciences Department CS 739 Distributed Systems Andrea C. Arpaci-Dusseau.
COMP 655: Distributed/Operating Systems Summer 2011 Dr. Chunbo Chu Week 6: Synchronyzation 3/5/20161 Distributed Systems - COMP 655.
Mutual Exclusion Algorithms. Topics r Defining mutual exclusion r A centralized approach r A distributed approach r An approach assuming an organization.
IMPLEMENTATION OF LAMPORT’S SCALAR CLOCKS Surekha Busa.
Reachability Testing of Concurrent Programs1 Reachability Testing of Concurrent Programs Richard Carver, GMU Yu Lei, UTA.
Clock Snooping and its Application in On-the-fly Data Race Detection Koen De Bosschere and Michiel Ronsse University of Ghent, Belgium Taipei, TaiwanDec.
Logical Clocks event ordering, happened-before relation (review) logical clocks conditions scalar clocks  condition  implementation  limitation vector.
CSE 486/586, Spring 2014 CSE 486/586 Distributed Systems Logical Time Steve Ko Computer Sciences and Engineering University at Buffalo.
2013Prof. Reuven Aviv, Mail Security1 Pretty Good Privacy (PGP) Prof. Reuven Aviv Dept. of Computer Science Tel Hai Academic College.
Prof. Reuven Aviv, Nov 2013 Public Key Infrastructure1 Prof. Reuven Aviv Tel Hai Academic College Department of Computer Science Public Key Infrastructure.
Ordering of Events in Distributed Systems UNIVERSITY of WISCONSIN-MADISON Computer Sciences Department CS 739 Distributed Systems Andrea C. Arpaci-Dusseau.
CSCE 668 DISTRIBUTED ALGORITHMS AND SYSTEMS
Greetings. Those of you who don't yet know me... Today is... and
CSC 8320 Advanced Operating System
Logical Clocks and Casual Ordering
Event Ordering.
TIME, CLOCKS AND THE ORDERING OF EVENTS IN A DISTRIBUTED SYSTEM
by Manas Hardas for Advanced Operating Systems Nov 27th 2007
Advanced Operating System Maekawa vs. Ricart-Agrawala By Rizal M Nor
CSE 542: Operating Systems
Outline Theoretical Foundations
Presentation transcript:

Lamport's Scalar clocks and Singhal-Kshemkalyani’s VC Algorithms Implementation of Lamport's Scalar clocks and Singhal-Kshemkalyani’s VC Algorithms Kent State University Computer Science Department Saleh Alnaeli Advanced Operating System. Spring 2010

Goals Implementing both of the algorithms study their behavior under some different arguments Processes Number Messages Number Involved processes Number in the computation Note: This presentation assumes that you have a back ground about Logical Clocks and some of its related algorithms (Scalar, Vector, S-K).

Lamport's Scalar clocks was proposed by Lamport 1978 to totally order events in distributed system each process Pi has a logical clock Ci (represented as integer value) consistency condition consistency: if ab, 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: consistency and if C(a)C(b) then ab scalar clocks are not strongly consistent: if ab, then C(a) < C(b) but C(a) < C(b), then not necessarily ab

Implementation of Scalar Clocks Rule1: before executing event update Ci so, Ci := Ci + d (d>0) Rule2: attach timestamp of the send event to the transmitted message when received, timestamp of receive event is computed as follows: Ci := max(Ci , Cmsg) and then execute R1 It is implemented in C++ and was verified in different ways: Checking its consistency using a function compares the new value of previous one locally and with the sender in receive event Results were compared with vector clock application

Generating the computations Computations were entered from input text file Generated manually and using a computation generator developed in C++ randomly (random sender and receiver) Each event is constructed according the following scheme: EventType,SenderID,ReceiverID such that: EventType is 1 for internal event, 2 for send event and 3 for receive event. Example:3,7,8 means an event to receive a SMS was sent by Pcocess 7 to 8 // Also order of the events can be changed in the InputFile just make sure the receive event is preceeded by send event SMS not found or lost for receive without send event. Sending to process it self is an internal event. Example 2,5,5

Singhal-Kshemkalyani’s Algorithm for vector clock S-K Considered as an efficient implementation of vector clocks. instead of sending the whole vector only need to send elements that changed. And same update rules are used for the recipient process. maintain two vectors : LS[1..n] – “last sent” LU[1..n] needs to send with the message only the elements that meet the condition: {(x,vti[x])| LSi[j] < LUi[x]} The sent vector contains the processes’ Id’s and Clock values of changed processes.

S-K Implementation Computations were entered from input text file It is implemented in C++ and was verified in different ways: Results were compared with others generated by a combined Scalar and vector clock application. Known examples and random computations were used. Computations were entered from input text file Computations were generated using a computation generator developed in C++.

Events construction scheme similar to scalar events format with extra field: EventType,SenderID,ReceiverID,EventId such that: EventType is 1 for internal event, 2 for send event and 3 for receive event. EventId is number of the event when the message has been sent Example:3,7,8,4 means an event to receive a SMS was sent by Process 7 to 8 and the event was the fourth send event order of the events can be changed in the InputFile just make sure the receive event is preceeded by send event SMS not found or lost for receive without send event. Sending to process it self is an internal event. Example 2,5,5,4

Performance Evaluation Lamport’s Scalar Clock algorithm: There were not enough area to study (trivial) S-K algorithms Performance metrics evaluated include Stamps Memory size used in units (1 unit=32 bytes) Conditions of varying Processes Number, messages Number, and number of the involved processes in the computation. It’s expected that SK in the worst case will perform as VC

S-K: Simulation Parameters Default Values Processes numbers 50-100 // constant 50 Simulation Cycles 15 Messages Number 500-2500 Involved processes in computation 100%-50% // 100%-20% (10-50 of 50) Events sequence 1 All Send to all and all receive (50 lost) Event sequence 2 Randomly send and direct receive Expectations: In the worst case of S-K will be Vector clock’s work.

# processes vs. #messages events by sequence1 with 2500 messages and 50 lost figure1 shows that S-K out performance regular VC even with changing the No of processes and involved processes as well Not Sufficient and not satisfied

#Messages vs. #involved processes Events were generated randomly with sequence 2 (randomly picking sender and receiver) After sending, message is directly received to got more updates in locals V. Constant # of processes 50 Changing # of involved processes (10-50)

Figure2 shows surprising results

Table1 and table2 S-K and VC respectively Messages Number  table1 500 1000 1500 2000 2500 10 5318 10804 15264 21152 27020 20 12412 25966 39054 54974 66504 30 17026 40906 64556 85070 110548 40 22698 56564 88224 119018 152488 50 24202 65326 105732 153888 189428 # involved processes Used memory in units Table2  500 1000 1500 2000 2500 10 25000 50000 75000 100000 125000 20 30 40 50

Verifying S-K efficiency equation S-K original paper states that their technique can be beneficial if n<N.b/(log2N+b) Such that: n=avr of entries in Ti, b=bits in a sequence number, log2N=bits needed to code N process ids. It doesn’t work with my simulation !!! I have calculated n value in (2500,40 and 110548,30 ) and I compared it with their equation but did not work!!! Mine is : When of involved processes gets close to 70% and #of messages gets close to 20N, then S-K becomes inefficient.

Conclusion The sequence of the events plays big role in determining the efficiency of S-K Number of the involved processes in the computation can affect S-K performance For low # of messages, S-K seems fine. When # of involved processes is about 70% and #of messages close to 20N then S-K becomes a weak. Efficiency equation is not applicable in my experiment .

Difficulties The most difficult issue was generating a computation that can be used for adequate results. It’s Difficult to predict the order of receiving the messages which make it difficult to generate a computation close to reality.

References Original S-K paper Logical clock, Adv OS course slides. Prof. Mikhail Nesterenko (Acknowledge) http://deneb.cs.kent.edu/~mikhail/classes/aos.s10/ S-k implementation-Manas Hardas. KSU. (Acknowledge)