## 7 Performance Evaluation
### Communication Overhead  
In this subsection, the energy consumed for sending a code image to the neighbor node are computed and then compared with Secure Deluge. We first investigate the total bytes transmitted for an entire code image since communication overhead is very important in that it is directly related to energy consumption. When PRR is 1 which implies that no packet loss happens, total transmitted bytes of each scheme is expressed as:  
\[CM_{SecureDeluge}=N_{pkt}^{basic}\cdot(L_{header}+L_{payload}+L_{hash})+L_{sig}+N_{page} \cdot(L_{ADV}+L_{REQ}) \tag{21}\]  
\[CM_{SPA}=N_{pkt}^{tx}\cdot L_{header}+N_{pkt}^{basic}\cdot(L_{payload}+L_{hash })+L_{sig}+N_{page}\cdot(L_{ADV}+L_{REQ}) \tag{22}\]  
\[CM_{MBSA}=N_{pkt}^{tx}\cdot(L_{header}+L_{MAC})+N_{page}\cdot(L_{page}+L_{hash })+L_{sig}+N_{page}\cdot(L_{ADV}+L_{REQ}) \tag{23}\]  
\[CM_{BFBSA}=N_{pkt}^{tx}\cdot L_{header}+N_{page}\cdot(L_{page}+L_{hash})+L_{ sig}+m+N_{page}\cdot(L_{ADV}+L_{REQ}) \tag{24}\]  
where \(L_{header}\), \(L_{payload}\), \(L_{hash}\), \(L_{sig}\) and \(L_{MAC}\) denote the length of a header, a payload, a hash value, a digital signature and a MAC, respectively. All Deluge packets are transmitted according to IEEE 802.15.4 presented in Figure 10. In other words, each packet is preceded by the backoff period and followed by the LIFS period. Therefore, the total energy consumption for sending one packet is computed as follows:  
\[ \begin{array}{ll}E_{pkt}&=E_{backoff}+E_{tx}^{pkt}+E_{LIFS}\\ &=I_{idle}\cdot V_{sup}\cdot T_{backoff}+I_{tx}\cdot V_{sup}\cdot T_{byte} \cdot L_{pkt}+I_{idle}\cdot V_{sup}\cdot T_{LIFS}\end{array}  \tag{25}\]  
where \(E_{backoff}\) and \(E_{LIFS}\) is the energy consumption during the backoff period and the LIFS period, respectively. \(E_{tx}^{pkt}\) is the energy consumption for transmitting a packet with the size of \(L_{pkt}\). In addition, the receiver node is assumed to be in the Rx state and thus the energy consumption can be computed as \(I_{rx}\cdot V_{sup}\cdot T_{rx}\) where \(T_{rx}\) is the duration over which the receiver node is in the RX state. Finally, \(E_{sleep}\), which is the energy consumption when the sender enters the inactive period in Figure 10, is calculated as \(I_{rx}\cdot V_{sup}\cdot T_{inactive}\). By considering all energy consumption not only for transmitting and receiving the code image but also for the backoff period, the LIFS period and the inactive period defined in IEEE 802.15.4 as shown in Figure 10, we obtained the energy consumption due to the communication overhead as shown in Figures 13-15, each of which corresponds to the excellent, fair and bad link quality, respectively. Figure 12: Computation overhead in bad link quality. In excellent link quality as shown in Figure 13, SPA, MBSA and BFBSA have lower communication overhead than Secure Deluge by approximately 25.4%, 55.4% and 50.3%. This is because Secure Deluge cannot adapt its packet size to the link quality even though larger packet reduces communication overhead in the excellent link quality. MBSA and BFBSA outperform SPA since MBSA and BFBSA can support fully variable packet size while SPA can only support the packet size of multiples of the basic packet. MBSA is better than BFBSA since BFBSA need to transmit a Bloom filter with the size of \(\left|N_{pkt}^{basic}\times(m/N)\right|\) to guarantee a false positive probability of 6.36 \(\times\) 10\({}^{-20}\). In fair link quality as shown in Figure 14, SPA, MBSA and BFBSA outperforms Secure Deluge by approximately 18.6%, 48.6% and 42.2%. Except that the gap between Secure Deluge and proposed schemes decreases since a small-size packet in Secure Deluge results in higher PRR, Figure 14 is similar to Figure 13. In bad link quality as shown in Figure 15, Secure Deluge and SPA has the same communication overhead since the  
Figure 14: Communication overhead in fair link quality. Figure 13: Communication overhead in excellent link quality. Figure 15: Communication overhead in bad link quality.