Timing-sync Protocol for Sensor Networks (TPSN)

18
Timing-sync Timing-sync Protocol for Protocol for Sensor Networks Sensor Networks (TPSN) (TPSN) Presenter: Ke Gao Presenter: Ke Gao Instructor: Yingshu Li Instructor: Yingshu Li

description

Timing-sync Protocol for Sensor Networks (TPSN). Presenter: Ke Gao Instructor: Yingshu Li. Does timesync matter?. Internet Time Synchronization Critical in some contexts (e.g. crypto, distributed packet traces) A convenience in many other contexts Sensor Network Synchronization - PowerPoint PPT Presentation

Transcript of Timing-sync Protocol for Sensor Networks (TPSN)

Page 1: Timing-sync Protocol for Sensor Networks (TPSN)

Timing-sync Protocol for Timing-sync Protocol for Sensor Networks Sensor Networks

(TPSN)(TPSN)

Presenter: Ke GaoPresenter: Ke Gao

Instructor: Yingshu LiInstructor: Yingshu Li

Page 2: Timing-sync Protocol for Sensor Networks (TPSN)

Does timesync matter?Does timesync matter?

Internet Time SynchronizationInternet Time Synchronization• Critical in some contexts (e.g. crypto, Critical in some contexts (e.g. crypto,

distributed packet traces)distributed packet traces)• A convenience in many other contextsA convenience in many other contexts

Sensor Network SynchronizationSensor Network Synchronization• Fundamental to its purpose: data fusionFundamental to its purpose: data fusion• Physical time needed to relate events in Physical time needed to relate events in

the physical worldthe physical world

Page 3: Timing-sync Protocol for Sensor Networks (TPSN)

Basic Concepts & AssumptionsBasic Concepts & Assumptions Hierarchical topology in the network: Every noHierarchical topology in the network: Every no

de is assigned a level in this hierarchical structde is assigned a level in this hierarchical structure.ure.

A node belonging to level i can communicate A node belonging to level i can communicate with at least one node belonging to level i-1.with at least one node belonging to level i-1.

Only one node is assigned to level 0, which we Only one node is assigned to level 0, which we call the “root node”.call the “root node”.

Each sensor nodes have unique identifiers. TPSN uses only bi-directional links to do pair

wise synchronization between a set of nodes.

Page 4: Timing-sync Protocol for Sensor Networks (TPSN)

TIMING-SYNC PROTOCOL FOR TIMING-SYNC PROTOCOL FOR SENSOR NETWORKS (TPSN)SENSOR NETWORKS (TPSN)

Level Discovery PhaseLevel Discovery Phase Synchronization PhaseSynchronization Phase

Page 5: Timing-sync Protocol for Sensor Networks (TPSN)

Level Discovery PhaseLevel Discovery Phase The root node is assigned a level 0 and it initiates this The root node is assigned a level 0 and it initiates this

phase by broadcasting a level_discovery packet. The lphase by broadcasting a level_discovery packet. The level_discovery packet contains the identity and the leevel_discovery packet contains the identity and the level of the sender. vel of the sender.

The immediate neighbors of the root node receive this The immediate neighbors of the root node receive this packet and assign themselves a level, one greater thapacket and assign themselves a level, one greater than the level they have received i.e., level 1. n the level they have received i.e., level 1.

After establishing their own level, they broadcast a neAfter establishing their own level, they broadcast a new level_discovery packet containing their own level. w level_discovery packet containing their own level.

This process is continued and eventually every node iThis process is continued and eventually every node in the network is assigned a level.n the network is assigned a level.

Page 6: Timing-sync Protocol for Sensor Networks (TPSN)

Synchronization PhaseSynchronization Phase ‘‘A’ A’ sends a sends a synchronization_pulse synchronization_pulse packet to ‘packet to ‘B’B’. .

The The synchronization_pulse packet synchronization_pulse packet contains the level ncontains the level number of ‘umber of ‘A’ A’ and the time value of and the time value of T1T1. .

Node Node B B receives this packet at time, receives this packet at time, T2, T2, where where T2 T2 is eqis equal to ual to T1 + T1 + ΔΔ + d+ d. Here . Here ΔΔ and and d d represents the clock drirepresents the clock drift between the two nodes and propagation delay respft between the two nodes and propagation delay respectively. ectively.

At time At time T3T3, ‘, ‘B’ B’ sends back an sends back an acknowledgement acknowledgement papacket to ‘cket to ‘A’A’. .

The The acknowledgement acknowledgement packet contains the level numpacket contains the level number of ber of ‘B’ ‘B’ and the values of and the values of T1, T2 T1, T2 and and T3T3..

Page 7: Timing-sync Protocol for Sensor Networks (TPSN)

This message exchange at the network level begins with the root This message exchange at the network level begins with the root node initiating the phase by broadcasting a time_sync packet. node initiating the phase by broadcasting a time_sync packet.

On receiving this packet, nodes belonging to level 1 wait for somOn receiving this packet, nodes belonging to level 1 wait for some random time before they initiate the two-way message exchane random time before they initiate the two-way message exchange with the root node.ge with the root node.

This randomization is to avoid the contention in medium access.This randomization is to avoid the contention in medium access.

Page 8: Timing-sync Protocol for Sensor Networks (TPSN)

Special ProvisionsSpecial Provisions1.1. When a new node join the network, it waits for some time to bWhen a new node join the network, it waits for some time to b

