WSN-Sim is a Python-based Wireless Sensor Network (WSN) simulator supporting AODV and DSR protocols.
To install the package, run the following command:
pip install wsn-sim
You can use the simulator by specifying options directly via the command line:
wsn-sim --protocol AODV --steps 10 --nodes 20 --links 30 --topology random
Alternatively, you can define these parameters in a .cfg
file and provide the file path:
# config.cfg
[simulation]
protocol = AODV
steps = 10
nodes = 20
links = 30
topology = random
Then run:
wsn-sim --config config.cfg
--config
: Path to the configuration file--protocol
: Choose the routing protocol (AODV/DSR)--steps
: Number of simulation steps--nodes
: Number of nodes in the network--links
: Number of random links between nodes--topology
: Network topology (grid/random/cluster)
To run the tests, use the following command:
python -m unittest discover tests
Here is an example of how to use the simulator:
-
Define your simulation parameters in a
.cfg
file:# simulation_config.cfg [simulation] protocol = DSR steps = 15 nodes = 25 links = 50 topology = random
-
Run the simulation using the configuration file:
wsn-sim --config simulation_config.cfg
-
Alternatively, run the simulation with parameters directly from the command line:
wsn-sim --protocol DSR --steps 15 --nodes 25 --links 50 --topology cluster
This project is licensed under the MIT License.
If you would like to contribute to this project, please fork the repository and submit a pull request. We welcome all improvements, including bug fixes, new features, and documentation enhancements.