Intelligent Energy-Aware Routing Protocol in Mobile IoT Networks Based on SDN

Intelligent devices and equipment have affected almost all aspects of our life and behavior. The type of connection and the manner of communication between this large volume of devices has caused the emergence of a vast field in the Internet called the Internet of Things, which significantly highlights the issue of energy management and increases the lifetime of networks. Complex communications, especially in mobile networks, have generated many challenges for network designers. To solve these challenges, the Software Defined Networking (SDN) paradigm has reduced the overhead in the devices caused by processing and computing by adding new capabilities to mobile IoT networks. This technique transfers energy-consuming tasks to the central controller, which manages continuous topological changes of the network in dynamic environments. This paper presents a new routing approach called Intelligent Energy-aware Routing Protocol in Mobile IoT Networks based on SDN (IERMIoT), which tries to manage the dynamic changes of topology due to the movement of mobile nodes to increase the network’s lifetime and prevent energy dissipation. For this purpose, it defines clusters of nodes and uses an intelligent evolutionary algorithm to determine the number of clusters required in the network and their balanced distribution in the dynamic environment. Also, this approach considers a mechanism to reduce the overhead of control packets and routing packets, which significantly affects the energy consumption of nodes. The simulation results indicate the proposed solution’s effectiveness compared to other simulated approaches with respect to packet delivery rate, average energy consumption, network lifetime, number of alive nodes, coverage, and routing overhead.

Intelligent Energy-Aware Routing Protocol in Mobile IoT Networks Based on SDN Raheleh Samadi , Student Member, IEEE, Amin Nazari , and Jochen Seitz , Member, IEEE Abstract-Intelligent devices and equipment have affected almost all aspects of our life and behavior.The type of connection and the manner of communication between this large volume of devices has caused the emergence of a vast field in the Internet called the Internet of Things, which significantly highlights the issue of energy management and increases the lifetime of networks.Complex communications, especially in mobile networks, have generated many challenges for network designers.To solve these challenges, the Software Defined Networking (SDN) paradigm has reduced the overhead in the devices caused by processing and computing by adding new capabilities to mobile IoT networks.This technique transfers energy-consuming tasks to the central controller, which manages continuous topological changes of the network in dynamic environments.This paper presents a new routing approach called Intelligent Energy-aware Routing Protocol in Mobile IoT Networks based on SDN (IERMIoT), which tries to manage the dynamic changes of topology due to the movement of mobile nodes to increase the network's lifetime and prevent energy dissipation.For this purpose, it defines clusters of nodes and uses an intelligent evolutionary algorithm to determine the number of clusters required in the network and their balanced distribution in the dynamic environment.Also, this approach considers a mechanism to reduce the overhead of control packets and routing packets, which significantly affects the energy consumption of nodes.The simulation results indicate the proposed solution's effectiveness compared to other simulated approaches with respect to packet delivery rate, average energy consumption, network lifetime, number of alive nodes, coverage, and routing overhead.
Index Terms-Software defined networking, evolutionary algorithm, mobile Internet of Things, routing.

I. INTRODUCTION
A S THE Internet of Things (IoT) has moved from a the- oretical" concept to reality, a wide variety of smart IoT devices has become part of our daily lives.Various devices are used to collect and distribute data without human intervention in multiple conditions and environments, from energy systems to industrial automation, healthcare, agriculture, etc.The Internet of Things is regularly associated with technologies such as radio frequency identification (RFID), low-range wireless communications, and network sensors.Low-power Internet of Things networks consists of thousands of sensors that, due to their low cost and ease of deployment, can be implemented in a structured or unstructured way in a dynamic physical environment to manage and monitor the dynamic conditions of the area in various applications.
However, their limitations in processing capability, memory, power consumption, etc., makes deploying these networks very complicated in many aspects, such as routing, energy consumption, reliability, and delay.With the passage of time and the evolution of some characteristics of resource-limited networks, mobility was developed as a new capability in these networks so that in a mobile network, nodes can move freely in the environment, collect information, and communicate with other nodes.But, what is noticeable is the resource limitation that cannot meet the diverse needs of the Internet of Things.Therefore, we need to adopt efficient and effective methods for some challenges, such as scalability, service quality, security, and routing in dynamic topologies [1], [2].
In 2012, the International Engineering Task Force (IETF) presented the RPL routing protocol for low-power and lossy networks (LLN).This protocol reliably and efficiently forms a quasi-forest routing topology over 6LowPAN IPv6 communication technology [3].Nevertheless, with the expansion of applications in dynamic environments, RPL does not seem to meet the needs of mobile IoT networks because it is primarily designed for a static network topology and shows minimal responsiveness to topological changes.Therefore, many efforts have been made to improve this routing protocol or design other protocols to the needs of new Internet of Things applications and consider diverse communication patterns.

