## 3 Proposed Algorithmic Approach
### Operation of the Route Generator Application within the Network Prototype  
When the application runs on the computer and the controller node is connected via the USB serial interface, sending a test frame using the \"Send\" button is possible. This frame will be visible from the sniffer application. After sending the frame, a list will be displayed, allowing the application to view the data received through the controller, as shown in Figure 5. If the above steps have been completed, it can be assumed that the controller is connected correctly. If the controller is connected correctly and can receive information from other nodes, it is already possible to send information from any node via its send button. Through the application's reception controls, select the device from which you want to receive data, which in this case is a node. The application will wait until it receives the frame with the requested information. The information sent can be verified through the sniffer. After transmitting the initial frame, the nodes retransmit it throughout the network and store the information about the energy and signal levels in memory. The stored information must be sent to the application through the push button of each node once a Dijkstra or Kruskal algorithm needs to be executed. The information received (neighbor table) is displayed in the application, where the address of the node containing the information (ID_S), the battery level (NB), and the signal quality (NS) of the nodes within range, together with their respective address (ID_S_NS), can be observed. Once the application has received all the information sent by the nodes and the controller, processing needs to be performed using the \"Process\" button to evaluate if the stored information is adequate to run the algorithms. All the above is shown in Figure 6a. Figure 4: SmartRF packet sniffer application. Figure 5: Application operation. Figure 6: _Cont._  
Once the processing is complete, the application will generate the edges using the directions and weights derived from the battery level and signal quality information. The total number of nodes and edges generated during processing will be displayed in the application. In addition, selecting the algorithm to be executed will be allowed. After selecting the desired algorithm, new routes will be generated and displayed on an additional screen, as shown in Figure (b)b. It will be possible to send these new routes to each node through a broadcast transmission from this window. Through the application and the controller, frames containing an End Destination Identifier (ID_DF), a Default Identifier (ID_DEFAULT), and a Frame Identifier (ID_FRAME) will be sent. The nodes will verify the Final Destination Identifier and modify the node's destination address to the Default Identifier if it matches the node's source address. Otherwise, they will retransmit the information if they have not previously stored the identifier of the received frame. The decision of knowing how far or close the node is at present is based on the reception power of the frame that arrives at the node. The controller, with the information about the neighbors of each node, executes the routing algorithms to define the network's topology, determine the best route, and define the default node for each sensor node. From the best routes found, each node is sent the identifier of the destination node to which it must send the frames so that they reach the gateway and, thus, the controller. The proposed algorithm to operate in multihop networks that use the IEEE 802.15.4 protocol considers the following scenario:  
* Sensor nodes are fixed. Figure 6: Receiving and sending information within the network prototype. * There are several nodes within the coverage area of each node. * Topology changes occur by adding or removing a node in the network. * The nodes are configured to operate in non-slotted mode with the IEEE 802.15.4 standard (FFD) and do not utilize network-layer protocols or operating systems.