OAI rfsimulator第一课

Laurent mail:definition and function of rfsimulator
The rfsimulator replaces the RF board at digital baseband level.

So it is another ‘rf board driver’ for OAI, the RF board is virtual.

OpenAir eNB, UE is not modified, it simply interface to another RF board driver (AI supports several RF boards).
It doesn’t simulate the board, which is assumed as perfect, nevertheless it simulates the propagation channel (if you need a not perfect RF board, you can add the imperfections in your channel model).

A documentation to read: targets/ARCH/rfsimulator/README.md to understand better what it does.

What is the rfsimulator channel simulation:

signal decay
phase rotation
gaussian noise addition
delay spread (several models)
multi-UE, multi-eNB (add interferences)
MIMO: mix several antennas (simple model only)
soon: transmission delay (to test timing advance)

A lot of rfsimulator features have not been tested or used by several people: most of users use it only to perform upper layers tests (above low PHY layer), so they don’t need advanced channel model.

There is also a telnet server that allows you to modify the channel during a test session.

If you need to add signal processing between Tx and Rx, there is a function in targets/ARCH/rfsimulator/apply_channelmod.c that you can extend for everybody.
OAI rfsimulator:

rfsimulator的定义

The rf simulator is a oai device replacing the radio heads (for example the USRP device). It allows connecting the oai UE (LTE or 5G) and respectively the oai eNodeB or gNodeB through a network interface carrying the time-domain samples, getting rid of over the air unpredictable perturbations. This is the ideal tool to check signal processing algorithms and protocols implementation. The rf simulator has some preliminary support for channel modeling.

总结下来有以下作用:
取代USRP
克服空口的不确定性(协议验证)
检查信号处理算法和协议执行(算法验证)
支持多种信道模型(同时支持自定义信道模型)

文章rfsimulator博客针对rfsimulator也进行了介绍,大家可以参考,我这边主要利用rfsimulator搭建一套场强测量系统
系统

系统模型;
5G基站–USRP–OAI
场强测量系统架构图

详细实现:
COTS gNB—USRP n310—OAI IQ transform(USRP IQ to OAI IQ as usrp_sample.dat to rfsimulator.iqs)----OAI IQ store & replay—OAI nrUE read params—NR DL SCOPE display RSRP.
注:OAI IQ transform就是利用replay_node将USRP IQ转换成OAI IQ
注:OAI IQ store和replay在后面会解释
注:NR DL SCOPE UE是在OAI SCOPE的基础上增加RSRP信息的实时显示(未来也可以考虑增加经纬度信息)

预期完成内容;
系统架构设计
OAI IQ的存储
OAI IQ的回放

  • OAI IQ的回放与显示

USRP IQ的存储

  • USRP IQ转换成OAI IQ
  • 物理层RSRP测量程序的编写
  • RSRP的显示界面
  • 经纬度位置信息的显示界面

明确了研究和开发目标我们需要了解下rfsimulator的基本使用方法,下面进入正题

rfsimulator概述:

OAI rfsimulator可以取代RF board。支持两种模式:
phy-test:在每个调度机会上生成随机的上下行业务
noS1:说白了就是没有核心网,形成的IP业务是在gNB和nrUE之间的oaitun接口上传输,可以用ping和iperf进行检查。

definition:
“noS1” mode: the generated IP traffic is sent and received between gNB and UE IP tunnel interfaces (“oaitun”) by applications like ping and iperf

“phy-test” mode: random UL and DL traffic is generated at every scheduling opportunity

构建:

build的时候需要关注的问题很多,就不在一一列举,遇到相关的问题可以参考对应的博客。
官网build指南在这里
博客build指南指南
配置信息参考wps文档OAI gNB和nrUE搭建指南(后期补链接)
第一次编译需要参考的博客Laurent

./build_oai --nrUE --gNB

编译:

cd <path to oai sources>/openairinterface5g/cmake_targets/ran_build/build
make rfsimulator

使用rfsimulator:
在命令行添加–rfsim即可使用rfsimulator

实际运行结果(未保存IQ,关于IQ的测试将在下面进行)
gNB主机(s可理解为信噪比):

