Skip to Main Content
Recent advances in the development of wireless sensor networks(WSNs) have considerably increased the interest in their applications for a wide range of problems such as environmental monitoring, target tracking, habitat monitoring etc. Many of these applications and the wireless sensor network(WSN) itself require that the clocks of the sensor nodes are synchronized with certain accuracy. Existing approaches to clock synchronization in WSNs are mostly hierarchical in nature. A hierarchical structure is usually difficult to maintain, and it results in longer synchronization phase and reduced synchronization accuracy for large WSNs. Traditional internal clock synchronization protocols that have been proposed for distributed systems assume that the network is complete, i.e., every node can communicate with every other node directly. But WSNs, in general, are not a complete network, and hence, traditional internal clock synchronization protocols are not directly suitable for WSNs. In this paper, we propose a novel peer-to-peer based fully distributed internal clock synchronization protocol for wireless sensor networks which are not a complete network. We have analyzed our protocol for bounds on synchronization error, and shown that the synchronization error is always upper bounded. We have carried out extensive simulation studies using Castalia simulator (up to 1000 nodes) to evaluate the performance of our protocol and also compared its performance with that of TPSN. The accuracy achieved is consistently better than that of TPSN, and the energy consumption per node is considerably less than that of TPSN except for small WSNs requiring higher accuracy. We have also implemented our protocol using TinyOS in a WSN consisting of a few TelosB motes. The experimental results from the above implementation of our protocol show that the synchronization error is bounded and the accuracy is within a few tics of the external clock.