Dumbbell-vicn

From fd.io
Jump to: navigation, search

Setup a Dumbbell topology using vICN

This example shows how to create and set up a typical Dumbbell topology using vICN:

+-----+                                    +-----+
|cons1|---------+                +---------|prod1|
+-----+         |                |         +-----+
+-----+         |                |         +-----+
|cons2|-------+ |                | +-------|prod2|
+-----+       | |                | |       +-----+
+-----+      +--+--+          +--+--+      +-----+
|cons3|------|core1|----------|core2|------|prod3|
+-----+      +--+--+          +--+--+      +-----+
+-----+       | |                | |       +-----+
|cons4|-------+ |                | +-------|prod4|
+-----+         |                |         +-----+
+-----+         |                |         +-----+
|cons5|---------+                +---------|prod5|
+-----+                                    +-----+
  • Each node is deployed as an LXC container
  • cons1, cons2, cons3, cons4, cons5 run an instance of Metis
  • core1 and core2 run the CICN plugin for VPP
  • prod1, prod2, prod3, prod4, prod5 run an instance of Metis

Deploying the topology

Requirements

  • vICN (Install instructions are here)
  • LXC image with the full CICN suite

How to

To setup the topology:

First (if you have not already done it), install the LXC CICN image:

$ wget https://cisco.box.com/shared/static/jozkxqqjm0qbwcl414myp9whbn4cix5o.gz -O ubuntu1604-cicnsuite-rc4.tar.gz --delete-after
$ lxc image import ubuntu1604-cicnsuite-rc4.tar.gz ubuntu1604-cicnsuite-rc4

Update the MAC and PCI addresses of the DPDK interfaces in the tutorial02-dumbell.json. The mac address must be the actual mac address of the DPDK interfaces in the server.

You can now run the topology:

$ ./vicn/bin/vicn.py -s examples/tutorial/tutorial02-dumbell.json

Understanding the dumbbell.json file

Most of the resources reported in the tutorial02-dumbbell.json file are already explained here. In the following, we walk through the vICN resources that are required to set up the two core nodes running the cicn-plugin and the connectivity among the containers. A detailed explanation of the attributes of each resource is given at the end of the tutorial.

Cores

Each of the two cores, core1 and core2, is composed of the following resources:

  • One LxcContainer
    • The LXC container used to emulate the node.
  • Two DpdkInterface
    • These resources describe the two DPDK interfaces that connect the core node to the bridge and to the other core node.
  • One VPP
    • This resource describes a VPP forwarder.
  • One CICNForwarder
    • This resource describes the CICN plugin for the VPP forwarder.

The following code shows the list of vICN resources to deploy and set up core1 and core2.

 {
   "type": "LxcContainer",
   "node": "server",
   "name": "core1",
   "groups": ["topology"],
   "image": "lxcimage"
 },
 {
   "type": "VPP",
   "node": "core1",
   "name": "core1-vpp"
 },
 {
   "type": "DpdkDevice",
   "node": "core1",
   "device_name": "GigabitEthernet0/9/0",
   "pci_address": "0000:00:09.0",
   "mac_address": "08:00:27:d1:b5:d1",
   "name": "core1-dpdk1"
 },
 {
   "type": "CICNForwarder",
   "node": "core1",
   "name": "core1-fwd"
 }
 {
   "type": "LxcContainer",
   "node": "server",
   "name": "core2",
   "groups": ["topology"],
   "image": "lxcimage"
 },
 {
   "type": "VPP",
   "node": "core2",
   "name": "core2-vpp"
 },
 {
   "type": "DpdkDevice",
   "node": "core2",
   "device_name": "GigabitEthernet0/a/0",
   "pci_address": "0000:00:0a.0",
   "mac_address": "08:00:27:8c:e3:49",
   "name": "core1-dpdk1"
 },
 {
   "type": "CICNForwarder",
   "node": "core2",
   "name": "core2-fwd"
 }
 

Connectivity

To connect the two cores together, it is required to use a link type resource. vICN provides three different types of link resources to connect two LXC containers running VPP and the cicn-plugin:

  • PhyLink
  • MemifLink
  • Link

In tutorial02-dumbell.json we show how to use a PhyLink.

PhyLink

A PhyLink resource represents a physical link that connects two LXC containers. A PhyLink requires two DpdkDevice, the two endpoints of the link.

In the tutorial02-dumbell.json, core1-dpdk1 and core2-dpdk1 belong to core1 core2 respectively, and they identify the DPDK nics with the pci addresses equal to 0000:00:09.0 and 0000:00:0a.0. Those two nics are connected through a cable and the PhyLink resource represents such physical connection.

In the tutorial02-dumbell.json, the definition of the PhyLink resource for <core1> and <core2> is the following:

 {
   "type": "PhyLink",
   "src": "core1-dpdk1",
   "dst": "core2-dpdk1",
   "groups": ["topology"]
 }
MemifLink

If there are no DPDK nics available, a convenient way for connecting two LXC containers runnig VPP and the cicn-plugin is to use a MemifLink resource. Such resource connects two containers through VPP MemIf interfaces. Those interfaces exploits a shared memory between the two VPP forwarders to provide a userspace implementation of zero-copy interfaces. As a consequence they can only be used between LXC containers running on the same server.

A MemIfLink resource requires the name of two node to connect:

 {
  "type": "MemifLink",
  "src_node": "core1",
  "dst_node": "core2",
  "groups": ["topology"]
 }
Link

A third option to connect two LXC containers runnig VPP and the cicn-plugin is to use a Link resource. A Link resource connects two containers using interfaces handled by the linux kernel. Such resource is useful to a container running VPP and the cicn-plugin wih a container runnig metis.

We discourage to use a Link resource to connect two LXC containers running VPP and the cicn-plugin, as they do not allow to achieve high troughput due to the interaction of VPP with the kernel.

A Link resource requires the name of two node to connect. In the tutorial02-dumbell.json we use them to connect each producer and consumer to core1 or core2:

 {
  "type": "Link",
  "src_node": "cons1",
  "dst_node": "core1",
  "groups": ["topology"]
 }

Attributes description

  • LxcContainer
    • Details for such resource can be found [here]
  • DpdkInterface
    • Attributes:
      • node : the node that controls the DPDK interface.
      • device_name : the name of the DPDK device given by VPP.
      • pci_address : the PCI address of the interface (can be retrieved via lspci)
      • mac_address : the mac address assigned to the DPDK device.
      • name : the name of the resource.
  • VPP
    • Attributes:
      • node : the node on which VPP will be installed and run.
      • name : the name of the resource.
  • CICNForwarder
    • Attributes:
      • node : the node on which the VPP forwarder is installed and run.
      • name : the name of the resource.
  • PhyLink
    • Attributes:
      • src: the DPDK interface belonging to the node at one of the two side of the link.
      • dst: the DPDK interface belonging to the node at other side of the link.
  • MemifLink
    • Attributes:
      • src_node: the name of the node running VPP and the cicn-plugin at one side of the link.
      • dst_node: the name of the node running VPP and the cicn-plugin at the other side of the link.
  • Link
    • Attributes:
      • src_node: the name of the node at one side of the link.
      • dst_node: the name of the node at the other side of the link.