1.环境
ubuntu18.04+低延迟内核
python3版本 3.6以上
sudo sysctl net.ipv4.conf.all.forwarding=1
sudo iptables-PFORWARD ACCEPT
如果终端不能上网有可能是docker不能上网,
iptables -t nat -L 查看nat转发规则
iptables -t nat -A POSTROUTING -s 192.168.70.128/26 -j MASQUERADE 增加转发规则
2.核心网
git clone https://gitlab.eurecom.fr/oai/cn5g/oai-cn5g-fed.git ~/oai-cn5g-fed
cd~/oai-cn5g-fed
git checkout master
拉取核心网容器、docker-compose文件、基站配置文件、oai-db使用oai-db2
3. OAI gNB
sudo apt install -y libboost-all-dev libusb-1.0-0-dev doxygen python3-docutils python3-mako python3-numpy python3-requests python3-ruamel.yaml python3-setuptools cmake build-essential
git clone https://github.com/EttusResearch/uhd.git ~/uhd
cd ~/uhd
git checkout v4.0.0.0
cd host
mkdir build
cd build
cmake ../
make -j 4
make test# This step is optional
sudo make install
sudo ldconfig
sudo uhd_images_downloader
# Get openairinterface5g source code
git clone https://gitlab.eurecom.fr/oai/openairinterface5g.git ~/openairinterface5gcd~/openairinterface5g
git checkout develop # Install dependencies in Ubuntu 20.04
cd~/openairinterface5g
source oaienv
cd cmake_targets
./build_oai -I # Build OAI gNB
cd~/openairinterface5g
source oaienv
cd cmake_targets
./build_oai -w USRP --nrUE --gNB --build-lib all -c
4. Run OAI CN5G and OAI gNB with USRP B210
cd~/oai-cn5g-fed/docker-composepython3 core-network.py--typestart-basic--fqdnyes--scenario1
cd~/openairinterface5gsource oaienvcd cmake_targets/ran_build/buildsudo./nr-softmodem-O../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf--sa-E--continuous-tx
5. Testing with Quectel RM500Q
WithPuTTY, send the following AT commands to the module using a serial interface (ex: COM2) at 115200 bps:
# MUST be sent at least once everytime there is a firmware upgrade!AT+QMBNCFG="Select","ROW_Commercial"AT+QMBNCFG="AutoSel",0AT+CFUN=1,1AT+CGDCONT=1AT+CGDCONT=2AT+CGDCONT=3AT+CGDCONT=1,"IP","oai"# Activate PDP context, retrieve IP address and test with pingAT+CGACT=1,1AT+CGPADDR=1AT+QPING=1,"openairinterface.org"
UE host
ping 192.168.70.135-n1000-S12.1.1.2
CN5G host
dockerexec-itoai-ext-dn ping 12.1.1.2
UE host
Download iPerf for Microsoft Windows fromhere.
Extract to Desktop and run with Command Prompt:
cd C:\Users\User\Desktop\iPerf\iperf-2.0.9-win64\iperf-2.0.9-win64
iperf -s -u -i 1 -p 5002 -B 12.1.1.2
CN5G host
docker exec-it oai-ext-dn iperf -u -t 86400 -i 1 -fk -B 192.168.70.135 -p 5002 -b 125M -c 12.1.1.2