Lab 5: Scoped KPM 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 (A1 service) to deploy a policyJob object to enforce a slice(SST=1, SD=000001) with specific PRB allocation in DL.
In the last phase of the experiment, you will use the BubbleRAN rApp SDK (Monitoring service) to deploy a MonitoringJob object to collect real-time metrics from the KPM service model for a specific slice (SST=1, SD=000001). Collected data is stored in a Victoria Metrics database inside the cluster.
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.
Please run the following command to check the UE connectivity:
brc test rtt ue1 gateway -- -c 3
Slice Enforcement via rApp
from br_rapp_sdk import A1Services
from br_rapp_sdk.a1_services.a1_policy_types import *
if __name__ == "__main__":
# Initialize the A1Services
a1_services = A1Services()
# Define the policy information
policy_info = PolicyObjectInformation(
near_rt_ric_id =NearRtRicId("ric.oran"),
policy_type_id=PolicyTypeId("bubbleran/slicing"),
policy_object=PolicyObject(
scope_identifier=ScopeIdentifier(
slice_id=SliceId(
sst=1,
sd="000001"
),
cell_id=CellId(
plmn_id=PlmnId(
mcc="001",
mnc="01"
)
),
),
policy_statements=PolicyStatements(
policy_objectives=PolicyObjectives(
lb_objectives=LbObjectives(
target_prb_usg=10,
prb_usg_type=7
)
)
)
)
)
# Print the policy information in YAML format
print("Policy Object Information: \n", policy_info.yaml())
# Apply the policy
policy_name= "slice1"
result = a1_services.apply_policy(policy_name = policy_name, policy_object = policy_info)
# Check if the operation was successful
if result.status == 'success':
policy_id = result.data.get('policy_id')
print(f"Policy applied successfully: {policy_id}")
else:
print(f"Error applying policy: {result.error}")
Use the following commands to run the rApp within the cluster:
python3 ./slicing-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 a new xapp named slicing.dynxapp-slicing-ric.oran in the list of deployed xApps. Please wait until the xApp is in the 1/1 Y state, which indicates that it has been successfully deployed and is running.
Monitoring rApp
The MonitoringJob feature is under development and subject to change.
from br_rapp_sdk import MonitoringServices
from br_rapp_sdk.monitoring_services.monitoring_types import *
if __name__ == "__main__":
# Initialize the monitoring services
monitoring_services = MonitoringServices()
# Define the monitoring object information
monitoring_object_info = MonitoringObjectInformation(
target=TargetId("ric.oran"),
monitoring_type_id=MonitoringTypeId("bubbleran/mon"),
monitoring_object=MonitoringObject(
scope_identifier=ScopeIdentifier(
slice_id=SliceId(
sst=1,
sd="000001"
)
),
monitoring_statements=MonitoringStatements(
serviceModels=[
ServiceModel(
name="KPM",
periodicity="1000"
)
],
database=DatabaseType(
victoriaMetrics=VictoriaMetricsDatabase(scenario="slice1_scenario")
)
)
)
)
# Print the monitoring object information in YAML format
print("Monitoring Object Information: \n", monitoring_object_info.yaml())
# Apply the monitoring job
monitoring_name = "kpm-monitoring-job"
result = monitoring_services.apply_monitoring(monitoring_name=monitoring_name, monitoring_object=monitoring_object_info)
# Check if the operation was successful
if result.status == 'success':
monitoring_id = result.data.get('monitoring_id')
print(f"Monitoring job applied successfully: {monitoring_id}")
else:
print(f"Error applying monitoring job: {result.error}")
Use the following commands to run the rApp within the cluster:
python3 ./scoped-kpm-rapp.py
Check for the status of the deployment using the command brc observe, you should see a new xapp named mon.dynxapp86c4de-ric.oran for KPM in the list of deployed xApps. Please wait until it is in the 1/1 Y state, which indicates that it has been successfully deployed and is running.
You can check the logs of the xApp using the command:
brc extract logs mon.dynxapp86c4de-ric.oran
Now, you can run the command below to send traffic and observe the collected KPM metrics for that slice in the Victoria Metrics database.:
brc test throughput ue1 dl gateway -- -t 60
Uninstall
To uninstall the network, policy job, and monitoring jobs, use the following command:
brc remove network open-ran.yaml
brc remove policyjob slice1
brc remove monitoringjob kpm-monitoring-job
Checking via the brc observe command, you should see that all the elements and rApp jobs are removed.
💬 Questions
- What KPM metrics are collected by the monitoring rApp for the specific slice?
- Use the lab Visualizing Data in Grafana to visualize the collected KPM metrics in Grafana.