Cost Optimized Switching of Routing Protocol Scheme for IoT Applications

In this work, we propose a context-aware switching of routing protocol scheme for specific application requirements of IoT in real-time using a softwaredefined networking controller in wireless sensor networks. The work planned has two stages i) Selection of suitable routing protocol (RP) for given IoT applications using higher cognitive process and ii) Deployment of the corresponding routing protocol. We use the supervised learning-regression method for classification of the routing protocol while considering the network parameters like stability, path delay, energy utilization, and throughput. The chosen routing protocol will be set in the sensor network using a software-defined networking controller in an exceedingly flexible manner during the second stage. Extensive simulation has been done and results are evaluated to point out the strength of the proposed work, while dynamically varying the specific requirements of IoT applications. We observe that the work proposed is path-breaking the prevailing methods, where a specific routing protocol is employed throughout the period of time. It’s clearly shown that the proposed, Low-cost Context-Aware Protocol Switching (LCAPS) scheme is efficient in improving the performance of the sensor network and also meets the specific application requirements of IoT by using Software-Defined Wireless Sensor Networks SDWSNs.


Introduction
Wireless Sensor Networks (WSNs) are sensors that have the inbuilt processing power to measure physical parameters connected through wireless media. In the olden days, sensors were placed near the region of interest (ROI) are connected to the base station through wired media. However, with the advancement of technology nowadays, WSN is widely used to process sensitive data from sensors with the help of wireless communication protocols. Routing is the process of selecting the routes to transfer data over a network and thus achieving more latency, energy efficiency, throughput, less delay, etc. Various routing algorithms are used to improve the efficacy of WSN [1][2][3].
Several mechanisms have recently been made known to alter the activity of a node at travel time. SDN can be practiced in Wireless Sensor Networks to enhance the function of nodes in real time to face the specific requirements of IoT applications [4].
It is necessary to dynamically monitor and manage the deployed nodes of WSN to face the specific requirements of the IoT application. For example, the DSDV [5] proactive table-driven routing protocol can be used to reduce network delay with more latency while AODV [6] reactive on-demand routing protocol is best for energy-efficient, less Bandwidth, minimum control overhead, and less traffic WSN applications. It is very much essential to manage and to select the suitable routing protocols appropriately under the different periods of time-based on the specific requirements of IoT application in real-time to obtain the optimal sensor network efficiency and QoS. However, the past WSN frameworks [7] do not encourage the change of routing protocols under specific application requirements in real-time, while the WSN combined with SDN may be arranged in real-time by detaching the control plane from the infrastructure plane which h has the physical sensor devices [8].
On the other hand, there is still a research gap on selecting the precise routing protocols to obtain the optimal sensor network performances and deploying the updated routing protocol in the network with minimum time delay. While in the switching phase of routing protocol few data packets transmitted might be failed and in a shift, it decreases the packet delivery ratio of the sensor network [9]. The contributions of this work are i) In this paper, a routing protocol switching scheme based on low cost context is proposed, and the parameter stability, path delay, energy utilization and network throughput of software-defined WSN are considered to optimize network performance, and various specific application requirements of the Internet of Things are also considered. ii) The manuscript designs a flexible SDN controller, which makes the right decision by considering the network conditions and the specific application requirements of the given Internet of Things. On the controller side of sensor and diagnostic network, the supervised learn-classification regression method is used to make the necessary decisions.

Field Programmable Gate Array WSN
Bouabdallah et al. [10] suggested minimizing the range for sensor nodes in the vehicular network. The load offset method is used here to determine different paths. He justified energy utilization could be reduced by sending information over different routes instead of adopting a single route in the network. Krasteva et al. [11] proposed that Reconfigurable hardware (FPGA-Field Programmable Gate Array) can increase the efficiency of hardware reconfigurable devices including WSNs. The reconfigurable device implies benefit in WSN deployment, management, and also in cost reduction. Similarly, Guevara et al. [12] suggested that the use of dynamic reconfiguration reduces the issues of scalability and heterogeneity capabilities of the WSN. Gao et al. [13] suggested a strategy to deploy a productive routing protocol in WSN. The dynamic reconfiguration helped in altering the routing protocol by the remote administrator based on the context the routing protocol can be optimized. Bera et al. [14] suggested a mobility-conscious implementation of the flow-table method in heterogeneous devices to enhance the Quality of Experience in users by minimizing energy utilization and message overhead in the sensor network. The proposed scheme holds two components namely route estimator and flow-manager. The route estimator helps to predict the future location of the users and the flow-manager involves in implementing the forwarding rule in accessing devices.

