## 1 Introduction
Unlike the traditionally used shortest-path routing protocols, which are focused on minimizing the end-to-end delay and maximizing the throughput, energy-aware routing protocols are focused on optimizing energy consumption, so that the nodes do not drain their batteries and their lifetime is prolonged [14; 15; 16]. In this sense, they are better suited for managing WSNs within the existent context of IIoT applications supporting Industry 4.0, where energy consumption is critical and can be solved at a minimal delay expense [11; 16]. Figure 1: Industry 4.0 Scenarios. In recent years, SDNs have been successfully deployed in many fields to meet the requirements of the smart industry [17]. Moreover, they have demonstrated promising results regarding energy consumption optimization [18; 19]. Software-defined network architectures separate the control plane (networking logic) from the data plane (routers and switches) to enable parallel processing and centralized control, which improves traditional network programmability, flexibility, scalability, and management [20; 21]. Recent works in [22; 23; 24] have shown that shifting the routing decisions from basic network elements to the SDN controller enables efficiently solving energy consumption issues as well as other important QoS issues, such as end-to-end delay and reliability. In this paper, a SDN-based energy-aware routing protocol is 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. The contributions of the proposed approach are twofold. On one hand, it prevents nodes from draining their batteries, thus preventing their failure, which would abruptly interrupt the transmission. In addition, it avoids the need for replacing the nodes' batteries, which is crucial in the practice since batteries are usually difficult to access and located in remote areas. On the other hand, balancing the energy consumption of all the nodes in the WSN allows the transmission time to last longer. The proposed approach is implemented using the Mininet-Wifi emulator [25], where the SDN architecture, including the network topology, access points, and stations, are simulated. The Ryu controller is used to control the routing path and the traffic flow. The Ryu controller is an open-source SDN framework developed by Nippon Telegraph and Telephone (NTT) cloud data written entirely in Python [26]. The experimental results show that the proposed SDN-based energy-aware routing protocol outperforms the traditionally used baseline shortest-path routing method regarding energy consumption and node failure, doubling its transmission time. The rest of the paper is organized as follows. Sections 2 and 3 present the background and related work, respectively. The proposed SDN-based energy-aware routing protocol is introduced in Section 4. The conducted experiments are presented in Section 5. In particular, the experimental setup and the network topology are described in Sections 5.1 and 5.2, respectively. Section 6 discusses the obtained results in terms of data traffic and energy consumption. Finally, Section 7 provides the concluding remarks and discusses promising directions for future research.