摘要
Time synchronization is one of the base techniques in wireless sensor networks(WSNs).This paper proposes a novel time synchronization protocol which is a robust consensusbased algorithm in the existence of transmission delay and packet loss.It compensates for transmission delay and packet loss firstly,and then,estimates clock skew and clock offset in two steps.Simulation and experiment results show that the proposed protocol can keep synchronization error below 2μs in the grid network of 10 nodes or the random network of 90 nodes.Moreover,the synchronization accuracy in the proposed protocol can keep constant when the WSN works up to a month.