Software Defined Wireless Sensor Network
Luo et al. [8] has proposed two different approaches to the flow table method: approach by ID based and value-based. The ID-depended method, the sensor node ID is compared to forward the information sensed to sink nodes in the network. Otherside in the value-depended approach, the value of the information sensed is compared with other nodes before being sent to the network. Galluccio et al. [15] developed a Software-Defined Networking solution for Wireless Sensor networks. The sensor nodes have been reconfigured in a stateful manner to minimize the volume of information trade between sensor nodes and Softwaredefined network controllers. Anadiotis et al. [16] have proposed the processing of big data in WSN based on the MapReduce method. It has been proposed that separating and lengthening the functionality of Software Defined Networking-WISE, planning that permits efficient loading and carrying of the userdefined map and reduces tasks at the nodes. Zeng et al. [17] proposed a plan to reduce energy utilization in Wireless Sensor Networks, that the sensor node has different sensor gadgets to perform various work. Hence, the sensor nodes could be triggered based on specific requirements. Wang et al. [18] proposed SDN-based WSN architecture to monitor and control the sensor nodes sleep-scheduling of WSN in a power economical aspects. Bera et al. [19] designed a Soft-WSN podium to manage and monitor WSNs using the SDN concept. Two managers are designed at the control layer of SDN-device manager and topology manager to enhance the QoS and to increase the network efficiency. The proposed system gives the ability to manage the network and device-specific tasks on Wireless Sensor Networks. The authors said that the system developed might be meshed into available wireless sensor networks, by not disturbing the technology underlying.

Proposed Architecture SDWSN
Assumption: it is pretended that sensor nodes are set up uniformly and the sensor network is connected in a flat architecture network structure type and every node connected is within the field of communication with a minimum of one node in the network. Access points and Sensor nodes are defined here as physical devices. The access point (AP) forwards the data sensed by the sensor node to the BS (Base station). The proposed system AP and sensor node are configured in real-time to greet the specific application requirements of IoT ( Fig. 1). In this portion, the communication protocols involved within the proposed system are discussed. The sensor nodes communicate with one other and with the access points, and therefore the access point communicates the acquired data from the sensor node with the controller and data server where the information is stored.
i) Sensor and Access point Communication: To communicate among the sensor nodes here in this work IEEE 802.15.4 Zig-bee protocol architecture is used. While it is generally used by low-energy networks. Besides, the Zig-bee protocol is used by most of the sensor nodes available in the market for its communication purpose. Here, it is assumed Zig-bee technology for communication between the sensor nodes and the access point in the network. ii) Access point and SDN Controller Communication: To communicate the information among the access point, data server, and the SDN Controller IEEE 802.11 WLAN protocol architecture is used. Therefore, the access point sends the acquired sensor data to the data server via WLAN technology in which the server runs on a fast wired network. Likewise, the controller communicates with the access point through traditional network technology. Decisions made by the controller are communicated by the access point to specific sensor nodes. Furthermore, the proposed system uses the well-developed and established protocols used in IoT, the IEEE 802.15.4, and IEEE 802.11 communication protocols.

Goals
The scheme proposed aims to increase the performance of the sensor network. Here, we have taken four factors to make the overall goal function-Stability, Path delay, energy utilization, and network throughput, which is going to be discussed further in this paper.

