Part of: Near-RT RIC on COSMOS · 4G / 5G & O-RAN tutorials
FlexRIC is an open-source near-real-time RAN Intelligent Controller (near-RT RIC) and a software
development kit for building one. This page explains what FlexRIC is made of, how it differs from the
other RIC on COSMOS, which protocol versions it speaks, and which COSMOS RAN stacks it works with. The
hands-on steps are in the per-stack FlexRIC tutorials listed at the end.
A near-RT RIC connects to base stations over the O-RAN E2 interface, collects measurements and,
where the base station allows it, sends control actions back, on timescales from about 10 ms to 1 s.
The RIC page explains the concept, the E2 procedures and
the service models in general.
FlexRIC implements that role as a small set of C programs and libraries rather than a cloud-native
platform. It began at EURECOM as part of the OpenAirInterface ecosystem. Since October 2026 it is
developed by the Duranta project at github.com/duranta-project/flexric;
the former EURECOM GitLab repository is a mirror. The current release is v3.0.0 (2026-10-12); the
COSMOS tutorials use the dev branch after it, which carries a fix the OCUDU tutorial needs.
On COSMOS servers FlexRIC comes as a package: apt-get install cosmos-flexric installs FlexRIC dev
commit fbd9859 with a one-line COSMOS fix, built for E2AP v2 and E2SM-KPM v3.00 (the versions both
COSMOS gNBs speak). /usr/share/cosmos-flexric/SOURCE records the exact upstream commit, the build
options and the patches applied. The FlexRIC + OCUDU tutorial
also shows how to build the same thing from source.
| Component | What it does | Installed by cosmos-flexric |
In the source tree |
|---|---|---|---|
| nearRT-RIC | the RIC itself: terminates E2 from the RAN, terminates E42 from the xApps, and relays subscriptions, indications and control between them | /usr/bin/nearRT-RIC |
examples/ric/nearRT-RIC |
| E2 agent library | the E2 side of a base station: OpenAirInterface-based gNBs link it in to become E2 nodes | — (built into the gNB) | src/agent/ |
| xApp SDK | the API an xApp is written against, in C, or in Python and other languages through SWIG | — | src/xApp/ |
| Service-model plugins | one shared library per E2 service model, loaded by the RIC and by each xApp at start-up | /usr/lib/flexric/lib*_sm.so |
src/sm/*/lib*_sm.so |
| Example xApps | monitoring and control examples, among them xapp_kpm_moni (E2SM-KPM monitoring), xapp_rc_moni (E2SM-RC monitoring) and xapp_rc_handover |
/usr/bin/xapp_* |
examples/xApp/ |
| E2 agent emulators | fake gNB/eNB agents for testing a RIC without a RAN | /usr/bin/emu_agent_* |
examples/emulator/agent/ |
Two interfaces matter:
nearRT-RIC, as defined by O-RAN.nearRT-RIC and the xApps. E42 is FlexRIC's own interface: anThe RIC's address comes from flexric.conf (NEAR_RIC_IP; the package installs
/etc/flexric/flexric.conf with 127.0.0.1) or the -a option; -p names the directory the
service-model plugins are loaded from. FlexRIC has no default for it: with the package, always pass
-p /usr/lib/flexric/.
FlexRIC supports several versions of each O-RAN protocol, selected when you build it. The RIC, the xApps
and the E2 node must be built for the same versions, or the E2 Setup or the reports fail.
| Protocol | Versions FlexRIC v3.0.0 can be built for | CMake option | Default |
|---|---|---|---|
| E2AP | v1.01, v2.03, v3.01 | -DE2AP_VERSION=E2AP_V1 / _V2 / _V3 |
v2.03 |
| E2SM-KPM | v2.01, v2.03, v3.00 | -DKPM_VERSION=KPM_V2_01 / _V2_03 / _V3_00 |
v2.03 |
| E2SM-RC | v1.03 | — | — |
| E2SM-CCC | v6 | — | — |
Besides the O-RAN service models, FlexRIC ships its own MAC, RLC, PDCP, GTP, SLICE and TC statistics
and control models. Only E2 nodes built on FlexRIC's own agent (OpenAirInterface and its derivatives)
implement them; OCUDU does not.
COSMOS also runs the O-RAN Software Community near-RT RIC (see the
O-RAN SC RIC tutorial). The two do the same
job differently:
| FlexRIC | O-RAN SC near-RT RIC | |
|---|---|---|
| Form | a few C processes, installed from the cosmos-flexric package (or built from source) |
many containers (E2 termination, E2 manager, subscription manager, routing manager, …) |
| Deployment on COSMOS | runs directly on the server next to the gNB | Docker Compose (srsran/oran-sc-ric) on any server |
| xApps | link the FlexRIC SDK, talk E42 to the RIC | containers using the O-RAN SC xApp framework, talk RMR |
| Service models | O-RAN KPM, RC, CCC plus FlexRIC's MAC/RLC/PDCP/GTP/SLICE/TC | O-RAN KPM, RC, CCC |
| Best fit | OpenAirInterface-based stacks (Duranta), lightweight experiments, writing your own xApp in C | an O-RAN SC-style platform; the reference xApps |
| RAN stack | E2 agent | What works with FlexRIC on COSMOS | Tutorial |
|---|---|---|---|
| OCUDU (srsRAN) | built into the gNB; enable it in the gNB's YAML | verified 2026-11-06, last 2026-11-20 with the cosmos-flexric package: E2 Setup and E2SM-KPM monitoring (report styles 1 and 4), soft ZMQ rig. E2SM-RC: the RC monitoring xApp finds no REPORT style it implements in OCUDU's RC function and sends no subscription; RC control not tried yet |
FlexRIC + OCUDU |
| Duranta (OAI fork) | FlexRIC's own agent library (the openair2/E2AP/flexric submodule, pinned to v3.0.0), compiled in with E2_AGENT=ON |
verified 2026-11-06, last 2026-11-20 with the cosmos-flexric package: E2 Setup and E2SM-KPM monitoring on the RF-simulator rig, with MCS and SINR distributions per report, and E2SM-RC monitoring (REPORT styles 1 and 4: the UE's RRC measurement reports and RRC state changes). duranta.ndz is built without the agent, so the tutorial rebuilds the gNB into a separate directory first |
FlexRIC + Duranta |
| NVIDIA Aerial (Duranta L2 on the Aerial L1) | as Duranta | not yet available: the Duranta L2 image for the GH200 has no E2 agent. FlexRIC itself builds for arm64, so the RIC can run on the GH200 | not yet available |
On this wiki
External
Author(s): COSMOS team · Last verified: 2026-11-20 (cosmos-flexric 3.0.0+40.gfbd9859e-1 = FlexRIC dev fbd9859, with OCUDU and with Duranta on platform A, see the two tutorials) · Tags: oran, ric, e2, flexric, kpm, xapp