Use OVS in userspace

It no longer requires kernel module when running in container environment
However, privileged mode is still required for Mininet to create namespaces

Change-Id: I04deefa9c8479cd85e6ca4f1e7349baf0bba8a76
diff --git a/trellis/trellis.py b/trellis/trellis.py
index 147ad80..61a0d88 100755
--- a/trellis/trellis.py
+++ b/trellis/trellis.py
@@ -64,13 +64,13 @@
         dhcp6 = self.addHost('dhcp6', cls=Dhcp6Server, mac='00:99:66:00:00:01', ips=['2000::3fd/120'], gateway='2000::3ff')
 
         # Control plane switch (for DHCP servers)
-        cs1 = self.addSwitch('cs1', cls=OVSBridge)
+        cs1 = self.addSwitch('cs1', cls=OVSBridge, datapath='user')
         self.addLink(cs1, s205)
         self.addLink(dhcp, cs1)
         self.addLink(dhcp6, cs1)
 
         # Control plane switch (for quagga fpm)
-        cs0 = self.addSwitch('cs0', cls=OVSBridge)
+        cs0 = self.addSwitch('cs0', cls=OVSBridge, datapath='user')
 
         # Control plane NAT (for quagga fpm)
         nat = self.addHost('nat', cls=NAT,
@@ -110,7 +110,7 @@
 if __name__ == "__main__":
     setLogLevel('debug')
     topo = Trellis()
-    switch = partial(OVSSwitch, protocols='OpenFlow13')
+    switch = partial(OVSSwitch, protocols='OpenFlow13', datapath='user')
     arguments = parse_trellis_args()
     set_up_zebra_config(arguments.controllers)
     net = get_mininet(arguments, topo, switch)
diff --git a/trellis/trellis_double_tagged.py b/trellis/trellis_double_tagged.py
index c7db067..c4c4748 100755
--- a/trellis/trellis_double_tagged.py
+++ b/trellis/trellis_double_tagged.py
@@ -68,13 +68,13 @@
         dhcp6 = self.addHost('dhcp6', cls=Dhcp6Server, mac='00:99:66:00:00:01', ips=['2000::3fd/120'], gateway='2000::3ff')
 
         # Control plane switch (for DHCP servers)
-        cs1 = self.addSwitch('cs1', cls=OVSBridge)
+        cs1 = self.addSwitch('cs1', cls=OVSBridge, datapath='user')
         self.addLink(cs1, s205)
         self.addLink(dhcp, cs1)
         self.addLink(dhcp6, cs1)
 
         # Control plane switch (for quagga fpm)
-        cs0 = self.addSwitch('cs0', cls=OVSBridge)
+        cs0 = self.addSwitch('cs0', cls=OVSBridge, datapath='user')
 
         # Control plane NAT (for quagga fpm)
         nat = self.addHost('nat', cls=NAT,
@@ -114,7 +114,7 @@
 if __name__ == "__main__":
     setLogLevel('debug')
     topo = Trellis()
-    switch = partial(OVSSwitch, protocols='OpenFlow13')
+    switch = partial(OVSSwitch, protocols='OpenFlow13', datapath='user')
     arguments = parse_trellis_args()
     set_up_zebra_config(arguments.controllers)
     net = get_mininet(arguments, topo, switch)
diff --git a/trellis/trellis_dualhome.py b/trellis/trellis_dualhome.py
index 04c0a21..7272dde 100755
--- a/trellis/trellis_dualhome.py
+++ b/trellis/trellis_dualhome.py
@@ -89,13 +89,13 @@
         dhcp6 = self.addHost('dhcp6', cls=Dhcp6Server, mac='00:99:66:00:00:01', ips=['2000::3fd/120'], gateway='2000::3ff')
 
         # Control plane switch (for DHCP servers)
-        cs1 = self.addSwitch('cs1', cls=OVSBridge)
+        cs1 = self.addSwitch('cs1', cls=OVSBridge, datapath='user')
         self.addLink(cs1, s205)
         self.addLink(dhcp, cs1)
         self.addLink(dhcp6, cs1)
 
         # Control plane switch (for quagga fpm)
-        cs0 = self.addSwitch('cs0', cls=OVSBridge)
+        cs0 = self.addSwitch('cs0', cls=OVSBridge, datapath='user')
 
         # Control plane NAT (for quagga fpm)
         nat = self.addHost('nat', cls=NAT,
@@ -178,7 +178,7 @@
 if __name__ == "__main__":
     setLogLevel('debug')
     topo = Trellis()
-    switch = partial(OVSSwitch, protocols='OpenFlow13')
+    switch = partial(OVSSwitch, protocols='OpenFlow13', datapath='user')
     arguments = parse_trellis_args()
     set_up_zebra_config(arguments.controllers)
     net = get_mininet(arguments, topo, switch)
diff --git a/trellis/trellis_duallink.py b/trellis/trellis_duallink.py
index 77b0169..e8753e5 100755
--- a/trellis/trellis_duallink.py
+++ b/trellis/trellis_duallink.py
@@ -71,13 +71,13 @@
         dhcp6 = self.addHost('dhcp6', cls=Dhcp6Server, mac='00:99:66:00:00:01', ips=['2000::3fd/120'], gateway='2000::3ff')
 
         # Data plane switch (for DHCP servers)
-        cs1 = self.addSwitch('cs1', cls=OVSBridge)
+        cs1 = self.addSwitch('cs1', cls=OVSBridge, datapath='user')
         self.addLink(cs1, s205)
         self.addLink(dhcp, cs1)
         self.addLink(dhcp6, cs1)
 
         # Control plane switch (for quagga fpm)
-        cs0 = self.addSwitch('cs0', cls=OVSBridge)
+        cs0 = self.addSwitch('cs0', cls=OVSBridge, datapath='user')
 
         # Control plane NAT (for quagga fpm)
         nat = self.addHost('nat', cls=NAT,
@@ -117,7 +117,7 @@
 if __name__ == "__main__":
     setLogLevel('debug')
     topo = Trellis()
-    switch = partial(OVSSwitch, protocols='OpenFlow13')
+    switch = partial(OVSSwitch, protocols='OpenFlow13', datapath='user')
     arguments = parse_trellis_args()
     set_up_zebra_config(arguments.controllers)
     net = get_mininet(arguments, topo, switch)
diff --git a/trellis/trellis_hag.py b/trellis/trellis_hag.py
index 9e2cda9..575a08a 100755
--- a/trellis/trellis_hag.py
+++ b/trellis/trellis_hag.py
@@ -94,13 +94,13 @@
         dhcp6 = self.addHost('dhcp6', cls=Dhcp6Server, mac='00:99:66:00:00:01', ips=['2000::3fd/120'], gateway='2000::3ff')
 
         # Dataplane L2 plane switch (for DHCP servers)
-        cs1 = self.addSwitch('cs1', cls=OVSBridge)
+        cs1 = self.addSwitch('cs1', cls=OVSBridge, datapath='user')
         self.addLink(cs1, s205)
         self.addLink(dhcp, cs1)
         self.addLink(dhcp6, cs1)
 
         # Control plane switch (for quagga fpm)
-        cs0 = self.addSwitch('cs0', cls=OVSBridge)
+        cs0 = self.addSwitch('cs0', cls=OVSBridge, datapath='user')
 
         # Control plane NAT (for quagga fpm)
         nat = self.addHost('nat', cls=NAT,
@@ -233,7 +233,7 @@
     setLogLevel('debug')
 
     topo = Trellis()
-    switch = partial(OVSSwitch, protocols='OpenFlow13')
+    switch = partial(OVSSwitch, protocols='OpenFlow13', datapath='user')
     arguments = parse_trellis_args()
     set_up_zebra_config(arguments.controllers)
     net = get_mininet(arguments, topo, switch)
diff --git a/trellis/trellis_hybrid.py b/trellis/trellis_hybrid.py
index 3bdea71..ab6e9d7 100755
--- a/trellis/trellis_hybrid.py
+++ b/trellis/trellis_hybrid.py
@@ -96,13 +96,13 @@
         dhcp6 = self.addHost('dhcp6', cls=Dhcp6Server, mac='00:99:66:00:00:01', ips=['2000::3fd/120'], gateway='2000::3ff')
 
         # Dataplane L2 plane switch (for DHCP servers)
-        cs1 = self.addSwitch('cs1', cls=OVSBridge)
+        cs1 = self.addSwitch('cs1', cls=OVSBridge, datapath='user')
         self.addLink(cs1, s205)
         self.addLink(dhcp, cs1)
         self.addLink(dhcp6, cs1)
 
         # Control plane switch (for quagga fpm)
-        cs0 = self.addSwitch('cs0', cls=OVSBridge)
+        cs0 = self.addSwitch('cs0', cls=OVSBridge, datapath='user')
 
         # Control plane NAT (for quagga fpm)
         nat = self.addHost('nat', cls=NAT,
@@ -235,7 +235,7 @@
     setLogLevel('debug')
 
     topo = Trellis()
-    switch = partial(OVSSwitch, protocols='OpenFlow13')
+    switch = partial(OVSSwitch, protocols='OpenFlow13', datapath='user')
     arguments = parse_trellis_args()
     set_up_zebra_config(arguments.controllers)
     net = get_mininet(arguments, topo, switch)
diff --git a/trellis/trellis_hybrid_v4.py b/trellis/trellis_hybrid_v4.py
index 1f45088..2db3b77 100755
--- a/trellis/trellis_hybrid_v4.py
+++ b/trellis/trellis_hybrid_v4.py
@@ -101,12 +101,12 @@
                             configFile='./dhcpd_hybrid_v4.conf')
 
         # Dataplane L2 plane switch (for DHCP servers)
-        cs1 = self.addSwitch('cs1', cls=OVSBridge)
+        cs1 = self.addSwitch('cs1', cls=OVSBridge, datapath='user')
         self.addLink(cs1, s205)
         self.addLink(dhcp, cs1)
 
         # Control plane switch (for quagga fpm)
-        cs0 = self.addSwitch('cs0', cls=OVSBridge)
+        cs0 = self.addSwitch('cs0', cls=OVSBridge, datapath='user')
 
         # Control plane NAT (for quagga fpm)
         nat = self.addHost('nat', cls=NAT,
@@ -290,7 +290,7 @@
     set_up_zebra_config(arguments.controllers)
 
     topo = Trellis()
-    switch = partial(ONOSOVSSwitch, protocols='OpenFlow13')
+    switch = partial(ONOSOVSSwitch, protocols='OpenFlow13', datapath='user')
     net = get_mininet(arguments, topo, switch)
 
     net.start()
diff --git a/trellis/trellis_remote_dhcp.py b/trellis/trellis_remote_dhcp.py
index 0c0043f..bf0f654 100755
--- a/trellis/trellis_remote_dhcp.py
+++ b/trellis/trellis_remote_dhcp.py
@@ -70,7 +70,7 @@
         self.addLink(h4v6, s205)
 
         # Control plane switch (for quagga fpm)
-        cs0 = self.addSwitch('cs0', cls=OVSBridge)
+        cs0 = self.addSwitch('cs0', cls=OVSBridge, datapath='user')
 
         # Control plane NAT (for quagga fpm)
         nat = self.addHost('nat', cls=NAT,
@@ -98,7 +98,7 @@
         self.addLink(r1, s205)
 
         # External switch behind r1
-        rs0 = self.addSwitch('rs0', cls=OVSBridge)
+        rs0 = self.addSwitch('rs0', cls=OVSBridge, datapath='user')
         self.addLink(r1, rs0)
 
         # External IPv4 Host behind r1
@@ -118,7 +118,7 @@
 if __name__ == "__main__":
     setLogLevel('debug')
     topo = Trellis()
-    switch = partial(OVSSwitch, protocols='OpenFlow13')
+    switch = partial(OVSSwitch, protocols='OpenFlow13', datapath='user')
     arguments = parse_trellis_args()
     set_up_zebra_config(arguments.controllers)
     net = get_mininet(arguments, topo, switch)
diff --git a/trellis/trellis_vlan.py b/trellis/trellis_vlan.py
index 433eb25..6fba7e7 100755
--- a/trellis/trellis_vlan.py
+++ b/trellis/trellis_vlan.py
@@ -44,7 +44,7 @@
         h3 = self.addHost('h3', cls=DhcpClient, mac='00:aa:00:00:00:03')
         h4 = self.addHost('h4', cls=DhcpClient, mac='00:aa:00:00:00:04')
         # In order to emulate tagged Quagga VM in h4
-        h4ovs = self.addSwitch('h4ovs', cls=OVSBridge)
+        h4ovs = self.addSwitch('h4ovs', cls=OVSBridge, datapath='user')
         self.addLink(h1, s204)
         self.addLink(h2, s204)
         self.addLink(h3, s205)
@@ -66,7 +66,7 @@
         self.addLink(dhcp, s205)
 
         # Control plane switch (for quagga fpm)
-        cs0 = self.addSwitch('cs0', cls=OVSBridge)
+        cs0 = self.addSwitch('cs0', cls=OVSBridge, datapath='user')
 
         # Control plane NAT (for quagga fpm)
         nat = self.addHost('nat', cls=NAT,
@@ -106,7 +106,7 @@
 if __name__ == "__main__":
     setLogLevel('debug')
     topo = Trellis()
-    switch = partial(OVSSwitch, protocols='OpenFlow13')
+    switch = partial(OVSSwitch, protocols='OpenFlow13', datapath='user')
     arguments = parse_trellis_args()
     set_up_zebra_config(arguments.controllers)
     net = get_mininet(arguments, topo, switch)