OpenAirInterface是由法国 EURECOM 发起的、基于 3GPP 标准协议栈的软件无线电 SDR 平台。
Gitlab下载地址
从 EURECOM 维护的 GitLab 上下载:
https://gitlab.eurecom.fr/oai/openairinterface5g.git
本篇博客基于tag 2022-w13版本。
编译
下载完成后 OAI 的编译可以在 cmake_targets 文件夹中通过 build_oai 工具进行,build_oai 为执行脚本,可以用以下命令查看编译选项:
bash
./build_oai -h
#########
The -I option is to install pre-requisites, you only need it the first time you build the softmodem or when some oai dependencies have changed.
The -w option is to select the radio head support you want to include in your build. Radio head support is provided via a shared library, which is called the "oai device" The build script creates a soft link from liboai_device.so to the true device which will be used at run-time (here the USRP one, liboai_usrpdevif.so). The RF simulatorRF simulator is implemented as a specific device replacing RF hardware, it can be specifically built using -w SIMU option, but is also built during any softmodem build.
--eNB is to build the lte-softmodem executable and all required shared libraries
--gNB is to build the nr-softmodem and nr-cuup executables and all required shared libraries
--UE is to build the lte-uesoftmodem executable and all required shared libraries
--nrUE is to build the nr-uesoftmodem executable and all required shared libraries
--ninja is to use the ninja build tool, which speeds up compilation.
-c is to clean the workspace and force a complete rebuild.
- 编译安装依赖项
项目首次需要用 -I 命令编译安装依赖项,之后环境未改变的话只需要进行一次。部分库需要从网上下载。因为本机靠代理上网,需先在命令行配置下代理,若直接上网则不需要:
bash
export http_proxy=代理地址端口
export https_proxy=代理地址端口
安装依赖项:
bash
sudo -E ./build_oai -I
- 编译UEs,eNodeB 和 gNodeB可执行文件
这里先选择使用 -w SIMU,即使用RF simulator,不需要实体的射频硬件例如 USRP :
bash
./build_oai -w SIMU --eNB --UE --nrUE --gNB
编译完成后可执行文件在 targets/bin 下面。
- 编译其他工具
OAI还提供软件scope图形工具等其他辅助工具,可以使用下面命令一起编译:
bash
./build_oai --build-lib all
若要开启scope图形功能,之前步骤2需要添加选项 -x:
bash
./build_oai -w SIMU --eNB --UE --nrUE --gNB -x
RFSIM模拟示例
使用 RF simulator 不需要实体的射频器件,说明参考https://gitlab.eurecom.fr/oai/openairinterface5g/-/blob/develop/radio/rfsimulator/README.md
| 参数 | 说明 |
|---|---|
-O |
基站侧小区配置文件,样例在targets/PROJECTS下 |
--rfsim |
开启射频仿真时,追加参数 --rfsim |
--rfsimulator.serveraddr |
server为服务器模式,作为客户端用,配服务器ip地址,默认模式为客户端模式,地址127.0.0.1(本机) |
--phy-test |
无随机接入,会在本地生成两个文件 reconfig.raw, rbconfig.raw, 为rrc的配置信息 |
-d |
开启软件示波器功能 |
示例:
bash
# gNB 侧主机使用
sudo ./targets/bin/nr-softmodem.Rel15 -O ./targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpb210.conf --rfsim --rfsimulator.serveraddr server --phy-test -d
# nrUE 侧主机使用,假如 gNB 主机ip地址为192.168.0.1
# reconfig.raw, rbconfig.raw 两个文件需要拷贝到nrUE 侧主机运行路径下
sudo ./target/bin/nr-uesoftmodem.Rel15 --rfsim --rfsimulator.serveraddr 192.168.0.1 --phy-test -d