A comprehensive 5G Core Network testbed integrating Open5GS and UERANSIM for research, testing, and educational purposes. This testbed supports multiple network slices and provides flexible deployment options to suit different testing scenarios.
This testbed network is used for 5G core network demonstration for 2025 CIF65217 Wireless Network course @ FILKOM UB.
A paper about this project is available on Bahasa Indonesia thru this link: https://j-ptiik.ub.ac.id/index.php/j-ptiik/article/view/16025
For more information: rayhanegar.sn@gmail.com
This repository provides a complete 5G standalone (SA) network testing environment with:
- Open5GS 5G Core Network: Full 5GC implementation with AMF, SMF, UPF, NRF, and all control plane functions
- UERANSIM: Open-source 5G UE and RAN (gNB) simulator for testing the core network
- Multi-Slice Support: Three pre-configured network slices (eMBB, URLLC, mMTC)
- Flexible Deployment: Native, Docker Compose, and Kubernetes (K3s) deployment options
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β UERANSIM Component β
β ββββββββββββ ββββββββββββ β
β β nr-gnb β βββββββΊ β nr-ue β β
β β (gNodeB) β β (UE) β β
β ββββββ¬ββββββ ββββββ¬ββββββ β
β β N2 (NGAP) β uesimtun0 (Data) β
βββββββββΌβββββββββββββββββββββΌβββββββββββββββββββββββββββββββββββββ
β β
β SCTP/38412 β GTP-U/2152
βΌ βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Open5GS 5G Core Network β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β Control Plane β β
β β βββββββ βββββββ βββββββ βββββββ βββββββ β β
β β β AMF β β SMF β β NRF β β AUSFβ β UDM β ... β β
β β βββββββ βββββββ βββββββ βββββββ βββββββ β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β User Plane β β
β β βββββββ ogstun (10.45.0.0/24) - eMBB β β
β β β UPF β ββ ogstun2 (10.45.1.0/24) - URLLC β β
β β βββββββ ogstun3 (10.45.2.0/24) - mMTC β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β Data Store β β
β β βββββββββββ ββββββββββ β β
β β β MongoDB β β WebUI β β β
β β βββββββββββ ββββββββββ β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βΌ
Internet
Important: The architecture diagram shows the IP addresses used in the current configuration (e.g., 10.34.4.130, 10.10.0.0/24). You must adjust these IP addresses to match your specific environment before deployment.
MongoDB and Open5GS WebUI operate outside the K3s/Docker cluster as external services running on the host machine or a separate VM. The containerized Open5GS network functions connect to these external services for subscriber data management.
- MongoDB: Serves as the persistent subscriber database, accessible by both the WebUI and core network functions (UDM, UDR, etc.)
- Open5GS WebUI: Provides a web-based interface for managing subscribers, requiring direct MongoDB access
- Isolation: Keeping data services external simplifies backup, migration, and allows the core network to scale independently
# Install MongoDB on Ubuntu
sudo apt update
sudo apt install -y mongodb-org
# Start MongoDB service
sudo systemctl start mongod
sudo systemctl enable mongod
# Verify MongoDB is running
sudo systemctl status mongod
# Check MongoDB is listening on port 27017
sudo netstat -tulpn | grep 27017By default, MongoDB only listens on localhost. To allow K3s/Docker containers to connect:
# Edit MongoDB configuration
sudo nano /etc/mongod.conf
# Update the bindIp to allow connections from your network
# Change:
# bindIp: 127.0.0.1
# To:
# bindIp: 0.0.0.0 # Or specify your host IP (e.g., 10.34.4.130)
# Restart MongoDB
sudo systemctl restart mongod# Install Node.js (required for WebUI)
curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
sudo apt install -y nodejs
# Clone and install Open5GS WebUI
git clone https://github.com/open5gs/open5gs.git
cd open5gs/webui
npm clean-install
# Configure MongoDB connection (if needed)
# Edit: open5gs/webui/server/index.js
# Update MongoDB URI to: mongodb://localhost:27017
# Start WebUI
npm run dev
# Or for production: npm run start
# Access WebUI at: http://<your-host-ip>:9999
# Default credentials: admin / 1423Critical: Before deploying Open5GS, update the MongoDB connection strings in the network function configurations:
Edit the following files in open5gs/open5gs-compose/:
amf/amf.yaml- Update NRF addresssmf/smf.yaml- Update NRF and UPF addressesnrf/nrf.yaml- Update MongoDB URI:mongodb://<your-host-ip>:27017udm/udm.yaml- Update MongoDB URIudr/udr.yaml- Update MongoDB URI- All NF configs - Update
sbi.advertiseaddresses to match your network
Example MongoDB URI update:
db_uri: mongodb://10.34.4.130:27017/open5gs # Change to your host IPEdit ConfigMaps in open5gs/open5gs-k3s-calico/01-configmaps/:
nrf-configmap.yamludm-configmap.yamludr-configmap.yaml- All relevant ConfigMaps with
db_urifields
# From host machine
mongo --host <your-host-ip> --port 27017
# From inside a container/pod (test connectivity)
ping <your-host-ip>
curl http://<your-host-ip>:27017
# MongoDB should respond with: "It looks like you are trying to access MongoDB over HTTP..."
# Check Open5GS database exists
mongo --host <your-host-ip> --eval "show dbs"The configurations in this repository use the following IP addresses as examples:
- Host/MongoDB/WebUI:
10.34.4.130 - Control Plane Network:
10.10.0.0/24 - User Plane Networks:
10.45.0.0/24,10.45.1.0/24,10.45.2.0/24
You must replace these with your actual network addresses before deployment.
-
Complete 5G Core Network Functions:
- AMF (Access and Mobility Management Function)
- SMF (Session Management Function)
- UPF (User Plane Function)
- NRF (Network Repository Function)
- AUSF (Authentication Server Function)
- UDM (Unified Data Management)
- UDR (Unified Data Repository)
- PCF (Policy Control Function)
- NSSF (Network Slice Selection Function)
- SCP (Service Communication Proxy)
-
Three Network Slices:
Slice SST DNN Subnet Use Case eMBB 1 embb.testbed 10.45.0.0/24 Enhanced Mobile Broadband URLLC 2 urllc.v2x 10.45.1.0/24 Ultra-Reliable Low Latency (V2X) mMTC 3 mmtc.testbed 10.45.2.0/24 Massive Machine Type (IoT) -
Three Deployment Options:
- Native Installation: Systemd services on Ubuntu (production-like)
- Docker Compose: Containerized NFs with hybrid architecture
- Kubernetes (K3s): Orchestrated deployment with Calico CNI
-
gNB Simulator (
nr-gnb): 5G base station implementation- NGAP (N2) interface to AMF
- GTP-U (N3) interface to UPF
- Multi-slice support
-
UE Simulator (
nr-ue): 5G user equipment implementation- Full NAS registration procedure
- PDU session establishment
- TUN interface creation (
uesimtun0) - Multi-DNN support
-
Supporting Tools:
nr-cli: Interactive command-line interfacenr-binder: Network namespace binding utility
Open5GS-Testbed/
βββ open5gs/ # Open5GS 5G Core Network
β βββ configs-reference/ # Reference configuration files for all NFs
β βββ open5gs-compose/ # Docker Compose deployment
β β βββ docker-compose.yml
β β βββ setup-host-network-*.sh # Network setup scripts
β β βββ amf/, smf/, upf/, ... # Per-NF configurations
β β βββ README.md # Compose deployment guide
β βββ open5gs-k3s-calico/ # Kubernetes deployment
β β βββ 00-foundation/ # K3s foundation resources
β β βββ 01-configmaps/ # NF configurations
β β βββ 02-control-plane/ # Control plane deployments
β β βββ 03-session-mgmt/ # Session management
β β βββ 04-user-plane/ # User plane deployments
β β βββ deploy-k3s-calico.sh # Deployment script
β β βββ README.md # K3s deployment guide
β βββ scripts/ # Helper scripts for native deployment
β βββ Open5GS Setup and Configuration.md # Native installation guide
β βββ README.md # Open5GS overview
βββ ueransim/ # UERANSIM RAN Simulator
β βββ build/ # Pre-compiled binaries
β β βββ nr-gnb # gNB simulator
β β βββ nr-ue # UE simulator
β β βββ nr-cli # CLI tool
β β βββ nr-binder # Network binder
β βββ configs/ # Configuration files
β β βββ open5gs-gnb-local.yaml # gNB configuration
β β βββ open5gs-ue-embb.yaml # UE configuration
β βββ README.md # UERANSIM usage guide
βββ README.md # This file
- Ubuntu 20.04/22.04 or similar Linux distribution
- Root/sudo access
- MongoDB installed and running (on host machine or accessible VM)
- Open5GS WebUI (optional but recommended for subscriber management)
- For Docker Compose: Docker and Docker Compose installed
- For K3s: K3s cluster with Calico CNI
- For UERANSIM: SCTP kernel module
Note: MongoDB and WebUI must be set up before deploying Open5GS. See the MongoDB and WebUI Setup section for installation instructions.
# Follow the native installation guide
cd open5gs
cat "Open5GS Setup and Configuration.md"
# Install Open5GS packages
sudo apt install software-properties-common
sudo add-apt-repository ppa:open5gs/latest
sudo apt update
sudo apt install open5gs
# Configure and start services
# See detailed guide for configuration steps
sudo systemctl start open5gs-amfd open5gs-smfd open5gs-upfd# Navigate to compose directory
cd open5gs/open5gs-compose
# Setup host network (choose one option)
sudo bash setup-host-network-eduvpn.sh
# OR
sudo bash setup-host-network-tailscale.sh
# OR
sudo bash setup-host-network-ethernet-icn.sh
# Start Open5GS containers
docker compose up -d
# Verify services
docker compose ps# Navigate to K3s directory
cd open5gs/open5gs-k3s-calico
# Setup K3s environment
sudo bash setup-k3s-environment-calico.sh
# Build and import container images
bash build-import-containers.sh
# Deploy Open5GS to K3s
bash deploy-k3s-calico.sh
# Verify deployment
kubectl get pods -n open5gs# Navigate to UERANSIM directory
cd ueransim
# Start gNB (in one terminal)
./build/nr-gnb -c configs/open5gs-gnb-local.yaml
# Start UE (in another terminal)
./build/nr-ue -c configs/open5gs-ue-embb.yaml
# Test connectivity
ping -I uesimtun0 -c 4 8.8.8.8| Guide | Description | Path |
|---|---|---|
| Native Installation | Step-by-step systemd service deployment | open5gs/Open5GS Setup and Configuration.md |
| Docker Compose | Hybrid containerized deployment guide | open5gs/open5gs-compose/README.md |
| Kubernetes (K3s) | K3s orchestration with Calico CNI | open5gs/open5gs-k3s-calico/README.md |
| Configuration Reference | All NF YAML configurations | open5gs/configs-reference/ |
| DNN Configuration | Network slice setup details | open5gs/open5gs-compose/DNN-configuration.md |
| Guide | Description | Path |
|---|---|---|
| UERANSIM Usage | Complete gNB/UE setup and testing | ueransim/README.md |
| gNB Configuration | Base station configuration | ueransim/configs/open5gs-gnb-local.yaml |
| UE Configuration | User equipment configuration | ueransim/configs/open5gs-ue-embb.yaml |
# Start Open5GS (choose deployment method)
# Start UERANSIM gNB and UE
# Test basic connectivity
ping -I uesimtun0 -c 4 8.8.8.8
# Test HTTP traffic
curl --interface uesimtun0 http://example.com
# Test throughput
iperf3 -c <server-ip> -B 10.45.0.2# Configure UE with multiple PDU sessions (eMBB + URLLC)
# Check created TUN interfaces
ip addr show | grep uesimtun
# Test eMBB slice (high bandwidth)
ping -I uesimtun0 -c 10 8.8.8.8
# Test URLLC slice (low latency)
ping -I uesimtun1 -c 10 8.8.8.8
# Compare latencies# Use nr-binder for traffic isolation
cd ueransim
./build/nr-binder 10.45.0.2 traceroute 8.8.8.8
# Capture 5G protocol traffic
sudo tcpdump -i any -n sctp -w n2-interface.pcap
sudo tcpdump -i any -n udp port 2152 -w n3-interface.pcap
# Monitor with Wireshark
wireshark n2-interface.pcapReminder: MongoDB and WebUI run outside the K3s/Docker cluster. Ensure these services are installed and running on your host machine. See MongoDB and WebUI Setup for details.
# Access Open5GS WebUI (replace with your host IP)
# URL: http://<your-host-ip>:9999 (e.g., http://10.34.4.130:9999)
# Login: admin / 1423
# Add subscriber:
# - IMSI: 001010000000001
# - K: 465B5CE8B199B49FAA5F0A2EE238A6BC
# - OPc: E8ED289DEBA952E4283B54E88E6183CA
# - Select DNN: embb.testbed, urllc.v2x, or mmtc.testbed# Connect to MongoDB (replace with your host IP if remote)
mongo --host <your-host-ip> --port 27017
# Or if MongoDB is on localhost:
# mongo
# Switch to open5gs database
use open5gs
# Add subscriber
db.subscribers.insert({
"imsi": "001010000000001",
"security": {
"k": "465B5CE8B199B49FAA5F0A2EE238A6BC",
"opc": "E8ED289DEBA952E4283B54E88E6183CA",
"amf": "8000"
},
"slice": [{
"sst": 1,
"default_indicator": true,
"session": [{
"name": "embb.testbed",
"type": 3
}]
}]
})sudo journalctl -u open5gs-amfd -f
sudo journalctl -u open5gs-upfd -fcd open5gs/open5gs-compose
docker compose logs -f amf
docker compose logs -f upfkubectl logs -n open5gs -l app=amf -f
kubectl logs -n open5gs -l app=upf -fsudo systemctl restart open5gs-amfd
sudo systemctl restart open5gs-upfddocker compose restart amf
docker compose restart upfkubectl rollout restart -n open5gs deployment/amf
kubectl rollout restart -n open5gs deployment/upf| Issue | Solution | Documentation |
|---|---|---|
| AMF not starting | Check PLMN configuration, verify SCTP module | Native guide |
| UPF TUN creation failed | Verify NET_ADMIN capability, check sysctl | Compose guide |
| MongoDB connection issues | Check MongoDB is running on host, verify port 27017 is open, ensure db_uri uses correct host IP, test connectivity from containers |
MongoDB Setup |
| NF registration failures | Check NRF connectivity, verify SBI addresses | K3s guide |
| WebUI cannot connect | WebUI runs on host machine - check Node.js is running, verify MongoDB connection, check firewall rules for port 9999 | MongoDB Setup |
| Issue | Solution | Documentation |
|---|---|---|
| gNB can't connect to AMF | Verify AMF IP/port, check SCTP module, test connectivity | UERANSIM guide |
| UE authentication failure | Check K/OPc match, verify IMSI in MongoDB | UERANSIM guide |
| PDU session rejected | Verify DNN in SMF config, check slice permissions | UERANSIM guide |
| No internet from UE | Check UPF NAT rules, verify IP forwarding | UERANSIM guide |
Detailed troubleshooting: See individual component README files for comprehensive solutions.
β οΈ Important: The IP addresses listed below are examples from the current configuration. You MUST adjust these addresses to match your specific network environment before deployment. Update all configuration files accordingly.
- MCC: 001 (Test network)
- MNC: 01
- MongoDB: Port 27017 on host IP (example:
10.34.4.130) - Open5GS WebUI: Port 9999 on host IP (example:
10.34.4.130) - Host Machine: Primary network interface IP (example:
10.34.4.130)
These services run on the host machine or a dedicated VM and are accessed by containerized network functions.
- AMF: 127.0.0.5
- SMF: 127.0.0.4
- NRF: 127.0.0.10
- Other NFs: 127.0.0.x
- Network: 10.10.0.0/24 (example - adjust to your network)
- AMF: 10.10.0.5
- SMF: 10.10.0.4
- UPF: 10.10.0.7
- NRF: 10.10.0.10
- eMBB subnet: 10.45.0.0/24 (ogstun)
- URLLC subnet: 10.45.1.0/24 (ogstun2)
- mMTC subnet: 10.45.2.0/24 (ogstun3)
When adapting this testbed to your environment, update IP addresses in:
- MongoDB Connection Strings: All
db_uriparameters in NRF, UDM, UDR configs - SBI Addresses: Service-based interface
advertiseaddresses in all NF configs - NGAP/GTPU Addresses: AMF NGAP address, UPF GTPU address
- Setup Scripts: Network setup scripts in
open5gs-compose/setup-host-network-*.sh - UERANSIM Configs: gNB and UE configuration files with AMF/UPF addresses
Refer to individual deployment guides for detailed configuration instructions.
This testbed is designed for:
- 5G Protocol Research: Full 3GPP-compliant implementation
- Network Slice Experimentation: Pre-configured eMBB, URLLC, mMTC slices
- Performance Testing: Throughput, latency, QoS validation
- Student Labs: Hands-on 5G core network experience
- Development: Testing 5G applications and services
- Basic 5G Connectivity: Deploy Open5GS, connect UERANSIM, test data plane
- Network Slice QoS: Compare latency/throughput across eMBB vs URLLC slices
- Multi-UE Scenarios: Register multiple UEs with different slice configurations
- Handover Testing: Test UE mobility between cells (multiple gNBs)
- Protocol Analysis: Capture and analyze NGAP, GTP-U, NAS messages
- Deployment Comparison: Compare Native vs Docker vs K8s performance
- Test PLMN codes (001/01)
- Example subscriber credentials
- No TLS for inter-NF communication
- MongoDB without authentication
- Open5GS WebUI with default credentials
- Use real PLMN codes from your operator license
- Generate unique K/OPc per subscriber
- Enable TLS for all NF-to-NF communication
- Secure MongoDB with authentication and TLS
- Change all default passwords
- Implement proper network segmentation
- Use hardware security modules (HSM) for key storage
- Enable SELinux/AppArmor for container isolation
| Metric | Native | Docker Compose | K3s |
|---|---|---|---|
| Registration Time | ~150ms | ~200ms | ~250ms |
| PDU Session Setup | ~100ms | ~150ms | ~180ms |
| Throughput (eMBB) | 500+ Mbps | 450+ Mbps | 400+ Mbps |
| Latency (URLLC) | ~15ms | ~20ms | ~25ms |
| Concurrent UEs | 100+ | 80+ | 60+ |
Note: Performance varies based on hardware, network conditions, and configuration.
Contributions are welcome! Areas for improvement:
- Additional network slice configurations
- Performance optimization
- Additional deployment scenarios
- Enhanced monitoring and observability
- Test automation scripts
- Documentation improvements
- Official Website: https://open5gs.org/
- GitHub Repository: https://github.com/open5gs/open5gs
- Documentation: https://open5gs.org/open5gs/docs/
- GitHub Repository: https://github.com/aligungr/UERANSIM
- Wiki: https://github.com/aligungr/UERANSIM/wiki
- 5G System Architecture: TS 23.501
- NAS Protocol: TS 24.501
- NGAP Protocol: TS 38.413
- 5G QoS: TS 23.503
- 3GPP Specifications: https://www.3gpp.org/DynaReport/38-series.htm
- Docker Documentation: https://docs.docker.com/
- Kubernetes Documentation: https://kubernetes.io/docs/
This testbed integrates open-source components:
- Open5GS: GNU Affero General Public License v3.0
- UERANSIM: GNU General Public License v3.0
Please refer to individual component licenses for detailed terms.
- Repository Maintainer: rayhanegar
- Open5GS: Open5GS Project Team
- UERANSIM: aligungr and contributors
For issues and questions:
- Check the relevant README.md in component directories
- Review troubleshooting sections
- Consult official documentation
- Open an issue in this repository
Status: β Active Development | π§ͺ Testbed Environment | π Educational Use
Last Updated: February 13, 2026