COS 461 Fall 1997 Time and Clocks u uses of time in distributed systems: –time-based algorithms (e.g. in security) –distributed make –gathering event traces.

Slides:



Advertisements
Similar presentations
Time, Clocks, and the Ordering of Events in a Distributed System
Advertisements

COS 461 Fall 1997 Group Communication u communicate to a group of processes rather than point-to-point u uses –replicated service –efficient dissemination.
Last Class: Clock Synchronization
Logical Clocks (2).
Logical Clocks.
CS4231 Parallel and Distributed Algorithms AY 2006/2007 Semester 2 Lecture 6 Instructor: Haifeng YU.
Time and synchronization (“There’s never enough time…”)
Time and Clock Primary standard = rotation of earth De facto primary standard = atomic clock (1 atomic second = 9,192,631,770 orbital transitions of Cesium.
Distributed Systems Spring 2009
Ordering and Consistent Cuts Presented By Biswanath Panda.
Group Communications Group communication: one source process sending a message to a group of processes: Destination is a group rather than a single process.
CPSC 668Set 12: Causality1 CPSC 668 Distributed Algorithms and Systems Fall 2009 Prof. Jennifer Welch.
Time, Clocks and the Ordering of Events in a Distributed System - by Leslie Lamport.
CSE 486/586, Spring 2012 CSE 486/586 Distributed Systems Logical Time Steve Ko Computer Sciences and Engineering University at Buffalo.
Lecture 9: Time & Clocks CDK4: Sections 11.1 – 11.4 CDK5: Sections 14.1 – 14.4 TVS: Sections 6.1 – 6.2 Topics: Synchronization Logical time (Lamport) Vector.
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.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED SYSTEMS.
Chapter 5.
CSE 486/586, Spring 2013 CSE 486/586 Distributed Systems Logical Time Steve Ko Computer Sciences and Engineering University at Buffalo.
Donghyun (David) Kim Department of Mathematics and Physics North Carolina Central University 1 Project Reference Some slides are in courtesy of Dr. Erciyes,
Logical Clocks n event ordering, happened-before relation (review) n logical clocks conditions n scalar clocks condition implementation limitation n vector.
Page 1 Logical Clocks Paul Krzyzanowski Distributed Systems Except as otherwise noted, the content of this presentation is.
Issues with Clocks. Context The tree correction protocol was based on the idea of local detection and correction. Protocols of this type are complex to.
Synchronization. Why we need synchronization? It is important that multiple processes do not access shared resources simultaneously. Synchronization in.
CSE 486/586 CSE 486/586 Distributed Systems Logical Time Steve Ko Computer Sciences and Engineering University at Buffalo.
Communication & Synchronization Why do processes communicate in DS? –To exchange messages –To synchronize processes Why do processes synchronize in DS?
Event Ordering Greg Bilodeau CS 5204 November 3, 2009.
CIS825 Lecture 2. Model Processors Communication medium.
9/14/20051 Time, Clocks, and the Ordering of Events in a Distributed System by L. Lamport CS 5204 Operating Systems Vladimir Glina Fall 2005.
DISTRIBUTED SYSTEMS Principles and Paradigms Second Edition ANDREW S
CS603 Clock Synchronization February 4, What is Clock Synchronization? All nodes agree on time What do we mean by time? –Monotonic –Any observation.
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.
Synchronization. Clock Synchronization In a centralized system time is unambiguous. In a distributed system agreement on time is not obvious. When each.
Hwajung Lee. Primary standard = rotation of earth De facto primary standard = atomic clock (1 atomic second = 9,192,631,770 orbital transitions of Cesium.
Lecture 1: Logical and Physical Time with some Applications Anish Arora CSE 6333 Notes include material from Dr. Jeff Brumfield.
Ordering of Events in Distributed Systems UNIVERSITY of WISCONSIN-MADISON Computer Sciences Department CS 739 Distributed Systems Andrea C. Arpaci-Dusseau.
CS533 Concepts of Operating Systems Class 8 Time, Clocks, and the Ordering of Events in a Distributed System By Constantia Tryman.
COMP 655: Distributed/Operating Systems Summer 2011 Dr. Chunbo Chu Week 6: Synchronyzation 3/5/20161 Distributed Systems - COMP 655.
6.2 Logical Clocks Kranthi Koya09/23/2015. Overview Introduction Lamport’s Logical Clocks Vector Clocks Research Areas Conclusion.
CS3771 Today: Distributed Coordination  Previous class: Distributed File Systems Issues: Naming Strategies: Absolute Names, Mount Points (logical connection.
11-Jun-16CSE 542: Operating Systems1 Distributed systems Time, clocks, and the ordering of events in a distributed system Leslie Lamport. Communications.
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.
Indranil Gupta (Indy) Topic: Time and Ordering Lecture A: Introduction and Basics Cloud Computing concepts All slides © IG.
Lecture 5 Page 1 CS 111 Summer 2013 Bounded Buffers A higher level abstraction than shared domains or simple messages But not quite as high level as RPC.
Distributed Computing
Time and Clock Primary standard = rotation of earth
CSE 486/586 Distributed Systems Logical Time
CSE 486/586 Distributed Systems Logical Time
Time and Clock Primary standard = rotation of earth
EECS 498 Introduction to Distributed Systems Fall 2017
Time and Clock.
Logical time (Lamport)
湖南大学-信息科学与工程学院-计算机与科学系
Concurrent Graph Exploration with Multiple Robots
Time and Clock.
ITEC452 Distributed Computing Lecture 10 Time in a Distributed System
Chapter 5 (through section 5.4)
Basics of Distributed Systems
CDK: Sections 11.1 – 11.4 TVS: Sections 6.1 – 6.2
Logical time (Lamport)
Logical time (Lamport)
CSE 486/586 Distributed Systems Logical Time
Logical time (Lamport)
CSE 542: Operating Systems
Outline Theoretical Foundations
Presentation transcript:

COS 461 Fall 1997 Time and Clocks u uses of time in distributed systems: –time-based algorithms (e.g. in security) –distributed make –gathering event traces for debugging –proving or disproving causality (insider trading) u common element: need to know in which order events happened

COS 461 Fall 1997 Absolute Time u this is what clocks tell us u strategy: keep clocks synchronized; put time-stamp on each event u problems –hard to synchronize distributed clocks –clock speeds vary unpredictably –handling time zones, daylight savings time, year 2000, etc.

COS 461 Fall 1997 Synchronizing Clocks u many protocols exist –NTP (Network Time Protocol) standard –will discuss simpler protocol here u use reference clock as baseline –Coordinated Universal Time (UCT) –from atomic clocks run by NIST u other machines try to sync with UCT

COS 461 Fall 1997 Clock Synchronization Protocol u A sends to B: My clock says –only possible building block u problem: message takes time to get to B –network delay is unknown and variable u work-around: measure round-trip time between A and B, assume it doesnt vary much and that delay is equal in both directions –not completely accurate

COS 461 Fall 1997 Clock Synchronization Problems u synchronization is necessarily inaccurate –happens before judgements might be wrong u can get out of sync badly if network is partitioned u vulnerable to dishonest time-servers u bottom line: OK for some applications u alternative: logical time

COS 461 Fall 1997 Logical Time u insight: often dont care about when something happened, only about which thing happened first u logical time talks about happened before relationships, without reference to absolute time u (analogies to Einsteins relativity are common but bogus)

COS 461 Fall 1997 Example Process P1 Process P2 Process P3 AB CD EF

COS 461 Fall 1997 The Happened Before Relation u X --> Y means X happened before Y –captures logical ordering, not temporal u three rules: –if X and Y occur in the same process, and X occurs before Y, then X --> Y –if M is a message, then send(M) --> receive(M) –if X --> Y and Y --> Z, then X --> Z

COS 461 Fall 1997 Example Process P1 Process P2 Process P3 AB CD EF

COS 461 Fall 1997 Logical Time Relationships u Given two events X and Y, either –X --> Y, or –Y --> X, or –neither »X and Y are concurrent »X could not have caused Y, and vice versa u --> relation defines a partial order u How to determine --> in practice?

COS 461 Fall 1997 Logical Timestamp Algorithms u simple algorithms to capture --> u assign numerical timestamp to each event –no relation to absolute time u simple timestamps –if X --> Y, then TS(X) < TS(Y) u vector timestamps –X --> Y if and only if TS(X) --> TS(Y)

COS 461 Fall 1997 Simple Logical Timestamps u timestamp is an integer u each process has a logical clock –starts at zero –incremented on each local event u each message has a timestamp –equal to senders logical clock when sent –on receive, receivers logical clock set to 1 + max(message timestamp, receivers previous logical clock)

COS 461 Fall 1997 Logical Timestamp Example Process P1 Process P2 Process P3 AB CD EF

COS 461 Fall 1997 Simple Logical Timestamps u successfully capture all --> relationships u also capture some false relationships –TS(X) Y u good scheme to use if extra ordering isnt a problem u otherwise, need something fancier

COS 461 Fall 1997 Vector Timestamps u captures --> exactly u more complicated than simple timestamps –uses more time and space u represent a logical time as a vector with P entries (assuming P processes) u each process has logical clock u each message has a logical timestamp

COS 461 Fall 1997 Vector Timestamp Algorithm u local event in process I –process I increments the Ith element of its logical clock u message sent –message timestamp = logical clock of sender u message received –for all J, receiver sets Jth element of logical clock to max of »Jth component in message timestamp »Jth component in receivers logical clock

COS 461 Fall 1997 Vector Time Example Process P1 Process P2 Process P3 AB CD EF (1,0,0)(2,0,0) (2,1,0) (2,2,0) (0,0,1) (2,2,2)

COS 461 Fall 1997 Vector Time and Ordering u given two events X and Y, –X --> Y iff some X[i]<Y[i] and all X[i]<=Y[i] –Y --> X iff some Y[i]<X[i] and all Y[i]<=Y[i] –X || Y iff some X[i] Y[j] u captures happened-before relation exactly

COS 461 Fall 1997 Interpreting Vector Time u each process numbers its events sequentially –represented by Ith element of process Is clock u each process keeps track of which events on other processes have happened before the present time –if the Ith element of Ps clock is N, that means that the first N events at I happened before the present on process P

COS 461 Fall 1997 Application: Event Logging Tool u maintain vector logical clocks u each process dumps events of interest to a local file –mark with logical timestamp u postmortem analysis tool can interleave the local traces correctly –can answer questions of possible causality

COS 461 Fall 1997 Critique of Logical Time u fine for some applications, but u doesnt capture all of the real relationships –messages can flow outside the system »insider trading example u happened before doesnt capture causality –absolute time has this problem too