# A Resource Oriented Route Selection Framework Using Contextual Information Based on Fuzzy Logic
## 4 Proposed Approach  
In this proposition, the improvement of the objective function in RPL is to optimize routing to meet the context requirements of IoT based smart city application. In this section, we describe the following regarding the proposed approach: metric formulation, context-oriented objective function with fuzzy logic based route selection framework, and context-aware system architecture. The primary purpose of any IoT application is to enable the end users to seamlessly access information and services. Sensors, actuators, and smart objects must, therefore, be aware of the primary purpose of the underlying application. Context is any information that can be used to characterize the situation of an entity, in which an entity can be a place, person, an object, which is involved in the interaction between the user and the application. Therefore, the contextual information is used as a parameter for a given application. In our proposition, we have taken smart devices as entities. Using context-awareness, we want to enhance the routing process in RPL. In resource-constrained devices, the queue size is generally small, therefore, with high data traffic, small queues start to overflow before link loss, because traffic backlog becomes heavy enough to be detected while using ETX. [12]. Therefore, even though ETX generally reasonably evaluates link conditions, using merely ETX is not enough to understand the network situation. Thus, we need to combine other metrics that are related to the node buffer, which allows for monitoring both link dynamicity and node status. As explained in [22; 24; 27; 31; 34; 35; 36], there are also other routing metrics used for a different purpose. However, none of them take into account the difference between the current queue length and the last-round queue occupancy. Besides, the previous states of the node are not considered during the path selection process. When considering this fact, we proposed a new context-oriented OF, called COOF. This COOF recursively examines the last state of a node on the path to the root. Besides the OF also consider the link as well as nodes situation at the time of route construction. We considered serval routing metrics as being representative of different application requirement. These metric values are used as context parameters to select the optimum route that can forward data traffic to ensure the QoS level that is required for a particular application. The paper in [12] shows that queue utilization correlates with packet loss. Therefore, queue fluctuation is the core metric that represent node status and are useful for reducing packet loss. Moreover, along with queue utilization, the energy metric is also used to consider the node's status. On the other hand, the ETX is used to represent the link status of the network. These routing metrics are used for defining an OF based on a fuzzy logic technique, which is as follows:  
Expected Transmission Count (ETX): it is defined as the expected number of transmissions required by a data packet to be successfully delivered on a wireless link. ETX is an additive link reliability metric that appends ETX of each link in the path. ETX is considered to be a reliable indicator of link quality between the nodes. As the ETX value decreases, link quality improves, so ETX value close  
Figure 3: RPL DAG structure with multiple Instances and multiple DODAGs. to one render the best communication link. Thus, it obtains the high-throughput path in multi-hop wireless networks and known as a reliability metric [37]. In our proposal, it is calculated every second as in Equation (1). We use a sliding window-based average with a window size of four seconds to obtain the average ETX at the node. \[ETX(i,j)=\frac{1}{d_{ij}\times d_{ji}} \tag{1}\]  
where, \(d_{ij}\) represents the measured probability that a packet is received successfully by the neighbor node and \(d_{ji}\) represents the measured probability that the acknowledgment packet is received successfully.