Skip to content

Pilot prototype on vim emu

Manuel Peuster edited this page Feb 27, 2019 · 55 revisions

This page is crated by @mpeuster and is used to document the developments of the first pilot prototype, deployed on vim-emu. This is a living document until the prototype is ready.

Pointers to Issues / Todos

Collection of pointers to related issues among different repositories:

Main issue: 1st working demo (for F2F in Dublin)

Pointers to Artifacts

Overview

The following figure captures technical details (mostly networking) of the current prototype:

Tech.Overview

Full Figure

Data Flow

The following figure shows the data flow of the current prototype: Data Flow

Full Figure

Walkthrough

Documents how to deploy and run the pilot on the emulator.

Requirements:

  • Python2 (vim-emu), Python3 (5GTANGO SDK)
  • bare-metal installation of vim-emu
  • installation of 5GTANGO SDK tools
  • local clone of this repository

Deploy NS1 and NS2 on emulator

Step 0: Prepare VNF containers

In a first terminal window, on the machine on which the emulator is installed, do:

git clone https://github.com/sonata-nfv/tng-industrial-pilot.git
cd tng-industrial-pilot/vnfs
./build_emulator_vnfs.sh

This will build all necessary VNFs (Docker containers) that will be used during this demo.

Step 1: Start emulator

In a first terminal window, start the emulator and keep it open:

# Switch to vim-emu folder
$ cd ~/vim-emu
# Start emulator (Attention: Emulator needs Python2 and root access)
$ sudo python2 examples/tango_default_cli_topology_2_pop.py

Step 2: Create service package

In a second terminal window (in which the Python virtualenv in which you installed the 5GTANGO SDK is active), do:

# switch to the sdk-projects folder of this repository
(venv)$ cd ~/tng-industrial-pilot/sdk-projects/
# package the network services
(venv)$ tng-pkg -p tng-smpilot-ns1-emulator/
(venv)$ tng-pkg -p tng-smpilot-ns2-emulator/

The service package file eu.5gtango.tng-smpilot-ns1-emulator.0.1.tgo and eu.5gtango.tng-smpilot-ns2-emulator.0.1.tgo are created.

Step 3: On-board services to emulator

Upload the service packages to the running vim-emu instance:

(venv)$ ./on-board-ns1.sh
(venv)$ ./on-board-ns2.sh

Step 4: Instantiate services on emulator

Trigger the instantiation of the uploaded services:

(venv)$ ./instantiate-ns1.sh
(venv)$ ./instantiate-ns2.sh

Wait some seconds until the services are up and running.

Note: Step 3 and 4 can be simplified with the helper script (attention: the script also performs Step 6) ./deploy_pilot_on_local_emulator.sh

Step 5: Check service deployment

Check the service status using the vim-emu client (in a third terminal window):

$ vim-emu compute list
# output:
+--------------+---------------+-----------------------------------+------------------+-------------------------------------+
| Datacenter   | Container     | Image                             | Interface list   | Datacenter interfaces               |
+==============+===============+===================================+==================+=====================================+
| dc2          | vnf_eae.cdu01 | sonatanfv/vnf-eae:vimemu          | mgmt,data        | dc2.s1-eth2,dc2.s1-eth3             |
+--------------+---------------+-----------------------------------+------------------+-------------------------------------+
| dc2          | vnf_dt.cdu01  | sonatanfv/vnf-dt:vimemu           | mgmt,data        | dc2.s1-eth7,dc2.s1-eth8             |
+--------------+---------------+-----------------------------------+------------------+-------------------------------------+
| dc2          | vnf_rtr.cdu01 | sonatanfv/vnf-rtr-nat:vimemu      | mgmt,data,uplink | dc2.s1-eth4,dc2.s1-eth5,dc2.s1-eth6 |
+--------------+---------------+-----------------------------------+------------------+-------------------------------------+
| dc1          | vnf_cc.cdu03  | ubuntu:trusty                     | mgmt,data        | dc1.s1-eth6,dc1.s1-eth7             |
+--------------+---------------+-----------------------------------+------------------+-------------------------------------+
| dc1          | vnf_cc.cdu02  | sonatanfv/vnf-cc-processor:vimemu | mgmt,data        | dc1.s1-eth4,dc1.s1-eth5             |
+--------------+---------------+-----------------------------------+------------------+-------------------------------------+
| dc1          | vnf_cc.cdu01  | sonatanfv/vnf-cc-broker:vimemu    | mgmt,data        | dc1.s1-eth2,dc1.s1-eth3             |
+--------------+---------------+-----------------------------------+------------------+-------------------------------------+
| dc1          | vnf_mdc.cdu01 | sonatanfv/vnf-mdc:vimemu          | mgmt,data        | dc1.s1-eth8,dc1.s1-eth9             |
+--------------+---------------+-----------------------------------+------------------+-------------------------------------+

Step 6: Test the deployment:

# follow logs of cc
docker exec -it mn.vnf_cc.cdu02 tail -f /var/cc.log

# alternative
docker exec -it mn.vnf_cc.cdu02 mosquitto_sub -h 30.0.0.1 -p 1883 -v -t WIMMS/+/+

Step 8: Terminate the services:

ATTANTION: It is important to terminate the services before the emulator is stopped, to ensure that the DT correctly unmounts the shared folder. Otherwise vim-emu and the DT container will hang!

# helper script (in sdk-projects/)
./terminate_pilot_on_local_emulator.sh

Notes

Manually interconnect the two services

Do the following to interconnect the two network services:

# do a containernet> dump or containernet> links to the to wich switch port the router's 'uplink' interface connects
containernet> dc2.s1 ovs-vsctl set port dc2.s1-eth6 tag=2

Explanation: The networks of the services are separated with VLANs in vim-emu. With this command we connect the 'uplink' interface of the router to the VLAN of NS1 (tag=2).

This is automatically done by ./instantiate-ns2.sh.

LOGs of server processes running in the Dockers:

# DT: IMMS APP
/var/imms.log
# MDC: Samba
/var/smb.log
# MDC: MDC APP
/var/mdc.log
# CC: Broker
/var/mosquitto.log
# CC: Processor
/var/cc.log

Checks

# check if the RTR (NS2) can ping CC (NS1)
docker exec -it mn.vnf_rtr.cdu01 ping 30.0.0.1
# check if the MDC (NS2) can ping CC (NS1)
docker exec -it mn.vnf_mdc.cdu01 ping 30.0.0.1
# check if the MDC (NS2) publishes random data to the CC (NS1) broker
docker exec -it mn.vnf_cc.cdu02 mosquitto_sub -h 30.0.0.1 -p 1883 -v -t machines/+/sensors/+
# or (with real MDC)
docker exec -it mn.vnf_cc.cdu02 mosquitto_sub -h 30.0.0.1 -p 1883 -v -t WIMMS/+/+
# or (with real CC)
docker exec -it mn.vnf_cc.cdu02 tail -f /var/cc.log

...