Part of: Duranta on COSMOS · 4G / 5G & O-RAN · Step 2 of the Duranta learning path · Previous: duranta-soft · Next: duranta-72
Put a real radio under the network from duranta-soft. The same Duranta gNB (nr-softmodem) and OAI CN5G core run on a COSMOS server in sb1, but the gNB now streams its samples to a USRP N310, which transmits a band n41 cell, and the UE is a commercial Quectel 5G modem on a second node. Register the modem, give it an IP address, reach the internet through it, and measure real downlink and uplink throughput.
This is the step where the host starts to matter. A radio must receive a continuous stream of samples on time; a gNB thread that runs late shows up as transmit-late markers in the log and as a modem that cannot decode the downlink. It is also the first time a shared radio has to be power-cycled and claimed correctly, and a commercial modem has to be steered onto a private cell. Everything above the radio is unchanged from step 1, so when something fails here you already know what a healthy core and gNB look like.
Concepts
- gNB — the 5G base station:
nr-softmodem, with the central and distributed units (CU and DU) in one process. It drives the radio through UHD, the USRP driver.- USRP N310 — a software-defined radio that converts baseband samples to RF and back. It runs its own Linux and a management daemon (MPM) that grants one streaming session at a time.
- Core (5GC) — OAI CN5G Docker containers: the AMF (registration), SMF (sessions), UPF (user data) and
oai-ext-dn, which stands in for the data network.- COTS UE — a commercial off-the-shelf modem, here a Quectel RM520N-GL with a test SIM. Its data session is driven through QMI and appears as a
wwannetwork interface.- CPU isolation — reserving cores for the gNB's real-time threads so nothing else on the host runs there.
got sync, is in service, +C5GREG: 0,1, an IPv4 address from the core.| Link | Between | Carried over |
|---|---|---|
| Radio | gNB server ↔ N310 | UHD sample streaming over the server's data network (never the control network) |
| Air | N310 ↔ modem | band n41, 40 MHz (106 PRB), 30 kHz subcarrier spacing, TDD DDDSU, centred at 2654.55 MHz |
| N2 — control | gNB ↔ AMF container | SCTP over the Docker bridge demo-oai; the modem's registration messages travel inside it |
| N3 — user data | gNB ↔ UPF container | GTP-U over the same bridge |
| N6 — data network | UPF → internet | the oai-ext-dn container, which NATs UE traffic to the internet |
| Modem control | UE node ↔ modem | AT commands on a serial port and QMI on /dev/cdc-wdmN, both over USB |
The gNB and the core share one server, exactly as in step 1. The modem's PDU session appears on the UE node as its wwan interface, with an address in 192.168.100.0/22.
Where the radio's address comes from. You never type the N310's address. The tutorial names the radio by its COSMOS inventory node (duranta_usrp_node) and network plane (duranta_usrp_plane), and with duranta_usrp_addr: auto it looks the address up in the COSMOS inventory when the run starts, on the console. "auto" therefore means "whatever the inventory says this radio's data address is today". To use a different N310, change duranta_usrp_node and duranta_sdr_node; to pin an address yourself, set duranta_usrp_addr in your --params file.
| Domains | sb1 |
| Nodes | 2, named in OMF_NODES |
| On the console | python3, ansible-playbook, ssh |
cosmos-tutorial check duranta-ota verifies, on each node:
Not in the package - you provide:
You will also need:
sb1 for the gNB server, the UE node and the N310, and SSH access to the sb1 console — see Getting started and SSH access;No licence is involved.
The radio is shared. The N310 is used by other
sb1experiments too. Reserve it, and never power-cycle a radio another user may be streaming from.
On the sb1 console, name the gNB server first and the UE node second, and ask whether the tutorial can run. The check is read-only: it changes nothing on the nodes or the radio.
export OMF_NODES="<gnb-node>,<ue-node>"
cosmos-tutorial check duranta-ota
It ends with RUNNABLE or NOT RUNNABLE and the reasons. It verifies that the first node carries the Duranta build and the second a 5G modem on USB, that no other gNB is running on either, and that the gNB server reaches the N310 on the data network. If an image is missing, load it first:
omf load -i duranta.ndz -t <gnb-node> -r 0 -o 2400 -b 600
omf load -i lte5gue.ndz -t <ue-node> -r 0 -o 2400 -b 600
omf tell -a on -t <gnb-node>,<ue-node>
-r 0 resizes the root partition to the whole disk.
export OMF_NODES=<node>,<node>
cosmos-tutorial check duranta-ota
cosmos-tutorial run duranta-ota # ansible
cosmos-tutorial run duranta-ota --mode manual # manual
cosmos-tutorial jupyter duranta-ota # jupyter
cosmos-tutorial run duranta-ota --mode parity # parity
cosmos-tutorial run duranta-ota --mode teardown # teardown
The tutorial ships the same experiment three ways. All three read one parameter file, use one log parser, and write the same JSON result into ~/cosmos-runs/duranta-ota/<UTC>-<mode>/ on the console. OMF_NODES is required and ordered: the gNB server first, the UE node second. The radio is not in OMF_NODES; it is named in the parameters, because it is a shared instrument the run powers from the console.
The playbook resolves the radio's address from the inventory, applies CPU isolation on the gNB server if the running kernel lacks it (and reboots once), power-cycles the radio and waits until it is genuinely claimable, puts the cell on its carrier, and runs the image's one-shot start-all.sh (core, subscribers, gNB). It then moves the radio's interrupts onto the right NUMA node, checks that the gNB is not flooding transmit-late markers, configures the modem, waits for registration, brings up the data call with scoped routes only, and measures ping to the core's data network and to 8.8.8.8 plus iperf3 downlink and uplink.
The manual mode runs the commands below for you. Run them yourself to see what each part does.
Step 1 — Find the radio (on the console). Ask the COSMOS inventory for the N310's data address; every later step uses it.
D=$(cosmos-tutorial which duranta-ota)
USRP=$(python3 $D/cosmos_addr.py usrp sdr1-s1-lg1 --plane data2); echo "$USRP"
Step 2 — Isolate CPU cores for the gNB (on the gNB server, once per image load). Without isolation the gNB shares its cores with everything else on the host: the cell comes up and carries downlink, then dies the first time uplink traffic flows. Isolation is a kernel boot parameter and the right cores differ per server, so the image carries none; the tool derives them from the NIC that reaches the radio.
ssh root@<gnb-node>
dev=$(ip route get $USRP | awk '{for(i=1;i<=NF;i++) if($i=="dev") print $(i+1); exit}')
cosmos-ofh-isolation --nic "$dev" # dry run: the cores it will isolate
cosmos-ofh-isolation --nic "$dev" --apply && systemctl reboot
# after the reboot:
grep -o 'isolcpus=[^ ]*' /proc/cmdline # must list cores
Step 3 — Power-cycle the radio and wait until it can be claimed. A crashed earlier session can leave the N310 claimed; a power cycle clears it. Power it off from the console, wait on the gNB server until it stops answering, power it on, then wait for MPM to answer discovery and, about 20 s later, to accept a session.
# on the console:
omf tell -a offh -t sdr1-s1-lg1
# on the gNB server:
for i in $(seq 1 45); do ping -c1 -W1 $USRP >/dev/null 2>&1 || break; sleep 2; done
# on the console, about 20 s later:
omf tell -a on -t sdr1-s1-lg1
# on the gNB server:
for i in $(seq 1 48); do uhd_find_devices --args addr=$USRP 2>/dev/null | grep -q serial && break; sleep 5; done
for i in $(seq 1 12); do timeout 40 uhd_usrp_probe --args addr=$USRP >/dev/null 2>&1 && break; sleep 5; done
Step 4 — Configure the cell and start the stack (on the gNB server). mk-gnb-oai-40.sh writes the gNB configuration for this radio; the sed puts the cell on its carrier (the SSB and Point A positions from the parameters); start-all.sh then refuses a claimed radio, brings up OAI CN5G, provisions the subscribers, writes the AMF's current address into the configuration, pins the gNB to the isolated cores and launches it with LD_LIBRARY_PATH set.
USRP=$USRP /root/duranta/mk-gnb-oai-40.sh
sed -i -E 's/(absoluteFrequencySSB *= *)[0-9]+/\1530910/; s/(dl_absoluteFrequencyPointA *= *)[0-9]+/\1527094/' /root/duranta/gnb-oai-40.conf
/root/duranta/start-all.sh
grep -aE 'got sync|is in service' /tmp/oai-gnb.log | tail -2
Step 5 — Check the host keeps up (on the gNB server). The package's fix-up script moves the radio NIC's interrupts onto that NIC's own NUMA node (outside the isolated cores), confirms the gNB is pinned, and restarts the gNB if its log floods with L (transmit-late) markers. Copy it from $D on the console first.
/root/duranta-ota_gnbfix.sh $USRP /tmp/oai-gnb.log /root/duranta/start-all.sh
DN=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' oai-ext-dn)
docker exec -d oai-ext-dn sh -c 'while true; do iperf3 -s -p 5201; sleep 0.3; done'
Step 6 — Configure and register the modem (on the UE node). A commercial modem ignores a private cell unless it is told to use 5G SA, to look in the cell's band, and which APN to ask for. The package's modem helper (copy duranta-ota_modem.py from $D) finds the Quectel's own devices (a UE node can carry two modems), writes those settings, reboots the modem so they take effect, and waits for registration.
ssh root@<ue-node>
systemctl stop ModemManager
read QMI WWAN <<<"$(python3 /root/duranta-ota_modem.py resolve auto auto)"; echo "$QMI $WWAN"
python3 /root/duranta-ota_modem.py configure /dev/ttyUSB2 00101 41 oai
python3 /root/duranta-ota_modem.py wait-reg /dev/ttyUSB2 240 00101
Step 7 — Start the data call and measure (on the UE node). The helper starts the QMI data call (and, if a stale session blocks it, deregisters, reboots and retries). Give $WWAN the address the network assigned and add scoped routes only: a default route through the modem cuts off the node's own SSH. Use the ext-DN address $DN from Step 5.
python3 /root/duranta-ota_modem.py call /dev/ttyUSB2 $QMI $WWAN oai 240 | tee /tmp/wds.txt
UE=$(awk -F': ' '/IPv4 address/{print $2}' /tmp/wds.txt | tr -d ' '); GW=$(awk -F': ' '/IPv4 gateway address/{print $2}' /tmp/wds.txt | tr -d ' ')
ip addr flush dev $WWAN; ip addr add $UE/22 dev $WWAN; ip link set $WWAN mtu 1400 up
ip route replace 192.168.100.0/22 dev $WWAN
for t in $DN 8.8.8.8; do ip route replace $t/32 via $GW dev $WWAN; done
ping -I $WWAN -c 10 -i 0.3 -W 2 $DN # the core's data network
ping -I $WWAN -c 10 -i 0.3 -W 2 8.8.8.8 # the internet
iperf3 -c $DN -p 5201 -B $UE -t 10 -i 0 -R # DL
iperf3 -c $DN -p 5201 -B $UE -t 10 -i 0 # UL
The notebook runs on the console and drives both nodes over SSH. It performs the same steps and plots downlink and uplink throughput. It can also be run non-interactively with papermill, which writes an executed copy to a new file.
The parity mode runs Ansible, manual and Jupyter one after the other on the same two nodes, radio and modem, and compares their results. It passes when every mode has the cell on air and the modem registered on the same cell, local ping loss is at most 20 %, the transmit-late count stays at most 500, downlink is in 20–400 and uplink in 2–120 Mbit/s, and the modes agree within 60 % (downlink) and 80 % (uplink). The bands are wide because over-the-air numbers depend on the modem's radio state and the shared RF space. The harness runs the teardown on every exit.
After Step 4, the radio is locked and the cell is in service:
[PHY] got sync (ru_thread)
[NR_RRC] cell PLMN 001.01 Cell ID ... is in service
got sync without is in service means the core did not answer NG Setup; is in service without got sync means the radio is not streaming.
After Step 5, the fix-up reports a pinned gNB and almost no transmit-late markers:
gnbfix: gNB pinned to ... (isolated ...)
gnbfix: tx-late markers in the last 20 kB: 0
gnbfix: OK
After Step 6, the modem is registered on its home network over 5G (+C5GREG: 0,1 on 001/01); after Step 7 it holds an IPv4 address in 192.168.100.0/22 and both pings succeed. A healthy cell on this rig gives roughly 110–120 Mbit/s downlink and 20 Mbit/s uplink with a ping of 11–12 ms; the uplink is small because DDDSU gives the uplink one slot in five. A parity run ends with PARITY: PASS:
=== duranta-ota parity ===
mode ue_ipv4 rsrp_dbm sinr_db tx_late ping_rtt_ms ping_remote_loss_pct dl_mbps ul_mbps
ansible 192.168.100.2 -84 25 0 11.21 0.0 116.0 15.6
manual 192.168.100.2 -84 25 0 12.06 0.0 119.0 11.7
jupyter 192.168.100.2 -84 26 0 12.54 0.0 119.0 19.5
dl_mbps spread max/min = 1.03 (tol 1.60)
ul_mbps spread max/min = 1.67 (tol 1.80)
PARITY: PASS (same experiment in all modes; all checks green)
(Real output from sb1, 2026-10-22, with the cell on the image's default 2593.35 MHz carrier; the current carrier is in Parameters.)
Change any of these with cosmos-tutorial run duranta-ota --params my.yml. An unknown key or a wrong type is refused. cosmos-tutorial params duranta-ota prints the file.
| Key | Default | Meaning |
|---|---|---|
duranta_sdr_node |
sdr1-s1-lg1 |
The N310 is a SHARED sandbox resource: reserve it and coordinate with its other users before running. |
duranta_usrp_node |
sdr1-s1-lg1 |
The radio's inventory node: its USRP address is looked up in the COSMOS inventory at run time. |
duranta_usrp_plane |
data2 |
The radio's network plane the gNB node streams on (data2 = the N310's data address). |
duranta_usrp_addr |
auto |
auto = from the COSMOS inventory (the radio node's duranta_usrp_plane address); an address pins it. |
duranta_radio_cycle |
True |
false = trust the radio's current state (faster, riskier) |
duranta_build_dir |
/opt/duranta/cmake_targets/ran_build/build |
|
duranta_mk_conf |
/root/duranta/mk-gnb-oai-40.sh |
USRP= regenerates gnb-oai-40.conf |
duranta_start_all |
/root/duranta/start-all.sh |
the image's validated one-shot (core+gNB) |
duranta_gnb_log |
oai-gnb.log |
this run's copy of the gNB log (relative = in the run's node dir /var/tmp/cosmos/); the live log is the one start-all.sh writes, emptied before each start |
duranta_core_dir |
/opt/oai-cn5g/oai-cn5g-fed/docker-compose |
|
duranta_core_compose |
docker-compose-basic-nrf.yaml |
|
duranta_ssb_arfcn |
530910 |
n41, 40 MHz (106 PRB @ 30 kHz), centred at 2654.55 MHz. |
duranta_pointa_arfcn |
527094 |
Point A (NR-ARFCN): the lowest subcarrier of the 106-PRB carrier. |
duranta_gnb_conf |
/root/duranta/gnb-oai-40.conf |
The gNB config the image's mk-gnb script writes and start-all.sh runs. |
duranta_band |
41 |
|
duranta_plmn |
00101 |
|
duranta_imsi |
auto |
auto = read from the modem's SIM (AT+CIMI); a number here is only a cross-check |
duranta_dnn |
oai |
|
duranta_ue_pool |
192.168.100.0/22 |
|
duranta_at_port |
/dev/ttyUSB2 |
|
duranta_qmi_dev |
auto |
auto = the Quectel's own QMI device and netdev, found from /dev/quectel-qmi or /dev/quectel-at (a UE node can carry two modems: node1.rrail has a SIMCom on cdc-wdm0/wwan0 and the Quectel on cdc-wdm1/wwan1). |
duranta_wwan |
auto |
|
duranta_nr5g_bands |
41 |
the cell's band ONLY: with "41:77:78" the modem camped on a stronger nearby n78 |
duranta_remote_target |
8.8.8.8 |
|
duranta_ping_count |
10 |
|
duranta_iperf_secs |
10 |
|
duranta_iperf_port |
5201 |
|
duranta_radio_timeout_s |
240 |
radio off->on->MPM answering |
duranta_gnb_timeout_s |
120 |
"got sync" / "is in service" |
duranta_reg_timeout_s |
240 |
+C5GREG: 0,1 |
To change a parameter, put only the keys you change in a file of your own and pass it to any mode. A key the tutorial does not have, or a value of the wrong type, is refused before anything starts:
cat > my.yml <<'EOF'
duranta_iperf_secs: 20
EOF
cosmos-tutorial run duranta-ota --params my.yml
To move the cell, change duranta_ssb_arfcn and duranta_pointa_arfcn together, by whole 1.2 MHz sync-raster steps, and keep duranta_nr5g_bands to the cell's band only. To change the tutorial itself, cosmos-tutorial copy duranta-ota puts an editable copy in the current directory, which then takes precedence over the installed one.
got sync, is in service and +C5GREG: 0,1 split the problem in three. The first two are the radio and the core, seen from the gNB; the third is the modem's view. A modem that never registers while both gNB lines are present is a modem-side problem (mode, band mask, SIM), not a RAN problem. The full attach sequence is on 5G SA fundamentals.L in the gNB log is a block of samples that reached the radio too late. A few at start-up are normal; a flood means the gNB threads share cores with other work or sit on the wrong NUMA node, and the modem then sees a downlink it cannot decode. The background is on Preparing a real-time RAN host.DDDSU cell caps both directions, and the modem's radio state adds run-to-run spread, so compare runs on the same rig and carrier. Every Duranta build's measurements, by CPU platform, are on Duranta performance by build.| Symptom | Cause | Fix |
|---|---|---|
| Uplink far below the expected value and different from run to run; one uplink slot per frame fails while the downlink is fine | an outside n41 signal occupies about 2560–2610 MHz at sb1; the image's default carrier (2593.35 MHz) sits inside it |
keep the tutorial's carrier, 2654.55 MHz (duranta_ssb_arfcn: 530910, duranta_pointa_arfcn: 527094); if you move it, keep the whole 40 MHz clear of 2560–2610 MHz |
check or the run stops: the gNB server does not reach the N310 |
the radio is off, or the inventory names another radio than the one you reserved | power the radio on from the console; set duranta_usrp_node and duranta_sdr_node to your radio, or pin duranta_usrp_addr |
start-all.sh reports claimed: True, or the gNB says Someone tried to claim this device again |
another session holds the USRP, or a stale claim after a crash | coordinate with the other user; if it is yours, power-cycle it from the console (Step 3) |
The radio pings after the power cycle but uhd_find_devices never sees it |
its MPM daemon did not start or is wedged; an omf power cycle is not always enough |
ssh root@<radio> reboot (the N310 runs Linux); if it still does not answer, ask COSMOS staff for a cold cycle at its power distribution unit |
gnbfix: NO CPU ISOLATION on this host |
the image carries no isolation, and it was not applied since the last omf load |
Step 2: cosmos-ofh-isolation --nic <USRP NIC> --apply, reboot, rerun |
The log floods with L, the modem's downlink BLER is near 1, or the cell dies when uplink traffic starts |
gNB threads not on isolated cores, or the radio NIC's interrupts on the other NUMA node | apply isolation (Step 2) and run the fix-up (Step 5); the tutorial restarts the gNB up to three times on a start-up flood |
dlopen(libparams_libconfig.so) … No such file, then exit |
the build was relocated and its library path is stale | export LD_LIBRARY_PATH=/opt/duranta/cmake_targets/ran_build/build (start-all.sh does this) |
gNB: NG Setup fails, AMF not associated |
the AMF container's address changes every time the core starts | rerun start-all.sh, which reads docker inspect oai-amf and rewrites amf_ip_address |
The modem stays in SEARCH while the cell is up |
its NR band mask excludes n41, or SA is disabled (nr5g_disable_mode must be 0) |
rerun Step 6; the helper sets SA-only and the mask 41 and verifies them after a reboot |
| The modem registers on a different cell | a band mask with more bands than the cell's lets it camp on a stronger nearby 001/01 cell | keep duranta_nr5g_bands to the cell's band only (41) |
The modem registers, but the data call returns CallFailed |
a PDU session left in the core by a previous run | the helper deregisters, reboots and retries; if it persists, docker compose restart oai-upf oai-smf on the gNB server |
The modem has an address but 100 % loss; ip -s link show $WWAN shows TX errors rising by one per packet and TX packets at 0 |
the host-to-modem USB data endpoint is stuck | a USB device reset of the modem (the helper does it automatically when it sees TX errors); see The commercial UE |
| SSH to the UE node stops answering after the data call | a default route through the modem | use only the scoped routes of Step 7 |
ping to a container address works but iperf3 says connection refused |
Docker assigns the demo-oai addresses in start order, so a remembered address may be another container |
always target the address from docker inspect … oai-ext-dn |
The modem cannot ping 8.8.8.8 but the data-network container answers |
the container's NAT is stale | docker exec oai-ext-dn ping 8.8.8.8 to confirm; restart the core |
OMF_NODES selected 1 node(s) … needs exactly 2 |
a node is off, or omf stat reports it unreachable and it does not answer SSH |
power the node on with omf tell and check ssh root@<node> |
After any mode, run the teardown from the console. It stops the modem's data call and hands the modem back to ModemManager, then stops the gNB and the core. The radio is left powered for the next user:
OMF_NODES=<gnb-node>,<ue-node> cosmos-tutorial run duranta-ota --mode teardown
After the manual steps, stop the gNB by the binary it is executing, never with pkill -x or pkill -f, which match by name or command line and can hit another user's process or your own shell. On the gNB server, define this helper once, then stop the gNB and the core:
stop_exe() { # signal the process GROUP of every process executing exactly $1 (default TERM)
local exe sig=${2:-TERM} d st pgid
exe=$(readlink -f "$1")
for d in /proc/[0-9]*; do
[ "$(readlink "$d/exe" 2>/dev/null)" = "$exe" ] || continue
st=$(cat "$d/stat" 2>/dev/null) || continue
st=${st##*) } # drop "pid (comm) ", safe for any comm
pgid=$(echo "$st" | awk '{print $3}') # remaining fields: state ppid pgrp
kill -"$sig" -- "-$pgid" 2>/dev/null
done
}
stop_exe /opt/duranta/cmake_targets/ran_build/build/nr-softmodem
docker compose -f /opt/oai-cn5g/oai-cn5g-fed/docker-compose/docker-compose-basic-nrf.yaml down
start-all.sh launched the gNB with setsid, so its process group is exactly that launch. If it is still running after a few seconds, repeat the call with KILL as the second argument. On the UE node, stop the data call and give the modem back:
qmicli -p -d $QMI --wds-stop-network=disable-autoconnect; ip addr flush dev $WWAN; ip link set $WWAN down
systemctl start ModemManager
Then power the nodes off from the console (the radio stays on):
omf tell -a offh -t <gnb-node>,<ue-node>
Package cosmos-experiments-duranta 0.1.0-25 - on every console it is released to (cosmos-tutorial list shows the installed version). The code is installed on the console in /usr/share/cosmos-experiments/duranta-ota/. To change anything, cosmos-tutorial copy duranta-ota puts an editable copy in the current directory, and cosmos-tutorial run duranta-ota then runs that copy instead of the installed one (cosmos-tutorial which duranta-ota shows which will run). Repository (GitLab account needed, not needed to run or change it): packages/cosmos-experiments-duranta/usr/share/cosmos-experiments/duranta-ota.
Last verified 2026-11-01 on duranta-w44-20261101 (Duranta 2026.w44), with the tutorial sources released in cosmos-experiments-duranta 0.1.0-20, cold start (all devices off), on sb1 (2× Intel Xeon Gold 6226, N310 and Quectel modem): one of two parity runs PASS (downlink 117–120, uplink 17–18 Mbit/s, ping 11–12 ms); the other failed on spread only, because its first mode was slow (downlink 33, then 101 and 118 Mbit/s). Earlier: three-mode parity PASS on 2026-10-30 from the installed cosmos-experiments-duranta package (downlink 108–119, uplink 21–22 Mbit/s), and on 2026-10-28, 2026-10-26 and 2026-10-22. Results by build are on Duranta performance by build.
References: Duranta source · Duranta at LF Networking · OAI RAN documentation · OAI CN5G · UHD manual · Quectel RM520N series · 3GPP TS 38.104 (bands) and TS 23.502 (registration and PDU session) · iperf3 · on this wiki: Duranta on COSMOS · OAI CN5G · The commercial UE · Preparing a real-time RAN host · SDR hardware.
Author(s): COSMOS team · Package: cosmos-experiments-duranta (cosmos-tutorial run duranta-ota) · Tags: duranta, oai, oai-cn5g, 5g, sa, sdr, usrp, n310, quectel, n41, ota