Ad Hoc and Sensor Networks – Roger Wattenhofer –9/1Ad Hoc and Sensor Networks – Roger Wattenhofer – Time Synchronization Chapter 9 TexPoint fonts used.

Slides:



Advertisements
Similar presentations
Christoph Lenzen Philipp Sommer Philipp Sommer Roger Wattenhofer Roger Wattenhofer Optimal Clock Synchronization in Networks.
Advertisements

The Flooding Time Synchronization Protocol
Lecture 1: Logical, Physical & Casual Time (Part 2) Anish Arora CSE 763.
Gradient Clock Synchronization in Wireless Sensor Networks
HIERARCHY REFERENCING TIME SYNCHRONIZATION PROTOCOL Prepared by : Sunny Kr. Lohani, Roll – 16 Sem – 7, Dept. of Comp. Sc. & Engg.
Wireless Sensor Networks Clock Synchronization Professor Jack Stankovic University of Virginia.
CPSC 689: Discrete Algorithms for Mobile and Wireless Systems Spring 2009 Prof. Jennifer Welch.
Time and Clock Primary standard = rotation of earth De facto primary standard = atomic clock (1 atomic second = 9,192,631,770 orbital transitions of Cesium.
Christoph PODC 2009 Tight Bounds for Clock Synchronization Christoph Lenzen, Thomas Locher, and Roger Wattenhofer.
Computer Science 425 Distributed Systems CS 425 / ECE 428  2013, I. Gupta, K. Nahrtstedt, S. Mitra, N. Vaidya, M. T. Harandi, J. Hou.
CPSC 689: Discrete Algorithms for Mobile and Wireless Systems Spring 2009 Prof. Jennifer Welch.
Fast Distributed Algorithm for Convergecast in Ad Hoc Geometric Radio Networks Alex Kesselman, Darek Kowalski MPI Informatik.
CPSC 689: Discrete Algorithms for Mobile and Wireless Systems Spring 2009 Prof. Jennifer Welch.
Ad Hoc and Sensor Networks – Roger Wattenhofer –7/1Ad Hoc and Sensor Networks – Roger Wattenhofer – MAC Theory Chapter 7 TexPoint fonts used in EMF. Read.
Time Synchronization (RBS, Elson et al.) Presenter: Peter Sibley.
LSRP: Local Stabilization in Shortest Path Routing Hongwei Zhang and Anish Arora Presented by Aviv Zohar.
Teaching material based on Distributed Systems: Concepts and Design, Edition 3, Addison-Wesley Copyright © George Coulouris, Jean Dollimore, Tim.
He Huang Introduction:The Flooding Time Synchronization Protocol.
Ad Hoc and Sensor Networks – Roger Wattenhofer –9/1Ad Hoc and Sensor Networks – Roger Wattenhofer – Clock Synchronization Chapter 8 TexPoint fonts used.
1 University of Freiburg Computer Networks and Telematics Prof. Christian Schindelhauer Wireless Sensor Networks 15th Lecture Christian Schindelhauer.
The Flooding Time Synchronization Protocol
Time Synchronization Murat Demirbas SUNY Buffalo.
Clock Synchronization Ken Birman. Why do clock synchronization?  Time-based computations on multiple machines Applications that measure elapsed time.
1 University of Freiburg Computer Networks and Telematics Prof. Christian Schindelhauer Wireless Sensor Networks 13th Lecture Christian Schindelhauer.
Lecture 12 Synchronization. EECE 411: Design of Distributed Software Applications Summary so far … A distributed system is: a collection of independent.
Lecture 2-1 CS 425/ECE 428 Distributed Systems Lecture 2 Time & Synchronization Reading: Klara Nahrstedt.
8/18/2015 Mobile Ad hoc Networks COE 549 Synchronization Tarek Sheltami KFUPM CCSE COE 1.
1 Physical Clocks need for time in distributed systems physical clocks and their problems synchronizing physical clocks u coordinated universal time (UTC)
Timing-sync Protocol for Sensor Networks (TPSN) Presenter: Ke Gao Instructor: Yingshu Li.
Energy-Aware Synchronization in Wireless Sensor Networks Yanos Saravanos Major Advisor: Dr. Robert Akl Department of Computer Science and Engineering.
Ted Herman/March Time, Synchronization, and Wireless Sensor Networks Part I Ted Herman University of Iowa.
Johannes PODC 2009 –1 Coloring Unstructured Wireless Multi-Hop Networks Johannes Schneider Roger Wattenhofer TexPoint fonts used in EMF. Read.
Time of arrival(TOA) Prepared By Sushmita Pal Roll No Dept.-CSE,4 th year.
Adaptive Control-Based Clock Synchronization in Wireless Sensor Networks Kasım Sinan YILDIRIM *, Ruggero CARLI +, Luca SCHENATO + * Department of Computer.
On-Demand Traffic-Embedded Clock Synchronization for Wireless Sensor Networks Sang Hoon Lee.
CS4231 Parallel and Distributed Algorithms AY 2006/2007 Semester 2 Lecture 10 Instructor: Haifeng YU.
Copyright: S.Krishnamurthy, UCR Power Controlled Medium Access Control in Wireless Networks – The story continues.
Ad Hoc and Sensor Networks – Roger Wattenhofer –9/1Ad Hoc and Sensor Networks – Roger Wattenhofer – Time Synchronization Chapter 9 TexPoint fonts used.
1 Clock Synchronization for Wireless Sensor Networks: A Survey Bharath Sundararaman, Ugo Buy, and Ajay D. Kshemkalyani Department of Computer Science University.
CS603 Clock Synchronization February 4, What is the best we can do? Lundelius and Lynch ‘84 Assumptions: –No failures –No drift –Fully connected.
Communication & Synchronization Why do processes communicate in DS? –To exchange messages –To synchronize processes Why do processes synchronize in DS?
CS 546: Intelligent Embedded Systems Gaurav S. Sukhatme Robotic Embedded Systems Lab Center for Robotics and Embedded Systems Computer Science Department.
Time synchronization for UWSN. Outline Time synchronization knowledge Typical time sync protocol Time sync in UWSN Discussion.
Topic 2: Communications (Short Lecture) Jorge J. Gómez.
Distributed Systems Principles and Paradigms Chapter 05 Synchronization.
Time This powerpoint presentation has been adapted from: 1) sApr20.ppt.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED SYSTEMS.
Time Synchronization Protocols in Wireless Sensor Networks.
Synchronization CSCI 4900/6900. Importance of Clocks & Synchronization Avoiding simultaneous access of resources –Cooperate to grant exclusive access.
Physical clock synchronization Question 1. Why is physical clock synchronization important? Question 2. With the price of atomic clocks or GPS coming down,
CS 3471 CS 347: Parallel and Distributed Data Management Notes13: Time and Clocks.
CS 347Notes 121 CS 347: Parallel and Distributed Data Management Notes12: Time and Clocks Hector Garcia-Molina.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED SYSTEMS.
UNIT IV INFRASTRUCTURE ESTABLISHMENT. INTRODUCTION When a sensor network is first activated, various tasks must be performed to establish the necessary.
6 SYNCHRONIZATION. introduction processes synchronize –exclusive access. –agree on the ordering of events much more difficult compared to synchronization.
CIS 825 Review session. P1: Assume that processes are arranged in a ring topology. Consider the following modification of the Lamport’s mutual exclusion.
Ad Hoc and Sensor Networks – Roger Wattenhofer –9/1– Clock Synchronization TexPoint fonts used in EMF. Read the TexPoint manual before you delete this.
Distributed Systems Lecture 5 Time and synchronization 1.
– Clustering TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: AAAA A A A.
Clock Synchronization
Distributed Computing
Localization with witnesses
Clock Synchronization
Clock Synchronization Chapter 9
Clustering TexPoint fonts used in EMF.
TexPoint fonts used in EMF.
Research: algorithmic solutions for networking
Chapter 5 (through section 5.4)
Overview: Chapter 4 Infrastructure Establishment
Presentation transcript:

