For the past few weeks I've been working on a very interesting project. This is a free and open source wireless network simulator called NetSim.
Here is a short description of what NetSim is:
NetSim is a wireless network simulator. NetSim is primarily designed for use by developers of the network stacks. It can also be used for initial design, development and debugging of the final applications, but its use in this capacity may be limited because of the way simulated peripherals are designed.
Simulated devices implement a wireless system on a chip (SoC) based on an ARMv6-M-compatible MCU (Cortex-M0) and an abstract IEEE 802.15.4 radio transceiver. By default simulated system runs at 1 MHz, which is usually fast enough for a networking stack and a simple application.
More detailed description and a source code is available at GitHub.
I've made NetSim so that I could test things like routing algorithms in a reproducible environment without having a ton of hardware and constant reprogramming.
I don't expect that too many people will want to use it, but may be someone will find it useful.
I've prepared an easy to use package for evaluation (attached). Note that from this point on everything is command line only, so be prepared and you've been warned :)
In the package you will find:
1. LwMesh_Sim - patch for LwMesh v1.2.1 that adds NetSim radio support. Just extract this archive on top of LwMesh.
2. sniffer - sniffer log viewer. It is based on my old project of a sniffer written in Python. Simply run "python sniffer.py" to get it working.
3. netsim - precompiled Linux version (x64 only).
4. netsim.exe - precompiled Windows version.
5. PingPong.bin - binary firmware image compiled from LwMesh_Sim/apps/PingPong.
6. PingPong_4x4.cfg - network configuration file for the simulator.
In PingPong application, node 0 randomly selects a destination address and sends a frame to that address. Receiving node selects a new address, and process goes on like this.
Destination address is selected from a predefined range, which is configurable from the config.h file.
PingPong_4x4.cfg configures a network of 16 nodes located in a 4x4 grid 20 meters apart.
To start simulation simply run "netsim.exe PingPong_4x4.cfg".
On my system 4x4 simulation runs 2.9 (or 3.3 depending on the core model) times faster than real time.
The same application, but in 10x10 configuration runs 2.9 (or 2.3) times slower than real time. So real time is somewhere in between :)
After playing with this simulator for a while, I've already observed a few things that might be improved, especially for big networks. Now it is time to do something about that.