Lab 6: Spectrum Management rApp
In this lab, you will deploy a 5G Standalone (SA) network and use a custom rApp to reconfigure the spectrum parameters of the RAN cell.
In the second phase of the experiment, the BubbleRAN rApp SDK and its OAM services module are used to reconfigure the spectrum parameters of the RAN cell. The updated configuration is applied via the Non-RT RIC and the SMO. As a result, the gNB is automatically reconfigured to reflect the new spectrum parameters. This phase demonstrates OAM-based control of the access network through an rApp, without requiring manual intervention on the RAN components.
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
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
---
apiVersion: athena.trirematics.io/v1
kind: Terminal
metadata:
name: ue2
namespace: trirematics
spec:
vendor: oai
stack: 5g-sa
model: terminal/nr-rfsim
preferred-access: oai-gnb.oran
target-cores:
- oai-5gc.oran
identity:
imsi: "001010000000002"
pin: "1234"
opc: "0xc42449363bbad02b66d16bc975d77cc1"
key: "0xfec86ba6eb707ed08905757b1bb44b8f"
sqn: "0xff9bb4000001"
slice:
dnn: internet
network-mode: IPv4
service-type: 1
differentiator: 0x000001
radio:
bands:
- n41
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 network includes a single access network node with one cell and two terminals. Initially, the cell spectrum configuration is:
cells:
- band: n78
arfcn: 641280
bandwidth: 40MHz
subcarrier-spacing: 30kHz
And UE1 is configured to operate in the n78 band, while UE2 is configured for the n41 band. As a result, only UE1 is connected to the gNB at the start of 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, except for UE2 which is expected to be in the 0/1 N state due to the band mismatch with the gNB.
To test the throughput of UE1, run the following command:
brc test throughput ue1 dl gateway
Spectrum Configuration Change via rApp
from br_rapp_sdk import OAMServices
from br_rapp_sdk.oam_services.network_types import *
from br_rapp_sdk.oam_services.terminal_types import *
if __name__ == "__main__":
# Initialize the OAMServices client
oam_services = OAMServices()
# Get the list of networks
net_id = NetworkId("oran")
result = oam_services.network.get_network(network_id=net_id)
if result.status == "success":
net_spec = result.data.get("item", [])
else:
print("Failed to retrieve networks: ", result.error)
exit(1)
# Print the current cell configuration
print("Spectrum Config before change:")
print(" band:", net_spec.access[0].cells[0].band)
print(" arfcn:", net_spec.access[0].cells[0].arfcn)
print(" bandwidth:", net_spec.access[0].cells[0].bandwidth)
print(" subcarrier-spacing:", net_spec.access[0].cells[0].subcarrier_spacing)
# Change the spectrum configuration
net_spec.access[0].cells[0].band = "n41"
net_spec.access[0].cells[0].arfcn = 504990
net_spec.access[0].cells[0].bandwidth = "20MHz"
net_spec.access[0].cells[0].subcarrier_spacing = "30kHz"
# Apply the updated network specification
result = oam_services.network.apply_network(
network_name=net_id,
network_spec=net_spec
)
if result.status == 'success':
network_id = result.data.get('network_id')
print(f"Access applied successfully: {network_id}")
else:
print(f"Error applying access: {result.error}")
# Retrieve the updated network to verify the change
result = oam_services.network.get_network(network_id=net_id)
if result.status == "success":
updated_net_spec = result.data.get('item')
print("\nSpectrum Config after change:")
print(" band:", updated_net_spec.access[0].cells[0].band)
print(" arfcn:", updated_net_spec.access[0].cells[0].arfcn)
print(" bandwidth:", updated_net_spec.access[0].cells[0].bandwidth)
print(" subcarrier-spacing:", updated_net_spec.access[0].cells[0].subcarrier_spacing)
else:
print("Failed to retrieve updated network: ", result.error)
You will change the configuration to via spectrum-rapp.py.
cells:
- band: n41
arfcn: 504990
bandwidth: 20MHz
subcarrier-spacing: 30kHz
This rApp provides an example of how management-level control actions can be applied to the radio access network using the BubbleRAN rApp framework. Its primary function is to modify predefined radio configuration parameters at the cell level through an OAM-driven workflow.
When the rApp is executed, it first retrieves the current network specification from the OAM layer. Each interaction with the OAM layer returns a response status, which is checked by the rApp to confirm that the requested operation has been successfully accepted and applied by the system. The modified network specification is then applied back to the system via the SMO. This operation is handled in an idempotent manner: only the updated cell configuration is reconfigured, while the rest of the network remains unchanged. As a result, the affected gNB is automatically reconfigured to reflect the new settings, without requiring a full network redeployment or manual intervention.
Use the following commands to run the rApp within the cluster:
python3 ./spectrum-rapp.py
After running the rApp, you will get the output like this:
#Spectrum Config before change:
# band: n78
# arfcn: 641280
# bandwidth: 40MHz
# subcarrier-spacing: 30kHz
#Access applied successfully: oran
#
#Spectrum Config after change:
# band: n41
# arfcn: 504990
# bandwidth: 20MHz
# subcarrier-spacing: 30kHz
After the configuration update, the state of the network elements can be observed using the brc observe command.
Under normal operating conditions, UE2 is now in the 1/1 Y state, while UE1 is in the 0/1 N state due to the band mismatch with the gNB.
To test the throughput of UE2, run the following command:
brc test throughput ue2 dl gateway
Uninstall
To uninstall the network, use the following command:
brc remove network open-ran.yaml
Checking via the brc observe command, you should see that all the elements are removed.
💬 Questions
- Explain why Spectrum management is a critical aspect of RAN control and how it can impact the performance of the network and the user experience.
- Why is the throughput of UE2 after the spectrum change lower than the throughput of UE1 before the change? Note: You may not observe a significant difference in this experiment because it is conducted in RF-sim mode. To clearly see the impact, the experiment should be replicated on a real testbed, for example using USRP-based hardware.
- Try to add a few lines of code using the rApp SDK to change the operating band of UE1 to n41.