Part 2: Launch & Configure Open vSwitch*

From the Data Plane Development Kit, launch Open vSwitch* and then configure its bridge ports and flows.

Hi, I'm Clayne with Intel. And I work with [software-defined networking, network function virtualization] SDN and NFV in the Data Center. In this video we'll set up and launch Open vSwitch* using [Data Plane Developer Kit] DPDK binaries that we built in the first video. Now, let's get started and set up our Open vSwitch database.

First, let's configure the Open vSwitch database. Remember, if you're launching a new Vagrant ssh session, you need to set the environment by using the commands shown in the gray box. Change into the Open vSwitch directory, and then use the Open vSwitch database tool to create the configuration database in the Open vSwitch directory in /usr/local/etc.

This database uses the vSwitch [sic] daemon schema shown. Then, start the database listening on the Unix* socket specified. And then, finally, initialize the database.

Now, we'll configure and start the Open vSwitch daemon. Use OpenvSwitch via CTL to pin the Open vSwitch thread, the logical core one, which is HEX2, and to use 512 megabytes of huge pages for the socket memory. Then, start the Open vSwitch daemon, pointing it at the database listening on the Unix socket we started in the previous step.

Now to set up the virtual switch. First, change into the Open vSwitch directory and use the ovs-vsctl to pin the DPDK poll mode driver thread to logical core 2, which is HEX4. Then, use the ovs-vsctl to create bridge 0 and add four ports to the bridge.

Note that the type of these ports is DPDK vhost-user. Pay attention, also, to the names of these ports in bold. You'll see these names again in the next video.

[MUSIC PLAYING]

Now double-check bridge 0 by running ovs-vsctl and look at /usr/local/var/run/openvswitch/ for the Unix socket with the same names of the Open vSwitch ports you just created. Now we need to add the flows and tell Open vSwitch what to do with the packets it receives.

First, clear any existing flows on bridge 0 with /ovs-tlofc del-flows. And then add both transmit and receive flows from the vhost user x to vhost user y. We'll need four entries in the flow table—in on port 2, out on port 3, in on port 3, out on port 2, and likewise for ports 1 and 4. The dl_type parameter, by the way, tells the bridge to look for IPv4 packets.

[MUSIC PLAYING]

Now double-check the flows using the ovs-ofctl dump-flows command, and then show the port mapping using the ovs-ofctl show. In this video, we started Open vSwitch, and we created our virtual switch. And then we set up the logical flow of traffic between each of the DPDK enabled [sic] ports. In the next video, we'll create two containers that use these DPDK enabled [sic] ports. Stay tuned