A. Software-Defined Networking Architecture
Software-defined networking (SDN) is a networking architecture that continuously and comprehensively monitors the entire network by adding new capabilities to low-power networks and assigns energy-consuming tasks to the controller to reduce the overhead caused by processing and computing in the nodes.
Figure 1 shows a view of the SDN-based architecture as considered for IERMIoT.The data plane consists of static and mobile sensor nodes of the network.This plane communicates with the control plane using the southbound application programming interface.
There are various communication protocols for this southbound API in SDN, among which OpenFlow is the most  Fig. 2. The defined match for a flow entry in the OXM format [6].
well-known protocol, mainly designed for managing LAN and WAN networks consisting of IP routers and Ethernet/MPLS switches and acts as a communication interface between the controller and the switch.Hence, the academic and industrial research communities have undertaken numerous efforts to study and advance SDN architecture, particularly its effectiveness in wireless networks.These activities encompass research and development efforts aimed at enhancing the efficiency of this paradigm [4], [5].Therefore, the proposed approach to achieve addressing implements a solution similar to the idea presented in [6] and exploits the OpenFlow extensible match (OXM), a type length value (TLV) format used to express matches in the flow tables, according to Figure 2. Furthermore, the control plane manages the network and defines and installs rules in flow tables.The most significant purpose of SDN-based networks is to centralize the network's intelligence.
This control plane includes one or more controllers, which can be centralized or distributed as a module embedded in the base station or implemented as an independent module according to the network scale and density of nodes.The controller improves topology control by having a global network view.Additionally, programming the controller's features based on the application's needs increases network performance.The control plane communicates with the application plane through the northbound application programming interface [7].

B. Proposed Approach
Sensor networks are extensively employed technologies that play a crucial role in materializing the concept of the Internet of Things.Their scope is boundless, catering to diverse applications ranging from surveillance, medical and healthcare services to smart cities.However, the predominant use of sensor networks revolves around environmental monitoring and the detection of specific phenomena [8].The suggested approach involves a combination of stationary and mobile nodes working together to gather the targeted data within the designated environment.The IERMIoT approach, relying on the features of the SDN architecture, tries to manage the dynamic changes of topology due to the movement of mobile nodes to increase the network's lifetime and prevent energy dissipation.It is based on subdividing the IoT network into clusters with special cluster heads (CHs) to concentrate the communication flows.For this purpose, considering the target environment and the number of nodes, a single controller is deployed.The controller employs an intelligent evolutionary algorithm to determine the number of clusters needed in the network and their balanced distribution in the dynamic environment.The simulation results indicate the proposed solution's effectiveness compared to other simulated approaches [9], [10], [11], [12] with respect to packet delivery rate, average energy consumption, network lifetime, number of live nodes, coverage, routing overhead and the number of holes to evaluate network coverage.
The main contributions of the article are as follows: 1) Using the SDN architecture to form clusters, discover transmission routes, and manage network topological changes due to the nodes' mobility.2) Implementation of a genetic algorithm to determine the number of clusters required in the network and their balanced distribution.3) Considering parameters such as node centrality, residual energy, and distance as parameters of the objective function in selecting CHs. 4) Defining a loyalty mechanism for mobile nodes to keep cluster stability and avoid repeated clustering.5) Improving the coverage and connection quality using mobile nodes.The rest of the article is organized as follows.Section II provides a literature review of some meta-heuristic algorithms and SDN architecture in low-power Internet of Things networks.The proposed system model is described in Section III.The assumptions of the network and the evaluation of the simulation results of the proposed system are discussed in Section IV, and the conclusions are presented in Section V.

