All in one OpenAirInterface, August 22nd

(Sept 7th 2017: small update for more recent eNB git commit version in develop branch)

This post is a full re-test with latest August 22nd versions:
Ubuntu 17.04 all packages upgraded, uhd last commit, OAI last commit


  • Latest commits
  • Fix a issue in mme that crash mme with some phones in the attach-request procedure (maybe Android 6 phones)
    If you want to fix only this issue, pick files:
    in the hereafter tar file
    The issue is: mme wrong decoding of smartphone codec list
  • Full re-test, from disk install of Ubuntu 17.04 to commercial UEs throughput measurement (Android 5 and Android 6)

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, routing the UE traffic to internet.

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 (Ubuntu 16.04.3 is almost same as 17.04)
  • 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 "Laurent"
     git config --global ""
  • Add the OAI repository as authorized remote system
    echo -n | openssl s_client -showcerts -connect 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

We prefer to use UHD driver 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://
cd uhd; mkdir host/build; cd host/build
make -j4
sudo make install
sudo ldconfig
sudo /usr/lib/uhd/utils/

Download our modifications

download: patches   extract the data:

tar xf Downloads/opencells-mods-20170823.tgz

Download & Compile the eNB on 17.04

git clone
cd openairinterface5g
git checkout develop
  • We tested with commit 17b9a9e917ce2a3a8c7004c7b9a221c350ddfe17

We already merged in develop most of updates for Ubuntu 17.04, so we need only to add in build_helper file the Ubuntu 17.04 support

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

Download and patch EPC

Clone OAI EPC:

# maybe go back to home directory (leave openairinterface5g directory)
git clone
cd openair-cn
git checkout develop

We tested with commit: 724542d0b59797b010af8c5df15af7f669c1e838

Apply the patch:

git apply ~/opencells-mods/EPC.patch

The new version of the source files are also in the tar, if you want to merge with another version of OpenAir EPC

What is in the patch file:

  • Add Ubuntu 17.04 for compilation and fix some bugs
    • build/tools/build_helper
    • src/common/common_defs.h
    • src/oai_hss/utils/hss_config.c
  • Remove link between Linux host name and LTE diameter protocol configuration
    • src/s6a/s6a_peer.c
  • Add usage of the input address for the SGW input socket
    • src/gtpv1-u/gtp_mod_kernel.c
    • src/gtpv1-u/gtp_mod_kernel.h
    • 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
  • 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

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:
  • eNB is on
  • MME is on
  • SPGW is on

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 = "";
 ipv6 = "192:168:30::17";
 active = "yes";
 preference = "ipv4";


 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 20MHz band, Huawei E3272 UE, elephone P6000 (android 5), a cavity duplexer a simple antenna, about 1 meter distance UE/eNB antenna with this file: ~/opencells-mods/enb.10MHz.b200

derivated from: 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
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


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

  • SIM MCC/MNC should be duplicated in a couple of files
    • 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
        • We don’t use phpmyadmin: we load the database from a ascii file
        • It is pre-configured with the
          • mme id
          • 10 users is network 208/92 (a French test network) are also created (don’t use 3GPP test network: 001/01: the mme fails when MCC starts by “0”)
        • Each time you import this db, it erases the entire database
          (example: you set mysql password to “linux”)
./hss_db_import 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 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
./cmake_targets/lte_build_oai/build/lte-softmodem -O <your config file>

Connect the UE, it should attach to network and be able to reach internet through OAI network.

If the UE attaches, but you don’t have internet access, verify phone configuration: enable data in config->sim and verify the APN value

Issues related to CPU power

If you reach performance issues: USRP/UHD prints “LLLLL” or the process exits “problem with samples”, OVERFLOW, …

The first case is to verify the USRP dialogs over USB3 (not USB2): the process must report:

Found USRP B200
-- Detected Device: B200
-- Operating over USB 3.

For OAI source code, we wrote improvements and some hints for UE performance last year. The Linux/Ubuntu advises can be applied to the eNB:

