Run Pktgen (Ubuntu 16.04.5)

Step 1. Install and configure DPDK

Step 2. Install Pktgen

$ sudo apt-get install -y wget patch libpcap-dev
$ curl -LO http://www.dpdk.org/browse/apps/pktgen-dpdk/snapshot/pktgen-3.5.0.tar.gz
$ tar xvfz pktgen-3.5.0.tar.gz

$ echo "export RTE_SDK=\$DPDK_DIR" >> ~/.bashrc
$ echo "export RTE_TARGET=\$DPDK_TARGET" >> ~/.bashrc
$ . ~/.bashrc

$ cd pktgen-3.5.0
$ make

Step 3. Run Pktgen

$ cd pktgen-3.5.0

$ sudo -E app/$RTE_TARGET/pktgen -c 0xf -n 4 -- -p 0x3 -P -m "[1:2].0"
=> [1:2].0 : use core #1 and #2 for port 0

Pktgen:/> set [port number] [parameter] [value]
set 0 count 100
=> send 100 packets to port 0
set 0 size 64
=> send 64-byte packets to port 0
set 0 rate 50
=> send packets to port 0 with 50% sending rate
set 0 src ip 10.0.0.0/24
=> configure a source IP address
set 0 src mac aa:bb:cc:dd:ee:ff
=> configure a source MAC address
start 0
=> start to send packets
stop 0
=> stop sending packets

(with script)

$ sudo -E app/$RTE_TARGET/pktgen -l 0-4 -n 3 -- -P -m "[1:3].0" -f scripts/rfc2544_tput_test.lua

 

Leave a Reply

Your email address will not be published. Required fields are marked *