II. RELATED WORK
The implementation of low-power Internet of Things networks with an SDN structure gives the network the opportunity that low-power sensor nodes can only be engaged in collecting environmental data and tasks that have a significant contribution to energy consumption, including routing and data processing, security [13], and quality of service (QoS) [14] are assigned to the controller.
Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.
The authors in [15] use the Harris Hawkes multi-objective metaheuristic (MOHHO) approach in SDN-based wireless sensor networks (WSNs).With criteria such as energy, distance and relative load imbalance, they address the problem of optimal placement of cluster head nodes in the network.However, the nodes in the network are assumed to be static.The approach [16] uses a scheme based on the improved Archimedes optimization algorithm (IAOAC) for clustering and the teaching-learning-based optimization algorithm (TLBO) with distance and energy criteria for multi-hop routing in static wireless sensor networks.Furthermore, EQRSRL [17] develops a reinforcement learning-based routing mechanism that provides a reasonable level of quality of service (QoS) for Internet of Medical Things (IoMT) traffic by classifying network traffic.
A meta-heuristic green routing algorithm in SDN-based wireless sensor networks was presented in [18].The Gray Wolf Optimization (GWO) algorithm is used to improve routing based on the state of the network by considering the average intra-cluster distance, average residual energy, cluster size, and average distance from the cluster heads to the controller.However, it is assumed that the network is static and nodes are homogeneous.The work of [19] uses the Whale Optimization Algorithm (WOA) to detect attacks before they occur in an SDN-based network.This algorithm classifies attacks by clustering the data and allows the controller to check its flow table to identify attacks before sending requests to the data plane.Also, in [10], another approach is presented to create unequal clusters in the network using the whale optimization algorithm.For this purpose, by defining the fitness function, it tries to optimize coverage, energy consumption, and load balancing.
The proposed protocol in [20] uses an SDN architecture to obtain a centralized network view.Then, it implements the particle swarm optimization algorithm on a neural network (NN-PSO) by identifying and classifying traffic to improve the quality of service in underwater IoT applications.To minimize the network delay, the study [21] proposes the Capacited Controller Placement Grey Wolf Optimization (CCPGWO) protocol based on the gray wolf optimization algorithm, which seeks to find the best position for placing controllers in the network.In this regard, the authors in [22] evaluate the optimal number of controllers in large-scale networks and improve the delay and reliability in the network by employing the Salp Swarm Optimization Algorithm (SSOA).
An SDN-based clustering approach is presented in [9].The main idea of this work is to identify the required number of clusters and their balanced distribution in a homogeneous and static environment using a genetic algorithm.Also, the authors use a greedy routing algorithm for data transfer.The study [23] presents a genetic algorithm-based routing protocol for mobile wireless sensor networks (MGAHP).In this work, the authors use the genetic algorithm to find the position of the optimal cluster heads and their number in the network.In continuation of the same work, the authors in [24], by improving the previous work, propose the IMGAHP protocol for MWSNs, which finds the optimal cluster heads by reallocating the TDMA schedule to the mobile nodes that have left the cluster and improves the packet delivery rate and energy consumption in the network.
An energy-efficient routing protocol in WSNs is introduced in [11] to reduce energy consumption during packet transmission.This routing protocol uses the Butterfly Optimization Algorithm (BOA) to select the optimal cluster heads and the Ant Colony Optimization (ACO) algorithm to choose the path from cluster heads to the base station.However, the nodes are assumed to be static.In [12], the authors use the imperial competitive optimization algorithm (ICA) to select the cluster heads and try to balance the load in the cluster heads by defining the standard deviation as a fitness function.
The above works have considered various aspects of lowpower Internet of Things networks and used the concept of SDN architecture to control the complexity and manage the network.However, sufficient attention has not been paid to how the controller is implemented, how it communicates with the nodes to reduce the overhead of control messages and the impact of mobility in dynamic networks, or at least their details are unavailable.

