# An Energy Balanced and Lifetime Extended Routing Protocol for Underwater Sensor Networks
## 4 Energy Balanced and Lifetime Extended Protocol (EBLE)
### Detailed Design of EBLE
#### 4.2.1 Candidate Forwarding Set Selection Phase  
In this phase, the sink node broadcasts an indicator signal first so that each node can obtain its relative distance towards the sink by calculating the received signal strength. Then each sensor node broadcasts a packet to inform its neighbors of its relative distance towards the sink and its current residual energy level (\(EL\)). \(EL\) is defined as in [17], that is, we divide a node's initial energy into \(m\) equal parts and the residual energy is larger than \(EL\) parts and smaller than \(EL+1\) parts. The optimal \(EL\) division can be obtained from [17]. After the successful reception of broadcasting packets, each sensor node stores the \(EL\) of its neighbors and calculates the cost value \(Q_{i,j}\) according to the cost function. The cost function for node \(i\) is described in (21).  
\[Q_{i,j} =\frac{d_{c}^{k}\left(a(f)\right)^{d_{c}}}{d_{i,sink}-d_{j,sink}}\] \[d_{c} =\max(d_{i,j},d_{min}) \tag{21}\]  
Figure 4: Energy consumption for different \(\alpha\).  
Where \(d_{i,j}\) is the distance between node \(i\) and node \(j\), \(d_{min}\) is the minimal transmission range. When \(d_{i,j}<d_{min}\), the transmitting power of the transducers keeps unchanged at \(P_{txmin}\). \(d_{i,sink}\) is the distance between node \(i\) and the sink, and \(d_{j,sink}\) is the distance between node \(j\) and the sink. The denominator, \((d(i,sink)-d(j,sink))\), denotes the effective propagation distance towards the sink. The numerator reflects the energy consumption ratio to forward the data packet to node \(j\). So the cost function can reflect the energy consumption per effective transmission distance. The aim of cost function is to select next hop forwarder with relatively long effective propagation distance and short actual propagation distance. So energy balancing and energy efficiency are both considered in our design. The node \(j\) would have a higher priority to be chosen as the next hop forwarder of node \(i\) if the value of \(Q_{i,j}\) is smaller. In order to further reduce inefficient transmissions, node \(j\) is considered to be a candidate forwarder of node \(i\) only when the following conditions are met: (1) \(d_{i,sink}>d_{i,j}\); (2) \(d_{i,sink}>d_{j,sink}\); (3) \(d_{i,j}^{k}a(f)^{d_{i,j}}+d_{j,sink}^{k}a(f)^{d_{i,sink}}<d_{i,sink}^{k}a(f)^{d _{i,sink}}\). The overall process of candidate forwarding set selection is shown in Algorithm 1. The relative parameters are defined in Table 1.  
```
1:procedureBroadcastPackets
2:\(Packet.AddHeader(NodePosition)\);
3:\(Packet.AddHeader(NodeEL)\);
4:\(Packet.SetPacketType(PacketType)\);
5: broadcast the packet;
6:endprocedure
7:
8:procedureReceivePackets
9:if Receive signal from sink then
10:\(d_{i,sink}\leftarrow CalculateRelativeDistance()\);
11:else
12:\(d_{j,sink}\leftarrow GetRelativeDistance()\);
13:\(d_{i,j}\leftarrow CalculateRelativeDistance()\);
14:endif
15:if\(d_{i,sink}>d_{i,j}\) and \(d_{i,sink}>d_{j,sink}\) and \(d_{i,j}^{k}a(f)^{d_{i,j}}+d_{j,sink}^{k}a(f)^{d_{i,sink}}<d_{i,sink}^{k}a(f)^{d _{i,sink}}\)then
16:\(Neighbor.nodeID\gets j\);
17:\(Neighbor.Q\leftarrow\) Calculate the Q value according to the cost function (21);
18:\(Neighbor.EL\gets EL(j)\);
19:\(NbList.Add(Neighbor)\);
20:else
21: drop the packet;
22:endif
23:endprocedure
```  
**Algorithm 1** Candidate Forwarding Set Selection  
\begin{table}
\begin{tabular}{l l} \hline \hline
**Notation** & **Definition** \\ \hline \(Node_{opt}\) & chosen forwarding node register \\ \(EL(i)\) & residual energy level of current node \(i\) \\ \(EL(j)\) & residual energy level of sending node \(j\) \\ \(Neighbor\) & neighbor node register \\ \(Num_{nb}\) & number of stored neighbor nodes \\ \(NbList\) & stored neighbor list \\ \(TR\) & maximum transmission range \\ \hline \hline \end{tabular}
\end{table}
Table 1: Nomenclature.