A wireless network simulator and wormhole detection module based on my self-designed algorithm.
This is a wireless network simulator based on Python. The simulator didn't need any extra Python package, so you can run it just with Python.
I created a brand-new wormhole detection algorithm based on my teacher Lu Li's paper. In fact the algorithm is just a simplified version of my teacher's.
- Run the sensor's network firstly
Use python main.py
to run this program.
After that, you should wait about 5 seconds, because the network needs to be inited.
Then you should see some output generated by the Sink Node.
- Then the wormhole detection
Just press the enter button, the program will insert a wormhole node, and the wormhole detection algorithm will be running. You should see some output about the wormhole detection.
Notice: In fact you should wait until the program give you like "Network init finished." prompt then press the enter button.
- Close the program
Just press the enter button again, the program will be closed.
- About the network
The networktest.py will receive a network file as input. The network.py will create a network which nodes are randomly placed. One thing you need to do is set the nodes' number.
- Create a network which nodes are placed handfully
Firstly create a new network file in the NetworkFiles folder. There is an example for the network file.
0 0
12 23
32 34
This means there are three nodes in the network, the ID is 0, 1, 2(auto incremted, you can see). And the nodes' coordinates are (0, 0), (12, 23), (32, 34). Then you should go to the networktest.py modify the TEST_FILE constants.
- Create a network randomly
Firstly modify the main.py, change the from networktest import *
to from network import *
Secondly modify the network.py, change the RANDOM_NODES_NUMBER
constants to any number you want.
I am too lazy to write, if you have any question, contact me, I will be pleased to answer
This is my graduate design. The 毕业设计.doc is my graduate design paper.