Energy Saving xApp

July 30, 2026 · View on GitHub

Overview

The Energy Saving (ES) xApp is an O-RAN-compliant near-RT RIC application that automates cell switch-on/off decisions based on real-time radio resource utilization. It closes the loop between the simulated network and the RIC — observing KPM reports, making decisions, and sending RC control messages back to the gNB — entirely autonomously.

AttributeValue
O-RAN StandardO-RAN Use Cases Detailed Specification 15.0
Use Case21 — Carrier and Cell Switch On/Off
Sub-use Case4.21.3.1
Service Models UsedKPM v3.00 (reporting), RC v1.03 (control)
Scenario Filescratch/Energy_saving_with_cell_utilization_scenario.cc
xApp Binaryxapp_es_with_cell_util
FlexRIC Branchoie-ric-taap-xapps

How It Works

┌─────────────────────────────────────────────────────────────────┐
│                         near-RT RIC                             │
│                                                                 │
│   KPM Indication ──► ES xApp ──► Decision ──► RC Control       │
│   (PRB utilization)              (ON / OFF)   (Cell switch)     │
└───────────▲─────────────────────────────────────────┬──────────┘
            │ E2 Interface                             │ E2 Interface
            │                                          ▼
┌───────────────────────────────────────────────────────────────┐
│                     ns-3 Simulation                           │
│                                                               │
│   gNB 1 ── gNB 2 ── gNB 3 ── gNB 4   (mmWave + LTE eNB)    │
│                   UEs                                         │
└───────────────────────────────────────────────────────────────┘

Step-by-step operation:

  1. The ES xApp subscribes to KPM indication reports from each simulated gNB.
  2. Each report carries the per-cell PRB utilization over the indication period.
  3. The xApp evaluates per-cell utilization against thresholds:
    • Utilization below the low threshold → cell is a candidate to switch off (deep sleep).
    • A sleeping cell's neighbours show high utilization → cell is a candidate to switch back on.
  4. The decision is sent as an RC Control message (Control Service Style 3, Action ID 1 — Handover Control) to the target gNB.
  5. The gNB applies the cell state change and continues reporting.

The sequence diagram below illustrates the full operation:

ES xApp Operation Sequence


Demo Video

🎬 Watch the Energy Saving xApp Demonstration


Prerequisites

Before running this xApp, make sure the following are in place:


Energy Saving Dashboard in RIC-TaaP Studio

Step 1 — Start the near-RT RIC

cd /path/to/flexric/build/examples/ric/
./nearRT-RIC

Step 2 — Open RIC-TaaP Studio

Open your browser at http://127.0.0.1:8000.

Step 3 — Connect to FlexRIC

Click Connect to FlexRIC on the homepage to establish the RIC link.

Step 4 — Select and configure the scenario

  • Click Show Form.
  • From the scenario list, select Energy_saving_with_cell_utilization_scenario.cc.
  • Enable the scenario flags to use the preset configuration.
  • Click Start. Cells and UEs will appear on the grid within a few seconds.

Step 5 — Launch the ES xApp

cd /path/to/flexric/build/examples/xApp/c/orange/
./xapp_es_with_cell_util

Alternatively, trigger the xApp directly from the GUI:

# Copy the trigger scripts (one-time setup)
cp "/path/to/mmwave-LENA-oran/GUI/FlexRIC xApp GUI trigger/"* /path/to/flexric/
cd /path/to/flexric/
python3 xApp_trigger.py

Step 6 — Observe results

Navigate to the Energy Saving Dashboard tab in RIC-TaaP Studio to monitor:

MetricDescription
UE DL ThroughputPer-UE downlink throughput (Mbps)
Cell Energy StateActive / Deep-sleep status per cell
PRB UtilizationPercentage of PRBs in use per cell
Energy ConsumptionPower consumption before and after xApp execution
QoS ImpactEffect of cell switch-off on user QoS

Step 7 — Stop the simulation

Click Stop in the Show Form window.


Running from Terminal

Open three separate terminals:

# Terminal 1 — near-RT RIC
cd /path/to/flexric/build/examples/ric/
./nearRT-RIC
# Terminal 2 — ns-3 simulation
cd /path/to/mmwave-LENA-oran
./ns3 run scratch/Energy_saving_with_cell_utilization_scenario.cc
# Terminal 3 — ES xApp
cd /path/to/flexric/build/examples/xApp/c/orange/
./xapp_es_with_cell_util

Key Run Flags

FlagTypeDefaultDescription
--e2TermIpstring127.0.0.1IP address of the near-RT RIC
--KPM_E2functionIDdouble2RAN function ID for KPM service model
--RC_E2functionIDdouble3RAN function ID for RC service model
--indicationPeriodicitydouble0.1KPM reporting interval (seconds)
--simTimedouble1000Total simulation duration (seconds)
--N_MmWaveEnbNodesuint84Number of mmWave gNBs
--N_Uesuint323Number of UEs
--IntersideDistanceCellsdouble600Inter-site distance between cells (metres)