# Time Management in Wireless Sensor Networks for Industrial Process Control
## 2 Materials and Methods
#### 2.1.1 IEEE 802.15.4  
The use of wireless communication in industrial process control is a novelty as most communication protocols in the industrial field are used only for process monitoring: reading the process parameters and sending them to a central unit for display and analysis. Both WirelessHART and ISA100 Wireless rely on time management for the proper operation of the wireless network. As they implement only the physical layer from the IEEE 802.15.4 standard and rely on proprietary implementations of the upper layers, they define their own time management algorithms. Having this in mind, we had to refer to IEEE 802.15.4 as a starting point in the definition and implementation of a simple and reliable time management algorithm.  
Since its first release back in 2003, the IEEE 802.15.4 standard has been continuously amended, adding new modulations, operating frequencies, data rates, and application layer features. The standard defines multiple operating modes from which TSCH is the most appropriate for wireless process control as it implies accurate time synchronization between the wireless nodes associated to a network. The concept is simple: it divides time into a sequence of timeslots of fixed intervals that the nodes must follow. Each timeslot allows for one transmission--a command or data frame and one reception--an acknowledgement, sent and received by following strict timeslot templates. It is expected that the sequence of timeslots will repeat after a certain amount of time, allowing for the predictability of the wireless network behavior. This repeating sequence of timeslots is called a slot frame.  
Our approach is to use the standard frames as they are defined by IEEE 802.15.4 (beacon, command, data, and acknowledgement) and make use of the available payload fields in the extended beacon and acknowledgement frames to send additional data between the nodes. TSCH will be used as the operating mode with a standard slot frame structure used for node management, but also for process control.  
By examining the standard IEEE 802.15.4 frame structure for O-QPSK modulation, as illustrated in Table 1 alongside the airtime for each field, and data rate (250 kbps) intended for use, we have determined that a timeslot duration of 10 milliseconds will be appropriate as it allows us to send and then receive two frames that have the maximum allowable length of 127 bytes, which together with the Preamble, SFD, and PHR total up to a maximum of 4.256 milliseconds of airtime per frame. As the acknowledgement frame, which is sent as a reply to a command or data frame, usually has its length at much less than 127 bytes, the timeslot time of 10 milliseconds is more than enough to handle the communication between the two nodes.  
To simplify the implementation of the algorithm, for testing and validation, we have decided to use the simplest network topology defined by IEEE 802.15.4, the star topology. In this topology, displayed below in Figure 2, the coordinator (C) is the central device and manages the wireless network, starting a network, responding to association requests  
\begin{table}
\begin{tabular}{c c c c} \hline \hline  & **Length (bytes)** & **Value** & **Duration (\(\mu\)s)** \\ \hline Preamble & 4 & 0 \(\times\) 00000000 & 128 \\ Start Frame & 1 & 0 xA7 & 32 \\ Delimiter (SFD) & & & \\ Physical Layer & 1 & 0x00 \(\div\) 0x7F & 32 \\ Header (PHR) & & & \\ PHY Payload & 127 & various & 32 \(\div\) 4064 \\ \hline \hline \end{tabular}
\end{table}
Table 1: The default IEEE 802.15.4 frame structure and duration.  
from devices (D), and starting control loops. The network is designed in such a way that a control loop can be started between any two devices associated to the network. Proper time management is handled by the coordinator and time synchronization between the coordinator and the devices is needed to achieve this. Complex topologies like mesh would require an additional line of research to define a proper time management algorithm.