Clock Synchronization



Similar documents
Synchronization in. Distributed Systems. Cooperation and Coordination in. Distributed Systems. Kinds of Synchronization.

Distributed Synchronization

Abstract. Cycle Domain Simulator for Phase-Locked Loops

Clocking. Figure by MIT OCW Spring /18/05 L06 Clocks 1

Local Interconnect Network Training. Local Interconnect Network Training. Overview

3.7. Clock Synch hronisation

Lecture 11: Sequential Circuit Design

Lecture 10: Sequential Circuits

Real-Time Component Software. slide credits: H. Kopetz, P. Puschner

Homework 1 (Time, Synchronization and Global State) Points

PowerPC Microprocessor Clock Modes

Distributed Systems Theory 6. Clock synchronization - logical vs. physical clocks. November 9, 2009

An Overview of Clock Synchronization

An All-Digital Phase-Locked Loop with High Resolution for Local On-Chip Clock Synthesis

Section 3. Sensor to ADC Design Example

Sequential Circuits. Combinational Circuits Outputs depend on the current inputs

Monitoring the NTP Server. eg Enterprise v6.0

Chapter 6: distributed systems

APPLICATION OF ADVANCED SEARCH- METHODS FOR AUTOMOTIVE DATA-BUS SYSTEM SIGNAL INTEGRITY OPTIMIZATION

Lecture 10 Sequential Circuit Design Zhuo Feng. Z. Feng MTU EE4800 CMOS Digital IC Design & Analysis 2010

Clock Synchronization using Packet Streams

SCALABILITY AND AVAILABILITY

Lecture 7: Clocking of VLSI Systems

Middleware and Distributed Systems. System Models. Dr. Martin v. Löwis. Freitag, 14. Oktober 11

Introduction to CMOS VLSI Design (E158) Lecture 8: Clocking of VLSI Systems

Simple and error-free startup of the communication cluster. as well as high system stability over long service life are

Application Note 58 Crystal Considerations with Dallas Real Time Clocks

ISSCC 2003 / SESSION 13 / 40Gb/s COMMUNICATION ICS / PAPER 13.7

Introduction to. LIN (Local Interconnect Network)

Clocking. Clocking in the Digital Network

Application Note 58 Crystal Considerations for Dallas Real-Time Clocks

Active Queue Management

DDR subsystem: Enhancing System Reliability and Yield

Phase-Locked Loop Based Clock Generators

Synchronization of sampling in distributed signal processing systems

LIN (Local Interconnect Network):

Practical Cassandra. Vitalii

Distributed Database Management Systems

Mediatrix Gateways and ISDN Clock Synchronization June 22, 2011

174: Scheduling Systems. Emil Michta University of Zielona Gora, Zielona Gora, Poland 1 TIMING ANALYSIS IN NETWORKED MEASUREMENT CONTROL SYSTEMS

Data Mining on Streams

The Role of Precise Timing in High-Speed, Low-Latency Trading

Latch Timing Parameters. Flip-flop Timing Parameters. Typical Clock System. Clocking Overhead

Non-Data Aided Carrier Offset Compensation for SDR Implementation

CSC 774 Advanced Network Security. Outline. Related Work

Clock Synchronization

Packet TDEV, MTIE, and MATIE - for Estimating the Frequency and Phase Stability of a Packet Slave Clock. Antti Pietiläinen

SPINS: Security Protocols for Sensor Networks

THE STEERING OF A REAL TIME CLOCK TO UTC(NBS) AND TO UTC by

VoIP Timing and Synchronization Best Practices

DS2187 Receive Line Interface

FPGA Clocking. Clock related issues: distribution generation (frequency synthesis) multiplexing run time programming domain crossing

Active Queue Management A router based control mechanism

Standardized software components will help in mastering the. software should be developed for FlexRay were presented at

FlexRay A Communications Network for Automotive Control Systems

TCP, Active Queue Management and QoS

I 2 S bus specification

Timing Methodologies (cont d) Registers. Typical timing specifications. Synchronous System Model. Short Paths. System Clock Frequency

Delivering NIST Time to Financial Markets Via Common-View GPS Measurements

Adaptive Tolerance Algorithm for Distributed Top-K Monitoring with Bandwidth Constraints

MapReduce and Distributed Data Analysis. Sergei Vassilvitskii Google Research

Multi-core real-time scheduling

Probabilistic Models for Big Data. Alex Davies and Roger Frigola University of Cambridge 13th February 2014

A Comparative Performance Analysis of Load Balancing Algorithms in Distributed System using Qualitative Parameters

Chapter 4. Medium Access Control. IN2P3 Octobre 2002 Jean-Pierre Thomesse

IEEE-1588 Standard for a Precision Clock Synchronization Protocol for Networked Measurement and Control Systems

Chapter 6 PLL and Clock Generator

