The Internet of Drones (IoD) is a networking architecture that stems from the interplay between Unmanned Aerial Vehicles (UAVs) and wireless communication technologies. Networked drones can unleash disruptive scenarios in many application domains. At the same time, to really capitalize their potential, accurate modeling techniques are required to catch the fine details that characterize the features and limitations of UAVs, wireless communications, and networking protocols. To this end, the present contribution proposes the Internet of Drones Simulator (IoD-Sim), a comprehensive and versatile open source tool that addresses the many facets of the IoD. IoD-Sim is an Network Simulator 3 (ns-3)-based simulator organized in a 3-layer stack, composed by (i) the Underlying Platform, which provides the telecommunication primitives for different standardized protocol stacks, (ii) the Core, that implements all the fundamental features of an IoD scenario, and (iii) the Simulation Development Platform, mainly composed by a set of tools that speeds up the graphical design for every possible use-case. In order to prove the huge potential of this proposal, three different scenarios are presented and analyzed from both a software perspective and a telecommunication standpoint. The peculiarities of this open-source tool are of interest for researchers in academia, as they will be able to extend to model upcoming specifications, including, but not limited to, mobile networks and satellite communications. Still, it will certainly be of relevance in industry to accelerate the design phase, thus improving the time-to-market of IoD-based services.