# Sigma Routing Metric for RPL Protocol
## 2 RPL Protocol  
The IPv6 Routing Protocol for Low Power and Lossy Network (RPL) is based on a distance vector and was standardized by IETF under ROLL (Routing Over Low Power and Lossy Networks) review. There are two types of nodes in an RPL network: the sink (or receiver) node gathers information throughout the network, and the origin or issuer node collects data from sensors to send them to the sink node. RPL uses the Destination-Oriented Directed Acyclic Graph (DODAG) concept [6; 14; 15; 16] to define its topology. For this reason, the following types of control messages should be defined:  
* DIO: DODAG Information Object
* DIS: DOGAG Information Solicitation
* DAO: Destination Advertisement Object
* DAO-ACK: Destination Advertisement Object Acknowledgement  
The DODAG is constructed downwards from the sink node, using DIO messages that contain information such as the root node identifier and the objective function, which is used when selecting parents for each node [17]. The nodes in the network keep transmitting DIO messages until all nodes have received and sent their ranks. Once this is done, every node selects their preferred parent, which is the node through which they send their packets. It is possible for each node to store information about other nodes in the network, in order to change a preferred parent if needed. The new DIO messages are sent periodically through the Trickle Timer algorithm to update the network. The DAO message is sent by all nodes to the root node and closes the route between the sender and the root node. The DAO-ACK message can be requested by a node to guarantee the delivery of the DAO. Lastly, the DIS message is used by new nodes that join the network to request a DIO and thus keep the topology up-to-date. The rank of a node in RPL is represented as a scalar number which depicts the location of that node within the DODAG. Each node in the network has a rank value: the rank of a node defines the relative single position from a node with respect to a sink node of the DODAG, and it is calculated based on the distances relating to its neighbors. The rank can be calculated as a function of link metrics and may consider other properties, such as limitations [6; 11]. In this process of DODAG network forming, each node selects multiple nodes as possible parents and the objective function defines how RPL nodes select their parent to improve routes within a RPL Instance. An objective function defines how an RPL node selects the optimized route within an RPL instance, based on metrics and routing restrictions. It provides specific criteria of optimization, such as minimizing hop count, ETX route, latency, etc. RPL forms a DODAG based on the objective function. The OF guides RPL in the selection of parents and candidate parents. It is also used by RPL to calculate the rank of a node. All upstream traffic is transmitted through the preferred parent. Objective Function zero (OF0) selects the route to the root using a minimal number of hops. This can be achieved by comparing the parents' ranks. Cooja uses a rank of 16 bits in units of 256 (min_hoprankinc) that allows a maximum of 255 hops. The ETX metric of a wireless link is the expected number of transmissions needed to send a packet through the link. The ETX Objective Function uses the ETX metrics while calculating the shortest path. On the other hand, the Objective Function (OF) in RPL is used by the nodes, in order to select forwarding nodes on an application-defined routing metric. RPL has two OFs. Among the functions standardized by IETF we find the OF0, which is based on the minimum count of hops, and the MRHOF, which is based on the expected transmission count (ETX). However, when the network becomes denser or the number of nodes increases, both OF0 and MRHOF introduce long hops, which can which can develop into a bottleneck that restricts the network. The adaptation is proposed to optimize both OFs through a new routing metric.