## 3 Delay and Energy Consumption Analysis
### Energy Consumption Analysis
#### 3.3.2 End-Devices  
Regarding end-devices, for each FSA protocol variant we define \(\overline{E}_{devices}^{\text{FSA-FBP}}\), \(\overline{E}_{devices}^{\text{FSA-ACK}}\) and \(\overline{E}_{devices}^{\text{DFSA}}\) respectively, which can be expressed as  
\[\overline{E}_{devices}^{\text{FSA-FBP}}=\sum_{j=0}^{n-1}n_{0j} \big{(}(n-j)E_{data}^{\text{FSA-FBP}}+jE_{sleep}^{\text{FSA-FBP}}\big{)}, \tag{16}\]  
\[\overline{E}_{devices}^{\text{FSA-ACK}}=\sum_{j=0}^{n-1}n_{0j} \big{(}(n-j)E_{data}^{\text{FSA-ACK}}+jE_{sleep}^{\text{FSA-ACK}}\big{)}, \tag{17}\]  
\[\overline{E}_{devices}^{\text{DFSA}}=\sum_{j=0}^{n-1}n_{0j}\big{(}(n-j)E_{data }^{\text{DFSA}}+jE_{sleep}^{\text{DFSA}}(j)\big{)}, \tag{18}\]where \(j\) represents the number of end-devices that have succeeded in a given point in time, \(n_{0j}\) represents the average number of frames for which the process remains with \(j\) end-devices with success, and \(n-j\) is the number of end-devices that have not succeeded yet.  
For all FSA protocol variants, we can also define \(E_{data}^{\text{FSA-FBP}}\), \(E_{data}^{\text{FSA-ACK}}\) and \(E_{data}^{\text{DFSA}}\) as the energy consumed by an end-device in a frame where it transmits its data packet, and \(E_{sleep}^{\text{FSA-FBP}}\), \(E_{sleep}^{\text{FSA-ACK}}\) and \(E_{sleep}^{\text{DFSA}}(j)\) as the energy consumed by an end-device in a frame where it sleeps.  
In FSA-FBP, an end-device that has not yet succeeded to transmit its data packet performs the following tasks in every frame: randomly selects a slot in the \(m\) slots of the frame to transmit its data packet, sleeps for the other \(m-1\) slots of the frame, keeps in idle state for two IFS, and receives a FBP. Therefore, the value of \(E_{data}^{\text{FSA-FBP}}\) can be obtained as  
\[E_{data}^{\text{FSA-FBP}} =\rho_{tx}T_{data}+\left(m-1\right)\rho_{sleep}T_{data}+2\rho_{ \sigma}T_{IFS}+\rho_{rx}T_{FBP}^{\text{FSA-FBP}}. \tag{19}\]  
In contrast, for FSA-ACK and DFSA, an end-device that has not yet succeeded to transmit its data packet performs the following tasks in every frame: randomly selects one slot the \(m\) slots of the frame to transmit its data packet, receives an ACK packet, sleeps for the remaining \(m-1\) slots of the frame, keeps in idle state for two IFS, and receives the FBP. Therefore, the \(E_{data}^{\text{FSA-ACK}}\) and \(E_{data}^{\text{DFSA}}(j)\) values can be obtained as  
\[E_{data}^{\text{FSA-ACK}}=\rho_{tx}T_{data}+\rho_{rx}T_{ack}+2\rho _{\sigma}T_{IFS}+\\ \left(m-1\right)\rho_{sleep}\left(T_{data}+T_{ack}+2T_{IFS}\right) +\rho_{\sigma}T_{IFS}+\rho_{rx}T_{FBP}^{\text{FSA-ACK}}, \tag{20}\]  
\[E_{data}^{\text{DFSA}}(j)=\rho_{tx}T_{data}+\rho_{rx}T_{ack}+2\rho _{\sigma}T_{IFS}+\\ \left(m_{j}-1\right)\rho_{sleep}\left(T_{data}+T_{ack}+2T_{IFS} \right)+\rho_{\sigma}T_{IFS}+\rho_{rx}T_{FBP}^{\text{DFSA}}. \tag{21}\]  
Finally, regardless of the FSA protocol variant, end-devices that succeed in transmitting their data in a given frame do not contend in subsequent frames, remaining in sleep mode for the rest of the frame. Hence, during that period, an end-device will consume an energy that can be expressed as  
\[E_{sleep}^{\text{FSA-FBP}}=\rho_{sleep}\cdot T_{frame}^{\text{FSA-FBP}}, \tag{22}\]  
\[E_{sleep}^{\text{FSA-ACK}}=\rho_{sleep}\cdot T_{frame}^{\text{FSA-ACK}}, \tag{23}\]  
\[E_{sleep}^{\text{DFSA}}(j)=\rho_{sleep}\cdot T_{frame}^{\text{DFSA}}(j). \tag{24}\]