Wireless Sensor Networks COE 499 Synchronization Tarek Sheltami

  • Slides: 25
Download presentation
Wireless Sensor Networks COE 499 Synchronization Tarek Sheltami KFUPM CCSE COE http: //faculty. kfupm.

Wireless Sensor Networks COE 499 Synchronization Tarek Sheltami KFUPM CCSE COE http: //faculty. kfupm. edu. sa/coe/tarek/coe 499. htm 2/20/2021 1

Outline n n n Overview Key Issues Traditional approaches Fine-grained approaches Coarse-grained approaches 2/20/2021

Outline n n n Overview Key Issues Traditional approaches Fine-grained approaches Coarse-grained approaches 2/20/2021 2

Overview Distributed wireless sensor networks need time synchronization for a number of good reasons,

Overview Distributed wireless sensor networks need time synchronization for a number of good reasons, some of which are described below: 1. Time-stamping measurements: data collection applications of sensor networks often require that sensor readings from different sensor nodes be provided with time stamps in addition to location information 2. In-network signal processing: Time stamps are needed to determine which information from different sources can be fused/aggregated within the network 3. Localization: TDo. A-based ranging techniques used in node localization require good time synchronization 4. Cooperative communication: Some physical layer multi-node cooperative communication techniques, which have the potential to provide significant energy savings, but require tight synchronization 2/20/2021 3

Overview 5. 6. 7. Medium-access: TDMA-based medium-access schemes also require that nodes be synchronized

Overview 5. 6. 7. Medium-access: TDMA-based medium-access schemes also require that nodes be synchronized so that they can be assigned distinct slots for collision free communication Sleep scheduling: synchronization is needed to coordinate the sleep schedules of neighboring devices, so that they can communicate with each other efficiently Coordinated actuation: Advanced applications in which the network includes distributed actuators in addition to sensing require synchronization 2/20/2021 4

Key Issues n n n The clock at each node consists of timer circuitry,

Key Issues n n n The clock at each node consists of timer circuitry, often based on quartz crystal oscillators The clock is incremented after each K ticks/interrupts of the timer Practical timer circuits, particularly in low-end devices, are unstable and error prone Crystal oscillators, such as those used in digital watches, experience a shift in frequency as a function of temperature A model for clock non-ideality Where f 0 is ideal frequency, ∆f is the frequency offset, df is the drift in the frequency, rf(t) an additional random error process and fi(t) is the instantaneous oscillator frequency 2/20/2021 5

Key Issues. . n n n Frequency Drift is undesired change in frequency caused

Key Issues. . n n n Frequency Drift is undesired change in frequency caused by component aging and environmental changes Frequency Offset is the difference between a measured frequency and the nominal frequency Assuming t=0 as the initial reference time, the clock reads time Ci(t) at time t as: 2/20/2021 6

Key Issues. . n n n Frequency drift and random error terms may be

Key Issues. . n n n Frequency drift and random error terms may be neglected to derive a simpler linear model for clock non-ideality: Where is the clock offset at the reference time t = 0 and βi the clock drift The more stable and accurate the clock, the closer is to 0, and the closer βi is to 1 A clock is said to be fast if βi is greater than 1, and slow otherwise Manufactured clocks are often specified with a maximum drift rate parameter ρ, such that 1− ρ ≤ βi ≤ 1+ ρ Motes, typical sensor nodes, have ρ values on the order of 40 ppm (parts per million), which corresponds to a drift rate of ± 40μs per second 2/20/2021 7

Ordering of events n “ ” is a partial ordering [ total ordering: for

Ordering of events n “ ” is a partial ordering [ total ordering: for any two events a, b (a b) either a b or b a parting ordering: a, b can be concurrent ] 2/20/2021 8

Definition The relation on the set of events of a system is the smallest

Definition The relation on the set of events of a system is the smallest relation satisfying the following 3 conditions: 1) if a, b events in same process, and a comes before b, then a b 2) if a is sending a message and b is receipt of same message by a different process, then a b 3) if a b and b c, than a c n assume a a n if a b and b a, than a, b are concurrent 2/20/2021 9

Logical Clock n n Ci =logical clock (counter) at process i C[b] = reading

Logical Clock n n Ci =logical clock (counter) at process i C[b] = reading of Cj when event b occurs at process j Clock condition for any events a, b IF a b THEN C[a] < C[b] No relationship to physical time 2/20/2021 10

Clock Condition If a b THEN C[a] < C[b] can be satisfied if the

Clock Condition If a b THEN C[a] < C[b] can be satisfied if the following conditions hold: C 1 C 2 If a and b are events in process i and a comes before b, then Ci[a] < Ci[b] If a is the sending of a message by process i and b is the receipt of that message by process j, then Ci[a] < Cj[b] 2/20/2021 11

Note: Ci[a] < Cj[b] a b Note: a, b concurrent Ci[a] = Cj[b] Note:

Note: Ci[a] < Cj[b] a b Note: a, b concurrent Ci[a] = Cj[b] Note: Ci[a] = Cj[b] a, b concurrent 2/20/2021 12

Traditional Approaches n Lamport’s Algorithm n n Provides a consistent ordering of all events

Traditional Approaches n Lamport’s Algorithm n n Provides a consistent ordering of all events in a distributed system Labeling each event x with a distinct time stamp Lx, such that: n n Lx ≠ Ly ∀ unique events x & y If event x precedes event y in within a node Lx < Ly If x transmitting and y receiving at two different nodes Lx < Ly Drawbacks: Doesn’t provide true causality, assume the true time of event x is indicated as Tx; then, while it is true that Tx<Ty Lx<Ly, it is not true that Lx<Ly Tx <Ty 2/20/2021 13

