# Performance Analysis of Time Synchronization Protocols in Wireless Sensor Networks
## 1 Introduction  
Time (clock) synchronization is a crucial requirement for the operation of wireless sensor networks (WSNs). Various applications, such as time-division multiple access (TDMA) scheduling, device tracking, monitoring, and data fusion, require all nodes to have synchronized clocks. A significant number of studies regarding this problem have been conducted in recent years. Many protocols and algorithms have been proposed to achieve sub-microsecond accuracy in experimental test-beds [1; 2; 3; 4; 5; 6; 7; 8; 9; 10; 11; 12; 13; 14; 15; 16; 17; 18; 19; 20; 21; 22; 23]. However, unlike time synchronization in wired networks, wireless networks present additional challenges such as the uncertainty of wireless transmission, energy consumption, and mobility [24]. Moreover, the resource constraints on sensor devices (e.g., low computational memory and low data rate) must be considered when designing a time synchronization protocol. In fact, the performance of protocols can deteriorate due to many practical factors, such as hardware quality, message delay jitter, ambient environmental conditions, network topology, and protocol configurations. Therefore, it is necessary to understand the operation of time synchronization protocols and the possible effects of those factors before using them in a real network. In this study, we conduct a performance analysis on the Flooding Time Synchronization Protocol (FTSP) [1] and Gradient Time Synchronization Protocol (GTSP) [11] which are representative time synchronization protocols with centralized and distributed mechanisms, respectively. Both protocolsare listed in many surveys and comparative studies [25; 26; 27; 28; 29], and in particular, they are widely used as benchmarks for newly proposed time synchronization protocols [4; 30]. Many protocols use similar methods to those of FTSP (least-squares regression) and GTSP (average consensus) in estimating clock drift. For example, [2; 3; 6; 9] used least-squares regression as in FTSP, and [12; 13; 17; 19; 20; 21] used the average consensus mechanism as in GTSP. In addition, the performance and stability of FTSP and GTSP have been proved by experimental testbed and simulation study [30; 31]. Therefore, we believe that a performance study on FTSP and GTSP can provide comprehensive insights regarding how time synchronization protocols work in different scenarios as well as the advantages and disadvantages of each centralized and distributed mechanism. The performance analysis is conducted to determine the diverse factors affecting the performance of time synchronization protocols, such as message delay jitter, time synchronization period, network topology, and packet loss ratio. In particular, FTSP is highly affected by message delay jitter and network size because message delay is accumulated as the number of hops from the reference node increases. To solve this problem, an extended version of FTSP (E-FTSP) is proposed and evaluated together with FTSP and GTSP from a diverse range of aspects. The main contributions of this study are as follows:  
* A comprehensive study of the performance of time synchronization protocols under diverse factors is performed. The effects of these factors on FTSP and GTSP were analyzed to understand the behavior of time synchronization protocols. The simulation methods used can be applied to the evaluation of future protocols. * We propose an enhancement of FTSP (E-FTSP) and evaluate its advantages. We explain the problem with FTSP caused by the accumulation of jitter and describe how our improvement minimizes it. The simulation results prove that E-FTSP improves upon the performance of FTSP significantly, especially in large-scale multi-hop networks. The remainder of this paper is organized as follows. Related works are introduced in Section 2. In Section 3, we briefly review the time synchronization problem and the primary concepts behind FTSP and GTSP. Section 4 describes the simulation setup used for comparative analysis of the protocols.