## 7 Conclusions and Future Work  
The IIoT is a key enabler of Industry 4.0 and produces a massive amount of data for the manufacturing process that is usually managed by WSNs. Nevertheless, with the continuous improvement of the smart industry, WSNs that rely on a number of nodes with small batteries have been led to their boundaries. Traditionally, network management strategies such as the baseline shortest-path routing protocol have paid little to no attention to energy consumption issues. However, transmitting huge amounts of data through WSNs can exhaust their nodes, thus abruptly interrupting the transmission and losing time, information, and money. In this scenario, the development of energy-based management strategies for reducing the energy consumption of WSNs is urgent.  
In this paper, an SDN-based energy-aware routing protocol has been proposed to optimize the power consumption of WSNs within the framework of IIoT to support Industry 4.0. In the proposed approach, the SDN controller estimates the energy level of critical nodes in the WSN and decides the best routing path based on their energy consumption rather than on the shortest-path criterion. In this way, the energy consumption of all the nodes in the WSN is balanced since the critical nodes are used only when their energy level is high and preserved when their energy level is low.  
Experimental results, obtained via a Mininet-Wifi simulation, have shown that the proposed SDN-based energy-aware routing protocol efficiently distributes the data packets among the nodes at different time intervals based on the SDN controller's decision, and thus reduces the energy consumption of the WSN. In particular, it has been possible to prevent WSNs' nodes from draining their batteries and abruptly interrupting the data  
Figure 12: End-to-End Delay of Transmitted Bytes From Access Point 1 to Access Point 4.  
transmission. This saves valuable retransmission time, prevents potential information loss, avoids the need for replacing the nodes' batteries, which are difficult to access, and makes the transmission time last longer. Finally, the proposed approach outperforms the traditionally used baseline shortest-path routing method in terms of energy consumption and node failure in addition to doubling its transmission time.  
As future work, we plan to apply the developed SDN-based energy-aware routing protocol in different scenarios.The topology limitation constrains the SDN-based energy-aware routing protocol in future scenarios, where nodes could not connect to other nodes in the network except through the low battery node due to the vast distance. In particular, we intend to implement it within the environment of mobile nodes with a restricted-energy source. In addition, using AI strategies to improve the performance of the proposed approach is also a promising future research direction.  
[PERSON] performed the experiments, analyzed the data, and wrote the paper. [PERSON] supervised the research and critically revised the paper. All authors have read and agreed to the published version of the manuscript.  
The authors extend their appreciation to the Deanship of Scientific Research at King Saud University for funding this work through research group No. (RG-1441-512).  
The authors thank the Deanship of Scientific Research and RSSU at King Saud University for their technical support.  
The authors declare no conflict of interest.