OpenAirInterface Integration

Unlike standard RemoteRF experiments that stream baseband IQ samples between your workstation and a remote SDR, full-stack 3GPP 5G NR software such as OpenAirInterface (OAI) (covering the PHY/L1, MAC, RLC, PDCP, and RRC layers) has strict sub-millisecond timing budgets that require running the OAI softmodem (nr-softmodem / nr-uesoftmodem) directly on the Linux server connected to the USRP RF front-end rather than over a wide-area network.

RemoteRF does not bundle OAI itself: the server administrator installs OAI separately following its standard installation, and RemoteRF’s application integrations (remoterf.integrations) provide the bridge to launch and control it. You reserve a USRP configured for OAI, open its MultiUSRP handle, and hand the radio to an OaiGnb or OaiUe instance on the server while keeping Python control over cell configuration, actions, and captured PHY data. When the softmodem stops, RemoteRF shuts it down cleanly and returns the USRP to native UHD control.

Note: You won't see OAI listed as a separate device type when making a reservation. Reserve a USRP on a deployment configured for OAI, then pass its MultiUSRP handle to OaiGnb or OaiUe.
OAI runs directly on the RemoteRF server alongside the USRP for real-time 5G NR timing, while your local Python script configures the cell, triggers actions, and pulls back CSI and telemetry.

How OAI Runs on RemoteRF

Under the hood, remoterf.integrations coordinates ownership of the USRP RF front-end between UHD and the server-side OAI softmodem across four stages:

  1. Stage 1

    Reserve & Open USRP Hardware

    Reserve one or more USRPs configured for OAI and open each with uhd.usrp.MultiUSRP(token). The same reservation and session cover both native UHD control and OAI softmodem runs.

  2. Stage 2

    Configure & Launch the OAI Softmodem

    Wrap each MultiUSRP handle in OaiGnb or OaiUe (passing {} configuration on the bundled org.remoterf.oai adapter, where RF band, frequency, and gains are fixed by the operator, or custom attributes when supported by a lab adapter). On start, the server pauses native UHD access and launches nr-softmodem or nr-uesoftmodem bound to that USRP's hardware serial.

  3. Stage 3

    Run Actions & Capture PHY Data

    While the cell or nrUE is active, invoke integration actions as Python methods (for example, gnb.health(), ue.link_status(), ue.ping(count=5), or gnb.capture_csi_burst(stream="ul_pusch", count=16)). Captured payloads such as shared-memory CSI tensors, JSON telemetry, or PCAP traces are transferred in chunks and decoded automatically into NumPy arrays, Python dictionaries, or bytes.

  4. Stage 4

    Stop & Return to Native UHD

    Calling stop_cell() or detach()—or exiting a with block—shuts down the OAI softmodem cleanly and releases the USRP back to native UHD control for subsequent experiments.

Basic Usage (gNB & nrUE)

Explicit Lifecycle (start_cell / attach)

Create OaiGnb and OaiUe instances around your reserved MultiUSRP handles, and manage startup, actions, and teardown explicitly:

from remoterf.drivers.usrp import uhd
from remoterf.integrations import OaiGnb, OaiUe

radio1 = uhd.usrp.MultiUSRP(token1)  # reserved USRP for the gNB
radio2 = uhd.usrp.MultiUSRP(token2)  # reserved USRP for the nrUE

gnb = OaiGnb(radio1)
ue = OaiUe(radio2)

try:
    gnb.start_cell(timeout_s=120)    # waits until RUNNING
    ue.attach(timeout_s=120)         # waits until UE TUN interface has an IPv4 address
    print(gnb.health())              # declared actions become methods
    print(ue.link_status())
    print(ue.ping(count=5))          # UE-only ping over the 5G core TUN link
    csi = gnb.capture_csi_burst(stream="ul_pusch", count=16)
finally:
    ue.detach()
    gnb.stop_cell()
# stopping both apps hands the radios back to UHD

Context Manager (with)

Both OaiGnb and OaiUe also support Python context managers. Entering a with block immediately starts the softmodem (with a default 120-second readiness timeout) and exiting stops it, so set any adapter-supported attributes before entering with:

from remoterf.drivers.usrp import uhd
from remoterf.integrations import OaiGnb, OaiUe

