# Modeling the Energy Performance of LoRaWAN
## 4 Modeling LoRaWAN End-Device Current Consumption
### Acknowledged Transmission
Figure 7: Current consumption profile of a MultiConnect mDot LoRaWAN end-device performing an acknowledged transmission: (**a**) with DR0 (left), (**b**) with DR5 (right). In the former, the acknowledgment is received by the end-device in the second window, whereas in the latter the acknowledgment is received in the first window. The data message transmitted by the end-device has a FRM Payload size of 51 bytes (left) and 242 bytes (right), respectively. In order to compute \(I_{\textit{avg\_ACK\_2}}\), we take into account that behavior of the end-device is similar to that in unacknowledged transmission, since states involved in the corresponding transmission operations are the same, and only two differences can be observed: duration of the second window (\(T_{2\textit{w}}\)) and of the subsequent radio off interval (\(T_{\textit{off}}\)) are both larger than in the unacknowledged transmission. In fact, the end-device needs to stay in the second receive window for the time needed to receive the acknowledgment, and subsequent operations involve processing of the ACK. Therefore, \(I_{\textit{avg\_ACK\_2}}\) can be obtained by means of the same equations used to compute \(I_{\textit{avg\_unACK}}\) (i.e., Equations (1)-(11)), but using the \(T_{2\textit{w}}\) and \(T_{\textit{off}}\) values that correspond to acknowledged transmission when an acknowledgment is sent in the second receive window (Table 8). We next extend the model to compute \(I_{\textit{avg\_ACK}}\) for non-zero BER. We assume that bit errors are uncorrelated. Let \(I_{k}\) denote the average current consumed by the end-device when it performs \(k\) retransmissions (the last one being successfully acknowledged), since the start of the procedures for the first transmission attempt, until the end of the procedures for the \(k\)-th retransmission. Let \(I_{\textit{act}}\) be the average current consumption due to activities related with transmitting a data message (including retransmissions), i.e., all states except the sleep interval. \(I_{\textit{act}}\) can be computed as:  
\[I_{\textit{act}}=\sum_{k=0}^{MAX\_RETR}E[I_{k}]\cdot p_{k} \tag{19}\]  
where \(E[I_{k}]\) denotes the expected current consumption of an end-device when it has performed \(k\) data message retransmissions, \(p_{k}\) indicates the probability that the end-device performs \(k\) retransmissions of a message, and \(MAX\_RETR\) denotes the maximum number of message retransmissions by an end-device. The latter is recommended as per the LoRaWAN specification to be set to 7. \(E[I_{k}]\) can be obtained by using the next equation:  
\[E[I_{k}]=\frac{I_{\textit{OK}}^{k}\cdot T_{\textit{OK}}^{k}+\sum \limits_{i=0}^{k}\left(I_{\textit{ACK\_TO}}\cdot(T_{\textit{ACK\_TO}}-T_{ \textit{rx2w}}^{i})+\ \frac{I_{\textit{A}}^{i}\cdot T_{\textit{A}}^{i}\cdot P_{\textit{A}}+I_{ \textit{B}}^{i}\cdot T_{\textit{B}}^{i}\cdot P_{\textit{B}}+I_{\textit{C}}^{ i}\cdot T_{\textit{C}}^{i}\cdot P_{\textit{C}}}{P_{\textit{A}}+P_{\textit{B}}+P_{ \textit{C}}}\right)}{T_{\textit{OK}}^{k}+\sum\limits_{i=1}^{k}\left(\left(T_{ \textit{ACK\_TO}}-T_{\textit{rx2w}}^{i}\right)+\frac{T_{\textit{A}}^{i}\cdot P _{\textit{A}}+T_{\textit{B}}^{i}\cdot P_{\textit{B}}+T_{\textit{C}}^{i}\cdot P _{\textit{C}}}{P_{\textit{A}}+P_{\textit{B}}+P_{\textit{C}}}\right)} \tag{20}\]  
In the previous equation, \(I_{\textit{OK}}^{i}\) and \(T_{\textit{OK}}^{i}\) denote the average current consumption and average duration of the activities related with an \(i\)-th acknowledged data transmission attempt which is error-free, and can be computed by using (15) and Tables 6-8. On the other hand, \(I_{\textit{ACK\_TO}}\) and \(T_{\textit{ACK\_TO}}\) correspond to the current consumption and the average duration of the \(\textit{ACK\_TIMEOUT}\) interval, respectively.