Ad Hoc and Sensor Networks – Roger Wattenhofer –9/1Ad Hoc and Sensor Networks – Roger Wattenhofer – Time Synchronization Chapter 9 TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: AAAA A

Ad Hoc and Sensor Networks – Roger Wattenhofer –9/2 Rating Area maturity Practical importance Theoretical importance First steps Text book No apps Mission critical Not really Must have

Ad Hoc and Sensor Networks – Roger Wattenhofer –9/3 Motivation Clock Sources Reference-Broadcast Synchronization (RBS) Time-sync Protocol for Sensor Networks (TPSN) Gradient Clock Synchronization Overview

Ad Hoc and Sensor Networks – Roger Wattenhofer –9/4 Motivation Time synchronization is essential for many applications –Coordination of wake-up and sleeping times (energy efficiency) –TDMA schedules –Ordering of collected sensor data/events –Co-operation of multiple sensor nodes –Estimation of position information (e.g. shooter detection) Goals of clock synchronization –Compensate offset between clocks –Compensate drift between clocks

Ad Hoc and Sensor Networks – Roger Wattenhofer –9/5 Properties of Synchronization Algorithms External versus internal synchronization –External sync: Nodes synchronize with an external clock source (UTC) –Internal sync: Nodes synchronize to a common time –to a leader, to an averaged time, or to anything else Instant versus periodic synchronization –Periodic synchronization required to compensate clock drift A-priori versus a-posteriori –A-posteriori clock synchronization triggered by an event Local versus global synchronization

