time synchronization

27
Time Synchronization Murat Demirbas SUNY Buffalo

Upload: wynona

Post on 18-Mar-2016

45 views

Category:

Documents


2 download

DESCRIPTION

Time Synchronization. Murat Demirbas SUNY Buffalo. Need for TimeSync. Typical purpose of sensor networks: collect sensor data, log to database and correlate with time, location, etc. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Time Synchronization

Time SynchronizationMurat Demirbas

SUNY Buffalo

Page 2: Time Synchronization

2

Need for TimeSync

• Typical purpose of sensor networks: collect sensor data, log to database and correlate with time, location, etc.

TimeSync may be avoided: The nodes can track the delays incurred to a message at each hop towards the basestation, and the basestation can punch a timestamp for the received message accordingly.

• Power management requires timesync for coordinated sleep and wakeup of nodes

• TDMA based networking strategies requires timesync• Coordinated action in sensor-actuator networks• Certain applications (such as Sniper localization) requires

timesync

Page 3: Time Synchronization

3

Requirements

• Efficiency Memory constraints Energy constraints

• Scalability

• Robustness

Page 4: Time Synchronization

4

Outline

• Uncertainties in clock hardware in sensors• Uncertainties in radio message delivery• Flooding Time Synchronization Protocol (FTSP)

Single-hop Multi-hop

• Reference Broadcast Synchronization (RBS)

Page 5: Time Synchronization

5

Clock hardware in sensors

• Typical sensor CPU has counters that increment by each cycle, generating interrupt upon overflow

we can keep track of time, but managing interrupts is error-prone

• External oscillator (with hardware counter) can increment, generate interrupt

even when CPU is “off” to save power

Page 6: Time Synchronization

6

Uncertainties in clock hardware

• cheap, off-the-shelf oscillators can deviate from ideal oscillator rate by one unit per 10-5 (for a

microsecond counter, accuracy could diverge by up to 40 microseconds each second)

oscillator rates vary depending on power supply, temperature

Page 7: Time Synchronization

7

Uncertainties in radio

• Send time: Nondeterministic, ~100ms Delay for assembling message & passing it to MAC layer

• Access time: Nondeterministic, ~1ms-~1sec Delay for accessing a clear transmission channel

• Transmission time: ~25ms Time for transmitting (depends on message size, radio clock speed)

• Propagation time: <1microsecond Time bit spends on the air (depends on distance between nodes)

• Reception time: overlaps with transmission time• Receive time: Nondeterministic, ~100ms

Delay for processing incoming message and notifying application

Page 8: Time Synchronization

8

MAC layer timestamping

• Message can be timestamped during transmission and reception

Mica2 and TinyOS enable direct access to MAC layer

• This eliminates 3 main sources of uncertainties Send time, access time, and receive time are eliminated

• However, uncertainties remain due to overlapping transmission and reception times

Page 9: Time Synchronization

9

Close up

• Interrupt handling time ~1microsec-~??microsec Delay between radio chip raising and CPU responding Abuses of interrupt disabling may cause problems

• Encoding time ~100microsec Delay for putting the wave on air

• Decoding time ~100microsec Delay for decoding wave to binary data

• Byte alignment time Delay due to different byte alignment of sender and receiver

Page 10: Time Synchronization

10

Close up…

Page 11: Time Synchronization

11

Delays in message transmission

Page 12: Time Synchronization

12

Outline

• Uncertainties in clock hardware in sensors• Uncertainties in radio message delivery• Flooding Time Synchronization Protocol (FTSP)

Single-hop Multi-hop

• Reference Broadcast Synchronization (RBS)

Page 13: Time Synchronization

13

Flooding Time Synchronization

• FTSP syncronizes time of a sender to multiple receivers RBS performs receiver-to-receiver synchronization

• Two important ideas MAC layer timestamping Compensation for clock drift

• Protocol for extending single-hop sync to network-wide sync

Page 14: Time Synchronization

14

MAC layer timestamping

• FTSP reduces the jitter of the interrupt handling and encoding/decoding times by recording multiple timestamps at the sender and receiver

Timestamps made at each byte boundary These timestamps are normalized to detect the jitter due to disabled

interrupts The minimum of the normalized timestamps is sent only

Page 15: Time Synchronization

15

Clock drift management

• Need to estimate the drift of the receiver clock wrt sender clock to avoid sending frequent sync messages

• The offset between two clocks changes in a linear fashion Linear regression is used to find the line L best approximating over the

past 8 data points

Page 16: Time Synchronization

16

Multi-hop timesync

• All the nodes sync their clocks to that of the root Root is a single, dynamically re-elected node

• Nodes form an ad hoc structure, as opposed to a fixed spanning tree, to transfer the global time from the root to all nodes

When a node collects enough data points, it can estimate its skew and offset, and is considered synchronize

Only synchronized nodes broadcast sync messages to the rest of the network

Page 17: Time Synchronization

17

Handling of sync messages

Page 18: Time Synchronization

18

Sending of Sync messages

Page 19: Time Synchronization

19

Convergence time

• Depends on N: NUMENTRIES_LIMIT M: ROOT_TIMEOUT R: Network radius measured from the current root

• Start-up convergence time P*(M+N*R)

• Root-failure convergence time P*(R+M+R’)

Page 20: Time Synchronization

20

Experimental data

Page 21: Time Synchronization

21

Outline

• Uncertainties in clock hardware in sensors• Uncertainties in radio message delivery• Flooding Time Synchronization Protocol (FTSP)

Single-hop Multi-hop

• Reference Broadcast Synchronization (RBS)

Page 22: Time Synchronization

22

RBS idea

• Use broadcast as a relative time reference Broadcast packet does NOT include timestamp Any broadcast, e.g., RTS/CTS, can be used

• A set of nodes synchronize with each other (not with the sender)

Significantly reduces non-determinism

Page 23: Time Synchronization

23

Reference broadcast• when operating system cannot record instant of

message transmission (access delay unknown), but can record instant of reception

m1 m1 is received simultaneously by multiple receivers: each records a timestamp value contained in m1

Page 24: Time Synchronization

24

Critical Path Analysis

Traditional RBS

Send Time

AccessTime Prop.

DelayRec.Time

Page 25: Time Synchronization

25

Reference broadcast…• after getting m1, all receivers share their local

timestamps at instant of reception

now, receivers come to consensus on a value for synchronized time: for example, each adjusts local clock/counter to agree with average of local timestamps

Page 26: Time Synchronization

26

Multi-Hop Time Synchronization

Page 27: Time Synchronization

27

Multi-Hop RBS Performance

Average path error is approximately n for an n hop path