Wireless Sensor Networks (WSN) are formed by a large number of networked sensing nodes. It is rather complex, or even unfeasible, to model analytically a WSN and it usually leads to oversimplified analysis with limited confidence. Besides, deploying test-beds supposes a huge effort. Therefore, simulation is essential to study WSN. However, it requires a suitable model based on solid assumptions and an appropriate framework to ease implementation. In addition, simulation results rely on the particular scenario under study (environment), hardware and physical layer assumptions, which are not usually accurate enough to capture the real behavior of a WSN, thus, jeopardizing the credibility of results. However, detailed models yields to scalability and performance issues, due to the large number of nodes, that depending on application, have to be simulated. Therefore, the tradeoff between scalability and accuracy becomes a major issue when simulating WSN. In this survey a suitable model for WSN simulation is introduced, together with guidelines for selecting an appropriate framework. In addition, a comparative description of available tools is provided.