Lab 4: Monitoring rApp
In this lab, you will deploy a 5G Standalone (SA) network using the OpenAirInterface (OAI) RF Simulator for the gNB and the OAI minimal 5G Core (5GC).
In the second phase of the experiment, you will use the BubbleRAN rApp SDK (Monitoring service) to deploy two MonitoringJob objects to collect real-time metrics from the MAC and RLC layers via the E2 interface. Each job automatically initiates a corresponding xApp. Collected data is stored in a MySQL database inside the cluster.
The MonitoringJob feature is under development and subject to change.
apiVersion: athena.trirematics.io/v1
kind: Network
metadata:
name: oran
namespace: trirematics
spec:
slices:
- plmn: "00101"
dnn: internet
network-mode: IPv4
service-type: 1
differentiator: 0x000001
ipv4-range: "12.1.1.0/24"
ipv6-range: "2001:1:2::/64"
access:
- name: oai-gnb
stack: 5g-sa
model: oai-ran/monolithic-gnb
radio:
device: rf-sim
identity:
an-id: 10
tracking-area: 1
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
core-networks:
- oai-5gc.oran
controller: ric.oran
core:
- name: oai-5gc
stack: 5g-sa
model: oai-cn/minimal
identity:
region: 0
cn-group: 4
cn-id: 5
edge:
- name: ric
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
---
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.oran
target-cores:
- oai-5gc.oran
identity:
imsi: "001010000000001"
pin: "1234"
opc: "0xc42449363bbad02b66d16bc975d77cc1"
key: "0xfec86ba6eb707ed08905757b1bb44b8f"
sqn: "0xff9bb4000001"
slice:
dnn: internet
network-mode: IPv4
service-type: 1
differentiator: 0x000001
radio:
bands:
- n78
readiness-check:
method: ping
target: google-ip
interface-name: oaitun_ue0
Network Deployment
Deploy the file using the command brc install network open-ran.yaml
.
The open-ran.yaml file does not include the xApp. The xApps will be deployed automatically by the SMO once the MonitoringJob objects are created.
Check for the status of the deployment using the command brc observe
and make sure all the Elements are in
the 1/1 Y
state.
Before starting the monitoring rApp, test UE connectivity:
brc test rtt ue1 gateway -- -c 3
Monitoring rApp
from br_rapp_sdk import MonitoringServices
from br_rapp_sdk.monitoring_services.monitoring_types import *
import time
if __name__ == "__main__":
# Initialize the A1Services
a1_services = MonitoringServices()
# Define the monitoring information for MAC layer
mac_monitoring_info = MonitoringObjectInformation(
target="ric.oran",
monitoringTypeId="mosaic5g/monitoring-python",
monitoringObject=MonitoringObject(
monitoringStatements=MonitoringStatements(
serviceModels=[
ServiceModel(name="MAC", periodicity="10")
],
database="SQL"
)
)
)
# Define the monitoring information for RLC layer
rlc_monitoring_info = MonitoringObjectInformation(
target="ric.oran",
monitoringTypeId="mosaic5g/monitoring-python",
monitoringObject=MonitoringObject(
monitoringStatements=MonitoringStatements(
serviceModels=[
ServiceModel(name="RLC", periodicity="100")
],
database="SQL"
)
)
)
# Print the monitoring information in YAML format
print("MAC Monitoring Object Information: \n", mac_monitoring_info.yaml())
print("RLC Monitoring Object Information: \n", rlc_monitoring_info.yaml())
# Apply the MAC monitoring object
mac_monitoring_name = "mac-monitoring"
mac_result = a1_services.apply_monitoring(
monitoring_name=mac_monitoring_name,
monitoring_object=mac_monitoring_info
)
# Check if the MAC monitoring object was applied successfully
if mac_result.status == 'success':
mac_monitoring_id = mac_result.data.get('monitoring_id')
print(f"MAC Monitoring Object applied successfully: {mac_monitoring_id}")
else:
print(f"Error applying MAC Monitoring Object: {mac_result.error}")
exit(1)
# Apply the RLC monitoring object
rlc_monitoring_name = "rlc-monitoring"
rlc_result = a1_services.apply_monitoring(
monitoring_name=rlc_monitoring_name,
monitoring_object=rlc_monitoring_info
)
# Check if the RLC monitoring object was applied successfully
if rlc_result.status == 'success':
rlc_monitoring_id = rlc_result.data.get('monitoring_id')
print(f"RLC Monitoring Object applied successfully: {rlc_monitoring_id}")
else:
print(f"Error applying RLC Monitoring Object: {rlc_result.error}")
exit(1)
# Wait until both monitoring objects are "Running"
while True:
mac_status = a1_services.get_monitoring_status(monitoring_id=mac_monitoring_id)
rlc_status = a1_services.get_monitoring_status(monitoring_id=rlc_monitoring_id)
mac_phase = mac_status.data.get('status', {}).get('phase') if mac_status.status == 'success' else 'error'
rlc_phase = rlc_status.data.get('status', {}).get('phase') if rlc_status.status == 'success' else 'error'
print(f"MAC status: {mac_phase}")
print(f"RLC status: {rlc_phase}")
if mac_phase and rlc_phase:
print("Both MAC and RLC Monitoring Objects are Running.")
break
time.sleep(3)
Use the following commands to run the rApp within the cluster:
python3 ./mon-rapp.py
Make sure the BubbleRAN rApp SDK is installed in your environment. You can install it using the command pip3 install br-rapp-sdk
.
Run the rApp inside the cluster, and make sure your kubeconfig file is located at ~/.kube/config.
Check for the status of the deployment using the command brc observe
, you should see two new xapp named monitoring-python.dynxapp-monitoring-python-3df268-ric.oran
for RLC and monitoring-python.dynxapp-monitoring-python-cef9d8-ric.oran
for MAC in the list of deployed xApps. Please wait until both are in the 1/1 Y
state, which indicates that they have been successfully deployed and are running.
To view collected metrics in the MySQL database, run:
brc cic mysql-db.sdl.oran run --follow -- sql
SELECT * FROM MAC_UE ORDER BY tstamp DESC LIMIT 10;
SELECT * FROM RLC_bearer ORDER BY tstamp DESC LIMIT 10;
💬 Questions
- What MAC-layer metrics are collected by the monitoring rApp? Hint: Use the command DESCRIBE MAC_UE; in the MySQL CLI.
- What RLC-layer metrics are collected by the monitoring rApp? Hint: Use the command DESCRIBE RLC_bearer; in the MySQL CLI.
- Can the rApp perform monitoring without an xApp? Why or why not?
- Extend the experiment by modifying the MonitoringJob definition to use both MAC and RLC service models in a single job. What differences do you observe compared to deploying them in separate jobs?