Tutorial
for Open Air Interface
Table of Contents
Introduction 0
Chapter 1 - Environment setup 1
Chapter 2 - Installation 2
Chapter 3 - EPC Installation 3
Chapter 4 - HSS Installation 4
Chapter 5 - ENB Installation 5
Chapter 6 - Configure OAI 6
Chapter 7 - Run OAI 7
Chapter 8 - Trouble shooting 8
Appendix A - Performance 9
2
Tutorial for Open Air Interface
Introduction
This tutorial is focusing on setup the OAI Core Network (OAI-CN: EPC+HSS) and OAI ENB
based on latest git version.
Introduction 3
Tutorial for Open Air Interface
Chapter 1 - Requirement
Hardware
At least 2 physical machines
At least 4 CPU cores running at least at 2.7GHz ( for ENB )
Intel Architecture
Huawei Dongle E3372 (E3276)
Blank USIM cards
Ettus USRP B210 and Antenna
Software
Ubuntu 14.04 ( 64-bit recommended )
ubuntu low-latency kernel > 3.19 or Preemptive_rt kernel > 3.19
ENB BIOS setting
For ENB only, it is not necessary to set on EPC machine. Remove all power management
features in the BIOS or GRUB
turned off C-States
Enhanced Intel Speedstep
ENB CPU Setting : Maximize CPU frequency
1. Install cpufrequtils sudo apt-get install cpufrequtils
2. Then edit the following file (if it doesn't exist, create it) sudo vim
/etc/default/cpufrequtils or sudo vim /etc/init.d/cpufrequtils
3. Add the following line into it GOVERNOR="performance"
4. Disable ondemand daemon, otherwise after you reboot the settings will be overwriten
sudo update-rc.d ondemand disable
5. You can check your settings with cpufreq-info It will show a block of information for
every core your processor has. Just check if all of them are in performance mode, and
at the maximum speed of your processor.
Chapter 1 - Environment setup 4
Tutorial for Open Air Interface
Wireshark setup (optional)
Wireshark is a useful tool to capture the packets for debugging. Go to Ubuntu Software
Center or use apt-get
sudo apt-get install wireshark
sudo groupadd wireshark
sudo usermod -a -G wireshark your_user_name
sudo chgrp wireshark /usr/bin/dumpcap
sudo chmod 777 /usr/bin/dumpcap
sudo setcap cap_net_raw,cap_net_admin=eip /usr/bin/dumpcap
sudo getcap /usr/bin/dumpcap
Chapter 1 - Environment setup 5
Tutorial for Open Air Interface
Chapter 2 - Installation
Get stable OAI
mkdir openair5G
cd openair5G
git clone https://gitlab.eurecom.fr/oai/openairinterface5g.git .
mkdir openair-cn
cd openair-cn
git clone https://gitlab.eurecom.fr/oai/openair-cn.git .
Chapter 2 - Installation 6
Tutorial for Open Air Interface
Chapter 3 - EPC Installation
EPC installation
Following section shows how to build EPC and HSS on same host. If you are using your
own MNC configuration, please check your MNC and MCC are listed in the
{openair_dir}/openair-cn/UTILS/mcc_mnc_itu.c. (See trouble shooting)
Environment (FQDN)
You need to configure the FQDN value in /etc/host for S6A Authentication by adding the
following entries EX. 127.0.1.1 EPC.HOSTNAME.realm EPC.HOSTNAME
Example
127.0.0.1 localhost
127.0.1.1 cran.oai.nmsl cran
In this case, our realm is “oai.nmsl “ and hostname is “cran”
Fixed bug in OAI
Notice: Although different version of OAI may modify the codes. Thus, the below line number
may be different.
Issue: MNC not matched: configuration for commercial UE
(Using Our own SIM)
You need to add mnc manually in the list : Edit /openair-cn/UTILS/mcc_mnc_itu.c
const mcc_mnc_list_t mcc_mnc_list[]={
{466,”68”} ###<- add this entry
…..
}
Issue : UE did not send “attach complete” message
Modify ./NAS/MME/EMM/SAP/emm_send.c:186:
Chapter 3 - EPC Installation 7
Tutorial for Open Air Interface
In emm_send_attach_accept() function, replace this line
emm_msg->epsattachresult = EPS_ATTACH_RESULT_EPS;
with
emm_msg->epsattachresult = EPS_ATTACH_RESULT_EPS_IMSI;
Build
Go to your OAI directory
1. Install Additional packages with old script
cd {openair_dir}/cmake_targets/
sudo ./build_oai -I --install-system-files --install-optional-packages
2. Install kernel module for
cd {openair_dir}/openair-cn/SCRIPTS
sudo ./build_epc -j
3. Install EPC
cd {openair_dir}/openair-cn/SCRIPTS
sudo ./build_epc -c -l
(Add -c while rebuilding)
Chapter 3 - EPC Installation 8
Tutorial for Open Air Interface
Chapter 4 - HSS Installation
Build
cd {openair_dir}/openair-cn/SCRIPTS
sudo ./build_hss -c -l
Set up phpmyadmin on Ubuntu
You can make shortcut under /var/www/html/ and link to phpmyadmin folder for
convenience. (/var/www/html may be different due to the different versions of Apache)
sudo ln -s /usr/share/phpmyadmin /var/www/html/
Chapter 4 - HSS Installation 9
Tutorial for Open Air Interface
Chapter 5 - ENB Installation
Build ENB
Before you build the ENB components, you have to turn off the power saving features and
maximize the CPU performance. (See Reqirement)
Build
cd {openair_dir}/cmake_targets/
sudo ./build_oai -I --install-system-files --install-optional-packages
Remove -x while build without GUI interface; -c for rebuilding
Chapter 5 - ENB Installation 10
Tutorial for Open Air Interface
Chapter 6 - Configure OAI
In the following section, we are going to show you how to configure the ENB, EPC, and
HSS. We are using the below network topology to demonstrate how to configure OAI. Notice
that the HSS in the below figure is outside the core network. In this tutorial, we build HSS
along with EPC and you do not have to setup the interface between HSS and EPC.
Chapter 6 - Configure OAI 11
Tutorial for Open Air Interface
Configure ENB
The available configurations are under {oai_dir}/targets/PROJECTS/GENERIC-LTE-
EPC/CONF/
Chapter 6 - Configure OAI 12
Tutorial for Open Air Interface
We use “enb.band7.tm1.usrpb210.conf” as example. (FDD Band 7)
1. Modified the MNC configuration
tracking_area_code = "1";
mobile_country_code = "466";
mobile_network_code = "68";
466 for Taiwan and 68 for our service (example)
2. Modfied your network configuration
////////// MME parameters:
mme_ip_address = ( { ipv4 = "192.168.1.2";
ipv6 = "192:168:30::17"; ## leave default for no ipv6
……
NETWORK_INTERFACES : {
ENB_INTERFACE_NAME_FOR_S1_MME = "eth0";
ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.1.3/24";
ENB_INTERFACE_NAME_FOR_S1U = "eth0";
ENB_IPV4_ADDRESS_FOR_S1U = "192.168.1.3/24";
ENB_PORT_FOR_S1U = 2152; # Spec 2152
};
Configure EPC
The EPC configured file is under /usr/local/etc/oai/epc.conf Make sure the interfaces of MME
and S-GW are connected with ENB.
1. Modified MNC value in GUMMEI
TAI_LIST = (
{MCC="466" ; MNC="68"; TAC = "1"; } # YOUR PLMN CONFIG HERE
);
2. Add network configuration in MME (MME is responsible for connecting ENB via S1)
NETWORK_INTERFACES :
{
MME_INTERFACE_NAME_FOR_S1_MME = "eth0";
MME_IPV4_ADDRESS_FOR_S1_MME = "192.168.1.2/24";
MME_INTERFACE_NAME_FOR_S11_MME = "none";
MME_IPV4_ADDRESS_FOR_S11_MME = "0.0.0.0/24";
};
3. Add network configuration in S-GW (SGW is responsible for data transmission with
Chapter 6 - Configure OAI 13
Tutorial for Open Air Interface
ENB) In this case we use the same interface
SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP = "eth0";
SGW_IPV4_ADDRESS_FOR_S1U_S12_S4_UP = "192.168.1.2/24";
SGW_IPV4_PORT_FOR_S1U_S12_S4_UP = 2152;
4. Add public IP in P-GW
PGW_INTERFACE_NAME_FOR_SGI = "eth2";
PGW_IPV4_ADDRESS_FOR_SGI = "140.114.XX.XX/24"; #Your Public IP
5. Specify the DNS server in P-GW
DEFAULT_DNS_IPV4_ADDRESS = "8.8.8.8"; # your DNS address
DEFAULT_DNS_SEC_IPV4_ADDRESS = "8.8.4.4";
Configure HSS
You need to add user date and MME information in the MySQL database . Login into
phpmyadmin via browser.(optional) (Default: http://127.0.0.1/phpmyadmin)
Table : APN
APN can be replaced by yourself.
Table : mmeidentity
In this table, you need to configure the same FQDN(hostname.realm) of your EPC machine
In this example, mmehost is cran-cn.oai.nmsl and mmerealm is oai.nmsl
SIM card configuration (For commercial UE) :
If you are using commercial equipment for testing, you need to setup the following
configuration. If you are using OAI UE, you can skip the following instructions. Following
setup is depending on our SIM card:
Chapter 6 - Configure OAI 14
Tutorial for Open Air Interface
ICCID: 89886500000745809013
IMSI: 466680000000001
KI: 8BAF473F2F8FD09487CCCBD7097C6862
OP: 11111111111111111111111111111111
Table : PGW
Add new entry with your P-GW interface setting (IP address)
PDN Table:
In this table, you need to configure the users_imsi , apn , pgw_id. “APN” should be matched
with the one in apn table. Pgw_id should be consistent with your pgw set up (pgw table).
Other values can be remained the same.
Users Table:
You need to configure the imsi , mmeidentity_idmmeidentity, key (ki).
Mmeidentity_idmmeidentity shoud be match your configuration on mmeidentity table. Other
values can be remained the same.
Using UNHEX founction while inseting the key value*
Chapter 6 - Configure OAI 15
Tutorial for Open Air Interface
Chapter 6 - Configure OAI 16
Tutorial for Open Air Interface
Chapter 7 - Run OAI
To run the OAI, first turn on the HSS database. If you run the EPC and HSS on the same
host, EPC will act as the S6A server. Thus, you need to turn on the EPC first.
Run EPC
Go to your OAI directory
cd {oai-dir}/openair-cn/SCRIPTS
sudo ./run_epc
Run HSS
Go to your OAI directory
cd {oai-dir}/openair-cn/SCRIPTS
sudo ./run_hss
When your EPC connect to HSS , you should see the “STATE_OPEN” message on both
EPC and HSS. After then, you can turn on the ENB. Note: If you fail to established the
connection you may check your FQDN setting in /etc/hosts and the freediameter files ,which
locate at /usr/etc/freediameter/mme_fd.conf and /usr/etc/freediameter/hss_fd.conf. The host
name should be match to FQDN and the realm should be match to your configuration. If not,
you should rebuild your EPC and HSS with the right configuration. DO NOT MODIFY
DIRECTLY.
Run ENB
Go to your OAI directory
cd {oai-dir}/cmake_targets/lte_build_oai/build
sudo ./lte-softmodem -d -m 26 -t 16 -O ../../../targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.u
Remove –d if you run ENB on the server(without GUI). -V is optional When you see the
message “Entering ITTI signals handler”. Then, your UE should be able to connect with OAI.
Chapter 7 - Run OAI 17
Tutorial for Open Air Interface
Chapter 8 - Trouble shooting
Issue : UHD missing (ENB with USRP B210) Copy and paste these commands into
your terminal. This will install UHD software as well as allow you to receive package
updates
sudo bash -c 'echo "deb http://files.ettus.com/binaries/uhd_stable/repo/uhd/ubuntu/`lsb_release -
sudo apt-get update
sudo apt-get install -t `lsb_release -cs` uhd
reference : http://ananmxw.blog.163.com/blog/static/2111441192013732399686/
issue : "Error 111" while trying to reconnect to the network
The quick fix is to compare MAC values only when EPC's own MAC is not 0. You may change Line 317
from
if (mac != header->message_authentication_code) {
to
if ((mac != 0) && (mac != header->message_authentication_code)) {
RX/TX overflow or busy
make sure that you have at least 4 CPU cores running at least at 2.7GHz without the
freq scaling (watch grep \"cpu MHz\" /proc/cpuinfo), see
https://twiki.eurecom.fr/twiki/bin/view/OpenAirInterface/OpenAirKernelMainSetup
make sure that you are running 64-bit lowlatency kernel, uname -a
rebuild the lte-softmodem, ./build_oai --eNB -C, optionally add -I to check the packages
use sudo with option -E
use chrt to change the process priority, i.e. sudo -E chrt 99 -E ./lte-softmodem ...
Chapter 8 - Trouble shooting 18
Tutorial for Open Air Interface
Appendix A - Performance
LTE Resource blocks
In ENB configuration files , {oai_dir}/targets/PROJECTS/GENERIC-LTE-EPC/CONF/{files}
N_RB_DL = 100; #Available value 6, 25, 50, 100
Appendix A - Performance 19