{"id":371,"date":"2019-09-22T14:18:00","date_gmt":"2019-09-22T14:18:00","guid":{"rendered":"http:\/\/open-cells.com\/?p=371"},"modified":"2019-11-29T08:07:08","modified_gmt":"2019-11-29T08:07:08","slug":"all-in-one-openairinterface","status":"publish","type":"post","link":"https:\/\/open-cells.com\/index.php\/2019\/09\/22\/all-in-one-openairinterface\/","title":{"rendered":"All in one OpenAirInterface"},"content":{"rendered":"<p>November 28th 2019: fix from user review<\/p>\n<p>September 23rd 2019: minor fix of warnings<\/p>\n<p>September 2019, large rework and update to latest eNB<\/p>\n<p>June 21st 2019: replace ubuntu 17.04 by ubuntu 18.04<\/p>\n<p>Sept 7th 2017: small update for more recent eNB git commit version in develop branch<\/p>\n<p>Starting condition:<br \/>\nUbuntu 18.04 all packages upgraded, uhd last commit, OAI last commit<\/p>\n<p>Modifications<\/p>\n<ul class=\"ili-indent\">\n<li>Latest commits<\/li>\n<li>Fix a issue in mme that crash mme with some phones in the attach-request procedure<br \/>\nIf you want to fix only this issue, pick files:<br \/>\nsrc\/nas\/emm\/Attach.c<br \/>\nsrc\/nas\/ies\/SupportedCodecList.c<br \/>\nin the hereafter tar file<br \/>\nThe issue is: mme wrong decoding of smartphone codec list<\/li>\n<li>Full re-test, from disk install of Ubuntu 17.04 to commercial UEs throughput measurement (Android 5 and Android 6)<\/li>\n<\/ul>\n<p>This document explains how to install and configure OAI EPC+eNB on one single Ubuntu 18.04 64 bits machine connected with a regular UE, routing the UE traffic to internet.<\/p>\n<p>The description uses a USRP B210 board.<\/p>\n<p>We also explain how to simplify, fix existing issues, to make a single computer as a full LTE network: EPC+eNB.<\/p>\n<p>Known limitations fixed in the hereafter description<\/p>\n<ul class=\"ili-indent\">\n<li>GTP UDP ports are in conflict for eNB and SGW<\/li>\n<li>Useless link between OAI and the Ubuntu\/Linux hostname removed<\/li>\n<li>Several simplifications and precisions to make easier and reliable installations<\/li>\n<\/ul>\n<h1>Install Ubuntu<\/h1>\n<ul>\n<li>Prepare a machine: a 4 actual cores, no hyper-threading.<br \/>\nAll other configuration in OAI Wiki (C1 states, &#8230;) describes is about useless.<\/li>\n<li>Download Ubuntu 18.04 64 bits version iso file<\/li>\n<li>create a usb key to boot on it<\/li>\n<li>install Ubuntu: choose to install Third party SW, and to upgrade all packages while installing<\/li>\n<li>do: <em>apt update; apt upgrade <\/em>until the machine is up-to-date<\/li>\n<li>install git and configure your identification in git:\n<pre> sudo apt install git \n git config --global user.name \"Laurent\"\n git config --global user.email \"laurent.thomas@open-cells.com\"<\/pre>\n<\/li>\n<li>Add the OAI repository as authorized remote system\n<pre>echo -n | openssl s_client -showcerts -connect gitlab.eurecom.fr:443 2&gt;\/dev\/null | sed -ne '\/-BEGIN CERTIFICATE-\/,\/-END CERTIFICATE-\/p' | sudo tee -a \/etc\/ssl\/certs\/ca-certificates.crt<\/pre>\n<\/li>\n<li>if you are upset with sudo password, add this line in \/etc\/sudoers\n<ul>\n<li>xxxxxx ALL=(ALL) NOPASSWD: ALL (xxxxxx is your login name)<\/li>\n<li>sudo will not ask anymore for a password<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h1>Install USRP drivers<\/h1>\n<p>We prefer to use UHD driver from source:<\/p>\n<pre>sudo apt-get install libboost-all-dev libusb-1.0-0-dev python-mako doxygen python-docutils python-requests python3-pip cmake build-essential\npip3 install mako numpy\ngit clone git:\/\/github.com\/EttusResearch\/uhd.git\ncd uhd; mkdir host\/build; cd host\/build\ncmake -DCMAKE_INSTALL_PREFIX=\/usr ..\nmake -j4\nsudo make install\nsudo ldconfig\nsudo \/usr\/lib\/uhd\/utils\/uhd_images_downloader.py<\/pre>\n<h1>Download our modifications<\/h1>\n<p>download and extract the data:<\/p>\n<pre>cd ~\nwget<a class=\"moz-txt-link-freetext\" href=\"https:\/\/open-cells.com\/d5138782a8739209ec5760865b1e53b0\/opencells-mods-20190923.tgz\"> https:\/\/open-cells.com\/opencells-mods-20190923.tgz<\/a>\ntar xf opencells-mods-20190923.tgz<\/pre>\n<h1>Download and patch EPC<\/h1>\n<p>Clone OAI EPC:<\/p>\n<pre># maybe go back to home directory (leave openairinterface5g directory)\ngit clone https:\/\/gitlab.eurecom.fr\/oai\/openair-cn.git\ncd openair-cn\ngit checkout develop<\/pre>\n<p>We tested with commit: 724542d0b59797b010af8c5df15af7f669c1e838<\/p>\n<p><em>The Eurecom gitlab require now a login, if you don&#8217;t have one, a copy of the git repository is in:<a href=\"https:\/\/open-cells.com\/d5138782a8739209ec5760865b1e53b0\/openair-cn.tgz\">openair-cn<\/a> extract the tar with<\/em><\/p>\n<pre>tar xf openair-cn.tgz\ncd openair-cn\ngit checkout develop<\/pre>\n<p>This is the last commit for OAI EPC on this development tree. Active OpenAir EPC is now another project on github. We use here this legacy EPC because the installation is quite easy (the new project uses Cassandra, al LOT of virtual machines, OpenVswitch and complex dependancies).<\/p>\n<p>Apply the patch:<\/p>\n<pre>git apply ~\/opencells-mods\/EPC.patch<\/pre>\n<p>The new version of the source files are also in the tar, if you want to merge with another version of OpenAir EPC<\/p>\n<p>What is in the patch file:<\/p>\n<ul class=\"ili-indent\">\n<li>Add Ubuntu 18.04 for compilation and fix some bugs<\/li>\n<li>Remove link between Linux host name and LTE diameter protocol configuration<\/li>\n<li>Add usage of the input address for the SGW input socket<\/li>\n<li>modify the freediameter S6a interface to fix a wrong OAI parameter<\/li>\n<li><strong>No kernel module patch is required<\/strong>: generic Ubuntu kernel 18.04 works fine with OAI<\/li>\n<li>separate ASN.1 compiler installation to be compatible with other OpenAir components on the same machine (ans1c version is different for eNB and gNB)<\/li>\n<\/ul>\n<h1>Install third party SW for EPC<\/h1>\n<pre>cd openair-cn; source oaienv; cd scripts\n.\/build_hss -i<\/pre>\n<ul>\n<li>Answer yes to install: freeDiameter 1.2.0<\/li>\n<li>phpmyadmin:\n<ul>\n<li>We don&#8217;t use phpmyadmin later in this procedure to update the MySQL database<\/li>\n<li>We removed the installation of phpmyadmin (of course you can use it if you prefer)<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>For ubuntu 18.04, we set back the legacy mysql security level<\/p>\n<pre>sudo mysql -u root &lt;&lt; END\nUSE mysql;\nUPDATE user SET plugin='mysql_native_password' WHERE User='root';\nFLUSH PRIVILEGES;\nEND\n\nsudo systemctl restart mysql.service\n\nsudo mysql_secure_installation<\/pre>\n<p>The last command will ask a few questions:<\/p>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li>password: set your password (linux is set in our default config files)<\/li>\n<li>VALIDATE PASSWORD PLUGIN: no<\/li>\n<li>Remove anonymous users: yes<\/li>\n<li>Disallow root login remotely: yes<\/li>\n<li>Remove test database and access to it: yes<\/li>\n<li>Reload privilege tables now: yes<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<ul>\n<li>Install 3PP SW for mme and spgw<\/li>\n<\/ul>\n<pre>.\/build_mme -i<\/pre>\n<ul class=\"ili-indent\">\n<li>Do you want to install freeDiameter 1.2.0: no<\/li>\n<li>Do you want to install asn1c rev 1516 patched? &lt;y\/N&gt;: yes<\/li>\n<li>Do you want to install libgtpnl ? &lt;y\/N&gt;: yes<\/li>\n<li>wireshark permissions: as you prefer<\/li>\n<\/ul>\n<pre> .\/build_spgw -i<\/pre>\n<ul class=\"ili-indent\">\n<li>Do you want to install libgtpnl ? &lt;y\/N&gt;: no<\/li>\n<\/ul>\n<h1>Compile the EPC nodes<\/h1>\n<p>No difficulty found in this phase.<\/p>\n<pre>cd openair-cn; source oaienv; cd scripts\n.\/build_hss\n.\/build_mme\n.\/build_spgw<\/pre>\n<p>If you face compilation issues, the log files are in openair-cn\/build\/log<\/p>\n<p>In there files, look for &#8220;error:&#8221; string.<\/p>\n<h1>Download &amp; Compile the eNB on 18.04<\/h1>\n<pre>git clone https:\/\/gitlab.eurecom.fr\/oai\/openairinterface5g.git\ncd openairinterface5g\ngit checkout develop<\/pre>\n<ul class=\"ili-indent\">\n<li>We tested with commit edb74831dabf79686eb5a92fbf8fc06e6b267d35<\/li>\n<\/ul>\n<ul>\n<li>Build in two steps<\/li>\n<\/ul>\n<pre>source oaienv\u00a0\u00a0\n.\/cmake_targets\/build_oai -I\u00a0 # install SW packages from internet\n.\/cmake_targets\/build_oai -w USRP --eNB --UE # compile eNB and UE<\/pre>\n<h1>Our Network setup description<\/h1>\n<p>I&#8217;ve made a simple configuration for this all-in-one setup.<\/p>\n<p>Each node is on a separate IP address, this address is used for all it&#8217;s interfaces. In our case of all-in-one, we take addresses on the loopback: this will be fine on all your machines.<\/p>\n<ul>\n<li>HSS is on localhost: 127.0.0.1<\/li>\n<li>eNB is on 127.0.0.10<\/li>\n<li>MME is on 127.0.0.20<\/li>\n<li>SPGW is on 127.0.0.30<\/li>\n<\/ul>\n<p>The LTE diameter configuration is now isolated from Linux hostname.<\/p>\n<p>realm for our EPC: &#8220;OpenAir5G.Alliance&#8221;, so, full distinguish names (FQDN) are: hss.OpenAir5G.Alliance, mme.OpenAir5G.Alliance<\/p>\n<h2>Install this configuration for eNB<\/h2>\n<p>In your eNB configuration file, the network is now fixed, as lo interface always exists and our computer internal addresses also:<\/p>\n<pre>\/\/\/\/\/\/\/\/\/\/ MME parameters:\n mme_ip_address = ( { ipv4 = \"127.0.0.20\";\n ipv6 = \"192:168:30::17\";\n active = \"yes\";\n preference = \"ipv4\";\n }\n );\n\nNETWORK_INTERFACES : \n {\n ENB_INTERFACE_NAME_FOR_S1_MME = \"lo\";\n ENB_IPV4_ADDRESS_FOR_S1_MME = \"127.0.0.10\/8\";\n\n ENB_INTERFACE_NAME_FOR_S1U = \"lo\";\n ENB_IPV4_ADDRESS_FOR_S1U = \"127.0.0.10\/8\";\n ENB_PORT_FOR_S1U = 2152; # Spec 2152\n };<\/pre>\n<p>In the eNB config file, you need also to set the MCC and MNC as per your SIM card:<\/p>\n<p>tracking_area_code = &#8220;1&#8221;;<br \/>\nmobile_country_code = &#8220;208&#8221;;<br \/>\nmobile_network_code = &#8220;92&#8221;;<\/p>\n<p>And obviously, your radio parameters.<\/p>\n<p>Wwe tested with USRP B210 20MHz band, Huawei E3272 UE, a cavity duplexer a simple antenna, about 1 meter distance UE\/eNB antenna with this file: ~\/opencells-mods\/enb.10MHz.b200<\/p>\n<p>if you use the OpenAir UE, a sim card file that match our hss database example: opencells-mods\/sim.conf. We will make another tutorial to use together OpenAir UE and rf board simulation<\/p>\n<h2>Install this configuration for EPC<\/h2>\n<p>For the EPC, we install in OAI default directory: \/usr\/local\/etc\/oai<\/p>\n<pre>sudo mkdir -p \/usr\/local\/etc\/oai\nsudo cp -rp ~\/opencells-mods\/config_epc\/* \/usr\/local\/etc\/oai<\/pre>\n<pre>cd openair-cn; source oaienv; cd scripts\n.\/check_hss_s6a_certificate \/usr\/local\/etc\/oai\/freeDiameter hss.OpenAir5G.Alliance\n.\/check_mme_s6a_certificate \/usr\/local\/etc\/oai\/freeDiameter mme.OpenAir5G.Alliance<\/pre>\n<p>Only the SGi output to internet need to be configured.<br \/>\nIn \/usr\/local\/etc\/oai\/spgw.conf,<br \/>\nyour should set the Ethernet interface that is connected to Internet, and,<br \/>\nto tell to the PGW to implement NAPT for the UE traffic<\/p>\n<pre> PGW_INTERFACE_NAME_FOR_SGI = \"enp3s0\"; \n PGW_MASQUERADE_SGI = \"yes\";<\/pre>\n<p>For the SIM card, you&#8217;ll have more to do:<\/p>\n<ul>\n<li>SIM MCC\/MNC should be duplicated in a couple of files\n<ul>\n<li>eNB: See above in eNB configuration chapter<\/li>\n<li>MME file: \/usr\/local\/etc\/oai\/mme.conf to update<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<pre>GUMMEI_LIST = ( MCC=\"208\" ; MNC=\"92\"; MME_GID=\"4\" ; MME_CODE=\"1\"; } );\nTAI_LIST = ({MCC=\"208\" ; MNC=\"92\"; TAC = \"1\"; } );<\/pre>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li>HSS\n<ul>\n<li>Configure the password for MySQL\n<ul>\n<li>in \/usr\/local\/etc\/oai\/hss.conf, set password as the password you created during MySQL installation<\/li>\n<\/ul>\n<\/li>\n<li>A HSS database in text is in: ~\/opencells-mods\/opencells_db.sql\n<ul>\n<li>We don&#8217;t use phpmyadmin: we load the database from a ascii file<\/li>\n<li>It is pre-configured with the\n<ul>\n<li>mme id<\/li>\n<li>10 users is network 208\/92 (a French test network) are also created (don&#8217;t use 3GPP test network: 001\/01: the mme fails when MCC starts by &#8220;0&#8221;)<\/li>\n<\/ul>\n<\/li>\n<li>Each time you import this db, it <strong>erases<\/strong> the entire database<br \/>\n(example: you set mysql password to &#8220;linux&#8221;)<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<pre>~\/opencells-mods\/hss_import 127.0.0.1 root linux oai_db ~\/opencells-mods\/opencells_db.sql<\/pre>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li>We use to modify the db by updating this file with regular text editor,<br \/>\nthen we re-load the entire database,<br \/>\nbut, if you prefer, usage of http:\/\/localhost\/phpmyadmin is fine.<\/li>\n<li>if you modified the hss db directly, we offer a export script:\n<pre>~\/opencells-mods\/hss_export<\/pre>\n<\/li>\n<li>The important values to set are:\n<ul>\n<li>table pdn:\n<ul>\n<li>all IMSI are listed, with the APN: these values are in UE\/USIM<\/li>\n<\/ul>\n<\/li>\n<li>table users:\n<ul>\n<li>all IMSI, key (Ki) and OPc must be the same in USIM card<\/li>\n<li>Sqn increments automatically\u00a0 when the UE authenticate in both USIM and HSS DB: it should be set as per USIM internal incrementation<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<li>SIM card update\n<ul>\n<li>Open cells UICC and card reader will\u00a0 be supported<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h1>Final test and verification<\/h1>\n<p>open 4 terminal windows<\/p>\n<ol>\n<li>in each window<\/li>\n<\/ol>\n<pre>cd openair-cn; source oaienv; cd scripts; .\/run_hss<\/pre>\n<pre>cd openair-cn; source oaienv; cd scripts; .\/run_mme<\/pre>\n<pre>cd openair-cn; source oaienv; cd scripts; sudo -E .\/run_spgw<\/pre>\n<pre>sudo bash\ncd ~\/openairinterface5g; source oaienv\ncd cmake_targets\/lte_build_oai\/build\n.\/lte-softmodem -O ~\/opencells-mods\/enb.10MHz.b200\n<\/pre>\n<p>Connect the UE, it should attach to network and be able to reach internet through OAI network.<\/p>\n<p>If the UE attaches, but you don&#8217;t have internet access, verify phone configuration: enable data in config-&gt;sim and verify the APN value<\/p>\n<h1>Issues related to CPU power<\/h1>\n<p>If you reach performance issues: USRP\/UHD prints &#8220;LLLLL&#8221; or the process exits &#8220;problem with samples&#8221;, OVERFLOW, &#8230;<\/p>\n<p>The first case is to verify the USRP dialogs over USB3 (not USB2): the process must report:<\/p>\n<pre>Found USRP B200\n-- Detected Device: B200\n-- Operating over USB 3.<\/pre>\n<p>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:<\/p>\n<p>https:\/\/gitlab.eurecom.fr\/oai\/openairinterface5g\/wikis\/setup-for-real-time-performance<\/p>\n<p>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).<\/p>\n<p>We re-built this procedure from scratch and tested i5-6600K.<\/p>\n<p>On the i5-6600K, we obtained stable performance at maximum traffic over 20MHz, transmission mode 1 (SISO), duplexer, antenna, E3372 UE (one single UE) over-the-air 10 cm distance :<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-2903\" src=\"https:\/\/open-cells.com\/wp-content\/uploads\/2017\/08\/speedtest-300x130.png\" alt=\"\" width=\"300\" height=\"130\" srcset=\"https:\/\/open-cells.com\/wp-content\/uploads\/2017\/08\/speedtest-300x130.png 300w, https:\/\/open-cells.com\/wp-content\/uploads\/2017\/08\/speedtest.png 758w\" sizes=\"auto, (max-width: 300px) 85vw, 300px\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>November 28th 2019: fix from user review September 23rd 2019: minor fix of warnings September 2019, large rework and update to latest eNB June 21st 2019: replace ubuntu 17.04 by ubuntu 18.04 Sept 7th 2017: small update for more recent eNB git commit version in develop branch Starting condition: Ubuntu 18.04 all packages upgraded, uhd &hellip; <a href=\"https:\/\/open-cells.com\/index.php\/2019\/09\/22\/all-in-one-openairinterface\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;All in one OpenAirInterface&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":true,"template":"","format":"standard","meta":{"_crdt_document":"","footnotes":""},"categories":[1],"tags":[],"class_list":["post-371","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/open-cells.com\/index.php\/wp-json\/wp\/v2\/posts\/371","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/open-cells.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/open-cells.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/open-cells.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/open-cells.com\/index.php\/wp-json\/wp\/v2\/comments?post=371"}],"version-history":[{"count":50,"href":"https:\/\/open-cells.com\/index.php\/wp-json\/wp\/v2\/posts\/371\/revisions"}],"predecessor-version":[{"id":3066,"href":"https:\/\/open-cells.com\/index.php\/wp-json\/wp\/v2\/posts\/371\/revisions\/3066"}],"wp:attachment":[{"href":"https:\/\/open-cells.com\/index.php\/wp-json\/wp\/v2\/media?parent=371"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/open-cells.com\/index.php\/wp-json\/wp\/v2\/categories?post=371"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/open-cells.com\/index.php\/wp-json\/wp\/v2\/tags?post=371"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}