Clock Sources Radio Clock Signal: –Clock signal from a reference source (atomic clock) is transmitted over a longwave radio signal –DCF77 station near Frankfurt, Germany transmits at 77.5 kHz with a transmission range of up to 2000 km –Accuracy limited by the distance to the sender, Frankfurt-Zurich is about 1ms. –Special antenna/receiver hardware required Global Positioning System (GPS): –Satellites continuously transmit own position and time code –Line of sight between satellite and receiver required –Special antenna/receiver hardware required

Ad Hoc and Sensor Networks – Roger Wattenhofer –9/7 Clock Devices in Sensor Nodes Structure –External oscillator with a nominal frequency (e.g. 32 kHz) –Counter register which is incremented with oscillator pulses –Works also when CPU is in sleep state Accuracy –Clock drift: random deviation from the nominal rate dependent on power supply, temperature, etc. –E.g. TinyNodes have a maximum drift of ppm at room temperature Oscillator This is a drift of up to 50 μs per second or 0.18s per hour

Ad Hoc and Sensor Networks – Roger Wattenhofer –9/8 Sender/Receiver Synchronization Round-Trip Time (RTT) based synchronization Receiver synchronizes to the sender‘s clock Propagation delay  and clock offset  can be calculated

Ad Hoc and Sensor Networks – Roger Wattenhofer –9/9 Disturbing Influences on Packet Latency Influences –Sending Time S (up to 100ms) –Medium Access Time A(up to 500ms) –Transmission Time T(tens of milliseconds, depending on size) –Propagation Time P A,B (microseconds, depending on distance) –Reception Time R(up to 100ms) Asymmetric packet delays due to non-determinism Solution: timestamp packets at MAC Layer S A T R P A,B Critical path Timestamp T A Timestamp T B

Ad Hoc and Sensor Networks – Roger Wattenhofer –9/10 Reference-Broadcast Synchronization (RBS) A sender synchronizes a set of receivers with one another Point of reference: beacon’s arrival time Only sensitive to the difference in propagation and reception time Time stamping at the interrupt time when a beacon is received After a beacon is sent, all receivers exchange their reception times to calculate their clock offset A B S Post-synchronization possible Least-square linear regression to tackle clock drifts

