Lab 7: RAN Slicing xApp within cluster
This experiment is to deploy a 5G Standalone (SA) network using the OpenAirInterface (OAI) RF Simulator for the gNB and the OAI minimal 5GC. In the second phase of the experiment, we enforce slicing at the gNB through an xApp.
FlexRIC is deployed as the Near-RT RIC, and we use its xApp SDK to configure and manage slices. Specifically, we control slice capacities by modifying the allocation of Physical Resource Blocks (PRBs). An interactive xApp is deployed to support xApp onboarding and execution. This container comes pre-installed with all necessary dependencies, including the BubbleRAN xApp SDK.
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: slicing
stack: 5g-sa
model: mosaic5g/interactive
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
Deployment and Testing​
Deploy the file using the command brc install network open-ran.yaml
.
Each slices has 2 values that define it, Slice/Service type (SSD) which identifies the type of network slice based on service requirements. and Slice Differentiator (SD) further differentiates slices with the same SST to support customized services or policies within that slice type.
In the yaml file these 2 values are defined as service-type/differentiator when configuring a slice for both the network and the terminal.
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 command below to see the throughput of the UE without any slicing enabled in the network.
brc test throughput ue1 dl gateway -- -t 60
Slice Enforcement via xApp​
After setting up the network with the configured slices both on RAN and Core side, we can use slicing xApp below to enforce the slices with the desired capacity for specific slice using the SST/SD. The xApp enables the policy ratio algorithm based on 3GPP standards (3GPP TS 28.541 - section 4.3.36 RRMPolicyRatio). This algorithm ensures that each network slice receives a guaranteed portion of network resources which is the dedicated ratio.
import sys
import xapp_usr_sdk as xapp
xapp.init(sys.argv)
nodes = xapp.e2_nodes(xapp.SLICE_USE_CASE_e)
assert(len(nodes) > 0 and "Needed at least one E2 node to slice")
node_idx = -1
for i in range(0, len(nodes)):
if (nodes[i].node.type == xapp.e2ap_ngran_gNB_DU_SDK or nodes[i].node.type == xapp.e2ap_ngran_gNB_SDK):
node_idx = i
assert(node_idx > -1 and "require node type is gNB or DU")
n = nodes[node_idx].node
sst = "1"
sd = "1"
dedicated_prb = 10
xapp.slice(n, sst, sd, dedicated_prb)
The provided xApp code is a sample from the BubbleRAN xApp SDK, designed to help you easily develop, configure, and execute xApps for managing and optimizing RAN behavior through the RIC framework. The SDK abstracts much of the underlying complexity of interacting with the RIC platform, providing pre-built modules, APIs, and configuration templates. This allows developers to focus on the core logic of their xApp—such as decision-making, policy control, or monitoring—without needing to manage low-level details of the RIC interface.
Use the following commands to copy and run the xApp interactively within the container:
brc cic interactive.slicing.oran shell -- sh -c 'cat > /opt/hydra/xapps/python/slicing.py' < slicing.py
brc cic interactive.slicing.oran run -- python-xapp slicing
Make sure the SST and SD used in the network yaml file maches with the one you are specifying in the xApp
Now you can run the command below to see the change in the throughput.
brc test throughput ue1 dl gateway -- -t 60
Each time you rerun the xApp:
-
If you use a previously defined SST/SD, it will modify the capacity of the existing slice.
-
If you use a new SST/SD, it will create and enforce a new slice.
Now, modify the capacity of an existing slice and observe the change in throughput during the test.
Rerun the xApp wit the same SST/SD values, with different dedicated ratio for the slice.
đź’¬ Lab Questions đź’¬
- Explain the relation between the dedicated ratio of slice and the result of throughput test.
- Draw the message flow for enabling network slices, starting from the xApp, through the RIC, and down to the RAN.
- Include the monitoring xApp in the setup, as used in the previous lab, to extract real-time data and observe the impact of the slicing xApp on key network parameters.