# Energy Harvested and Cooperative Enabled Efficient Routing Protocol (EHCRP) for IoT-WBAN
## 5 Energy Harvested and Cooperative-Enabled Routing Protocol (EHCRP) Scheme
### Path Cost Estimation  
Most of the existing protocols attempt to select the shortest path from/to the sink/coordinator, but this research work additionally considers link efficacy for the selection of next hop for data communication. This approach presents a path cost estimation (\(P.C.E.\)) technique work on total energy (\(TE\)), hop-count (\(HC\)), link efficiency (\(LE\)), distance (\(d\)) and the node congestion level (\(NCL\)) of a node to the CCN as shown in Equation (11). The least value of PCE is used to choose next-hop as a forwarder node:  
\[P.C.E\ =\ \frac{(\alpha\ \times R.E+\beta\times L.E+\gamma\times HC+\delta \times d+\omega\times N.C.L.)}{SNR} \tag{11}\]  
where \(\alpha\), \(\beta\), \(\gamma\), and \(\delta\) denote weighting factors for \(TE\), \(LE\), \(HC\) and \(d\), respectively, while considering signal to noise ratio as well.  
Based on the exchange of BEACON messages among SNs, the path-loss is calculated. If the path-loss is on the higher side, the network quality is considered as poor, alternatively if the path loss is lower, the quality is considered as good. Considering our energy-centric communication model development for WBAN, we employ the simplistic path-loss model.  
To select the optimal forwarder node, distance is an important factor to be considered. If the location of CNC is \(X_{0}\) and \(Y_{0}\) axis of central node and the location of source node is \(X_{1}\) and \(Y_{1}\) axis of SN, then the distance of SNs from central node can be calculated through the Euclidian distance as given in Equation (12):  
\[d_{(sink,\ SN)}\ =\ \sqrt{(X_{0}-\ X1)^{2}+\ (Y_{0}-\ Y_{1})^{2}} \tag{12}\]  
Another most important parameter in network is Link efficiency \(L.E\) that directly effects the energy consumption, which is shown in Equation (13). Quality of service (QoS) of a network is mainly based on \(L.E\) which ensures maximum end-to-end transmission:  
\[L.E_{\ i,\ j}=\sum\frac{PR_{n}}{PS_{s}} \tag{13}\]  
where \(L.E\) denotes link efficacy between nodes \(i\) and \(j\) through \(PR_{n}\), i.e., the total packets received at neighbor node and \(PS_{s}\), the total packets sent from source node. If the \(L.E\) is low, it may cause packet loss during transmission.  
Each SN sends complete information in a REPLY message to the CNC after important estimation. The REPLY message comprises of node ID, total energy, possible network energy loss, and required transmission power T.P and other information.  
In some cases, noise exists in paths which create major problems in data transmission. WBANs might be interacting with other communication technologies such as Zigbee, Bluetooth WPAN, WLAN, cellular system etc. for data transmission. Because of the interference of these technologies the signal strength may decrease in the WBAN. If the noise ratio gets higher, the signal strength will be low and can lead to data packet loss, on the other hand if the noise ratio becomes low the signal strength is higher, leading to minimum data loss of packet. SNR can be computed by Equation (14):  
\[SNR_{Reciver}\ =\ P_{Trans}-\ Pl(d)-\ N_{P} \tag{14}\]  
where, \(SNR_{Reciver}\) is ratio of snr at receiver end, \(P_{Trans}\) is transmission power, \(Pl\) (\(d\)) represents path loss at distance \(d\) and \(N_{P}\) represents noise power.  
In order to get the optimal results from any network, the node congestion level (NCL) must be properly controlled. Congestion is the event in which the data rate exceeds the available capacity at any point in WBAN [1]. It is categorized as node level congestion and link level congestion in WBANs. In this research work, more focus is on node level congestion. Node level congestion can be calculated using Equation (15):  
\[NCL(Current\ Queue\ Size)\ =\ Q_{total}-\ Q_{free} \tag{15}\]  
where \(Q_{total}\) represents total buffer space of the sensor and \(Q_{free}\) represents free available buffer space.