# A Proposal for IoT Dynamic Routes Selection Based on Contextual Information
## 3 Proposed Approach
### Proposed Approach
#### 3.2.1 Objective Functions  
Existing objective functions have constraints, since an objective function composed by a single routing metric presents advantages and limitations. A single metric present in the objective function may not fully satisfy the requirements required by the applications. For example, while the number  
Figure 1: Functional model of the proposed approach.  
of jumps allows choosing the shortest path, this can lead to the failure of one or more nodes due to power consumption because the battery level is not considered in the decision process. In addition, considering ETX as a single routing metric can lead to high latency in routing messages. When selecting routes with low ETX, the network becomes more reliable but does not reduce the latency during the message routing process. Thus, the ETX metric alone is not suitable for real-time applications because it does not take into account the delivery time requirements of the messages.  
The fixed and permanent combination of two metrics is insufficient to efficiently meet all the requirements of the applications, since the requirement of each application may change eventually. In addition, considering two routing metrics it is possible to optimize routing performance but at the cost of penalizing other performance parameters. For example, using the ETX metric may help the routing process to use more reliable paths, however, it may lead to excessive use of some network nodes reducing the remaining energy. Thus, it is necessary to combine several metrics to be able to characterize the route quality more efficiently. For the best route selection, it is proposed the combination of several important routing metrics.  
The objective functions proposed in this approach enable the devices to select the parent nodes (default route) based on the context information obtained from the application. Each application may have requirements that simultaneously needs up to three metrics (Expected Transmission Count (ETX), Number of Hops (_NH_), and/or Energy Consumed (_EC_)). These requirements allow rating them according to their priority level (N) considering the following levels: High = 1; Medium = 3; and Low = 5. Each metric is represented by an \(F\) function. Based on this information, a _T(ni)_ weight is achieved by each network device, which represents the sum of the context functions.  
* Delivery Quality and Context Aware Type 1 Objective Function (DQCA-OF1): \[T(ni)=NETX\cdot FETX(ni)+NNH\cdot FNH(ni)\] (10)  
The DQCA-OF1 function considers the metrics Expected Transmission Count (ETX) and Number of Hops (_NH_) for the calculation of the route selection.  
* Delivery Quality and Context Aware Type 2 Objective Function (DQCA-OF2): \[T(ni)=NETX\cdot FETX(ni)+NEC\cdot FEC(ni)\] (11)  
The DQCA-OF2 function includes the metrics Expected Transmission Count (ETX) and Energy Consumed (_EC_) for the route selection calculation.  
* Delivery Quality and Context Aware Type 3 Objective Function (DQCA-OF3): \[T(ni)=NNH\cdot FNH(ni)+NEC\cdot FEC(ni)\] (12)  
The DQCA-OF3 function uses the metrics Number of Hops (_NH_) and Energy Consumed (_EC_) for the route selection calculation.  
* Delivery Quality and Context Aware Type 4 Objective Function (DQCA-OF4): \[T(ni)=NETX\cdot FETX(ni)+NNS\cdot FNS(ni)+NEC\cdot FEC(ni)\] (13)  
The DQCA-OF4 function includes the metrics Expected Transmission Count (ETX), Number of Hops (_NH_) and Energy Consumed (_EC_) for the route selection calculation.