## 2 Literature Review
It is important to note that the aforementioned study only examines LoRa, and therefore does not model the use of acknowledgments and retransmission which are important mechanisms of the MAC layer defined in LoRaWAN, which is set to be the subject of research in this article. Although some studies show the energy consumption of sensor nodes based on both LoRa and LoRaWAN communication, the presented values are obtained from a data table or empirically [49; 50; 51; 52; 53; 54; 55]. However, the studies in question did not consider an energy model that can thoroughly estimate and optimize the energy consumption of sensor nodes, which is also the subject of research in this article. Considering the results of the research studies provided so far, as well as the aforementioned deficiencies in those studies, in this article a detailed analytical model of energy consumption of sensor nodes and energy cost of data delivery is provided. The model considers the hardware behavior and mechanisms of real LoRaWAN devices, as well as their physical and MAC layer parameters. The proposed energy consumption model is based on Class A, as the most energy-efficient LoRaWAN class. Based on the literature review, it can be concluded that this paper is among the first to specify a detailed analytical model of energy consumption and simulation of the energy cost of data delivery of sensor nodes. It considers both the real hardware behavior of LoRaWAN devices and real-case tests of data packet delivery in different specific fields of LoRa deployment scenarios. While the actual hardware behavior of LoRaWAN devices includes, for instance, their levels of power consumption in different modes of operation, the real-case tests of data packet delivery conducted in different specific LoRa field deployment scenarios enable decision making on whether a packet delivery confirmation is required in a particular application scenario or not. The defined energy model is supplemented by the optimization of LoRaWAN parameters important for the reduction in energy consumption of sensor nodes, such as spreading factor, coding rate, and bandwidth, as well as the generated traffic volume. It is necessary to emphasize that the impact of LoRaWAN parameters such as payload size, acknowledged transmission, coding rate, spreading factor, and communication range on the sensor node consumption is also studied in [15]. In contrast to the analyses in [15], in this paper, special emphasis is placed on the analysis of optimization of energy consumption with regard to packet transmission rate considering different sizes of data packets which are not all very common in commercial devices, as well as energy consumption aspects in different scenarios of LoRa network deployment. Furthermore, unlike the analyses carried out in [52], in which the battery lifespan is calculated without the use of acknowledgments, this paper presents the possibility of using acknowledgments to estimate the lifespan of batteries more precisely. Furthermore, the impact of deficiency of data delivery caused by degradation on the energy performance of LoRaWAN was considered. For actual analysis, the simulated models are derived based on measurements conducted in the real testbeds. The possibility of using acknowledgments or omitting them is also analyzed, based on the results collected by real measurements, in order to select the best case for the optimization of energy consumption. In addition, the models used in this paper also study the impact of collisions on LoRaWAN energy performance. Moreover, unlike the analyses in [53], in which the focus is placed on the optimization of the fixed LoRaWAN setup communication with only a single considered data rate, this paper analyzes the use of different available data rates to select the best method for the optimization of energy consumption. The model considers the possibility of the use of an adaptive data transmission rate, as presented by results of conducted simulations.