Parallel and Distributed Simulation Synchronizing Wallclock Time.

Slides:



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

Synchronization.
Time in Distributed Systems
HIERARCHY REFERENCING TIME SYNCHRONIZATION PROTOCOL Prepared by : Sunny Kr. Lohani, Roll – 16 Sem – 7, Dept. of Comp. Sc. & Engg.
Distributed Systems CS Synchronization Lecture 6, Sep 26, 2011 Majd F. Sakr, Vinay Kolar, Mohammad Hammoud.
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.
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.
CS6223: Distributed Systems Distributed Time and Clock Synchronization (1) Physical Time.
Computer Science 425 Distributed Systems CS 425 / ECE 428  2013, I. Gupta, K. Nahrtstedt, S. Mitra, N. Vaidya, M. T. Harandi, J. Hou.
Time in Embedded and Real Time Systems Lecture #6 David Andrews
Distributed Systems Fall 2010 Time and synchronization.
Teaching material based on Distributed Systems: Concepts and Design, Edition 3, Addison-Wesley Copyright © George Coulouris, Jean Dollimore, Tim.
1 IMPROVING RESPONSIVENESS BY LOCALITY IN DISTRIBUTED VIRTUAL ENVIRONMENTS Luca Genovali, Laura Ricci, Fabrizio Baiardi Lucca Institute for Advanced Studies.
Time and Global States Chapter 11. Why time? Time is an Important and interesting issue in distributes systems. One we can measure accurately. Can use.
Synchronization in Distributed Systems. Mutual Exclusion To read or update shared data, a process should enter a critical region to ensure mutual exclusion.
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.
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.
1 Synchronization Part 1 REK’s adaptation of Claypool’s adaptation of Tanenbaum’s Distributed Systems Chapter 5.
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.
Naming CSCI 4780/6780. Attribute-based Naming Flat and structured names provide location transparency Structured names are also human-friendly Increasingly,
A Security Analysis of Network Time Protocol Andy Hospodor COEN /03/03 Paper by Matt Bishop, 1991.
Computer Science Lecture 10, page 1 CS677: Distributed OS Last Class: Naming Name distribution: use hierarchies DNS X.500 and LDAP.
Time and Coordination March 13, Time and Coordination What is time? :-)  Issue: How do you coordinate distributed computers if there is no global.
Computer Science Lecture 9, page 1 CS677: Distributed OS Last Class: Naming Name distribution: use hierarchies DNS Iterative versus Recursive name resolution.
Communication & Synchronization Why do processes communicate in DS? –To exchange messages –To synchronize processes Why do processes synchronize in DS?
Time synchronization for UWSN. Outline Time synchronization knowledge Typical time sync protocol Time sync in UWSN Discussion.
Distributed Systems Principles and Paradigms Chapter 05 Synchronization.
1 Clock Synchronization & Mutual Exclusion in Distributed Operating Systems Brett O’Neill CSE 8343 – Group A6.
Synchronization Distributed System. Why synchronization? Two sharpshooters in a multiplayer online game kill the same target. Which one gets the points?
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.
Physical clock synchronization Question 1. Why is physical clock synchronization important? Question 2. With the price of atomic clocks or GPS coming down,
Time and global states Chapter 11. Outline Introduction Clocks, events and process states Synchronizing physical clocks Logical time and logical clocks.
Distributed Systems CS Synchronization – Part I Lecture 8, Sep 23, 2013 Mohammad Hammoud.
Distributed Systems Topic 5: Time, Coordination and Agreement
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.
Distributed Systems Lecture 5 Time and synchronization 1.
Page 1 Clock Synchronization: Physical Clocks Minqi Zhou Distributed Systems Except as otherwise noted, the content of this presentation.
Distributed Web Systems Time and Global State Lecturer Department University.
Proof of liveness: an example
Distributed Computing
Distributed Systems CS
Time and Clock Primary standard = rotation of earth
Time and Clock.
Logical time (Lamport)
Clock Synchronization: Physical Clocks
Distributed Systems CS
Time and Clock.
DISTRIBUTED SYSTEMS Principles and Paradigms Second Edition ANDREW S
Distributed Systems CS
Physical clock synchronization
CDK: Sections 11.1 – 11.4 TVS: Sections 6.1 – 6.2
Distributed Synchronization
Logical time (Lamport)
Logical time (Lamport)
Logical time (Lamport)
Last Class: Naming Name distribution: use hierarchies DNS
Presentation transcript:

Parallel and Distributed Simulation Synchronizing Wallclock Time

