# Wireless Sensor Network Energy Model and Its Use in the Optimization of Routing Protocols
## 3 Analysis and Results under the Simulation Tool
### Experimental Scenario
It obtains all the transmitted data through the LoRa protocol; data are then transmitted via WiFi allowing them to be found on the ThethingsNetwork platform. In this platform, it is possible to display the data separately from each node, knowing when the last transmission was made, the frequency of transmission of each device, and its measurements. This device obtains all the data transmitted by the Zigbee coordinator, all the data transmitted by the LoRa nodes, and also the data transmitted by the Bluetooth concentrator. For Bluetooth nodes, Wireless Personal Area Networks (WPAN) is an industrial specification operating on the frequency of 2.4 GHz as well as Zigbee. There are Bluetooth nodes that work as beacons (low power consumption devices that emit a broadcast signal). In this case, each node has a light sensor and they are constantly sending light values. In addition, there is a fifth device, which works as beacon scanner. The function of this device is to receive all the data coming from the other nodes, decode them, and send them through LoRa using another module that contains that protocol. Figure 16 describes the devices used for the real scenario according to the wireless technologies mentioned above. A communications sniffer was also used in addition to the application interface www.thethingsnetwork.org. In the middle of the figure, two devices act as coordinating nodes. The distribution of the nodes in real space is shown in Figure 17 where we have an area of approximately 300 m \(\times\) 300 m that is displayed in Figure 14. We show an approximate radius of coverage of the sensors of 40 m. However, it can vary according to the antenna. Empirically it can be smaller by the amount of collisions according to wireless technology. Figure 16: Devices used for the experimental validation [40]. Figure 18 shows an example of the plot of the packets with some wireless technology, in this case, LoRa. The package and console display interface is www.thethingsnetwork.org, which allows us to observe the quality parameters of links, frequencies, lost packets, etc. Thanks to this analysis and the energy model, we can sharpen the precision of the model and further refine the types of energy to detect possible inefficient expenses of actions in the network nodes. Table 6 shows three useful performance metrics for analyzing the behavior of a network. The results for three different types of protocol are described: reagent (AODV), hybrid (MPH), and proactive (ZTR). The overall performance is better in the MPH protocol because it has route redundancy yet, it does not have so many routes to generate too much overhead and network collisions. We also  
Figure 17: Distribution of nodes in the test space. Figure 18: Example of frame for performance metrics. note that the simulator has the ability to accurately reproduce (approximately 2% difference) the real scenario under the specific conditions on each node according to the wireless technology used. In this way, different routing protocol rules suitable for coexisting networks in a wireless medium can be tested and energy optimization models can be generated according to the technology used and the target application. This makes the simulator an effective tool in predicting packet routing and power consumption models. Using this simple energy model, we can implement energy saving techniques in some of the activities carried out by the nodes and we are capable of quantifying their impact on the total expenditure. For Figure 19, we implemented the MPH protocol in order to contrast the energy expenditure of each type of energy in the model under both stable and adverse conditions. For the four different wireless technologies, the rules of the MPH hybrid protocol were used. We observed that when there were adverse conditions such as shutting down, 15% of the nodes were turned off for 10 min every two hours, implying that the energies that have the greatest consumption impact are: CSMA energy, transmission energy, and receiving energy, increasing their value approximately by 40%.