Ubuntu 17.04 安装 OpenAirInterface (OAI)教程

  国外有一个大神写了一个基于Ubuntu 17.04安装OAI eNB,UE和EPC一整套系统的教程。原文链接https://open-cells.com/index.php/2017/06/07/openair-single-machine-ubuntu-17-04-after-major-epc-update/ 。笔者亲测有效,整套系统可以在 5M 带宽下成功运行。原文有一个小地方有问题,笔者对此略微做了修改,现把教程复制到下文,权当分享。方便无法翻墙的同学学习。

  干货,绝对不坑。

  如果在安装依赖库过程中出现如下错误

cloning to '/opt/ssh'...
fatal:unable to access'https://gist.github.com/2190472.git/' : Failed to connect to gist.github.comport 443: Connection timed out

  则用vim打开 build_helper文件,即 vim tools/build_helper  注释下面两行代码

$SUDO rm -fr /opt/ssh
$SUDO git clonehttps://gist.github.com/2190472.git /opt/ssh

OpenAir, single machine Ubuntu 17.04, after major EPC update

(updated: 2017, June 7th)

This document explains how to install and configure OAI EPC+eNB on one single Ubuntu 17.04 64 bits machine connected with a regular UE (a Huawei E3272), routing the UE traffic to internet.

We use EPC after a major contribution in May 2017: a lot of code has been modified, all directories names were changes, configuration parameters names/values changed.

The description uses a USRP B210 board, a Lime SDR page is provided separately.

We also explain how to simplify, fix existing issues, to make a single computer as a full LTE network: EPC+eNB.

Known limitations fixed in the hereafter description

  • OAI EPC require kernel >= 4.7, so we have to use Ubuntu 17.04

    • We already pushed some enhancements in OAI, nevertheless some more are required
  • GTP UDP ports are in conflict for eNB and SGW
  • Useless link between OAI and the Ubuntu/Linux hostname removed
  • Several simplifications and precisions to make easier and reliable installations

Install Ubuntu

  • Prepare a machine: a 4 actual cores, no hyper-threading.
    All other configuration in OAI Wiki (C1 states, …) describes is about useless.
  • Download Ubuntu 17.04 64 bits version iso file
  • create a usb key to boot on it
  • install Ubuntu: choose to install Third party SW, and to upgrade all packages while installing
  • do: apt update; apt upgrade until the machine is up-to-date
  • install git and configure your identification in git:
    sudo apt install git 
    git config –global user.name “Laurent”
    git config –global user.email “laurent.thomas@open-cells.com”
  • Add the OAI repository as authorized remote system
    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
  • if you are upset with sudo password, add this line in /etc/sudoers
    • xxxxxx ALL=(ALL) NOPASSWD: ALL (xxxxxx is your login name)
    • sudo will not ask anymore for a password

Install USRP drivers

Ettus has not yet released their driver for Ubuntu 17.04, we take it from source:

  • sudo apt-get install libboost-all-dev libusb-1.0-0-dev python-mako doxygen python-docutils python-requests cmake build-essential
  • git clone git://github.com/EttusResearch/uhd.git
  • cd uhd; mkdir host/build; cd host/build
  • cmake -DCMAKE_INSTALL_PREFIX=/usr ..
  • make -j4
  • sudo make install
  • sudo ldconfig
  • sudo /usr/lib/uhd/utils/uhd_images_downloader.py

Download our modifications

download: patches

extract the data: tar xf opencells-mods.tgz

Download & Compile the eNB on 17.04

  • git clone https://gitlab.eurecom.fr/oai/openairinterface5g.git
  • cd openairinterface5g
  • git checkout develop
  • We tested with commit 7580d021d387cc63fcf6ecbb97a87b816676a06f  Tue Jun 6 17:59:32 2017 +0200
  • As we already tested and merged in develop updates for Ubuntu 17.04
  • A few more updates are required for Ubuntu 17.04
    replace the file cmake_targets/tools/build_helper by the file in our archive:

    • cp opencells-mods/cmake_targets/tools/build_helper cmake_targets/tools/build_helper
  • Now, you should be able to build as usual the eNB
    • source oaienv                                    # configure the shell
    • ./cmake_targets/build_oai -I       # install SW packages from internet
    • ./cmake_targets/build_oai  -w USRP –eNB –UE # compile eNB