AC/DC Power Supply Reference Design. Advanced SMPS Applications using the dspic DSC SMPS Family

DeviceNet Bus Software Help for Programming an Allen Bradley Control System

A 1.62/2.7/5.4 Gbps Clock and Data Recovery Circuit for DisplayPort 1.2 with a single VCO

Modern Optimization Methods for Big Data Problems MATH11146 The University of Edinburgh

System Software and TinyAUTOSAR

A Simultaneous Solution for General Linear Equations on a Ring or Hierarchical Cluster

A new Cluster Resource Manager for heartbeat

e.g. τ = 12 ps in 180nm, 40 ps in 0.6 µm Delay has two components where, f = Effort Delay (stage effort)= gh p =Parasitic Delay

At what line speed do modems initialise? (1) Operator Controlled Mode (RA mode 1)

Microcomputer Protocol Implementation at Local Interconnect Network Georgi Krastev

Chapter 14: Distributed Operating Systems

Utility Communications FOXMAN-UN Network Management System for ABB Communication Equipment

Industrial Ethernet How to Keep Your Network Up and Running A Beginner s Guide to Redundancy Standards

Vehicle data acquisition using CAN By Henning Olsson, OptimumG

Top 10 Reasons why MySQL Experts Switch to SchoonerSQL - Solving the common problems users face with MySQL

USB 3.0 CDR Model White Paper Revision 0.5

Low latency synchronization through speculation

Database Replication with Oracle 11g and MS SQL Server 2008

PEDAMACS: Power efficient and delay aware medium access protocol for sensor networks

MAINTENANCE & ADJUSTMENT

VOLTAGE-TO-FREQUENCY CONVERTER

Analysis of Industrial PROFINET in the Task of Controlling a Dynamic System**

Systolic Computing. Fundamentals

Example of the Glicko-2 system

Chapter 16: Distributed Operating Systems

Transcription:

Clock Synchronization Henrik Lönn Electronics & Software Volvo Technological Development Contents General Types of Synchronisation Faults and problems to cope with Example algorithms Transmission delays Derivation of criterion n>3m Derivation of clock precision 1

Why do we need an agreed time? Consistent inputs/outputs Control loops Rollback recovery Time-triggered task execution Resource utilization ECU ECU Clock Synchronization Internal vs. External Master-Slave vs. Distributed Hardware vs. software 2

Synchronization Goals: High Precision -Small deviation, or skew, between clocks High Accuracy - Small deviation to external time Monotonic and Continuous time d dt Ci 1 < ρ or Clock drift ( 1-ρ)( t t ) t t ( 1+ ρ)( t t ) 2 1 2 1 2 1 Why should clock drift be small? Generally: All users of the clock service require a certain accuracy & precision => Clock synchronization must be performed more often with large drift 3

How often should we re-synchronize synchronize? ρ: A rate deviation from external time (s/s) R: Time between synchronizations s : Precision after synchronization Skew increase by R*2ρ between two synchronizations Choose R so that s +R*2ρ < Req. precision How often should we re-synchronize synchronize? Loosely coupled systems: Inaccurate, expensive clock readings=> Use high accuracy clocks, synchronize seldom Tightly coupled systems: Accurate clock readings=> Use low accuracy clocks and synchronize often ( s +R*2ρ < Req. precision) 4

Rate adjustment Clock rate is adjusted Required adjustment: Time between adjustments: R => Adjust rate with /R Oscillators Inverters RC oscillators 10-3 Quartz oscillators 10-6 5

Hardware clock synchronization Use a clock distribution network Much hardware required Very good precision Collection of Clock readings Phase Locked Loop feedback control loop φ i Comparator V c Filter Oscillator (VCO) φ r 6

Full connectivity not required A cluster is fully connected internally and connected to at least one clock in each cluster p i +M-1 3m+1 Number of Clock inputs > 3 times number of faults M number of clusters p i clocks in cluster i m faulty clocks are tolerated Software clock synchronisation: Use messages Cheap in hardware Flexible Low precision Current time is 1500 7

Hardware assisted Software clock synchronisation: Use messages whose exact point of arrival is recorded by hardware Cheap in hardware high precision on suitable topology Current time is 1500 Beep! Exact arrival time is 15:01 Use of pre-scheduled events as clock readings TDMA: Time Division Multiple Access CC: 0 1... CC max 0 1 t Communication Cycle, CC Message from node: 0 1... max 0 1 t 8

Faults Excessive drift Clock reading errors Byzantine faults ( Dual-faced clocks) The faulty clock gives different readings to different nodes Cliques Clock groups that are mutually unsynchronized Clock synch. algorithm must prevent this! A Slowest B Slower C Slow D Fast E Faster F Fastest This group follows clock B This group follows clock E 9

