# A Joining Procedure and Synchronization for TSCH-RPL Wireless Sensor Networks
## 2 Overview on the IEEE 802.15.4 TSCH and RPL
### Time-Slotted Channel Hopping  
Initially, the medium access method of the IEEE 802.15.4 standard [7] allowed for establishing communications through guaranteed slots or contention-based periods using a Superframe structure that was delimited by beacons. Following the IEEE 802.15.4e amendment of 2012, some improvements that were proposed by a proprietary mechanism were added [8], and other channel access methods were defined [9], among which the Time-Slotted Channel Hopping (TSCH) method, which is focused mainly on industrial environments, stands out. The TSCH access method is part of the MAC mechanism set of the IEEE 802.15.4e amendment of the standard. Among all of the methods that were included, TSCH is specifically designed to work in aggressive environments where interference and fading hinder communications in the sensor network. This mechanism replaces the concept of Superframe with the Slotframe, which is nothing more than a succession of time slots that are repeated at certain intervals. An in-depth description about the TSCH method's timeslot timing template can be found in the standard [7]. In addition, it adds frequency diversity thanks to its channel-hopping mechanism, which allows for mitigation of the effects due to interferences. These characteristics provide greater robustness, as well as work cycle optimization, thanks to the use of optimal radio resources planning both in the time domain and the frequency domain. Figure 1 illustrates an example of a timeslot and channel offset schedule. Communication between a pair of devices is scheduled during the same timeslot and channel offset, and repeated every slotframe. Channel offset provides an opportunity to use the same slot in the schedule with a different frequency at each iteration of the slotframe. The channel used to establish a connection in each of these slots changes according to Equation (1):  
\[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 is a parameter that 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 in selecting a channel of a predefined sequence according to the index that is obtained after calculating the module. Figure 1: The timeslot and channel offset matrix used in the Time-Slotted Channel Hopping (TSCH) method. The configuration and the steps that are required to obtain an efficient schedule are outside the scope of the IEEE 802.15.4e standard. The chosen implementation during the experiments is the autonomous scheduler Orchestra (2018). Orchestra provides the opportunity to maintain multiple schedules, each allocated to a particular traffic type, with different sizes and timeslots assigned to them. Orchestra allows the nodes to autonomously obtain a simple schedule and update it automatically as the topology evolves and is fed with network information by the RPL layer. TSCH Scanning and Synchronization Procedures  
A synchronization phase is first required due to the mechanism that underlies the operation of TSCH. This mechanism is based on the division of time into slots of sufficient duration so that two nodes can communicate with each other. By using such a short time slot to communicate, devices must maintain synchronization between themselves. For this, all devices that are part of the WSN must follow the same absolute time reference, which in this case is represented by the absolute slot number (ASN). This parameter represents the number of slots that have passed since the network was started. In addition, the nodes need to control the clock drift that can occur to keep this synchronization and the slots of several devices aligned in order to maintain the strict time limits that communication requires.