## 4 Feasibility Test of the API Protocol via Simulations
### Feasibility Test of Partial Initialization
#### 4.1.1 Simulation Operation and Conditions for Testing the Feasibility of the API Protocol  
The simulation is built using MATLAB software and its operation is as follows:* The simulation considers the uplink data transmission between a master node and several slave nodes in the operational stage.
* All the slave nodes generate random data of which value is randomly distributed according to the given data distribution.
* In the beginning of the simulation, some of them are randomly chosen according to the given application requirement. The application requirement is the ratio of the number of successfully initialized slave nodes to the total number of slave nodes in the network, which is also referred to as the initialization rate.
* The selected slave nodes are then put in the operational stage, and thus transmits data to a master node with respect to simulation time. It is assumed that there is no packet loss due to channel contentions.
* Depending on the given BER, an error may occur in the data transmitted by the slave node.
* This same data transmission process is repeated up to the given number of transmissions at the end of a simulation.
* At each transmission, the statistics of the accumulated data until current transmission for both the API and the FI are driven by the master node, respectively. By using the obtained statistics of both cases, the similarity is also obtained. The pattern of similarity is then checked.
* Simulations are executed case by case by changing the number of slave nodes, the BER, the type of data randomness, the initialization rate, and the standard deviation of data.  
The similarity is determined by using the mean square difference (MSD) between the standard deviations (STDs) of accumulated data obtained by the API and that by the FI. We denote the STDs of the API and the FI by \(STD_{API}\) and \(STD_{FI}\), respectively. We then calculate the MSD by \(\left(STD_{API}-STD_{FI}\right)^{2}\). The similarity, denoted by \(S\), can be expressed as \(S=\frac{1}{MSD+1}\) (\(0\leq S\leq 1\)) [22]. The similarity increases as the value of \(S\) approaches 1, and vice versa. The simulation conditions are given as follows:  
* The value of BER is \(5\times 10^{-4},10^{-3},\text{ and }10^{-2}\).
* The number of transmissions is 1000.
* The number of slave nodes is 10, 30, and 50.
* The initialization rates are set to 10%, 30%, 50%, 70%, and 100%. The FI is nothing, but the case of the initialization rate of 100%, which implies that all the slave nodes need to be initialized.
* It is difficult to predict the data model because the characteristics of the generated data vary depending on the underwater applications. In addition, the randomness of data distribution may further increase due to the unreliability of underwater acoustic communications. Therefore, the normal distribution is primarily employed in our simulations in consideration of the following reason. Based on the Central Limit Theorem (CLT), the measured data (or random variable) in underwater wireless networks is expected to follow the normal distribution with high probability because the measured random variable can be the sum of many independent random variables which were affected by many different natural phenomena in underwater. As shown in Figure 3a, the generated data for the simulations follows a normal distribution with the mean value of 1 and the STDs of 5, 10, and 20.
* In addition, the uniform distribution is also applied in simulations in order to investigate the feasibility of the API according to the type of data distributions. The uniform distribution is a typical probability density function(pdf) which is different from the normal distribution, is also simple and easily analyzed after obtaining the simulation results. Another data following a uniform distribution are in the range of [-10,10] (i.e., \(\text{STD}\approx 5.77\)), [-20,20] (i.e., \(\text{STD}\approx 11.54\)), and [-40,40] (i.e., \(\text{STD}\approx 23.09\)), as illustrated in Figure 3b.