## 4 Overview of the Proposed Error Recovery Mechanism
### The Proposed Error Recovery Mechanism
#### 4.3.2 Adaptive Error Recovery Mechanism  
One way to make an error recovery mechanism adaptive to the network channel conditions is to make the number of extra encoded packets adaptive based on the current packet error rate (PER) [10; 18]. If the channel suffers from a high PER, the error control mechanism can provide the destination with \begin{table}
\begin{tabular}{c c} \hline \hline
**Strengths** & **Weaknesses** \\ \hline Improved Reliability & Not adaptive to network’s channel condition \\ Improved delay in data delivery & Not adaptive to users’ queries \\ Reduced energy consumption & Does not support service differentiation \\ Lightweight & Does not consider environmental context of WBSNs \\ \hline \hline \end{tabular}
\end{table} 
Table 5: The MP mechanism’s performance analysis. extra encoded packets in order to increase the chance of packet recovery at the destination. This work relies on this method to make the proposed approach \"adaptive to the network's channel conditions\". An error recovery mechanism integrated with service differentiation or sensor priority settings based on applications or user demand can improve the overall QoS support of the mechanism. Hence, the proposed error recovery mechanism along with PER also depends on the sensor's adaptive priority settings by the PS or MS.  
For critical health monitoring applications, it is necessary to receive the critical data (high priority data) with a \(PLR<1\)% [36,46]. However, MP's approach has failed to provide health monitoring applications with this requirement when the channel is suffering from a PER higher than 20% (as shown in Figure 6). This is because MP's error recovery mechanism is not adaptive to the network conditions, and it does not take necessary actions on transferring the high priority or critical data when the channel is suffering from a high rate of packet errors. In order to solve this problem, the proposed mechanism allows users or doctors to identify the critical sensors for the system or application. Every time a sensor sends its data to a relay node, the relay node checks its priority label (e.g., critical or non-critical). Then, considering the current PER from which the channel is suffering, it provides the destination with enough encoded packets for high priority data. This is to make sure that the destination receives the high priority data with a PLR under 1%. To add extra packets, the network is designed in such way that every relay node is responsible for making extra encoded packets for three sensors. For the considered network scenario, the allocations are: \(R1:S1,S2,S3\), \(R2:S4,S5,S6\), \(R3:S7,S8,S9\) and \(R4:S10,S11,S12\). Similar to MP's mechanism, in this work, every relay node collects data from six sensors (see Figure 3), but responsible for making \"extra\" encoded packets only for three sensors. As shown in Figure 6, for PER between 1% to around 20-21%, MP's mechanism works fine for critical applications with \(PLR\leq 1\)%. Therefore, no extra encoded packet is required to send to the destination for this range of PER. However, to support critical  
Figure 6: The MP mechanism’s reliability performance. applications in the case of PER higher than 21%, few extra encoded packets are required. The calculation of the optimal number of extra encoded packets, based on the current PER and corresponding PLR, can be formulated as an optimization problem. Equation 2 represents the problem, where, \(x=\) the value of adaptive PER, \(y=\) the value of corresponding PLR and \(P_{\mathit{nep}}=\) the number of extra encoded packets. The values of \(PER\) and \(PLR\) are expressed in the scale 0-1 instead of %. \[\underset{x}{\text{minimize}} P_{\mathit{nep}}=f_{\mathit{nep}}(x,y)\] (2) subject to \[0.18\leq x\leq 1\] \[\mathbf{y}\leq 0.01\]  
To solve the above problem, a numerical method based on Algorithm 1 has been used.