radio1 = uhd.usrp.MultiUSRP(token1)  # reserved USRP for the gNB
radio2 = uhd.usrp.MultiUSRP(token2)  # reserved USRP for the nrUE

gnb = OaiGnb(radio1)
ue = OaiUe(radio2)

with gnb, ue:                        # starts on enter, stops on exit
    print(ue.link_status())
    print(ue.ping(count=5))
    latest = gnb.read_csi(stream="ul_pusch")
# leaving the block stops both apps and hands the radios back to UHD

Configuration Timing & Bundled Defaults: If an integration accepts configuration attributes, pass them to the constructor or assign them before calling start() / start_cell() / attach() (or entering with); modifying attributes after startup raises AttributeError. On the bundled org.remoterf.oai adapter, RF band, frequency, and gain settings are operator-managed on the server and callers must leave configuration empty ({}).

Lifecycle, Actions & Captures

Before launching OAI on a reserved USRP, you can list available integrations and profiles on that radio with radio.integration_list({}), and inspect the actions exposed on an instance with gnb.actions.

Symbol / Method Role Notes
OaiGnb(radio, **config)
OaiUe(radio, **config)
Softmodem wrappers Bind a reserved MultiUSRP RF front-end to integration ID org.remoterf.oai with profile "gnb" or "ue".
start_cell(timeout_s=120.0, wait=True)
attach(timeout_s=120.0, wait=True)
Start & wait for readiness Aliases for App.start(). Polls until the softmodem reaches RUNNING or raises IntegrationError / TimeoutError.
stop_cell(timeout_s=120.0)
detach(timeout_s=120.0)
Stop & release USRP Aliases for App.stop(). Shuts down the OAI softmodem cleanly and waits until the USRP is returned to native UHD control.
status() / actions Inspect runtime state status() returns the latest operation snapshot; actions lists declared action names exposed by the OAI integration.
call(action, **params)
app.<action>(**params)
Run action & decode output Runs a declared action and waits for completion. Returned payloads are transferred in chunks and decoded automatically to a NumPy array (dtype/shape), parsed JSON (format="json"), or bytes ("bytes" / "pcap").
IntegrationError Server / runtime failure Raised when the server rejects a request or an operation/action fails; exposes the machine-readable error string on .code.

L1 Plugins & xApps

Depending on the deployment configuration and enabled actions, the OAI integration supports workflows beyond running a static cell:

Link Status & End-to-End Ping

Query health() or link_status() on either profile (returning {"state": "running"} for gnb, or {"state": "ip_up"|"syncing", "ifname", "ip"} for ue). On OaiUe, ping(count=...) (1–20) tests end-to-end IP reachability to the configured data-network target over the UE TUN interface.

Read-Only CSI Ring Captures

On deployments running a CSI-ring-enabled OAI build, read_csi(stream=...) and capture_csi_burst(stream=..., count=..., timeout_s=...) (count 1–256, timeout_s ≤ 600) read from shared-memory rings ("ul_pusch", "ul_srs", or "dl_ssb", where "dl_ssb" covers only the SSB band) and return decoded complex64 NumPy arrays alongside per-entry seq, frame, slot, snr_db (sanitized to None if non-finite), rnti, ta, and timestamps_s metadata. These read-only actions run in the server process without requiring user_code or consuming the job budget, and ring files are cleaned up automatically on stop_cell() / detach().

Hot-Loadable L1 C Plugins

On plugin-enabled OAI builds, load_l1_plugin(stage=..., c_code=...) compiles custom C PHY-layer code on the server into a shared library and loads it into the running softmodem via OAI_PLUGIN_CTRL; unload_l1_plugin() restores the default stage.

Python xApps (run_xapp)

Run time-bounded Python monitoring or RAN control scripts (code=..., duration_s=..., 1–600 s) alongside the active softmodem with shared-memory access via OAI_SHM_DIR and JSON output returned via XAPP_OUTPUT.

Administrator Permission & Job Budget: Because load_l1_plugin and run_xapp compile or execute user-provided code on the RemoteRF server, they are disabled by default unless enabled by the deployment administrator under user_code in integrations.json. Supervised jobs (ping, load_l1_plugin, and run_xapp) share a per-operation budget of 3 launches (job_budget_exhausted once used up).

Server & Operator Configuration

