This page provides technical information about the VPP based VNFs in the vCPE use case for ONAP R1.
The information builds upon, and updates in some areas, the information documented here: ONAP vCPE VNF Installation Guide v1.docx
The VPP based VNFs to be covered are:
- vBRG
- vBNG
- vG-MUX
- vGW
Preparing the vCPE VPP VNF Images
The VNFs are instantiated by a heat template and environment file which starts with a plain Ubuntu 16.04 image and then proceeds to build the VPP code and, in several cases, the Honeycomb agent code for the VNF.
The compilation of these components is time consuming (30+ minutes) and occasionally unsuccessful. So, the plan is to create snapshot images for each VNF with the time consuming VPP and Honeycomb code pre-built.
Building a pre-built VNF Image
Using the vG-MUX as an example, the following steps are used to create a vG-MUX image which can then be used as the image for instantiating a vG-MUX VNF.
- Manually configure the .yaml file to not run the install script
- Comment out the last line of base_vcpe_vgmux.yaml (i.e. do not invoke v_gmux_install.sh via the yaml)
- Create a 'stack' - using an appropriately populated .env file
- openstack stack create -t base_vcpe_vgmux.yaml -e base_vcpe_vgmux.env vGMUX
- Log into the VM as the 'ubuntu' user and switch to the 'root' user
- sudo su -
- cd /opt
- Create the file "/opt/config/compile_state.txt" with the contents of "build"
- From /opt, invoke the install script
- ./v_gmux_install.sh
- This will build vpp and honeycomb code, it may take 30-40 minutes
- Clean up some files not required for the final image (this will save several gigabytes):
- rm -fr /opt/vpp /opt/hc2vpp /opt/demo
Edit the file "/opt/config/compile_state.txt" and change the contents of the file to "done"
Note: In the case of the vbrg emulator, the file /opt/config/compile_state.txt is created by
the base_vcpe_vbrg.yaml file. The compile state (done, auto or build) can be passed into
the vbrg env file before the VNF is created.Compile State Description Done Use a prebuilt image. Install script sets up the environment Auto Install script builds honeycomb and vpp and sets up the environment Build Install script builds honeycomb and vpp - Reboot
- Save an image of the VNF
- openstack server image create --name vgmux-base-ubuntu-16-04 <VM Name or ID>
- "vgmux-base-ubuntu-16-04" will be the name of the new vG-MUX image
Instantiate a VNF based on the pre-built Image
- Change the .env file to use the VNF image created using the process described above.
- For example - replace "ubuntu-16-04-cloud-amd64" with "vgmux-base-ubuntu-16-04" in "vcpe_vgmux.env"
- Ensure the .yaml file does not have the install script commented out
- For example, ensure "v_gmux_install.sh" is not commented out in "base_vcpe_vgmux.yaml"
- Create a 'stack'
- openstack stack create -t base_vcpe_vgmux.yaml -e base_vcpe_vgmux.env vGMUX
- Note, remove the "vGMUX" stack that was created during the "Building a VNF Image" stage
- Using the image created above, the install script will perform some configuration steps and complete much more quickly since the VPP and Honeycomb code has already been compiled.
Pre-built VNF images available
Prebuilt images in the ONAP-vCPE, Integration and Integraiont-SB01 Projects (as of 11/13/2017):
VNF | Image Name |
---|---|
vBRG | vbrg-base-ubuntu-16-04 |
vBNG | vbng-base-ubuntu-16-04 |
vG-MUX | vgmux2-base-ubuntu-16-04 |
vGW | vgw-base-ubuntu-16-04 |
VNF Specific Usage Information
vG-MUX VES Configuration and Usage Information
The vG-MUX provides integrated VES functionality to generate sample events for demonstrating ONAP closed loop functionality. The VES functionality can be configured via command line (CLI) or via the Honeycomb agent.
Configuration of VES via CLI
Configure VES agent to generate events
vppctl set ves agent server 127.0.0.1 port 88 intval 20
Query VES agent configuration
vppctl show ves agent
Modify VES agent configuration (2 steps - delete, then configure)
vppctl set ves agent del server 127.0.0.1 port 88 intval 20
vppctl set ves agent server 127.0.0.1 port 95 intval 30
The VES can be configured to generate events in 'real' or 'demo' mode. In 'demo' mode, the value of the 'Packet Loss Rate' attribute can be configured.
Configure VES mode to 'demo' and 40% Packet Loss Rate
vppctl set ves mode demo base 40
This will cause events to be generated with output data that looks like the following sample.
Note that 'sourceId' and 'sourceName' are populated with the value of the 'vnf_id' metadata.
Also note that Packet-Loss-Rate has a value of "40.0" per the example configuration command shown above.
The ves mode can be changed as desired to modify the Packet-Loss-Rate value.
Configuration of VES via Honeycomb
Sample 'curl' commands executed from the VM (i.e. 127.0.0.1) are shown to configure the VES agent and mode.
Configure the VES agent
curl -i -H "Content-Type:application/json" --data '{"config":{"server-addr":"127.0.0.1","server-port":80,"read-interval":10,"is-add":1}}' -X POST -u admin:admin http://127.0.0.1:8183/restconf/config/vesagent:vesagent
Delete the VES agent configuration (must be done before changing the configuration)
curl -i -H "Content-Type:application/json" -X DELETE -u admin:admin http://127.0.0.1:8183/restconf/config/vesagent:vesagent/config
Query the VES agent configuration
curl -i -H "Content-Type:application/json" -X GET -u admin:admin http://127.0.0.1:8183/restconf/operational/vesagent:vesagent/config
Configure the VES mode to 'demo' and 40% packet loss
curl -i -H "Content-Type:application/json" --data '{"mode":{"working-mode":"demo","base-packet-loss":40}}' -X POST -u admin:admin http://127.0.0.1:8183/restconf/config/vesagent:vesagent
Delete the VES mode (need to delete before changing it via Honeycomb)
curl -i -H "Content-Type:application/json" -X DELETE -u admin:admin http://127.0.0.1:8183/restconf/config/vesagent:vesagent/mode
Query the VES mode configuration
curl -i -H "Content-Type:application/json" -X GET -u admin:admin http://127.0.0.1:8183/restconf/operational/vesagent:vesagent/mode
Configuring vBRG and vG-MUX via REST from SDNC
The following are sample configurations made to the VNFs running in the ONAP lab.
These are curl commands issued from the SDNC VM to the vBRG and vG-MUX respectively.
In order to allow allow the SDNC VM to talk to the vBRG via it's WAN IP address, the following routing entry was made on the SDNC VM.
10.3.0.0/24 is the subnet for the vBRG and 10.0.1.10 is the ONAP OAM address of the vBNG.
ubuntu@vm-vcpe-sdnc:~$ route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
...
10.3.0.0 10.0.1.10 255.255.255.0 UG 0 0 0 eth0
...
Configuration to the vBRG
Create VXLAN port for tunnel to the vG-MUX
curl -H 'Content-Type: application/json' -H 'Accept: application/json' -u admin:admin -X PUT -d '{"interface":[{"name":"vxlanTun0", "type":"v3po:vxlan-tunnel", "enabled":"true", "link-up-down-trap-enable": "enabled", "vxlan":{"src":"10.3.0.9", "dst":"10.1.0.20", "vni":"100", "encap-vrf-id":"0"}}]}' http://10.3.0.9:8183/restconf/config/ietf-interfaces:interfaces/interface/vxlanTun0
Add the VXLAN port to the bridge-domain
curl -H 'Content-Type: application/json' -H 'Accept: application/json' -u admin:admin -X PUT -d '{'l2':{"bridge-domain":"bridge-domain-10" , "bridged-virtual-interface": false, "split-horizon-group": 2}}' http://10.3.0.9:8183/restconf/config/ietf-interfaces:interfaces/interface/vxlanTun0/v3po:l2
Configuration to the vG-MUX
Create VXLAN port for tunnel to vBRG
curl -H 'Content-Type: application/json' -H 'Accept: application/json' -u admin:admin -X PUT -d '{"interface":[{"name":"vxlanTun1", "type":"v3po:vxlan-tunnel", "enabled":"true", "link-up-down-trap-enable": "enabled", "vxlan":{"src":"10.1.0.20", "dst":"10.3.0.9", "vni":"100", "encap-vrf-id":"0"}}]}' http://10.0.101.20:8183/restconf/config/ietf-interfaces:interfaces/interface/vxlanTun1
Create VXLAN port for tunnel to vGW
curl -H 'Content-Type: application/json' -H 'Accept: application/json' -u admin:admin -X PUT -d '{"interface":[{"name":"vxlanTun0", "type":"v3po:vxlan-tunnel", "enabled":"true", "link-up-down-trap-enable": "enabled", "vxlan":{"src":"10.5.0.20", "dst":"10.5.0.21", "vni":"100", "encap-vrf-id":"0"}}]}' http://10.0.101.20:8183/restconf/config/ietf-interfaces:interfaces/interface/vxlanTun0
Create XConnect between the two VXLAN tunnels
curl -H 'Content-Type: application/json' -H 'Accept: application/json' -u admin:admin -X PUT -d '{"l2":{"xconnect-outgoing-interface":"vxlanTun1"}}' http://10.0.101.20:8183/restconf/config/ietf-interfaces:interfaces/interface/vxlanTun0/v3po:l2
curl -H 'Content-Type: application/json' -H 'Accept: application/json' -u admin:admin -X PUT -d '{"l2":{"xconnect-outgoing-interface":"vxlanTun0"}}' http://10.0.101.20:8183/restconf/config/ietf-interfaces:interfaces/interface/vxlanTun1/v3po:l2
Configuration of routing entry from vG-MUX to the vBRG via the vBNG
Configure static route from vG-MUX to vBRG via the vBNG
curl -H 'Content-Type: application/json' -H 'Accept: application/json' -u admin:admin -X PUT -d '{ "routing-protocol":[ { "name":"learned-protocol-0", "description":"static route to vbrg", "enabled":"true", "type":"hc2vpp-ietf-routing:static", "vpp-protocol-attributes": { "primary-vrf": "0"}, "static-routes":{ "ipv4":{ "route":[ { "id":1, "description":"static route to vbrg", "destination-prefix":"10.3.0.9/32", "next-hop":"10.1.0.10", "outgoing-interface":"GigabitEthernet0/4/0" }]}}}]}' http://10.0.101.20:8183/restconf/config/hc2vpp-ietf-routing:routing/routing-instance/vpp-routing-instance/routing-protocols/routing-protocol/learned-protocol-0
Alternatively, a generic route to the subnet could be done:
CLI command to static route
vppctl ip route add 10.3.0.0/24 via 10.1.0.10 GigabitEthernet0/4/0