Software-defined End-to-End 5G Network

In this tutorial, we will show how the entire end-to-end 5G network can be simulated using software defined user equipment (UE). This allows for the evaluation of novel — non-standard compliant — algorithms and protocols. Such a setup enables you to test and prototype two-sided network functions such as AI/ML-based CSI feedback compression or even custom constellations for pilotless communications.

Ensure that you have already built the UE container oai-nr-ue (see OpenAirInterface Setup).

Note

For end-to-end RF experiments, this tutorials requires a second Jetson device with another USRP connected to the second device (or two USRPs connected to the same Jetson). However, end-to-end simulations can be done by using OAI’s rfsimulator mode. In this mode, the UE is connected to the gNB via a simulated radio interface without the need for actual RF hardware.

Run the gNB

Before connecting the UE, the gNB needs to be ready to connect. As we are using the rfsimulator mode, we need to start the gNB using a slightly different configuration file.

# start the gNB with USRP connected
./scripts/start_system.sh b200_arm64

# or start the gNB in rfsimulator mode
./scripts/start_system.sh rfsim_arm64_rfsim

The main difference in the configuration files is that the USRP is replaced by the simulated channel interface.

Check that the gNB is running correctly

docker logs -f oai-gnb

During the initialization procedure, the gNB provides the required UE parameters

136387.122571 [PHY] A (nr_common_signal_proced:92) Command line parameters for OAI UE: -C 3319680000 -r 106 --numerology 1 --ssb 516

These parameters depend on the choice of the configuration file of the gNB. Ensure this is properly set as UE_EXTRA_OPTIONS in the .env file in the corresponding configs directory.

For RF experiments, please also set the USRP_SERIAL_UE to the serial number of the USRP connected to the UE. For cable-based experiments, the two USRPs must be connected as shown in Fig. 19.

Note

As the rfsimulator does not run in real-time mode, one can simulate a larger number of PRBs than in the case of the USRP.

Run the UE

We are now ready to connect the UE to the gNB.

Instead of using a real sim-card the UE can be configured via the configs/common/nrue.uicc.conf file. In case you modify the IMSI, ensure it is registered in the the `oai_db.sql. Otherwise, the UE will not be recognized by the 5G core network.

Ensure that the UE configuration in the docker-compose.yaml file is correctly configured. In particular, the additional UE_EXTRA_OPTIONS parameters in the .env file must be correctly aligned with gNB config. For the above example with 106 PRBs, the UE_EXTRA_OPTIONS should be

UE_EXTRA_OPTIONS=-r 106 --numerology 1 -C 3319680000

For RF based experiments, we recommend to use the 24 or 51 PRB configurations.

Note that the start_system.sh script will automatically start the UE when the gNB is running. Otherwise, you can start the UE with

cd configs/rfsim_arm64/
docker compose up -d oai-nr-ue

# and shutdown the UE
docker compose stop oai-nr-ue

For RF experiments, this needs to be done on the second Jetson device.

Verify that the UE is running correctly

docker logs -f oai-nr-ue

You should now see the UE connected to the gNB.

Test performance

Verify that an IP address was assigned

docker exec -ti oai-nr-ue ifconfig

This should show a network interface with IP 12.1.1.2.

Ping an external network

docker exec -ti oai-nr-ue ping -I oaitun_ue1 google.com

You can access the current UE stats via

docker exec -ti oai-nr-ue cat nrL1_UE_stats-0.log

Or run an end-to-end speed test via

docker exec -d oai-ext-dn iperf3 -s

# Running uplink test (UE to gNB)
docker exec -ti oai-nr-ue iperf3 -u -t 10 -i 1 -b 5M -B 12.1.1.2 -c 192.168.72.135

# Running downlink test (gNB to UE)
docker exec -ti oai-nr-ue iperf3 -u -t 10 -i 1 -b 5M -B 12.1.1.2 -c 192.168.72.135 -R

You can now also run multiple UEs by adding more instances of oai-nr-ue in the docker-compose.yaml file to simulate a multi-user scenario.