Distributed Systems. Time, clocks, and Ordering of events. Rik Sarkar. University of Edinburgh Fall 2014

Similar documents
Distributed Systems. Clock Synchronization: Physical Clocks. Paul Krzyzanowski

Lecture 10: Clocks and Time

Distributed Systems. 05. Clock Synchronization. Paul Krzyzanowski. Rutgers University. Fall 2017

Lecture 12: Time Distributed Systems

Distributed Systems COMP 212. Lecture 17 Othon Michail

Clock-Synchronisation

Time Synchronization and Logical Clocks

Time Synchronization and Logical Clocks

Last Class: Naming. Today: Classical Problems in Distributed Systems. Naming. Time ordering and clock synchronization (today)

Time. COS 418: Distributed Systems Lecture 3. Wyatt Lloyd

CSE 124: TIME SYNCHRONIZATION, CRISTIAN S ALGORITHM, BERKELEY ALGORITHM, NTP. George Porter October 27, 2017

CSE 5306 Distributed Systems. Synchronization

Last Class: Naming. DNS Implementation

DISTRIBUTED REAL-TIME SYSTEMS

TIME ATTRIBUTION 11/4/2018. George Porter Nov 6 and 8, 2018

CSE 5306 Distributed Systems

Clock and Time. THOAI NAM Faculty of Information Technology HCMC University of Technology

Middleware and Distributed Systems. Time. Martin v. Löwis. Mittwoch, 22. Februar 12

Synchronisation in. Distributed Systems. Co-operation and Co-ordination in. Distributed Systems. Kinds of Synchronisation. Clock Synchronization

INTERNATIONAL JOURNAL OF ENGINEERING SCIENCES & RESEARCH TECHNOLOGY

Proseminar Distributed Systems Summer Semester Paxos algorithm. Stefan Resmerita

Distributed Systems Exam 1 Review. Paul Krzyzanowski. Rutgers University. Fall 2016

Advanced Topics in Distributed Systems. Dr. Ayman A. Abdel-Hamid. Computer Science Department Virginia Tech

Synchronization. Distributed Systems IT332

Experiment on Cristian s and Berkeley Time Synchronization Algorithms

Synchronization Part 1. REK s adaptation of Claypool s adaptation of Tanenbaum s Distributed Systems Chapter 5

Time in Distributed Systems


殷亚凤. Synchronization. Distributed Systems [6]

Distributed Systems COMP 212. Revision 2 Othon Michail

TIME AND SYNCHRONIZATION. I. Physical Clock Synchronization: Motivation and Challenges

Delivering Sub-Microsecond Accurate Time to Linux Applications Around the World

Distributed Systems Exam 1 Review Paul Krzyzanowski. Rutgers University. Fall 2016

CS555: Distributed Systems [Fall 2017] Dept. Of Computer Science, Colorado State University

Distributed Coordination 1/39

Precise computer clock setting with MS Windows

Wireless Communication Bluetooth, Timing

Implementing NTP. Support was added for IPv6 addresses, VRFs, multicast-based associations, and burst and iburst modes for poll-based associations.

ECSE 425 Lecture 30: Directory Coherence

Implementing NTP. Release 3.8.0

Synchronization of Network Devices Time by GPS Based Network Time Protocol Output

EECS 498 Introduction to Distributed Systems

Network Time Protocol

IEEE 1588 PTP clock synchronization over a WAN backbone

The Flooding Time Synchronization Protocol

Implementing a NTP-Based Time Service within a Distributed Middleware System

Chapter 6 Synchronization (1)

Distributed Systems. Day 7: Time and Snapshots [Part 1]

Applications of Paxos Algorithm

Introduction to Distributed Systems

Chapter 6 Synchronization

David (Bong Jun) Choi (Supervisor: Xuemin (Sherman) Shen) Department of Electrical and Computer Engineering University of Waterloo

Precision Time Protocol, and Sub-Microsecond Synchronization

This chapter describes how to configure the Network Time Protocol (NTP) on Cisco NX-OS devices. This chapter includes the following sections:

Globally Synchronized time via Datacenter Networks

Configuring Precision Time Protocol (PTP)

Verteilte Systeme (Distributed Systems)

Basic vs. Reliable Multicast

Kyland Technology Co., Ltd. White Paper KT/ZY-RD Kyland Technology Co., Ltd. White Paper. High Precision Time Synchronization

SETTING UP AN NTP SERVER AT THE ROYAL OBSERVATORY OF BELGIUM

The Timed Asynchronous Distributed System Model By Flaviu Cristian and Christof Fetzer

Replication in Distributed Systems

INTRODUCTION TO WIRELESS SENSOR NETWORKS. CHAPTER 7: TIME SYNCHRONIZATION Anna Förster

