The goal of this simulator is to measure latency and throughput on a precise use case for a NR V2X mesh network on into-train communication (between consist). The C++ simulator is based on ns-3 with the 5GLena extension which contains the V2X application.
I recommend to use a Linux distribution to run the simulator. The simulator is tested on Ubuntu 20.04 LTS.
| Prerequisite ns-3 | Version |
|---|---|
| C++ compiler | clang++ or g++ (g++ version 9 or greater) |
| Python | 3.6 or greater |
| CMake | 3.13 or greater |
| Build system | make, ninja, xcodebuild(XCode) |
All the prerequisites are available on the official website of ns-3 : ns-3 getting started
For the usages, you need some libraries and tools to build the 5GLena module.
Install libc6-dev (it provides semaphore.h header file). The Ubuntu package name is:
sudo apt-get install libc6-dev
Install sqlite:
apt-get install sqlite sqlite3 libsqlite3-dev
Notice that ns-3 and nr prerequisites are required (otherwise you will get an error, e.g: fatal error: ns3/sqlite-output.h).
All the prerequisites are available on the official website of 5GLena : 5GLena GitLab
To start, I recommend to read the 5GLena Gitlab and the ns-3 documentation.
To run these commands, you need to be in the simulator folder.
With examples :
./ns3 clean
./ns3 configure --build-profile=debug --enable-examples --enable-tests
./ns3 build
Without examples :
./ns3 clean
./ns3 configure --build-profile=debug --enable-tests
./ns3 build
Optimized build profile is for real simulation :
./ns3 clean
./ns3 configure --build-profile=optimized --enable-tests
./ns3 build
To run the simulation (It runs one time the simulation. For more you need the python script):
./ns3 run scratch/simulator/main.cc
All informations for Clion are avaibles on the ns-3 documentation : ns-3 Clion
In the jetbrains project there is some build profiles to start simulation with python scripts which are in the simulator_script folder. These python's scripts are used to start the simulations with some flexible parameters. They allow to run the simulation with different parameters without recompiling the simulator. They are running the simulator with the command line. All the measurements are saved in .db files to transmit them from the CPP simulator to the python script.
The CPP simulator main file is main.cc.
| Name | Version |
|---|---|
| NS-3 | 3.40 |
| 5GLena | v2x 0.3 |