Skip to main content

Lab 4: Dataset Collection in RAN

This experiment is to deploy a 5G Standalone (SA) network using OpenAirInterface (OAI) RF Simulator gNB and OAI minimal 5GC. We also deploy FlexRIC as the Near-RT RIC. For this lab, a MySQL database is also deployed within the network for xApps to store data. Finally a custom monitoring xApp with callbacks will be deployed on bare-metal connecting to the RIC and the database.

open-ran-db.yaml
apiVersion: athena.trirematics.io/v1
kind: Network
metadata:
name: bubbleran
namespace: trirematics
spec:
slices:
- plmn: "00101"
dnn: "internet"
network-mode: "IPv4"
service-type: eMBB
differentiator: 0x000000
ipv4-range: "12.1.1.0/24"
ipv6-range: "2001:db8:1::/64"
access:
- name: oai-gnb
stack: 5g-sa
model: oai-ran/monolithic-gnb
identity:
an-id: 50
radio:
device: rf-sim
cells:
- band: n78
arfcn: 641280
bandwidth: 40MHz
subcarrier-spacing: 30kHz
tdd-config:
period: 5ms
dl-slots: 7
dl-symbols: 6
ul-slots: 2
ul-symbols: 4
controller: flexric.bubbleran
core-networks:
- minimal.bubbleran
core:
- name: minimal
stack: 5g-sa
model: oai-cn/minimal
identity:
region: 0
cn-group: 4
cn-id: 5
dns:
ipv4:
default: 8.8.8.8
secondary: 8.8.4.4
edge:
- name: flexric
stack: 5g-sa
model: mosaic5g/flexric
- name: sdl
stack: 5g-sa
model: mosaic5g/xapps-sdl
---
apiVersion: athena.trirematics.io/v1
kind: Terminal
metadata:
name: ue1
namespace: trirematics
spec:
vendor: oai
stack: 5g-sa
model: terminal/nr-rfsim
preferred-access: oai-gnb.bubbleran
target-cores:
- minimal.bubbleran
identity:
imsi: "001010000000001"
pin: "1234"
opc: "0xc42449363bbad02b66d16bc975d77cc1"
key: "0xfec86ba6eb707ed08905757b1bb44b8f"
sqn: "0xff9bb4000001"
slice:
dnn: "internet"
network-mode: "IPv4"
service-type: eMBB
differentiator: 0x000000
radio:
bands:
- n78
readiness-check:
method: ping
target: google-ip
interface-name: oaitun_ue0

---
apiVersion: athena.trirematics.io/v1
kind: Terminal
metadata:
name: ue2
namespace: trirematics
spec:
vendor: oai
stack: 5g-sa
model: terminal/nr-rfsim
preferred-access: oai-gnb.bubbleran
target-cores:
- minimal.bubbleran
identity:
imsi: "001010000000002"
pin: "1234"
opc: "0xc42449363bbad02b66d16bc975d77cc1"
key: "0xfec86ba6eb707ed08905757b1bb44b8f"
sqn: "0xff9bb4000001"
slice:
dnn: "internet"
network-mode: "IPv4"
service-type: eMBB
differentiator: 0x000000
radio:
bands:
- n78
readiness-check:
method: ping
target: google-ip
interface-name: oaitun_ue0

Deployment​

Use the command brc install network open-ran-db.yaml to deploy the network. It should finish without errors and printout the three Kubernetes resource names that were created. Check for the status of the deployment using the command brc observe. Wait until all the Elements other than the UE are in the STATUS set to 1/1 Y state.

After deploying the network, before running the xApp, you should update the xApp configuration file with the IP of the deployed Near-RT RIC, the local source IP in the cluster subnet and the deployed database. To do so you may execute the update_conf.sh script which automatically extract the IPs from the cluster and updates the specified configuration file:

cd /path/to/xapp-source/conf_files
./update_conf.sh -c xapp_cust_sm.conf
tip

Once the network is deployed, traffic can be generated between the UEs and the network with the following commands:

brc test throughput ue1 dl gateway -- -t 600
brc test throughput ue2 dl gateway -- -t 600

With the brc test throughput tool the user can generate iperf traffic from the UPF (gateway) to the UE for downlink traffic (dl) or vice-versa for uplink (ul). For more details you may check the BubbleRAN CLI reference.

The script will prompt the user for selecting which Near-RT RIC the xApp should connect to (in case of multiple RICs and/or networks currently deployed). Since xapp_all_sm.conf also defines the database information, the script will prompt the user to specify which database in the deployed network to connect to.

After selecting a RIC and database to connect, an output as the following is obtained:

Select the RIC to configure (enter number):
1) flexric.flexric.bubbleran (10.244.2.142)
Choice [1-1]: 1
Selected RIC: flexric.flexric.bubbleran with IP 10.244.2.142
Local IP for xApp: 10.244.0.218
Select the Database to configure (enter number):
1) mysql-db.sdl.bubbleran (10.244.0.253)
Choice [1-1]: 1
Selected Database IP: 10.244.0.253
Config file 'xapp_cust_sm.conf' updated successfully.
warning

