christoph lenzen philipp sommer philipp sommer roger wattenhofer roger wattenhofer optimal clock...

27
Christoph Lenzen Philipp Sommer Roger Wattenhofer Optimal Clock Synchronization in Networks

Upload: marquise-sloper

Post on 28-Mar-2015

216 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Christoph Lenzen Philipp Sommer Philipp Sommer Roger Wattenhofer Roger Wattenhofer Optimal Clock Synchronization in Networks

Christoph Lenzen Philipp Sommer

Roger Wattenhofer

Optimal Clock Synchronization in Networks

Page 2: Christoph Lenzen Philipp Sommer Philipp Sommer Roger Wattenhofer Roger Wattenhofer Optimal Clock Synchronization in Networks

Philipp Sommer, ETH Zurich @ SenSys‘09

Synchronized clocks are essential for many applications:

Time in Sensor Networks

Time Synchronization(RBS, TPSN, FTSP, ...)

SensingLocalization

Duty-Cycling

TDMA

Page 3: Christoph Lenzen Philipp Sommer Philipp Sommer Roger Wattenhofer Roger Wattenhofer Optimal Clock Synchronization in Networks

Philipp Sommer, ETH Zurich @ SenSys‘09

Hardware clock

Counter register of the microcontroller

Sourced by an external crystal (32kHz, 7.37 MHz)

Clock drift

Random deviation from the nominal rate dependent on ambient temperature, power supply, etc. (30-100 ppm)

Hardware Clocks Experience Drift

t

rate

11+²

1-²

Mica2

Page 4: Christoph Lenzen Philipp Sommer Philipp Sommer Roger Wattenhofer Roger Wattenhofer Optimal Clock Synchronization in Networks

Problem: Jitter in the message delay

Various sources of errors (deterministic and non-deterministic)

Solution: Timestamping packets at the MAC layer (Maróti et al.)

→ Jitter in the message delay is reduced to a few clock ticks

Philipp Sommer, ETH Zurich @ SenSys‘09

Messages Experience Jitter in the Delay

Send Access Transmission

Reception Receive

0-100 ms 0-500 ms 1-10 ms

0-100 mstimestamp

timestamp

t

Expected delay TJitter J

timefreq

uenc

y (%

)

Page 5: Christoph Lenzen Philipp Sommer Philipp Sommer Roger Wattenhofer Roger Wattenhofer Optimal Clock Synchronization in Networks

Philipp Sommer, ETH Zurich @ SenSys‘09

Goal:

Send time information (beacons) to synchronize clocks

Problems:- Hardware clocks exhibit drift

- Jitter in the message delay

Summary: Clock Synchronization

Expected delay T

Jitter J

Page 6: Christoph Lenzen Philipp Sommer Philipp Sommer Roger Wattenhofer Roger Wattenhofer Optimal Clock Synchronization in Networks

Philipp Sommer, ETH Zurich @ SenSys‘09

Sychnronization error vs. hop distance

Preview: Experimental Results

FTSP PulseSync

NEW!

Page 7: Christoph Lenzen Philipp Sommer Philipp Sommer Roger Wattenhofer Roger Wattenhofer Optimal Clock Synchronization in Networks

Philipp Sommer, ETH Zurich @ SenSys‘09

Introduction Theory Practice

Outline

Page 8: Christoph Lenzen Philipp Sommer Philipp Sommer Roger Wattenhofer Roger Wattenhofer Optimal Clock Synchronization in Networks

Philipp Sommer, ETH Zurich @ SenSys‘09

How do we synchronize the clocks of two sensor nodes?

Synchronizing Nodes: Single-Hop

0 1

reference clock

Page 9: Christoph Lenzen Philipp Sommer Philipp Sommer Roger Wattenhofer Roger Wattenhofer Optimal Clock Synchronization in Networks

Philipp Sommer, ETH Zurich @ SenSys‘09

Sending periodic beacons to synchronize nodes

J

t=100 t=130

Beacon interval B

T T1

0

J

reference clock

Synchronizing Nodes

t

t

100 130

Page 10: Christoph Lenzen Philipp Sommer Philipp Sommer Roger Wattenhofer Roger Wattenhofer Optimal Clock Synchronization in Networks

Message delay jitter affects clock synchronization quality

Philipp Sommer, ETH Zurich @ SenSys‘09

