## 2 Methods/Experimental Approach
### Power Consumption Model
#### 2.1.1 The Processing Energy Consumption  
During the execution of its task, the processor operates in general either in the active, sleep or idle state, and dissipates different amounts of energy in each of them. Its energy dissipation can be modeled at two levels namely:  
1. During a specific operational state: data processing state (active), idle mode and even sleep mode. 2. During state transition time. Determining the energy consumption at the processor's level is not a deterministic experiment but a stochastic one. The process depends on multiple aspects especially the randomness of the duration quantity which itself is due to the random nature of the type of physical phenomena and events for which the NB-IoT is deployed. A typical example is a scenario in which the NB-IoT nodes are deployed within a water distribution system for leakage detection as in [17]. In such a scenario, there is no certainty on when and where exactly a water leakage occurs. Part of the major sources of uncertainty of the energy consumption of IoT networks includes the uncertainty of time duration in each of its three power modes and the uncertainty of the number of transitions between the different power modes. During its operation, the Central Processing Unit (CPU) of the NB-IoT node goes through different power mode states. The total energy consumption (\(E_{DS}\)) of the NB-IoT node's CPU during \(n\) active, \(m\) sleep and \(l\) idle states can be modeled as  
\[E_{DS}=\sum_{k=1}^{n}P_{A}T_{A}(k)+\sum_{k=1}^{m}P_{S}T_{S}(k)+\sum_{k=1}^{l}P _{I}T_{I}(k) \tag{3}\]  
where \(P_{A},P_{S}\) and \(P_{I}\) are the powers consumed by the CPU in each of the three modes (Active, Sleep and Idle) respectively, and \(T_{A}(k),T_{S}(k)\) and \(T_{I}(k)\) are the randomly varying times of the CPU for each of the different power modes. The power values are computed from the current consumption of each mode and the nominal operating battery voltage. In general, the processor's operation in a NB-IoT node goes through five possible state transitions which include the transitions from _Active to Idle_, _Idle to Active_, _Active to Sleep_, _Sleep to Active_ and _Idle to Sleep_. In addition to the total energy consumption \(E_{DS}\) during the operation of the CPU in the different states, the energy consumed during the above mentioned five possible transition states, referred to as \(E_{ST}\), can be modeled as  
\[E_{ST}=\sum_{k=1}^{n}F_{TR}(k)T_{TR}(k)\frac{(P_{IS}(k)+P_{FS}(k))}{2} \tag{4}\]  
where \(F_{TR}(k)\) is the frequency of occurrence of a power state transition as modelled for the different operations (initialization, transmission, information relay, reception, etc.) of the NB-IoT node, \(T_{TR}(k)\) is the duration of a state transition \(k\), and \(P_{IS}(k)\)and \(P_{FS}(k)\) are the power consumption in the initial and final states respectively. Equation (4) describes the total energy consumed by a NB-IoT node CPU during its multiple transitions (n transitions) from one of its five operating states (e.g., Active state) to another state (e.g., Sleep state). The energy consumed during state transitions is modelled as thesum of all individual energy consumption if all \(n\) state transitions as undergone by the node during its operation period. Each of these \(n\) energy consumption is modelled to be directly proportional to the frequency of occurrence of that particular state transition within the operation duration of the node (\(F_{TR}(k)\)), also directly proportional to the duration of the particular state transition under consideration (\(T_{TR}(k)\)). The product of \(F_{TR}(k)\) and \(T_{TR}(k)\) brings in the time aspect of the electrical energy formula. As it is known, electrical energy is the product of power and duration, the second part of the formula is the average power consumed by the state transition and is calculated as the numerical average of power consumption during the initial state (\(P_{IS}(k)\)) and the final state to which we transit (\(P_{FS}(k)\)).