diff --git a/ofdpa/flows.py b/ofdpa/flows.py
index 52d4376..0033468 100755
--- a/ofdpa/flows.py
+++ b/ofdpa/flows.py
@@ -424,7 +424,318 @@
         delete_groups(self.controller, Groups)
 
 
-class L3VPNMPLS(base_tests.SimpleDataPlane):
+class _32VPN(base_tests.SimpleDataPlane):
+    """
+            Insert IP packet
+            Receive MPLS packet
+    """
+
+    def runTest(self):
+        if len(config["port_map"]) < 2:
+            logging.info("Port count less than 2, can't run this case")
+            return
+
+        intf_src_mac = [0x00, 0x00, 0x00, 0xcc, 0xcc, 0xcc]
+        dst_mac = [0x00, 0x00, 0x00, 0x22, 0x22, 0x00]
+        dip = 0xc0a80001
+        ports = config["port_map"].keys()
+        Groups = Queue.LifoQueue()
+        for port in ports:
+            # add l2 interface group
+            id = port
+            vlan_id = port
+            l2_gid, l2_msg = add_one_l2_interface_group(self.controller, port,
+                                                        vlan_id, True, True)
+            dst_mac[5] = vlan_id
+            # add MPLS interface group
+            mpls_gid, mpls_msg = add_mpls_intf_group(self.controller, l2_gid,
+                                                     dst_mac, intf_src_mac,
+                                                     vlan_id, id)
+            # add MPLS L3 VPN group
+            mpls_label_gid, mpls_label_msg = add_mpls_label_group(
+                    self.controller,
+                    subtype=OFDPA_MPLS_GROUP_SUBTYPE_L3_VPN_LABEL,
+                    index=id, ref_gid=mpls_gid, push_mpls_header=True,
+                    set_mpls_label=port, set_bos=1, set_ttl=32)
+            # ecmp_msg=add_l3_ecmp_group(self.controller, vlan_id, [mpls_label_gid])
+            do_barrier(self.controller)
+            # add vlan flow table
+            add_one_vlan_table_flow(self.controller, port, vlan_id, vrf=0,
+                                    flag=VLAN_TABLE_FLAG_ONLY_TAG)
+            # add termination flow
+            add_termination_flow(self.controller, port, 0x0800, intf_src_mac,
+                                 vlan_id)
+            # add routing flow
+            dst_ip = dip + (vlan_id << 8)
+            add_unicast_routing_flow(self.controller, 0x0800, dst_ip,
+                                     0xffffffff, mpls_label_gid)
+            Groups._put(l2_gid)
+            Groups._put(mpls_gid)
+            Groups._put(mpls_label_gid)
+        do_barrier(self.controller)
+
+        switch_mac = ':'.join(['%02X' % x for x in intf_src_mac])
+        for in_port in ports:
+            ip_src = '192.168.%02d.1' % (in_port)
+            for out_port in ports:
+                if in_port == out_port:
+                    continue
+                ip_dst = '192.168.%02d.1' % (out_port)
+                parsed_pkt = simple_tcp_packet(pktlen=100, dl_vlan_enable=True,
+                                               vlan_vid=(in_port),
+                                               eth_dst=switch_mac, ip_ttl=64,
+                                               ip_src=ip_src,
+                                               ip_dst=ip_dst)
+                pkt = str(parsed_pkt)
+                self.dataplane.send(in_port, pkt)
+                # build expect packet
+                mac_dst = '00:00:00:22:22:%02X' % (out_port)
+                label = (out_port, 0, 1, 32)
+                exp_pkt = mpls_packet(pktlen=104, dl_vlan_enable=True,
+                                      vlan_vid=(out_port), ip_ttl=63,
+                                      ip_src=ip_src,
+                                      ip_dst=ip_dst, eth_dst=mac_dst,
+                                      eth_src=switch_mac, label=[label])
+                pkt = str(exp_pkt)
+                verify_packet(self, pkt, out_port)
+                verify_no_other_packets(self)
+        delete_all_flows(self.controller)
+        delete_groups(self.controller, Groups)
+
+class _32EcmpVpn(base_tests.SimpleDataPlane):
+    """
+            Insert IP packet
+            Receive MPLS packet
+    """
+
+    def runTest(self):
+        if len(config["port_map"]) < 2:
+            logging.info("Port count less than 2, can't run this case")
+            return
+
+        intf_src_mac = [0x00, 0x00, 0x00, 0xcc, 0xcc, 0xcc]
+        dst_mac = [0x00, 0x00, 0x00, 0x22, 0x22, 0x00]
+        dip = 0xc0a80001
+        ports = config["port_map"].keys()
+        Groups = Queue.LifoQueue()
+        for port in ports:
+            # add l2 interface group
+            id = port
+            vlan_id = port
+            l2_gid, l2_msg = add_one_l2_interface_group(self.controller, port,
+                                                        vlan_id, True, True)
+            dst_mac[5] = vlan_id
+            # add MPLS interface group
+            mpls_gid, mpls_msg = add_mpls_intf_group(self.controller, l2_gid,
+                                                     dst_mac, intf_src_mac,
+                                                     vlan_id, id)
+            # add MPLS L3 VPN group
+            mpls_label_gid, mpls_label_msg = add_mpls_label_group(
+                    self.controller,
+                    subtype=OFDPA_MPLS_GROUP_SUBTYPE_L3_VPN_LABEL,
+                    index=id, ref_gid=mpls_gid, push_mpls_header=True,
+                    set_mpls_label=port, set_bos=1, set_ttl=32)
+            ecmp_msg=add_l3_ecmp_group(self.controller, vlan_id, [mpls_label_gid])
+            do_barrier(self.controller)
+            # add vlan flow table
+            add_one_vlan_table_flow(self.controller, port, vlan_id, vrf=0,
+                                    flag=VLAN_TABLE_FLAG_ONLY_TAG)
+            # add termination flow
+            add_termination_flow(self.controller, port, 0x0800, intf_src_mac,
+                                 vlan_id)
+            # add routing flow
+            dst_ip = dip + (vlan_id << 8)
+            add_unicast_routing_flow(self.controller, 0x0800, dst_ip,
+                                     0xffffffff, ecmp_msg.group_id)
+            Groups._put(l2_gid)
+            Groups._put(mpls_gid)
+            Groups._put(mpls_label_gid)
+            Groups._put(ecmp_msg.group_id)
+        do_barrier(self.controller)
+
+        switch_mac = ':'.join(['%02X' % x for x in intf_src_mac])
+        for in_port in ports:
+            ip_src = '192.168.%02d.1' % (in_port)
+            for out_port in ports:
+                if in_port == out_port:
+                    continue
+                ip_dst = '192.168.%02d.1' % (out_port)
+                parsed_pkt = simple_tcp_packet(pktlen=100, dl_vlan_enable=True,
+                                               vlan_vid=(in_port),
+                                               eth_dst=switch_mac, ip_ttl=64,
+                                               ip_src=ip_src,
+                                               ip_dst=ip_dst)
+                pkt = str(parsed_pkt)
+                self.dataplane.send(in_port, pkt)
+                # build expect packet
+                mac_dst = '00:00:00:22:22:%02X' % (out_port)
+                label = (out_port, 0, 1, 32)
+                exp_pkt = mpls_packet(pktlen=104, dl_vlan_enable=True,
+                                      vlan_vid=(out_port), ip_ttl=63,
+                                      ip_src=ip_src,
+                                      ip_dst=ip_dst, eth_dst=mac_dst,
+                                      eth_src=switch_mac, label=[label])
+                pkt = str(exp_pkt)
+                verify_packet(self, pkt, out_port)
+                verify_no_other_packets(self)
+        delete_all_flows(self.controller)
+        delete_groups(self.controller, Groups)
+
+class _32ECMPL3(base_tests.SimpleDataPlane):
+    """
+    Port1(vid=in_port, src=00:00:00:22:22:in_port, 192.168.outport.1) ,
+    Port2(vid=outport, dst=00:00:00:22:22:outport, 192.168.outport.1)
+    """
+
+    def runTest(self):
+        Groups = Queue.LifoQueue()
+        if len(config["port_map"]) < 2:
+            logging.info("Port count less than 2, can't run this case")
+            return
+
+        intf_src_mac = [0x00, 0x00, 0x00, 0xcc, 0xcc, 0xcc]
+        dst_mac = [0x00, 0x00, 0x00, 0x22, 0x22, 0x00]
+        dip = 0xc0a80001
+        # Hashes Test Name and uses it as id for installing unique groups
+        ports = config["port_map"].keys()
+        for port in ports:
+            vlan_id = port
+            id = port
+            # add l2 interface group
+            l2_gid, msg = add_one_l2_interface_group(self.controller, port,
+                                                     vlan_id=vlan_id,
+                                                     is_tagged=True,
+                                                     send_barrier=False)
+            dst_mac[5] = vlan_id
+            l3_msg = add_l3_unicast_group(self.controller, port, vlanid=vlan_id,
+                                          id=id, src_mac=intf_src_mac,
+                                          dst_mac=dst_mac)
+            ecmp_msg = add_l3_ecmp_group(self.controller, id, [l3_msg.group_id])
+            # add vlan flow table
+            add_one_vlan_table_flow(self.controller, port, vlan_id,
+                                    flag=VLAN_TABLE_FLAG_ONLY_TAG)
+            # add termination flow
+            add_termination_flow(self.controller, port, 0x0800, intf_src_mac,
+                                 vlan_id)
+            # add unicast routing flow
+            dst_ip = dip + (vlan_id << 8)
+            add_unicast_routing_flow(self.controller, 0x0800, dst_ip,
+                                     0xffffffff, ecmp_msg.group_id)
+            Groups._put(l2_gid)
+            Groups._put(l3_msg.group_id)
+            Groups._put(ecmp_msg.group_id)
+        do_barrier(self.controller)
+
+        switch_mac = ':'.join(['%02X' % x for x in intf_src_mac])
+        for in_port in ports:
+            mac_src = '00:00:00:22:22:%02X' % in_port
+            ip_src = '192.168.%02d.1' % in_port
+            for out_port in ports:
+                if in_port == out_port:
+                    continue
+                ip_dst = '192.168.%02d.1' % out_port
+                parsed_pkt = simple_tcp_packet(pktlen=100, dl_vlan_enable=True,
+                                               vlan_vid=in_port,
+                                               eth_dst=switch_mac,
+                                               eth_src=mac_src, ip_ttl=64,
+                                               ip_src=ip_src,
+                                               ip_dst=ip_dst)
+                pkt = str(parsed_pkt)
+                self.dataplane.send(in_port, pkt)
+                # build expected packet
+                mac_dst = '00:00:00:22:22:%02X' % out_port
+                exp_pkt = simple_tcp_packet(pktlen=100, dl_vlan_enable=True,
+                                            vlan_vid=out_port,
+                                            eth_dst=mac_dst, eth_src=switch_mac,
+                                            ip_ttl=63,
+                                            ip_src=ip_src, ip_dst=ip_dst)
+                pkt = str(exp_pkt)
+                verify_packet(self, pkt, out_port)
+                verify_no_other_packets(self)
+        delete_all_flows(self.controller)
+        delete_groups(self.controller, Groups)
+
+
+class _24VPN(base_tests.SimpleDataPlane):
+    """
+            Insert IP packet
+            Receive MPLS packet
+    """
+
+    def runTest(self):
+        if len(config["port_map"]) < 2:
+            logging.info("Port count less than 2, can't run this case")
+            return
+
+        intf_src_mac = [0x00, 0x00, 0x00, 0xcc, 0xcc, 0xcc]
+        dst_mac = [0x00, 0x00, 0x00, 0x22, 0x22, 0x00]
+        dip = 0xc0a80001
+        ports = config["port_map"].keys()
+        Groups = Queue.LifoQueue()
+        for port in ports:
+            # add l2 interface group
+            id = port
+            vlan_id = port
+            l2_gid, l2_msg = add_one_l2_interface_group(self.controller, port,
+                                                        vlan_id, True, True)
+            dst_mac[5] = vlan_id
+            # add MPLS interface group
+            mpls_gid, mpls_msg = add_mpls_intf_group(self.controller, l2_gid,
+                                                     dst_mac, intf_src_mac,
+                                                     vlan_id, id)
+            # add MPLS L3 VPN group
+            mpls_label_gid, mpls_label_msg = add_mpls_label_group(
+                    self.controller,
+                    subtype=OFDPA_MPLS_GROUP_SUBTYPE_L3_VPN_LABEL,
+                    index=id, ref_gid=mpls_gid, push_mpls_header=True,
+                    set_mpls_label=port, set_bos=1, set_ttl=32)
+            # ecmp_msg=add_l3_ecmp_group(self.controller, vlan_id, [mpls_label_gid])
+            do_barrier(self.controller)
+            # add vlan flow table
+            add_one_vlan_table_flow(self.controller, port, vlan_id, vrf=0,
+                                    flag=VLAN_TABLE_FLAG_ONLY_TAG)
+            # add termination flow
+            add_termination_flow(self.controller, port, 0x0800, intf_src_mac,
+                                 vlan_id)
+            # add routing flow
+            dst_ip = dip + (vlan_id << 8)
+            add_unicast_routing_flow(self.controller, 0x0800, dst_ip,
+                                     0xffffff00, mpls_label_gid)
+            Groups._put(l2_gid)
+            Groups._put(mpls_gid)
+            Groups._put(mpls_label_gid)
+        do_barrier(self.controller)
+
+        switch_mac = ':'.join(['%02X' % x for x in intf_src_mac])
+        for in_port in ports:
+            ip_src = '192.168.%02d.1' % (in_port)
+            for out_port in ports:
+                if in_port == out_port:
+                    continue
+                ip_dst = '192.168.%02d.1' % (out_port)
+                parsed_pkt = simple_tcp_packet(pktlen=100, dl_vlan_enable=True,
+                                               vlan_vid=(in_port),
+                                               eth_dst=switch_mac, ip_ttl=64,
+                                               ip_src=ip_src,
+                                               ip_dst=ip_dst)
+                pkt = str(parsed_pkt)
+                self.dataplane.send(in_port, pkt)
+                # build expect packet
+                mac_dst = '00:00:00:22:22:%02X' % (out_port)
+                label = (out_port, 0, 1, 32)
+                exp_pkt = mpls_packet(pktlen=104, dl_vlan_enable=True,
+                                      vlan_vid=(out_port), ip_ttl=63,
+                                      ip_src=ip_src,
+                                      ip_dst=ip_dst, eth_dst=mac_dst,
+                                      eth_src=switch_mac, label=[label])
+                pkt = str(exp_pkt)
+                verify_packet(self, pkt, out_port)
+                verify_no_other_packets(self)
+        delete_all_flows(self.controller)
+        delete_groups(self.controller, Groups)
+
+
+class _24EcmpVpn(base_tests.SimpleDataPlane):
     """
 	    Insert IP packet
 	    Receive MPLS packet
@@ -507,13 +818,15 @@
         delete_groups(self.controller, Groups)
 
 
-class _32VPN(base_tests.SimpleDataPlane):
+
+class _24ECMPL3(base_tests.SimpleDataPlane):
     """
