# Underwater Wireless Sensor Networks Performance Comparison Utilizing Telnet and Superframe
## 4 Proposed Underwater Network Topology
By using this algorithm, the network can dynamically select the CHN based on the current values of l\({}_{\text{k}}\) and h\({}_{\text{k}}\) for each sensor node. This can help to balance the energy consumption and extend the lifetime of the network. Algorithm 3 is used to calculate the energy dissipated by the cluster head in a UWSN. The algorithm consists of five steps. ```
Begin Step 1: Network Initialization Step 2: If \(\text{dmin}>\text{E}_{\text{FS}}\) then the energy of kth node Step 3: Energy of kth node (E\({}_{\text{k}}\)) = (RE\({}_{\text{max}}\) \(-\) ReE\({}_{\text{min}}\))/(ReE\({}_{\text{max}}\) \(-\) RE\({}_{\text{min}}\)) Step 4: If \(\text{dmin}\leq\text{E}_{\text{FS}}\) then the energy of kth node Step 5: Energy of kth node (E\({}_{\text{k}}\)) = (ReE\({}_{\text{min}}\) \(-\) RE\({}_{\text{max}}\))/(RE\({}_{\text{min}}\) \(-\) ReE\({}_{\text{max}}\)) End Where dmin = minimum distance between the sensor nodes  E\({}_{\text{FS}}\) = Energy of free space E\({}_{\text{k}}\) = Energy of kth node  RE\({}_{\text{max}}\) = maximum residual energy RE\({}_{\text{min}}\) = minimum residual energy RE\({}_{\text{max}}\) = maximum remaining energy
```  
**Algorithm 3**Energy dissipated by the cluster head  
**Step 1:** Network Initialization. This step is used to initialize the network before calculating the energy dissipated by the cluster head. **Step 2:** If \(\text{d}_{\text{min}}>\text{E}_{\text{FS}}\) then the energy of kth node. In this step, if the minimum distance between the sensor nodes (d\({}_{\text{min}}\)) is greater than the energy of free space (E\({}_{\text{FS}}\)), the energy of the kth node is calculated. **Step 3:** Energy of kth node (E\({}_{\text{k}}\)) = (RE\({}_{\text{max}}\)x \(-\) ReE\({}_{\text{min}}\))/(ReE\({}_{\text{max}}\) \(-\) RE\({}_{\text{min}}\)). The energy of the kth node (E\({}_{\text{k}}\)) is calculated using the maximum residual energy (RE\({}_{\text{max}}\)), minimum residual energy (RE\({}_{\text{min}}\)), maximum remaining energy (ReE\({}_{\text{max}}\)), and  
**Step 5:** Energy of kth node (\(\text{E}_{\text{k}}\)) = (\(\text{Re}\text{E}_{\text{min}}-\text{RE}_{\text{max}}\))/(\(\text{RE}_{\text{min}}-\text{Re}\text{E}_{\text{max}}\)). The energy of the kth node (\(\text{E}_{\text{k}}\)) is calculated using the maximum residual energy (\(\text{RE}_{\text{max}}\)), minimum residual energy (\(\text{RE}_{\text{min}}\)), maximum remaining energy (\(\text{Re}\text{E}_{\text{max}}\)), and minimum remaining energy (\(\text{Re}\text{E}_{\text{min}}\)). The formula used is (\(\text{Re}\text{E}_{\text{min}}-\text{RE}_{\text{max}}\))/ (\(\text{RE}_{\text{min}}-\text{Re}\text{E}_{\text{max}}\)). Overall, the algorithm is used to calculate the energy of the cluster head in a UWSN based on the distances between the sensor nodes and the energy of free space. In underwater environments, the energy of free space (EPS) value is generally lower than in air due to the attenuation of radio waves caused by the high absorption and scattering of electromagnetic waves in water. The actual value of EFS in underwater environments can vary, depending on such factors as the frequency of the radio signal, the salinity and temperature of the water, and the presence of obstacles or reflections. Generally, EFS values in underwater environments range from tens to hundreds of microjoules per bit per meter (\(\text{\mu}\)J/bit/m). In our simulation, we have considered the \(\text{E}_{\text{FS}}\) as 5 (\(\text{\mu}\)J/bit/m). The value of \(\text{d}_{\text{min}}\) in Algorithm 2 refers to the minimum distance between the sensor nodes in a cluster. This value is typically chosen based on the specific requirements of the application and the characteristics of the underwater environment, such as the maximum communication range of the sensor nodes, the desired sensing resolution, and the level of interference in the environment.