One-way Delay Measurement Using NTP

Time. Computer Science and Engineering College of Engineering The Ohio State University. Lecture 37

Distributed Systems. 09. State Machine Replication & Virtual Synchrony. Paul Krzyzanowski. Rutgers University. Fall Paul Krzyzanowski

MINIMIZING TRANSACTION LATENCY IN GEO-REPLICATED DATA STORES

Large Systems: Design + Implementation: Communication Coordination Replication. Image (c) Facebook

CSE 123: Computer Networks Alex C. Snoeren. HW 2 due Thursday 10/21!

Fault Tolerance. Goals: transparent: mask (i.e., completely recover from) all failures, or predictable: exhibit a well defined failure behavior

Timing in Packet Networks. Stefano RUffini 9 March 2015

The IEEE 1588 Standard

SICLOCK TC 400 / TC100 and Redundancy

Distributed Systems. Before We Begin. Advantages. What is a Distributed System? CSE 120: Principles of Operating Systems. Lecture 13.

Distributed Systems. Pre-Exam 1 Review. Paul Krzyzanowski. Rutgers University. Fall 2015

Lecture 9: Bridging & Switching"

Synchronization. Clock Synchronization

SIMATIC. Process Control System PCS 7 Time synchronization (V8.1) Security information 1. Preface 2. Fundamentals 3

Fault Tolerance Causes of failure: process failure machine failure network failure Goals: transparent: mask (i.e., completely recover from) all

Distributed systems Lecture 3: Further RPC and OOM systems; Clocks

Time in Distributed Systems

18 Distributed Time. Distributed Embedded Systems Philip Koopman Nov. 9, Copyright , Philip Koopman

CLOCK SYNCHRONIZATION IN CELLULAR/MOBILE NETWORKS PETER CROY SENIOR NETWORK ARCHITECT AVIAT NETWORKS

Improving Mobile Backhaul Network Reliability with Carrier-Class IEEE 1588 (PTP) WHITE PAPER

1/10/16. RPC and Clocks. Tom Anderson. Last Time. Synchroniza>on RPC. Lab 1 RPC

IEEE 1588v2 PTP Support

CMU SCS CMU SCS Who: What: When: Where: Why: CMU SCS

Configuring NTP. Information About NTP. This chapter contains the following sections:

Selected Questions. Exam 2 Fall 2006

Distributed Systems Synchronization

Primary-Backup Replication

Configuring NTP. Information About NTP. This chapter contains the following sections:

Time Synchronization in Wireless Networks

Distributed Systems. replication Johan Montelius ID2201. Distributed Systems ID2201

Novell. NetWare 6. NETWORK TIME MANAGMENT ADMINISTRATION GUIDE

INTERNAL AND EXTERNAL CLOCK SYNCHRONIZATION IN A POWER LINE NETWORK

Distributed systems. Lecture 6: distributed transactions, elections, consensus and replication. Malte Schwarzkopf

Engineering Goals. Scalability Availability. Transactional behavior Security EAI... CS530 S05

TCG 01-G & TCG 02-G Firmware Release Notes

Distributed Operating Systems. Distributed Synchronization

Transcription:

Distributed Systems Time, clocks, and Ordering of events Rik Sarkar University of Edinburgh Fall 2014

Notes Last lecture: MST, MIS Ref: Lynch, distributed algorithms Today: Time, clocks, NTP Ref: CDK Causality, ordering, logical clocks: Ref: VG, CDK Distributed Systems, Edinburgh, 2014 2

Time Ordering of events are important: Which happened first Need synchronizaqon between sender and receiver CoordinaQon of joint acqvity Etc.. Distributed Systems, Edinburgh, 2014 3

UTC UTC Coordinated universal Qme Time maintained for civil use (on atomic clock) Kept within 0.9 seconds of exact mean Qme for Greenwich Distributed Systems, Edinburgh, 2014 4

Clocks Piezoelectric effect: Squeeze a quartz crystal: generates electric field Apply electric field: crystal bends: Quartz crystal clock: ResonaQon like a tuning fork Accurate to parts per million Gain/lose ½ second per day Distributed Systems, Edinburgh, 2014 5

Challenges Two clocks do not agree perfectly Skew: The Qme difference between two clocks Quartz oscillators vibrate at different rates Dri): The difference in rates of two clocks If we had two perfect clocks Distributed Systems, Edinburgh, 2014 6

Challenges Two clocks do not agree perfectly Skew: The Qme difference between two clocks Quartz oscillators vibrate at different rates Dri): The difference in rates of two clocks If we had two perfect clocks Skew = 0 Dric = 0 Distributed Systems, Edinburgh, 2014 7

