# CoSiWiNeT: A Clock Synchronization Algorithm for Wide Area IIoT Network
## 1 Introduction  
Due to the market and business evolution, industrial automation systems are evolving from the rigid automation pyramid to a flexible and reconfigurable architecture. The advances in cyber-physical systems (CPSs) and the industrial internet of things (IIoT) are enabling this evolution [1]. The future industrial automation systems envision using service-oriented architectures (SOAs) to deal with flexibility and reconfiguration issues. This paradigm shift in the architecture of future industrial automation systems opens doors for implementing advanced and futuristic applications that are difficult to realize with existing automation systems [2]. The growing presence of distributed resources makes their management complex and thus requiring efficient monitoring and controlling. Numerous applications based on remote monitoring and control such as remotely controlling a valve in a factory, predicting or preventing maintenance of factory assets based on periodic collection and analysis of factory sensor data by third-party vendors, controlling the production schedules in a factory based on the current inventory status of another raw material-producing factory, are grabbing the attention of plant owners, industries, and research institutes. All such remote applications require factories to be connected to a remote site or another factory over a wide area network (WAN), as shown in Figure 1. A WAN is a geographically distributed heterogeneous communication network that interconnects wired andwireless segments from public and private networks, in which several communication technologies such as fiber optic link, Wi-Fi, Bluetooth, and Power Line Communication (PLC) are adopted. Remote monitoring and control applications need a common notion of time for data consistency and coordination of activities among the factory and remote sites. A common notion of time is achieved by a clock or time synchronization service that aligns the clocks of all the devices on the network by distributing a common time to all nodes. The level of time accuracy and precision varies by application requirements, whereas remote maintenance of factory assets typically requires a second-level accuracy, while remotely controlling the factory valves will require a microsecond-level accuracy. Thus, the success of remote applications depends on the level of accuracy and precision of synchronization between a factory and remote site. Network packet delay variation or jitter adversely affects the clock synchronization accuracy. This effect is prominent in WAN as the different network segments contribute differently to end-to-end packet delays, e.g., the jitter of a fiber optics link is much less than the wireless links, resulting in variable end-to-end packet delays over time. The interference and noise levels over a WAN are significantly high. The unreliable communication networks result in higher events of missing packets and packet delay variation (PDV) than factory LANs such as wireless sensor networks (WSN). Thus, the heterogeneous nature and significant interference make it challenging to achieve an adequate synchronization over a WAN [3] compared to LANs. Hardware-based and highly accurate clock synchronization solutions such as global positioning system (GPS) and precision time protocol (PTP) are prominent candidates for WAN. GPS is a satellite-based system that provides timing information to receivers on Earth; however, signal stability cannot be guaranteed for GPS. Having GPS at all distributed resources is also a costly solution. In addition, GPS is vulnerable to environmental conditions such as radio jams, resulting in signal loss and errors in synchronization. PTP is a network packet-based synchronization method that uses hardware time-stamps to compute delays. PTP requires hardware support to all the nodes to achieve a higher accuracy. Thus, it is not a cost-effective solution.