-
Notifications
You must be signed in to change notification settings - Fork 17
Pilot prototype on vim emu
This page is crated by @mpeuster and is used to document the developments of the smart manufacturing pilot prototype, deployed on vim-emu. This is a living document until the prototype is ready. A more complex version of this prototype was shown at IEEE NetSoft 2019.
-
VNFs
-
Descriptor projects (network services and VNFDs)
The following figure captures technical details (mostly networking) of the current prototype:
The following figure shows the data flow of the current prototype:
This section describes how to prepare an empty Ubuntu machine to become an execution environment for the pilot prototype.
- about 4 CPU cores, 8 GB mem, 100GB disk (less might work, but won't be fun)
- Ubuntu 18.04 LTS (fresh!)
- Python2 system wide
- vim-emu
- Python3 SDK venv:
- 5GTANGO SDK (project, validate, package)
- tng-cli
- First run
sudo apt-get install python-backports.ssl-match-hostname
andsudo apt remove ufw
- Then follow this guide. Manual installation with option 1 "bare metal".
- Finally
cd ~/vim-emu
andsudo python setup.py develop
Following this guide, do:
cd ~/
# install virutalenv
sudo apt install virtualenv
# find out the path to your python3
which python3
# create a fresh virtualenv
virtualenv -p <path_to_python3> venv_tango_sdk
# activate the virtualenv
source venv_tango_sdk/bin/activate
# install tng-sdk-project
pip3 install git+https://github.com/sonata-nfv/tng-sdk-project.git
# install tng-sdk-validator
pip3 install git+https://github.com/sonata-nfv/tng-sdk-validation.git
# install tng-sdk-package
pip3 install git+https://github.com/sonata-nfv/tng-sdk-package
# install tng-cli
pip3 install git+https://github.com/sonata-nfv/tng-cli
Clone this repo to get all the demo materials:
git clone https://github.com/sonata-nfv/tng-industrial-pilot.git
Build the VNF containers (that might take time, be patient)
cd ~/tng-industrial-pilot/vnfs/
sudo ./build_docker_vnfs.sh
Done. Your machine is now prepared to execute the walkthrough.
Documents how to deploy and run the pilot on the emulator.
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_docker_vnfs.sh
This will build all necessary VNFs (Docker containers) that will be used during this demo.
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
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.
Upload the service packages to the running vim-emu instance:
(venv)$ ./on-board-ns1.sh
(venv)$ ./on-board-ns2.sh
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
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_mdc.cdu01.0 | sonatanfv/vnf-mdc:vimemu | data | dc2.s1-eth5 |
+--------------+-----------------+--------------------------------------+------------------+-------------------------+
| dc2 | vnf_cc.cdu04.0 | sonatanfv/vnf-cc-database:vimemu | data | dc2.s1-eth4 |
+--------------+-----------------+--------------------------------------+------------------+-------------------------+
| dc2 | vnf_eae.cdu01.0 | sonatanfv/vnf-eae:vimemu | data | dc2.s1-eth2 |
+--------------+-----------------+--------------------------------------+------------------+-------------------------+
| dc2 | vnf_cc.cdu02.0 | sonatanfv/vnf-cc-processor:vimemu | data | dc2.s1-eth3 |
+--------------+-----------------+--------------------------------------+------------------+-------------------------+
| dc1 | vnf_cc.cdu03.0 | sonatanfv/vnf-cc-mqttexporter:vimemu | data | dc1.s1-eth3 |
+--------------+-----------------+--------------------------------------+------------------+-------------------------+
| dc1 | vnf_dt.cdu01.0 | sonatanfv/vnf-dt:vimemu | data | dc1.s1-eth6 |
+--------------+-----------------+--------------------------------------+------------------+-------------------------+
| dc1 | vnf_cc.cdu01.0 | sonatanfv/vnf-cc-broker:vimemu | data | dc1.s1-eth2 |
+--------------+-----------------+--------------------------------------+------------------+-------------------------+
| dc1 | vnf_rtr.cdu01.0 | sonatanfv/vnf-rtr-nat:vimemu | data,uplink | dc1.s1-eth4,dc1.s1-eth5 |
+--------------+-----------------+--------------------------------------+------------------+-------------------------+
# follow logs of cc processor
docker exec -it mn.vnf_cc.cdu02.0 tail -f /var/cc.log
# follow logs of cc mqtt exporter
docker exec -it mn.vnf_cc.cdu03.0 tail -f /var/mqe.log
# alternative: directly subscribe to broker
docker exec -it mn.vnf_cc.cdu02.0 mosquitto_sub -h 30.0.0.1 -p 1883 -v -t WIMMS/+/+
Use your browser and go to the Prometheus Dashboard to view the recorded metrics:
- http://127.0.0.1:9090
- http://{your-host}:9090
Select metric wimms_em63_actsimpara2
and press execute.
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
Do the following to interconnect the two network services:
sudo ovs-vsctl set port dc1.s1-eth5 tag=1
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
.
# 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
# check if the RTR (NS2) can ping CC (NS1)
docker exec -it mn.vnf_rtr.cdu01.0 ping 30.0.0.1
# check if the MDC (NS2) can ping CC (NS1)
docker exec -it mn.vnf_mdc.cdu01.0 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.0 mosquitto_sub -h 30.0.0.1 -p 1883 -v -t machines/+/sensors/+
# or (with real MDC)
docker exec -it mn.vnf_cc.cdu02.0 mosquitto_sub -h 30.0.0.1 -p 1883 -v -t WIMMS/+/+
# or (with real CC)
docker exec -it mn.vnf_cc.cdu02.0 tail -f /var/cc.log
...