Ad Hoc and Sensor Networks – Roger Wattenhofer –9/11 Time-sync Protocol for Sensor Networks (TPSN) Traditional sender-receiver synchronization (RTT-based) Initialization phase: Breadth-first-search flooding –Root node at level 0 sends out a level discovery packet –Receiving nodes which have not yet an assigned level set their level to +1 and start a random timer –After the timer is expired, a new level discovery packet will be sent –When a new node is deployed, it sends out a level request packet after a random timeout

Ad Hoc and Sensor Networks – Roger Wattenhofer –9/12Ad Hoc and Sensor Networks – Roger Wattenhofer – Time-sync Protocol for Sensor Networks (TPSN) Synchronization phase –Root node issues a time sync packet which triggers a random timer at all level 1 nodes –After the timer is expired, the node asks its parent for synchronization using a synchronization pulse –The parent node answers with an acknowledgement –Thus, the requesting node knows the round trip time and can calculate its clock offset –Child nodes receiving a synchronization pulse also start a random timer themselves to trigger their own synchronization 1 A B 2 Time Sync ACK Sync pulse

Ad Hoc and Sensor Networks – Roger Wattenhofer –9/13 Time-sync Protocol for Sensor Networks (TPSN) Time stamping packets at the MAC layer In contrast to RBS, the signal propagation time might be negligible Authors claim that it is “about two times” better than RBS Again, clock drifts are taken into account using periodical synchronization messages Problem: What happens in a non-tree topology (e.g. ring)?!? –Two neighbors may have exceptionally bad synchronization 1 A B 2

Ad Hoc and Sensor Networks – Roger Wattenhofer –9/14 Theoretical Bounds for Clock Synchronization Network Model: –Each node i has a local clock L i (t) –Network with n nodes, diameter D. –Reliable point-to-point communication with minimal delay µ –Jitter ε is the uncertainty in message delay Two neighboring nodes u, v cannot distinguish whether message is faster from u to v and slower from v to u, or vice versa. Hence clocks of neighboring nodes can be up to  off. Hence, two nodes at distance D may have clocks which are  D off. This can be achieved by a simple flooding algorithm: Whenever a node receives a new minimum value, it sets its clock to the new value and forwards its new clock value to all its neighbors µ µ +  µ u v u v

Ad Hoc and Sensor Networks – Roger Wattenhofer –9/15 1.Global property: Minimize clock skew between any two nodes 2.Local (gradient) property: Small clock skew between two nodes if the distance between the nodes is small. 3.Clock should not be allowed to jump backwards  You don’t want new events to be registered earlier than older events. Example: Ring topology Gradient Clock Synchronization Small clock skew Large clock skew Root node

Ad Hoc and Sensor Networks – Roger Wattenhofer –9/16 1.Global property: Minimize clock skew between any two nodes 2.Local (gradient) property: Small clock skew between two nodes if the distance between the nodes is small. 3.Clock should not be allowed to jump backwards To prevent trivial solution, we need a fourth constraint: 4.Clock should always to move forward. Sometimes faster, sometimes slower is OK. But there should be a minimum and a maximum speed. Trivial Solution: Let t = 0 at all nodes and times

Ad Hoc and Sensor Networks – Roger Wattenhofer –9/17 Gradient Clock Synchronization Model – Each node has a hardware clock H i (∙) with a clock rate where 0 < L < U and U ≥ 1 – The time of node i at time t is – Each node has a logical clock L i (∙) which increases at the rate of H i (∙) – Employ a synchronization algorithm A to update the local clock with fresh clock values from neighboring nodes (clock cannot run backwards) – Nodes inform their neighboring nodes when local clock is updated Time is 140 Time is 150 Time is 142 Time is 152 ???

