# Centralized Energy Prediction in Wireless Sensor Networks
## 1 Introduction  
Wireless sensor networks (WSN) are formed by interconnected nodes with the capacity of sensing, processing, and communicating. Advances in digital electronics, wireless communication, and microelectromechanical systems (MEMS) have enhanced WSN popularity, a technology currently used in a vast number of applications, such as environmental, industrial and health monitoring, tracking and detection, home automation, and security [1]. WSN is also a key technology in the development of the Internet of Things (IoT) [2]. These networks are resource constrained, typically having low processing power, low storage capacity, limited bandwidth, and limited energy. Those restrictions are important to reduce the cost of hardware production but limit the network flexibility, resource reuse, security, and network lifetime. [PERSON] et al. [3] state that to solve WSN-inherent problems, including energy and computational constraints, a holistic solution is necessary. Previous works propose integrating WSN with Software-Defined Networking (SDN) as a potential solution to the previously mentioned limitations. The SDN approach decouples the control plane from the data plane, centralizing the routing decisions in the SDN controller [4; 5]. The integration of WSN and SDN is referred to in the literature as Software-Defined Wireless Sensor Networks (SDWSN) [6; 7; 8; 9], and results show that SDWSNs perform as well as RPL [9] (IPv6 Routing Protocol for Low-Power and Lossy Networks, RFC 6550). Routing in WSN considers the resource constraints and the performance demands from applications [10; 11]. For example, an energy-aware routing protocol uses energy consumption metrics to extend the network lifetime [12]. In SDN-based networks, the controller is in charge of all routing decisions, and for this reason, it needs information about the network topology and status (i.e., performances metrics), such as energy consumptionmetrics. To understand the importance of this information in the SDN controller, [PERSON] and [PERSON] [12] applied energy-aware route selection to SDWSN. In their proposal, each node reports its remaining energy to the controller every time there is a decrease higher than 1% of the total energy supply. The energy-aware route selection performance was compared to a link quality route selection using the expected transmission count (ETX), a routing metric based on active probing measurements [13]. Their results showed that using the energy-aware route selection increases the network lifetime and reduces the number of route changes. However, this requires that the network devices periodically inform their energy information (i.e., average energy consumption or residual energy) to the SDN controller to maintain the routing metric updated, which increases packets traffic and impacts the network performance. Several authors proposed mechanisms to reduce the transmissions of these packets. Their main objective is to predict future values of a monitored variable to reduce the frequency of transmissions to update the metric value [14; 15; 16; 17]. For example, [PERSON] et al. [16] implemented autoregressive algorithms in an IoT context to predict sensing measurements, with results depicting a reduction in data transmission and energy consumption. [PERSON] et al. [17] compared Markov chain and time series based node energy consumption prediction algorithms in WSN, and obtained a reduction in the number of messages with energy consumption information for both cases. On the other hand, the prediction requires processing and energy resources that are scarce in WSN nodes. In this work, we study the benefits and consequences of moving the prediction execution from every WSN node to one centralized node without resource constraints. For this, we decided to implement our proposal using an SDN architecture. Thus, we can use the SDN controller processing power to predict the energy consumption of every node in the network and its communication structure to share the information between the WSN nodes and the controller.