Stability
Stability is taken for selecting the next router and it chooses the path based on a greater probability of successful delivery. WSN must communicate in real-time with more stability to meet IoT requirements for specific applications. To improve such applications, a communication protocol is required based on the behavior of the data packet deadline. Using path stability estimation, the forwarding node is making the optimal routing decision. The data packet reception ratio (DRR) of the channel delivering node y to z is referred to as DRRyz and indicates the probability of successful path delivery is defined in Tab. 1.
where l is the number of data packets lost and d is the number of data packets delivered, a e 0; 1 ð Þ is path restriction coefficient oversight the impact of the formerly estimated value on the fresher one, d dþl is the newly measured DRR value [20]. The main objective is to increase the stability and thereby to improve the performance of the sensor network. Analytically represented as, Subject to DRR xy > 0 and d > 0 Eq.
(2) denotes that DRR xy and d greater than zero always. T and A represents the total time and a total number of network aisles used for network routing. p is the routing protocol that is practiced at the node.

Path Delay
This shows the time spent on a data packet to send from node x to the nearby node y and it consists of line delay (delay L ), contention delay (delay C ), transportation delay (delay T ), and the propagation delay (delay P ) represented analytically as where D i,k is the delay for i th channel in k th hop. t s is the time consumed when the packet is ready for transmission and becomes transmission queue head, t ack is the time when the acknowledgment is received, BW is the network bandwidth, and (A) is the size of the acknowledgment then, t ack À Size of A ð Þ=BW À t s is the recently estimated delay and β e [0, 1] is the tunable weighting coefficient. The above equation shows the Exponential Weighted Moving Average (EWMA) update for delay estimation, which has the advantage of being simpler and demanding less resource. The aim is to decrease the network dealy for all A used in routing defined as follows, Cost of sensor network with routing protocol p ε P Minimize ¼

Energy Utilization
It is defined as the energy consumed by the sensor node for transmission and reception of data packets. Additionally, the space between the source and destination also relies on energy utilization. Hence, the energy consumed by a sensor node for relaying the data packets to an adjoining node which is placed in a distance d is mathematically represented as [21]. ε is a constant, and g represents the drain efficiency. Where d is the distance between the sender and receiver sensor nodes, and r is the loss exponent of the network aisle. To be simple, the network aisle loss exponent considers here is constant always. Furthermore, the energy consumed for the provided sender and receiver nodes for the network aisle placed at h Multihop area is evaluated as, Here for energy utilization (h − 1) hops are assumed due to reception, the receiver node is energized using an external source. Therefore, the main goal of SDN is to reduce energy utilization for all sender and receiver nodes of the sensor network but to set up the focused routing protocol based on specific application requirements of IoT p ε P, Analytically represented as

Throughput
For a network aisle 'a' throughput can be calculated as follows: [22]. The main objective is obtaining increased network throughput to enhance the progress of the sensor network.
Analytically represented as, Subject to W d ; l > 0; and RT d ; l > 0: (9) where C gives the total number of accessible channels. W d,l is the received window size of Transmission control protocol in d th channel lth hop. RT d;l is defined as round-trip time of dth channel in lth hop. It has been noted that Transmission control protocol performance in the Wireless sensor network is low. Hence, it was followed a distributed Transmission control protocol (TCP) caching mechanism where the lost segments are retransmitted by the sensor nodes locally to enhance the performance of the sensor network. In the proposed work, it is assumed that the network path between a sender and receiver prevail always.

Total Goal Tasks
A multigoal task is formed by merging the separate individual goal tasks. Here a load-based approach is examined to arrange a multi-goal task. Analytically represented as, (2), (6), (8) and (9), The various loads like α, β, c, and d are considered as coefficients for the individual goal task. Depends on the specific requirements of IoT applications the values of the coefficients are calculated and its sum could be equivalent to one, the nodes changing in position are still have resource constraints. It is clearly stated that the distance among two sensor nodes varies from concern to time and here it will be taken as one of the main constraints. Because of changes in distance between two nodes concerning the time the size of the window and time of the round-trip also changes. Additionally, line, transportation, contention, and propagation delay should not be less than zero. Therefore, these are playing a major role in reducing the cost. The cost optimization must be mathematically calculated at the sensor nodes where the routing protocols are deployed. Hence, the Software-Defined Network controller establishes to determine the routing protocol for which the goal task reaches the minimum value.

