## 5 Delay and Energy Models  
In this section, we use the analysis presented in the previous section to formulate the calculation of the average delay and energy consumption in a data collection round using the RFSA protocol described in Section 3.2.  
The average delay, expressed in seconds and defined as the time elapsed since the data collection round starts until all end-devices succeed in transmitting their \(L\) data packets to the coordinator, can be formulated as:  
\[\overline{T_{CR}}=t_{absorption}\left(mT_{SLOT}+2T_{IFS}+T_{FBP}\right) \tag{12}\]  
where \(T_{SLOT}\), \(T_{IFS}\) and \(T_{FBP}\) are the duration of a slot, an IFS and the time of transmission of an FBP packet, respectively, and \(t_{absorption}\) is the average number of frames that the process needs to be absorbed. Indeed, the process starts at state \(X_{1}=(n,m)\) and finishes when it reaches state \(X_{K}=(0,m)\).  
The average energy consumed by the coordinator is denoted by \(\overline{E_{coord}}\). The coordinator executes the following operations in every frame of the process: (i) listens to the channel for the \(m\) slots of each frame to receive incoming data packets; (ii) remains in idle mode for the duration of two IFS; and (iii) transmits the FBP after each frame. Therefore, the average energy consumption of the coordinator can be formulated as:  
\[\overline{E_{coord}}=t_{absorption}\left(m\rho_{rx}T_{SLOT}+2\rho_{\sigma}T_{IFS}+ \rho_{tx}T_{FBP}\right) \tag{13}\]  
The average energy consumed by all of the end-devices is denoted by \(\overline{E_{n-ed}}\). Since we consider a homogeneous network and the MAC rules are identical to all of the end-devices, the average energy consumed per end-device can be considered as symmetrical and be expressed as \(\overline{E_{1-ed}}=\overline{E_{n-ed}}/n\).  
An end-device that has not succeeded yet in transmitting all of its \(L\) data packets executes the following operations in each frame: (i) transmits a data packet in one of the \(m\) slots; (ii) switches to standby for the other \(m-1\) slots; (iii) stays in idle mode for two IFS; and (iv) receives the FBP. Thus, the energy consumed by one end-device in a frame where it transmits a data packet can be expressed as:  
\[E_{tx\_data}^{frame}=\rho_{tx}T_{SLOT}+\left(m-1\right)\rho_{stby}T_{SLOT}+2 \rho_{\sigma}T_{IFS}+\rho_{rx}T_{FBP} \tag{14}\]  
An end-device that has succeeded in transmitting its \(L\) data packets in a given frame will sleep in subsequent frames until the data collection round finishes. Thus, the energy consumed by one end-device in a frame where it does not transmit a data packet can be expressed as:  
\[E_{sleep}^{frame}=\rho_{sleep}\left(mT_{SLOT}+2T_{IFS}+T_{FBP}\right) \tag{15}\]  
The average energy consumed by all end-devices can be formulated as:  
\[\overline{E_{n-ed}}=\sum_{j=1}^{K-1}\left\{n_{1j}E_{j}^{frame}\right\} \tag{16}\]  
where \(n_{1j}\) is the average number of frames that the process remains in each transient state \(X_{j}\) and \(E_{j}^{frame}\) is the energy consumed by all end-devices in one frame being in state \(X_{j}\). Then, \(\overline{E_{n-ed}}\) can be expressed as:  
\[\overline{E_{n-ed}}=\sum_{j=1}^{K-1}\left\{n_{1j}\left(N_{j}^{tx}E_{tx\_data }^{frame}+N_{j}^{sleep}E_{sleep}^{frame}\right)\right\} \tag{17}\]  
where \(N_{j}^{tx}=c_{j}+(m-f_{j})\) and \(N_{j}^{sleep}=\left(n-N_{j}^{tx}\right)\) are the number of end-devices that transmit a data packet and the number of end-devices that sleep, respectively, when the process is in state \(X_{j}\). Recall that \(c_{j}\) and \(f_{j}\) are the number of contending end-devices and the number of free slots in state \(X_{j}\), respectively, and \(n\) is the total number of end-devices that transmit data to the coordinator.  
In the next section, we validate the accuracy of the delay and energy models for RFSA and evaluate the delay and energy performance for different network configurations using RFSA and FSA.