## 5 Conclusions  
In conclusion, this paper addresses the challenges associated with applying software-defined networking (SDN) technology to wireless sensor networks (WSNs) with nodes operating on limited computing capabilities and battery power.  
Minimizing energy consumption, arising from processing at the network layer and delays in routing algorithm execution at nodes, necessitates the adoption of SDN technology in WSNs. Our proposal uses the concept of SDN, but for transmitting information between the controller and the sensor nodes, the IEEE 802.15.4 protocol is used instead of the network protocols used in WSNs. The controller assesses the WSN network to determine the optimal topology, considering both the battery and signal levels upon frame reception to designate the relay node. The received signal level is linked to transmission errors caused by channel noise and the distance at the time of transmission power. To validate our  
Figure 24: Comparing the number of hops without using algorithms, the Kruskal algorithm, and the Dijkstra algorithm. (**a**) Test 1: Number of hops to reach the controller with nodes having similar battery levels. (**b**) Test 2: Number of hops to reach the controller with nodes three and four having higher battery levels. (**c**) Test 3: Number of hops to reach the controller with nodes seven and eight having higher battery levels. (**d**) Comparison of hops in each test performed.  
proposal, we implemented a prototype built for this purpose and the Dijkstra and Kruskal algorithm to determine the most optimal topology for the network.  
Algorithms are presented so that the nodes can send their information to the gateway and so that the gateway sends the information to the WSN nodes operating with IEEE 802.15.4. With the results obtained, the advantage of using a controller for determining the network topology has been demonstrated, eliminating the implementation of a routing algorithm in the nodes. Using the link protocol instead of routing protocols has been validated, thereby reducing processing and transmission delays in the data. The results obtained allow us to continue developing an architecture for SDWSN.  
The key features of this work include the utilization of an SDN-enabled controller to reduce processing delays, the incorporation of node battery levels and distance considerations in route selection, the adoption of the IEEE 802.15.4 protocol for data transport, and the proposal of an SDWSN architecture without network-level protocols.  
Conceptualization, C.E.A., L.C. and C.T.; methodology, C.E.A., L.C., C.T. and J.C.-R.; software, C.E.A. and L.C.; validation, C.E.A., L.C., C.T. and J.C.-R.; formal analysis, C.E.A., L.C., C.T. and J.C.-R.; investigation, C.E.A., L.C., C.T. and J.C.-R.; resources, C.E.A., C.T. and J.C.-R.; data curation, C.E.A., L.C. and C.T.; writing--original draft preparation, C.E.A., L.C., C.T. and J.C.-R.; writing--review and editing, C.E.A., L.C., C.T. and J.C.-R.; visualization, C.E.A., L.C., C.T. and J.C.-R.; supervision, C.E.A., L.C., C.T. and J.C.-R.; project administration, C.E.A. and C.T.; funding acquisition, C.E.A. and C.T. All authors have read and agreed to the published version of the manuscript.  
Escuela Politecnica Nacional has supported this work through project PIIF-21-04.  
Not applicable.  
Data availability Statement: Data are contained within the article.