Solution Approach
The proposed method consists of the consecutive phases: i) Selection of appropriate routing protocol and ii) Deployment of the selected routing protocol Fig. 2 gives an idea of the proposed scheme. In an SDN controller based on bounding the proposed work determination-making process will be unified on high priority.
Hence, the suggested plan could be implemented in software-defined wireless sensor network to enhance the efficiency of the sensor network. The SDN controller collects the network information like the size of the network, pause time, speed of the node, range of communication, and data packet sending rate. Hence, the current software-defined wireless sensor networks promises to collect network information. As a result of the system, there will not be any additional overhead in the proposed scheme in the aspects of network data acquisition.

Selection of Appropriate Routing Protocol
In our approach proposed, a plan of decision-making is designed in the software defined network controller side to calculate the capability of RP involved in attaining the maximum performance of sensor network and to meet the challenges of given application-specific requirements of IoT. Supervised learning approach (Gradient-based descent method) is used by which adequate decision will be taken by the SDN Controller based on the condition available such as the size of the network, number of nodes, the energy available, speed of the node, and specific application requirements of IoT provided. The training state holds two steps-Network information feature extraction and Network information classification.

Network Information Feature Extraction
Here various parameters of the network have been taken, such as the locality, size of the network, pause time, speed of the node, time stamp, and data packet sending rate. Features are collected and extracted from various network data. The network frameworks are defined down.

Locality
This is used to know about the sensor nodes information taken region and also helps to find the nearby list of sensor nodes. It is considered that the sensor nodes are set up in a distributed network through a common random way and in the initial time the network is always connected.

The Intensity of the Network
This provides information about the number of active sensor nodes available in the sensor network. Apparently, for a typical WSN model, the total energy utilization in the sensor network arises with respect to the rise in the sum of sensor nodes that hold the information of routing. Hence, it is assumed the intensity of the network is an important framework to be extracted from the network data.

Pause Time
This information is used to determine the network mobility i.e., static or dynamic. If the pause time of the sensor nodes is equal, then the sensor nodes are said to be static type else the sensor nodes are said to be dynamic. Pause time deals with the movement patterns of the sensor nodes to take necessary decisions.

Speed of the Node
This gives information regarding the sensor node's speed in the sensor network. If the acceleration of the sensor node is more, then the topology of the sensor network varies frequently. Hence, the Open flow tables are needed to be renewed frequently at every sensor node which leads to an increase the energy utilization again.

Time Stamp
This provides information about the data collection time of the sensor nodes and is used to calculate the delay in receiving the information from the sensor nodes.

Data Packet Sending Rate
During all the time periods this shows the number of data packets sent from the sender to receiver in the sensor network. This results in the volume of energy utilization and PDR in the sensor network.
The parameters discussed above are useful in extracting the Sensor network information and contributed to classifying the statistics of the network. The SDN Controller gathers the sensor network information and it holds various tuples as shown here: (<Size of the network, Locality, pause time, Speed of the node, Time stamp, Data packet sending rate>). The sensor nodes regularly collect this data and send it to the SDN controller.

Network Information Classification
The network information extracted is classified depending on load-based optimization problem described in Section 3. A low-cost value is evaluated based on the performance of the sensor network is more optimized and also relies on the given specific requirements of IoT applications. Hence, for the specific application requirements, different weights are assigned for Stability, Path delay, Energy utilization, and throughput, as described in Section 3. Analytically, it is represented as, [23] x i x i (11) where x i represents the different load considered for the specific application requirements of IoT given. n denotes the number of load based goal task taken. Here in this scheme, Consider n = four. especially, stability, path delay, energy, and throughput. Subsequently, load for x i is allocated and it impacts the results. It is very important that x i s are the parameters (known as weights) parameterize the given lowcost space of mapping linear algebra from A to B. Hence, B is a linear algebra of A among coefficient x i : To know the values of x i ; the goal of the trainer is to bring h x a ð Þ as make it feasible to face the specific requirements of IoT application given. Hence, (11) is analytically represented as follows, It's very important n shows for various frameworks taken in the proposed scheme, like as stability, path delay, energy, and throughput. b is the destination price depends on low price evaluated by (12) for a specific routing protocol. Hence, for the provided value, the aim is to decrease the destination price b. Thus, the trainer selects which routing protocol decreases b with respect to a.
Algorithm for classification and deployment:

