  Unmanned Aerial Vehicle (UAV) systems are being increasingly used in a broad
range of applications requiring extensive communications, either to
interconnect the UAVs with each other or with ground resources. Focusing either
on the modeling of UAV operations or communication and network dynamics,
available simulation tools fail to capture the complex interdependencies
between these two aspects of the problem. The main contribution of this paper
is a flexible and scalable open source simulator -- FlyNetSim -- bridging the
two domains. The overall objective is to enable simulation and evaluation of
UAV swarms operating within articulated multi-layered technological ecosystems,
such as the Urban Internet of Things (IoT). To this aim, FlyNetSim interfaces
two open source tools, ArduPilot and ns-3, creating individual data paths
between the devices operating in the system using a publish and subscribe-based
middleware. The capabilities of FlyNetSim are illustrated through several
case-study scenarios including UAVs interconnecting with a multi-technology
communication infrastructure and intra-swarm ad-hoc communications.
