diff --git a/tests/FuncUtils.py b/tests/FuncUtils.py
index 1aefae1..6b346a7 100644
--- a/tests/FuncUtils.py
+++ b/tests/FuncUtils.py
@@ -278,6 +278,18 @@
     match_send_flowadd(self, match, priority, of_ports[1])
     return (pkt_match, match)  
 
+def match_arp_opcode(self,of_ports,priority=None):
+    #Generate Match_Arp_Opcode
+
+    #Create a simple arp packet and generate match on arp opcode 
+    pkt_match = simple_arp_packet(arp_op=1)
+    match = parse.packet_to_flow_match(pkt_match)
+    self.assertTrue(match is not None, "Could not generate flow match from pkt")
+
+    match.wildcards = ofp.OFPFW_ALL^ofp.OFPFW_NW_PROTO
+    match_send_flowadd(self, match, priority, of_ports[1])
+    return (pkt_match, match)  
+
 def match_arp_sender(self,of_ports,priority=None):
     #Generate Match_Arp_Sender
 
diff --git a/tests/flow_matches.py b/tests/flow_matches.py
index 2216899..71e36b8 100644
--- a/tests/flow_matches.py
+++ b/tests/flow_matches.py
@@ -650,6 +650,42 @@
         self.dataplane.send(of_ports[0], str(pkt2))
         verify_packet_in(self, str(pkt2), of_ports[0], ofp.OFPR_NO_MATCH)
 
+class ArpOpcode(base_tests.SimpleDataPlane):
+
+    """"Verify match on single Header Field -- Arp Protocol"""
+
+    def runTest(self):
+
+        logging.info("Running Arp Protocol test")
+
+        of_ports = config["port_map"].keys()
+        of_ports.sort()
+        self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
+    
+        #Clear Switch State
+        delete_all_flows(self.controller)
+
+        egress_port=of_ports[1]
+        no_ports=set(of_ports).difference([egress_port])
+        yes_ports = of_ports[1]
+    
+        logging.info("Inserting a flow with match on Arp Protocol Opcode")
+        logging.info("Sending matching and non-matching arp packets")
+        logging.info("Verifying only matching packets implements the action specified in the flow")
+
+        #Create a flow matching on ARP Opcode 
+        (pkt,match) = match_arp_opcode(self,of_ports)
+
+        #Send Packet matching the flow 
+        self.dataplane.send(of_ports[0], str(pkt))
+
+        #Verify packet implements the action specified in the flow
+        receive_pkt_check(self.dataplane,pkt,[yes_ports],no_ports,self)
+        
+        #Create a non-matching packet , verify packet_in get generated
+        pkt2 = simple_arp_packet(arp_op=2)
+        self.dataplane.send(of_ports[0], str(pkt2))
+        verify_packet_in(self, str(pkt2), of_ports[0], ofp.OFPR_NO_MATCH)
 
 class ArpSenderIP(base_tests.SimpleDataPlane):
 
