<html><head></head><body><div style="font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:small;"><div style="font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:small;"><div>Hi,</div><div><br></div><div>I was looking at this simple tunneling example from the docs.&nbsp;</div><div><br></div><div><a href="http://docs.openvswitch.org/en/latest/howto/tunneling/" class="" rel="nofollow" target="_blank">http://docs.openvswitch.org/en/latest/howto/tunneling/</a><br></div><div><br></div><div>It says "Pings between any of the VMs should work, regardless of whether the VMs are running on the same host or different hosts".</div><div><br></div><div>But it seems to me that the order in which the ports are added to the bridge matters. If we add the tunnel port before adding the tap interfaces, then the datapath flows are setup such that the VMs on the same host may not be able to communicate with each other.</div><div><br></div><div>For example, ignoring the remote host, I just add 2 tap interfaces and a geneve tunnel port to the OVS bridge.I will use ofproto/trace to generate the datapath flows for a broadcast packet originating from one of the tap interfaces.&nbsp;</div><div><br></div><div>In this first attempt, I will reverse the order from the above doc by adding the tunnel port first and then add the tap interfaces to the bridge. Please look at the Datapath actions that get generated. The packet is transformed by the set_tunnel action before outputting to port-4 (vport1). Is this expected? If I was pinging from vport2 to vport1 and this were an initial broadcast arp packet, it would have been dropped at vport1 as malformed and ping wouldn't succeed.</div><div><br></div><div><div>root@ubuntu:~# ovs-vsctl add-port br0 tun1 -- set interface tun1 type=geneve options:remote_ip=4.4.4.4</div><div>root@ubuntu:~# ovs-vsctl add-port br0 vport1 -- add-port br0 vport2<br></div><div><br></div><div>root@ubuntu:~# ovs-ofctl show br0 (partial output)<br></div><div>&nbsp;1(tun1): addr:0e:ba:6b:40:fb:52<br></div><div>&nbsp;2(vport2): addr:a2:2c:48:53:e7:e5<br></div><div>&nbsp;3(vport1): addr:fa:6a:41:04:ac:ee</div><div><br></div><div>root@ubuntu:~# ovs-dpctl show (partial output)<br></div><div>system@ovs-system:</div><div><span style="white-space: pre-wrap;">        </span>port 0: ovs-system (internal)<br></div><div><span style="white-space: pre-wrap;">        </span>port 1: br0 (internal)</div><div><span style="white-space: pre-wrap;">        </span>port 2: genev_sys_6081 (geneve)</div><div><span style="white-space: pre-wrap;">        </span>port 3: vport2</div><div><span style="white-space: pre-wrap;">        </span>port 4: vport1&nbsp;</div><div><br></div><div>root@ubuntu:~# ovs-appctl ofproto/trace br0 in_port=2,dl_dst=ff:ff:ff:ff:ff:ff</div><div>Bridge: br0</div><div>Flow: in_port=2,vlan_tci=0x0000,dl_src=00:00:00:00:00:00,dl_dst=ff:ff:ff:ff:ff:ff,dl_type=0x0000</div><div><br></div><div>Rule: table=0 cookie=0 priority=0</div><div>OpenFlow actions=NORMAL</div><div>no learned MAC for destination, flooding</div><div>output to kernel tunnel</div><div><br></div><div>Final flow: in_port=2,vlan_tci=0x0000,dl_src=00:00:00:00:00:00,dl_dst=ff:ff:ff:ff:ff:ff,dl_type=0x0000</div><div>Megaflow: recirc_id=0,in_port=2,vlan_tci=0x0000/0x1fff,dl_src=00:00:00:00:00:00,dl_dst=ff:ff:ff:ff:ff:ff,dl_type=0x0000</div><div>Datapath actions: 1,set(tunnel(dst=4.4.4.4,ttl=64,flags(df))),2,4</div><div><br></div></div><div>-------------------</div><div><br></div><div>On the other hand, if I follow the order from the doc, i.e., add tap interfaces first and then the tunnel port, then the datapath actions look fine as the output to vport happens before the set_tunnel action and so ping would succeed.</div><div><br></div><div><div>root@ubuntu:~# ovs-vsctl add-port br1 vport3 -- add-port br1 vport4<br></div><div>root@ubuntu:~# ovs-vsctl add-port br1 tun2 -- set interface tun2 type=geneve options:remote_ip=5.5.5.5</div><div><br></div><div>root@ubuntu:~# ovs-ofctl show br1 (partial output)</div><div>&nbsp;1(vport3): addr:0e:9c:cb:2e:3c:c2<br></div><div>&nbsp;2(vport4): addr:26:7f:e7:2c:3c:6a<br></div><div>&nbsp;3(tun2): addr:4e:f4:ec:6e:9f:a3</div><div><br></div><div>root@ubuntu:~# ovs-dpctl show (partial output)<br></div><div>system@ovs-system:</div><div><span style="white-space: pre-wrap;">        </span>port 0: ovs-system (internal)<br></div><div><span style="white-space: pre-wrap;">        </span>port 2: genev_sys_6081 (geneve)<br></div><div><span style="white-space: pre-wrap;">        </span>port 5: br1 (internal)<br></div><div><span style="white-space: pre-wrap;">        </span>port 6: vport3</div><div><span style="white-space: pre-wrap;">        </span>port 7: vport4</div><div><br></div><div>root@ubuntu:~# ovs-appctl ofproto/trace br1 in_port=1,dl_dst=ff:ff:ff:ff:ff:ff</div><div>Bridge: br1</div><div>Flow: in_port=1,vlan_tci=0x0000,dl_src=00:00:00:00:00:00,dl_dst=ff:ff:ff:ff:ff:ff,dl_type=0x0000</div><div><br></div><div>Rule: table=0 cookie=0 priority=0</div><div>OpenFlow actions=NORMAL</div><div>no learned MAC for destination, flooding</div><div>output to kernel tunnel</div><div><br></div><div>Final flow: in_port=1,vlan_tci=0x0000,dl_src=00:00:00:00:00:00,dl_dst=ff:ff:ff:ff:ff:ff,dl_type=0x0000</div><div>Megaflow: recirc_id=0,in_port=1,vlan_tci=0x0000/0x1fff,dl_src=00:00:00:00:00:00,dl_dst=ff:ff:ff:ff:ff:ff,dl_type=0x0000</div><div>Datapath actions: 5,7,set(tunnel(dst=5.5.5.5,ttl=64,flags(df))),2</div><div><br></div></div><div><br></div><div>Thanks,</div><div>Chaithan</div><div><br></div></div></div></body></html>