RFSIMULATOR=server ./nr-softmodem -O ../../../targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpn300.conf --rfsim --phy-test --parallel-config PARALLEL_SINGLE_THREAD -d --rfsimulator.options chanmod --rfsimulator.modelname AWGN -s 10

nrUE主机(s可理解为信噪比):

RFSIMULATOR=10.10.8.201 ./nr-uesoftmodem --rfsim --phy-test --rrc_config_path . -d  --rfsimulator.options chanmod --rfsimulator.modelname AWGN -s 10

运行结果:
在这里插入图片描述
旧的运行规则以及结果
命令行参数解释
详细可移步官网介绍:如何使用rfsimulator

如何用rfsimulator完成IQ数据的保存和回放:
IQ保存

--rfsimulator.options chanmod,saviq  
--rfsimulator.options chanmod
--rfsimulator.modelname AWGN

生成运行的OAI IQ文件:
gNB主机:

RFSIMULATOR=server ./nr-softmodem -O ../../../targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpn300.conf --rfsim --phy-test --parallel-config PARALLEL_SINGLE_THREAD -d --rfsimulator.options saviq 

nrUE主机:

RFSIMULATOR=10.10.8.201 ./nr-uesoftmodem --rfsim --phy-test --rrc_config_path . -d  --rfsimulator.options saviq 

生成的文件会保存在/tmp下,名字默认为rfsimulator.iqs
如果/tmp下没有找到对应文件,一般是因为权限问题(耽误了一周!!!)

注:可以同时启动信道模型和IQ数据的存储
gNB主机:

RFSIMULATOR=server ./nr-softmodem -O ../../../targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpn300.conf --rfsim --phy-test --parallel-config PARALLEL_SINGLE_THREAD -d --rfsimulator.options chanmod,saviq --rfsimulator.modelname AWGN -s 20

nrUE主机:

RFSIMULATOR=10.10.8.201 ./nr-uesoftmodem --rfsim --phy-test --rrc_config_path . -d  --rfsimulator.options chanmod,saviq --rfsimulator.modelname AWGN -s 20

如果是第一次使用rfsimulator请仔细阅读下面的解释:
在10.10.8.201启动gNB:

sudo RFSIMULATOR=server ./nr-softmodem -O ../../../targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpn300.conf --parallel-config PARALLEL_SINGLE_THREAD --rfsim --phy-test

启动gNB和nrUE
在10.10.8.215启动nrUE:

sudo RFSIMULATOR=<TARGET_GNB_INTERFACE_ADDRESS> ./nr-uesoftmodem --rfsim --phy-test --rrc_config_path .

注:
<TARGET_GNB_INTERFACE_ADDRESS> can be 127.0.0.1 if both gNB and nrUE executables run on the same host, OR the IP interface address of the remote host running the gNB executable, if the gNB and nrUE run on separate hosts
the --rrc_config_path parameter SHALL specify where the 2 RAW files are located (rbconfig.raw and reconfig.raw).

If you are running on the same machine and launched the 2 executables (nr-softmodem and nr-uesoftmodem) from the same directory, nothing has to be done.
If you launched the 2 executables from 2 different folders, just point to the location where you launched the nr-softmodem:

sudo RFSIMULATOR=<TARGET_GNB_INTERFACE_ADDRESS> ./nr-uesoftmodem --rfsim --phy-test --rrc_config_path /the/path/where/you/launched/nr-softmodem

If you are not running on the same machine or launched the 2 executables from 2 different folders, you need to COPY the 2 raw files(rbconfig.raw and reconfig.raw)

关于SCP的使用:

SCP入门
scp usera@machineA:/the/path/where/you/launched/nr-softmodem/r*config.raw userb@machineB:/the/path/where/you/will/launch/nr-uesoftmodem/
Obviously this operation SHALL be done before launching the nr-uesoftmodem executable.

关于noS1:

to enable the noS1 mode --noS1 and --nokrnmod 1 options should be added to the command line

关于softscope:

In the UE, you can add -d option to get the softscope.

解决softscope消失的问题

利用ping和iperf测试IP traffic

