Getting Started
⚠️ Important Legal Warning - Read First!
Before using SDR equipment for radio transmission, you must understand the relevant laws and regulations. According to China's Public Security Administration Punishments Law (effective January 1, 2026) Article 32:
Setting up base stations or using radio frequencies without approval may result in 5-15 days administrative detention!
Please use an RF shielded box or cable connection for experiments. For details, read RF Regulations & Compliance.
This guide will help you quickly set up a complete 5G NR private network lab environment.
System Architecture
┌──────────────┐ ┌──────────────┐ ┌──────────────┐
│ UE │────▶│ gNB │────▶│ 5G Core │
│ (Phone/srsUE)│ Air │ (srsRAN) │ N2/N3│ (Open5GS) │
└──────────────┘ └──────────────┘ └──────────────┘
│
┌─────┴─────┐
│ SDR │
│ (USRP) │
└───────────┘Prerequisites
Before you begin, ensure you have the following:
Hardware Requirements
| Device | Recommended | Notes |
|---|---|---|
| Server/PC | Ubuntu 22.04, 16GB+ RAM | Run core network and gNB |
| SDR | USRP B210 / BladeRF x40 | RF frontend |
| Antenna | 700-2700MHz | Select based on band |
| SIM Card | Programmable SIM | sysmoUSIM-SJS1 recommended |
| Test UE | 5G SA capable phone | Or use srsUE |
Software Requirements
- Ubuntu 22.04 LTS (recommended)
- Open5GS v2.7+
- srsRAN Project 24.04+
- UHD driver (for USRP users)
Installation Overview
1. Install Open5GS Core Network
# Add Open5GS repository
sudo add-apt-repository ppa:open5gs/latest
sudo apt update
# Install Open5GS
sudo apt install open5gsFor detailed configuration, see Open5GS Installation Guide.
2. Install srsRAN gNB
# Install dependencies
sudo apt install cmake make gcc g++ pkg-config \
libfftw3-dev libmbedtls-dev libsctp-dev libyaml-cpp-dev \
libgtest-dev libzmq3-dev
# Clone and compile srsRAN
git clone https://github.com/srsran/srsRAN_Project.git
cd srsRAN_Project
mkdir build && cd build
cmake ..
make -j$(nproc)
sudo make installFor detailed configuration, see srsRAN Installation Guide.
3. Configure Subscriber
Add subscriber in Open5GS WebUI:
IMSI: 001010000000001
Key: 465B5CE8B199B49FAA5F0A2EE238A6BC
OPc: E8ED289DEBA952E4283B54E88E6183CA4. Start Services
# Start Open5GS services
sudo systemctl start open5gs-amfd
sudo systemctl start open5gs-smfd
sudo systemctl start open5gs-upfd
# ... other services
# Start gNB
sudo gnb -c gnb.yamlVerify Connection
After successful startup, you should see gNB connection info in AMF logs:
[amf] INFO: gNB-N2 accepted[192.168.1.100]:38412 in ng-path module (../src/amf/ngap-sctp.c:113)
[amf] INFO: gNB-N2 accepted[192.168.1.100] in master_sm module (../src/amf/amf-sm.c:754)Next Steps
- Prerequisites - Detailed system configuration
- Open5GS Configuration - Core network parameters
- gNB Configuration - Base station configuration
⚠️ RF Compliance Reminder
Before conducting over-the-air experiments, you must ensure:
- ✅ Have read RF Regulations & Compliance
- ✅ Using RF shielded box or cable connection + attenuator
- ✅ Transmission power set to minimum usable value
- ✅ No interference to public wireless networks
Consequences of violations: Under 2026 regulations, illegal base stations may result in 5-15 days detention!