Ad Hoc and Sensor Networks – Roger Wattenhofer –9/18Ad Hoc and Sensor Networks – Roger Wattenhofer – Synchronization Algorithms: A max Question: How to update the local clock based on the messages from the neighbors? Idea: Minimizing the skew to the fastest neighbor –Set the clock to the maximum clock value received from any neighbor (if greater than local clock value) Poor gradient algorithm: Fast propagation of the largest clock value could lead to a large skew between two neighboring nodes … Clock value: D+x Old clock value: D+x-1 Old clock value: x+1 Time is D+x Old clock value: x Time is D+x New time is D+x Skew D!

Ad Hoc and Sensor Networks – Roger Wattenhofer –9/19 Synchronization Algorithms: A max’ The problem of A max is that the clock is always increased to the maximum value Idea: Allow a constant slack γ between the maximum neighbor clock value and the own clock value The algorithm A max’ sets the local clock value L i (t) to → Worst-case clock skew between two neighboring nodes is still Θ(D) independent of the choice of γ ! How can we do better? – Idea: Take the clock of all neighbors into account by choosing the average value

Ad Hoc and Sensor Networks – Roger Wattenhofer –9/20 Synchronization Algorithms: A avg A avg sets the local clock to the average value of all neighbors: Surprisingly, this algorithm is even worse! We will now proof that in a very natural execution of this algorithm, the clock skew becomes large! … Clock value: x+(n-1) 2 Clock value: x+(n-2) 2 Clock value: x+1 Time is x+(n-1) 2 Time is x+(n-2) 2 Clock value: x Time is x+4 n n Time is x+1 Skew 2n-3

Ad Hoc and Sensor Networks – Roger Wattenhofer –9/21Ad Hoc and Sensor Networks – Roger Wattenhofer – Synchronization Algorithms: A avg Consider the following execution: All  i for i 2 {1,…,n-1} are arbitrary values in the range (0,1)  The clock rates can be viewed as relative rates compared to the fastest node n! … nn-11 Clock rate: h n = 1 Clock rate: h n-1 = 1 -  n-1 Clock rate: h 1 = 1 -  1 All messages arrive after 1 time unit! Theorem: In the given execution, the largest skew between neighbors is 2n-3 2 O(D).

Ad Hoc and Sensor Networks – Roger Wattenhofer –9/22Ad Hoc and Sensor Networks – Roger Wattenhofer – Synchronization Algorithms: A avg We first prove two lemmas: Lemma 1: In this execution it holds that 8 t 8 i 2 {2,…,n}: L i (t) –L i-1 (t) ≤ 2i – 3, independent of the choices of  i > 0. Proof: Define  L i (t) := L i (t) – L i (t-1). It holds that 8 t 8 i:  L i (t) ≤ 1. L 1 (t) = L 2 (t-1) as node 1 has only one neighbor (node 2). Since  L 2 (t) ≤ 1 for all t, we know that L 2 (t) – L 1 (t) ≤ 1 for all t. Assume now that it holds for 8 t 8 j ≤ i: L j (t) –L j-1 (t) ≤ 2j – 3. We prove a bound on the skew between node i and i+1: For t = 0 it is trivially true that L i+1 (t) – L i (t) ≤ 2(i+1) – 3.

Ad Hoc and Sensor Networks – Roger Wattenhofer –9/23Ad Hoc and Sensor Networks – Roger Wattenhofer – Synchronization Algorithms: A avg Assume that it holds for all t’ ≤ t. For t+1 we have that The first inequality holds because the logical clock value is always at least the average value of its neighbors. The second inequality follows by induction. The third and fourth inequalities hold because  L i (t) ≤ 1. □