-            Insert IP packet
-            Receive MPLS packet
+    Port1(vid=in_port, src=00:00:00:22:22:in_port, 192.168.outport.1) ,
+    Port2(vid=outport, dst=00:00:00:22:22:outport, 192.168.outport.1)
     """
 
     def runTest(self):
+        Groups = Queue.LifoQueue()
         if len(config["port_map"]) < 2:
             logging.info("Port count less than 2, can't run this case")
             return
@@ -521,71 +834,65 @@
         intf_src_mac = [0x00, 0x00, 0x00, 0xcc, 0xcc, 0xcc]
         dst_mac = [0x00, 0x00, 0x00, 0x22, 0x22, 0x00]
         dip = 0xc0a80001
+        # Hashes Test Name and uses it as id for installing unique groups
         ports = config["port_map"].keys()
-        Groups = Queue.LifoQueue()
         for port in ports:
-            # add l2 interface group
-            id = port
             vlan_id = port
-            l2_gid, l2_msg = add_one_l2_interface_group(self.controller, port,
-                                                        vlan_id, True, True)
+            id = port
+            # add l2 interface group
+            l2_gid, msg = add_one_l2_interface_group(self.controller, port,
+                                                     vlan_id=vlan_id,
+                                                     is_tagged=True,
+                                                     send_barrier=False)
             dst_mac[5] = vlan_id
-            # add MPLS interface group
-            mpls_gid, mpls_msg = add_mpls_intf_group(self.controller, l2_gid,
-                                                     dst_mac, intf_src_mac,
-                                                     vlan_id, id)
-            # add MPLS L3 VPN group
-            mpls_label_gid, mpls_label_msg = add_mpls_label_group(
-                    self.controller,
-                    subtype=OFDPA_MPLS_GROUP_SUBTYPE_L3_VPN_LABEL,
-                    index=id, ref_gid=mpls_gid, push_mpls_header=True,
-                    set_mpls_label=port, set_bos=1, set_ttl=32)
-            # ecmp_msg=add_l3_ecmp_group(self.controller, vlan_id, [mpls_label_gid])
-            do_barrier(self.controller)
+            l3_msg = add_l3_unicast_group(self.controller, port, vlanid=vlan_id,
+                                          id=id, src_mac=intf_src_mac,
+                                          dst_mac=dst_mac)
+            ecmp_msg = add_l3_ecmp_group(self.controller, id, [l3_msg.group_id])
             # add vlan flow table
-            add_one_vlan_table_flow(self.controller, port, vlan_id, vrf=0,
+            add_one_vlan_table_flow(self.controller, port, vlan_id,
                                     flag=VLAN_TABLE_FLAG_ONLY_TAG)
             # add termination flow
             add_termination_flow(self.controller, port, 0x0800, intf_src_mac,
                                  vlan_id)
-            # add routing flow
+            # add unicast routing flow
             dst_ip = dip + (vlan_id << 8)
             add_unicast_routing_flow(self.controller, 0x0800, dst_ip,
-                                     0xffffffff, mpls_label_gid)
+                                     0xffffff00, ecmp_msg.group_id)
             Groups._put(l2_gid)
-            Groups._put(mpls_gid)
-            Groups._put(mpls_label_gid)
+            Groups._put(l3_msg.group_id)
+            Groups._put(ecmp_msg.group_id)
         do_barrier(self.controller)
 
         switch_mac = ':'.join(['%02X' % x for x in intf_src_mac])
         for in_port in ports:
-            ip_src = '192.168.%02d.1' % (in_port)
+            mac_src = '00:00:00:22:22:%02X' % in_port
+            ip_src = '192.168.%02d.1' % in_port
             for out_port in ports:
                 if in_port == out_port:
                     continue
-                ip_dst = '192.168.%02d.1' % (out_port)
+                ip_dst = '192.168.%02d.1' % out_port
                 parsed_pkt = simple_tcp_packet(pktlen=100, dl_vlan_enable=True,
-                                               vlan_vid=(in_port),
-                                               eth_dst=switch_mac, ip_ttl=64,
+                                               vlan_vid=in_port,
+                                               eth_dst=switch_mac,
+                                               eth_src=mac_src, ip_ttl=64,
                                                ip_src=ip_src,
                                                ip_dst=ip_dst)
                 pkt = str(parsed_pkt)
                 self.dataplane.send(in_port, pkt)
-                # build expect packet
-                mac_dst = '00:00:00:22:22:%02X' % (out_port)
-                label = (out_port, 0, 1, 32)
-                exp_pkt = mpls_packet(pktlen=104, dl_vlan_enable=True,
-                                      vlan_vid=(out_port), ip_ttl=63,
-                                      ip_src=ip_src,
-                                      ip_dst=ip_dst, eth_dst=mac_dst,
-                                      eth_src=switch_mac, label=[label])
+                # build expected packet
+                mac_dst = '00:00:00:22:22:%02X' % out_port
+                exp_pkt = simple_tcp_packet(pktlen=100, dl_vlan_enable=True,
+                                            vlan_vid=out_port,
+                                            eth_dst=mac_dst, eth_src=switch_mac,
+                                            ip_ttl=63,
+                                            ip_src=ip_src, ip_dst=ip_dst)
                 pkt = str(exp_pkt)
                 verify_packet(self, pkt, out_port)
                 verify_no_other_packets(self)
         delete_all_flows(self.controller)
         delete_groups(self.controller, Groups)
 
-
 @disabled
 class MPLSBUG(base_tests.SimpleDataPlane):
     def runTest(self):
@@ -911,154 +1218,6 @@
         delete_groups(self.controller, Groups)
 
 
-class _32ECMPL3(base_tests.SimpleDataPlane):
-    """
-    Port1(vid=in_port, src=00:00:00:22:22:in_port, 192.168.outport.1) ,
-    Port2(vid=outport, dst=00:00:00:22:22:outport, 192.168.outport.1)
-    """
-
-    def runTest(self):
-        Groups = Queue.LifoQueue()
-        if len(config["port_map"]) < 2:
-            logging.info("Port count less than 2, can't run this case")
-            return
-
-        intf_src_mac = [0x00, 0x00, 0x00, 0xcc, 0xcc, 0xcc]
-        dst_mac = [0x00, 0x00, 0x00, 0x22, 0x22, 0x00]
-        dip = 0xc0a80001
-        # Hashes Test Name and uses it as id for installing unique groups
-        ports = config["port_map"].keys()
-        for port in ports:
-            vlan_id = port
-            id = port
-            # add l2 interface group
-            l2_gid, msg = add_one_l2_interface_group(self.controller, port,
-                                                     vlan_id=vlan_id,
-                                                     is_tagged=True,
-                                                     send_barrier=False)
-            dst_mac[5] = vlan_id
-            l3_msg = add_l3_unicast_group(self.controller, port, vlanid=vlan_id,
-                                          id=id, src_mac=intf_src_mac,
-                                          dst_mac=dst_mac)
-            ecmp_msg = add_l3_ecmp_group(self.controller, id, [l3_msg.group_id])
-            # add vlan flow table
-            add_one_vlan_table_flow(self.controller, port, vlan_id,
-                                    flag=VLAN_TABLE_FLAG_ONLY_TAG)
-            # add termination flow
-            add_termination_flow(self.controller, port, 0x0800, intf_src_mac,
-                                 vlan_id)
-            # add unicast routing flow
-            dst_ip = dip + (vlan_id << 8)
-            add_unicast_routing_flow(self.controller, 0x0800, dst_ip,
-                                     0xffffffff, ecmp_msg.group_id)
-            Groups._put(l2_gid)
-            Groups._put(l3_msg.group_id)
-            Groups._put(ecmp_msg.group_id)
-        do_barrier(self.controller)
-
-        switch_mac = ':'.join(['%02X' % x for x in intf_src_mac])
-        for in_port in ports:
-            mac_src = '00:00:00:22:22:%02X' % in_port
-            ip_src = '192.168.%02d.1' % in_port
-            for out_port in ports:
-                if in_port == out_port:
-                    continue
-                ip_dst = '192.168.%02d.1' % out_port
-                parsed_pkt = simple_tcp_packet(pktlen=100, dl_vlan_enable=True,
-                                               vlan_vid=in_port,
-                                               eth_dst=switch_mac,
-                                               eth_src=mac_src, ip_ttl=64,
-                                               ip_src=ip_src,
-                                               ip_dst=ip_dst)
-                pkt = str(parsed_pkt)
-                self.dataplane.send(in_port, pkt)
-                # build expected packet
-                mac_dst = '00:00:00:22:22:%02X' % out_port
-                exp_pkt = simple_tcp_packet(pktlen=100, dl_vlan_enable=True,
-                                            vlan_vid=out_port,
-                                            eth_dst=mac_dst, eth_src=switch_mac,
-                                            ip_ttl=63,
-                                            ip_src=ip_src, ip_dst=ip_dst)
-                pkt = str(exp_pkt)
-                verify_packet(self, pkt, out_port)
-                verify_no_other_packets(self)
-        delete_all_flows(self.controller)
-        delete_groups(self.controller, Groups)
-
-
-class _24ECMPL3(base_tests.SimpleDataPlane):
-    """
-    Port1(vid=in_port, src=00:00:00:22:22:in_port, 192.168.outport.1) ,
-    Port2(vid=outport, dst=00:00:00:22:22:outport, 192.168.outport.1)
-    """
-
-    def runTest(self):
-        Groups = Queue.LifoQueue()
-        if len(config["port_map"]) < 2:
-            logging.info("Port count less than 2, can't run this case")
-            return
-
-        intf_src_mac = [0x00, 0x00, 0x00, 0xcc, 0xcc, 0xcc]
-        dst_mac = [0x00, 0x00, 0x00, 0x22, 0x22, 0x00]
-        dip = 0xc0a80001
-        # Hashes Test Name and uses it as id for installing unique groups
-        ports = config["port_map"].keys()
-        for port in ports:
-            vlan_id = port
-            id = port
-            # add l2 interface group
-            l2_gid, msg = add_one_l2_interface_group(self.controller, port,
-                                                     vlan_id=vlan_id,
-                                                     is_tagged=True,
-                                                     send_barrier=False)
-            dst_mac[5] = vlan_id
-            l3_msg = add_l3_unicast_group(self.controller, port, vlanid=vlan_id,
-                                          id=id, src_mac=intf_src_mac,
-                                          dst_mac=dst_mac)
-            ecmp_msg = add_l3_ecmp_group(self.controller, id, [l3_msg.group_id])
-            # add vlan flow table
-            add_one_vlan_table_flow(self.controller, port, vlan_id,
-                                    flag=VLAN_TABLE_FLAG_ONLY_TAG)
-            # add termination flow
-            add_termination_flow(self.controller, port, 0x0800, intf_src_mac,
-                                 vlan_id)
-            # add unicast routing flow
-            dst_ip = dip + (vlan_id << 8)
-            add_unicast_routing_flow(self.controller, 0x0800, dst_ip,
-                                     0xffffff00, ecmp_msg.group_id)
-            Groups._put(l2_gid)
-            Groups._put(l3_msg.group_id)
-            Groups._put(ecmp_msg.group_id)
-        do_barrier(self.controller)
-
-        switch_mac = ':'.join(['%02X' % x for x in intf_src_mac])
-        for in_port in ports:
-            mac_src = '00:00:00:22:22:%02X' % in_port
-            ip_src = '192.168.%02d.1' % in_port
-            for out_port in ports:
-                if in_port == out_port:
-                    continue
-                ip_dst = '192.168.%02d.1' % out_port
-                parsed_pkt = simple_tcp_packet(pktlen=100, dl_vlan_enable=True,
-                                               vlan_vid=in_port,
-                                               eth_dst=switch_mac,
-                                               eth_src=mac_src, ip_ttl=64,
-                                               ip_src=ip_src,
-                                               ip_dst=ip_dst)
-                pkt = str(parsed_pkt)
-                self.dataplane.send(in_port, pkt)
-                # build expected packet
-                mac_dst = '00:00:00:22:22:%02X' % out_port
-                exp_pkt = simple_tcp_packet(pktlen=100, dl_vlan_enable=True,
-                                            vlan_vid=out_port,
-                                            eth_dst=mac_dst, eth_src=switch_mac,
-                                            ip_ttl=63,
-                                            ip_src=ip_src, ip_dst=ip_dst)
-                pkt = str(exp_pkt)
-                verify_packet(self, pkt, out_port)
-                verify_no_other_packets(self)
-        delete_all_flows(self.controller)
-        delete_groups(self.controller, Groups)
 
 
 class _24UcastTagged(base_tests.SimpleDataPlane):