Outline Clock Synchronization Problem Wallclock Time: Definitions Synchronization algorithms Correcting clock errors

Problems With Unsynchronized Clocks A mechanism to synchronize hardware clocks is needed. Position update Wallclock time (processor 2) Wallclock time (processor 1) Each processor has a local oscillator providing wallclock time values At any instant clocks in distinct processors will differ Clocks in different processors drift relative to each other Message received before it was sent ! Dead reckoning?

Time Definitions Historically, time definitions based on periodic astronomical events –Solar day: time duration that elapses between event where the sun is at the highest point in the sky –24 hours per solar day, 3600 seconds per hour –Greenwich mean time: solar time at the Greenwich meridian (observatory near London) Today, atomic clocks define standard time sources –Time duration based on transitions of cesium atom

Time Definitions (cont.) Earth’s rotation slowing down slightly Duration of a “day” is increasing Slowing down effect not accounted for by atomic clocks Solution: leap seconds are periodically added to time produced by cesium clock –Resulting time called Coordinated Universal Time (UTC) –Time standard accepted world wide –Disseminated by standards organizations National Institute of Standards and Technology (NIST) in U.S. Available via satellites, radio broadcasts, phones

Clock Synchronization Problems Ensuring different processors maintain clocks that are synchronized with each other  = maximum offset allowed between two clocks Ensuring that clocks are synchronized with UTC Only an issue if interacting with UTC-based devices

Synchronized Wallclock Time Notation –C i = hardware clock in processor i –T = UTC –Max clock drift  : 1-  ≤ dC i /dT ≤ 1+  –Clocks in two processor may drift 2  per unit UTC Processors must periodically resynchronize their clocks How often? –  = maximum offset allowed between two clocks – Clocks can drift  time units in  /2  time – Resynchronization must be done at least every  /2  time units

Clock Synchronization Algorithms Centralized, pull algorithms –Each processor periodically requests current time from a central time server –Server reads local clock and returns current time value Centralized, push algorithms –Central time server periodically sends current time to other processors Distributed algorithms –No central time server –Processors use distributed algorithm to synchronize their local clock Basic problem: communication latency time is unpredictable

Centralized, Pull Algorithm T S = local time in requestor when request sent I = interrupt service time T = time value provided by server T R = local time in requestor when response received T R = T + L where L is communication latency Estimate L = (T R - T S - I) / 2 Collect several estimates of L, discard outliers, average Latency often symmetric in LANs, typically not in WANs Time Server Time Requestor Wallclock time TSTS TTRTR I

Push and Distributed Algorithms Push algorithms –Server periodically broadcasts time values –Requires assumption of message latency Distributed algorithms –Avoids single point of failure, bottleneck for large systems –A push algorithm Each processor periodically sends time values to a subset of the other processors Incoming time values: discard outliers, average received values

Network Time Protocol Distributed clock service implemented on Internet Hierarchical subnetwork of clock servers –Clock information flows down hierarchy –Servers at level i synchronize with servers at level i+1 Primary servers –Level 1 of tree –Synchronized with national time servers Secondary servers –Level 2, 3, …

NTP Latency and Offset Estimation A = T 2 –T 1 =  +L; A is an upper bound on  B = T 3 –T 4 =  –L’; B is a lower bound on  Estimate offset as (A+B)/2 Round trip delay = L+L’ = A –B Level i+1 Server Level i Server Wallclock time Four time stamps stored in message: T 1, T 2, T 3, T 4  = offset between clocks (unknown) L, L’ = message latency (send and reply) T1+T1+ T 2 =T 1 +  +L T3-T3- T 4 =T 3 -  +L’ T1T1 L T3T3 L’

NTP: Other Aspects Collect clock estimates from several servers Clock selection algorithm: reduce to set of “trusted clocks” –Interval selection sub-algorithm eliminates outliers –Clustering algorithm selects best K estimates among the ones that remain Clock combining algorithm –Weighted average of clock estimates used to adjust local oscillator

Correcting (Resynchronizing) Clocks Reset clock to new time value –Could cause clock to go backwards in time –Abrupt changes forward also undesirable Phase in clock change –Suppose clock is 10 milliseconds ahead –Interrupt generated every 30 milliseconds –Each interrupt increment clock by 29 milliseconds rather than 30 –Perform above operation 10 times

Summary Clock synchronization needed for features like latency compensation in dead reckoning algorithms Coordinated Universal Time (UTC) standard reference Synchronization: Unknown message latency source of problems Several styles of clock synchronization available –Centralized vs. distributed –Push vs. pull Clock corrections must be phased in