23 - OAI NSA gNB搭建 - 博一

OSA今日宣布实现OAI 5G NSA端到端通信

OAI first 5G data
“OpenAirInterface today sports a full end-to-end 5G stack connecting to commercial phones. The full open source NSA solution including the Core Network and gNB, the one and the only: OPENAIRINTERFACE”
2020.07.31

更新一下博客的搭建教程

OAI EPC核心网搭建:https://blog.csdn.net/BUPTOctopus/article/details/81560514
OAI eNB搭建:
https://blog.csdn.net/BUPTOctopus/article/details/81561607
OAI gNB搭建:本文

1、搭建gNB

和eNB没啥区别,我直接贴过来之前的博客了:
环境要求:Ubuntu 16.04 LTS / CentOS 7
本文以Ubuntu 16.04.3 LTS 为例,硬件环境为core i7 6500U,16GB DDR3@1600,USRP N310

  • 1.1 安装git
sudo apt-get update
sudo apt-get install subversion git
  • 1.2 Add a certificate from gitlab.eurecom.fr to your Ubuntu
echo -n | openssl s_client -showcerts -connect gitlab.eurecom.fr:443 2>/dev/null | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' | sudo tee -a /etc/ssl/certs/ca-certificates.crt 
  • 1.3 Disable certificate check completely if you do not have root access to /etc/ssl directory
sudo git config --global http.sslverify false
  • 1.4 基本文件下载
sudo git clone https://gitlab.eurecom.fr/oai/openairinterface5g.git

2、 Build , Config and Run

  • 2.1 Build
cd ~/openairinterface5g
sudo git checkout develop  //develop-nr分支已经弃用,别切错了
source oaienv
cd cmake_targets

在国内的话注释掉两句:

sudo vim ~/openairinterface5g/cmake_targets/tools/build_helper

然后注释掉这两句

$SUDO rm -rf /opt/ssh
$SUDO git clone https://gist/github.com/2190472.git /opt/ssh
  • 如果需要手动装uhd驱动的话可以去http://files.ettus.com/binaries/uhd_stable/src/
  • 装完驱动如果usrp的images下载太慢的话可以直接用我传到百度云的,链接:https://pan.baidu.com/s/18iVdGWKyvPp21_7zvzIJxw 提取码:UHDI 放到/usr/share/uhd/images中,然后再运行build_oai

到编译这里跟eNB就一个--gNB选项的区别:
编译gNB:

sudo /build_oai -I --gNB  -x --install-system-files -w USRP

如果用noS1模式再加--noS1,更多选项-h

如果编译为5G UE:

sudo ./build_oai -c -C -I --install-optional-packages --install-system-files --nrUE -w USRP -V

3、配置运行gNB连接EPC

  • 3.1 配置文件
    目前已支持NSA,还未支持SA,以band78+N310为例:
sudo vim ~/openairinterface5g/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpn300.conf

3.1.1 在MME参数那里配置:
将YOUR_EPC_IP_ADDR配置为MME的地址
MCC MNC TAC那些跟核心网配置成一样的

	tracking_area_code  =  1;
    plmn_list = ({mcc = 208; mnc = 93; mnc_length = 2;});	 
    tr_s_preference     = "local_mac"
…………
// MME parameters:
    mme_ip_address = ( { ipv4 = "**YOUR_EPC_IP_ADDR**";
                         ipv6 = "192:168:30::17";
                         active     = "yes";
                         preference = "ipv4";
                         }
                      );

3.1.2 在X2接口参数那里配置:
四个eNB server的IP地址和gNB的网卡

///X2
    enable_x2 = "yes";
    t_reloc_prep      = 1000;      /* unit: millisecond */
    tx2_reloc_overall = 2000;      /* unit: millisecond */
    target_enb_x2_ip_address = ({ ipv4 = "**YOUR_ENB_IP_ADDR**";
                                  ipv6 = "192:168:30::17";
                                  preference = "ipv4";
                                 }
                               );
    NETWORK_INTERFACES :
    {
        GNB_INTERFACE_NAME_FOR_S1_MME = "eth0";
        GNB_IPV4_ADDRESS_FOR_S1_MME   = "**YOUR_ENB_IP_ADDR**";
        GNB_INTERFACE_NAME_FOR_S1U    = "eth0";
        GNB_IPV4_ADDRESS_FOR_S1U      = "**YOUR_ENB_IP_ADDR**";
        GNB_PORT_FOR_S1U              = 2152; # Spec 2152
        GNB_IPV4_ADDRESS_FOR_X2C      = "**YOUR_ENB_IP_ADDR**";
        GNB_PORT_FOR_X2C              = 36422; # Spec 36422
    };

3.1.3 在RU参数那里配置:
sdr_addrs的IP改为用来跟N310通信的IP,SFP0对应192.168.10.2,SFP1对应192.168.20.2

RUs = (
    {		  
       local_rf       = "yes"
         nb_tx          = 1
         nb_rx          = 1
         att_tx         = 0
         att_rx         = 0;
         bands          = [7];
         max_pdschReferenceSignalPower = -27;
         max_rxgain                    = 114;
         eNB_instances  = [0];
	 sdr_addrs = "addr=192.168.10.2,mgmt_addr=192.168.10.2";
         #clock_src = "external";
    }
); 

3.1.4 其他配置
一些配置看名字根据需要修改即可.
值得一提的是目前absoluteFrequencySSB由于RRC的问题,如果修改的话需要手动到RRC配置中一起修改:

    # absoluteFrequencySSB is the central frequency of SSB 
    absoluteFrequencySSB                                          = 641272; 
    dl_frequencyBand                                                 = 78;
    # the carrier frequency is assumed to be in the middle of the carrier, i.e. dl_absoluteFrequencyPointA_kHz + dl_carrierBandwidth*12*SCS_kHz/2
    dl_absoluteFrequencyPointA                                       = 640000;
    #scs-SpecificCarrierList
    dl_offstToCarrier                                              = 0;
    # subcarrierSpacing
    # 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120  
    dl_subcarrierSpacing                                           = 1;
    dl_carrierBandwidth                                            = 106;

需要openair2/RRC/LTE/rrc_eNB.c
找到MeasObj2->measObject.choice.measObjectNR_r15.carrierFreq_r15 =641272; 修改相应的参数,在这里是641272
(相信这个问题很快就会修复。)

  • 3.2 运行gNB
cd ~/openairinterface5g/cmake_targets/ran_build/build
sudo ./nr-softmodem -O ~/openairinterface5g/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpn300.conf | sudo tee nr_5g1.log
  • 3.3 运行5G UE
sudo ./nr-uesoftmodem --numerology  1 -r 106 -C 3510000000 --usrp-args "addr=192.168.20.2,clock_source=internal,time_source=internal"
©️2020 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页