In this article, we would like to bridge two remote Mininet environments using VXLAN.

Environment

The following figure shows the network topology:

h1(h1-eth0) --- (s1-eth1)s1(vxlan) -- VXLAN -- (vxlan)s1(s1-eth1) --- (h2-eth0)h2

The network of left-hand-side is simunated on 140.113.215.191 The network of right-hand-side is simunated on 140.113.215.200

Honest Advice

Check your OVS version by ovs-vsctl show and make sure you are working with version > 2.0.1 It wastes me two nights just because there is something wrong in the old version…

Basic Configuration

Create two Mininet on each side

sh1# sudo mn --topo single,1
sh2# sudo mn --topo single,1

Create vxlan interface on each side

mn1> sh ovs-vsctl add-port s1 vxlan
mn2> sh ovs-vsctl add-port s1 vxlan

Setup vxlan interface on each side

mn1> sh ovs-vsctl set interface vxlan type=vxlan option:remote_ip=140.113.215.200
mn2> sh ovs-vsctl set interface vxlan type=vxlan option:remote_ip=140.113.215.191

Setup IP for hosts

mn1> h1 ifconfig h1-eth0 10.0.0.1
mn2> h1 ifconfig h1-eth0 10.0.0.2
mn1> h1 ping -c1 10.0.0.2

Advanced Configuration

Manually assign VXLAN Network ID (VNI) and/or OpenFlow port number

e.g. VNI=5566, OF_PORT=9

ovs-vsctl set interface vxlan type=vxlan option:remote_ip=140.113.215.200 option:key=5566 ofport_request=9

Assign VNI flow by flow

(Useful when implementing multi-tenant environment)

ovs-vsctl set interface vxlan type=vxlan option:remote_ip=140.113.215.200 option:key=flow ofport_request=9

and then setup your flow entries by

ovs-ofctl add-flow s1 in_port=1,actions=set_field:5566->tun_id,output:9
ovs-ofctl add-flow s1 in_port=9,tun_id=5566,actions=output:1