Skip to content

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

DeviceRecommendedNotes
Server/PCUbuntu 22.04, 16GB+ RAMRun core network and gNB
SDRUSRP B210 / BladeRF x40RF frontend
Antenna700-2700MHzSelect based on band
SIM CardProgrammable SIMsysmoUSIM-SJS1 recommended
Test UE5G SA capable phoneOr 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

bash
# Add Open5GS repository
sudo add-apt-repository ppa:open5gs/latest
sudo apt update

# Install Open5GS
sudo apt install open5gs

For detailed configuration, see Open5GS Installation Guide.

2. Install srsRAN gNB

bash
# 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 install

For detailed configuration, see srsRAN Installation Guide.

3. Configure Subscriber

Add subscriber in Open5GS WebUI:

yaml
IMSI: 001010000000001
Key: 465B5CE8B199B49FAA5F0A2EE238A6BC
OPc: E8ED289DEBA952E4283B54E88E6183CA

4. Start Services

bash
# 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.yaml

Verify 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

⚠️ RF Compliance Reminder

Before conducting over-the-air experiments, you must ensure:

  1. ✅ Have read RF Regulations & Compliance
  2. ✅ Using RF shielded box or cable connection + attenuator
  3. ✅ Transmission power set to minimum usable value
  4. ✅ No interference to public wireless networks

Consequences of violations: Under 2026 regulations, illegal base stations may result in 5-15 days detention!

Released under the MIT License.