It is an academic project for CS6390 Advanced Computer Networks taught by Jorge A. Cobb (Summer 2017). The goal is to simulate a simple Ad Hoc network and implement OLSR protocol. See requirements.md, Project_scenarios.pdf and SampleScenario.txtfor further details.
This project is run on one of campus VMs (csgrads1.utdallas.edu) with platform configuration: Linux – CentOS 7.4 x86_64 Dell PowerEdge R720 w/2 eight-core 2.2GHz Intel Xeon, 256GB RAM.
- The codes are written in C++ and compiled with g++ compiler.
- There are two execution files: "controller" and "node".
- Use shell script to launch one "controller" and several "node"s in background.
- The config file "topology.txt" is treated as a necessary input.
- There are two modes to compile and execute: normal mode and debugging mode. -- Normal mode: Run programs without debugging messages. -- Debugging mode: Run programs with debugging messages.
. [Root_of_Project]: the root directory of whole project
|-- controller: a directory with all source codes and the execution file of controller
|-- main.cpp: the source code of main program of controller
|-- Controller.h: the header file of Controller class
|-- Controller.cpp: the implementation details of Controller class
|-- Makefile: Makefile (default in normal mode)
|-- Makefile_debug_version: Makefile in debugging mode
|-- node: a directory with all source codes and the execution file of node
|-- main.cpp: the source code of main program of node
|-- Node.h: the header file of Node class
|-- Node.cpp: the implementation details of Node class
|-- Makefile: Makefile (default in normal mode)
|-- Makefile_debug_version: Makefile in debugging mode
|-- text: a directory with all fromX.txt, toX.txt and Xreceived.txt files (This will be created after running programs)
|-- log: a directory only for debugging (This will be created after running programs in debugging mode)
|-- "topology.txt": a text file with topology configuration
|-- "launcher.sh": an execution script to run "controller" and "node"s in background
|-- "launcher_debug_version.sh": an execution script to run "controller" and "node"s in background with debugging mode
- To compile in normal mode: -- No extra step for this.
- To compile in debugging mode: -- Replace "Makefile" with "Makefile_debugging_version". Do it for both node and controller.
- Enter the directory of controller by following command:
cd [Root_of_Project]/controller
- Compile with make command:
make
- As a result, there should be an execution file "controller" created under the directory of controller.
- Enter the directory of node by following command:
cd [Root_of_Project]/node
- Compile with make command:
make
- As a result, there should be an execution file "node" created under the directory of node.
- Modify "topology.txt" and "launcher.sh" (or "launcher_debugging_version.sh") into the way which fits the scenario.
- More details about "launcher.sh", please see the attached sample "launcher.sh".
- Note that if the compilation is done in debugging mode, please use "launcher_debugging_version.sh".
- Place files into right directories.
- Make sure "topology.txt" and "launcher.sh" is under [Root_of_Project].
- Make sure execution file "controller" is under [Root_of_Project]/controller.
- Make sure execution file "node" is under [Root_of_Project]/node.
- See more details at "Directories and Files Introduction" part.
- Enter [Root_of_Project] by following command:
cd [Root_of_Project]
- Make sure "launcher.sh" is executable by command:
chmod +x launcher.sh
- Run "launcher.sh" by following command:
./launcher.sh
- Then there should be some processes running in background.
- After about 120 seconds, all processes finish running.
- There should be all fromX.txt, toX.txt and Xreceived.txt created under [Root_of_Project]/text.
- A neighbor node who is in MPR set means it is also a bidiretional neighbor.
- For example, a HELLO message like:
* 0 HELLO UNIDIR 1 2 BIDIR 3 4 MPR 5 6
- Note that node 5 and 6 only appear in MPR (not in BIDIR).
- From this message, we know that node 0 has bidirectional neighbors 3, 4, 5, and 6.