## 3 Proposed Algorithmic Approach  
This section describes the algorithm implemented in the sensor nodes for information transfer between the controller and the nodes using the protocol IEEE 802.15.4. The nodes send the information to the controller, and the controller calculates the optimal topology of the best route for each node and sends the default route or default node to each sensor node. The relay nodes with the most energy in the batteries and the shortest distance between relay nodes are considered to select the best route. Nodes store their battery level, along with the identifiers of neighboring nodes and the corresponding received signal levels. This information is transmitted to the controller for algorithm execution. The network diagram used to perform performance tests of the algorithms is shown in Figure 1. The prototype is minimally feasible regarding the number of nodes, but it facilitates algorithm testing, assuming that node identifiers are pre-assigned and tested in controlled scenarios. The network consists of eight ATZB256 RFR2 wireless nodes, separated from each other by a distance of 15 cm. These nodes will be assigned the default route generated in the application. The absence of implemented link layer neighbor discovery protocols and network layer routing protocols in the nodes prevents them from determining nodes within their coverage area and identifying the controlling node \begin{table}
\begin{tabular}{p{56.9 pt} p{56.9 pt} p{56.9 pt} p{56.9 pt} p{56.9 pt} p{56.9 pt} p{56.9 pt} p{56.9 pt}} \hline \hline
**Ref** & **Year** & **Description** & \begin{tabular}{c} **Network Layer** \\ **Protocol** \\ \end{tabular} & \begin{tabular}{c} **Link Layer** \\ **Protocol** \\ \end{tabular} & \
\begin{tabular}{c} **Hardware/Bits** \\ **Simulation** \\ \end{tabular} &
\begin{tabular}{c} **Simulation** \\ **Algorithm** \\ \end{tabular} \\ \hline
[26] & 2016 &
\begin{tabular}{c} Energy- \\ efficient \\ routing \\ algorithm for \\ SDWSNs \\ \end{tabular} & Not reported & Not reported & No implemented & Yes & NWPSO \\ \hline
[27] & 2017 & \(\mu\)-SDN & 6 LowPAN & 802.15.4 & ARM920T/32 & Implementation & AODV, LQRP routing protocols \\ \hline
[28] & 2018 & \
\begin{tabular}{c} Software- \\ defined energy \\ aware routing \\ SD-EAR \\ \end{tabular} & Not reported & Not reported & No implemented & Yes &
\begin{tabular}{c} based on sleep \\ request—sleep \\ grant \\ mechanism \\ \end{tabular} \\ \hline
[29] & 2018 &
\begin{tabular}{c} SDWSN- \\ architecture \\ \end{tabular} & Not reported & Not reported & No implemented & Yes & Dijkstra \\ \hline
[25] & 2019 &
\begin{tabular}{c} Clustering \\ Routing based \\ on Dijkstra \\ algorithm for \\ WSNs \\ \end{tabular} & Not reported & Not reported & No implemented & Yes & [PERSON] \\ \hline
[21] & 2021 &
\begin{tabular}{c} Kruskal-based \\ SDWSN \\ \end{tabular} & Not reported & Not reported & No implemented & Yes & [PERSON] \\ \hline
\begin{tabular}{c} [PERSON], \\ [PERSON] \\ \end{tabular} \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Summary of routing works in SDWSN. for direct transmission. Consequently, test scenarios can be created where intermediate nodes relay data, forming a multi-hop network. The communication between nodes is defined by software, enabling emulation of scenarios without communication due to being out of coverage zones. This setup facilitates nodes within the sniffer's coverage area to capture frames from all nodes, assessing the algorithm's performance. The nodes are exclusively programmed for operation with the 802.15.4 protocol, with libraries enabling direct frame manipulation. Before algorithm testing, nodes are set up in a predetermined multi-hop topology, programmed to communicate with predefined nodes exclusively. The default route is established, ensuring nodes know the designated relay node for initial data transmission to the controller node. Subsequently, the controller dispatches frames to nodes, enabling each to store reception intensity levels from previously designated neighboring nodes.