{"id":236,"date":"2017-06-07T13:32:26","date_gmt":"2017-06-07T13:32:26","guid":{"rendered":"http:\/\/open-cells.com\/?p=236"},"modified":"2019-07-29T08:16:31","modified_gmt":"2019-07-29T08:16:31","slug":"openair-single-machine-ubuntu-17-04-after-major-epc-update","status":"publish","type":"post","link":"https:\/\/open-cells.com\/index.php\/2017\/06\/07\/openair-single-machine-ubuntu-17-04-after-major-epc-update\/","title":{"rendered":"(obsolete) OpenAir, single machine Ubuntu 17.04, after major EPC update"},"content":{"rendered":"<p>(updated: 2017, July 10th)<\/p>\n<p>Modifs since version on July 6th:<\/p>\n<ul class=\"ili-indent\">\n<li>Latest commit<\/li>\n<li>Fix lacking file in the tarball<br \/>\n(non modified ones since the June version were missing)<\/li>\n<li>improved code pieces formating in HTML, added automatic git patch<\/li>\n<li>Full re-test, from disk install of Ubuntu 17.04 to UE throughput measurement<\/li>\n<\/ul>\n<p>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.<\/p>\n<p>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.<\/p>\n<p>The description uses a USRP B210 board, a Lime SDR page is provided separately.<\/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>OAI EPC require kernel &gt;= 4.7, so we have to use Ubuntu 17.04\n<ul>\n<li>We already pushed some enhancements in OAI, nevertheless some more are required<\/li>\n<\/ul>\n<\/li>\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 17.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>Ettus has not yet released their driver for Ubuntu 17.04, we take it from source:<\/p>\n<pre>sudo apt-get install libboost-all-dev libusb-1.0-0-dev python-mako doxygen python-docutils python-requests cmake build-essential\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: <a href=\"http:\/\/open-cells.com\/d5138782a8739209ec5760865b1e53b0\/opencells-mods-20170710.tgz\">patches<\/a>&nbsp;&nbsp; extract the data:<\/p>\n<pre>tar xf opencells-mods-20170710.tgz<\/pre>\n<h1>Download &amp; Compile the eNB on 17.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 08b8b3142df16831396a5283a015564ff56bf91c<\/li>\n<\/ul>\n<p>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<\/p>\n<pre>git apply opencells-mods\/eNB.patch<\/pre>\n<ul>\n<li>Now, you should be able to build as usual the eNB<\/li>\n<\/ul>\n<pre>source oaienv&nbsp;&nbsp;\n.\/cmake_targets\/build_oai -I&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # install SW packages from internet\n.\/cmake_targets\/build_oai&nbsp; -w USRP --eNB --UE # compile eNB<\/pre>\n<h1>Download and patch EPC<\/h1>\n<p>Clone OAI EPC:<\/p>\n<pre>git clone https:\/\/gitlab.eurecom.fr\/oai\/openair-cn.git\ncd openair-cn\ngit checkout develop<\/pre>\n<p>(we used: commit 5353b606662a6ae7eaadf6bc39cbf6452d298b0e)<\/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 17.04 for compilation and fix some bugs\n<ul>\n<li><em>build\/tools\/build_helper<\/em><\/li>\n<li><em>src\/common\/common_defs.h<\/em><\/li>\n<li><em>src\/oai_hss\/utils\/hss_config.c<\/em><\/li>\n<\/ul>\n<\/li>\n<li>Remove link between Linux host name and LTE diameter protocol configuration\n<ul>\n<li><em>src\/s6a\/s6a_peer.c<\/em><\/li>\n<\/ul>\n<\/li>\n<li>Add usage of the input address for the SGW input socket\n<ul>\n<li><em>src\/gtpv1-u\/gtp_mod_kernel.c<\/em><\/li>\n<li><em>src\/gtpv1-u\/gtp_mod_kernel.h<\/em><\/li>\n<li><em>src\/gtpv1-u\/gtpv1u_task.c<\/em><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><strong>No kernel module patch is required<\/strong> anymore: generic Ubuntu kernel 17.04 works fine with OAI<\/p>\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>Do you want to install freeDiameter 1.2.0 ?: yes<\/li>\n<li>set your MySQL password and remember it!<\/li>\n<li>Answer yes to install: freeDiameter 1.2.0<\/li>\n<li>phpmyadmin:\n<ul>\n<li>choose light or apache as you prefer<\/li>\n<li>Configure database for phpmyadmin with dbconfig-common: yes<\/li>\n<li>password: same as MySQL for simplicity<\/li>\n<li>We don&#8217;t use phpmyadmin later in this procedure, nevertheless we tested successfully also with it<\/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;: no<\/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<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 and two parameter files: 10MHz band, 20MHz band, Huawei E3272 UE, a cavity duplexer a simple antenna, about 1 meter distance UE\/eNB antenna.<\/p>\n<ul>\n<li>openairinterface5g\/targets\/PROJECTS\/GENERIC-LTE-EPC\/CONF\/enb.band7.tm1.50PRB.usrpb210.conf<\/li>\n<li>openairinterface5g\/targets\/PROJECTS\/GENERIC-LTE-EPC\/CONF\/enb.band7.tm1.100PRB.usrpb210.conf<\/li>\n<\/ul>\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>.\/hss_db_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>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&nbsp; 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&nbsp; 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\n.\/cmake_targets\/lte_build_oai\/build\/lte-softmodem -O &lt;your config file&gt;\n<\/pre>\n<p>Connect the UE, it should attach to network and be able to reach internet through OAI network<\/p>\n<p>We re-built this procedure from scratch and tested two machines: i5-4570 and i5-6600K.<\/p>\n<p>On the i5-4570, at maximum traffic, the eNB is stable on 10MHz band at full user data speed.<\/p>\n<p>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:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-251\" src=\"http:\/\/open-cells.com\/wp-content\/uploads\/2017\/06\/speedtest-300x185.png\" alt=\"\" width=\"300\" height=\"185\" srcset=\"https:\/\/open-cells.com\/wp-content\/uploads\/2017\/06\/speedtest-300x185.png 300w, https:\/\/open-cells.com\/wp-content\/uploads\/2017\/06\/speedtest.png 733w\" sizes=\"auto, (max-width: 300px) 85vw, 300px\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>(updated: 2017, July 10th) Modifs since version on July 6th: Latest commit Fix lacking file in the tarball (non modified ones since the June version were missing) improved code pieces formating in HTML, added automatic git patch Full re-test, from disk install of Ubuntu 17.04 to UE throughput measurement This document explains how to install &hellip; <a href=\"https:\/\/open-cells.com\/index.php\/2017\/06\/07\/openair-single-machine-ubuntu-17-04-after-major-epc-update\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;(obsolete) OpenAir, single machine Ubuntu 17.04, after major EPC update&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_crdt_document":"","footnotes":""},"categories":[1],"tags":[],"class_list":["post-236","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/open-cells.com\/index.php\/wp-json\/wp\/v2\/posts\/236","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=236"}],"version-history":[{"count":26,"href":"https:\/\/open-cells.com\/index.php\/wp-json\/wp\/v2\/posts\/236\/revisions"}],"predecessor-version":[{"id":1537,"href":"https:\/\/open-cells.com\/index.php\/wp-json\/wp\/v2\/posts\/236\/revisions\/1537"}],"wp:attachment":[{"href":"https:\/\/open-cells.com\/index.php\/wp-json\/wp\/v2\/media?parent=236"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/open-cells.com\/index.php\/wp-json\/wp\/v2\/categories?post=236"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/open-cells.com\/index.php\/wp-json\/wp\/v2\/tags?post=236"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}