# Multi-Media and Multi-Band Based Adaptation Layer Techniques for Underwater Sensor Networks
## 7 Proposed Scheme
### Medium Selection Mechanism
#### 7.4.1 Distance Calculation  
This phase is used to find the distance between nearby and distant nodes in underwater communication. For distance finding methods, we need to follow two steps: a.) The received signal strength indicator (RSSI) method is used to find the signal strength between the nodes, and b.) the Manhattan method is used to find the distance between nearby and faraway nodes. Received Signal Strength Calculation  
RSSI is used to calculate the loss of signal between the nodes in underwater sensor networks, including signal loss in underwater networks. The propagation model is used to calculate the RSSI between the nodes. The formula with which to measure the path loss is shown below  
\[Path\ Loss(d)=Path\ Loss(d0)+10 nlog\left(\frac{d}{d0}\right)+X\sigma \tag{1}\]  
In Equation (1), d is the distance between the nodes. Based on the decrease in RSSI, the path loss n should be measured. The value of X\(\sigma\) is 0, which is the Gaussian distribution variable to change the power of the received signal at a certain distance. The referential distance is d0, which is equal to 1 m. Path Loss(d0) is the referential power value. Suppose R to be the received signal strength at distance d0 between the transmitter and receiver nodes; then, the equation can be written as follows  
\[R(dB)=Pr-Path\ Loss(d0) \tag{2}\]  
Figure 6: Medium selection design scheme inside adaptation layer. In Equation (2), Pr is the power of node that is transmitting the signal and Path Loss(d0) is the referential power in dB. The RSSI value can be calculated using the formula shown in Equation (3). \[RSSI(dB)=R-10 nlog\ d \tag{3}\]  
Distance Estimation of Nearby Node Using Manhattan Method  
In [59; 60], the Manhattan method was used to find the distance between near-far nodes. In this case, the referential object must be allocated. Let's consider the referential set as Ref\({}_{\text{ab}}\) for the pair of nodes (a, b), where a is the nearby node of b. Let N\({}_{\text{a}}\) and N\({}_{\text{b}}\) denote the nearby set of nodes a and b. Then, the referential set can be created as Ref\({}_{\text{ab}}\) = N\({}_{\text{a}}\) U N\({}_{\text{b}}\) U [a] U [b]. Based on the referential set Ref\({}_{\text{ab}}\), two vectors V\({}_{\text{a}}\) and V\({}_{\text{b}}\) can be generated for nodes a and b respectively by using vector generation. In this case both comprise a RSSI value in dB for all the nodes in Ref\({}_{\text{ab}}\). The sending power of the RSSI node itself is set at 0. That is RSSI (a, a) = 0 in vector V\({}_{\text{a}}\). If the node d is far from the node a, then RSSI (a, d) is set at \(-100\). If the given vectors are (a\({}_{1}\), a\({}_{2}\), a\({}_{3}\)... ) and (b\({}_{1}\), b\({}_{2}\), b\({}_{3}\)... ) with elements at same number n, then the Manhattan distance \(M_{dis}\) can be calculated using Equation (4). \[M_{dis}=\sum_{i=1}^{n}ai-bi \tag{4}\]  
Figure 7 shows an example of a graph constructed using the Manhattan distance. Suppose the referential set Ref\({}_{\text{ab}}\) of N\({}_{\text{S1}}\) and N\({}_{\text{S2}}\) is obtained using (S1, S2, S3, S4, S5). V\({}_{\text{S1}}\) and V\({}_{\text{S2}}\) are the set as [0, \(-55\), \(-65\), \(-60\), \(-100\)] and [\(-60\), 0, \(-50\), \(-75\), \(-70\)], which is the RSSI value. Then, the distance between the nearby nodes S1 and S2 can be calculated as shown in Equation (5). \[M_{dis}=|0+60|+|-55+0|+|-65+50|+|-60+75|+|-100+70|=175 \tag{5}\]  
Distance Estimation of Far-Away Node Using Manhattan Method  
By using the RSSI values, the distance between the nearby nodes can be calculated. We know that the Manhattan distance of M\({}_{\text{dis}}\) (S1, S2) = 175, so the distance between (S2, S1) = 175. Similarly, the other distances, such as M\({}_{\text{dis}}\) (S2, S4), M\({}_{\text{dis}}\) (S1, S3), M\({}_{\text{dis}}\) (S2, S5), M\({}_{\text{dis}}\) (S1, S4), M\({}_{\text{dis}}\) (S3, S4), M\({}_{\text{dis}}\) (S2, S3), and M\({}_{\text{dis}}\) (S3, S5), can be calculated. Figure 8 shows the methods for finding the distance for far-away nodes.