Ad Hoc and Sensor Networks – Roger Wattenhofer –9/24Ad Hoc and Sensor Networks – Roger Wattenhofer – Synchronization Algorithms: A avg Lemma 2: 8 i 2 {1,…,n}: lim t ! 1  L i (t) = 1. Proof: Assume  L n-1 (t) does not converge to 1. Case (1): 9  > 0 such that 8 t:  L n-1 (t) ≤ 1 - . As  L n (t) is always 1, if there is such an , then lim t ! 1 L n (t) - L n-1 (t) = 1, a contradiction to Lemma 1. Case (2):  L n-1 (t) = 1 only for some t, then there is an unbounded number of times t’ where  L n-1 (t) < 1, which also implies that lim t ! 1 L n (t) - L n-1 (t) = 1, again contradicting Lemma 1. Hence, lim t ! 1  L n-1 (t) = 1. Applying the same argument to the other nodes, it follows inductively that 8 i 2 {1,…,n}: lim t ! 1  L i (t) = 1. □

Ad Hoc and Sensor Networks – Roger Wattenhofer –9/25Ad Hoc and Sensor Networks – Roger Wattenhofer – Synchronization Algorithms: A avg Theorem: In the given execution, the largest skew between neighbors is 2n-3. Proof: We show that 8 i 2 {2,…,n}: lim t ! 1 L i (t) – L i-1 (t) = 2i – 3. Since L 1 (t) = L 2 (t–1), it holds that lim t ! 1 L 2 (t) – L 1 (t) =  L 1 (t) = 1, according to Lemma 2. Assume that 8 j ≤ i: lim t ! 1 L j (t) – L j-1 (t) = 2j – 3. According to Lemma 1 & 2, lim t ! 1 L i+1 (t) – L i (t) = Q for a value Q ≤ 2(i+1) – 3. If (for the sake of contradiction) Q < 2(i+1) – 3, then and thus lim t ! 1  L i (t) < 1, a contradiction to Lemma 2. □

Ad Hoc and Sensor Networks – Roger Wattenhofer –9/26Ad Hoc and Sensor Networks – Roger Wattenhofer – Synchronization Algorithms: A bound Idea: Minimize the skew to the slowest neighbor –Update the local clock to the maximum value of all neighbors as long as no neighboring node’s clock is more than B behind. Gives the slowest node time to catch up Problem: Chain of dependency –Node n-1 waits for node n-2, node n-2 waits for node n-3, … → Chain of length Θ(n) = Θ(D) results in Θ(D) waiting time → Θ(D) skew! … nn-1n-2 Clock value: x Clock value: x - B Clock value: x - 2B Time is xTime is x- B Time is x- 2B

Ad Hoc and Sensor Networks – Roger Wattenhofer –9/27 Synchronization Algorithms: A root How long should we wait for a slower node to catch up? – Do it smarter: Set → skew is allowed to be → waiting time is at most as well Node with fast clock Node with slow clock Skew … Chain of length Waiting time

Ad Hoc and Sensor Networks – Roger Wattenhofer –9/28 Synchronization Algorithms: A root When a message is received, execute the following steps: This algorithm guarantees that the worst-case clock skew between neighbors is bounded by. In [Fan and Lynch, PODC 2004] it is shown that when logical clocks need to obey minimum/maximum speed rules, the skew of two neighboring clocks can be up to  (log D / log log D). max := Maximum clock value of all neighboring nodes min := Minimum clock value of all neighboring nodes if (max > own clock and min + > own clock own clock := min(max, min + ) inform all neighboring nodes about new clock value end if

Ad Hoc and Sensor Networks – Roger Wattenhofer –9/29 Open Problem The obvious open problem is about gradient clock synchronization. Nodes in an arbitrary graph are equipped with an unmodifiable hardware clock and a modifiable logical clock. The logical clock must make progress roughly at the rate of the hardware clock, i.e., the clock rates may differ by a small constant. Messages sent over the edges of the graph have delivery times in the range [0, 1]. Given a bounded, variable drift on the hardware clocks, design a message-passing algorithm that ensures that the logical clock skew of adjacent nodes is as small as possible at all times. Indeed, there is a huge gap between upper bound of √D and lower bound of log D / log log D.