Simple-vms

From fd.io
Jump to: navigation, search

Simple three nodes topology using VMs

This example shows how to create and set up the following topology using VMs:

(consumer)     Link1          (relay)        Link2        (producer)
 cicn1  <------------------->  cicn2  <------------------->  cicn3
10.0.1.21             10.0.1.22    10.0.3.22             10.0.3.23
  • cicn1 runs an instance of Metis.
  • cicn2 runs the cicn-plugin for VPP and acts as a relay node forwarding interests and content from cicn1 to cicn3.
  • cicn3 runs an instance of Metis.

Setting up the scenario through Vagrant

We provide a vagrant file which automatically sets up the above topology, installing and configuring Metis and the cicn-plugin for VPP.

Requirements

To run the vagrant file it is necessary to have the following software installed in the system:

How to

Using the vagrant file to setup the above topology is pretty straighforward:

Download the vagrant file
$ wget https://cisco.box.com/shared/static/d9y0x4v16w67iacvt0seu0q3nwl425cf -O Vagrantfile

Launch Vagrant
$ vagrant up

Understanding Metis and the cicn-plugin configuration

Using the vagrant file is a convient way to bootstrap the above scenario with few simple steps. In the following, we walk through the configuration of the cicn forwarder (either Metis or the cicn-plugin) for each single node.

Configure cicn1

The node cicn1 is configured to run an instance of Metis. To login the node use the following command:

$ vagrant ssh cicn1

Configure Metis forwarder

The configuration of Metis is made throguh a configuration file (metis.cfg) which is be available in the home folder. The content of the file will look like:

# Set a local listener to allow local application to communicate with the forwarder
add listener tcp local0 127.0.0.1 9695
add listener udp local1 127.0.0.1 9695

# Set a remote listener to enable Metis to receive interest and content through the local IP address and UDP port
add listener udp remote0 10.0.0.21 33302

# Set a connection to enable Metis to send interest and content to the remote IP address and UDP port
add connection udp conn0 10.0.1.22 33302 10.0.1.21 33302

# Create a route, or entry in the FIB, for the prefix ccnx:/cicn. Interest matching with ccnx:/cicn will be forwarded using conn0
add route conn0 ccnx:/cicn 1
  • The current version of Metis requires the two local listeners to allow local application, e.g., metis_control, to communicate with the forwarder. IP address and the TCP/UDP port should not be changed.
  • For remote listeners, only UDP ports are currently supported.

In the vagrant, the following command runs Metis:

$ metis_daemon --config metis.cfg &

Additionally, it is possible to configure Metis (or change its acutal configuration) while it is running. The utility metis_control allows to interact with Metis. The following steps launch and configure Metis without using a configuration file:

Start Metis
$ metis_daemon &

Start metis_control
$ metis_control -k ~/.ccnx/.ccnx_keystore.p12 -p 1234

Set a remote listener to enable Metis to receive interest and content through the local IP address and UDP port
> add listener udp remote0 10.0.1.21 33302

Set a connection to enable Metis to send interest and content to the remote IP address and UDP port
> add connection udp conn0 10.0.1.22 33302 10.0.1.21 33302

Create a route, or entry in the FIB, for the prefix ccnx:/cicn. Interest matching with ccnx:/cicn will be forwarded using conn0
> add route conn0 ccnx:/cicn 1

Unlike in the configuration file, setting Metis using metis_control does not require to set up the local listeners. They are automatically set up when Metis is launched.

Configure cicn2

The node cicn2 is configured to use the cicn-plugin for VPP. To access the node use the following command:

$ vagrant ssh cicn2

The configuration of cicn2 is made through several steps:

  • Prepare the system to run VPP
  • Configure VPP
  • Enable and configure cicn-plugin

Setup the system for VPP

The following commands setup the system to run VPP:

Disable the two DPDK interfaces that VPP will use
Names might change, in this case it is necessary to use the actual name of the
DPDK interfaces
$ sudo ifconfig enp0s8 down
$ sudo ifconfig enp0s9 down

Load modules in the kernel
$ sudo modprobe uio
$ sudo modprobe igb_uio

Stop any VPP instance (it might start as a service right after being installed)
$ sudo systemctl stop vpp

Enable hugepages in the system
$ sudo sysctl -w vm.nr_hugepages=1024

Confiure VPP

The /etc/vpp/startup.conf file for the above scenario looks like:

  unix {
    nodaemon
    log /var/log/vpp/vpp.log
    full-coredump
  }

  api-trace {
    on
  }

  api-segment {
    gid vpp
  }

  dpdk {
    socket-mem 1024
    dev 0000:00:08.0
    dev 0000:00:09.0
  }

Where 0000:00:08.0 and 0000:00:09.0 are the PCI addresses of the two DPDK interfaces as shown through the command lspci.

$ lspci
00:08.0 Ethernet controller: Intel Corporation 82540EM Gigabit Ethernet Controller (rev 02)
00:09.0 Ethernet controller: Intel Corporation 82540EM Gigabit Ethernet Controller (rev 02)

To set IP connectivity in VPP, the vagrant file executes the following commands:

Start and configure IP connectivity in VPP
$ systemctl start vpp
$ vppctl set int ip address GigabitEthernet0/8/0 10.0.1.22/24
$ vppctl set int state GigabitEthernet0/8/0 up
$ vppctl set int ip address GigabitEthernet0/9/0 10.0.3.22/24
$ vppctl set int state GigabitEthernet0/9/0 up

Finally, the cicn-plugin is enabled and configured as follows:

Enable cicn-plugin and configure it
$ vppctl cicn enable

Create the two faces for cicn1 and cicn2
$ vppctl cicn cfg face add local 10.0.1.22:33302 remote 10.0.1.21:33302
$ vppctl cicn cfg face add local 10.0.3.22:33302 remote 10.0.3.23:33302

Add an entry in the FIB for the prefix /cicn and face 2
$ vppctl cicn cfg fib add prefix /cicn face 2

Configure cicn3

Like the node cicn1, the node cicn3 is configured to run an instance of Metis forwarder. To access the node use the following command:

$ vagrant ssh cicn3

Configure Metis forwarder

The configuration file for Metis, metis.cfg, can be found in the home folder and it looks like:

# Set a local listener to allow local application to communicate with the forwarder
add listener tcp local0 127.0.0.1 9695
add listener udp local1 127.0.0.1 9695

Set a remote listener to enable Metis to receive interest and content through the local IP address and UDP port
add listener udp remote0 10.0.3.23 33302

# Set a connection to enable Metis to send interest and content to the IP address and UDP port of cicn2
add connection udp conn0 10.0.3.22 33302 10.0.3.23 33302

Unlike in cicn1, we do not neet to set any FIB entry in cicn3. A producer application will automatically generates one when started.