Part 4: Run Testpmd & Pktgen Inside Separate Docker* Containers
Build and launch two Docker* containers that use Open vSwitch* with support from the Data Plane Developer Kit.
Hi, I'm Clayne with Intel. And I work with [software-defined networking, network function virtualization] SDN NFV in the Linux* data center. Welcome to the fourth video in our series on fast networking in the Linux data center.
In this video, we will launch the applications inside the containers that we already created, and we'll watch the traffic flowing back and forth between them. Coming into this video, you should have three terminal windows open: one in the pktgen context, one in the testpmd context, and one in the host OS context. If you don't have those windows open, go ahead and do it now.
Remember, every time you launch a new window you need to enter the host [virtual machine] VM context by typing Vagrant ssh and then you need to enter the environment variable context by running source and then step00-setemv. First, we'll set the DPDK parameters for testpmd. So make sure you're in the testpmd container window. This is a lot to type, so we recommend just using the scripts that you can download.
Because most of these parameters are common to the DPDK, I'll only point out the ones necessary to use DPDK in containers. The --no PCI parameter tells a DPDK to not look for nix on the PCI bus. And the --vdev parameter tells DPDK to use a vert I/O device located at the path specified.
These paths should look familiar to you because they are the paths to the unit sockets that were created when we launched Open vSwitch*, and which we passed into the container when we launched it. Next, we'll export the testpmd at parameters into the testpmd container window. We're using a burst size of 64 with no hardware VLANs and to receive and transmit size of 2 MB with a testpmd app pin to run on cores 6 and 7.
Now, we'll set the DPDK parameters for the pktgen app, so make sure you enter these commands in the terminal that you launched in the pktgen context. Pktgen will use vhost user sockets 1 and 2 instead of 3 and 4. And it is pinned to CPUs 0, 3, and 4 instead of 5 and 7, as testpmd was.
Step 19: We'll set the pktgen app parameters and then launch the pktgen app. Pktgen is launched in color output mode and in promiscuous mode. The -m parameter indicates that core zero should handle RX and TX on port 0, and core 4 should handle RX and TX on port 1.
Now that we have pktgen and testpmd up running, let's generate traffic. In the pktgen container app, type start all. You'll see traffic immediately starts to flow. Then in the testpmd window, type show port stats all. This will show you what testpmd is seeing.
Then, in the host OS window, type the command shown to watch how the Open vSwitch traffic counters are incrementing. You can also view how CPU resources are being used by running top on the host and then pressing 1.
In video one, we built the DPDK and Open vSwitch packages. In video two, we started Open vSwitch and set the flows between the ports. In video three, we built two Docker* containers, and then in this video we ran the apps in those containers and saw traffic flowing. Please feel free to download this script package for all four videos at the URL shown. Thanks for watching.
Product and Performance Information
Performance varies by use, configuration and other factors. Learn more at www.Intel.com/PerformanceIndex.