Clock Synchronization: Synchronizing Wallclock Time in Distributed Systems, Study notes of Computer Science

The importance of clock synchronization in distributed systems and the challenges of maintaining synchronized wallclock times. It covers historical time definitions, clock synchronization problems, synchronization algorithms, and correcting clock errors. The document also introduces the network time protocol (ntp) as a solution for clock synchronization in large systems.

Typology: Study notes

Pre 2010

Uploaded on 09/17/2009

koofers-user-oiy
koofers-user-oiy 🇺🇸

5

(1)

10 documents

1 / 3

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Maria Hybinette, UGA
CSCI: 4210/6210
Simulation & Modeling
PDES: Synchronizing Clocks
(Wallclock Time)
Maria Hybinette, UGA 2
Outline
!Clock Synchronization Problem
!Wallclock Time: Definitions
!Synchronization algorithms
!Correcting clock errors
Maria Hybinette, UGA 3
Problems With Unsynchronized Clocks
!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
Position update generated @ 3.035
3.010 3.020 3.030 3.040 3.050 3.060 3.070 3.080
Wallclock time
(processor 2)
3.025 3.035 3.045 3.055 3.065 3.075 3.085 3.095
Wallclock time
(processor 1)
Received @ 3.030
Message received before it was sent !
Dead reckoning?
A mechanism to synchronize hardware clocks is needed.
Maria Hybinette, UGA 4
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
Maria Hybinette, UGA 5
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
Maria Hybinette, UGA 6
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
pf3

Partial preview of the text

Download Clock Synchronization: Synchronizing Wallclock Time in Distributed Systems and more Study notes Computer Science in PDF only on Docsity!

Maria Hybinette, UGA

CSCI: 4210/

Simulation & Modeling

PDES: Synchronizing Clocks

(Wallclock Time)

Maria Hybinette, UGA 2

Outline

! Clock Synchronization Problem

! Wallclock Time: Definitions

! Synchronization algorithms

! Correcting clock errors

Maria Hybinette, UGA 3

Problems With Unsynchronized Clocks

! 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 Position update generated @ 3. 3.010 3.020 3.030 3.040 3.050 3.060 3.070 3. Wallclock time (processor 2) Wallclock time^ 3.025^ 3.035^ 3.045^ 3.055^ 3.065^ 3.075^ 3.085^ 3. (processor 1) Received @ 3. Message received before it was sent! Dead reckoning? A mechanism to synchronize hardware clocks is needed. Maria Hybinette, UGA 4

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

! 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

Maria Hybinette, UGA 7

Clock Synchronization Problems

! Ensuring different processors maintain

clocks that are synchronized with each

! = maximum offset allowed between two clocks

! Ensuring that clocks are synchronized with

UTC

» Only an issue if interacting with UTC-based devices Maria Hybinette, UGA 8

Synchronized Wallclock Time

! Notation

» Ci = hardware clock in processor i » T = UTC » Max clock drift ": 1 - "! dCi/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 Maria Hybinette, UGA 9

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

Maria Hybinette, UGA 10

Centralized, Pull Algorithm

TS = local time in requestor when request sent I = interrupt service time T = time value provided by server TR = local time in requestor when response received TR = T + L where L is communication latency Estimate L = (TR - TS - I) / 2 Collect several estimates of L, discard outliers, average Latency often symmetric in LANs, typically not in WANs

Time Server

Time Requestor

TS T TR Wallclock time

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 , …