Download and patch EPC

First, clone OAI EPC:

  • git clone https://gitlab.eurecom.fr/oai/openair-cn.git
  • cd openair-cn
  • git checkout develop

(we used: commit 67180ca07c3f543fb6efde13bfdd88ec153185c7 Date: Tue May 30 10:16:31 2017 +0200)

Add Ubuntu 17.04 for compilation and fix some bugs

  • cp opencells-mods/build/tools/build_helper  build/tools/build_helper
  • 备注:原文上一条命令有误,笔者按照作者意图进行了修改
  • patch -i opencells-mods/src/common/common_defs.h.patch src/common/common_defs.h
  • patch -i opencells-mods/src/oai_mme/oai_mme.c.patch src/oai_mme/oai_mme.c
  • patch -i opencells-mods/src/oai_hss/utils/hss_config.c.patch src/oai_hss/utils/hss_config.c

Remove link between Linux host name and LTE diameter protocol configuration

  • patch -i opencells-mods/src/s6a/s6a_peer.c.patch src/s6a/s6a_peer.c

Add usage of the input address for the SGW input socket

  • patch -i opencells-mods/src/gtpv1-u/gtp_mod_kernel.c.patch src/gtpv1-u/gtp_mod_kernel.c
  • patch -i opencells-mods/src/gtpv1-u/gtp_mod_kernel.h.patch src/gtpv1-u/gtp_mod_kernel.h
  • patch -i opencells-mods/src/gtpv1-u/gtpv1u_task.c.patch src/gtpv1-u/gtpv1u_task.c

No kernel module patch is required anymore: generic Ubuntu kernel 17.04 works fine with OAI

Install third party SW for EPC

  • cd openair-cn; source oaienv; cd scripts
  • ./build_hss -i
    • Do you want to install freeDiameter 1.2.0 ?: yes
    • set your MySQL password and remember it!
    • Answer yes to install: freeDiameter 1.2.0
    • phpmyadmin:
      • choose light or apache as you prefer
      • Configure database for phpmyadmin with dbconfig-common: yes
      • password: same as MySQL for simplicity
      • We don’t use phpmyadmin later in this procedure, nevertheless we tested successfully also with it
  • Install 3PP SW for mme and spgw
  • ./build_mme -i
    • Do you want to install freeDiameter 1.2.0: no
    • Do you want to install asn1c rev 1516 patched? <y/N>: no
    • Do you want to install libgtpnl ? <y/N>: yes
    • wireshark permissions: as you prefer
  • ./build_spgw -i
    • Do you want to install libgtpnl ? <y/N>: no

Compile the EPC nodes

No difficulty found in this phase.

  • cd openair-cn; source oaienv; cd scripts
  • ./build_hss
  • ./build_mme
  • ./build_spgw

Our Network setup description

I’ve made a simple configuration for this all-in-one setup.

Each node is on a separate IP address, this address is used for all it’s interfaces. In our case of all-in-one, we take addresses on the loopback: this will be fine on all your machines.

  • HSS is on localhost: 127.0.0.1
  • eNB is on 127.0.0.10
  • MME is on 127.0.0.20
  • SPGW is on 127.0.0.30

The LTE diameter configuration is now isolated from Linux hostname.

realm for our EPC: “OpenAir5G.Alliance”, so, full distinguish names (FQDN) are: hss.OpenAir5G.Alliance, mme.OpenAir5G.Alliance

Install this configuration for eNB

In your eNB configuration file, the network is now fixed, as lo interface always exists and our computer internal addresses also:

// 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};

