2

I am performing an experiment on 2 Xeon based servers. Both the servers have two dual port NIC, total 4 NICs. OVS is running on one server and DPDK pktgen on the other server.

I tried to add flow rules to the table to run OVS as L2 forwarding switch. I ran the following commands to create the bridge and add the flow rules.

./ovs-vsctl 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=0000:04:00.0 options:flow-ctrl-autoneg=true
./ovs-vsctl add-port br0 dpdk1 -- set Interface dpdk1 type=dpdk options:dpdk-devargs=0000:04:00.1 options:flow-ctrl-autoneg=true
./ovs-vsctl add-port br0 dpdk2 -- set Interface dpdk2 type=dpdk options:dpdk-devargs=0000:05:00.0 options:flow-ctrl-autoneg=true
./ovs-vsctl add-port br0 dpdk3 -- set Interface dpdk3 type=dpdk options:dpdk-devargs=0000:05:00.1 options:flow-ctrl-autoneg=true

./ovs-ofctl del-flows br0
./ovs-ofctl add-flow br0 "table=0, eth_dst=a0:36:9f:0e:36:48,actions=output=1"
./ovs-ofctl add-flow br0 "table=0, eth_dst=a0:36:9f:0e:36:4a,actions=output=2"
./ovs-ofctl add-flow br0 "table=0, eth_dst=a0:36:9f:3e:eb:a4,actions=output=3"
./ovs-ofctl add-flow br0 "table=0, eth_dst=a0:36:9f:3e:eb:a2,actions=output=4"

Everything is working fine in this case. And then I changed the pktgen to generate packets with the fake mac addresses. I also changed the flow rules in the table by executing the following commands.

./ovs-ofctl add-flow br0 "table=0, eth_dst=00:00:00:00:00:00,actions=output=1"
./ovs-ofctl add-flow br0 "table=0, eth_dst=00:00:00:00:00:01,actions=output=2"
./ovs-ofctl add-flow br0 "table=0, eth_dst=00:00:00:00:00:02,actions=output=3"
./ovs-ofctl add-flow br0 "table=0, eth_dst=00:00:00:00:00:03,actions=output=4"

I verified that the pktgen is generating the packets with these mac addresses, but the OVS doesn't forward the packets in this case. Am I missing something here?

I tried to find out the solution but all the tutorials have mentioned the same thing to add flows to the tables for l2 forwarding. Why is the OVS not forwarding packets in case of fake mac addresses? I have used all the ports in promiscuous mode.

I want to measure the performance for large number of tables entries and that is why I need to generate packets with fake mac address.

A-B
  • 563
  • 2
  • 6
  • 17

2 Answers2

0

Can you print the network namespace configuration.

route -n
ip netns ls
ovs-vsctl show

make sure you have configured the kernel to allow forwarding:

sudo vi /etc/sysctl.conf

uncomment net.ipv4.ip_forward = 1

you can watch the traffic

sudo tcpdump -i br0

Please see this answer regarding iptables forwarding: https://unix.stackexchange.com/questions/313180/iptables-forward-chain-traffic-not-seen-by-tcpdump

Sum1sAdmin
  • 1,914
  • 1
  • 11
  • 20
  • Thanks for your answer. I don't understand the relation between L2 forwarding in OVS and enabling ip_forward in routing tables in Linux. Moreover, it's working for actual mac addresses and not for fake ones. – A-B Dec 19 '17 at 12:16
  • ah sorry you might not need routing at all, I use ovs on openstack extensively with GRE and have never tried a dpdk set up. The bridge, ports options look correct to me, Have you looked at the output of ` ps -eLo pid,psr,comm | grep pmd ` as per documentation? – Sum1sAdmin Dec 19 '17 at 13:34
0

By default your host doesn't know MAC address other host. They will know neighbor MAC address with ARP protocol. So, make sure your installed table flow handle ARP process for each host. On ryu controller you can use simple_switch_13.py, or to simulate controller with GUI you can use https://github.com/dektiram/SDNColdBrew

dek.tiram
  • 91
  • 3