Before running this lab, the user should build the targets with MYSQL_XAPP CMakeList option as follows:

cd build
cmake -DXAPP_DB=MYSQL_XAPP ..
make -j

Once the configuration file has been updated accordingly, now the monitoring xApp can be run:

cd build
./src/dev/c/xapp_cust_moni -c ../conf/xapp_cust_sm.conf

If run successfully an output like the following should be obtained:

08:54:35.682258 [INFO]:  conf_file.c:443 Config -c file to ../conf_files/xapp_all_sm.conf
08:54:35.682366 [INFO]: e42_xapp_api.c:81 Git SHA1 fea7dffd78de11f0d97ef16a0fda2937cbab544e
08:54:35.682370 [INFO]: e42_xapp.c:191 NearRT-RIC Server IP Address = 10.244.2.142, PORT = 36422
08:54:35.682412 [INFO]: emb_sm_ag.c:93 Loaded SM(s) 10, custom SMs true
08:54:35.682423 [INFO]: emb_sm_ric.c:93 Loaded SM(s) 10, custom SMs true
08:54:35.682906 [INFO]: msg_handler_xapp.c:533 E42 SETUP-REQUEST tx
08:54:35.683124 [INFO]: msg_handler_xapp.c:374 E42 SETUP-RESPONSE rx xApp ID 8
08:54:35.683129 [INFO]: msg_handler_xapp.c:390 Connected E2 Node(s) 1
Sending subscription
E2 node idx 0 info: nb_id 50, mcc 1, mnc 1, mnc_digit_len 2, ran_type ngran_gNB
Registered E2 node idx 0, supported RAN Func ID = 2
Registered E2 node idx 0, supported RAN Func ID = 3
Registered E2 node idx 0, supported RAN Func ID = 4
Registered E2 node idx 0, supported RAN Func ID = 142
Registered E2 node idx 0, supported RAN Func ID = 143
Registered E2 node idx 0, supported RAN Func ID = 144
Registered E2 node idx 0, supported RAN Func ID = 145
Registered E2 node idx 0, supported RAN Func ID = 146
Registered E2 node idx 0, supported RAN Func ID = 147
Registered E2 node idx 0, supported RAN Func ID = 148
xApp subscribes RAN Func ID 142 in E2 node idx 0, nb_id 50
08:54:36.683382 [INFO]: msg_handler_xapp.c:568 RIC_SUBSCRIPTION_REQUEST tx RAN_FUNC_ID 142 RIC_REQ_ID 1
08:54:36.684552 [INFO]: msg_handler_xapp.c:155 RIC_SUBSCRIPTION_RESPONSE rx RAN_FUNC_ID 142 RIC_REQ_ID 1
xApp subscribes RAN Func ID 143 in E2 node idx 0, nb_id 50
08:54:36.684594 [INFO]: msg_handler_xapp.c:568 RIC_SUBSCRIPTION_REQUEST tx RAN_FUNC_ID 143 RIC_REQ_ID 2
08:54:36.685608 [INFO]: msg_handler_xapp.c:155 RIC_SUBSCRIPTION_RESPONSE rx RAN_FUNC_ID 143 RIC_REQ_ID 2
xApp subscribes RAN Func ID 144 in E2 node idx 0, nb_id 50
08:54:36.685630 [INFO]: msg_handler_xapp.c:568 RIC_SUBSCRIPTION_REQUEST tx RAN_FUNC_ID 144 RIC_REQ_ID 3
08:54:36.685950 [INFO]: msg_handler_xapp.c:155 RIC_SUBSCRIPTION_RESPONSE rx RAN_FUNC_ID 144 RIC_REQ_ID 3
[xApp]: reporting period = 1000 [ms]
xApp subscribes RAN Func ID 2 in E2 node idx 0, nb_id 50
08:54:36.686002 [INFO]: msg_handler_xapp.c:568 RIC_SUBSCRIPTION_REQUEST tx RAN_FUNC_ID 2 RIC_REQ_ID 4
08:54:36.686266 [INFO]: msg_handler_xapp.c:155 RIC_SUBSCRIPTION_RESPONSE rx RAN_FUNC_ID 2 RIC_REQ_ID 4
[xApp]: reporting period = 1000 [ms]
[xApp]: reporting period = 1000 [ms]
MAC ind_msg latency = 18446744073709330270 from E2-node type 2 ID 50
RLC ind_msg latency = 18446744073709330161 from E2-node type 2 ID 50
PDCP ind_msg latency = 18446744073709330170 from E2-node type 2 ID 50

Accessing the database​

In order to access the MySQL database deployed within the cluster, first, we need to obtain the IP within cluster. To do that, first we need to extract the IP of the database kubernetes pod as follows:

# To get just the IP
kubectl get pods -n trirematics -o wide | awk '/mysql-db\.sdl/ { print $6 }'
tip

The IP of the database is already found on the configuration file ../conf_files/xapp_all_sm.conf that we previously updated. Indeed, the output of the update_conf.sh script already provided the IP of the database.