How accurately can we synchronize two Nodes?

0

1

x

y

r y(x) = r·x + ∆y

relative clock rate(estimated)

clock offset

J J

∆y

Beacon interval B

^^

r

Page 11: Christoph Lenzen Philipp Sommer Philipp Sommer Roger Wattenhofer Roger Wattenhofer Optimal Clock Synchronization in Networks

Message delay jitter affects clock synchronization quality

Philipp Sommer, ETH Zurich @ SenSys‘09

How accurately can we synchronize two Nodes?

0

1

x

y

y(x) = r·x + ∆y clock offset

J J∆y

Beacon interval B

r̂ ^

relative clock rate(estimated)

rr̂

Page 12: Christoph Lenzen Philipp Sommer Philipp Sommer Roger Wattenhofer Roger Wattenhofer Optimal Clock Synchronization in Networks

Philipp Sommer, ETH Zurich @ SenSys‘09

Lower Bound on the clock skew between two neighbors

Clock Skew between two Nodes

0

1

x

y

r

J J∆y

Beacon interval B

Error in the rate estimation:- Jitter in the message

delay- Beacon interval- Number of beacons k

Synchronization error:

(complete proof is in the paper)

^

rr̂

Page 13: Christoph Lenzen Philipp Sommer Philipp Sommer Roger Wattenhofer Roger Wattenhofer Optimal Clock Synchronization in Networks

Philipp Sommer, ETH Zurich @ SenSys‘09

How do we synchronize the clocks of multiple sensor nodes?

Synchronizing Nodes: Multi-hop

0 1

reference clock

2

Page 14: Christoph Lenzen Philipp Sommer Philipp Sommer Roger Wattenhofer Roger Wattenhofer Optimal Clock Synchronization in Networks

Philipp Sommer, ETH Zurich @ SenSys‘09

How does the network diameter affect synchronization errors?

Examples for sensor networks with high diameter

Bridge, road or pipeline monitoring

Deployment at Golden Gate Bridge with 46 hops(Kim et al., IPSN’07)

Now we have a network of nodes!

0 1 2 3 4 ... d

Page 15: Christoph Lenzen Philipp Sommer Philipp Sommer Roger Wattenhofer Roger Wattenhofer Optimal Clock Synchronization in Networks

Philipp Sommer, ETH Zurich @ SenSys‘09

Nodes forward their current estimate of the reference clock

Each synchronization beacon is affected by a random jitter J

Sum of the jitter grows with the square-root of the distance

stddev(J1 + J2 + J3 + J4 + J5 + ... Jd) = √d×stddev(J)

Multi-hop Clock Synchronization

J1 J2 J3

0 1 2 3 4 ...J4 J5

d

Single-hop: Multi-hop:

Jd

(proof is in the paper)

Page 16: Christoph Lenzen Philipp Sommer Philipp Sommer Roger Wattenhofer Roger Wattenhofer Optimal Clock Synchronization in Networks

Philipp Sommer, ETH Zurich @ SenSys‘09

Introduction Theory Practice

Outline

Page 17: Christoph Lenzen Philipp Sommer Philipp Sommer Roger Wattenhofer Roger Wattenhofer Optimal Clock Synchronization in Networks

Philipp Sommer, ETH Zurich @ SenSys‘09

Flooding Time Synchronization Protocol (FTSP)- Nodes synchronize to a root (leader) node- Leader-election phase (by smallest id)- Periodic synchronization beacons (unaligned)- Linear-regression table to correct clock drift

Clock Synchronization in Practice

Maroti et al. (SenSys‘04)

04 2

51

3

6root node

Page 18: Christoph Lenzen Philipp Sommer Philipp Sommer Roger Wattenhofer Roger Wattenhofer Optimal Clock Synchronization in Networks

Philipp Sommer, ETH Zurich @ SenSys‘09

Measurement results from testbed with 20 Mica2 nodes

Testbed Experiments (FTSP)

0 1 2 3 4 20...

- Synchronization error grows exponentially

- Nodes far away from the root failed to synchronize with their parent node

Page 19: Christoph Lenzen Philipp Sommer Philipp Sommer Roger Wattenhofer Roger Wattenhofer Optimal Clock Synchronization in Networks

FTSP uses linear regression to compensate for clock drift

