# Bell-X, An Opportunistic Time Synchronization Mechanism for Scheduled Wireless Sensor Networks
## 2 Timing for TSCH and RPL
### TSCH Beacon Advertising  
The IEEE 802.15.4 standard defines different medium access mechanisms, highlighting the TSCH mode for those applications that require high reliability, especially for industrial scenarios where interferences are more common. TSCH medium access mode allows for structuring the temporal plane following the philosophy that was inherited from the TDMA protocol, while using a certain number of slots that are periodically repeated in time. This subset of time slots can be grouped into what is known as slotframe. In addition, TSCH allows for different communication channels to be used, using a frequency hopping technique, which allows a different channel to be used during each time slot, in order to mitigate interferences. To be able to calculate the frequency channel used in each time slot, the following equation is used:  
\[f=F\Big{[}\big{(}ASN+ch_{offset}\big{)}mod\ C\Big{\}} \tag{1}\]  
where \(f\) is the physical transmission channel; \(ASN\) is the absolute slot number, which corresponds to the number of slots that have passed since the network was deployed; the \(ch_{offset}\) parameter allows for different channels to be used in the same time slot; and, \(C\) corresponds to the total number of channels that are used. Therefore, the function \(F\{-\}\) consists of selecting a channel of a predefined sequence according to the index that is obtained after calculating the module.  
The scheduling of these radio resources (time slots and frequency channels) allows for optimizing the performance of the nodes within the network, enabling only those slots in which a message exchange is scheduled, and leaving the rest inactive to save energy. These rules to establish an optimized scheduling are not defined in the standard, but there are recommendations to establish minimum resources to carry out a basic exchange [7].  
In the TSCH mechanism it is necessary to perform a previous synchronization phase in order for a node to be able to access the network. In this phase, the node attempting to join the network must acquire information about the scheduling used, as well as adjust its time clock based on a reference node that already belongs to the network. This synchronization is necessary so that two devices can exchange messages within the same timeslot. During this slot time, a node must be able to send a message and receive its corresponding acknowledgement. The exchange of these messages would not be possible if two nodes are not correctly synchronized.  
The nodes that are already correctly synchronized are periodically sending advertising messages with information about the scheduling or the current value of the ASN parameter in order to carry out the synchronization process. These messages are known as Enhanced Beacons (EB), an improved version of traditional IEEE 802.15.4 beacons that allow for additional information to be included in fields called Information Elements.  
Moreover, the nodes that were prepared to join the network start the scanning process, during a certain preconfigured period and for each of the configured channels, until they correctly receive an Enhanced Beacon. The synchronization process will take longer depending on different factors such as the number of channels configured, the scan time of each channel, the traffic on the network or the Enhanced Beacon transmission period [6].  
Figure 1 shows a scheme with two nodes, one synchronized and sending beacons and another during the scanning phase. The scheme illustrates different reasons why the synchronization process might fail. Taking these cases into account, the configuration of parameters, such as slotframe size, beacon advertising period, or scan time, can improve the synchronization times of new nodes.