This project includes an e2e setup and integration of V2X ns3 module of 5G-LENA with OpenRAN architecture with the purpose of implementing the resource allocation functionality of V2X networks in O-RAN architecture.
It contains the OpenRAN RIC of O-RAN architecture, the xApp implementing the logic of resource scheduling in V2X networks, the modified V2X ns3 module of 5G-LENA and the E2 inteface connecting the ns3 module with O-RAN.
To run the project:
- Install the ns3 packages needed to run ns3.
- Configure & build ns3-v2x-scheduling
cd ../ns3-v2x-scheduling
./ns3 configure --build-profile=debug --disable-werror --enable-examples
./ns3 build
- Import docker images and setup docker containers of OpenRAN RIC based on OpenRAN GYM
cd ../colosseum-near-rt-ric/setup-scripts
./setup-ric-bronze.sh
At the end of the build, the added containers in docker should be the following: e2term, db, e2mgr, e2rtmansim.
- Create & install the shared library e2sim (E2-interface connecting ns3-module with OpenRAN-RIC via SCTP/IP)
cd ../oran-e2sim/e2sim
./build_e2sim.sh
- Setup the xApp container
cd ../v2x-xapp/setup-scripts
./setup-xapp-base.sh # Downloads & install the base image with the updated libraries. The base image shall have the e2 interface pre-installed, thus by default having enabled the connection with e2term and the exchange of E2 messages
./start-xapp-ns-o-ran.sh # Creates a secondary image with the python scripts of the xapp logic
# if outside the xapp container, access bash mode of the container -> docker exec -it xapp-v2x-24 bash
# Once inside the xapp container, go to /home/xapp-sm-connector directory
Following the aforementioned steps, the xApp is configured to receive E2 messages, decode the xml format of the these messages and send back E2-Ric encoded messages.
The simulation involves these steps:
- Starting the xApp Agent in the xApp container: It starts the SCTP/IP server and binds to local address and accepts connection from the RIC
- Starting the ns3 simulation instances: Inside the ns3 it is started the ns3-E2-Termination endpoint, which connects ns3 to RIC via SCTP/IP. This simulation instance waits for Subscription Requests coming from RIC to start sending reports to the xApp.
- Starting RIC-E2-endpoint: The end point responsible to decode the incoming E2 messages, route them to the appropriate xApp and maintain the Service Model paradigm.
It is crucial to execute the steps as shown above: ns3 simulation instances (2) before the RIC-E2-endpoint(3), so that the ns3-E2-Termination endpoint can received and decode the Subscribe Requests generated by the RIC-E2-endpoint; start xApp-Agent (1) before the RIC-E2-endpoint, as the last opens a TCP/IP socket connection to the xApp and if xApp has not started and bind to the receiving address, the RIC won't be able to forward the incoming control messages
- Start xApp-Aggent
# Enter inside xApp container
docker exec -it xapp-v2x-24 bash
cd /home/xapp-v2x
python3 run_xapp_parallel.py
- Starting ns3 simulation instances
cd ../v2x-oran-scheduling
python3 v2x_sched.py # Launches multiple processes in parallel, one per each simulation scenario
- Starting RIC-E2-endpoint
docker exec -it xapp-v2x-24 bash
cd /home/xapp-sm-connector
./run_xapp.sh