# Design and Analysis of an Efficient Energy Algorithm in Wireless Social Sensor Networks
## 6 Checkpointing and Recovery Algorithms
### Algorithm for Failure Recovery
Hence, the additional messages of HCP are less than S for CP. For the ACP, its additional messages are the least because there is no coordination in ACP. #### 8.2.6 Experiment 6 Test of _Acfm_

Figures 16 and 17 express the change of _ACFM_ for the three protocols under different \(F\) and \(R\). It can be seen that the enlargement of F causes the increment of _ACFM_ in the three protocols. Hereinto, the change extents of HCP and ACP are lesser. This is because the rollback requests forwarded by \(CH_{s}\) increase when \(F\) augments. For the HCP and ACP, the rollback requests forwarded by \(CH_{s}\) are lesser, and so is the effect of \(F\). In the Scp, each rollback requires all processes to partake and so the messages forwarded by \(CH_{s}\) become major and take up a high proportion of the total messages. Then it causes the change extent of messages forwarded by \(CH_{s}\) being larger when \(R\) varies. What is more, the CHs in SCP will forward the coordination requests also and so the messages forwarded by \(CH_{s}\) in Scp are the largest. For the HCP, the coordination requests for different clusters and rollback requests forwarded by \(CH_{s}\) are lesser, and so the messages forwarded by \(CH_{s}\) are less than ACP. As \(R\) increases, the _ACFM_ of the three protocols all reduce. Hereinto, the _ACFM_ of HCP is least when \(R\) is less than 1. This is because the kinds of requests related to processes in different clusters increase when \(R\) augments. So the messages forwarded by \(CH_{s}\) reduce. For the SCP, the related coordination processes in different clusters decreases with the increment of \(R\) when \(R\) is larger than 1, and so the coordination requests forwarded by \(CH_{s}\) reduce obviously. In the HCP, though the coordination and rollback requests for different clusters decrease with the increment of \(R\), there are a certain amount of elimination notices of \(DC_{s}\). Hence, the reduction extent of HCP is less than the one of SCP. In short, because each process in SCP just stores one checkpoint, so the occupation of storage space is lesser. There is no cascade rollback in SCP, thus the recovery time is short, but in order to assure the checkpoints coordination of all processes, the processes in SCP need to exchange a lot of coordination information and so the additional messages are major. In the ACP, because the checkpoints of processes are not synchronous, so the checkpoint time is just the time needed to store the state of the process and the additional messages just include bits of additional messages caused by rollback. However, the storage space of ACP is larger because of

Figure 16: Impact of F on ACFM. Figure 15: Impact of R on AAM. the storing of many checkpoints. What is more, the recovery time is longer, because there are cascade rollbacks among checkpoints of processes. For the proposed hybrid protocol HCP, the time to transmit and receive the kinds of coordination information is less than the one of SCP, because the coordination of checkpoints is limited to the processes in same cluster. Hence, the checkpoint time of HCP is greatly shorter than the one of SCP. In addition, the coordination and rollback of HCP do not affect the other clusters marginally and so the retransmission overhead of \(CH_{\text{s}}\) is lesser. Though the additional messages of HCP are a little higher than the ones of ACP because of coordination, the recovery time of HCP is shorter for bits of constraints from different clusters and cascade rollbacks. ## 9 Conclusions and Next Work

Mobile ad hoc networks are an important part of modern communication networks, but the existing checkpointing algorithms could not be applied to this network environment very well because it has the features such as less of support of fixed network, multi-hops routing, changeable topological structure, bad stability and high failure probability.