# Underwater Electromagnetic Sensor Networks, Part II: Localization and Network Simulations
## 4 Simulation of a Complete U-WSN
### Radio Parameters  
Modulations are typically classified as bandwidth efficient or power efficient [26]. Bandwidth-efficient modulations, such as high density QAM schemes, are able to accommodate data within a limited bandwidth. Power-efficient schemes, such as BPSK and FSK, are able to reliably send information at the lowest practical power level. In Section 2, we have seen that the underwater medium exhibits high attenuation. Thus, in order to increase the communication range, we require transmitting at high power levels and establishing reliable communication at a low signal to noise ratio (SNR). We chose 2-FSK, since it is power efficient and allows us to use efficient power amplifiers (i.e., FSK provides a constant envelope signal, so that we can use amplifiers that work in saturation mode).  
Castalia only offered FSK with a noncoherent receiver and no channel coding. Therefore, we have added the coherent receiver and channel coding to the class Radio (in particular, to the method Radio::SNR2 BER). We have chosen a convolutional code \((3,1,2)\), whose non-systematic feedforward encoder is represented by \(G(D)=[1+D,\,1+D^{2},\,1+D+D^{2}]\), with free distance \(d_{\text{free}}=7\) and \(B_{d_{\text{free}}}=1\) (this is the total number of nonzero information bits on all weight-\(d_{\text{free}}\) paths, divided by the number of information bits per unit time). Let \(p\) be the bit error rate (BER) obtained from the SNR curve for our FSK modulation. We have characterized the system by including the coding gain as the BER upper bound given by ([27] Equation 12.1):  
\[\text{BER}(p,B_{d_{\text{free}}},d_{\text{free}})\approx B_{d_{\text{free}}} \left[2\sqrt{p(1-p)}\right]^{d_{\text{free}}} \tag{11}\]  
The radio parameters common to all simulations are: data rate \(1\,\mathrm{kbps}\), \(1\) bit per symbol, signal bandwidth \(3\,\mathrm{kHz}\), noise bandwidth \(3\,\mathrm{kHz}\), receiver sensitivity \(-115\,\mathrm{dBm}\), clear channel assessment \(-112\,\mathrm{dBm}\) and noise floor \(-127\,\mathrm{dBm}\). We assumed carrier frequency separation of \(1\,\mathrm{kHz}\)The required transmit power depends on the scenario under study and influences critically the communication range. Section 4.3.1 shows simulation results for 10 dBm, 25 dBm and 40 dBm, while Sections 4.3.2-4.3.4 only consider 40 dBm. We remark that a transmit power level of 40 dBm is used in commercial products [24]. Castalia has a prefixed value of 0 dBm as the maximum power allowed by the simulator, which must be updated for our setting. In particular, it is needed to increase the value of variable maxTxPower in the WirelessChannel class.  
The maximum packet size depends on the application under study. For instance, the localization algorithm considered in Section 3.1 requires small packets of a size of eight bytes (i.e., typically two float numbers per iteration in single precision) before encoding. Recall that the larger the packet, the higher the probability that it suffers some impairment. Section 4.3.1 shows simulation results for random packets of 30 bytes, while the rest of the simulations transmit their neighbor list, which consists of around 15 bytes.