Traditional Approaches. . n Cristian’s Algorithm n n A node A sends a request

Traditional Approaches. . n Cristian’s Algorithm n n A node A sends a request to node B (which has the reference clock) and receives back the value of B’s clock, TB Node A records locally both the transmission time T 1 and the reception time T 2 2/20/2021 14

Traditional Approaches. . Cristian’s Algorithm. . n n There are many sources of uncertainty

Traditional Approaches. . Cristian’s Algorithm. . n n There are many sources of uncertainty and delay, which impact its accuracy: n Send time – which includes any processing time and time taken to assemble and move the message to the link layer n Access time – which includes random delays while the message is buffered at the link layer due to contention and collisions n Propagation time – which is the time taken for point-to-point message travel. While negligible for a single link, this may be a dominant term over multiple hops if there is network congestion. n Receive time – which is the time taken to process the message and record its arrival. 2/20/2021 15

Traditional Approaches. . Cristian’s Algorithm. . n n The simplest estimate is to approximate

Traditional Approaches. . Cristian’s Algorithm. . n n The simplest estimate is to approximate the message propagation time as (T 2 −T 1)/2 If the processing delay is known to be I, then a better estimate is (T 2 − T 1 − I )/2. More sophisticated approaches take several round-trip delay samples and use minimum or mean delays after outlier removal. 2/20/2021 16

Fine-grained clock synchronization n Reference broadcast synchronization (RBS) n n n Two nodes receive

Fine-grained clock synchronization n Reference broadcast synchronization (RBS) n n n Two nodes receive the beacon of one node in the same broadcast area The two receivers record the local time when the reference signal was received. The two receivers exchange this local time stamp through separate messages 2/20/2021 17

Fine-grained clock synchronization. . n Time-Sync Protocol for Sensor Networks (TPSN) 2/20/2021 18

Fine-grained clock synchronization. . n Time-Sync Protocol for Sensor Networks (TPSN) 2/20/2021 18

Fine-grained clock synchronization. . n Linear parameter-based synchronization Assuming the same pair-wise message exchange

Fine-grained clock synchronization. . n Linear parameter-based synchronization Assuming the same pair-wise message exchange as in TPSN for nodes A and B, we have that the transmission time T 1 and reception time T 4 are measured in node A’s local clock, while reception time T 2 and transmission time T 3 are measured in node B’s local clock. We therefore get the following temporal relationships: 2/20/2021 19

Fine-grained clock synchronization. . n Linear parameter-based synchronization 2/20/2021 20

Fine-grained clock synchronization. . n Linear parameter-based synchronization 2/20/2021 20

Fine-grained clock synchronization. . n Flooding time synchronization protocol (FTSP) 1. Interrupt handling time:

Fine-grained clock synchronization. . n Flooding time synchronization protocol (FTSP) 1. Interrupt handling time: This is the delay in waiting for the processor to complete its current instruction before transferring the message in parts to the radio 2. Modulation/encoding time: This is the time taken by the radio to perform modulation and encoding at the transmitter, and the corresponding demodulation and decoding at the receiver § FTSP uses a broadcast from a single sender to synchronize multiple receivers § Unlike RBS, the sender actually broadcasts a time measurement, and the receivers do not exchange messages among themselves. § Each broadcast provides a synchronization point (a global–local time pair) to each receiver 2/20/2021 21

Fine-grained clock synchronization. . n FTSP has two main components: 1. Multiple time measurements:

Fine-grained clock synchronization. . n FTSP has two main components: 1. Multiple time measurements: The sender takes several time stamp measurements during transmission, one at each byte boundary after a set of SYNC bytes used for byte alignment. These measurements are normalized by subtracting an appropriate multiple of the byte transmission time, and only the minimum of these multiple measurements is embedded into the message. At the receiver too, multiple time measurements are taken and the minimum of those is used as the receiver time. This serves to reduce the jitter significantly in interrupt handling and the (de)coding and (de)modulation times. With as few as six ime stamps, an order of magnitude improvement in precision can be obtained on a Mica Mote platform (from the order of tens of microseconds to the order of about one microsecond). 2/20/2021 22

Fine-grained clock synchronization. . n FTSP has two main components: 2. Flooded messaging: To

Fine-grained clock synchronization. . n FTSP has two main components: 2. Flooded messaging: To propagate the synchronization information, a flooding approach is used. First, a single uniquely identifiable node in the network provides the global clock. The reception of each broadcast message allows a receiver to accumulate a reference synchronization point. When a receiver accumulates several reference points, it becomes synchronized itself (e. g. using a regression line to estimate the local clock drift). Nodes can collect reference points either from the global reference node, or from other nodes that are already synchronized. The frequency of the flooding provides a tradeoff between synchronization accuracy and overhead. 2/20/2021 23

Coarse-grained clock synchronization n The Wisden system wireless sensor network system for structural-response data

Coarse-grained clock synchronization n The Wisden system wireless sensor network system for structural-response data acquisition 2/20/2021 24

Coarse-grained clock synchronization n Drawbacks § § It is vulnerable to varying clock drifts

Coarse-grained clock synchronization n Drawbacks § § It is vulnerable to varying clock drifts at the intermediate nodes, particularly when packet residence times within the network are long For example, it has been estimated that with a 10 ppm drift, data samples cannot reside for more than 15 minutes before accumulating 10 ms of error in the time stamp 2/20/2021 25