Optimal Clock Synchronization in Networks · Problem: Jitter in the message delay Various sources...
Transcript of Optimal Clock Synchronization in Networks · Problem: Jitter in the message delay Various sources...
![Page 1: Optimal Clock Synchronization in Networks · Problem: Jitter in the message delay Various sources of errors (deterministic and non-deterministic) Solution: Timestamping packets at](https://reader034.fdocuments.us/reader034/viewer/2022042911/5f44865274f33c48614e4432/html5/thumbnails/1.jpg)
Christoph LenzenPhilipp Sommer
Roger Wattenhofer
Optimal Clock Synchronizationin Networks
![Page 2: Optimal Clock Synchronization in Networks · Problem: Jitter in the message delay Various sources of errors (deterministic and non-deterministic) Solution: Timestamping packets at](https://reader034.fdocuments.us/reader034/viewer/2022042911/5f44865274f33c48614e4432/html5/thumbnails/2.jpg)
Synchronized clocks are essential for many applications:
Philipp Sommer, ETH Zurich @ SenSys‘09
Time in Sensor Networks
Time Synchronization(RBS, TPSN, FTSP, ...)
SensingLocalization
Duty-Cycling
TDMA
![Page 3: Optimal Clock Synchronization in Networks · Problem: Jitter in the message delay Various sources of errors (deterministic and non-deterministic) Solution: Timestamping packets at](https://reader034.fdocuments.us/reader034/viewer/2022042911/5f44865274f33c48614e4432/html5/thumbnails/3.jpg)
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)
Philipp Sommer, ETH Zurich @ SenSys‘09
Hardware Clocks Experience Drift
t
rate
11+²
1-²
Mica2
![Page 4: Optimal Clock Synchronization in Networks · Problem: Jitter in the message delay Various sources of errors (deterministic and non-deterministic) Solution: Timestamping packets at](https://reader034.fdocuments.us/reader034/viewer/2022042911/5f44865274f33c48614e4432/html5/thumbnails/4.jpg)
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 mst
Expected delay TJitter J
timefreq
ue
ncy
(%
)
![Page 5: Optimal Clock Synchronization in Networks · Problem: Jitter in the message delay Various sources of errors (deterministic and non-deterministic) Solution: Timestamping packets at](https://reader034.fdocuments.us/reader034/viewer/2022042911/5f44865274f33c48614e4432/html5/thumbnails/5.jpg)
Goal:
Send time information (beacons) to synchronize clocks
Problems:
Hardware clocks exhibit drift
Jitter in the message delay
Philipp Sommer, ETH Zurich @ SenSys‘09
Summary: Clock Synchronization
Expected delay T
Jitter J
![Page 6: Optimal Clock Synchronization in Networks · Problem: Jitter in the message delay Various sources of errors (deterministic and non-deterministic) Solution: Timestamping packets at](https://reader034.fdocuments.us/reader034/viewer/2022042911/5f44865274f33c48614e4432/html5/thumbnails/6.jpg)
Sychnronization error vs. hop distance
Philipp Sommer, ETH Zurich @ SenSys‘09
Preview: Experimental Results
FTSP PulseSync
![Page 7: Optimal Clock Synchronization in Networks · Problem: Jitter in the message delay Various sources of errors (deterministic and non-deterministic) Solution: Timestamping packets at](https://reader034.fdocuments.us/reader034/viewer/2022042911/5f44865274f33c48614e4432/html5/thumbnails/7.jpg)
Introduction
Theory
Practice
Philipp Sommer, ETH Zurich @ SenSys‘09
Outline
![Page 8: Optimal Clock Synchronization in Networks · Problem: Jitter in the message delay Various sources of errors (deterministic and non-deterministic) Solution: Timestamping packets at](https://reader034.fdocuments.us/reader034/viewer/2022042911/5f44865274f33c48614e4432/html5/thumbnails/8.jpg)
How do we synchronize the clocks of two sensor nodes?
Philipp Sommer, ETH Zurich @ SenSys‘09
Synchronizing Nodes: Single-Hop
0 1
reference clock
![Page 9: Optimal Clock Synchronization in Networks · Problem: Jitter in the message delay Various sources of errors (deterministic and non-deterministic) Solution: Timestamping packets at](https://reader034.fdocuments.us/reader034/viewer/2022042911/5f44865274f33c48614e4432/html5/thumbnails/9.jpg)
Sending periodic beacons to synchronize nodes
Philipp Sommer, ETH Zurich @ SenSys‘09
J
t=100 t=130
Beacon interval B
T T1
0
J
reference clock
Synchronizing Nodes
t
t
100 130
![Page 10: Optimal Clock Synchronization in Networks · Problem: Jitter in the message delay Various sources of errors (deterministic and non-deterministic) Solution: Timestamping packets at](https://reader034.fdocuments.us/reader034/viewer/2022042911/5f44865274f33c48614e4432/html5/thumbnails/10.jpg)
Message delay jitter affects clock synchronization quality
Philipp Sommer, ETH Zurich @ SenSys‘09
How accurately can we synchronize two Nodes?
0
1
x
y
ry(x) = r·x + ∆y
relative clock rate(estimated)
clock offset
J J
∆y
Beacon interval B
^^
r
![Page 11: Optimal Clock Synchronization in Networks · Problem: Jitter in the message delay Various sources of errors (deterministic and non-deterministic) Solution: Timestamping packets at](https://reader034.fdocuments.us/reader034/viewer/2022042911/5f44865274f33c48614e4432/html5/thumbnails/11.jpg)
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: Optimal Clock Synchronization in Networks · Problem: Jitter in the message delay Various sources of errors (deterministic and non-deterministic) Solution: Timestamping packets at](https://reader034.fdocuments.us/reader034/viewer/2022042911/5f44865274f33c48614e4432/html5/thumbnails/12.jpg)
Lower Bound on the clock skew between two neighbors
Philipp Sommer, ETH Zurich @ SenSys‘09
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 delayBeacon intervalNumber of beacons k
-
Synchronization error:
(complete proof is in the paper)
^
rr̂
![Page 13: Optimal Clock Synchronization in Networks · Problem: Jitter in the message delay Various sources of errors (deterministic and non-deterministic) Solution: Timestamping packets at](https://reader034.fdocuments.us/reader034/viewer/2022042911/5f44865274f33c48614e4432/html5/thumbnails/13.jpg)
How do we synchronize the clocks of multiple sensor nodes?
Philipp Sommer, ETH Zurich @ SenSys‘09
Synchronizing Nodes: Multi-hop
0 1
reference clock
2
![Page 14: Optimal Clock Synchronization in Networks · Problem: Jitter in the message delay Various sources of errors (deterministic and non-deterministic) Solution: Timestamping packets at](https://reader034.fdocuments.us/reader034/viewer/2022042911/5f44865274f33c48614e4432/html5/thumbnails/14.jpg)
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)
Philipp Sommer, ETH Zurich @ SenSys‘09
Now we have a network of nodes!
0 1 2 3 4 ... d
![Page 15: Optimal Clock Synchronization in Networks · Problem: Jitter in the message delay Various sources of errors (deterministic and non-deterministic) Solution: Timestamping packets at](https://reader034.fdocuments.us/reader034/viewer/2022042911/5f44865274f33c48614e4432/html5/thumbnails/15.jpg)
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)
Philipp Sommer, ETH Zurich @ SenSys‘09
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: Optimal Clock Synchronization in Networks · Problem: Jitter in the message delay Various sources of errors (deterministic and non-deterministic) Solution: Timestamping packets at](https://reader034.fdocuments.us/reader034/viewer/2022042911/5f44865274f33c48614e4432/html5/thumbnails/16.jpg)
Introduction
Theory
Practice
Philipp Sommer, ETH Zurich @ SenSys‘09
Outline
![Page 17: Optimal Clock Synchronization in Networks · Problem: Jitter in the message delay Various sources of errors (deterministic and non-deterministic) Solution: Timestamping packets at](https://reader034.fdocuments.us/reader034/viewer/2022042911/5f44865274f33c48614e4432/html5/thumbnails/17.jpg)
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
Philipp Sommer, ETH Zurich @ SenSys‘09
Clock Synchronization in Practice
Maroti et al. (SenSys‘04)
0
4 2
5
13
6root node
![Page 18: Optimal Clock Synchronization in Networks · Problem: Jitter in the message delay Various sources of errors (deterministic and non-deterministic) Solution: Timestamping packets at](https://reader034.fdocuments.us/reader034/viewer/2022042911/5f44865274f33c48614e4432/html5/thumbnails/18.jpg)
Measurement results from testbed with 20 Mica2 nodes
Philipp Sommer, ETH Zurich @ SenSys‘09
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: Optimal Clock Synchronization in Networks · Problem: Jitter in the message delay Various sources of errors (deterministic and non-deterministic) Solution: Timestamping packets at](https://reader034.fdocuments.us/reader034/viewer/2022042911/5f44865274f33c48614e4432/html5/thumbnails/19.jpg)
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: Optimal Clock Synchronization in Networks · Problem: Jitter in the message delay Various sources of errors (deterministic and non-deterministic) Solution: Timestamping packets at](https://reader034.fdocuments.us/reader034/viewer/2022042911/5f44865274f33c48614e4432/html5/thumbnails/20.jpg)
Simulation of FTSP with regression tables of different sizes(k = 2, 8, 32)
Philipp Sommer, ETH Zurich @ SenSys‘09
Linear Regression (FTSP)Lo
gSc
ale!
![Page 21: Optimal Clock Synchronization in Networks · Problem: Jitter in the message delay Various sources of errors (deterministic and non-deterministic) Solution: Timestamping packets at](https://reader034.fdocuments.us/reader034/viewer/2022042911/5f44865274f33c48614e4432/html5/thumbnails/21.jpg)
Send fast synchronization pulses through the network
Speed-up the initialization phase
Faster adaptation to changes in temperature or network topology
Philipp Sommer, ETH Zurich @ SenSys‘09
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: Optimal Clock Synchronization in Networks · Problem: Jitter in the message delay Various sources of errors (deterministic and non-deterministic) Solution: Timestamping packets at](https://reader034.fdocuments.us/reader034/viewer/2022042911/5f44865274f33c48614e4432/html5/thumbnails/22.jpg)
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 rateclock offset
^
The green line is calculated using kmeasurement points that are statistically independent of the red line (see paper).
r̂
![Page 23: Optimal Clock Synchronization in Networks · Problem: Jitter in the message delay Various sources of errors (deterministic and non-deterministic) Solution: Timestamping packets at](https://reader034.fdocuments.us/reader034/viewer/2022042911/5f44865274f33c48614e4432/html5/thumbnails/23.jpg)
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
Philipp Sommer, ETH Zurich @ SenSys‘09
Evaluation
0 1 2 3 4 20...Probe beacon
![Page 24: Optimal Clock Synchronization in Networks · Problem: Jitter in the message delay Various sources of errors (deterministic and non-deterministic) Solution: Timestamping packets at](https://reader034.fdocuments.us/reader034/viewer/2022042911/5f44865274f33c48614e4432/html5/thumbnails/24.jpg)
Global Clock Skew
• Maximum synchronization error between any two nodes
Philipp Sommer, ETH Zurich @ SenSys‘09
Experimental Results
Synchronization Error FTSP PulseSync
Average (t>2000s) 23.96 µs 4.44 µs
Maximum (t>2000s) 249 µs 38 µs
FTSP PulseSync
![Page 25: Optimal Clock Synchronization in Networks · Problem: Jitter in the message delay Various sources of errors (deterministic and non-deterministic) Solution: Timestamping packets at](https://reader034.fdocuments.us/reader034/viewer/2022042911/5f44865274f33c48614e4432/html5/thumbnails/25.jpg)
Sychnronization Error vs. distance from root node
Philipp Sommer, ETH Zurich @ SenSys‘09
Experimental Results (2)
FTSP PulseSync
![Page 26: Optimal Clock Synchronization in Networks · Problem: Jitter in the message delay Various sources of errors (deterministic and non-deterministic) Solution: Timestamping packets at](https://reader034.fdocuments.us/reader034/viewer/2022042911/5f44865274f33c48614e4432/html5/thumbnails/26.jpg)
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
Philipp Sommer, ETH Zurich @ SenSys‘09
Outlook
This is known as wireless broadcasting, a well-studied problem (in theory)
![Page 27: Optimal Clock Synchronization in Networks · Problem: Jitter in the message delay Various sources of errors (deterministic and non-deterministic) Solution: Timestamping packets at](https://reader034.fdocuments.us/reader034/viewer/2022042911/5f44865274f33c48614e4432/html5/thumbnails/27.jpg)
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
Philipp Sommer, ETH Zurich @ SenSys‘09
Conclusions