Configuring OVS on host1 and Duplicate Traffic

Getting Started with Napatech Link-Virtualization™ Software

Platform
Napatech SmartNIC
Content Type
Getting Started
Getting Started Guide
Capture Software Version
Link-Virtualization™ Software 4.5

Procedure

  1. Create a bridge with 2 physical and 2 virtual ports:
    ovs-vsctl --if-exists del-br br0
    ovs-vsctl add-br br0 -- set bridge br0 datapath_type=netdev
    
    ovs-vsctl add-port br0 dpdk0 -- set interface dpdk0 type=dpdk \
    	options:dpdk-devargs=class=eth,mac=xx:xx:xx:xx:xx:xx
    
    ovs-vsctl add-port br0 dpdk1 -- set interface dpdk1 type=dpdk \
    	options:dpdk-devargs=class=eth,mac=yy:yy:yy:yy:yy:yy
    
    ovs-vsctl add-port br0 dpdkvp0 -- set int dpdkvp0 type=dpdk \ 
      options:"dpdk-devargs=0000:XX:XX.0,representor=[4]"
    
    ovs-vsctl add-port br0 dpdkvp1 -- set int dpdkvp1 type=dpdk \
      options:"dpdk-devargs=0000:XX:XX.0,representor=[5]"
    
    where:

    XX:XX is the PCI bus ID, found with the command lspci | grep Napatech.

    mac=xx:xx:xx:xx:xx:xx is the MAC address of the physical port dpdk0, and mac=yy:yy:yy:yy:yy:yy is the MAC address of the physical port dpdk1.

    For more information see Reading MAC Addresses of the SmartNIC.

  2. Clear the flow table. Add flow table entries to send all traffic through a service chain composed of two VMs: phy0->vm1->vm2->phy0. Add one additional rule to duplicate a slice of inter-VM traffic to the monitoring port:
    # clear the flow table 
    ovs-ofctl del-flows br0
    
    # send all traffic through 2-VM SFC
    ovs-ofctl add-flow br0 in_port=dpdk0,actions=dpdkvp0
    ovs-ofctl add-flow br0 in_port=dpdkvp0,actions=dpdkvp1
    ovs-ofctl add-flow br0 in_port=dpdkvp1,actions=dpdk0
    
    # duplicate a slice of traffic to the monitoring port
    ovs-ofctl add-flow br0 \
      priority=35000,in_port=dpdkvp1,ip,udp,nw_src:16.0.4.0/24,actions=dpdkvp1,dpdk1
    
    # display flow table
    ovs-ofctl dump-flows br0