In the eNB config file, you need also to set the MCC and MNC as per your SIM card:

tracking_area_code = “1”;
mobile_country_code = “208”;
mobile_network_code = “92”;

And obviously, your radio parameters.

Wwe tested with USRP B210 and two parameter files: 10MHz band, 20MHz band, Huawei E3272 UE, a cavity duplexer a simple antenna, about 1 meter distance UE/eNB antenna.

  • openairinterface5g/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210.conf
  • openairinterface5g/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpb210.conf

Install this configuration for EPC

For the EPC, we install in OAI default directory: /usr/local/etc/oai

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

Then, you should generate the cyphering certificates:

  • 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

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";

For the SIM card, you’ll have more to do:

  • SIM MCC/MNC should be duplicated

    • eNB: See above in eNB configuration chapter
    • 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
      • Configure the password for MySQL

        • in /usr/local/etc/oai/hss.conf, set password as the password you created during MySQL installation
      • A HSS database in text is in: opencells-mods/opencells_db.sql
        • It is pre-configured with the mme id
        • A SIM user in network 001/01 (the test network defined by 3GGP) is already created.
        • 10 users is network 208/92 (a French test network) are also created
        • Each time you import this db, it erases the entire database
          (example: you set mysql password to “linux”)

          • ./hss_db_import 127.0.0.1 root linux oai_db opencells-mods/opencells_db.sql
        • We use to modify the db by updating this file with regular text editor,
          then we re-load the entire database,
          but, if you prefer, usage of http://localhost/phpmyadmin is fine
        • The important values to set are:
          • table pdn:

            • all IMSI are listed, with the APN: these values are in UE/USIM
          • table users:
            • all IMSI, key (Ki) and OPc must be the same in USIM card
            • Sqn increments automatically  when the UE authenticate in both USIM and HSS DB: it should be set as per USIM internal incrementation
      • SIM card update
        • Open cells UICC and card reader will  be supported

Final test and verification

open 4 terminal windows

  1. in first window

    • cd openair-cn; source oaienv; cd SCRIPTS; ./run_hss
  2. in second window
    • cd openair-cn; source oaienv; cd SCRIPTS; ./run_mme
  3. in third window
    • cd openair-cn; source oaienv; cd SCRIPTS; sudo -E ./run_spgw
  4. in last windows
    • sudo bash
    • cd openairinterface5g; source oaienv
    • ./cmake_targets/lte_build_oai/build/lte-softmodem -d -O <your config file>
  5. Connect the UE, it should attach to network and be able to reach internet through OAI network

We re-built this procedure from scratch and tested two machines: i5-4570 and i5-6600K.

On the i5-4570, at maximum traffic, the eNB is stable on 10MHz band at full user data speed.

On the i5-6600K, we obtain stable performance at maximum traffic over 20MHz, transmission mode 1 (SISO), one single UE over-the-air 1 meter distance:

