How to create a control network for the VMs of a Virtualbrick testbed.

Rationale

A control network is a network dedicated to the control of the VMs that belong to a Virtualbricks testbed. Having a control network separated by the network used for network experiments allows the user to isolate the link used for the experiments. This brings two advantages. First, control traffic, i.e. data sent to VMs to manage an experiment, does not interfere with data traffic exchanged between VMs during the experiment, which is essential; second, scenario impairments, such as long delays, high loss rate, etc.disruption, do not affect control traffic, making slow or impossible (e.g. in DTN partitioned networks) the actual control of VMs. By default, we use the network 10.0.0.0/24 as control network, and all VMs of our testbeds are connected to the host (10.0.0.1) by means of their first NIC, dedicated to this service.

Tools and configuration

To set up a control network we need to install and enable a vde_switch on the host. Optionally, the user may also want to install a DHCP, but this second step should be skipped by the users of our testbeds or our images, where an alternative method is preferred. Last, the testbed and its VMs must be configured to use the vde_switch on the host. Also this third step must be skipped by our testbed users, which come preconfigured (they only require the installaton of the vde_switch to be succesfully switched on).

Setup the vde_switch

The vde_switch is just a virtual switch. It is one of the tools provided in the VDE package. In Debian and Ubuntu the packet vde2, is already installed, or it can be easily installed from official repositories. As a last resort, if in your ditribution the packet is not included, it can be installed form the source code, by following the guide provided here.

A vde_switch must be configured to start at boot and then remain active. It will have a TAP interface that will be used as connection point between the VMs and the host.

Instructions: (you may find convenient to cut and paste most commands on your terminal):

  1. Download this file
  2. Open a terminal, go to the directory where the file has just been saved and decompress the file
tar jxvf vde_switch-init.tar.bz2
  1. Copy the file in the directory /etc/init.d: (if you are root omit sudo)
sudo cp vde_switch /etc/init.d/
  1. Assign the execution right to the file:
sudo chmod +x /etc/init.d/vde_switch
  1. Add the service to the list of services activated at boot:
sudo update-rc.d vde_switch defaults
  1. Unless already done, add your username (e.g. andrea) to the kvm group (repeat for all potential Virtualbricks' users):
sudo adduser USERNAME kvm
  1. Reboot:
sudo reboot
  1. Check the network configuration
sudo ifconfig

you should find a new network interface tap0 address 10.0.0.1. This is the address of the host on the control network (10.0.0.0/24). VMs will have to use it to address the host.

To address the VMs from the host (e.g. to log in via ssh), you need to know their IP adresses on the control network. All our testbed VMs have this address preset (e.g. in DTN2hops 10.0.0.11, 10.0.0.12 etc.). The same holds true for our base images (10.0.0.10).

Advanced users only: read the following if you want to build a new testbed from scratch advanced instructions

  • How to setup a Virtualbricks testbed (basic st