Algorithm 1: Classification Algorithm
Input: Set of routing protocols P, Network information Output: Sorting the network information features and stored them in Class S 1 Assign T min = X, p = 1, S = 0;

return S
At last, value of x j is determined as follows [24]: where x j is the starting value, and the action will be done again till the rate of x j mingles. The term µ is the training score. Subsequently, the rate of x j is obtained, to meet the application-specific requirements of IoT prescribed. Here network information classification is done by the 'Regression via classification' method.

Deployment of the Selected Routing Protocol
Algorithm1 is used in selecting the precise routing protocol to optimize the sensor network performance, necessary for deploying in the network. Algorithm 2 is used in suitable protocol to be set up in the sensor network in regular aspects as the sensor network data acquisition. The above-said Algorithm 1 analyzes the network classes received for which the cost is very low for the given condition of the network. At last, the Software Defined Network controller sets the desired RP in the sensor network. Hence the restore interval of the time period (TP itr ) relies on users' needs.

Performance Evaluations
The performance of the sensor network is evaluated on the proposed scheme LCAPS (Low-cost Context-Aware Protocol Switching), using the simulator NS-3 in which the necessary part is built for the switching of RP in real time. The caption 'LCAPS' is mentioned to represent the proposed work in the remaining part of this paper. Various parameters are taken as defined in the Tab. 2. The proposed work performance is compared with the protocols follows dynamic stable routing protocol [25], Ad-hoc on- demand distance vector routing protocol, Destination sequenced distance vector routing protocol, Optimum link stability routing protocol, In LCAPS scheme the SDN Controller takes a decision and different routing protocols are deployed to enhance the performance of the sensor network while taking the specific application requirements of IoT into account. Otherside, the impact of the benchmark scheme has been taken into account that some of the routing protocols are used throughout the simulation time have been shown. Based on the network data extracted from the network statistics and classifications defined in Section 4, the SDN controller dynamically audits the suitability of routing protocols to optimize sensor network efficiency based on cost. Once the routing protocol has been determined the SDN controller assigns it to the network. In the proposed work, It is consider the stability, path delay, energy utilization, and throughput of various weighted network parameters to consider the specific application requirements of the IoT, as shown in the section follows V-A, B, and C.
The information collected in the network is proactive as described in Algorithm 2 and it can also be done reactively, once there is an immediate change in the specific application requirements of IoT. Without waiting for periodic updates, network information collection can be done based on request. Depends on the specific application requirements of IoT and the condition of the network the SDN controller decides on deploying the appropriate routing protocol. Once the decision has been taken the SDN Controller sets it at the sensor nodes of the network. By following the deployed routing protocol the sensor nodes route data in the network. Always a deal exists on fixing the values of a time interval for collecting the network information. If the time interval is high the sensor network collected data could be lost by the SDN Controller. On the other hand control message, overhead arises in the sensor network if the interval is small. Further, by considering the deployment and specific application requirements of the network, while this is an important issue in the approaches based on SDWSN [26]. For the experimental purpose, the time period set here is 15 min. Based on the user's requirements the time can be changed.

IoT Application 1: Concern about Network Throughput (β) and Stability (g)
An IoT application has been taken for which maximization of network throughput and stability is important while considering other factors like path delay and energy. Hence, the values 0.10, 0.40, 0.40, 0.10 are assigned as a load for the coefficients α, β, c, and d respectively Fig. 3 shows the results obtained for stability, path delay, network throughput, and energy utilization in the network. It is seen that LCAPS has more ability to improve the sensor network efficiency compare to the availing methods, i.e., maximization of network throughput and stability of sensor networks.
In view of this case, it is observed that the stability value increases using the scheme proposed. Likewise, the network throughput is too increased as shown in Fig. 3d. In contrast, energy utilization and path delay not improved, the main aim is to increase the network throughput and stability of the sensor network. Hence, the proposed plan increases the sensor network efficiency, depend on the various specific requirements of IoT applications. The total amount also decreased very much using the introduced plan, as shown in Fig. 6b.

