# **OAI** ###### tags: `Master` `OAI` ## Installation ### System requirements (Hardware compatibility) - 2 PC(eNB and EPC) - USRP B210(給eNB使用發射訊號) - Sim card(可直接用在手機當UE,也可以插在Dongle用在筆電上) ### Kernel Setups - Main Installation (Software compatibility) - **Kernel and Ubuntu Version** - eNB: low-latency kernel 3.19 on top of Ubuntu 14.04, 64-bit architecture type - EPC: 4.7.x kernel from source with GTP module ```shell= sudo apt-get install xz-utils build-essential wget libncurses5-dev libssl-dev sudo apt-get build-dep linux-image-$(uname -r) ncurses-bin wget https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.7.1.tar.xz unxz linux-4.7.1.tar.xz tar -xovf linux-4.7.1.tar cd linux-4.7.1 make menuconfig make -j`nproc` sudo make modules_install sudo make install ``` - **Power management for eNB** ==Remove all power management features in the BIOS (sleep states, in particular C-states) and CPU frequency scaling (Intel SpeedStep)== watch grep \"cpu MHz\" /proc/cpuinfo `In /etc/default/grub:` **Add** GRUB_CMDLINE_LINUX_DEFAULT="quiet intel_pstate=disable" "processor.max_cstate=1 intel_idle.max_cstate=0 idle=poll" `update-grub` **In** /etc/modprobe.d/blacklist.conf **Blacklist** intel_powerclamp **Disable** hyperthreading, CPU frequency control in BIOS - **Install i7z to check CPU** ```shell= sudo apt-get install i7z sudo i7z ``` ==C0 will be 100% and other state would be 0%==  - **Disable CPU Frequency scaling** ```shell= sudo apt-get install cpufrequtils sudo vi /etc/default/cpufrequtils ``` **Add** GOVERNOR="performance" ```shell= sudo update-rc.d ondemand disable sudo /etc/init.d/cpufrequtils restart ``` **Check** with cpufreq-info ## Set MySQL ==連線到140.114.77.76/phpmyadmin user name:**** pwd:******== ### Table <User> 1. 點擊上方Structure,將key, rand, opc的類型從varbinary改為binary 2. imsi: ==sim卡上的imsi值== 3. ms_ps_status: NOT_PURGED 4. rau_tau_timer: 120 5. mmeidentity_idmmeidentity: 46 ==這個值要看mmeidentity的數字== 6. key: ==sim卡上的key值== 7. OPc: ==sim卡上的opc值== ### Table <mmeidentity> 新增一筆 1. idmmeidentity: 46 2. mmehost: ==用cat /etc/hosts看== 3. mmerealm: domain name (ex:wmlab) 4. UE-Reachability: 0 ### Table <pdn> 1. apn: oai.ipv4 設定這個apn gw的服務 2. pgw_id: ==看pgw table的值== 3. users_imsi: ==sim卡上的imsi值== ### Table <pgw> 新增一筆 1. id: ==新增時會自己設置== 2. ipv4: ==輸入ip addr== (ex:140.114.77.76) ## Configuration ==Configuration 請參照Reference2== Next, we explain the setup for running eNB and EPC+HSS on two different hosts. Assume the IP addresses of eNB and EPC+HSS are **192.168.12.82** and **192.168.12.62** respectively. We also assume that the interface with which they are connected together is ethernet (eth0) - Configure eNB machine  mme_ip_address is network interface's IP address of your EPC/HSS, and NETWORK_INTERFACE is your eNB related network interface information - Configure EPC machine Copy EPC config files in /usr/local/etc/oai ```shell= sudo mkdir -p /usr/local/etc/oai/freeDiameter sudo cp ~/openair-cn/ETC/mme.conf /usr/local/etc/oai sudo cp ~/openair-cn/ETC/hss.conf /usr/local/etc/oai sudo cp ~/openair-cn/ETC/spgw.conf /usr/local/etc/oai sudo cp ~/openair-cn/ETC/acl.conf /usr/local/etc/oai/freeDiameter sudo cp ~/openair-cn/ETC/mme_fd.conf /usr/local/etc/oai/freeDiameter sudo cp ~/openair-cn/ETC/hss_fd.conf /usr/local/etc/oai/freeDiameter ```     ## Running ### Install certificates(not required) ```shell= cd ~/openair-cn/scripts ./check_hss_s6a_certificate /usr/local/etc/oai/freeDiameter/ hss.wmnet ./check_mme_s6a_certificate /usr/local/etc/oai/freeDiameter/ mme.wmnet ``` ### Compile & Run HSS (Always Run HSS First) ```shell= cd ~/openair-cn/scripts ./build_hss -c ``` ==!! now don't run below one !!! Run only once to install database== ```shell= ** Be careful of running this ***** ./run_hss -i ~/openair-cn/SRC/OAI_HSS/db/oai_db.sql ``` #Run this for all subsequent runs ```shell= ./run_hss ``` ### Compile & MME ```shell= cd ~/openair-cn/scripts ./build_mme -c ./run_mme ``` ### Compile & SP-GW ```shell= cd ~/openair-cn/scripts ./build_spgw -c ./run_spgw ``` ### Compile & Run eNB ```shell= cd ~/openairinterface5g source oaienv ./cmake_targets/build_oai -w USRP -x -c --eNB cd cmake_targets/lte_build_oai/build sudo -E ./lte-softmodem -O ~/openairinterface5g/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf (-d) sudo -E ./lte-softmodem -h #(to see help options) ``` 接著, 電腦插上sim卡 試試看有沒有網路 ## Reference 1. [https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/OpenAirSoftwareSupport](https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/OpenAirSoftwareSupport) 2. [https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/HowToConnectCOTSUEwithOAIeNBNew](https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/HowToConnectCOTSUEwithOAIeNBNew) 3. [ https://blog.csdn.net/wxsdr/article/details/53691763]( https://blog.csdn.net/wxsdr/article/details/53691763)
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up