Diffusion-based molecular communication is a promising bio-inspired paradigm to implement nanonetworks, i.e., the interconnection of nanomachines. The peculiarities of the physical channel in diffusion-based molecular communication require the development of novel models, architectures and protocols for this new scenario, which need to be validated by simulation. N3Sim is a simulation framework for nanonetworks with transmitter, receiver, and harvester nodes using Diffusion-based Molecular Communication (DMC). In DMC, transmitters encode the information by releasing molecules into the medium, thus varying their local concentration. N3Sim models the movement of these molecules according to Brownian dynamics, and it also takes into account their inertia and the interactions among them. Harvesters collect molecules from the environment to reuse them for later transmissions. Receivers decode the information by sensing the particle concentration in their neighborhood. The benefits of N3Sim are multiple: the validation of channel models for DMC and the evaluation of novel modulation schemes are just a few examples. (C) 2013 Elsevier B.V. All rights reserved.