现在没有走空口
那么就需要USRP采集空口数据了
感觉这个测试测过是有问题的???

gNB主机作为server
nrUE主机作为server
iperf的使用方法

store and replay(存在很大的问题):

我们可以存储发射的IQ样本(OAI IQ是什么样的?很好奇?),只需要添加命令行

--rfsimulator.options saviq 

即可,一旦我们使用了该命令行,rfsimulator将会将IQ样本写入一个叫rfsimulator.iqs的文件,文件的格式按照说明是successive blocks of a header followed by the I/Q array。

samplesBlockHeader的定义在
openairinterface5g-develop\targets\ARCH\COMMON\common_lib.h

typedef struct {
  uint64_t magic;          // Magic value (see defines above)
  uint32_t size;           // 采样的数量Number of samples per antenna to follow this header
  uint32_t nbAnt;          // 天线的数量Total number of antennas following this header
  // Samples per antenna follow this header,
  // i.e. nbAnt = 2 => this header+samples_antenna_0+samples_antenna_1
  // data following this header in bytes is nbAnt*size*sizeof(sample_t)
  uint64_t timestamp;      // Timestamp value of first sample第一个采样的时间戳,为什么要设置采样时间戳
  uint32_t option_value;   // Option value
  uint32_t option_flag;    // Option flag
} samplesBlockHeader_t;

想要深入了解replay的工作原理可以参考
openairinterface5g-develop\targets\ARCH\rfsimulator\stored_node.c

如果需要回放这个IQ数据(将采集好的IQ回放便于实验室分析和后期处理),我们需要先compile

make replay_node

回放的意义是什么?我自己生成的OAI IQ如何分析呢?replay怎么用啊?需要有输出啊!
replay的结果如何看?如何能证明我正确的replay了呢?
进而利用replay_node和stored IQ作为IQ数据源(如何验证呢?)。
也可以利用replay_node将USRP IQ转换成OAI IQ(听起来很厉害,但是没有实现?)

信道仿真:

前面提到利用OAI rfsimulator支持多种信道模型,当然也可以自定义信道模型参数(未来考虑添加高铁信道模型)
利用OAI实现自定义信道模型实践

new_channel_desc_scm(bridge->tx_num_channels,
                     bridge->rx_num_channels,
                     <model name>,
                     bridge->sample_rate,
                     bridge->tx_bw,
                     0.0, // forgetting_factor
                     0,   // maybe used for TA
                     0);  // path_loss in dB

改变输入噪声(可以理解为信噪比):

RFSIMULATOR=server ./nr-softmodem -O ../../../targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpn300.conf --rfsim --phy-test --parallel-config PARALLEL_SINGLE_THREAD -d --rfsimulator.options chanmod --rfsimulator.modelname AWGN -s 20

-s X 其中X可以理解为SNR
-s 50
-s 20
-s 0
-s -20
-s -50

在D:\OAI\openairinterface5g-develop-20201118\openairinterface5g-develop\targets\ARCH\rfsimulator\simulator.c的解释

// create channel simulation model for this mode reception
// snr_dB is pure global, coming from configuration paramter "-s"
// Fixme: referenceSignalPower should come from the right place
// but the datamodel is inconsistant
// legacy: RC.ru[ru_id]->frame_parms.pdsch_config_common.referenceSignalPower
// (must not come from ru[]->frame_parms as it doesn't belong to ru !!!)
// Legacy sets it as:
// ptr->channel_model->path_loss_dB = -132.24 + snr_dB - RC.ru[0]->frame_parms->pdsch_config_common.referenceSignalPower;
// we use directly the paramter passed on the command line ("-s")
// the value channel_model->path_loss_dB seems only a storage place (new_channel_desc_scm() only copy the passed value)
// Legacy changes directlty the variable channel_model->path_loss_dB place to place
// while calling new_channel_desc_scm() with path losses = 0

实时控制和监控(暂时用不到):

RSRP测量

关于RSRP的测量主要与网络覆盖评估有关(和自己毕设关系紧密)
参考TS38.215 Physical layer measurements
3GPP资源查找和使用技巧
我自己对物理层测量指标的总结(有中文解释)

  • 2
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值