# Modeling the Energy Performance of LoRaWAN
## 4 Modeling LoRaWAN End-Device Current Consumption
### Acknowledged Transmission
As per our measurements, \(I_{\textit{ACK\_TO}}\) has the same value as \(I_{\textit{w1w}}\), whereas \(\textit{ACK\_TIMEOUT}\) is a random variable uniformly distributed between 1 and 3 s. Variables \(I_{\textit{Y}}^{i}\), \(T_{\textit{X}}^{i}\) and \(p_{\textit{X}}\), where \(x\) can be equal to \(A\), \(B\) or \(C\), correspond respectively to the average current consumption, duration, and probability of unsuccessful acknowledged data message transmission events defined as follows: \(A\) is the event whereby the data message suffers a collision, or it does not suffer a collision but it suffers at least one bit error, and it is equivalent in terms of current consumption and duration to the active part (i.e., all states minus sleep) in unacknowledged transmission; \(B\) is the event whereby the data \begin{table}
\begin{tabular}{l l l l l l} \hline \hline \multirow{2}{*}{**State Number**} & \multirow{2}{*}{**Description**} & \multicolumn{2}{l}{**Duration**} & \multicolumn{2}{l}{**Current Consumption**} \\ \cline{3-5}  & & **Variable** & **Value (ms)** & **Variable** & **Value (mA)** \\ \hline
7 & 2 nd receive window & \(T_{\textit{rx2w}}\) & (\(T_{\textit{tx}}\) _min_ in Table 6) & \(I_{\textit{2w}}\) & 38.0 \\
8 & radio off & \(T_{\textit{off}}\) & 337.8 & \(I_{\textit{off}}\) & 13.4 \\ \hline \hline \end{tabular}
\end{table} 
Table 8: States, variables and their values for LoRaWAN acknowledged transmission when the acknowledgment is sent in the second receive window. message is successfully received, but the acknowledgment, sent in the first receive window, suffers at least one bit error; and \(C\) is the event whereby the data message is successfully received, but the acknowledgment sent in the second receive window, suffers at least one bit error (note that errors in downlink messages can be detected by means of the MIC field). Events \(B\) and \(C\) are equivalent in terms of current consumption and duration to the active part of successful acknowledged transmission with the acknowledgment in the first and in the second window, respectively. Probabilities \(p_{A}\), \(p_{B}\) and \(p_{C}\) are determined in Equations (20)-(22). Let \(I_{Data}\) and \(I_{Ack}\) denote the total size of the data and acknowledgment messages, respectively. Probabilities \(p_{A}\), \(p_{B}\) and \(p_{C}\) can then be obtained as follows:  
\[p_{A}=p_{coll}+(1-p_{coll})\cdot(1-(1-b)^{I_{Data}}) \tag{21}\]  
\[p_{B}=p_{1 win}\cdot(1-p_{A})\cdot(1-(1-b)^{I_{Ack}})=0.5\cdot(1-p_{A})\cdot \left(1-(1-b)^{I_{Ack}}\right) \tag{22}\]  
\[p_{C}=p_{2 win}\cdot(1-p_{A})\cdot(1-(1-b)^{I_{Ack}})=0.5\cdot(1-p_{A})\cdot(1- (1-b)^{I_{Ack}}) \tag{23}\]  
We next determine \(p_{k}\). To this end, we first derive the probability that an end-device will send an acknowledged message without performing any retransmissions, \(p_{0}\). Then, \(p_{0}\) can be computed as the probability that the data message will not suffer collisions, and neither the data message nor the acknowledgment will suffer errors:  
\[p_{0}=(1-b)^{I_{Data}}\cdot(1-b)^{I_{Ack}}\cdot(1-p_{coll}) \tag{24}\]  
Based on \(p_{0}\), \(p_{k}\) can be found as the probability that only both message and acknowledgment transmissions that correspond to the \(k\)-th message retransmission are successful, as follows:  
\[p_{k}=(1-p_{0})^{k}\cdot p_{0} \tag{25}\]  
Note that as per Equation (24), when the end-device reaches the maximum number of retransmissions, if the last data message retransmission is not successful, the corresponding current consumption is not added to \(I_{act}\) computation in Equation (19). Nevertheless, impact of this inaccuracy is negligible for \(MAX\_RETR=7\) and for practical BER values (e.g., up to \(10^{-3}\)). Therefore, we opt to favor simplicity in our model.