Now, we can access the database with the IP (e.g. 10.244.3.75), the credentials specified in the configuration file (found in conf_files/xapp_all_sm.conf) and when prompt, use password linux:

 mysql -u oai -h 10.244.0.253 -P 3306 -p testdb
Enter password: linux

Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 10
Server version: 8.0.35-0ubuntu0.20.04.1 (Ubuntu)

Copyright (c) 2000, 2025, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> SHOW TABLES;
+------------------------+
| Tables_in_testdb |
+------------------------+
| GTP_NGUT |
| KPM_HDR |
| KPM_IND_MEAS_DATA |
| KPM_IND_MEAS_DATA_INFO |
| KPM_IND_MEAS_INFO |
| KPM_IND_UE_ID_E2SM |
| MAC_UE |
| PDCP_bearer |
| RLC_bearer |
| SLICE |
| TC_packet |
| UE_SLICE |
+------------------------+
12 rows in set (0.00 sec)

mysql> select * from RLC_bearer;

Uninstall​

To uninstall the network, use the following command:

brc remove network open-ran-db.yaml

Checking via the brc observe command, you should see that all the elements are removed.

πŸ’¬ Lab Questions πŸ’¬

  1. Validate the MAC statistic (custom service model) in the database using SQL query.
  2. Use available tools to visualize the database.
  3. Construct a query to get the PLMN of the cell and the UE RNTI.

Advanced

This lab can also be performed leveraging an over-the-air deployment. In this section, we provide a sample deployment with a LITEON RU. Similarly to the previous deployment, this includes a 5G Standalone (SA) network with OpenAirInterface (OAI) gNB using a LITEON RU device, and Open5GS core network.

open-ran-liteon.yaml
apiVersion: athena.trirematics.io/v1
kind: Network
metadata:
name: bubbleran
namespace: trirematics
spec:
slices:
- plmn: "00101"
dnn: internet
network-mode: IPv4
service-type: eMBB
differentiator: 0x000000
ipv4-range: 12.1.1.0/24
ipv6-range: 2001:db8:1::/64
access:
- name: oai-gnb
stack: 5g-sa
model: oai-ran/monolithic-gnb-ru #cu-du-ru
identity:
an-id: 30
tracking-area: 1
radio:
device: oran-7.2
antenna:
formation: 4x4
scheduling:
nodeName: bubble2 # Change with any other CU-DU node
annotations:
# PCI IDs obtained by running `dpdk-devbind.py --status` in the CU-DU node
extras.t9s.io/pci-ids: '["0000:01:11.0", "0000:01:11.1"]'
# VF MACs obtained for dpdk0 interface by running `ip link show` in CU-DU node
extras.t9s.io/du-macs: '["02:11:22:33:44:66", "02:11:22:33:44:67"]'
# RU MAC (repeated) obtained by logging into RU and running `show eth-info`
extras.t9s.io/ru-macs: '["e8:c7:4f:25:80:f9", "e8:c7:4f:25:80:f9"]'
extras.t9s.io/mtu: '9000'
# RU IP used for logging into it
extras.t9s.io/o1-remote-ipv4: 192.168.1.40
# Flag for reboot, after first use, it can be set to `false` if values in 'cells' is not changed
extras.t9s.io/liteon-ru-reboot: 'true' #'false'
cells:
- band: n78
arfcn: 643296
bandwidth: 100MHz
subcarrier-spacing: 30kHz
tdd-config:
period: 2.5ms
dl-slots: 3
dl-symbols: 6
ul-slots: 1
ul-symbols: 4
controller: flexric.bubbleran
core-networks:
- ogscore.bubbleran
core:
- name: ogscore
stack: 5g-sa
model: open5gs/5gc
profiles:
- debug
identity:
region: 128
cn-group: 4
cn-id: 5
edge:
- name: flexric
stack: 5g-sa
model: mosaic5g/flexric
- name: sdl
stack: 5g-sa
model: mosaic5g/xapps-sdl
dns:
ipv4:
default: 8.8.8.8
secondary: 8.8.4.4

Deployment​

Use the command brc install network open-ran-liteon.yaml to deploy the network. It should finish without errors and printout the three Kubernetes resource names that were created. Check for the status of the deployment using the command brc observe. Wait until all the Elements other than the UE are in the STATUS set to 1/1 Y state.

After the network has been successfully deployed, the monitoring xApp can be deployed following the exact same steps previously detailed.

warning

Before deploying this network first make sure:

  1. The CU-DU node name specified in the deployment file (in this case bubble2 on the section scheduling) is correct.
  2. The CU-DU node is able to reach the RU IP specified in the deployment file. If not sure about the IP, please check the Google Sheet (provided to all customers) with all IPs of your MX-PDK. To do so you may try to ssh into the RU from the node with the command ssh user@RU-IP replacing RU-IP with the actual IP.
  3. The CU-DU node is properly synchronized with the PTP grandmaster switch. To do so you may check the status with
sudo systemctl status ptp4l.service
sudo systemctl status phc2sys.service
  1. The CU-DU node's DPDK has been setup with
sudo dpdk-setup