Simulation of Underwater RF Wireless Sensor Networks using Castalia Sergio Valcarcel Macua, Santiago Zazo Javier Zazo, Marina P´ erez Jim´ enez Universidad Polit´ ecnica de Madrid Iv´ an P´ erez- ´ Alvarez, Eugenio Jim´ enez Universidad de Las Palmas de Gran Canaria IDeTIC Joaqu´ ın Hern´ andez Brito Oceanic Platform of the Canary Islands (PLOCAN) Abstract—We use real measurements of the underwater channel to simulate a whole underwater RF wireless sensor networks, including propagation impairments (e.g., noise, interferences), radio hardware (e.g., modulation scheme, bandwidth, transmit power), hardware limitations (e.g., clock drift, transmission buffer) and complete MAC and routing protocols. The results should be useful for designing centralized and distributed algorithms for applications like monitoring, event detection, localization and aid to navigation. We also explain the changes that have to be done to Castalia in order to perform the simulations. I. I NTRODUCTION Underwanter sensor networks are useful for environmental moni- toring and security applications. While acoustic or optical methods are preferred in deep sea water scenarios, they suffer from several impairments in shallow water settings. In particular, acoustic signals suffer from multi-path propagation, reverberation and ambient noise and, very importantly, they have a negative impact on marine life [1], [2]; while optical signals suffer from high absorption and strong backscatter [3]. RF communications seems an attractive alternative that could offer higher bandwidth and better transmission in medium boundaries (e.g., water–air, seabed–ice). Indeed, we have been able to measure the frequency response and achieve stable links at some meters distance [4], [5]. Now, we want to develop underwater wireless sensor networks (U-WSN) for applications like localization, aid to navigation, event detection and environment monitoring. We consider both centralized and distributed algorithms. In a centralized algorithm, nodes sense the environment and send their measurements to a sink node, which is in charge of gathering and processing all data from every node. Distributed algorithms are those in which nodes communicate with their neighbors and exchange some information (not necessarily the measurements but some intermediate variables like their estimate about some magnitude), so that they can predict and interact with the environment. Examples of distributed algorithms include feature extraction for data compression [6], diffusion adapta- tion [7] and belief propagation algorithms [8]. From a communica- tions point of view, centralized algorithms require routing any packet from any node to the sink, which requires route discovery; while distributed algorithms require point to point communication between neighbors, which may require neighborhood discovery. Deploying U-WSN presents several challenges, like communi- cation impairments, unexpected and asynchronous events, limited battery life, etc. Thus, we approach the problem in four main stages: i) channel characterization, i) simulation of U-WSN for specific scenario, iii) algorithm design and iv) network deployment. Stage 1 includes measurement campaigns to obtain the frequency response and the underwater propagation model underwater. In this paper we focus on stage 2, using the underwater channel characterization Work partially supported by the Spanish Ministry of Science and Innovation grant TEC2013-46011-C3-1-R, the COMONSENS Network of Excellence TEC2015-69648-REDC and by an FPU doctoral grant to Javier Zazo. explained in the companion papers [4], [5]. In particular, the main contribution of this work is to simulate a whole U-WSN, including propagation impairments (e.g., noise, interferences), radio hardware (e.g., modulation scheme, bandwidth, transmit power), hardware limitations (e.g., clock drift, transmission buffer), complete MAC and routing protocols for studying the influence of different parameters on some standard scenarios. The results of this work should be input to stage 3 for studying the feasibility of some algorithms (e.g., the order of loss packet rate that must be tolerated by the distributed algorithms presented in the companion paper [9]). Stage 4 includes prototype development and building a testbed. The idea is to iterate over these stages in order to minimize the cost of a real deployment. Castalia [10] is a simulator for Wireless Sensor Networks (WSN) based on the OMNeT++ platform [11] that offers realistic wireless channel and radio models and realistic node behaviour. The main reasons for choosing Castalia are its level of realism, speed and flexibility. The speed is achieved because all the modules are written in C++. The flexibility is at the cost of having no GUI. Indeed, Castalia is a command line simulator, where scenarios and settings are defined through external configuration files. The results are also given in text files, but they can be accessed with convenient parser scripts. In the following sections we explain how we have used and extended Castalia for simulating a U-WSN in some scenarios. II. WIRELESS CHANNEL A. Channel model characterization We start from the measurements of the underwater channel–taken with loop antennas—presented in the companion papers [4], [5]. Figure 1-top shows the measured (solid) and simulated (dashed) channel frequency response. Figure 1-bottom shows the fading of the signal at 46kHz along almost 2 hours. We have used the measurements of the frequency response to propose a path loss model, where the log of the attenuation is linear with the distance. Let L(d) denote the path loss (dB) at d meters from the transmitter. Then, the proposed model expresses L(d) as an affine function of the distance with parameter η: L(d)= L(d0)+ η d d0 + X (1) where d0 is some reference distance and X is a random variable. Note that (1) is different from the standard free-space path loss model, in which the log of the attenuation is linear with the log of the distance: L fs (d)= L(d0)+ η · 10 · log d d0 + X (2) We remark that these path loss models should be frequency dependent, but we have assumed the simpler narrow band case. In order to find parameters L(d0) and η for both models, we have considered carrier frequency 46kHz and d0 =2. The vector