- cd into folder "ns-3.34":
cd path_to_ns-3.34 - Clone this repository:
git clone https://github.com/mindt102/csma-ca-simulation.git - Move main.sh from csma-ca-simulation into ns-3.34:
mv csma-ca-simulation/main.sh . - Edit main.sh to change the parameters
- Run main.sh by
./main.shorbash main.sh
- cd into csma-ca-simulation:
cd csma-ca-simulation - To analyze an XML file:
python3 analyze.py flowData/path_to_file ls flowDatato see all configurations. E.g.: sv0-ps512 (Server node is node 0, Packet size is 512 byte => No RTS/CTS)- To analyze all XML file after running with 2..30 nodes:
./analyzeAll.sh configurationorbash analyzeAll.sh configuration(e.g.:./analyzeAll.sh sv0-ps512) - After analyzing data is summarized automatically and saved at analyzedData/"configuration" and summarizedData/"configuration" (e.g.:
analyzedData/sv0-ps512)
- cd into csma-ca-simulation:
cd csma-ca-simulation - Run the summarize script to see loss flow ratio of each case:
./summarize.sh "configuration"orbash summarize.sh "configuration"(e.g:./summarize.sh sv0-ps512)
- cd into csma-ca-simulation:
cd csma-ca-simulation - Run the python script
python3 plot.py path_to_summary_file(e.g:python3 plot.py summarizedData/sv0-ps512.csv)