When we detect a clock has a skew Eg: it is 5 seconds behind Or 5 seconds ahead What can we do? Distributed Systems, Edinburgh, 2014 8

When we detect a clock has a skew Eg: it is 5 seconds behind We can advance it 5 seconds to correct Or 5 seconds ahead Pushing back 5 seconds is a bad idea Message was received before it was sent Document closed before it was saved etc.. We want monotonicity: Qme always increases Distributed Systems, Edinburgh, 2014 9

When we detect a clock has a skew Eg: it is behind Run it faster unql it catches up It is ahead Run it slower unql it catches up This does not guarantee correct clock in future Need to check and adjust periodically Distributed Systems, Edinburgh, 2014 10

How clocks synchronize Obtain Qme from Qme server: Client Request Qme Time : 00:05:20 Server Distributed Systems, Edinburgh, 2014 11

How clocks synchronize Obtain Qme from Qme server: Client Request Qme Server Time : 00:05:20 Time is inaccurate Delays in message transmission Delays due to processing Qme Server s Qme may be inaccurate Distributed Systems, Edinburgh, 2014 12

ChrisQan s algorithm Compensate for delays Request sent at T 0 Reply received at T 1 T server Request Reply T 0 T 1 Assume delays are symmetric Distributed Systems, Edinburgh, 2014 13

ChrisQan s algorithm T new = T server + (T 1 T 0 )/2 T server Request Reply T 0 T 1 Distributed Systems, Edinburgh, 2014 14

T new = T server + (T 1 T 0 )/2 ChrisQan s algorithm Example: T 0 = 5:05:08.100, T 1 = 5:05:9.500, T server = 5:05:9.100 T new = 5:05:09:800 T server Request Reply T 0 T 1 Distributed Systems, Edinburgh, 2014 15

ChrisQan s algorithm If minimum message transit Qme T min is known Range = T 1 T 0-2T min Accuracy of result: (T 1 T 0-2T min )/2 T server Request Reply T 0 T 1 T min T min Distributed Systems, Edinburgh, 2014 16

ChrisQan s algorithm If minimum message transit Qme T min is known Range = T 1 T 0-2T min Accuracy of result: (T 1 T 0-2T min )/2 T server Request Reply T 0 T 1 T min T min Distributed Systems, Edinburgh, 2014 17

Berkeley algorithm Assumes no machine has perfect Qme Takes average of parqcipaqng computers Sync all clocks to average Distributed Systems, Edinburgh, 2014 18

Berkeley algorithm One computer is elected as server (master) Others are slaves Master polls each machine for Qme Compute average Idea average will cancel out skews Send each clock the offset by which it needs to adjust Qme Distributed Systems, Edinburgh, 2014 19

Berkeley algorithm One computer is elected as server (master) Others are slaves Master polls each machine for Qme Compute average Idea average will cancel out skews Send each clock the offset by which it needs to adjust Qme Sending Qme itself is suscepqble to network delays Distributed Systems, Edinburgh, 2014 20

Berkeley algorithm Fault tolerance Ignore readings of clocks with too large skews If master fails: run an elecqon algorithm and a slave becomes master Distributed Systems, Edinburgh, 2014 21

Network Qme protocol Enable clients to synchronize to UTC with reasonable accuracy Reliable: Redundant servers and paths Scalable: Enable many clients to synchronize frequently Security AuthenQcate sources Distributed Systems, Edinburgh, 2014 22

Network Qme protocol Servers in strata 1: directly connected to atomic, GPS etc clock May inter- communicate for cross checks 2: few microseconds of level 1 etc Distributed Systems, Edinburgh, 2014 23

Network Qme protocol Uses mulqple rounds of messages to get bemer Qme Large number of servers Uses an MST for inter- server sync Distributed Systems, Edinburgh, 2014 24

Time and synchronizaqon Important topic in distributed systems Many different methods Depending on systems, requirements No perfect soluqon Distributed Systems, Edinburgh, 2014 25

Special relaqvity Light cone: Things that e can have cause/influence e Things that could have caused/influenced e Distributed Systems, Edinburgh, 2014 26

GPS Satellites: Have very accurate atomic clocks Transmit signals: satid, Qme T 0, Receivers measure distance: (T 1 T 0 )*c [c = speed of light] Distance from mulqple satellites gives locaqon Complex computaqon, taking into account possible errors, clock dric and skew etc.. Needs relaqvisqc computaqon Special relaqvity: Clocks on fast moving satellites run slow (microseconds per day dric for satellites) General relaqvity: Clocks far from heavy bodies run fast (microseconds per day) Distributed Systems, Edinburgh, 2014 27