Lab 11: KPM Monitoring rApp with OCUDU
This is an experimental blueprint intended for Non-Terrestrial Network (NTN) evaluation in an emulated environment.
This lab has two parts:
- Deploy the network. You deploy an emulated 5G Standalone (SA) network with an OCUDU Non-Terrestrial Network (NTN) gNB and an OAI UE. FlexRIC acts as the Near-RT RIC and connects to the gNB over the E2 interface.
- Monitor the network. You use the Monitoring service of the BubbleRAN rApp SDK to create a MonitoringJob that collects Key Performance Measurement (KPM) metrics from the gNB. When the job is created, the SMO automatically deploys a monitoring xApp. The xApp subscribes to the KPM service model over E2 and stores the collected metrics in the Victoria Metrics database in the cluster.
Network Deployment
ocudu-oai-net.yaml
apiVersion: athena.trirematics.io/v1
kind: Network
metadata:
name: ocudu-zmq-ntn
namespace: trirematics
spec:
slices:
- plmn: "00101"
dnn: internet
network-mode: IPv4
service-type: 1
differentiator: 0x000000
ipv4-range: 12.1.1.0/24
ipv6-range: 2001:db8:1::/64
access:
- name: gnb
stack: 5g-sa
model: ocudu/monolithic-gnb-ntn
identity:
an-id: 30
tracking-area: 1
radio:
device: zmq
annotations:
terminals.roles.athena.t9s.io/oai-ue: "oai-ue-ntn.oai-ue.oai-ue.t9s.local"
cells:
- band: n256
arfcn: 437000
bandwidth: 5MHz
subcarrier-spacing: 15kHz
core-networks:
- minimal.ocudu-zmq-ntn
controller: flexric.ocudu-zmq-ntn
core:
- name: minimal
stack: 5g-sa
model: oai-cn/minimal
identity:
region: 0
cn-group: 4
cn-id: 5
edge:
- name: flexric
stack: 5g-sa
model: mosaic5g/flexric
dns:
ipv4:
default: 8.8.8.8
secondary: 8.8.4.4
---
apiVersion: athena.trirematics.io/v1
kind: Terminal
metadata:
name: oai-ue
namespace: trirematics
spec:
vendor: oai
stack: 5g-sa
model: terminal/oai-ue-ntn
preferred-access: gnb.ocudu-zmq-ntn
target-cores:
- minimal.ocudu-zmq-ntn
identity:
imsi: "001010000000001"
pin: "1234"
opc: "0xc42449363bbad02b66d16bc975d77cc1"
key: "0xfec86ba6eb707ed08905757b1bb44b8f"
sqn: "0xff9bb4000001"
slice:
dnn: internet
network-mode: IPv4
service-type: 1
differentiator: 0x000000
radio:
device: zmq
formation: "1x1"
bands:
- n256
readiness-check:
method: ping
target: google-ip
interface-name: oaitun_ue1
Deploy the network:
brc install network ocudu-oai-net.yaml
The ocudu-oai-net.yaml file does not define a monitoring xApp. The SMO deploys one automatically when the rApp creates the MonitoringJob.
Run brc observe and wait until every Element shows 1/1 Y.
Then check that the UE is connected by sending three pings to the gateway:
brc test rtt oai-ue gateway -- -c 3
KPM Monitoring rApp
The following rApp creates a MonitoringJob named kpm-monitoring, then waits until the job is running:
from br_rapp_sdk import MonitoringServices
from br_rapp_sdk.monitoring_services.monitoring_types import *
import time
if __name__ == "__main__":
# Initialize the A1Services
monitoring_services = MonitoringServices()
# Define the monitoring information for KPM
kpm_monitoring_info = MonitoringObjectInformation(
target="flexric.ocudu-zmq-ntn",
monitoringTypeId="mosaic5g/monitoring-c",
monitoringObject=MonitoringObject(
monitoringStatements=MonitoringStatements(
serviceModels=[
ServiceModel(name="KPM", periodicity="1000")
],
profiles=["ocudu"],
database=DatabaseType(
victoriaMetrics=VictoriaMetricsDatabase(scenario="test_kpm_ntn")
)
)
)
)
# Print the monitoring information in YAML format
print("KPM Monitoring Object Information: \n", kpm_monitoring_info.yaml())
# Apply the monitoring object
monitoring_name = "kpm-monitoring"
result = monitoring_services.apply_monitoring(
monitoring_name=monitoring_name,
monitoring_object=kpm_monitoring_info
)
# Check if the monitoring object was applied successfully
if result.status == 'success':
monitoring_id = result.data.get('monitoring_id')
print(f"KPM Monitoring Object applied successfully: {monitoring_id}")
else:
print(f"Error applying KPM Monitoring Object: {result.error}")
exit(1)
# Wait until the monitoring object is "Running"
while True:
status = monitoring_services.get_monitoring_status(monitoring_id=monitoring_id)
phase = status.data.get('status', {}).get('phase') if status.status == 'success' else 'error'
print(f"KPM status: {phase}")
if phase == "Running":
print("KPM Monitoring Objects is Running.")
break
time.sleep(3)
The MonitoringJob defines:
- Target:
flexric.ocudu-zmq-ntn, the FlexRIC instance that the OCUDU gNB connects to. - Service model:
KPM, reported every 1000 ms (periodicity="1000"), with theocuduprofile. - Database: Victoria Metrics. The
scenariolabel (test_kpm_ntn) tags every sample from this job, so you can filter on it when you query the data later.
Before you run the rApp:
- Install the BubbleRAN rApp SDK if it is not already installed:
pip3 install br-rapp-sdk. - Run the rApp from a machine with access to the cluster, and make sure your kubeconfig file is at
~/.kube/config.
Run the rApp:
python3 ./mon-rapp-ocudu.py
The rApp prints the MonitoringJob in YAML format, followed by KPM Monitoring Object applied successfully and the job ID. It then prints the job status every few seconds and exits once the status is Running.
Run brc observe again. A new xApp whose name starts with monitoring-c.dynxapp (for example, monitoring-c.dynxapp1e18f4-flexric.ocudu-zmq-ntn) appears in the list. Wait until it shows 1/1 Y, which means it is deployed and running.
Follow the xApp logs to see the KPM reports. Replace the name with the one shown by brc observe:
brc extract logs monitoring-c.dynxapp1e18f4-flexric.ocudu-zmq-ntn
In a second terminal, generate uplink traffic from the UE for 60 seconds:
brc test throughput oai-ue ul gateway -- -t 60
While the test runs, watch the xApp logs. The uplink throughput metric DRB.UEThpUl should increase.
Uninstall
Remove the network and the MonitoringJob:
brc remove network ocudu-oai-net.yaml
brc remove monitoringjob kpm-monitoring
Run brc observe to confirm that all Elements and rApp jobs are gone.
💬 Questions
- Which KPM metrics does the OCUDU gNB report? Are any metrics missing compared with the OAI gNB in Lab 5?
- Compare the uplink throughput reported by the KPM xApp with the result of
brc test throughput. Do the values match? Explain any difference. - Follow Visualizing Data in Grafana to plot the collected KPM metrics in Grafana.