IoT Application 2: Concern about Energy Utilization (α) and Path Delay (d)
In this IoT application, energy utilization and path delay are given priority over network throughput and stability. Hence, the value of α, β, c, and d are considered as 0.40, 0.10, 0.10, and 0.40 accordingly. Fig. 4 shows the obtained results for stability, path delay, energy utilization and network throughput in the sensor network.
Like other cases, the introduced SDN controller makes the right decision to provide various routing protocols over multiple time periods. It is seen that LCAPS has more ability to improve the performance of the sensor network among prevailing schemes, i.e., maximization of energy utilization and path delay as shown in the Fig. 4. It is seen that the energy utilization and path delay of the sensor network is decreased by applying the introduced plan. Further, medium results for throughput and stability are obtained. In contrast, throughput and stability are not improved, hence our primary aim is to decrease the energy utilization and path delay of the network. Hence, the proposed plan increases the sensor network efficiency, based on the different specific requirements of IoT applications. Using this proposed scheme the overall cost also decreased very much, as depicted in Fig. 6c. As a result, it is proved that the scheme proposed provoking the availing methods from the perception of various sensor networking parameters like stability, path delay, energy utilization, and network throughput shown in Fig. 4. The Fig. 6c shows the overall cost with varying rates α, β, c, and d in-network as depicted depend on the cost optimization problem discussed in Section 3-C.

IoT Application 3: Concern about Network Throughput (β) and Path Delay (d)
IoT application considered here for which minimization of path delay and maximization of network throughput is important while considering other factors like stability and energy. Hence, the values 0.10, 0.40, 0.10, 0.40 are assigned as a load for the coefficients α, β, c, and d respectively. Fig. 5 shows the results for the desired IoT application requirements. Because of LCAPS, It is seen that the network throughput is increased while some of the available protocols DSR and AODV are not doing so. Another hand, it is nearly equal to the DSDV and OLSR since it is a proactive nature protocol scheme. Moreover, the LCAPS scheme decreases the network path delay when compared to the availed plans, while switching the routing protocols concerning time-based on the specific requirements of IoT application as shown in Fig. 5b. Otherside, energy utilization and stability are medium when deploying the introduced method while compared to the available schemes. Hence, it is proved that the proposed scheme has the capability of deploying the exact routing protocols in the nodes of the sensor network to meet specific application requirements of IoT.   Fig. 6a the experimental values show the total optimization after solving, a load-based approach using Multi-load Function as described in Section 3-C. It is observed that the introduced plan, LCAPS, is having the ability to decrease the cost while comparing it to a constant routing method.
Conversely, if the same RP is involved in the whole simulation process, It is observed that the network efficiency is not improved and it does not adopt the specific requirements of IoT application example, Destination sequenced distance vector routing protocol and optimal link-state routing protocol can be used to increase the network throughput but increases path delay also. Hence, it does not meet the user's needs.
The Optimized cost in percent for the specific requirements of IoT applications are shown in the following Figs. 6a-6c.

Conclusion and Future Work
In this work, a scheme is proposed that deals with low-cost context based switching of routing protocol while considering the parameters stability, path delay, energy utilization, and network throughput in Software-Defined WSN to optimize the performance of the network, mutually various specific application requirements of IoT are taken into account.
Here, we design a flexible SDN controller to take the right decisions by considering the network conditions and the given specific application requirements of IoT. At the SDN controller end supervised learning-regression via classification method is used to take necessary decision. At last, in real-time, the determined routing protocol is set up in the sensor network. The proposed method performance is assessed by various IoT application environments and proved it has the capacity of improving the performance of sensor network while considering the prevailing methods, where a specific routing protocol is assigned throughout the period of time.
It is observed that each sensor node experiences a time delay during the setup of the determined routing protocol. Hence, during the time of the switching stage of routing few data packets are retransmitted unnecessarily and it could be lost, results in reducing the stability of the sensor network. Additionally, mobility of sensor nodes takes much time in reporting the status to the SDN Controller. Hence, the SDN Controller does not have real-time data and changes in the sensor network due to delay in status reporting. This is the major obstacle of an approach based on SDN. There is an idea of implementing the deployment of the routing protocol in nodes of the sensor network by flow-rule method to reduce the switching time as a future extension of this work.
Funding Statement: The authors do not receive any specific funding for this work.

Conflicts of Interest:
The authors declare that they have no conflicts of interest to report regarding the present work.