Jitter is amplified before it is sent to the next hop

Philipp Sommer, ETH Zurich @ SenSys‘09

Linear Regression (FTSP)

0

1

x

y

r

y(x) = r·x + ∆y clock offset

J J

∆y

Beacon interval B

Example for k=2

^

^

r

synchronization error

relative clock rate(estimated)

Page 20: Christoph Lenzen Philipp Sommer Philipp Sommer Roger Wattenhofer Roger Wattenhofer Optimal Clock Synchronization in Networks

Philipp Sommer, ETH Zurich @ SenSys‘09

Simulation of FTSP with regression tables of different sizes(k = 2, 8, 32)

Linear Regression (FTSP)Lo

g Sc

ale!

Page 21: Christoph Lenzen Philipp Sommer Philipp Sommer Roger Wattenhofer Roger Wattenhofer Optimal Clock Synchronization in Networks

Philipp Sommer, ETH Zurich @ SenSys‘09

Send fast synchronization pulses through the network- Speed-up the initialization phase- Faster adaptation to changes in temperature or network topology

The PulseSync Protocol

Beacon time B

t

01234

t

01234

Beacon time B

FTSP

PulseSync

Expected time= D·B/2

Expected time= D·tpulse

tpulse

Page 22: Christoph Lenzen Philipp Sommer Philipp Sommer Roger Wattenhofer Roger Wattenhofer Optimal Clock Synchronization in Networks

Remove self-amplification of synchronization error- Fast flooding cannot completely eliminate amplification

Philipp Sommer, ETH Zurich @ SenSys‘09

The PulseSync Protocol (2)

0

1

x

y

r

J J

∆y

Beacon interval B

Example for k=2

^

r

synchronization error

y(x) = r·x + ∆y

relative clock rate

clock offset

^

The green line is calculated using kmeasurement points that are statistically independent of the red line (see paper).

Page 23: Christoph Lenzen Philipp Sommer Philipp Sommer Roger Wattenhofer Roger Wattenhofer Optimal Clock Synchronization in Networks

Philipp Sommer, ETH Zurich @ SenSys‘09

Testbed setup- 20 Crossbow Mica2 sensor nodes- PulseSync implemented in TinyOS 2.1- FTSP from TinyOS 2.1

Network topology- Single-hop setup, basestation- Virtual network topology (white-list)- Acknowledgments for time sync beacons

Evaluation

0 1 2 3 4 20...Probe beacon

Page 24: Christoph Lenzen Philipp Sommer Philipp Sommer Roger Wattenhofer Roger Wattenhofer Optimal Clock Synchronization in Networks

Philipp Sommer, ETH Zurich @ SenSys‘09

Global Clock Skew• Maximum synchronization error between any two nodes

Experimental Results

Synchronization Error FTSP PulseSyncAverage (t>2000s) 23.96 µs 4.44 µs

Maximum (t>2000s) 249 µs 38 µs

FTSP PulseSync

Page 25: Christoph Lenzen Philipp Sommer Philipp Sommer Roger Wattenhofer Roger Wattenhofer Optimal Clock Synchronization in Networks

Philipp Sommer, ETH Zurich @ SenSys‘09

Sychnronization Error vs. distance from root node

Experimental Results (2)

FTSP PulseSync

Page 26: Christoph Lenzen Philipp Sommer Philipp Sommer Roger Wattenhofer Roger Wattenhofer Optimal Clock Synchronization in Networks

Philipp Sommer, ETH Zurich @ SenSys‘09

Extension to more general network topologies Schedule synchronization beacons without collisions

• Time information has to propagate quickly through the network

• Avoid loss of synchronization pulses due to collisions

Outlook

This is known as wireless broadcasting,

a well-studied problem (in theory)

Page 27: Christoph Lenzen Philipp Sommer Philipp Sommer Roger Wattenhofer Roger Wattenhofer Optimal Clock Synchronization in Networks

Philipp Sommer, ETH Zurich @ SenSys‘09

Theoretical insights into clock synchronization- Lower bound on the global clock skew

PulseSync: a novel clock synchronization algorithm- Flooding sync pulses at high speed through the network- Matches the lower bound on the global skew (shown in the paper)

Testbed experiments on a 20-node line topology- Prototype implementation of PulseSync - PulseSync outperforms FTSP for this setting

Conclusions