e assigned a level. If it is not assigned a level within that period,e assigned a level. If it is not assigned a level within that period, it timeouts and broadcasts a level_request message. The neig it timeouts and broadcasts a level_request message. The neighbors reply to this request by sending their own level. This couhbors reply to this request by sending their own level. This could be seen as a local level discovery phase.ld be seen as a local level discovery phase.

2.2. If a node dies, the node would not get back an acknowledgemIf a node dies, the node would not get back an acknowledgement to its synchronization_pulse. It would retransmit the synchent to its synchronization_pulse. It would retransmit the synchronization_pulse after some random amount of time. After retrronization_pulse after some random amount of time. After retransmitting the synchronization_pulse a fixed number of times, ansmitting the synchronization_pulse a fixed number of times, the node broadcasts a level_ request message. On getting bacthe node broadcasts a level_ request message. On getting back a reply, the node is assigned a new level.k a reply, the node is assigned a new level.

3.3. If an elected root node dies, the level 1 nodes run a leader elecIf an elected root node dies, the level 1 nodes run a leader election algorithm and the elected leader takes over the functionaltion algorithm and the elected leader takes over the functionality of the root node. This new root node starts from the beginniity of the root node. This new root node starts from the beginning and reruns the level discovery phase.ng and reruns the level discovery phase.

Page 9: Timing-sync Protocol for Sensor Networks (TPSN)

Error analysis of TPSN Error analysis of TPSN

Decomposition of Packet DelayDecomposition of Packet Delay

1. Send time: time spent in actually constructing the packet at the application layer.

2. Access time: After reaching the MAC layer, the packet waits until it can access the channel

3. Transmission time: This refers to the time when a packet is transmitted bit by bit at the physical layer over the wireless link.

4. Propagation time: time taken by the packet to traverse the wireless link from the sender to the receiver.

5. Reception time: time taken in receiving the bits and passing them to the MAC layer.

6. Receive time: time when packet is passed on to the application layer where it’s decoded.

Page 10: Timing-sync Protocol for Sensor Networks (TPSN)

SSUCUC, R, RUCUC and P and PUCUC stand for the stand for the uncertainty at sender, at receiver uncertainty at sender, at receiver and in propagation time respectively.and in propagation time respectively.

RDRDA->BA->B refers to the relative drift refers to the relative drift between the nodes A and B from between the nodes A and B from time time t1 t1 to to t4.t4.

BAttR

41

Page 11: Timing-sync Protocol for Sensor Networks (TPSN)
Page 12: Timing-sync Protocol for Sensor Networks (TPSN)

Variation in packet delays – How to Variation in packet delays – How to improve them?improve them?

Uncertainty at the sender (SUncertainty at the sender (SUCUC): Paper proposes to reduce ): Paper proposes to reduce this source of error by time stamping the packet at the MAC this source of error by time stamping the packet at the MAC layer.layer.

Uncertainty in propagation time (PUncertainty in propagation time (PUCUC): TPSN uses only ): TPSN uses only symmetric links and on such links, the variation in delay is symmetric links and on such links, the variation in delay is going to be negligible.going to be negligible.

Uncertainty at the receiver (RUncertainty at the receiver (RUCUC): By time stamping the ): By time stamping the packet at the MAC layer, TPSN removes the receive time packet at the MAC layer, TPSN removes the receive time completely comparing to the traditional time ( reception + completely comparing to the traditional time ( reception + receive time )receive time )

As can be seen from the above analysis, TPSN As can be seen from the above analysis, TPSN would give roughly a better performance would give roughly a better performance comparing the traditional method.comparing the traditional method.

Page 13: Timing-sync Protocol for Sensor Networks (TPSN)
Page 14: Timing-sync Protocol for Sensor Networks (TPSN)
Page 15: Timing-sync Protocol for Sensor Networks (TPSN)

Multihop ResultsMultihop Results

It seems that error almost becomes a constant beyond 3-hop It seems that error almost becomes a constant beyond 3-hop distance. This is because synchronization error between any pair distance. This is because synchronization error between any pair of motes will probabilistically take different values from the of motes will probabilistically take different values from the normal distribution obtained in the earlier section. The normal distribution obtained in the earlier section. The randomness in the sign as well as the magnitude of the randomness in the sign as well as the magnitude of the synchronization error and drift prevents the error from blowing up.synchronization error and drift prevents the error from blowing up.

Page 16: Timing-sync Protocol for Sensor Networks (TPSN)
Page 17: Timing-sync Protocol for Sensor Networks (TPSN)

Auxiliary Benefits of TPSNAuxiliary Benefits of TPSN TPSN comes with an auxiliary benefit of improving the TPSN comes with an auxiliary benefit of improving the

performance of localization service in sensor networks. A common performance of localization service in sensor networks. A common approach of doing localization in sensor networks is to use approach of doing localization in sensor networks is to use ultrasonic ranging. The distance between two nodes is calculated ultrasonic ranging. The distance between two nodes is calculated by measuring the time of flight of sound.by measuring the time of flight of sound. The traditional accuracy is The traditional accuracy is around of 2cm.around of 2cm.

But instead, in TPSNBut instead, in TPSN the sender the sender mote first synchronizes with the mote first synchronizes with the receiver mote using TPSN and then sends the ultrasonic signal, we receiver mote using TPSN and then sends the ultrasonic signal, we can synchronize a pair of motes to an average accuracy of less can synchronize a pair of motes to an average accuracy of less than 20 usthan 20 us

Page 18: Timing-sync Protocol for Sensor Networks (TPSN)

Q & AQ & A