Ubuntu 17.04 安装 OpenAirInterface (OAI)教程相关推荐

  1. linux安装搜狗中文,Ubuntu 17.04 安装搜狗中文输入法

    写在前面 最近开始用Ubuntu系统,开始机器学习的相关学习,经过几天的折腾,终于在Ubuntu 17.04装上了搜狗输入法. 安装中文输入法 Ubuntu17.04中支持IBUS,fcitx等输入法 ...

  2. ubuntu 18.04 安装ROS melodic教程。

    1.首先,我这个ubuntu 18.04是刚刚安装好的,所以我们先换源. sudo nano /etc/apt/sources.list 然后将里面的内容清空,把下面的内容复制进去保存退出. ##中科 ...

  3. Ubuntu 16.04 安装anaconda3详细教程(从下载源到测试成功)

    首先下载anaconda3镜像,清华大学开源软件镜像站下载地址: https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/ 查看你的Linux系统是 ...

  4. Ubuntu 20.04 安装微信详细教程

    参考链接:https://blog.csdn.net/u010381752/article/details/114012432 1. 下载deepin-wine 在根目录下新建deepintemp文件 ...

  5. Ubuntu 18.04 安装RealSense D435教程

    1.更新内核 运行代码 uname -r 如果>=4.4.0-50的版本则ok,否则需要升级内核. 2.更新cmake(需要3.6以上版本)(需要科学上网) 首先下载cmake-3.13.2.t ...

  6. Ubuntu 17.04 编译安装 Nginx 1.9.9 配置 https 免费证书

    Ubuntu 17.04 编译安装 Nginx 1.9.9 配置 https 免费证书 安装 Nginx 安装依赖 $ apt-get update $ apt-get install build-e ...

  7. Ubuntu 16.04安装教程及虚拟机设置

    摘自:Ubuntu 16.04安装教程及设置 作者:一只青木呀 发布时间: 2020-07-09 22:36:50 网址:https://blog.csdn.net/weixin_45309916/a ...

  8. ROS_Kinetic_01 在 Ubuntu 16.04 安装ROS Kinetic 全教程附资料和镜像 2018.10.20更新

    Exbot易科机器人实验室新站点(测试中):http://server.blackant.org:23452/ 2018 ROS Melodic的迷失与救赎::https://blog.csdn.ne ...

  9. Ubuntu 17.04中安装 WPS Office 2016 for Linux

    http://dev.go2live.cn/linux/ubuntu-17-04%e4%b8%ad%e5%ae%89%e8%a3%85-wps-office-2016-for-linux-%e6%bc ...

最新文章

  1. 四位先行进位电路逻辑表达式_计算机硬件基础:二进制半加器、全加器与加法电路...
  2. php 数组与数组之间去重,PHP开发中一维数组与二维数组去重功能实现教程
  3. 网络抖动多少ms算正常_子宫内膜厚度多少算正常?
  4. Ubuntu中设置静态IP和DNS
  5. UNIX:描述符和文件结构
  6. [tensorflow、神经网络] - 使用tf和mnist训练一个识别手写数字模型,并测试
  7. Docker 配置,详细说明 daemon.json 的作用
  8. c语言 文件加密头文件,[C语言]文件加密
  9. Kotlin入门(7)循环语句的操作
  10. 如何正确处理HTTP 404错误页面
  11. 计算机VB中清除按钮,计算机vb程序设计时计算器清除的代码怎么写
  12. PS小技巧 证件照蓝底/红底换白底(非抠图,抠图头发边缘处理效果差)
  13. 使用C# .net开发微信公众号之设置所属行业
  14. 【论文笔记_目标检测_2022】Cross Domain Object Detection by Target-Perceived Dual Branch Distillation
  15. Django企业开发实战--by胡阳,学习记录1015
  16. torch.Tensor.requires_grad属性的使用说明
  17. php 编码转换 乱码解决
  18. UVAlive 4394
  19. Symbian程序安装不成功的解决方法
  20. 基于Android的股票交易软件,基于android的股票交易系统的融资融券交易子系统的设计与实现-软件工程专业论文.docx...

热门文章

  1. 违章查询接口免费php,基于聚合数据的全国违章直连查询接口示例-PHP版
  2. Android 分享图片到WhatsApp,Messenger,Facebook
  3. NodeJS 与第三方模块 mysql(基本操作)
  4. 以下不属于java基本数据类型的是_【单选题】在 Java 中,以下()不属于 Java 基本数据类型。 A. int B. boolean C. String D. double...
  5. 《自动控制原理与设计(第5版)》读书笔记
  6. 个人不建议TIM更新至 3.1.1版本,3.0.0安装包放文章里面了,需要的自取。
  7. ICLR 2022 Spotlight | MSU联合MIT-IBM提出首个黑箱防御框架
  8. 习而学的软件工程教育 之 思考
  9. 【转载】python导入文件和模块
  10. python花钱培训值吗-参加Python培训收费是多少?老男孩Python培训