Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
125 changes: 82 additions & 43 deletions docs/moongen.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,33 @@
MoonGen Installation (DPDK-2.0 Version)
MoonGen Installation (DPDK-19.5 Version)
===================

#### Welcome to installation memo for [MoonGen](http://scholzd.github.io/MoonGen/install.html), MoonGen is a "Scriptable High-Speed Packet Generator".
#### Welcome to installation memo for [MoonGen](http://scholzd.github.io/MoonGen/install.html). MoonGen is a "Scriptable High-Speed Packet Generator".
----------

1. Preparation steps
## 1. Preparation steps
===================
Installation steps are assuming that you have already got OpenNetVM installed. If you have already got OpenNetVM installed, please following the steps below for a double check of your system.

1.1 check if you have available hugepages
Installation steps are assuming that you already have [openNetVM installed](./Install.md). Follow the steps below to double check your system configuration.

`$grep -i huge /proc/meminfo`
### 1.1 Check for available hugepages

If ***HugePages_Free*** 's value equals to 0, which means there is no free hugepages available, you probably have to reboot your machine, by `$sudo reboot` to get some released hugepages.
`$ grep -i huge /proc/meminfo`

1.2 check if you have available ports binded to DPDK
If the ***HugePages_Free*** 's value equals 0, which means there are no free hugepages available, there may be a few reasons why:
- The manager crashed, but an NF(s) is still running.
- In this case, either kill them manually by hitting Ctrl+C or run `$ sudo pkill NF_NAME` for every NF that you have ran.
- The manager and NFs are not running, but something crashed without freeing hugepages.
- To fix this, please run `$ sudo rm -rf /mnt/huge/*` to remove all files that contain hugepage data.
- The above two cases are not met, something weird is happening:
- A reboot might fix this problem and free memory: `$ sudo reboot`

`$cd dirctory_of_your_installed_dpdk`
### 1.2 Check NIC ports are bound to DPDK

`$./tools/dpdk_nic_bind.py --status`
`$ cd dirctory_of_your_installed_dpdk`

if you got the follwing binding information indicating that you have the two 10-Gigabit NIC ports binded with DPDK driver, then you are fine, please jump to step 1.4, otherwise, please jump to step 1.3.
`$ ./usertools/dpdk-devbind.py --status`

If you got the follwing similar binding information indicating that you have the two 10-Gigabit NIC ports bound with the DPDK driver, jump to step 1.4. Otherwise, please jump to step 1.3.

```
Network devices using DPDK-compatible driver
Expand All @@ -34,73 +41,105 @@ Network devices using kernel driver
0000:05:00.1 '82576 Gigabit Network Connection' if=eth0 drv=igb unused=igb_uio *Active*
```

1.3 bind the 10G ports to DPDK
### 1.3 Bind the 10G ports to DPDK

1.3.1 load in your uio linux kernel module
An example of incorrect bindings is as follows:

`$sudo modprobe uio`
```
Network devices using DPDK-compatible driver
============================================
<none>
1.3.2 load in your igb_uio, which is in DPDK kernel module, e.g x86_64-native-linuxapp-gcc
Network devices using kernel driver
===================================
0000:05:00.0 '82576 Gigabit Network Connection' if=eth0 drv=igb unused=igb_uio *Active*
0000:05:00.1 '82576 Gigabit Network Connection' if=eth1 drv=igb unused=igb_uio
0000:07:00.0 '82599EB 10-Gigabit SFI/SFP+ Network Connection' if=eth2 drv=ixgbe unused=igb_uio *Active*
0000:07:00.1 '82599EB 10-Gigabit SFI/SFP+ Network Connection' if=eth3 drv=ixgbe unused=igb_uio
```

`$sudo insmod x86_64-native-linuxapp-gcc/kmod/igb_uio.ko`
In our example above, we see two 10G capable NIC ports that we could use with description '82599EB 10-Gigabit SFI/SFP+ Network Connection'.

if it showed up as alredy bind, use `$sudo rmmod igb_uio`, and then perform `$sudo insmod x86_64-native-linuxapp-gcc/kmod/igb_uio.ko`.
One of the two NIC ports, 07:00.0, is active shown by the *Active* at the end of the line. Since the Linux Kernel is currently using that port, network interface eth2, we will not be able to use it with openNetVM. We must first disable the network interface in the Kernel, and then proceed to bind the NIC port to the DPDK Kernel module, igb_uio:

