OAI搭建完全手册
开源软件OAI搭建终于成功,主要参照官网操作手册,并不断解决出现的各种问题,现将安装配置过程和遇到的主要问题整理在此文档,以供参考学习。
1 代码解析
OAI开源代码分为两个部分:eNB模块openairinterface5g和核心网模块openair-cn,老版本代码的核心网部分包含EPC和HSS两个模块,新版本核心网包含MME、HSS、SPGW三个模块。推荐安装master branch,因为官网确保master是最稳定的版本,有其他开发兴趣的可以check develop branch。
2 系统环境
我们的核心网安装在ThinkStation 64位主机上,系统Ubuntu 14.04,内核版本4.7;eNB安装使用64位华硕主板,硬件要求corei5,i7,主频3.0GHz以上,USB3.0(射频前端要求),系统Ubuntu14.04.3 LTS,内核版本3.19。建议使用华硕主板,因为相关CPU frequency的配置较为容易。
官网链接:https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/OpenAirSystemRequirements
3 安装步骤
3.1 安装内核
eNB:
1. 安装Ubuntu 14.04.3系统
2. 在BIOS里关掉所有功耗管理性能(sleep states, in particular C-states,CPU frequencyscaling ):
- 在/etc/default/grub中添加intel_pstate=disable,也可以添加processor.max_cstate=1intel_idle.max_cstate=0 idle=poll(optional)
- 执行update-grub。
- 在/etc/modprobe.d/blacklist.conf最末添加blacklistintel_powerclamp,如果文件不存在,新建一个。
- 最后确认在BIOS 关闭hyperthreading,CPU frequency control, C-States, P-States 和其他功耗管理。
- 安装 cpufrequtils:
sudo apt-get install cpufrequtils
编辑以下文件(如不存在新建一个):
sudo vi /etc/default/cpufrequtils
添加下面这行到文件中:
GOVERNOR="performance"
保存退出
关闭ondemand daemon,防止重启后被改写.
sudo update-rc.d ondemand disable
3. 安装3.19lowlatency内核:
sudo apt-get install linux-image-3.19.0-61-lowlatency linux-headers-3.19.0-61-lowlatency
4. Reboot
Corenetwork:
1. 系统为Ubuntu14.04.5 LTS
2. 安装4.7.x版本内核,可选择官网pre-compile版本:
git clone https://gitlab.eurecom.fr/oai/linux-4.7.x.git
cd linux-4.7.x
sudo dpkg -i linux-headers-4.7.7-oaiepc_4.7.7-oaiepc-10.00.Custom_amd64.deb linux-image-4.7.7-oaiepc_4.7.7-oaiepc-10.00.Custom_amd64.deb
3. Reboot,从4.7.7-oaiepc内核启动
官网链接:https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/OpenAirKernelMainSetup
问题:
之前未重新安装4.7内核时,运行spgw会报错error inloading gtp kernel module;后从源码安装带有gtp module的4.7.x内核,登录不了图形界面,原因是xorg server不能成功运行,且spgw运行时报错相同。登录界面问题通过crtl+alt+F1进入命令行界面,安装gnome服务解决。Gtp module加载失败的问题未解决,怀疑系统和内核未很好的安装所致,故重新安装了oai的pre-compile的4.7.x内核,gtp问题解决。
3.2 下载代码
1. 安装git:
sudo apt-get update
sudo apt-get install subversion git
2. 添加许可证:
Sudo su
echo -n | openssl s_client -showcerts -connect gitlab.eurecom.fr:443 2>/dev/null | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' >> /etc/ssl/certs/ca-certificates.crt
3. 下载源码:
eNB:
git clone https://gitlab.eurecom.fr/oai/openairinterface5g.git
corenetwork:
git clone https://gitlab.eurecom.fr/oai/openair-cn.git
官网链接:https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/GetSources
3.3 安装mysql-server
理论上讲,按照3.4步骤执行./build_hss–i 时会自动安装mysql-server和phpmyadmin数据库管理软件,但是在实际安装时并没有自动弹出安装mysql-server,导致phpmyadmin也不能成功安