III. PROPOSED SYSTEM MODEL
Routing is considered one of the essential capabilities in low-power networks because communication and data routing contribute significantly to energy consumption.Low-power network protocols, such as routing over low-power and lossy networks (RPL), seem insufficient for mobile networks and emerging IoT applications with diverse communication patterns [25].
Considering the restrictions of low-power IoT networks, energy limitation is considered one of the most essential factors in developing these networks.On the other hand, traditional algorithms are not responsive to mobility and routing locally, and these networks cannot efficiently deal with topological changes and related challenges [26].In the meantime, the SDN paradigm has shown its performance in reducing the complexity of the network by separating the control plane from the data plane and utilizing centralized management.This paradigm brings intelligence to the network and allows the controller to control and manage the overall behavior of the network.Thus, the nodes work as simple data collectors in the environment.They do not spend their energy on routing and assign the task of route discovery and routing policies to the controller [27].The controller is responsible for route discovery, cluster formation, cluster heads (CHs) selection, topology discovery, and control of node behavior.
Therefore, the controller sends topology discovery messages to the nodes to discover and maintain the neighborhood tables.After receiving this message, each node sends a reply message including its ID, the remaining energy, a list of its neighbors, and its node type (fixed or mobile) to the controller.In this way, the controller obtains the network topology.Furthermore, the controller is responsible for developing and maintaining the network topology.After acquiring the global view of the network, the clustering algorithm is implemented in the controller to form clusters and select cluster head nodes.
Since nodes in large-scale networks are randomly scattered in the environment in different numbers and sizes, there is no guarantee of complete network coverage and a balanced distribution of the nodes.Therefore, another challenge of network clustering is the formation of optimal clusters that maintain the balance of intra-and inter-cluster load and energy.In addition, balanced clusters provide network stability and improve network coverage so that the proportional distribution of clusters reduces the energy consumption of CHs in aggregated clusters and provides reliable data transmission.In the proposed paper, the controller creates balanced clusters by executing the genetic algorithm and using its optimization features, which we will discuss in detail in the following sections.

