# Investigating Master-Slave Architecture for Underwater Wireless Sensor Network
## 4 System Model
### Restricting Extra Reception of Packets:  
Our approach minimizes the data packet reception in the PFNs of a node that is not eligible to send data (i.e., slave nodes). In prior routing protocols, all PFNs receive the data packet; however, eventually, further transmission is carried out by one of them. Since we are focusing on optimizing our network in terms of energy, we cannot afford wastage of energy in the form of receiving energy. Therefore, we adopted a method that suppresses all nodes, ineligible for forwarding the data packet to save the receiving energy. One possible scenario is depicted in Figure 10. As shown in the figure, a node suppressed by the sender node may also reside in some other node's range, while this node is the master node of its own PFN i.e., Node N is the slave node of Node S1 but the master node of S and therefore can receive data packets from S1 but not from S.  
Figure 9: Flow Chart of the whole process. ```
for\(i\gets 1\)toNodes by 1 do whileFlagdo if\(S(k).E\geq threshold\)then for\(j\gets 1\)to\(Sink\_Nodes\)by 1 do distance=distance b/w Sink(i) and S(k) ifdistance\(\leq transmissionrange\)then sink_found=1 break if\(sink\_found==1\)then Packet_delivered=Packet_delivered+1 break ; elseif(\(PFZ2\_Masters\geq 1\)) and (\(APD\_S(k)=0\)then Fetch master's info from master table Send Control Packet Wait for control packet's broadcast send data packet elseif(\(PFZ2\_Masters\geq 1\)) and (\(APD\_S(k)=0\))then Fetch master's info from master table Send Control Packet Wait for control packet's broadcast send data packet elseif(\(PFZ1\_Masters\geq 1\)) and (\(APD\_S(k)!=0\))then if\(S(k).ID==S(k).C[2]\)then Calculate Activation time elseif\(S(k).ID==S(K). [1]\)then calculate activation time elseif\(S(k).ID==S(K). [2]\)then calculate activation time wait for activation time if\(Activation\_time==0\)then send control packet wait until control packet cover region send data packet calculate holding time elseif\(PFZ1\_Masters\geq 1\)then ifS(k).ID==S(k).C[1]then Activation time=0 elseif\(S(k).ID==S(K).C[2]\)then calculate Activation time wait for activation time wait for activation time if\(Activation\_time==0\)then calculate Activation time wait for activation time if\(Activation\_time==0\)then send control packet wait until control packet cover region send data packet calculate holding time elseif\(S(k).ID==S(K).C[2]\)then calculate Activation time wait for activation time wait for activation time if\(Activation\_time==0\)then send control packet wait until control packet cover region send data packet calculate holding time else drop packet flag = 0 break
```  
**Algorithm 2**Packet's transmission Algorithm  
``` for\(i\gets 1\)toNodes by 1 do whileFlagdo if\(S(k).E\geq threshold\)then for\(j\gets 1\)to\



## 5 Simulation

### Simulation Setup

In this section, we thoroughly describe the simulations that we carried out using MATLAB software. Simulations are based on the comparative analysis of WDFAD with our proposed protocol (ERPMSA-UWSN) based on varying parameters i.e., PDR, energy tax, end-to-end delay, and the different number of sinks. Furthermore, most of the environmental parameters and settings are taken from the WDFAD protocol system setup. The 100-500 sensor nodes are randomly deployed in the 3D orientation inside water and over 10 Km\({}^{3}\) volumetric space, as shown in Figure 11. The individual average coverage of a node ranges from 2 km\({}^{3}\) to 10 Km\({}^{3}\) in a sparse to denser network, respectively. Multiple sinks are deployed on the ocean surface stationary and set to receive data from relay nodes. These randomly deployed nodes follow the random walk mobility model (RWM) [44] for movement. They select their next direction based on random probability and move there with the random speed ranges from 1 m/s to 5m/s along the X-Y plane. They change their position after every 2 s and the RWM model keeps the node bounded in coverage boundary. The movement of the nodes is mostly considered in the horizontal axis, while along the vertical axis it is considered slightly.