We may make later a post for eNB (OAI/eNB can reach much better performance than today develop branch, but it require to enhance parts of the source code).

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 obtained stable performance at maximum traffic over 20MHz, transmission mode 1 (SISO), one single UE over-the-air 1 meter distance (not re-tested since July version):


25 thoughts on “All in one OpenAirInterface, August 22nd”

  1. Hi, Laurent,
    I ran the eNB and EPC successfully. And my board is Limesdr, but I have also met some problem.
    Build the lte-softmodem,like this:
    ./cmake_targets/build_oai -c -w LMSSDR –eNB –UE
    run lte-softmodem:
    sudo ./cmake_targets/lte_build_oai/build/lte-softmodem -O ./targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210.conf –rf-config-file ./targets/ARCH/LMSSDR/LimeSDR_above_1p8GHz_1v4.ini

    But I can not get the tx signal when I checked the frequency of nearby neighborhoods by professional equipment. Can you help me out please?

    1. Hi i had the same problem , i changed tx_gain to 100 in enb.band7.tm1.50PRB.lmssdr.conf file and now carrier is visible .

      But i can’t see base station in my phone , phone is nexus 5x and i know it support LTE band7 without problem .

      i even set mnc and mcc according to my sim card in enb.band7.tm1.50PRB.lmssdr.conf and mme.conf .

  2. Hi Dear Laurent
    Could you please help me regarding a problem that occures in the execution of lte-softmodem
    That error is:

    [MAC][I][eNB_dlsch_ulsch_scheduler] UE rnti 72c : in synch, PHR 36 dB CQI 15
    [RRC][I]UE rnti 72c failure timer 0/20000
    [PHY][I]rx_rf: rfdevice timing drift of -1 samples (ts_off 62698675)
    [PHY][I]UE 0 : rnti 72c
    [MAC][I][eNB_dlsch_ulsch_scheduler] UE rnti 72c : in synch, PHR 38 dB CQI 15
    [RRC][I]UE rnti 72c failure timer 0/20000
    [PHY][I]UE 0 : rnti 72c
    [MAC][I][eNB_dlsch_ulsch_scheduler] UE rnti 72c : in synch, PHR 38 dB CQI 15
    [RRC][I]UE rnti 72c failure timer 0/20000

    1. Reza,
      There is no error in this: [I] trace is “information”
      It tells you the UE is attached, and no failure timer occured.
      the 0/20000 means that after 20000 errors, the eNB will abort the UE connexion

  3. Hi Laurent!
    Thank you for the detailed steps it worked fine, however I have tested a different setup, I considered epc on one machine (I have used the patch you have provided) and enb + oaisim on another machine(I run one enb and one user). As a result the enb could not connect to the epc’s mme leading to the ue not being able to attach to epc’s hss+mme. Do you have any suggestions?

    1. Hello,
      We never work with OAISIM.
      We will publish a separte channel simulator that will work with regular OAI UE and OAI eNB,
      nevertheless, as it is free, we do it in “best effort” work.

  4. Hi, Laurent

    Could you please give a hint as to why after command

    ~/openairinterface5g$ git checkout develop

    I get error message when trying to apply the patch?

    git apply ../opencells-mods/eNB.patch
    error: patch failed: cmake_targets/tools/build_helper:551
    error: cmake_targets/tools/build_helper: patch does not apply

    1. Actual commit is commit 1fb76157c838819587a4a5bd0c214fc100b7fbaf. ‘Though it says that it has merged the commit 17b9a9e917ce2a3a8c7004c7b9a221c350ddfe17 that you tested against, later build_oai -I for eNB fails with ‘oai doesn’t support ubuntu 17.04’ message.

    2. Below is git apply in verbose mode.

      ~/openairinterface5g$ git apply -v ../opencells-mods/eNB.patch
      Checking patch cmake_targets/tools/build_helper…
      error: while searching for:
      pydb \
      libyaml-dev \
      wget \

      $SUDO update-alternatives –set /usr/lib/atlas-base/atlas/

      #Remove old gnutls/nettle installation that was done from sources

      $SUDO apt-get install -y nettle-dev nettle-bin

      $SUDO apt-get install -y libgnutls-dev
      elif [[ “$OS_BASEDISTRO” == “fedora” ]]; then
      if [[ “$OS_DISTRO” == “rhel” ]] || [[ “$OS_DISTRO” == “centos” ]]; then
      if rpm -q epel-release > /dev/null; then

      error: patch failed: cmake_targets/tools/build_helper:551
      error: cmake_targets/tools/build_helper: patch does not apply

      1. I am not a linux nerd, but libgnutls-dev library is compatible with previous release of Ubuntu, 16.04. 17.04 utilizes libgnutls30 library only. Do you think it could be the reason for the patch to fail? If yes, how one can fix it?

        1. As per description of git apply error, the patch couldn’t find the line of code in question. It could have been added by earlier commits.

          1. Got tired of finding out where the diff between eNB.patch and build_helper comes from, so applied changes manually.

          2. Dmitry,
            Thanks to point out the latest develop git branch commit refuses to merge our patch.
            I’m a bit lost in your trials:
            – works fine with the version we tested
            => if you do git checkout 17b9a9e917ce2a3a8c7004c7b9a221c350ddfe17
            the patch works fine
            – for the latest commit, as you discovered, the command “git apply eNB.patch” fails
            => the merge fails for a small detail
            instead of git apply, replace the file we need to patch by our version:
            cp ../opencells-mods/cmake_targets/tools/build_helper cmake_targets/tools/build_helper

            I tested: the following compilation works, nevertheless someone will have to perform a full test with a UE.

            I’ll do a new patch version later (we’ll try to maintain this tutorial up to date with latest commits about once per month).


  5. Hi Laurent,
    i am getting following error while executing ./run_spgw:
    Initializing GTPV1U interface
    Creating new listen socket on address and port 2123
    Inserting new descriptor for task 6, sd 31
    Received 1 events
    rmmod: ERROR: Module gtp is not currently loaded
    ERROR in loading gtp kernel module (check if built in kernel)
    Initializing GTPv1-U ERROR
    Function sgw_init (&spgw_config) has failed
    returning -1

    i am using Ubuntu 17.04 (GNU/Linux 4.10.0-33-generic x86_64), i have applied the patches given above. could you please help me out here?


  6. Hi, Laurent,
    I have succesfully compiled eNB+EPC, my RF board is limeSDR. No issues, your instructions are excellent, code is great, components of the system start smoothly, except eNB. I get LLLLL soon after the start of the eNb. My system is Ubuntu 17.04, CPU i5-3260, 4 cores (MacBook Pro 2013+Retina). Applying cpu improvement instructions make things even worse. So my question to you is should i opt for a more powerfull HW or there are code enhancement opportunities yet to be realized that will make the code run on a weaker system? Could moving mme+hss+spgw to a different machine help my cpu handle eNB processing load? I’d appreciate you giving a piece of advice.

    1. Dmitry,

      About the CPU, i don’t find this reference, maybe it is a i5-3360M.
      Anyway, it is likely a 2 cores CPU + hyperthreading.
      You can verify with:
      grep -i core /proc/cpuinfo
      grep siblings /proc/cpuinfo

      If the cores have siblings, it means hyperthreading is running and you see two cores whereas only one exists (this is not two cores, but one core with two sets of registers).

      I saw many people on the mailing list complaining OAI doesn’t run well on such (even recent) 2 cores CPUs (Intel released even “i7” with two actual cores).

      Today, I don’t think OAI runs nicely (even 5MHz/SISO) on such 2 cores CPU, but it should (if we pay enough effort in optimization).
      The best you can do right now: isolate the second core in a shield (probably core 1 and 3 are siblings)
      Run the EPC out of the shielded core
      Run the softmodem in the shielded domain.

      I don’t think running the EPC on another machine will make it significantly better, but you can try.
      For this separate EPC, change the IPs in the all config files to use the Ethernet interface ones.
      (If it is not that simple, I’ll make a post on separate eNB/EPC configuration).

      In next months, we need is to improve the softmodem to run well with less CPU.
      Open cells implemented pieces of code, for that purpose.
      We didn’t release it because we wait a major update that will come soon in develop branch to merge our improvements.
      It is hard to estimate when we will release our work: there is overlap between the near future huge commit in develop branch and what we did.
      So, we expect a complex “merge” that will partially erase what we did.

      Furthermore, we have to deliver first the work we are paid for.
      This is also why we didn’t progress during August on our LimeSDR tests: we do such free open source in best effort mode.


      1. Laurent,

        Thanks for replying. I double checked, my CPU is i5-3230M, 2 cores. Look forward to getting into cpu shielding.

  7. Hi Laurent,
    Recently, my friends told me a way to solve the “LLLLL…” in eNB.
    In system settings->software& updates->Additional Drivers ,we select “Do not use the device ” instead of “Using processor microcode …….”, restart the computer, then it works. that’s all, thank you.

    1. Hello,
      This is a very important remark that need to be qualified better.
      This package is made by Intel, only Intel know what is in, but we know the purpose.
      The motherboard bios contains a version of Intel microcode (a microcode must be loaded in the CPU).
      The Debian/Ubuntu package runs a Intel code that updates this microcode if needed.

      So, you found at least a case where the updated microcode is worse than the one in the bios.

      Could you provide us with more information: CPU type, mother board reference and bios version where this situation occurs?

      thanks for this discovery

  8. Hello,
    I’m sorry to reply you so late.
    my computer is (DELL)3668-R2938/R1938
    and CPU type is i7-7700
    bios version 1.1.0
    Before I change it, it prints out the “LLL…” every time when I run eNB.


    1. Hi,
      The source of microcode seems to be:
      in the tar file, the file releasenote explains how is done the root integration in Linux.

      Ubuntu/Debian seems to only repackage this from Intel delivery, believing they will put better version than the MB bios one.
      In your case it seems a mistake to perform this update.

      Linux boot trace gives us the microcode version:
      dmesg | grep microcode:

      If microcode update in enabled, the output has a line like:
      [ 0.000000] microcode: microcode updated early to revision 0xba, date = 2017-04-09

      In all cases, the microcode version is given like:
      [ 0.963620] microcode: sig=0x506e3, pf=0x2, revision=0xba

      Could you check the versions you have in each case?

  9. Hi Laurent,
    after I run “dmesg | grep microcode”,I got the output as follows;
    [ 0.086702] mce: [Hardware Error]: PROCESSOR 0:906e9 TIME 1510484689 SOCKET 0 APIC 0 microcode 48
    [ 0.086704] mce: [Hardware Error]: PROCESSOR 0:906e9 TIME 1510484689 SOCKET 0 APIC 0 microcode 48
    [ 0.086707] mce: [Hardware Error]: PROCESSOR 0:906e9 TIME 1510484689 SOCKET 0 APIC 0 microcode 48
    [ 0.086709] mce: [Hardware Error]: PROCESSOR 0:906e9 TIME 1510484689 SOCKET 0 APIC 0 microcode 48
    [ 0.818583] microcode: sig=0x906e9, pf=0x2, revision=0x48
    [ 0.818766] microcode: Microcode Update Driver: v2.2.
    I don’t know what it means, could you figure it out for me, thank you.


    1. Hi
      mce => machine check exception
      Means your machine have a HW fault (or the SW wrongly detects HW fault)
      there is package to obtain more details:
      apt install mcelog
      mcelog --client

      Do you have this log for both cases: with “microcode enabled” in ubuntu drivers?

Leave a Reply

Your email address will not be published. Required fields are marked *