A. An Overview of Genetic Algorithms
Since many of the optimization problems in the real world have large dimensions and complexities, it is incredibly timeconsuming to reach a definitive optimal solution.One of the essential fields of applications of metaheuristic algorithms is optimization problems that maximize or minimize the objective function to find the best solution among possible solutions.In general, metaheuristic algorithms are not limited to a specific problem and are used for a wide range of NP-hard problems [28].Genetic Algorithm (GA) is a family of "computational models" inspired by the concept of evolution.These algorithms encode candidates for the solution of a particular problem in a "chromosome-like" data structure.The hypothesis starts with a completely random and unique population of a number of nodes.Next, the fitness of all population members is evaluated, and the selected nodes are modified through genetic operators (selection, crossover, and mutation) and create the next generation.This operation is repeated until the algorithm converges.
Initial Population: The suggested approach uses an intelligent method instead of random generation to generate the initial population.For this purpose, after collecting the network information, the controller values the initial chromosomes based on the position of the nodes and the number of optimal clusters (k = K opt ), which is obtained from equation [29].
Here, E fs and E mp represent the parameters for energy consumed for transmission in free space and multi-path transmission.E elec refers to the energy consumed per bit of data in the transmitter and receiver circuit.N is the total number of distributed nodes in the network, M is the area of the covered field, d toBS is the average distance between the nodes and the base station, and N alive indicates the number of live nodes in each round.
Therefore, a chromosome is created as a two-dimensional matrix (k × 2).k nodes are randomly selected from among N live nodes, and from the first node to the k th node is used to fill this matrix.The matrix's first row refers to the node's x position, and the second row to its y position.For example, it is assumed that k = 8 and nodes [4,11,26,31,46,55,69, 70] are randomly selected.
Fitness Function: The fitness function is a cost function generated for each optimized feature.The output of the genetic algorithm depends on this function and is repeated regularly in the algorithm.This way, less qualified members are removed from the population, and the most valuable ones are identified.The proposed algorithm simultaneously considers several different criteria for forming clusters.
The fitness function's first parameter is the cluster heads' centrality.This function uses the error square measure according to equation (2).The general goal of this criterion is to minimize the sum of squared errors for a fixed number of clusters in such a way as to guarantee that the cluster heads are located in the center of the cluster.
N is the number of nodes in the environment and k is the number of clusters.Also, C j refers to the center of the cluster and is obtained by minimizing the distance of each member x i from the center of the cluster.
The second parameter is the creation of balanced clusters, for which the number of members of each cluster j (#NE j ) is calculated, and the difference between the largest and smallest cluster is considered the objective function in (3).std determines the standard deviation between cluster members.
The last parameter is to reduce the number of isolated nodes.In other words, the nodes left without membership in the cluster need to send their data to the base station directly or through other cluster heads, which require more energy consumption due to the longer distance.Therefore, the goal of Equation ( 4) is to reduce the number of uncovered nodes in the network.
N uncovered and N alive indicate the number of uncovered nodes and the total number of live nodes in the network, respectively.
In general, the fitness function is performed according to equation ( 5) by combining the above objectives shown in equations (2, 3, and 4): The weight of the coefficient w i (i = 1, 2, 3) is used to show the impact of the objective functions.
Selection Operator: In the roulette wheel mechanism, each of the chromosomes has the probability of being selected depending on its suitability (based on the fitness function).That is, the probability of selecting node i is equal to the fitness value of chromosome i to the sum of the fitness of all chromosomes.In other words, the better a chromosome is, the more likely it is to be selected to produce the next generation.
Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.
Crossover and Mutation Operators: After selecting the chromosomes, new solutions are generated by combining them as parents since the two selected parents had the best fitness values, and the probability of improving the solutions increases.Also, random mutation is performed on the created solutions to avoid getting stuck in the local optimum and to provoke diversity in the population.

B. Selection of Cluster Heads Phase
Due to the existence of mobile nodes in the network, topological changes occur continuously.Thus, forming stable clusters with appropriate cluster heads for data transmission is considered one of the challenges of low-power networks of the Internet of Things.To manage mobility and prevent network failure, the controller, by defining the cost function, reduces the probability of choosing mobile nodes as CH nodes and thus increases the stability of clusters.In the cluster head selection phase, all the members of each cluster are assigned a rank according to equation ( 6), and the node with the lowest rank will be selected as the cluster head.We use the highest residual energy and the lowest distance to the cluster's center for ranking.
where d c i shows the distance of the i th node to the center of the cluster, E i is the node's energy, and ∝ is the penalty coefficient of the mobile node.
To manage mobility and prevent cluster failure, in the second part of the equation, mobile nodes are penalized with a coefficient ∝ so that the probability of choosing a mobile node as a cluster head is lower than that of stationary nodes.Because by choosing the mobile node as the head of the cluster, the possibility of losing intra-cluster communication and data loss increases.

C. Stability and Routing Phase
In this step, the cluster heads send their information to non-cluster nodes.After receiving the information, the nodes connect to the nearest cluster head, and thus clusters are formed.In the stability phase, the nodes sense the environment and send the sensed data to the related CH, and the CHs also send the collected data to the destination.In most studies, the clustering algorithm is executed in each round to select new CHs; however, clustering has a lot of overhead that leads to energy consumption.In this work, the increase in the stability time of the cluster has been taken into consideration, and only in two cases, the clustering phase will be re-executed.First, when the energy of the cluster head node is lower than the considered threshold thr, defined in equation (7), and second when the network topology changes due to the death of nodes or the movement of mobile nodes.
λ and γ are numerical values in [0, 1] and E avg refers to the average energy of cluster member nodes.E std indicates the standard deviation of energy between cluster member nodes.However, with the movement of the nodes, their location has changed and causes the routing tables to be restored, which requires a lot of energy consumption.This paper assumes that mobile nodes use the concept of loyalty to the cluster head.That is, as long as they are in the radio range of the current cluster head, they will not select a new cluster head.In this case, cluster stability lasts longer and fewer messages are exchanged at the cluster and network levels.In the meantime, if the cluster head node does not receive a message from the mobile node after two consecutive rounds, it assumes that the target node has left the cluster.Therefore, it sends a message to the controller to update the changes, and the mobile node connects to the next closest cluster head node by sending a request message.
Another responsibility of the controller is network routing.Since the OpenFlow protocol does not work in limited resource network communication, the nodes' routing tables are designed based on the concepts of OpenFlow.The controller considers the CHs in the form of a graph and determines the communication paths between them based on the radio range.The next hop is calculated based on the amount of energy used to send the packet and an estimate of the energy used to send the packets from the next hop to the base station according to equation (8).Therefore, the neighboring node with the least energy consumption to send the packet is selected as the next hop.
NN refers to the number of neighbors of the i th node.E Tx shows the energy consumption when transmitting data and E Rx is the energy consumed by l−bits while the data is received.E DA used for the energy consumed for data aggregation.EE ntoBS calculates an estimate of the energy consumption of the next step node to the station in equation ( 9).In addition to the next hop node's energy, its distance to the base station is also considered to avoid loops in routing.Therefore, the distance of the next hop to the base station is always less than the distance of the source node to the base station.

IV. EVALUATION OF THE PROPOSED SYSTEM
This section analyzes and evaluates the proposed protocol's effectiveness and performance in various scenarios.In our investigation, we implemented clustering using fundamental meta-heuristic algorithms such as Genetic Algorithm (GA), Particle Swarm Optimization (PSO), and Imperialist Competitive Algorithm (ICA), as well as more recent approaches like Grey Wolf Optimizer (GWO) and Whale Optimization Algorithm (WOA).Figure 3 demonstrates that the GA algorithm, thoroughly discussed in Section III, exhibits  acceptable performance in network stability.Moreover, based on the attained results, we can infer that the IERMIoT approach is suitable for mobile IoT networks, as it effectively manages mobile nodes.This is largely attributed to the loyalty mechanism and control package management, which significantly reduce energy consumption.Furthermore, to explore the impact of node mobility on energy consumption, we implemented the loyalty mechanism for the meta-heuristic algorithms in this study.As depicted in Figure 4, the loyalty mechanism successfully decreases the energy consumption of mobile nodes to an acceptable degree.
Therefore, the genetic algorithm is used to compare the performance of the proposed approach with other protocols, and a thorough assessment of the implementation of the aforementioned meta-heuristic algorithms and their effectiveness will be undertaken in future work.
Since the IERMIoT approach employs the SDN architecture for integrated and centralized network management and a meta-heuristic algorithm to solve the issue, various protocols in this field have been selected for performance comparison.The routing protocol based on the Butterfly Optimization and Ant Colony Optimization Algorithms (BFA-ACO) in [11], the clustering-based protocol using Whale Optimization Algorithm (WOA) of [10] and the Load Balanced Clustering based on Imperialist Competitive Algorithm (ICA) in [12]  were selected, because they were defined for wireless sensor networks to improve energy consumption and network performance in a homogeneous environment, respectively.Also, the GA-SDN protocol in [9] using the SDN architecture and a genetic optimization algorithm in low-power IoT networks is another protocol that we simulated for comparison.Simulations are run on a computer with an 11th Gen Intel(R) Core(TM) i7-11700K, 3.60 GHz, and 16 GB of RAM.The criteria used to evaluate the performance include the following.
• Number of live nodes reveals the number of nodes that have not run out of energy and are able to receive and send packets.• Energy consumption indicates the total energy consumed by the nodes to send and receive the packet.• Network lifetime specifies the time when 75% of the nodes have lost their energy.• Death of the first node shows the time when the energy of the first node runs out.• Coverage refers to the number of areas covered by sensors during the simulation.• Packet delivery rate is defined as the number of packets received by the base station.• Routing overhead is defined as the ratio between the total amount of packets received by the BS to the total number of packets generated.

A. Scenarios
The algorithms mentioned above are evaluated for three scenarios under the same conditions and simulation parameters according to Table I.It is assumed that nodes are randomly scattered in the environment, and a constant bit rate traffic is considered for all algorithms with the same transmission rate.It should be noted that in the proposed protocol, 40% of the nodes in each scenario are mobile.Here, we use the Random Walk movement model, where each node chooses a direction randomly and non-uniformly.Table II     the proposed protocol are compared with other approaches.In addition, the initial parameters of the desired protocols are explained in Table III.

B. Energy Consumption
One of the significant challenges of implementing lowpower Internet of Things networks is the energy issue, so by reducing the energy consumption of nodes, the efficiency and lifetime of the network increase.For this purpose, the ERMIoT and other protocols' average energy consumption is evaluated in all three scenarios.As shown in Figure 5, in the first scenario, the IERMIoT improves the average energy consumption compared to GA-SDN by 15.57%, BFA-ACO by 42.96%, ICA by 35.95%, and WOA by 60.65%, respectively.The results of other scenarios are listed in Table IV.
Since the energy consumption is directly related to the square of the distance, the centrality of the CHs in the clusters reduces the communication distance with the member nodes.Furthermore, this approach employs the routes identified in the routing phase to send control packets.This will reduce the overhead caused by packet transferring.
In contrast, the GA-SDN algorithm performs reclustering locally and collects data in the controller periodically and at certain times to manage the overhead of the control packet.
The approaches ICA and BFA need to collect information on IoT devices in each round, and clustering is done in a centralized manner at the base station.However, they do not consider a mechanism to manage the overhead of control packets.WOA also reduces the overhead of control packets by increasing the stability phase period.
In addition, the IERMIoT approach maintains its compatibility with increasing network size and shows acceptable scalability.While ICA and BFA perform better than WOA in the first scenario, their energy consumption increases significantly with the increase in the network's scale.

C. Network Stability
Increasing network stability is another challenge of lowpower Internet of Things networks, which directly depends on the network's energy consumption.With the death of a part of the nodes, the network loses its coherence and correlation.Various definitions have been provided to evaluate network stability.Some studies consider the death of the first node, and others the death of the last node in the network.In this work, every death of the first node, half of the nodes, and 75% of the nodes are used to evaluate the stability of the network.After the death of 75% of the nodes, the simulation is terminated because the network practically loses its stability.The   IERMIoT tries to maintain the stability of the clusters as much as possible by providing the loyalty mechanism discussed in Section III to prevent the repeated execution of clustering due to the movement of mobile nodes and the changes made in the network topology.
Figure 6 illustrates the stability of the network in different scenarios.The simulation results show the network lifetime in the IERMIoT is much higher than other simulated protocols.

D. Number of Alive Nodes
As the number of live nodes decreases, the network gradually loses its coherence, so some nodes may not be able to transmit collected data to the base station.Figure 7 shows the number of live nodes in each round in the simulated protocols.Based on the results, the IERMIoT shows better performance in each round.In the first scenario, the number of alive nodes in each round improves in the proposed approach compared to GA-SDN by 5.99%, BFA-ACO by 61.15%, ICA by 44.07%, and WOA by 22.86%, respectively.The results of other scenarios are listed in Table IV.Because the energy criterion is considered in clustering and routing, it saves energy at the level of nodes by managing the broadcast of control packets.
Another critical factor that affects energy consumption and network lifetime is the number of uncovered nodes.A node is called uncovered when it is not a cluster member, so it sends data directly to the base station.Considering the distance Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.parameter in direct transmission, uncovered nodes drain their energy faster.

E. Death of the First Node
The death of the first node shows how energy consumption is distributed among the nodes.When different tasks are distributed among the nodes, the energy depletion of the nodes happens later.Figure 8 shows the first dead node criterion for different scenarios.The results show a significant improvement in the proposed approach compared to other methods.The first dead node in each round improves in the IERMIoT in the first scenario, compared to GA-SDN by 6.97%, BFA-ACO by 73.52%, ICA by 31.76%, and WOA by 24.34%, respectively.The results of other scenarios are listed in Table IV.In our suggested protocol, CHs are selected in the controller using the SDN architecture.Likewise, one of the essential criteria for choosing the cluster head in the proposed method is attention to the energy of the cluster head.Therefore, the nodes with more energy are selected as the cluster head.Moreover, the proposed algorithm pays attention to the balance of the clusters in selecting the cluster heads, which balances the energy consumption of the cluster heads.If the clusters are unbalanced, the cluster head with more members will consume a lot of energy.

F. Network Coverage
Coverage is an important quality of service (QoS) criterion in the Internet of Things (IoT) networks.It pertains to the extent to which sensor nodes are able to cover a given environment effectively.Due to the random placement of these nodes, coverage holes can emerge, leading to a decline in network quality.Consequently, a significant question arises: does node mobility have the potential to enhance network coverage?The Delaunay triangulation method [30] determines the average number of holes per second to address this question.Each triangle is explored in this method and if the length of one of the sides is equal to or greater than twice the coverage range, the triangle is considered to have a hole.Equation (10) shows the calculation of the number of holes until 75% of the nodes cease functioning: Where T is the number of all triangles formed in the Delaunay triangulation algorithm, e is the length of the side of the triangle, and Coverage range is the coverage range of the sensor node.Figure 9 illustrates that the IERMoT effectively covered the determined environment by 86.16% in the first scenario, 29.19% in the second scenario, and 29.93% in the third scenario, compared to other protocols, even with the random movement of nodes.This finding suggests that if we can identify the areas using the controller and manage the movement of the nodes intelligently, it may be possible to enhance this criterion further.

G. Packet Delivery Rate (PDR)
PDR can be considered the ratio of data packets the base station successfully receives to the total number of packets sent by the nodes.As shown in Figure 10, the IERMIoT improves the packet delivery rate in the first scenario, compared to GA-SDN by 22.94%, BFA-ACO by 44.17%, ICA by 45.08%, and WOA by 14.24%, respectively.The results of other scenarios are detailed in Table IV.

H. Routing Overhead
Routing overhead specifies how many routing packets are sent for each data packet.The fewer routing packets, the lower the energy consumption and the more stable discovered routes.The simulation results show that the routing overhead in the GA-SDN method is lower than in other approaches.This is due to increased steady-state duration and local clustering.However, due to the longer network lifetime and higher packet delivery rate in the IERMIoT, a significant improvement in this criterion can be seen compared to other simulation protocols.Figure 11 reveals the routing overhead for different scenarios.

V. CONCLUSION
In this paper, we presented a routing strategy that utilizes a software-defined network framework in low-power mobile IoT networks.The IERMoT approach aims to enhance network longevity and to prevent energy wastage through centralized management of mobile nodes.To achieve this, our research includes multiple metaheuristic algorithms (such as GA, PSO, ICA, GWO, and WOA) to determine the optimal number of clusters and their well-balanced distribution in the target environment.Additionally, the proposed approach enhances cluster stability and node connectivity by introducing a loyalty mechanism for mobile nodes within the cluster.The performance of IERMoT was evaluated from various perspectives.The simulation results demonstrate significant improvements in network parameters such as average energy consumption, number of live nodes, network stability, first node death, network coverage, packet delivery rate, and routing overhead.
Since the current work has been simulated in MATLAB, in order to provide more realistic results in future work, we plan to utilize the OMNeT++ simulation framework.By combining machine learning algorithms with the features of SDN architecture, we aim to enhance the intelligence of the network.Additionally, we will examine the impact of mobile node movements on network coverage by considering both random and predefined mobility patterns.

Fig. 1 .
Fig. 1.The general view of IERMIoT based on Software-defined networking.

Fig. 3 .
Fig. 3.The performance of meta-heuristic algorithms in the stability of the proposed approach.

Fig. 4 .
Fig. 4. Average energy consumption in network based on loyalty mechanism.
illustrates different scenarios based on which the performance and efficiency of Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.

TABLE IV IMPROVEMENT
OF VARIOUS PARAMETERS IN THE PROPOSED APPROACH COMPARED TO OTHER PROTOCOLS IN DIFFERENT SCENARIOS