Tutorial on how to run OAI in docker (only tested on 14.04)
Note: We assume that you have already run OAI natively on other machines using other tutorials
Make sure you are running 3.19.xxx-lowlatency kernel on Linux
For new implementation of EPC with kernel 4.7x, please refer to here
Installation from scratch
Install Docker, https://docs.docker.com/engine/installation/linux/ubuntulinux/
Note: Current installation assumes that eNB and RRH are running on two seperate containers in same PC. We also assume that EPC is running on a physically separate machine
Pre-installed Docker images
Setup eNB Docker Image
sudo docker run -t -i --privileged --rm --name="oai5g_enb" -v /dev/bus/usb:/dev/bus/usb ubuntu:14.04
The above command will open a shell inside docker container.
#Following commands need be run inside docker container
apt-get update
apt-get install software-properties-common git wget psmisc -y
GIT_SSL_NO_VERIFY=true git clone https://gitlab.eurecom.fr/oai/openairinterface5g.git
cd openairinterface5g
git checkout develop
git pull
source oaienv
cd cmake_targets
./build_oai -w USRP -I
#There might be some errors in installation but its okay.
#verify that USRP is working
uhd_usrp_probe
Setup RRH Docker Image
sudo docker run -t -i --privileged --rm --name="oai5g_rrh" -v /dev/bus/usb:/dev/bus/usb ubuntu:14.04
The above command will open a shell inside docker container.
#Following commands need be run inside docker container
apt-get update
apt-get install software-properties-common git wget psmisc -y
GIT_SSL_NO_VERIFY=true git clone https://gitlab.eurecom.fr/oai/openairinterface5g.git
cd openairinterface5g
git checkout develop
git pull
source oaienv
cd cmake_targets
./build_oai -w USRP -I
#There might be some errors in installation but its okay.
#verify that USRP is working
uhd_usrp_probe
Setup EPC Docker Image
sudo docker run -t -i --rm -P --privileged --cap-add=ALL -v /dev:/dev -v /lib/modules:/lib/modules -h "yang" --name="oai_epc" ubuntu:14.04 /bin/bash
The above command will open a shell inside docker container.
#Following commands need be run inside docker container
apt-get update
apt-get install software-properties-common git wget psmisc -y
GIT_SSL_NO_VERIFY=true git clone https://gitlab.eurecom.fr/oai/openair-cn.git
cd openair-cn/SCRIPTS
git checkout develop
git pull
./build_mme -i
./build_hss -i
./build_spgw -i
/etc/init.d/mysqld restart
#Configure the database/EPC Config files. See https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/HowToConnectCOTSUEwithOAIeNBNew
Configure docker bridge to use very large MTU (Required if running RRH in raw transport mode)
-
Assuming that you are using default docker configuration. Docker creates default bridge docker0 with 1500 as its MTU. For every new container it adds virtual Ethernet adapter vethxxx which connects to this bridge.
-
We assume that eNB and RRH containers are connected by vetheNB and vethRRH. These interfaces are dynamically created by docker. You can see the list of interfaces via ifconfig
-
Carry out the following instructions in the same order(ONLY ON HOST MACHINE). If there is error in steps below, you need to figure out problems with your docker installation.
sudo apt-get install bridge-utils
brctl show docker0 #Check the virtual interfaces attached to docker0
sudo ifconfig vetheNB mtu 9000 up
sudo ifconfig vethRRH mtu 9000 up
sudo ifconfig docker0 mtu 9000 up
Useful links:
https://joshua.hoblitt.com/rtfm/2014/05/dynamically_changing_the_mtu_of_a_linux_bridge_interface/
https://docs.docker.com/v1.5/articles/networking/#bridge-building
Important Notes:
-
Once the above steps are carried out, you can follow instructions from other tutorials, https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/OpenAirUsage to configure config files, etc
-
If you encounter real-time issues/errors on RRH/eNodeB, then use 5MHz. Always use latest develop branch.
-
Config file for RRH (5Mhz), $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf
-
Config file for RRH (10Mhz), $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.rrh.usrpb210.conf
-
If you see lot of errors, "out of order packet received", the comment the following line and recompile on both RRH/eNodeB image, https://gitlab.eurecom.fr/oai/openairinterface5g/blob/develop/targets/ARCH/ETHERNET/USERSPACE/LIB/eth_udp.c#L301
-
Make sure that USRP turn on (green/red lights) once RRH starts!
-
If you have errors running mysqld in privileged container like this "/usr/sbin/mysqld: error while loading shared libraries: libaio.so.1: cannot open shared object file: Permission denied" , then do the following steps:
-
Search and remove all mysql installation from host machine. You can search mysql packages as
dpkg -l |grep mysql sudo ln -s /etc/apparmor.d/usr.sbin.mysqld /etc/apparmor.d/disable/ sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.mysqld sudo /etc/init.d/apparmor restart sudo aa-status #Should not have mysql here
- After the above steps, try to re-start mysql-server in docker container
### ToDo:
1. Tests for other RF targets
1. Throughput tests/performance of OAI inside containers
1. Upload pre-built docker images for eNB/RRH and EPC and also create dockerfile for automated image building
1. Instructions on running inside lxc/kvm, etc