## 9 Conclusions  
In this work, the development of a _software-in-loop_ platform to perform UWSN simulations using a real-time STANAG 5066 stack has been presented. The used STANAG 5066 stack is part of a real-world implementation of an EM-based underwater node, framed within Spanish Government's project HERAKLES. The main objective of this work was to assess the suitability of this _software-in-loop_ simulation approach.  
The developed platform integrated a STANAG 5066 stack, but any real-time implementation of production-stage software could be easily integrated with minor modifications. The configurable time-slicing scheme of the simulator allowed to select the appropriate granularity in order to guarantee the real-time processing whilst maintaining CPU usage below a critical threshold.  
Taking into account the particularities of STANAG 5066, the simulated results showed no significant divergence from the expected behavior. Two scenarios were simulated. The first one comprised a broadcast situation that was used to assess the performance of NONARQ retransmissions. It was observed that including this feature could improve the effective link range about 0.5 m (using the simulation parameters of Table 4). Moreover, the results on Scenario 1 demonstrated that the integration of STANAG 5066 communications stack with the developed platform did not show any type of bottleneck. On the other scenario, in which a linear UWSN was deployed, the impact of PIR on both latency and PLR was evaluated. The results suggested that PIR has a critical impact on both parameters, showing a behavior that is within the limits of the expected one. As the PIR increased, the bottleneck link due to traffic accumulation was easily identified. In addition, latency dramatically increased with PIR for the farthest nodes.  
This work has demonstrated many advantages in terms of the evaluation of real protocol stack implementations. Furthermore, the physical layer has been simulated using a model based on real-world measurements, but it does not take into account other phenomena such as fading or complex channel impulse responses. Nonetheless, the simulation platform could be improved by integrating the aforementioned physical phenomena in the channel propagation software block.  
This work has demonstrated through simulation that _software-in-loop_ techniques are feasible for EM-UWSN using STANAG 5066. The obtained outcomes will be used in further works to simulate real-world deployments using HERAKLES' underwater nodes.  
**Author Contributions:** Formal analysis, V.A.-E., S.Z. and V.G.; Funding acquisition, S.Z. and I.P.-A.; Investigation, V.A.-E. and S.Z.; Methodology, V.A.-E. and V.G.; Project administration, S.Z. and I.P.-A.; Software, V.A.-E.; Supervision, S.Z. and I.P.-A.; Validation, V.A.-E. and V.G.; Writing--Original draft, V.A.-E. and V.G.; Writing--Review & editing, S.Z. and I.P.-A. All authors have read and agreed to the published version of the manuscript.  
**Funding:** This work was supported by the Spanish Ministry of Science and Innovation under the grant TEC2016-76038-C3-1-R (HERAKLES).  
**Conflicts of Interest:** The authors declare no conflict of interest. The funders had no role in the design of the study; in the collection, analyses, or interpretation of data; in the writing of the manuscript, or in the decision to publish the results.