Skip to main content

Lab 2: Slicing 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 Load balancing 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 the creation of network slices with maximum downlink Physical Resource Block (PRB) allocation at the RAN.

open-ran.yaml
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.

tip

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

slicing-rapp.py
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
danger

Make sure the BubbleRAN rApp SDK is installed in your environment. You can install it using the command pip3 install br-rapp-sdk.

danger

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.

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

💬 Questions

  1. What does prb_usg_type = 7 mean in the policy? Hint: Refer to 3GPP TS 28.552, Section 5.1.1.2.9.
  2. In this experiment, is it necessary to establish a control loop between the xApp and the gNB?
  3. Draw the message flow starting from the rApp, passing through the Non-RT RIC, Near-RT RIC, xApp, and finally reaching the RAN.
  4. Extend the experiment by using two UEs in two different slices. Send two policies, each with different scopes and statements, to limit downlink bitrate by adjusting the peak DL PRB usage using slice enforcement.