1.3.3 bind the 10G ports to DPDK
`$ sudo ifconfig eth2 down`

`$sudo ./tools/dpdk_nic_bind.py -b igb_uio 07:00.0`
Rerun the status command, ./usertools/dpdk-devbind.py --status, to see that it is not active anymore. Once that is done, proceed to bind the NIC port to the DPDK Kenrel module:

`$sudo ./tools/dpdk_nic_bind.py -b igb_uio 07:00.1`
`$ sudo ./usertools/dpdk-devbind.py -b igb_uio 07:00.0`

1.4 check if g++ and gcc are updated with version higher than 4.7
Check the status again, `$ ./usertools/dpdk-devbind.py --status`, and assure the output is similar to our example below:

`$g++ --version`
```
Network devices using DPDK-compatible driver
============================================
0000:07:00.0 '82599EB 10-Gigabit SFI/SFP+ Network Connection' drv=igb_uio unused=ixgbe
`$gcc --version`
Network devices using kernel driver
===================================
0000:05:00.0 '82576 Gigabit Network Connection' if=eth0 drv=igb unused=igb_uio *Active*
0000:05:00.1 '82576 Gigabit Network Connection' if=eth1 drv=igb unused=igb_uio
0000:07:00.1 '82599EB 10-Gigabit SFI/SFP+ Network Connection' if=eth3 drv=ixgbe unused=igb_uio
```

1.4 check if g++ and gcc are updated with version higher than 4.8

`$ g++ --version`

`$ gcc --version`

if not, please add the repository using:

`$sudo add-apt-repository ppa:ubuntu-toolchain-r/test`
`$ sudo add-apt-repository ppa:ubuntu-toolchain-r/test`

Then, to install it use:

`$ sudo apt-get update`

then, to install it use:
`$ sudo apt-get install g++-4.8`

`$sudo apt-get update`
and then change the default compiler to use update-alternatives:

`$sudo apt-get install g++-4.7`
`$ sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 40 --slave /usr/bin/g++ g++ /usr/bin/g++-4.8`

and then change the default compiler use update-alternatives:
`$ sudo update-alternatives --config gcc`

`$sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.7 40 --slave /usr/bin/g++ g++ /usr/bin/g++-4.7`
Install other dependencies with:

`$sudo update-alternatives --config gcc`
```
$ sudo apt-get install -y build-essential cmake linux-headers-`uname -r` pciutils libnuma-dev
$ sudo apt install cmake
$ sudo apt install libtbb2
```


2. MoonGen Installation
## 2. MoonGen Installation
===================

2.1 get the resource from github, and checkout the dpdk2.0 branch
### 2.1 Get the resource from github, and checkout the dpdk19.5 branch

`$git clone https://github.com/emmericp/MoonGen`
`$ git clone https://github.com/emmericp/MoonGen`

`$cd MoonGen`
`$ cd MoonGen`

`$git checkout dpdk2.0`
`$ git checkout dpdk-19.05`

`$sudo git submodule update --init`
`$ sudo git submodule update --init`

2.2 build the resource
### 2.2 Build the resource

`$sudo ./build.sh`
`$ sudo ./build.sh`

2.3 set up hugetable
### 2.3 Set up hugetable

`$sudo ./setup-hugetlbfs.sh`
`$ sudo ./setup-hugetlbfs.sh`

2.4 execute the test, configure the ***quality-of-service-test.lua*** with your destination ip address (ip address for the server you want to sent packets to) in line 60 and line 177, and your source ip address (ip address for the machine you are executing MoonGen on) in line 68 and line 165, and run with command:
### 2.4 Execute the test
Configure the ***quality-of-service-test.lua*** with your destination ip address (ip address for the server you want to sent packets to) and your source ip address (ip address for the machine you are executing MoonGen on), and run with command:

`$sudo ./build/MoonGen ./examples/quality-of-service-test.lua 0 1`
`$ sudo ./build/MoonGen ./examples/quality-of-service-test.lua 0 1`

and if sample log showed up as following, you are fine, please use ***Ctrl+C*** to stop generating packets:
and if the sample log outputs the following, your configutation is correct. Use ***Ctrl+C*** to stop generating packets:

```
wenhui@nimbnode16:~/MoonGen$ sudo ./build/MoonGen ./examples/quality-of-service-test.lua 0 0
Expand Down