Lecture 1: Logical, Physical & Casual Time (Part 2) Anish Arora CSE 763.

Slides:



Advertisements
Similar presentations
Synchronization.
Advertisements

Time in Distributed Systems
Logical Clocks.
HIERARCHY REFERENCING TIME SYNCHRONIZATION PROTOCOL Prepared by : Sunny Kr. Lohani, Roll – 16 Sem – 7, Dept. of Comp. Sc. & Engg.
Time and synchronization (“There’s never enough time…”)
Distributed Computing
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.
Computer Science 425 Distributed Systems CS 425 / ECE 428  2013, I. Gupta, K. Nahrtstedt, S. Mitra, N. Vaidya, M. T. Harandi, J. Hou.
Distributed Systems Spring 2009
Time in Embedded and Real Time Systems Lecture #6 David Andrews
Distributed Systems Fall 2010 Time and synchronization.
1. Explain why synchronization is so important in distributed systems by giving an appropriate example When each machine has its own clock, an event that.
Teaching material based on Distributed Systems: Concepts and Design, Edition 3, Addison-Wesley Copyright © George Coulouris, Jean Dollimore, Tim.
Distributed Operating Systems CS551 Colorado State University at Lockheed-Martin Lecture 7 -- Spring 2001.
Synchronization Clock Synchronization Logical Clocks Global State Election Algorithms Mutual Exclusion.
20101 Synchronization in distributed systems A collection of independent computers that appears to its users as a single coherent system.
Distributed Systems CS Synchronization – Part II Lecture 8, Sep 28, 2011 Majd F. Sakr, Vinay Kolar, Mohammad Hammoud.
SynchronizationCS-4513, D-Term Synchronization in Distributed Systems CS-4513 D-Term 2007 (Slides include materials from Operating System Concepts,
1 University of Freiburg Computer Networks and Telematics Prof. Christian Schindelhauer Wireless Sensor Networks 13th Lecture Christian Schindelhauer.
Synchronization in Distributed Systems CS-4513 D-term Synchronization in Distributed Systems CS-4513 Distributed Computing Systems (Slides include.
EEC-681/781 Distributed Computing Systems Lecture 10 Wenbing Zhao Cleveland State University.
EEC-681/781 Distributed Computing Systems Lecture 10 Wenbing Zhao Cleveland State University.
Lecture 12 Synchronization. EECE 411: Design of Distributed Software Applications Summary so far … A distributed system is: a collection of independent.
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.
1 Synchronization Part 1 REK’s adaptation of Claypool’s adaptation of Tanenbaum’s Distributed Systems Chapter 5.
TIME, CLOCKS AND THE ORDERING OF EVENTS IN A DISTRIBUTED SYSTEM L. Lamport Computer Science Laboratory SRI International.
Lecture 2-1 CS 425/ECE 428 Distributed Systems Lecture 2 Time & Synchronization Reading: Klara Nahrstedt.
1 Physical Clocks need for time in distributed systems physical clocks and their problems synchronizing physical clocks u coordinated universal time (UTC)
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED SYSTEMS.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED SYSTEMS.
1 A Modular Approach to Fault-Tolerant Broadcasts and Related Problems Author: Vassos Hadzilacos and Sam Toueg Distributed Systems: 526 U1580 Professor:
1 System Models. 2 Outline Introduction Architectural models Fundamental models Guideline.
Confidence Intervals for the Mean (σ known) (Large Samples)
Computer Science Lecture 10, page 1 CS677: Distributed OS Last Class: Naming Name distribution: use hierarchies DNS X.500 and LDAP.
Parallel and Distributed Simulation Synchronizing Wallclock Time.
Synchronization Chapter 5.
Communication & Synchronization Why do processes communicate in DS? –To exchange messages –To synchronize processes Why do processes synchronize in DS?
Distributed Systems Principles and Paradigms Chapter 05 Synchronization.
Lecture 9: Time and clocks (Chap 11) Haibin Zhu, PhD. Assistant Professor Department of Computer Science Nipissing University © 2002.
Time This powerpoint presentation has been adapted from: 1) sApr20.ppt.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED SYSTEMS.
Real-Time & MultiMedia Lab Synchronization Distributed System Jin-Seung,KIM.
Synchronization CSCI 4900/6900. Importance of Clocks & Synchronization Avoiding simultaneous access of resources –Cooperate to grant exclusive access.
Time and global states Chapter 11. Outline Introduction Clocks, events and process states Synchronizing physical clocks Logical time and logical clocks.
DISTRIBUTED SYSTEMS Principles and Paradigms Second Edition ANDREW S
CS 3471 CS 347: Parallel and Distributed Data Management Notes13: Time and Clocks.
CS 347Notes 121 CS 347: Parallel and Distributed Data Management Notes12: Time and Clocks Hector Garcia-Molina.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED SYSTEMS.
6 SYNCHRONIZATION. introduction processes synchronize –exclusive access. –agree on the ordering of events much more difficult compared to synchronization.
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.
COMP 655: Distributed/Operating Systems Summer 2011 Dr. Chunbo Chu Week 6: Synchronyzation 3/5/20161 Distributed Systems - COMP 655.
Chapter Confidence Intervals 1 of 31 6  2012 Pearson Education, Inc. All rights reserved.
Distributed Systems Lecture 5 Time and synchronization 1.
Fail-Stop Processors UNIVERSITY of WISCONSIN-MADISON Computer Sciences Department CS 739 Distributed Systems Andrea C. Arpaci-Dusseau One paper: Byzantine.
Distributed Web Systems Time and Global State Lecturer Department University.
Proof of liveness: an example
Prof. Leonardo Mostarda University of Camerino
Distributed Computing
Lecture 5 Time and synchronization
Time and Clock.
Time and Clock.
Maya Haridasan April 15th
DISTRIBUTED SYSTEMS Principles and Paradigms Second Edition ANDREW S
Logical time (Lamport)
Confidence Intervals for the Mean (Large Samples)
Chap 5 Distributed Coordination
Outline Theoretical Foundations
Presentation transcript:

Lecture 1: Logical, Physical & Casual Time (Part 2) Anish Arora CSE 763

Physical Clocks Assume each process i has a physical clock, C i (t), that is a continuous, differentiable function except where the clock is reset Necessary conditions for a system of physical clocks to be correct: 1.Each clock must run at the approximately correct rate 2.The clocks must be synchronized |

Physical Clock Synchronization How closely can a system of physical clocks be synchronized? Theorem (basic idea) If physical clocks are maintained using the given algorithm, the maximum difference between any two clocks is d(2 + ) where d=maximum distance between processes (diameter of distributed system) =maximum error in any clock rate =maximum time between message transmissions on each link =max unpredictable message delay

Physical Clock Synchronization Assume that message transmission time has two components: a minimum delay and an unpredictable delay Algorithm When sending a message, a process timestamps it with the current value of its physical clock Upon receiving a message, a process sets its physical clock to the maximum of 1.its current value and 2.the timestamp plus the minimum message delay

Importance of Clock Synchronization Synchronized clocks are fundamental to the correct functioning of a distributed system ordering events (e.g., FCFS scheduling) consistent updates of replicated data expiration of privileges prearranged synchronization ordering multi-version objects interpreting data that is a function of time

The Problem A distributed system having synchronized clocks should have the following properties: At any instant the values of the clocks at any two sites in the distributed should differ by no more than a known quantity At any instant the value of a clock at a site should differ from universal time (i. e., real time) by at most /2 The values assumed by any clock should be monotonically increasing The first property cannot be achieved absolutely, but only with some very high probability

Difficulty of Clock Synchronization The following factors conspire to prevent perfectly synchronized clocks: Clocks cannot be engineered to run at precisely the correct rate Sites in a distributed system cannot communicate infinitely often There are always unpredictable delays in message delivery Faulty or malicious sites may provide incorrect or inconsistent time values to other sites

Standard Time Dissemination To coordinate time throughout the world, national administrations maintain and disseminate standard time (such as International Atomic Time, TAl, and Coordinated Universal Time, UTC) U.S. National Institute of Standards and Technology WWV, Fort Collins, CO WWVH, Kauai, HI WWBV, Boulder, CO Geosynchronous Orbiting Environmental Satellite (GOES) LORAN-C Global Positioning System (GPS)

Distributed Time Services There are two widely-used technologies for time service: OSF DCE's Distributed Time Service based on Digitals DECdts developed during a mature commercial product described in reference 2 NTP - Network Time Protocol specified in 1985 adopted as an Internet Standard Recommended Protocol Transarcs implementation proposed to OSF

DCE Distributed Time Service A clock is a device that provides a measure of UTC Real clocks always exhibit some deviation from universal time, or error. The error can never be known exactly, but it can be bounded So, a clock reports a range of values, anyone of which could be the universal time

DCE DTS Architecture

Obtaining a Time Value from a Server Unsolicited time information is of minimal value A request/response protocol gives more information

Obtaining a Time Value from a Server When a clerk requests a time value from a server it doesn't know exactly when the server read its clock

Obtaining a Time Value from a Server A interval containing the server's time at the synchronization instant can be computed If lower bounds exist on the times required for intervening activities, the interval can be narrowed

Computing a Correct Time Time values are obtained from several servers, in case some of them are faulty If all servers are correct, then the narrowest correct time is simply the intersection of the intervals

Computing a Correct Time Assume at most one server is faulty

Computing a Correct Time Assume at most two servers are faulty

Marzullo's Algorithm 1.Arrange the endpoints of the intervals into a list 2.Mark each endpoint as a minimum or maximum 3.Sort the list. (If two endpoints have the same value, the minimums must precede the maximums) 4.Set the initial estimate of the number of faulty servers, f 5.Scan the list in increasing order to find the first endpoint that is in at least M - f intervals, where M is the number of servers 6.Scan the list in decreasing order to find the first endpoint in at least M - f intervals 7.If no such points are found, then there are more than f faulty servers. Increment f and go to step 5 8.The two points found delimit a correct time interval

Adjusting a Clock Depending on the difference between the local clock and the computed time, one of two methods is used to update the local clock Abrupt adjustment immediately sets the local clock to the computed time. This is done only if the difference is greater than 10 minutes Gradual adjustment changes the amount by which the clock is incremented at each tick. It preserves the property that time is a monotonically increasing, continuous function

Adjusting a Clock For gradual adjustment, a fast clock must be slowed down so that UTC catches up; a slow clock must be speeded up so it catches up to UTC If the clock is usually incremented by, then during adjustment it is incremented by + ( > 0 clock gains time; < 0 clock loses time) To achieve the necessary adjustment, the tick increment is adjusted for ticks

Adjusting a Clock Example normal clock increment, =1 additional adjustment, =0.5 clock reading = 100 correct time =102 number of adjustments =( ) / 0.5 = 4

Determining the Inaccuracy Whenever a clock is read, its inaccuracy must be calculated This inaccuracy has four components: 1.The base inaccuracy at the synchronization point 2.The drift increase 3.The decrease due to the adjustment in the clock 4.The clock resolution

Clerk Synchronization A clerk synchronizes when its local clock exceeds a specified inaccuracy 1.Obtain time values from a specified number of servers 2.Read the local clock to determine the synchronization instant 3.Translate each servers time to the synchronization instant 4.Compute best correct time from servers time values 5.Compare the local time with best correct time. Report faulty clock or initiate clock adjustment 6.Schedule the next synchronization

Server Synchronization If the server has a time provider, it periodically synchronizes with its time provider 1.Obtain time value(s) from time provider 2.Read the local clock to determine the synchronization instant 3.Translate the time provider's time(s) to the synchronization instant 4.Compute best correct time from time provider's time(s) and own clock value 5.Compare the local time with best correct time. Report faulty clock or initiate clock adjustment 6.Schedule the next synchronization

Server Synchronization If a server has no local time provider, it periodically synchronizes with other servers. 1. Obtain time values from all local servers 2. Read the local clock to determine the synchronization instant 3. Translate the servers times to the synchronization instant 4. Compute best correct time from time servers times and own clock value 5. Compare the local time with best correct time. Report faulty clock or initiate clock adjustment 6. Schedule the next synchronization