# A Joining Procedure and Synchronization for TSCH-RPL Wireless Sensor Networks
## 2 Overview on the IEEE 802.15.4 TSCH and RPL
### RPL: The IPv6 Routing Protocol for Low-Power and Lossy Networks  
The RPL protocol is specified in RFC 6550 (Kelly, 2018), and is responsible for providing routing (including a route selection mechanism) from multi-point sources to a central node in addition to supporting point-to-point traffic. The protocol is designed for discovering and maintaining routes in devices with limited processing, memory, and energy capacities, which is why RPL has become widely used in WSNs. The topologies in RPL are represented by a Directed Acyclic Graph (DAG), a graph that organizes links to avoid loops. RPL provides the ascending routes of each node of the network to the root, forming a Destination-Oriented DAG (DODAG) that is optimized according to an Objective Function (OF). A DODAG's formation and maintenance is done through different control messages: DODAG Information Solicitation (DIS) messages are used to request information about the RPL's topology; DODAG Information Object (DIO) messages are sent periodically or in response to a DIS, using the Trickle Timer method, to disseminate information about the RPL's topology; and Destination Advertisement Object (DAO) messages are propagated upwards to build downwards routes. The objective functions define how the RPL nodes must select and optimize the routes within the same RPL topology. In these definitions, you can find how the nodes transform one or more metrics into a certain rank, which symbolizes the approximate distance to the DODAG root. The construction of the DODAG is performed according to the procedure that is illustrated in Figure 2.  
RPL DIO Transmission Using a Trickle Timer  
For the transmission of DIO messages that are used in RPL for the dissemination of the information necessary to join the topology, a mechanism that is based on Trickle Timer, which is specified in RFC6206 [12], is used. This mechanism allows for the set of nodes that use a shared lossy medium to exchange information in a more energy-efficient and scalable way. The algorithm is responsible for modifying the transmission window of the DIO messages, reducing the quantity of control messages, as long as the information corresponding to the topology remains stable. In this way, a node transmits DIO messages unless it receives messages from other neighbours, whose content suggests that the information to be transmitted is redundant.  
1. The configuration of the Trickle Timer mechanism is based on three basic parameters: IntervalMin (\(I_{min}\)), Interval Doublings (\(ID\)), and Redundancy Constant (\(RC\)). Taking into account these parameters, the Trickle Timer mechanism works in the following way:
2. When the algorithm is started, the current value of the timer is set to its minimum value, which is defined by the \(I_{min}\) parameter, after which the first interval of this duration begins.
3. Whenever the node listens to a transmission that it considers \"consistent\" with the current topology, it increments a counter called \(c\).
4. When the timer expires, the node transmits if and only if the counter is less than the redundancy constant, which is defined as \(RC\).
5. When the timer expires, the algorithm doubles the length of the interval until it reaches the maximum value given by \(I_{min}\cdot ID\), and remains in this setup until an event resets the timer.
6. If a node receives a transmission that it considers \"inconsistent\", the node resets the Trickle Timer. To restart it, the node sets the timer back to \(I_{min}\).  
The description of this mechanism is important, since some implementations, such as the one performed by the Contiki OS [13], use the Trickle Timer mechanism to modify the Enhanced Beacon transmission period in addition to the transmission of DIO messages.