Byzantine faults Effect on a sensible algorithm: (Syncronize to median of clock readings): C C A B I m slowest D E I m Slower I m Slow I m Fast I m Faster I m fastest C Faulty This group will follow clock B This group will follow clock D Byzantine lie Solution: Use a fault tolerant algorithm. 3m+1 clocks to tolerate m clock failures Convergence vs Consistency Algorithms The presented algorithms are of this type Interactive convergence algorithms Adjustment function guarantees limited clock skew in spite of faulty clocks and different sets of clock readings Interactive consistency algorithms Agreement algorithm guarantees that all sets of clock readings are identical. Adjustment function is arbitrary, take e. g. median 10

Interactive convergence algorithm (CA1) Collect clock readings Replace values larger than max with an arbitrary value smaller than max Take average of clock readings Local Clock Collection of Clock readings External clock Who's first detector Up Dn Modulo 2*max counter Clock deviation (Twos complement) Fault Tolerant Average algorithm (CA2) Mean of clocks excluding t fastest and t slowest Readings from different clocks New clock value 11

Midpoint algorithm Mean of fastest and slowest excluding t fastest and t slowest Readings from different clocks New clock value Convergence Nonaveraging Algorithm (CNA) Resynchronization interval=r At synchronization i: If clock reaches ir, send synchronization message Adjust time to ir if synchronization message arrive in time, and relay message Ignore synchronization messages that arrive too early or too late (adjustment i has been done) 12

Transmission delays: Hardware/Hybrid environment: Speed of light 3 ns/m Software environment: (Bounded) Message delays Transmission delay Time is now 15.00! Not more? I have to set back my clock! Reducing effects of message delay in loosely coupled systems: Incoming messages receive a timestamp by hardware Before a message is relayed, its clock value is increased by the time spent in the node 13

Probabilistic Clock Synch. Time is C remote! Request sent, t0 Reply sent, tr Reply arrives, t1 Request arrives Stochastic, additional delay Stochastic, additional delay Minimum message delay Minimum message delay Request sent, t0 Reply arrives, t1 Probabilistic Clock Synch. 1) Request reference clock reading from master - Request sent at t 0 and clock reading C remote received at t 1 2) Assume that reading instant is C local =(t 0 +t 1 )/2 and calculate clock deviation C local -C remote Make multiple readings until t 1 -t 0 < threshold Total delay=t 1 -t 0 Total stochastic delay, d stoch =(t 1 -t 0 ) -2*d min t 0 +d min < t r <t 0 +d min + d stoch Choose midpoint => error<d stoch /2 14

Correctness Criteria Slowest Slower Slow Fast Faster Fastest G2 G1 For all partitions G1 and G2 of correct clocks such that all clocks in G1 are faster than those in G2: C1: If all clocks in G1 use a reference that is faster than all clocks in G2 then there must be at least one clock in G2 that uses a reference that is at least as fast as the slowest clock in G1 and vice versa C2: If a clock uses a reference from a faulty clock, there must be correct signals that are slower and faster than the reference. i. e. Faulty clocks that are used as a reference must be sandwiched between correct clocks Tolerating Byzantine Faults Correctness criterion C1=> If max f then x G p( x) ( N, m) G1 + m 1 min f p( y) ( N, m) G1 y G2 (If "no clock in G1 use reference in G2" then "a clock in G2 must use ref. in G1") If then min y G2 max x G1 f ( N, m) G1 + 1 p( y) f ( N, m) G1 + m+ 1 p( x) (1) (2) (If "no clock in G2 use reference in G1" then "a clock in G1 must use ref. in G2") f p(i) (N,m): Number of the reference clock used by clock i (Clock readings numbered "fastest first". There are N clocks and m Byz. faults) x B Slowest Slower Slow Fast Faster Fastest G2 A G1 15

Tolerating Byzantine Faults (2)-(1) f max Avoid faulty clocks (Criterion C2) f ( N, m) N m max x G1 min x G2 p( x) f ( N, m) m+ 1 p( y) Substitute in (3) ( N, m) f p( y )( N, m) m p( x ) min x G 1 y G 2 N-m - (m+1) m; N 3m+1 (3) Attainable precision, CA2 Precision after synchronization: s Clock precision: δ Reading error: ε Synchronization interval: R s =mδ/(n-2m) + ε δ= s +2Rρ= mδ/(n-2m)+ε+2rρ δ=( ε+2rρ) ((N-2m)/(N-3m)) 16

Attainable precision, CA2 Include uncertainty in R and time when correction is applied δ= s +ρ s +2ρ(1+ρ)R= (mδ/(n-2m)+ε+2rρ) (1+ρ) δ=(1+ρ)(ε+2rρ) ((N-2m)/(N-3m-mρ)) Summary Reasons for clock synchronisation Some problems to cope with Types of clock synchronisaton Example algorithms Derivation of attainable clock precision for one algorithm 17