# Centralized Energy Prediction in Wireless Sensor Networks
## 5 Experiments and Results
### Prediction Mechanisms Performance Evaluation  
The energy consumption prediction proposal performance was evaluated from simulations using COOJA [44] and emulating sky motes, which is a TelosB equivalent available in COOJA simulator. We also executed experiments running the prediction algorithm in the WSN nodes, such as proposed by [PERSON] et al. [18], which for the best of our knowledge, it is the most recent work about energy consumption prediction using Markov chain in SDWSN. Both approaches were simulated using multihop grid topologies from 16 nodes to 81 nodes, including one controller node and one sink node. We also simulated the scenario without prediction to use it as a baseline. In this case, all WSN nodes send their energy consumption to the SDN controller every 60 s. In parallel, we run a temperature monitoring application where every node sends a temperature sample (2 bytes message) every 60 s as well. Furthermore, all nodes wait 60 s plus a random value between 0 and 60 s before initializing the prediction algorithm and the temperature application. We use the random value to prevent all nodes from transmitting energy and temperature packets at the same time, which would create packets collisions. The metrics to evaluate the energy consumption prediction proposals include prediction performance and network performance metrics. These metrics are prediction accuracy, total delay, total delivery rate, packets overhead, and energy consumption. The total delay is the average time the packets spent to reach the destination. The prediction accuracy is evaluated in two ways: prediction error and valid predictions rate. The prediction error is the average error of all the predictions during the test. The valid predictions rate is the number of predictions with an error lower than 5% divided by the total predictions performed. We chose 5% based on the average estimation error we obtained using our energy consumption model (Section 5.1). The total delivery rate is calculated by dividing the number of packets successfully received by the number of packets sent. The packets overhead is quantified as the number of packets per minute. The energy consumption is the average energy consumption per minute of all nodes, excluding the sink node and the controller node. The total delay, total delivery, and overhead metrics are classified by type of packet. Control packets are those related to the IT-SDN control plane, data packets are the application packets sent to the sink, and energy packets are the packets related to the prediction mechanisms and energy information. The graphics in this section show the average results calculated among replications. Table 3 shows the abbreviations used for each scheme, and Tables 4 and 5 summarize the simulation and energy consumption parameters, respectively. Figure 3: Connection diagrams for (**a**) energy consumption measurement using the N6705C of Keysight and (**b**) the SDN controller and TelosB gateway. Table 6 represents the cost per transitions in microjoules, i.e., matrix \(B\) in Equation (3). The cases with cost zero are transitions that never occurred or that we were not able to measure with our equipment. Last, according to our tests, the initial state is always Processing. Thus, the initial vector \(X_{0}=[0\;\;1\;\;0\;\;0\;\;0]\).