欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

All in one OpenAirInterface

程序员文章站 2022-04-27 23:34:44
...

本文几乎照搬 all in one openairinterface

安装环境

Name Version
Ubuntu 18.04.4(all packages upgraded)
UHD 3.15.0.HEAD-0-gaea0e2de
openair-cn commit 724542d0b59797b010af8c5df15af7f669c1e838
openairinterface commit edb74831dabf79686eb5a92fbf8fc06e6b267d35

准备工作

1. Add the OAI repository as authorized remote system

添加OAI库作为授权的远端系统

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

2. Install USRP drivers

参考链接–安装USRP驱动(UHD)

3. Download author’s modifications

下载原作者Laurent的补丁

cd ~
wget https://open-cells.com/opencells-mods-20190923.tgz
tar xf opencells-mods-20190923.tgz

4. Download and patch EPC

# maybe go back to home directory (leave openairinterface5g directory)
git clone https://gitlab.eurecom.fr/oai/openair-cn.git
cd openair-cn
git checkout develop

当时的develop分支commit:724542d0b59797b010af8c5df15af7f669c1e838

克隆上面代码现在需要帐号了,如果你没用的话,可以考虑下载作者上传的压缩包
openair-cn

tar xf openair-cn.tgz
cd openair-cn
git checkout develop

Apply the patch(打上作者提供的补丁):

git apply ~/opencells-mods/EPC.patch

Install third party SW for EPC

安装第三方依赖

HSS

cd openair-cn 
source oaienv
cd scripts
./build_hss -i
  • Answer yes to install: freeDiameter 1.2.0
  • phpmyadmin:
    • We don’t use phpmyadmin later in this procedure to update the MySQL database
    • We removed the installation of phpmyadmin (of course you can use it if you prefer)

For ubuntu 18.04, we set back the legacy mysql security level

# 如果你有密码就用下面注释掉的那一句
sudo mysql -u root << END
#sudo mysql -u root -pYOURPASSWORD << END
USE mysql;
UPDATE user SET plugin='mysql_native_password' WHERE User='root';
FLUSH PRIVILEGES;
END

sudo systemctl restart mysql.service

sudo mysql_secure_installation

The last command will ask a few questions:

  • password: set your password (linux is set in our default config files)
  • VALIDATE PASSWORD PLUGIN: no
  • Remove anonymous users: yes
  • Disallow root login remotely: yes
  • Remove test database and access to it: yes
  • Reload privilege tables now: yes

MME

./build_mme -i
  • Do you want to install freeDiameter 1.2.0: no
  • Do you want to install asn1c rev 1516 patched? <y/N>: yes
  • Do you want to install libgtpnl ? <y/N>: yes
  • wireshark permissions: as you prefer

SPGW

./build_spgw -i
  • Do you want to install libgtpnl? <y/N>: no

Complie the EPC nodes

cd openair-cn 
source oaienv
cd scripts

./build_hss
./build_mme
./build_spgw

如果你遇到任何编译的问题,日志文件在 openair-cn/build/log下,在这个文件里找
error:的字符串

我在编译mme时遇到了如下图所示的问题,提示的是找不到freeDiameter动态库。
All in one OpenAirInterface

解决办法是从源码安装freeDiameter,不用脚本安装。

GIT_SSL_NO_VERIFY=true git clone https://gitlab.eurecom.fr/oai/freediameter.git -b eurecom-1.2.0
cd freediameter
git apply ~/opencells-mods/freediameter1.2.0.postOAI.patch
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr/local ../
make -j4
sudo make install

Download & Complie the eNB on 18.04

git clone https://gitlab.eurecom.fr/oai/openairinterface5g.git
cd openairinterface5g
git checkout edb74831da
source oaienv  
./cmake_targets/build_oai -I  # install SW packages from internet
./cmake_targets/build_oai -w USRP --eNB --UE # compile eNB and UE

Install author’s configuration for EPC

sudo mkdir -p /usr/local/etc/oai
sudo cp -rp ~/opencells-mods/config_epc/* /usr/local/etc/oai

cd openair-cn; source oaienv; cd scripts
./check_hss_s6a_certificate /usr/local/etc/oai/freeDiameter hss.OpenAir5G.Alliance
./check_mme_s6a_certificate /usr/local/etc/oai/freeDiameter mme.OpenAir5G.Alliance
  1. spgw.conf
    Only the SGi output to internet need to be configured.
    In /usr/local/etc/oai/spgw.conf,
    your should set the Ethernet interface that is connected to Internet, and,
    to tell to the PGW to implement NAPT for the UE traffic

    PGW_INTERFACE_NAME_FOR_SGI = "enp3s0";
    PGW_MASQUERADE_SGI = "yes";
    
  2. SIM MCC/MNC should be duplicated in a couple of file

    • eNB
       ////////// MME parameters:
      mme_ip_address = ( { ipv4 = "127.0.0.20";
      ipv6 = "192:168:30::17";
      active = "yes";
      preference = "ipv4";
      }
      );
      
       NETWORK_INTERFACES :
      {
      ENB_INTERFACE_NAME_FOR_S1_MME = "lo";
      ENB_IPV4_ADDRESS_FOR_S1_MME = "127.0.0.10/8";
      
      ENB_INTERFACE_NAME_FOR_S1U = "lo";
      ENB_IPV4_ADDRESS_FOR_S1U = "127.0.0.10/8";
      ENB_PORT_FOR_S1U = 2152; # Spec 2152
      };
      
    • MME file: /usr/local/etc/oai/mme.conf to update
      GUMMEI_LIST = ( MCC="208" ; MNC="92"; MME_GID="4" ; MME_CODE="1"; } );
      TAI_LIST = ({MCC="208" ; MNC="92"; TAC = "1"; } );
      
    • HSS file: /usr/local/etc/oai/hss.conf to update
      设置mysql的账号和密码以及数据库的名字,然后用phpmyadmin网页修改。

Final test and verification

打开四个终端窗口

In each window

cd openair-cn; source oaienv; cd scripts; ./run_hss
cd openair-cn; source oaienv; cd scripts; ./run_mme
cd openair-cn; source oaienv; cd scripts; sudo -E ./run_spgw
sudo bash
cd ~/openairinterface5g; source oaienv
cd cmake_targets/lte_build_oai/build
./lte-softmodem -O ~/opencells-mods/enb.10MHz.b200

目前手机可以连上,但是一是没有网络连接,二是mme运行会突然中断,应该是配置文件的
问题,后面继续调试。

相关标签: linux sdr