RemoteRF Server does not come with OAI preinstalled—first install OAI separately on the server following its standard installation instructions. Application integrations are also disabled by default. To connect org.remoterf.oai to your OAI installation, configure integrations.json in the server’s configuration directory (~/.config/remoterf/integrations.json) before starting serverrf:

{
  "version": 1,
  "enabled": true,
  "manifests": ["org.remoterf.oai"],
  "devices": {
    "10": {"serial": "3184A2F", "integrations": ["org.remoterf.oai"]}
  },
  "cgroup_root": "/sys/fs/cgroup/operator-delegated/remoterf",
  "limits": {
    "org.remoterf.oai": {
      "memory_mib": 8192,
      "max_pids": 256,
      "start_timeout_s": 120,
      "action_timeout_s": 60,
      "stop_timeout_s": 30
    }
  },
  "user_code": []
}
  • Device binding & cgroup supervision: Each enabled USRP entry in devices must map a server-local device_id to its exact UHD serial (serial) alongside an operator-created delegated Linux cgroup_root. limits accepts integer memory_mib (16–65,536), max_pids (1–4,096), and start_timeout_s, action_timeout_s, and stop_timeout_s (1–600 s, default 30 s).
  • Custom code gate (user_code): Leave "user_code": [] on student-facing servers. Adding "org.remoterf.oai" to user_code permits load_l1_plugin and run_xapp to compile or run caller-supplied code unsandboxed as the server OS user inside the operation’s cgroup.

The bundled org.remoterf.oai adapter reads OAI binaries, configuration files, and runtime flags from the server process environment (a _<SERIAL> suffix on REMOTERF_OAI_GNB_CONF or REMOTERF_OAI_UE_CONF overrides the path for a specific USRP):

Environment Variable Profile Purpose
REMOTERF_OAI_SOFTMODEM gnb Path to the nr-softmodem binary.
REMOTERF_OAI_GNB_CONF gnb Path to the gNB configuration file (append _<SERIAL> to override for a specific USRP).
REMOTERF_OAI_GNB_ARGS gnb Optional gNB CLI flags (defaults to --continuous-tx; the adapter appends --RUs.[0].sdr_addrs serial=<radio>).
REMOTERF_OAI_UESOFTMODEM ue Path to the nr-uesoftmodem binary.
REMOTERF_OAI_UE_CONF ue Path to the nrUE configuration file (append _<SERIAL> to override for a specific USRP).
REMOTERF_OAI_UE_ARGS ue Required nrUE CLI flags (the adapter appends --usrp-args serial=<radio>).
REMOTERF_OAI_UE_IFNAME ue UE TUN interface expected to obtain an IPv4 address on attach (default oaitun_ue1).
REMOTERF_OAI_DN_IP ue Target IPv4 address for the ping action (default 192.168.70.135).
REMOTERF_OAI_SHLIBPATH Both Optional --loader.shlibpath directory for OAI shared libraries.
REMOTERF_OAI_CC Both C compiler used by load_l1_plugin (default /usr/bin/gcc).

The server automatically exports OAI_SHM_DIR=<work_dir>/shm (for ul_pusch.ring, ul_srs.ring, and dl_ssb.ring) and OAI_PLUGIN_CTRL=<work_dir>/plugin_ctrl.json into the softmodem environment.

Supported Hardware & Requirements

  • Server-attached, serial-addressed USRPs: Requires a serial-addressed USRP (such as a USRP 2901, B205-mini, or N210) connected directly to a RemoteRF server where OAI is installed and enabled in integrations.json.
  • Edge hosts and non-USRP SDRs: USRPs attached via a remote edge host (remoterf-host) return unsupported_host, and non-USRP SDRs (such as ADALM-PLUTO or HackRF One) do not support OAI softmodem execution.
  • gNB and UE setups: End-to-end 5G NR links require either two reserved USRPs (OaiGnb + OaiUe over attenuated coaxial cabling or an authorized over-the-air link) or a single OaiGnb USRP paired with a commercial off-the-shelf (COTS) 5G UE on the testbed.
  • RF compliance: OAI gNB and nrUE softmodems actively transmit 5G NR signals; verify permitted bands and review RF Best Practices and RF Safety & Regulatory Guidance before transmitting over the air.

Next Steps