Changes between Initial Version and Version 1 of Tutorials/oai-docker


Ignore:
Timestamp:
Jun 23, 2019, 4:00:40 PM (5 years ago)
Author:
nimakris
Comment:

OAI Docker Tutorial

Legend:

Unmodified
Added
Removed
Modified
  • Tutorials/oai-docker

    v1 v1  
     1
     2== Running OpenAirInterface in docker containers
     3
     4
     5=== Description
     6This tutorial will guide you through running the OpenAirInterface (OAI) platform (www.openairinterface.org) in Orbit by using docker containers.
     7
     8=== Hardware Used
     91. Grid Nodes with USRP B210
     102. Baseline image docker_oai.ndz
     11
     12=== Setup
     13
     14* To get started, make a reservation on the Orbit scheduler for using the Grid nodes. The tutorial assumes that the nodes hosting the dockers have a USRP B210 attached on them.
     15
     16* Once the reservation starts, log in to the grid console and load the image on the testbed node with the installed USRP B210. Before doing so, verify the state of all the nodes in the testbed:
     17
     18{{{
     19nimakris@console.grid:~$ omf tell -a offh -t all
     20nimakris@console.grid:~$ omf stat -t all
     21}}}
     22
     23If the nodes report in POWEROFF state, then go ahead and load the image on a USRP B210 node with the following command:
     24{{{
     25nimakris@console.grid:~$ omf load -t node13-7 -i docker_oai.ndz
     26}}}
     27
     28* After the image is loaded on the node, you need to turn it on, with the following command:
     29
     30{{{
     31nimakris@console.grid:~$ omf tell -a on -t node13-7
     32}}}
     33
     34* Once the node is up and running (you can test this by sending a ping command) log on the node as root
     35
     36{{{
     37nimakris@console.grid:~$ ssh root@node13-7
     38}}}
     39
     40=== Running the docker containers
     41
     42Scripts are installed on the node in order to facilitate running the containers. Follow the following steps:
     43
     44* Pull the images for the containers locally with:
     45{{{
     46root@node13-7:~# cd docker-containers/
     47root@node13-7:~/docker-containers# ./docker_init.sh
     48}}}
     49
     50The command will take some time as it retrieves all the containers from a registry over the Internet. Its output should be similar to the following:
     51{{{
     52root@node13-7:~/docker-containers# ./docker_init.sh
     53Images destination:      /usr/share/uhd/images
     54Downloading images from: http://files.ettus.com/binaries/images/uhd-images_003.009.002-release.zip
     55Downloading images to:   /tmp/tmp9M_J2T/uhd-images_003.009.002-release.zip
     5626296 kB / 26296 kB (100%)
     57
     58Images successfully installed to: /usr/share/uhd/images
     59linux; GNU C++ version 5.3.1 20151219; Boost_105800; UHD_003.009.002-0-unknown
     60
     61-- Loading firmware image: /usr/share/uhd/images/usrp_b200_fw.hex...
     62--------------------------------------------------
     63-- UHD Device 0
     64--------------------------------------------------
     65Device Address:
     66    type: b200
     67    name: MyB210
     68    serial: 30AD29B
     69    product: B210
     70
     71**Rest of docker output is omitted**
     72
     7339c677681ea4a6e09a293a428b4e2fc84baf4906158edfac9f2000e02ad7ea15
     741400ca2f0bcbdaf2b91c53a866673dd018ae30fb11da20fed1692bedc2ea5d20
     757f80be2cbdc4f23a65a969740cd7cdea22a69d180ef41c1423e9ccd13bfb7db3
     76316ac2399384baa5fbf94163be2e0a8f35bb30d75cf356183b67701f72d48802
     777f1b5f0dfb2e2a16ab1516f7acd0b5b0916819680d8ad629181bd543cb827616
     78be9d5e88c14f48ff9d2332c5ce88f14ae7814e7fb9ffa1492ed276628dbc4ff9
     79289436b174e36140fac36c0d01320710fab570ab89fec2c6a088f791d7d9b758
     80hss
     81mme_spgw
     82mec
     83oai_ran
     84wifidu
     85mec_service
     86oai_enb
     87}}}
     88
     89Once the process has ended the images are located locally on the machine. Verify that the following command shows images located locally:
     90
     91{{{
     92root@node13-7:~/docker-containers# docker images
     93REPOSITORY                                     TAG                 IMAGE ID            CREATED             SIZE
     94repo.nitlab.inf.uth.gr:5000/oai/oai_ran        version20           49dbf718a92c        4 hours ago         5.96GB
     95repo.nitlab.inf.uth.gr:5000/oai/mec_app        version20           12bc647ec4aa        3 days ago          204MB
     96repo.nitlab.inf.uth.gr:5000/oai/mec_agent      version20           17959ec65057        3 days ago          965MB
     97repo.nitlab.inf.uth.gr:5000/oai/oai_ran_du     version20           54ca1d78946d        3 days ago          3.79GB
     98repo.nitlab.inf.uth.gr:5000/oai/oai_mme_spgw   version20           71c00e425751        3 days ago          1.67GB
     99repo.nitlab.inf.uth.gr:5000/oai/oai_hss        version20           17a308a08eca        3 days ago          1.72GB
     100repo.nitlab.inf.uth.gr:5000/oai/wifidu         version20           9d33b7d67d2d        3 days ago          549MB
     101}}}
     102
     103Also, the following command should show that no docker is currently running
     104
     105{{{
     106root@node13-7:~/docker-containers# docker ps
     107CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES
     108}}}
     109
     110* Now you are ready to launch the services, in order to deploy 3 dockers for running the HSS, MME/S-PGW and the eNodeB. In order to do so, run the following:
     111
     112{{{
     113root@node13-7:~/docker-containers# ./autostart_dockers -p 46099
     114PLMNID is 46099
     115Starting all docker containers..
     116HSS Docker started successfully..
     117MME & S-/P-GW Docker started successfully..
     118Turning on the USRP device
     119Turing on USRP device
     120Will start the OAI eNB Container
     121OAI eNB docker started successfully..
     122Starting the API on the HSS contaner..
     123Generating configuration on the HSS container.
     124Starting HSS on the container
     125Waiting for 10 seconds for the HSS to start correctly..
     126Starting the API on the MME & S-/P-GW contaner..
     127Generating configuration on the EPC container.
     128Starting EPC on the container
     129Starting the API on the OAI eNB..
     130Generating configuration on the OAI eNB container.
     131Starting OAI RAN on the container
     132}}}
     133
     134The script launches all the containers and dynamically sets up their configuration files. This example is using as a PLMNID the 46099, but you can pass as an argument different PLMNIDs to match your UEs. If you want to change the PLMNID, open the autostart_dockers file and add the respective information for your OP code.
     135
     136* Verify that all the dockers are running correctly by using the following command:
     137
     138{{{
     139root@node13-7:~/docker-containers# docker ps
     140CONTAINER ID        IMAGE                                                    COMMAND             CREATED             STATUS              PORTS               NAMES
     141be9d5e88c14f        repo.nitlab.inf.uth.gr:5000/oai/oai_mme_spgw:version20   "bash"              6 minutes ago       Up 3 minutes                            mme_spgw
     1427f80be2cbdc4        repo.nitlab.inf.uth.gr:5000/oai/oai_ran:version20        "bash"              6 minutes ago       Up 3 minutes                            oai_enb
     14339c677681ea4        repo.nitlab.inf.uth.gr:5000/oai/oai_hss:version20        "bash"              6 minutes ago       Up 3 minutes                            hss
     144}}}
     145
     146You can also attach to the eNB docker to verify that OAI is running correctly the eNodeB with the following command:
     147
     148{{{
     149root@node13-7:~/docker-containers# docker exec -ti oai_enb tail -f /tmp/oai.log
     150[PHY]   thread rxtx created id=79
     151[HW]   [SCHED][eNB] eNB_thread_prach started on CPU 0, sched_policy = SCHED_FIFO , priority = 99, CPU Affinity= CPU_0 CPU_1 CPU_2 CPU_3 CPU_4 CPU_5 CPU_6 CPU_7
     152ALL RUs ready - ALL eNBs ready
     153[HW]   [SCHED][eNB] eNB_thread_prach_br started on CPU 0, sched_policy = SCHED_FIFO , priority = 99, CPU Affinity= CPU_0 CPU_1 CPU_2 CPU_3 CPU_4 CPU_5 CPU_6 CPU_7
     154[PHY]   ru_thread_prach() RACH waiting for RU to be configured
     155[PHY]   ru_thread_prach() RU configured - RACH processing thread running
     156Sending sync to all threads
     157TYPE <CTRL-C> TO TERMINATE
     158Entering ITTI signals handler
     159got sync (ru_thread)
     160}}}
     161
     162
     163* Once your experiment ends, you can bring down safely all the dockers with:
     164
     165{{{
     166root@node13-7:~/docker-containers# ./autostart_dockers -s
     167
     168OAI eNB docker stopped
     169MME & S-/P-GW docker stopped
     170HSS docker stopped
     171}}}
     172
     173* You can also delete all the local images in order to save space before saving the node image with the following command:
     174{{{
     175root@node13-7:~/docker-containers# ./destroy_all_dockers.sh
     176}}}
     177
     178=== Running the MEC over FH experiment in dockers
     179
     180You can also run the experiment over dockers for the setup that is presented in the following papers: [https://nitlab.inf.uth.gr/NITlab/papers/Makris-Passas-CloudRAN-MEC-LANMAN2019.pdf "On Minimizing Service Access Latency: Employing MEC on the Fronthaul of Heterogeneous 5G Architectures"], [https://nitlab.inf.uth.gr/NITlab/papers/p15-makris-passas-MEC.pdf "Employing MEC in the Cloud-RAN: an Experimental Analysis"], [https://nitlab.inf.uth.gr/NITlab/papers/Makris_Cloud_based_convergence_of_disaggregated_bs.pdf "Cloud-based convergence of heterogeneous RANs in 5G disaggregated architectures"]
     181
     182The configuration is integrating WiFi at the PDCP layer of OAI, and also a MEC agent that allows traffic from the same UE attached to the LTE and WiFi networks to reach a service deployed on the MEC agent. MEC traffic goes up to the PDCP layer of the stack.
     183
     184The setup will deploy dockers over the node using two different networks, based on the following architecture.
     185
     186[[Image()]]
     187
     188NOTE: Verify the MAC address for the WiFi device that you will use at the UE part of the network, and place it in the autostart_dockers script at the CLIENT_MAC variable.
     189
     190* Start the containers with the following command:
     191
     192{{{
     193root@node13-7:~/docker-containers# ./autostart_dockers -p 46099 --mec
     194PLMNID is 46099
     195Running with MEC enabled
     196Starting all docker containers..
     197HSS Docker started successfully..
     198MME & S-/P-GW Docker started successfully..
     199MEC Application Docker started successfully..
     200MEC Agent Docker started successfully..
     201Attaching WiFi device on the docker
     202WiFi DU Docker started successfully..
     203Turning on the USRP device
     204Turing on USRP device
     205Will start the OAI RAN Container
     206OAI RAN Docker started successfully..
     207Starting the API on the HSS contaner..
     208Generating configuration on the HSS container.
     209Starting HSS on the container
     210Waiting for 10 seconds for the HSS to start correctly..
     211Starting the API on the MME & S-/P-GW contaner..
     212Generating configuration on the EPC container.
     213Starting EPC on the container
     214Collecting the required information from applications..
     215Starting MEC Agent software
     216/root/mec_daemon.rb start -- -m 172.18.0.4 -p 50000 -d 02:42:ac:10:00:05
     217Starting hostapd and DU agent on the WiFi DU
     218/root/wifidu_daemon.rb start -- -a 172.18.0.5 -m 172.18.0.4 -p 50000 -d 7c:c3:a1:a8:09:6b
     219Starting the API on the OAI RAN (CU&DU)..
     220Generating configuration on the OAI RAN container.
     221Starting OAI RAN on the container
     222}}}
     223
     224* You can verify that OAI is running in the docker by attaching to it and dumping the log file:
     225
     226{{{
     227root@node13-7:~# docker exec -ti oai_ran tail -f /tmp/oai-du.log
     228
     229[HW][I][SCHED][eNB] RX thread 9 started on CPU 1 TID 98, sched_policy = SCHED_FIFO, priority = 98, CPU Affinity =  CPU_0 CPU_1 CPU_2 CPU_3 CPU_4 CPU_5 CPU_6 CPU_7
     230Creating main eNB_thread
     231[HW][I][SCHED][eNB] Started eNB main thread on CPU 4 TID 99 , sched_policy = SCHED_FIFO, priority = 99, CPU Affinity =  CPU_0  CPU_1  CPU_2  CPU_3  CPU_4  CPU_5  CPU_6  CPU_7
     232eNB_thread: mlockall in ...
     233eNB_thread: mlockall out ...
     234waiting for sync (eNB_thread)
     235Sending sync to all threads
     236TYPE <CTRL-C> TO TERMINATE
     237Entering ITTI signals handler
     238got sync (eNB_thread)
     239PROTO_AGENT Creating a new link client socket connecting to 172.18.0.6:2210
     240PROTO_AGENT Creating a new link client socket connecting to 172.18.0.5:2210
     241PROTO_AGENT Creating a new link client socket connecting to 172.18.0.4:50000
     242}}}
     243
     244If you see an output similar to the above, then the dockers are running correctly.
     245
     246**NOTE: If you receive a TX_THREAD busy error, stop and restart all dockers. As this setup is based on an older code of OAI, it consumes significantly more resources. Try to run it on a powerful node of the testbed (e.g. Intel Core Gen8), as it is more stable.**
     247
     248* Now, you can go ahead and attach a multi-homed UE to the node. You can attach a multihomed UE as usually to the LTE network. For the WiFi part, connect to the "FLEXSPLIT" network and setup the address to be the same as the LTE UE.
     249
     250* You can try to ping either services after the MME (172.16.0.1) or services placed in the mec_service docker at the 172.16.0.5 address.
     251
     252* Once your experiment ends, you can bring down safely all the dockers with:
     253
     254{{{
     255root@node13-7:~/docker-containers# ./autostart_dockers -s
     256
     257OAI eNB docker stopped
     258MME & S-/P-GW docker stopped
     259HSS docker stopped
     260}}}
     261
     262* You can also delete all the local images in order to save space before saving the node image with the following command:
     263{{{
     264root@node13-7:~/docker-containers# ./destroy_all_dockers.sh
     265}}}