# DYNASTI--Dynamic Multiple RPL Instances for Multiple IoT Applications in Smart City
## 2 RPL Background  
RPL is a distance vector routing protocol based on Internet Protocol Version 6 (IPv6) and provides multipoint-to-point/ point-to-multipoint communications for LLNs [29]. RPL distinguishes upward and downward traffic according to the direction that messages are transmitted. For RPL, downward indicates that the communication is going from the root to the nodes, and upward means that information is flowing from the nodes to the root. The node called _sink_ or root is the central point and most of the times it acts as gateway. RPL creates and maintains a tree topology, named Destination Oriented Directed Acyclic Graph (DODAG), rooted at the gateway.  
Each node has a rank based on hop-distance from the root in a DODAG, which increases by going down the tree from the root. In general, it reveals the node's individual position relative to other nodes taking the root as reference. The exact calculation of the rank is specified by an objective function (routing metric), which can consider other aspects, such as delay, energy consumption, or path loss [30; 31].  
RPL is designed to allow the system to create and run more than one RPL instance. Multiple instances of RPL can coexist in the network and multiple DODAGs can be constructed in each instance, but a node belongs to a single DODAG for each RPL instance it joined. The idea of multiple RPL instances comes from the need of optimizing the network paths for different objective functions. The same network nodes can run two or more RPL instances to serve a performance criterion, given by an objective function. For instance, one RPL instance seeks to reduce the latency while another instance aims to reduce the energy consumption [22].  
The DODAGs construction process is distributed and initiates with the announcement of a new DODAG, to which the nodes can join. When a new node joins the new DODAG, it must provide at least one parent node as a default route towards the root. A parent of a node is defined as one of the immediate successors of the node on a path towards the root. RPL exchanges frequently three types of control messages to find the parent towards the root and also to enable the communication between the root to the nodes. DODAG Information Object (DIO) message contains information that makes a discovered of a DODAG. This message carries the RPL instance ID, DODAG ID, Mode of Operation, Rank of the sending node, Metric Container, Routing Information, and DODAG Configuration. DODAG Information Solicitation (DIS) messages are sent by nodes who have not joined any DODAG. The message is sent to neighboring nodes to discover the DODAGs nearby. The DISmessage is answered by the nodes via a DIO message. Destination Advertisement Object (DAO) message is used to propagate destination information upward along the DODAG.  
A node may also use DIS to probe its neighborhood in order to receive a DIO message and find new available DODAGs. After receiving the DIO message, a node can join a DODAG tree. Nodes will receive and process DIO messages from many nodes and make a decision to join the graph based on the objective function and local policies. For this reason, DIO messages carry more information than other RPL messages. The DAO message also propagates RPL routing information, but it contains upward route information which is valid only to members of the same DODAG. RPL uses the trickle algorithm to manage the DIO messages rate. On the one hand, if there is a smaller number of DIO messages sent than a specific threshold within the interval, RPL reduces the trickle timer value. On the other hand, if there is a greater number of DIO messages than a specific threshold, the trickle interval (DIO message rate sending) is doubled up to a maximum value.