## 4 Proposed SARP Routing Protocol for BASNs
### Working Principle of Sensors in SARP
#### 4.4.4 Route Repair Procedure  
Route maintenance occurs only when a forwarder node fails to convey data packets to the sink. The designed scheme instantaneously identifies the route breakdown, which is very common in BASNs. Route failure is identified when a sender cluster head has not received an acknowledgment message from the receiver cluster head in a predefined time interval. In case of a route failure, the sender cluster head first looks in its routing table for the alternative forwarding nodes, if they exist, then it selects the second-highest priority forwarder as the alternative route and sends a \(ready\_rec\_msg\) message to inform about the arrival of packets. Simultaneously, it deletes the records relating to the failure node and updates the priorities of the rest of the remaining forwarders in the routing table. Otherwise, the sender cluster leader will start the route discovery process discussed above to establish a routing path towards the sink. As soon as the packets are received, the sink identifies the route changes and sends an \(ackno\_msg\) message to the source cluster head, including the identity of all relay nodes along a routing path in BASNs. Thus, a new routing path over a set of cluster heads is verified in both upward and downward directions between the source and destination in the network. However, in case of a member node failure, the cluster head just discards that node from its member list and updates the routing table. In the entire routing process, each cluster head maintains the priority of the associated forwarders in the routing table, which keeps changing as time passes until the forwarder battery is drained. This priority helps the forwarder to distribute packets relaying the responsibility among different relaying nodes in order to balance the network traffic and energy consumption load in BASNs. The designed scheme adopts a simple procedure to tackle route failure problems and, therefore, avoids high energy consumption issues due to low overheads in BASNs. In the proposed scheme, the entire body area network is represented as a graph \(\mathcal{G}(\mathcal{V},\mathcal{R})\), in which the vertices \(\mathcal{V}=\mathcal{V}_{\mathcal{S}_{i}}\cup\mathcal{V}_{\mathcal{S}_{i}( \mathcal{G})}\in\mathbb{S}_{1}\) and the edges \(\mathcal{R}=\mathcal{V}_{\mathcal{S}_{i}}\subseteq\mathcal{V}_{\mathcal{S}_{i}( \mathcal{G}^{\prime})}\in\mathcal{L}(n)\), such that \(\mathcal{S}_{i}=\{\mathcal{S}_{j}\}\)\((\mathcal{S}_{i},\,\mathcal{S}_{j})\in\mathcal{K}\) represents the sensor nodes \(\mathcal{S}_{i}\), and their wireless links \(\mathcal{L}(j)\) located in a particular region \(\mathcal{T}_{\mathcal{S}_{i}(\ell)}\) belong to the sink \((\mathbb{S}_{1})\). The packets generated by each sensor node are divided into rounds \(\mathcal{R}\) where each round \(\mathcal{R}_{i}\) consists of time frames \(\mathcal{T}_{f}\), such that each frame \(t_{f}\subset\mathcal{T}_{f}\). At the beginning of each round, the residual energy of the sensor node is \(\mathcal{R}_{\pi(t)}\), which decays to \(\xi\mathcal{R}_{\pi(t)}\) at the end of the round where the energy coefficient \(\xi\) is \(0\prec\xi\leq 1\) in BASNs. Herein, the key objective function of the proposed scheme is to optimize the performance of each biosensor node by following the objectives defined in Equation (1) in each round of the simulation. Consequently, the objective function of the proposed scheme given in Eq.1 can be divided into single objectives, which can be written as  
\[\phi_{SARP}=\int_{\mathbb{b}_{\ell}}^{\mathbb{b}_{a}}\min_{ \begin{subarray}{c}\forall\mathcal{I}\,(0)\in\mathcal{M}\\ \mathcal{S}_{1}\end{subarray} }\mathcal{L}_{i}(E_{e})+\int_{\mathbb{b}_{\ell}}^ {\mathbb{b}_{a}}\min_{ \begin{subarray}{c}\forall\mathcal{I}\,(0)\in\mathcal{M }\\ \mathcal{S}_{1}\end{subarray} }\mathcal{L}_{i}(\mathcal{S}_{1})+\int_{\mathbb{b}_{ \ell}}^{\mathbb{b}_{a}}\max_{ \begin{subarray}{c}\forall\mathcal{I}\,(0)\in \mathcal{M}\\ \mathcal{S}_{1}\end{subarray}