1# Vhost and VPP testing script
3This script intends to provide a reference script for testing [VPP](http://fd.io/) vhost-user performances.
4It uses the basic topology PHY -> VM -> PHY.
5You will therefore need a machine with two physical interfaces and the ability to run a VM with qemu in
6order to run the test.
8## A word about the VM
10The VM that is executed is a CLONE of the running system.
11In practice, that means that the VM is using, as root filesystem,
12a mounted OverlayFS instance of the root directory (Meaning that
13the VM will share the same file, but all updates will not affect the
14root file system).
16This also means that the VM boots on a shared file system, which implies
17that the initramfs image must include the 9p driver.
19One way of doing it is documented [here] (http://unix.stackexchange.com/questions/90423/can-virtfs-9p-be-used-as-root-file-system).
20$ printf '%s\n' 9p 9pnet 9pnet_virtio | sudo tee -a /etc/initramfs-tools/modules
21$ sudo update-initramfs -u
26$ cd vhost-test
28First copy and update the configuration file such that the parameters
29correspond to your setup.
31$ cp conf.sh.default conf.sh
32$ vim conf.sh
34Then, run the setup.
36$ ./vhost.sh start
38Once the setup is running, you can re-pin the processes.
39This is important, as it also performs 'chrt' on the working threads.
41$ ./vhost.sh pin
43Once the setup is running, you can:
44- Log into the VM
45$ ./vhost.sh ssh
47- Log into VPP
48$ sudo screen -r vhtestvpp
51Finally, when you are done, you can stop the VMs.
53$ ./vhost.sh stop
55## Traffic Generation with MoonGen
57mg.lua is intended to be used with the MoonGen packet generator.
58This script measures packet loss and forwarding with a user-defined
59granularity. The script keeps running while consecutive measures are
60too far on both Tx axis (--maxRateInterval option) or on the drop rate
61axis (--targetDropRateRatio). The latter is a ratio instead of an interval,
62as the packet drop is mostly a logarithmic value.
64The script is used as follows:
65sudo /path/to/MoonGen ./mg.lua <options>
67Mandatory options are:
68--rxport <id> MoonGen's rx port index
69--txport <id> MoonGen's tx port index
70--dst <hwaddr> Frame's destination L2 address
72Other options are:
73--duration <seconds> Each measurement duration
74--frameSize <bytes> Each frame size
75--maxRateInterval <%> Max Tx interval between measure
76--targetDropRateRatio <ratio> Max ratio between two drop rate measures
77--minRateInterval <%> Min Tx interval (Will override drop ratio in case of non-continuous)
78--out <file> Output file
82### Current status
84This script hasn't been tested by anyone but me for now.
85You should therefore expect bugs on different setups.
87### Main contributors
89Pierre Pfister - LF-ID:ppfister