The Flooding Time Synchronization Protocol Miklós Maróti Branislav Kusy Gyula Simon
description
Transcript of The Flooding Time Synchronization Protocol Miklós Maróti Branislav Kusy Gyula Simon
The Flooding Time Synchronization Protocol
Miklós Maróti Branislav Kusy Gyula Simon
Ákos Lédeczi
SenSys’04, November 3–5, 2004, Baltimore, Maryland, USA.
Outline
Introduction Uncertainties In Radio Message Delivery Clock draft Time synchronization approach Conclusion
Introduction
describe the Flooding Time Synchronization Protocol (FTSP) for Wireless Sensor Network
designing the FTSP, our goals were to achieve network-wide time synchronization with error in the micro-second rang
The algorithm compensates for utilizing the concepts of MAC layer time-stamping and skew compensation with linear regression
The algorithm was implemented on Mica/Mica2 platforms running the TinyOS operating system
Uncertainties In Radio Message Delivery
Send Time—Depending on the system call overhead of the operating system and on the current processor load
Access Time—message stay s the radio device buffer and waiting for access to the transmit channel
Interrupt Handling Time—the delay between the radio chip raising and the microcontroller responding to an interrupt. This time is mostly less than a few microsecond (waiting for the microcontroller to finish the currently executed instruction)
Transmission Time—depending on the length of the message and the speed of the radio
Propagation Time—is highly deterministic ,This time is less than one microsecond (for ranges under 300 meters)
Encoding Time—for the radio chip to encode and transform a part of the message to electromagnetic waves
Byte Alignment Time—because of the different byte alignment of the sender and receiver and can computed from bit offset and speed of the radio
Uncertainties In Radio Message Delivery
Uncertainties In Radio Message Delivery
Variability in Packet Delay
software MAC propagationTX RX software
sender receiver
ALL DELAYS ARE VARIABLE !
Senderuncertainty
222
UCUCUC RPSError
Propagationcertainty
Receiveruncertainty
Clock Skew
- cause by clock drift
- variations in crystal oscillation frequency
- due to environmental variation (temperature , humidity) or
manufacturing
- frequency difference
- clock offset
Error of time synchronization
Host B
Host A
Time
T2
T1
T3
T4
T2=T1+offset+ propagation delay
T4=T3- offset+ propagation delay
propagation delay = (T2-T1) + (T4-T3) /2
drift clock = (T2-T1) - (T4-T3) /2
Variability in clock offset
sender-receiver synchronization
Variability in clock offset
BAttRD
41
t4
BAtD 4
Real Time
Ideal clock
Node B clock
Node A clock
t1
BAtD 1
Local node time
Relative drift
222241
BA
tt
UCUCUC RDRPSError
Time Synchronization Techniques
Sender Receiver
NIC
Physical Media
NIC
Propagation Time
Receiver
NICI saw itat t=4 I saw it
at t=5
Reference Broadcast Synchronization (RBS)
Reference Broadcast Synchronization (RBS) - A transmitter broadcast a reference packet to two receivers
- Each receiver records the time that the reference was
received , according to its local clock.
- receivers exchange their observations each other
- suitable only for low precision demands
Time Synchronization Techniques
Reference Broadcast Synchronization (RBS) - advantage
. Completely eliminating transmitter side uncertainties
- disadvantage
. Number of message exchanges is high
. For n node . 1node broadcast , n-1 message exchange for sync
result network traffic overhead and high energy consumption
Time Synchronization Techniques
Timing-sync Protocol for Sensor Network (TPSN)
- the TPSN algorithm first create a spanning tree of the network
- level discovery phase
. Create a hierarchy topology
. Each node is assigned a level
. A node is selected as the root node (level 0)
. Root broadcast level_discovery package which contain
identifier and level of the sender
. Neighbor receive the package then assigned itself a level plus1
and subsequent message received are discard
Time Synchronization Techniques
Timing-sync Protocol for Sensor Network (TPSN) . Node then rebroadcast level_discovery message
. Until all nodes are assigned a level
Time Synchronization Techniques
Time Synchronization Techniques
Level Discovery Phase
Timing-sync Protocol for Sensor Network (TPSN)
- synchronization phase
. Using a sender-receiver synchronization . Use two-way message exchange . A node initiates synchronization by sending a pulse message that including the node’s level and local time . B node that receives and reply an acknowledgement that including the original time stamp . Calculate the drift clock and propagation delay and synchronizes itself with the receiving node
time synchronization techniques
Time Synchronization Techniques
Synchronization Phase
Time Synchronization Techniques
A
Send at T3Recv at T4
T4 = T3 + DELAY- OFFSET
Send at T1 Recv at T2
T2 = T1 + DELAY + OFFSET
B
OFFSET = {(T2-T1)-(T4-T3)}/2
DELAY = {(T2-T1)+(T4-T3)}/2
Timing-sync Protocol for Sensor Network (TPSN) - advantage
. better Performance than RBS
. More minimum error than RBS
- disadvantage
. Tow-way communication that higher communication load
. Limits its accuracy
Time Synchronization Techniques
When a node collects enough reference point , it estimates the offset and skew
Flooding Time Synchronization Protocol
root
Time stamp
Root ID Sequence
number
Broadcast a single radio message time stamp
Collect reference point
Synchronization message format
local time-stamp
global time-stamp[global , local ] time-stamp
A
Multi-hop time synchronization - FTSP utilize reference points to perform synchronization
- a reference points are generated by sending and receiving
periodic broadcast message
- a reference points contains a pair of global and local time stamp
- When a node collects enough reference point , it estimates the
offset and skew
- the newly synchronized node can then broadcast
synchronization messages to another node
- offset and skew calculated by linear regression
Flooding Time Synchronization Protocol
synchronization message format - consists three fields
- timestamp , contains the global time estimate of the transmitter
- rootID , ID of the root
- SeqNum, sequence number set and incremented by the root
when a new synchronization round , used to handle redundant
synchronization message
Flooding Time Synchronization Protocol
Managing redundant information - in a dense network a receiver may receive several message
from different node in a short time interval
- due to limited resources , subset of the message must be
selected to create reference point
- in the Mica2 implementation an eight-element regression table
stores the reference point used to calculate the regression line
- to aid message filtering for more beneficial to store reference
point
. Each node maintains a highestSeqNum variable and
MyRootID
Flooding Time Synchronization Protocol
The root election problem - election process is needed to provide a root after startup - to perform global synchronization that only one root is needed - nodes may fail or the network disconnected or no node can play the role of root - FTSP utilizes a simple election process base on unique node ID
- when a node can’t receive new time synchronization message for ROOT_TIMEOUT number of message broadcast periods then declares itself to be the root (myrooID=myID) - ROOT_TIMEOUT = NUMENTRIES_LIMIT = times *Periodically re-sync
Flooding Time Synchronization Protocol
Managing redundant information (cont.)
Flooding Time Synchronization Protocol
Heartbeats = numbers of message broadcast
NUMENTRIES_LIMIT = times *Periodically re-sync
60 Mica2 motes deployed in a 5x12 grid Each mote can communicate with neighbors only ID1 is smallest id When ID1 is fail then ID2 will replace ID1 The period of time re-synchronization was 30 sec for 60 nodes
Experimental
ROOT_TIMEOUT=6
Experimental
A: at 0:04 all motes were turned on B: at 1:00 the root with ID1 was switched off, ID2 becomes the
new root C: between 2:00 and 2:15 randomly selected nodes were reset
one by one with 30 second period D: at 2:30 the motes with odd node IDs were switched off (half
of the nodes are removed) E: at 3:01 the motes with odd node IDs were switched back on
(100% new nodes were introduced) F: at 4:02 the experiment was ended.
Experimental
The nodes were switched on at the time (0:04), but during the next 3 minutes (0:07) no node was synchronized because none of them declared itself to be the root.
Then many nodes timed out and became the roots of the network, which was the reason why the average and maximum synchronization errors soared for 10 minutes untill the election process has completed (0:17) and only a single root remained (ID1).
Complete synchronization has been achieved in 14 minutes (at 0:18)
Experimental
When the root ID1 was switched off that global time had not been updated
until each node timed out and declared itself to be the root. The election process again resulted in a single root (ID2) the error stayed low during this time because nodes did not
discard their old offset and skew estimates and the new root was broadcasting its estimation of the old global time
Election process finished at 1:06 (in 6 minutes)
Experimental
TPSN eliminates the send, access, interrupt handling, encoding, decoding and receive time errors
The authors of TPSN algorithm implemented both TPSN and RBS on the Mica platform using a 4 MHz clock for time-stamping, and compared the precision of the two algorithms. The resulting average errors for a single hop case for two nodes are 16.9µs and 29.1µs for the TPSN and RBS algorithms,
Multiple time-stamps with linear regression are used to estimate clock skew and offset. The average error of the algorithm for a single hop case using two nodes was 1.48µs
FTSP also utilizes less network resources than either RBS or TPSN
Conclusion