Lab 9: SLA 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 to develop and deploy a sample rApp that sends slicing policies to the Non-RT RIC via the R1 interface. These policies are then forwarded to the Near-RT RIC over the A1 interface, where a corresponding xApp enforces the policies at the gNB via the E2 interface. This setup enables dynamic slice management and ensures Service Level Agreement (SLA) enforcement at the RAN.
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 initial open-ran.yaml file does not include the xApp. The xApp will be deployed automatically by the SMO at a later stage in the experiment.
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’s throughput before any slice enforcement is applied in the network:
brc test throughput ue1 dl gateway -- -t 60
Slice Enforcement via rApp
from br_rapp_sdk import A1Services
from br_rapp_sdk.a1_services.a1_policy_types import *
# 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/sla"),
policy_object=PolicyObject(
scope_identifier=ScopeIdentifier(
slice_id=SliceId(
sst=1,
sd="000001",
plmn_id=PlmnId(
mcc="001",
mnc="01"
)
),
),
policy_statements=PolicyStatements(
policy_objectives=PolicyObjectives(
slice_sla_objectives=SliceSlaObjectives(
gua_dl_thpt_per_slice=40000,
max_dl_thpt_per_slice=40000
)
)
)
)
)
# 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 ./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 sla.dynxapp-sla-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.
Now, you can run the command below to see the throughput of the UE after the rApp enforces the slice:
brc test throughput ue1 dl gateway -- -t 60
There is a control loop between the xApp and the gNB, over the E2 interface, to maintain the requested throughput. The gNB periodically sends KPM Indication messages to the Near-RT RIC over the E2 interface. Based on these measurements, the xApp can adjust PRB by sending RC Control requests to the gNB if needed.
Check the logs of the xApp using the command brc extract logs sla.dynxapp-sla-ric.oran
to see the slice enforcement process.
💬 Lab Questions 💬
- What is the difference in the roles of the xApp and rApp in this experiment?
- Why is there a control loop between the xApp and the gNB, and what is its function in the context of SLA enforcement?
- Draw the message flow, starting from the rApp, through the Non-RT RIC, Near-RT RIC, xApp, and down to the RAN.
- Why is the xApp deployed by the SMO and not manually by the user? What are the benefits of this automation?
- Extend the experiment by using two UEs in two different slices. Send two policies with different scopes and statements for SLA enforcement.