Open5GS is the 5G core network that COSMOS pairs with the OCUDU (srsRAN) gNB, from the soft-only cell with no radio to the O-RAN 7.2 split with a commercial O-RU. This page explains what a 5G core does, what each Open5GS network function is for, how the core is installed and started on the COSMOS images, how subscribers get into it, and when to choose it over the other two cores on the testbed. Read it before your first OCUDU tutorial, or when an attach fails and you need to know which part of the core to look at.
A 5G Standalone (SA) network has three parts: the user equipment (UE), the radio access network (RAN, here a gNB), and the 5G core (5GC). The core authenticates subscribers, decides which UE may attach, allocates IP addresses, and forwards user traffic between the radio network and the internet. The 5G SA fundamentals page explains this division and the attach sequence in full; this page assumes that background and concentrates on one implementation.
Open5GS is an open-source implementation of the 4G Evolved Packet Core (EPC) and the 5G core, written in C and licensed under the GNU Affero General Public License (AGPL-3.0). Source code: github.com/open5gs/open5gs. It implements the 3GPP service-based architecture (TS 23.501) with one process per network function (NF), a MongoDB subscriber database, and an optional web interface for editing subscribers. Each NF reads one YAML file.
The problem Open5GS solves on COSMOS is getting a standards-conformant core out of the way of a radio experiment. It is small, starts in seconds, runs on the same server as the gNB, and needs no container runtime or Kubernetes. That makes a complete 5G SA cell possible on a single reserved node.
Figure — The 5G SA architecture. The control-plane NFs (AMF, SMF, AUSF, UDM, UDR, NRF, PCF, NSSF) talk to each other over the service-based bus; the gNB reaches the AMF over N2 and the UPF over N3; the UPF reaches the data network over N6. Open5GS runs every box in the core as a separate process.
The core splits into a control plane, which decides what may happen, and a user plane, which carries the packets. In Open5GS every NF below is a binary named open5gs-<nf>d, started with -c <config>.yaml.
| NF | Full name | What it does |
|---|---|---|
| AMF | Access and Mobility Management Function | The gNB's entry point into the core. It terminates N2 (the NG Application Protocol, NGAP, on SCTP port 38412), accepts the gNB's NG Setup, and carries the UE's Non-Access Stratum (NAS) messages: registration, authentication, security mode. The PLMN and tracking area code (TAC) it serves decide which gNBs it accepts. |
| SMF | Session Management Function | Creates PDU sessions (a UE's IP connection to a data network), allocates the UE's IP address from a pool, and programs the UPF over N4 using the Packet Forwarding Control Protocol (PFCP). |
| UPF | User Plane Function | Forwards user traffic. It receives the UE's packets from the gNB over N3 (GTP-U tunnels on UDP 2152) and sends them to the data network over N6. In Open5GS the N6 side is a Linux TUN device, ogstun. |
| NRF | NF Repository Function | Service discovery. Every NF registers with the NRF at start-up; an NF that needs another (the AMF looking for an SMF, for example) asks the NRF. |
| SCP | Service Communication Proxy | Routes service-based interface (SBI) requests between NFs ("indirect communication"). In the default configuration every NF sends its SBI requests through the SCP, so the NRF and the SCP must both be running. |
| AUSF | Authentication Server Function | Runs 5G-AKA authentication for a registering UE. |
| UDM | Unified Data Management | Holds the subscriber's authentication credentials and subscription profile on behalf of the AUSF and AMF; also de-conceals the UE's encrypted identity (SUCI) using the home-network keys. |
| UDR | Unified Data Repository | The storage front end for UDM and PCF data; in Open5GS it reads MongoDB. |
| PCF | Policy Control Function | Supplies QoS and charging policy for sessions. |
| NSSF | Network Slice Selection Function | Chooses the network slice (S-NSSAI) that serves a UE. |
| BSF | Binding Support Function | Tracks which PCF serves which PDU session. |
| MongoDB | — | The subscriber database (open5gs database, subscribers collection). |
| WebUI | — | A browser editor for subscribers (Node.js, port 9999). Scripted provisioning does not use it. |
Open5GS also ships the 4G EPC functions (open5gs-mmed, -sgwcd, -sgwud, -hssd, -pcrfd). None of the COSMOS 5G SA tutorials use them.
When a UE attaches, the gNB forwards its Registration Request to the AMF over N2. The AMF asks the NRF (through the SCP) for an AUSF; the AUSF gets an authentication vector from the UDM, which reads the subscriber's key material from the UDR and MongoDB. After authentication and NAS security mode, the AMF accepts the registration. The UE then requests a PDU session; the AMF asks the NRF for an SMF, the SMF allocates an address from its pool and installs forwarding rules in the UPF over PFCP, and the gNB sets up the matching N3 tunnel. From then on the UE's packets flow gNB → UPF → ogstun → NAT → internet.
This path explains most debugging on the core: a failure in NRF discovery surfaces as an error far downstream in the AMF, and a missing subscriber surfaces as an authentication failure, not as "unknown user".
Each NF has its own YAML file. Three of them decide almost every core-side failure on COSMOS:
amf.yaml — the served PLMN (mobile country and network code), the TAC, the slice list, and the NGAP bind address. The gNB's PLMN and TAC must match, or NG Setup is rejected.nrf.yaml — the NRF's own serving PLMN. It must match the AMF's PLMN. If it does not, the NRF treats the UE's home network as a foreign network, tries to route discovery through a Security Edge Protection Proxy (SEPP) that does not exist, and discovery fails; the AMF logs HTTP response error [400] and the UE receives Registration reject [95]. Change the PLMN in both files, always.smf.yaml — the UE address pool and the data network names (DNNs) it serves.upf.yaml — the N3 (GTP-U) bind address and the ogstun device. When the gNB and the UPF are on different hosts, the N3 address must be on the data plane, not the management network.Open5GS is part of the OCUDU image, ocudu.ndz (the current dated build is listed on OCUDU image builds), loaded with omf load. It is a native build — no containers — installed under /opt/open5gs, with the NF configuration files in /opt/open5gs/etc/ (for example /opt/open5gs/etc/amf.yaml and /opt/open5gs/etc/smf.yaml). An Open5GS installed from the upstream apt packages instead places its configuration in /etc/open5gs/ and runs each NF as a systemd unit; the COSMOS image does not use that layout.
The core runs on the same server as the gNB (or the O-DU, in the O-RAN 7.2 tutorials). The gNB reaches the AMF on the loopback address 127.0.0.5, port 38412.
The image ships a launcher and a stop script:
/root/open5gs/start.sh # NFs + ogstun 192.168.100.1/22 + NAT + provisions subscribers
ss -lnp -A sctp | grep 38412
LISTEN 0 0 127.0.0.5:38412 0.0.0.0:* users:(("open5gs-amfd",...))
What to look for: a LISTEN socket on 127.0.0.5:38412 owned by open5gs-amfd. No line means the AMF is not running and every gNB will fail NG Setup.
start.sh starts MongoDB and the NFs, creates ogstun with the gateway address 192.168.100.1/22, adds a MASQUERADE rule so UE traffic reaches the internet, and provisions subscribers. It also pins the NFs to housekeeping cores, away from the gNB's real-time threads. To stop the core:
/root/open5gs/stop.sh
The UE pool 192.168.100.0/22 and PLMN 00101 are the COSMOS standard for all three RAN stacks. The core serves TAC 7:
grep -A4 'tai:' /opt/open5gs/etc/amf.yaml
tai:
- plmn_id:
mcc: 001
mnc: 01
tac: 7
A gNB configuration written for a different PLMN or TAC fails NG Setup with unknown-PLMN-or-SNPN; fixing the PLMN alone is not enough, because the TAC must match too.
A UE can register only if the core holds its IMSI, its secret key (Ki) and its operator key (OPc). On COSMOS these come from one inventory: the cosmos-sim-db package, which lives only on core servers. Its generator, cosmos-sim-gen, writes subscribers for a given core; the image's reconciler compares the core's database with the inventory and adds only what is missing:
open5gs: inventory (cosmos-sim-db 2026-08-28) 73 SIMs on 00101 incl. soft pool; provisioned 73; missing 0
That output comes from the ProtO-RU tutorial's bring-up, which runs the reconciler before starting the gNB. The tutorial launchers also provision their own test subscribers (for example the soft UE 001010123456780) from subscriber_db.csv.
Warning: SIM key material belongs on core servers only. Provision on the host that runs the core. Never pass Ki or OPc through console parameters, experiment bundle variables or wiki pages; a bundle carries the IMSI only.
IPv4-only sessions. The OCUDU (srsRAN) gNB supports IPv4 PDU sessions only. Amarisoft lteue and many commercial modems request a dual-stack IPv4v6 session by default, which the gNB rejects every time ([NGAP] Unsupported PDU Session Type: ipv4v6) while registration still succeeds. Set each subscriber's session type to IPv4 (type: 1) at the core:
mongosh open5gs --quiet --eval 'db.subscribers.updateMany({}, {$set: {"slice.0.session.0.type": 1}})'
The SMF then answers any IPv4v6 request with an IPv4 session, which the gNB accepts.
After any subscriber write, compare the database with the generator's output rather than trusting the write: a key written into the wrong field produces Authentication failure (MAC failure) at the AMF, which looks exactly like a wrong SIM.
COSMOS offers three cores. Choose by what you want to study.
| Open5GS | OAI CN5G | Aether SD-Core | |
|---|---|---|---|
| Pairs with | OCUDU (srsRAN) | Duranta (OAI) | OCUDU, as a separate core host |
| Deployment | native processes on the RAN host | Docker Compose on the RAN host | Kubernetes (RKE2) + Helm on its own host |
| Start-up | seconds | about a minute (container health checks) | minutes; restart rules apply |
| Subscriber store | MongoDB | MySQL | MongoDB, pushed from Helm values by simapp |
| Best for | radio experiments where the core must be dependable and invisible | Duranta tutorials and OAI-native work | studying a cloud-native core and a separate core host |
Choose Open5GS when the radio is the object of study. It is the default for every OCUDU tutorial except the two-server SD-Core tutorial, and it has the fewest moving parts. Its limitations are those of a single-host core: the AMF listens on loopback, so a gNB on another server needs the NGAP and GTP-U bind addresses moved to the data plane, and there is no orchestration layer to study. For a core that runs as Kubernetes workloads on its own server, use Aether SD-Core; for the Duranta stack use OAI CN5G. Amarisoft ships its own integrated core (ltemme) and uses none of these.
The tutorials that use Open5GS, in learning-path order:
| Step | Tutorial | Modality | Status |
|---|---|---|---|
| 1 | OCUDU 5G SA soft-only — gNB + srsUE over ZMQ | no radio, one host | verified 2026-09-14 |
| 2 | OCUDU 5G SA over the air — cross-vendor UEs | USRP N310, commercial modem and lteue |
verified 2026-09-16 |
| 3 | OCUDU 7.2 with a soft O-RU — ProtO-RU on a USRP N310 | O-RAN 7.2, soft O-RU | verified 2026-09-15 |
| 4 | OCUDU 5G SA over O-RAN 7.2 — commercial O-RUs | O-RAN 7.2, Benetel RAN650 / LiteOn FlexFi | verified 2026-09-16; Benetel measured 2026-09-22 |
| 6 | Near-RT RIC + OCUDU — E2 KPM monitoring | soft rig on Open5GS; 7.2 rigs on SD-Core | verified 2026-09-22 |
Step 5 of the path, the two-server SD-Core tutorial, replaces Open5GS with SD-Core.
The core is not the throughput bottleneck in any COSMOS measurement; the numbers below are set by the radio, the carrier bandwidth and the RAN server. They are listed here so you can see what an Open5GS-backed cell delivers. The full matrix, with every platform and modality, is on the OCUDU page.
| CPU platform | Cores / threads |
|---|---|
| A — 2× Intel Xeon Gold 6226 @ 2.70 GHz | 24 cores / 24 threads (HT off) |
| B — 2× Intel Xeon Gold 6126 @ 2.60 GHz | 24 cores / 48 threads (HT on) |
| C — 1× AMD EPYC 9355P | 32 cores / 32 threads (SMT off) |
| Modality | UE | Platform | DL, Mbit/s | UL, Mbit/s | Date · image |
|---|---|---|---|---|---|
| Soft-only (ZMQ, band 3, 10 MHz) | srsue |
A | 26.2–26.6 | 4.62–4.82 | 2026-09-14 · ocudu-20260909b |
| B | 26.1–26.2 | 4.72–5.02 | 2026-09-14 · ocudu-20260909b |
||
| C | 27.2 | 5.03 | 2026-09-14 · ocudu-20260909b |
||
| Over the air (N310, n41 40 MHz) | Quectel RM520N-GL | A | 54.7–55.8 | 58.6–59.1 | 2026-09-17 · ocudu-20260916 |
| O-RAN 7.2, soft O-RU (ProtO-RU + N310, 40 MHz n41) | Quectel RM520N-GL | A | 88–103 | 38–39 | 2026-09-15 · ocudu-20260915 |
| O-RAN 7.2, Benetel RAN650 (100 MHz n78), golden O-RU state restored | Quectel RM520N-GL | B | 209–220 | 78 | 2026-09-22 · ocudu-20260916 |
unknown-PLMN, stops, and does not retry; its log shows nothing further. Restart the gNB after fixing the core.192.168.100.0/22 has to reach the host with ogstun, or the PDU session is established and no replies return — which looks like a radio fault and is not.freeDiameter: line in /opt/open5gs/etc/smf.yaml stays commented out (5G SA does not use Diameter; the SMF aborts on a missing freeDiameter/smf.conf otherwise), and start.sh copies the UDM's home-network key files into place. start.sh provisions subscribers with python3-pymongo, which is baked into ocudu.ndz.lteue split the IMSI as a 3-digit MCC, a 2-digit MNC and a 10-digit MSIN. The COSMOS PLMN 00101 satisfies this; a 3-digit-MNC PLMN produces a 16-digit IMSI and Registration reject [95].Author(s): COSMOS team · Last verified: 2026-09-21 (landing page; see each linked tutorial for its own verification date) · text revised 2026-09-24 · Tested image/release: ocudu.ndz · Tags: open5gs, 5gc, core, 5g, sa, overview