diff --git a/Detailed_Testing_Methodology.txt b/Detailed_Testing_Methodology.txt
index a2c94e2..34922cc 100644
--- a/Detailed_Testing_Methodology.txt
+++ b/Detailed_Testing_Methodology.txt
@@ -979,3 +979,844 @@
 
 24. Sequential execution  -- TBD 
 
+
+
+
+
+****     Counters     ****
+
+
+
+1. Received Packets per Flow
+
+
+Test Description: Verify that packet_count in the Flow_Stats reply increments in accordance with the packets in flow  
+
+Test mode: Automated
+Test Tile: PktPerFlow
+POrts: 3 (1 Control Plane 2 Data Plane)
+Initial State: Default (Clear switch state), Connection setup
+Test-Field: Mandatory
+
+
+Test Notes: 
+
+a) Insert a flow , match = ingress_port
+b) Send N packet matching the flow  i.e packets should be sent on ingress_port
+c) Send flow_stats_request for the flow 
+d) Verify packet_count = N in the flow_stats_reply
+
+
+
+2. Received Bytes per Flow
+
+
+Test Description: Verify that byte_count in the Flow_Stats reply increments in accordance with the bytes in flow  
+
+Test mode: Automated
+Test Tile: BytPerFlow
+POrts: 3 (1 Control Plane 2 Data Plane)
+Initial State: Default (Clear switch state), Connection setup
+Test-Field: Mandatory
+
+
+Test Notes: 
+
+a) Insert a flow , match = ingress_port
+b) Send N packet matching the flow  i.e packets should be sent on ingress_port
+c) Send flow_stats_request for the flow 
+d) Verify byte_count = N*(no. of bytes in one packet) in the flow_stats_reply
+
+
+
+3. Duration in sec per Flow
+
+
+Test Description: Verify that duration_sec in the Flow_Stats reply increments in accordance with the time that flow was alive in sec 
+
+Test mode: Automated
+Test Tile: DurationPerFlow
+POrts: 3 (1 Control Plane 2 Data Plane)
+Initial State: Default (Clear switch state), Connection setup
+Test-Field: Mandatory
+
+
+Test Notes: 
+
+a) Insert a any flow 
+b) Send flow_stats_request for that flow periodically after n sec intervals upto timeout of y 
+c) Verify each flow_stats_reply has duration_sec field incrementing as n , 2n , 3n .. y 
+
+
+
+4. Duration in nsec per flow
+
+
+Test Description: Verify that duration_nsec in the flow_stats repl increments in accordance with the time flow has been alive in nanoseconds 
+beyond duration_sec.
+
+Test mode: Automated
+Test Tile: DurationPerFlow
+POrts: 3 (1 Control Plane 2 Data Plane)
+Initial State: Default (Clear switch state), Connection setup
+Test-Field: Mandatory
+
+
+Test Notes: 
+
+a) Insert any flow 
+b) Send flow_stats_request periodically after n sec intervals upto timeout of y 
+c) Verify each flow_stats_reply has duration_sec field incrementing as n , 2n , 3n .. y and read out duration_nsec field ( Verification of nsec field 
+is out of scope)
+
+
+
+5. Received packets per port
+
+
+Test Description: Verify that rx_packets in the Port_Stats reply increments in accordance with the packets recieved on that port
+
+Test mode: Automated
+Test Tile: RxPktPerPort
+POrts: 3 (1 Control Plane 2 Data Plane)
+Initial State: Default (Clear switch state), Connection setup
+Test-Field: Mandatory
+
+
+Test Notes: 
+
+a) Insert a flow with match on ingress_port
+b) Send N packets on the ingress_port 
+c) Send port_stats request for port=ingress_port
+d) Verify port_stats_reply has rx_packet=N
+
+
+
+
+6. Transmitted packets per port
+
+
+Test Description: Verify that tx_packets in the Port_Stats reply increments in accordance with the packets transmitted from a port  
+
+Test mode: Automated
+Test Tile: TxPktPerPort
+POrts: 3 (1 Control Plane 2 Data Plane)
+Initial State: Default (Clear switch state), Connection setup
+Test-Field: Mandatory
+
+
+Test Notes: 
+
+a) Insert a flow with match on ingress_port, action output = egress_port
+b) Send N packets on the ingress_port
+c) Send port_stats request for port=ingress_port
+d) Verify port_stats_reply had tx_packets=N   
+
+
+
+7. Received Bytes per port
+
+
+Test Description: Verify that rx_bytes in the Port_Stats reply increments in accordance with the bytes recieved on a port  
+
+Test mode: Automated
+Test Tile: RxBytPerPort
+POrts: 3 (1 Control Plane 2 Data Plane)
+Initial State: Default (Clear switch state), Connection setup
+Test-Field: Mandatory
+
+
+Test Notes: 
+
+a) Insert a flow with match on ingress_port, action output = egress_port
+b) Send N packet matching the flow  
+c) Send port_stats request for port=ingress_port
+d) Verify port_stats_reply had rx_bytes=N*(no. of bytes in a packet) 
+
+
+
+8. Transmitted Bytes per port
+
+
+Test Description: Verify that tx_bytes in the Port_Stats reply increments in accordance with the bytes transmitted from a port  
+
+Test mode: Automated
+Test Tile: TxBytPerPort
+POrts: 3 (1 Control Plane 2 Data Plane)
+Initial State: Default (Clear switch state), Connection setup
+Test-Field: Mandatory
+
+
+Test Notes: 
+
+a) Insert a flow with match on ingress_port, action output = egress_port
+b) Send N packet matching the flow  
+c) Send port_stats request for port=ingress_port
+d) Verify port_stats_reply had tx_bytes=N*(no. of bytes in a packet) 
+
+
+
+9. Recieve Drops per port (TBD ---> Verification of counter incrementing correctly)
+
+
+Test Description: Verify that rx_dropped counters in the Port_Stats reply increments in accordance with the packets dropped by RX  
+
+Test mode: Automated
+Test Tile: RxDrops
+POrts: 3 (1 Control Plane 2 Data Plane)
+Initial State: Default (Clear switch state), Connection setup
+Test-Field: Mandatory
+
+Test Notes :
+
+a) Send port_stats request for port=ingress_port
+b) Verify port_stats reply has rx_dropped count
+
+
+
+
+
+10. Transmit Drops per port (TBD ---> Verification of counter incrementing correctly)
+
+
+Test Description: Verify that tx_dropped counters in the Port_Stats reply increments in accordance with the packets dropped by TX
+
+Test mode: Automated
+Test Tile: TxDrops
+POrts: 3 (1 Control Plane 2 Data Plane)
+Initial State: Default (Clear switch state), Connection setup
+Test-Field: Manadatory
+
+
+a) Send port_stats request for port=ingress_port
+b) Verify port_stats reply has tx_dropped count
+
+
+
+
+11. Recieve Errors (TBD ---> Verification of counter incrementing correctly)
+
+
+Test Description: Verify that rx_errors counters in the Port_Stats reply increments in accordance with number of recieved error  
+		  This is a super-set of more specific receive errors and should be greater than or equal to the sum of all
+                  rx_*_err values.
+
+Test mode: Automated
+Test Tile: RxErrors
+POrts: 3 (1 Control Plane 2 Data Plane)
+Initial State: Default (Clear switch state), Connection setup
+Test-Field: Mandatory
+
+
+Test Notes: 
+
+a) Send port_stats request for port=ingress_port
+b) Verify port_stats reply has rx_errors count
+
+
+
+12. Transmit Errors (TBD ---> Verification of counter incrementing correctly)
+
+
+Test Description: Verify that tx_errors counters in the Port_Stats reply increments in accordance with number of trasmit errors  
+
+Test mode: Automated
+Test Tile: TxErrors
+POrts: 3 (1 Control Plane 2 Data Plane)
+Initial State: Default (Clear switch state), Connection setup
+Test-Field: Mandatory
+
+
+Test Notes: 
+
+a) Send port_stats request for port=ingress_port
+b) Verify port_stats reply has tx_errors count
+
+
+
+13. Recieve Frame Errors (TBD ---> Verification of counter incrementing correctly)
+
+
+Test Description: Verify that rx_frm_err counters in the Port_Stats reply increments in accordance with the number of frame alignment errors
+Test mode: Automated
+Test Tile: RxFrameErr
+POrts: 3 (1 Control Plane 2 Data Plane)
+Initial State: Default (Clear switch state), Connection setup
+Test-Field: Mandatory
+
+
+Test Notes: 
+
+a) Send port_stats request for port=ingress_port
+b) Verify port_stats reply has rx_frame_err count 
+
+
+
+14. Recieve Overrun Errors (TBD ---> Verification of counter incrementing correctly)
+
+
+Test Description: Verify that rx_over_err counters in the Port_Stats reply increments in accordance with the number of with RX overrun
+
+Test mode: Automated
+Test Tile: RxOErr
+POrts: 3 (1 Control Plane 2 Data Plane)
+Initial State: Default (Clear switch state), Connection setup
+Test-Field: Mandatory
+
+
+Test Notes: 
+
+a) Send port_stats request for port=ingress_port
+b) Verify port_stats reply has rx_over_err count 
+
+
+15. CRC Errors (TBD ---> Verification of counter incrementing correctly)
+
+
+Test Description: Verify that rx_crc_err counters in the Port_Stats reply increments in accordance with the number of crc errors
+
+Test mode: Automated
+Test Tile: RxCrcErr
+POrts: 3 (1 Control Plane 2 Data Plane)
+Initial State: Default (Clear switch state), Connection setup
+Test-Field: Manadatory
+
+
+Test Notes: 
+
+a) Send port_stats request for port=ingress_port
+b) Verify port_stats reply has rx_crc_err count 
+
+
+
+16. Collisions (TBD ---> Verification of counter incrementing correctly)
+
+
+Test Description: Verify that collisons counters in the Port_Stats reply increments in accordance with the collisions encountered by the switch
+
+Test mode: Automated
+Test Tile: Collisions
+POrts: 3 (1 Control Plane 2 Data Plane)
+Initial State: Default (Clear switch state), Connection setup
+Test-Field: Mandatory
+
+
+Test Notes: 
+
+a) Send port_stats request for port=ingress_port
+b) Verify port_stats reply has collisions count 
+
+
+
+17. Active Entries per Table
+
+
+Test Description: Verify that active_count in the table increments in accordance with the flows inserted in the table
+
+Test mode: Automated
+Test Tile: ActiveCount
+POrts: 3 (1 Control Plane 2 Data Plane)
+Initial State: Default (Clear switch state), Connection setup
+Test-Field: Mandatory
+
+
+Test Notes: 
+
+a) Insert a flow 
+b) Send table_stats_request
+c) Verify active_count=1
+
+
+
+18. Packet Lookup per Table
+
+
+Test Description: Verify that lookup_count in the Table_Stats reply increments in accordance with the number of packets looked up in table
+
+Test mode: Automated
+Test Tile: LookupMatchedCount
+POrts: 3 (1 Control Plane 2 Data Plane)
+Initial State: Default (Clear switch state), Connection setup
+Test-Field: Mandatory
+
+
+Test Notes: 
+
+a) Insert a flow with match on ingress_port
+b) Send N packets on ingress_port (matching the flow)
+c) Send N' packets on x port (Not matching the flow)
+d) Send table_stats_request 
+e) Verify lookup_count = N+N' 
+
+
+
+19. Packets matched per Table
+
+Test Description: Verify that matched_count in the Table_Stats reply increments in accordance with the number of packets matched with the table
+
+Test mode: Automated
+Test Tile: LookupMatchedCount
+POrts: 3 (1 Control Plane 2 Data Plane)
+Initial State: Default (Clear switch state), Connection setup
+Test-Field: Mandatory
+
+
+Test Notes: 
+
+a) Insert a flow with match on ingress_port
+b) Send N packets on ingress_port (matching the flow)
+c) Send N' packets on x port (Not matching the flow)
+d) Send table_stats_request 
+e) Verify matched_count = N 
+
+
+
+
+20. Transmit Packets per Queue
+
+Test Description: Verify that tx_packets in the queue_stats reply increments in accordance with the number of transmitted packets
+
+Test mode: Automated
+Test Tile: TxPktPerQueue
+POrts: 3 (1 Control Plane 2 Data Plane)
+Initial State: Default (Clear switch state), Connection setup
+Test-Field: Optional
+
+
+Test Notes: 
+
+a) Send queue_stats request for ports=ofp.OFPP_ALL and queue_ids=ofp.OFPQ_ALL (i.e all ports and all queues)
+b) Send queue_stats request for egress_port[0] and queue_id[0] and note the tx_packets count in the reply
+c) Insert a flow entry with enqueue action , port = egress_port[0] queue_id= queue_id[0]
+d) Send packet matching the flow
+e) Send queue_stats request again, verify tx_packet count incremented 
+f) Repeat b , c , d , e for all the queue_ids configured for egress_port[0]
+h) Repeat b , c , d , e , f for all the egress_ports available
+
+
+
+
+21. Transmit Bytes per Queue
+
+Test Description: Verify that tx_bytes in the queue_stats reply increments in accordance with the number of transmitted bytes
+
+Test mode: Automated
+Test Tile: TxBytPerQueue
+POrts: 3 (1 Control Plane 2 Data Plane)
+Initial State: Default (Clear switch state), Connection setup
+Test-Field: Optional
+
+
+Test Notes: 
+
+a) Send queue_stats request for ports=ofp.OFPP_ALL and queue_ids=ofp.OFPQ_ALL (i.e all ports and all queues)
+b) Send queue_stats request for egress_port[0] and queue_id[0] and note the tx_bytes count in the reply
+c) Insert a flow entry with enqueue action , port = egress_port[0] queue_id= queue_id[0]
+d) Send packet matching the flow
+e) Send queue_stats request again, verify tx_byte count incremented 
+f) Repeat b , c , d , e for all the queue_ids configured for egress_port[0]
+h) Repeat b , c , d , e , f for all the egress_ports available
+
+
+
+22. Transmit Overrun Errors per queue (TBD ----> Verification of tx_error count being incremented correctly) 
+
+Test Description: Verify that tx_errors in the queue_stats reply increments in accordance with the number of packets dropped due to overrun.
+Test mode: Automated
+Test Tile: TxErrorPerQueue
+POrts: 3 (1 Control Plane 2 Data Plane)
+Initial State: Default (Clear switch state), Connection setup
+Test-Field: Optional
+
+Test Notes: 
+
+
+a) Send queue_stats request for port=egress_port and queue_ids=ofp.OFPQ_ALL
+B) send queue_stats request for egress_port and queue_id[0] (i.e first queue configured for egress_port)
+c) Verify reply has tx_errors count .
+d) Repear b , c for the all queue_ids of egress_port
+
+
+
+
+
+****     Flow matches     ****
+
+
+
+1. All Wildcard Match
+
+Test Description: Adding a Flow that matches all the possible fields
+
+Test mode: Automated
+Test Tile: AllWildcardMatch
+POrts: 3 (1 Control Plane 2 Data Plane)
+Initial State: Default (Clear switch state), Connection setup
+Test-Field: Mandatory
+
+
+Test Notes:
+
+a) Insert a flow with wildcard = OFPFW_ALL (wildcard all fields), action output to egress_port
+b) Send packets with different header fields
+c) Verify all packets match the flow and implement the action specified.
+
+
+2. Single Header Field: Ingress Port
+
+Test Description: Match on Ingress Port and Wildcard rest 
+
+Test mode: Automated
+Test Tile: IngressPort
+POrts: 3 (1 Control Plane 2 Data Plane)
+Initial State: Default (Clear switch state), Connection setup
+Test-Field: Mandatory
+
+
+Test Notes: 
+
+a) Insert a flow with match = in_port (say port x), action output to egress_port
+b) Send packet on port x 
+c) Verify packet was recieved on egress_port
+d) Send packet on port y
+e) Verify PacketIn event was triggered on control plane
+
+
+
+3. Single Header Field: Ethernet Src Address
+
+Test Description: Match on Ethernet Source Address and Wildcard rest 
+
+Test mode: Automated
+Test Tile: EthernetSrcAddress
+POrts: 3 (1 Control Plane 2 Data Plane)
+Initial State: Default (Clear switch state), Connection setup
+Test-Field: Mandatory
+
+
+Test Notes: 
+
+a) Insert a flow with match = dl_src (say x) , action output to egress_port
+b) Send packet wth dl_src = x 
+c) Verify packet was recieved on egress_port
+d) Send packet with dl_src = y 
+e) Verify PacketIn event was triggered on the control plane
+
+
+
+4. Single Header Field: Ethernet Dst Address
+
+Test Description: Match on Ethernet Destination Address and Wildcard rest 
+
+Test mode: Automated
+Test Tile: EthernetDstAddress
+POrts: 3 (1 Control Plane 2 Data Plane)
+Initial State: Default (Clear switch state), Connection setup
+Test-Field: Mandatory
+
+
+Test Notes: 
+
+a) Insert a flow with match = dl_dst (say x) , action output to egress_port
+b) Send packet wth dl_dst = x  
+c) Verify packet was recieved on egress_port
+d) Send packet with dl_dst = y 
+e) Verify PacketIn event was triggered on the control plane
+
+
+
+5. Single Header Field: Ethernet Type 
+
+Test Description: Match on Ehternet Type and Wildcard rest 
+
+Test mode: Automated
+Test Tile: EthernetType
+POrts: 3 (1 Control Plane 2 Data Plane)
+Initial State: Default (Clear switch state), Connection setup
+Test-Field: Mandatory
+
+
+Test Notes: 
+
+a) Insert a flow with match = dl_type (say x) , action output to egress_port
+b) Send packet wth dl_type = x   
+c) Verify packet was recieved on egress_port
+d) Send packet with dl_type = y 
+e) Verify PacketIn event was triggered on the control plane
+
+
+
+
+6. Single Header Field: Vlan Id
+
+Test Description: Match on Ingress Port and Wildcard rest 
+
+Test mode: Automated
+Test Tile: VlanId
+POrts: 3 (1 Control Plane 2 Data Plane)
+Initial State: Default (Clear switch state), Connection setup
+Test-Field: Mandatory
+
+
+Test Notes: 
+
+a) Insert a flow with match = dl_vlan (say x) , action output to egress_port
+b) Send a tagged packet with (dl_vlan_enable=True,dl_vlan = x)  
+c) Verify packet was recieved on egress_port
+d) Send another tagged packet with (dl_vlan_enable=True,dl_vlan = y )
+e) Verify PacketIn event was triggered on the control plane
+
+
+
+
+7. Single Header Field: Vlan PCP
+
+Test Description: Match on Vlan ID Priority 
+
+Test mode: Automated
+Test Tile: VlanPcp
+POrts: 3 (1 Control Plane 2 Data Plane)
+Initial State: Default (Clear switch state), Connection setup
+Test-Field: Mandatory
+
+
+Test Notes: 
+
+a) Insert a flow with match = dl_vlan_pcp (say x) , action output to egress_port
+b) Send a tagged packet with (dl_vlan_enable=True, dl_vlan = * , dl_vlan_pcp = x)  
+c) Verify packet was recieved on egress_port
+b) Send a tagged packet with (dl_vlan_enable=True, dl_vlan = * , dl_vlan_pcp = y)  
+e) Verify PacketIn event was triggered on the control plane
+
+
+
+
+
+8. Single Header Field: IP Src Address -------- > (TBD)
+
+Test Description: Match on IP Src Address and Wildcard rest 
+
+Test mode: Automated
+Test Tile: IPSrcAddress
+POrts: 3 (1 Control Plane 2 Data Plane)
+Initial State: Default (Clear switch state), Connection setup
+Test-Field: Mandatory
+
+
+
+
+9. Single Header Field: IP Dst Address -----------> (TBD)
+
+Test Description: Match on IP Dst Address and Wildcard rest 
+
+Test mode: Automated
+Test Tile: IPDstAddress
+POrts: 3 (1 Control Plane 2 Data Plane)
+Initial State: Default (Clear switch state), Connection setup
+Test-Field: Mandatory
+
+
+
+
+
+10. Single Header Field: IP protocol---------------> (TBD)
+
+Test Description: Match on IP Protocol and Wildcard rest 
+
+Test mode: Automated
+Test Tile: IPprotocol
+POrts: 3 (1 Control Plane 2 Data Plane)
+Initial State: Default (Clear switch state), Connection setup
+Test-Field: Mandatory
+
+
+
+
+
+
+11. Single Header Field: IP Tos bits
+
+Test Description: Match on IP Tos bits and Wildcard rest 
+
+Test mode: Automated
+Test Tile: IpTos
+POrts: 3 (1 Control Plane 2 Data Plane)
+Initial State: Default (Clear switch state), Connection setup
+Test-Field: Mandatory
+
+
+Test Notes: 
+
+a) Insert a flow with match = nw_tos (say x) , action output to egress_port
+b) Send a tcp packet with (nw_tos=x)  
+c) Verify packet was recieved on egress_port
+b) Send a tcp packet with (nw_tos = y)
+e) Verify PacketIn event was triggered on the control plane
+
+
+
+12. Single Header Field: Transport Source Port
+
+Test Description: Match on Transport Src Port and Wildcard rest 
+
+Test mode: Automated
+Test Tile: TcpSrcPort
+POrts: 3 (1 Control Plane 2 Data Plane)
+Initial State: Default (Clear switch state), Connection setup
+Test-Field: Mandatory
+
+
+Test Notes: 
+
+a) Insert a flow with match = tp_src (say x) , action output to egress_port
+b) Send a tcp packet with (tp_src=x)  
+c) Verify packet was recieved on egress_port
+b) Send a tcp packet with tp_src= y)
+e) Verify PacketIn event was triggered on the control plane
+
+
+
+13. Single Header Field: Transport Destination Port
+
+Test Description: Match on Transport Dst Port and Wildcard rest 
+
+Test mode: Automated
+Test Tile: TcpDstPort
+POrts: 3 (1 Control Plane 2 Data Plane)
+Initial State: Default (Clear switch state), Connection setup
+Test-Field: Mandatory
+
+
+Test Notes: 
+
+a) Insert a flow with match = tp_dst (say x) , action output to egress_port
+b) Send a tcp packet with (tp_dst=x)  
+c) Verify packet was recieved on egress_port
+b) Send a tcp packet with tp_dst = y)
+e) Verify PacketIn event was triggered on the control plane
+
+
+
+
+14. Multiple Header Fields: L2
+
+
+Test Description: Match on Ethernet Type, Ethernet Source Address, Ethernet Destination Address and Wildcard rest 
+
+Test mode: Automated
+Test Tile: MultipleHeaderFieldL2
+POrts: 3 (1 Control Plane 2 Data Plane)
+Initial State: Default (Clear switch state), Connection setup
+Test-Field: Mandatory
+
+
+Test Notes: 
+
+a) Insert a flow with match = dl_type (say x), dl_src (say y ), dl_dst (say z), action output to egress_port
+b) Send a eth packet with dl_type (say x), dl_src (say y ), dl_dst (say z)
+c) Verify packet was recieved on egress_port
+b) Send a eth packet with dl_type (say w), dl_src (say v ), dl_dst (say f)
+e) Verify PacketIn event was triggered on the control plane
+
+
+
+15. Multiple Header Fields: L3 ------> TBD
+
+
+
+
+16. Multiple Header Fields: L4
+
+Test Description: Match on Tcp Source Port, Tcp Destination Port
+
+Test mode: Automated
+Test Tile: MultipleHeaderFieldL4
+POrts: 3 (1 Control Plane 2 Data Plane)
+Initial State: Default (Clear switch state), Connection setup
+Test-Field: Mandatory
+
+
+Test Notes: 
+
+a) Insert a flow with match = tp_src (say x), tp_dst (say y )
+b) Send a tcp packet with tp_src (say x), tp_dst (say y )	
+c) Verify packet was recieved on egress_port
+b) Send a eth packet with tcp_src (say w), tcp_dst (say v )
+e) Verify PacketIn event was triggered on the control plane
+
+
+
+17. All Header Fields: Exact Match flows
+
+Test Description: Verify exact flow matches are possible 
+
+Test mode: Automated
+Test Tile: ExactMatch
+POrts: 3 (1 Control Plane 2 Data Plane)
+Initial State: Default (Clear switch state), Connection setup
+Test-Field: Mandatory
+
+
+Test Notes: 
+
+a) Insert a flow with exact match, action output to egress_port
+b) Send packet matching the flow  
+c) Verify packet received on egress_port
+d) Send a non-matching packet
+e) Verify PacketIn event gets triggered
+
+
+
+18. Exact Match Highest Priority
+
+Test Description: An exact match flow entry has a highest priority compared to other flow entries 
+
+Test mode: Automated
+Test Tile: ExactMatchHigh
+POrts: 4 (1 Control Plane 3 Data Plane)
+Initial State: Default (Clear switch state), Connection setup
+Test-Field: Mandatory
+
+
+Test Notes: 
+
+a) Insert two overlapping flows:
+	Exact Match (prio = p )   action egress_port
+	Wildacrd All (prio = p+ ) action egress_port2
+b) Send packet matching the flows
+c) Verify packet received on egress_port 
+
+
+
+
+19. Wildcard Match Highest Priority
+
+Test Description: If Wildcard flow entries have priority associated with them.
+		  Higher priority Wildcard flow overrides the lower priroty Wildcard flow  
+
+Test mode: Automated
+Test Tile: WildcardMatchHigh
+POrts: 4 (1 Control Plane 3 Data Plane)
+Initial State: Default (Clear switch state), Connection setup
+Test-Field: Mandatory
+
+
+Test Notes: 
+
+a) Insert two wildcarded flows :
+	Wildcard All Except ingress (prio = p ) , action = egress_port
+	Wildcard All (prio = p+ ) ,action = egress_port2
+b) Send packet matching the flows  
+c) Verify packet is recieved on egress_port2
+
+
+
+20. Fragment TCP Segments ------> TBD 
+
+Test Description: Create flow matching on tcp port number. Verify that fragmented packets always match that flow rule.
+
+Test mode: Automated
+Test Tile: FragTcpSeg
+POrts: 3 (1 Control Plane 2 Data Plane)
+Initial State: Default (Clear switch state), Connection setup
+Test-Field: Mandatory
diff --git a/tests/FuncUtils.py b/tests/FuncUtils.py
index 5cfcb6a..ad00246 100644
--- a/tests/FuncUtils.py
+++ b/tests/FuncUtils.py
@@ -12,272 +12,843 @@
 import oftest.parse as parse
 import logging
 import types
+
 import oftest.base_tests as base_tests
 from oftest.testutils import *
 from time import sleep
 
 #################### Functions for various types of flow_mod  ##########################################################################################
 
-def Exact_Match(self,of_ports,priority=0):
+def exact_match(self,of_ports,priority=None):
 # Generate ExactMatch flow .
 
-        #Create a simple tcp packet and generate exact flow match from it.
-        Pkt_ExactFlow = simple_tcp_packet()
-        match = parse.packet_to_flow_match(Pkt_ExactFlow)
-        self.assertTrue(match is not None, "Could not generate flow match from pkt")
-        match.in_port = of_ports[0]
-        #match.nw_src = 1
-        match.wildcards=0
-        msg = message.flow_mod()
-        msg.out_port = ofp.OFPP_NONE
-        msg.command = ofp.OFPFC_ADD
-        msg.buffer_id = 0xffffffff
-        msg.match = match
-        if priority != 0 :
-                msg.priority = priority
+    #Create a simple tcp packet and generate exact flow match from it.
+    pkt_exactflow = simple_tcp_packet()
+    match = parse.packet_to_flow_match(pkt_exactflow)
+    self.assertTrue(match is not None, "Could not generate flow match from pkt")
+    match.in_port = of_ports[0]
+    #match.nw_src = 1
+    match.wildcards=0
+    msg = message.flow_mod()
+    msg.out_port = ofp.OFPP_NONE
+    msg.command = ofp.OFPFC_ADD
+    msg.buffer_id = 0xffffffff
+    msg.match = match
+    if priority != None :
+        msg.priority = priority
 
-        act = action.action_output()
-        act.port = of_ports[1]
-        self.assertTrue(msg.actions.add(act), "could not add action")
+    act = action.action_output()
+    act.port = of_ports[1]
+    self.assertTrue(msg.actions.add(act), "could not add action")
 
-        rv = self.controller.message_send(msg)
-        self.assertTrue(rv != -1, "Error installing flow mod")
-        self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
+    rv = self.controller.message_send(msg)
+    self.assertTrue(rv != -1, "Error installing flow mod")
+    self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
 
-        return (Pkt_ExactFlow,match)
-        
+    return (pkt_exactflow,match)
 
-def Match_All_Except_Source_Address(self,of_ports,priority=0):
+def exact_match_with_prio(self,of_ports,priority=None):
+    # Generate ExactMatch with action output to port 2
+
+    #Create a simple tcp packet and generate exact flow match from it.
+    pkt_exactflow = simple_tcp_packet()
+    match = parse.packet_to_flow_match(pkt_exactflow)
+    self.assertTrue(match is not None, "Could not generate flow match from pkt")
+    match.in_port = of_ports[0]
+    #match.nw_src = 1
+    match.wildcards=0
+    msg = message.flow_mod()
+    msg.out_port = ofp.OFPP_NONE
+    msg.command = ofp.OFPFC_ADD
+    msg.buffer_id = 0xffffffff
+    msg.match = match
+    if priority != None :
+        msg.priority = priority
+
+    act = action.action_output()
+    act.port = of_ports[2]
+    self.assertTrue(msg.actions.add(act), "could not add action")
+
+    rv = self.controller.message_send(msg)
+    self.assertTrue(rv != -1, "Error installing flow mod")
+    self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
+
+    return (pkt_exactflow,match)         
+       
+
+def match_all_except_source_address(self,of_ports,priority=None):
 # Generate Match_All_Except_Source_Address flow
         
-        #Create a simple tcp packet and generate match all except src address flow.
-        Pkt_WildcardSrc= simple_tcp_packet()
-        match1 = parse.packet_to_flow_match(Pkt_WildcardSrc)
-        self.assertTrue(match1 is not None, "Could not generate flow match from pkt")
-        match1.in_port = of_ports[0]
-        #match1.nw_src = 1
-        match1.wildcards = ofp.OFPFW_DL_SRC
-        msg1 = message.flow_mod()
-        msg1.out_port = ofp.OFPP_NONE
-        msg1.command = ofp.OFPFC_ADD
-        msg1.buffer_id = 0xffffffff
-        msg1.match = match1
-        if priority != 0 :
-                msg1.priority = priority
+    #Create a simple tcp packet and generate match all except src address flow.
+    pkt_wildcardsrc= simple_tcp_packet()
+    match1 = parse.packet_to_flow_match(pkt_wildcardsrc)
+    self.assertTrue(match1 is not None, "Could not generate flow match from pkt")
+    match1.in_port = of_ports[0]
+    #match1.nw_src = 1
+    match1.wildcards = ofp.OFPFW_DL_SRC
+    msg1 = message.flow_mod()
+    msg1.out_port = ofp.OFPP_NONE
+    msg1.command = ofp.OFPFC_ADD
+    msg1.buffer_id = 0xffffffff
+    msg1.match = match1
+    if priority != None :
+        msg1.priority = priority
 
-        act1 = action.action_output()
-        act1.port = of_ports[1]
-        self.assertTrue(msg1.actions.add(act1), "could not add action")
+    act1 = action.action_output()
+    act1.port = of_ports[1]
+    self.assertTrue(msg1.actions.add(act1), "could not add action")
 
-        rv = self.controller.message_send(msg1)
-        self.assertTrue(rv != -1, "Error installing flow mod")
-        self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
+    rv = self.controller.message_send(msg1)
+    self.assertTrue(rv != -1, "Error installing flow mod")
+    self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
 
-        return (Pkt_WildcardSrc,match1)
+    return (pkt_wildcardsrc,match1)
+
+def match_wthernet_src_address(self,of_ports,priority=None):
+    #Generate Match_Ethernet_SrC_Address flow
+
+    #Create a simple tcp packet and generate match on ethernet src address flow
+    pkt_MatchSrc = simple_tcp_packet(dl_src='00:01:01:01:01:01')
+    match = parse.packet_to_flow_match(pkt_MatchSrc)
+    self.assertTrue(match is not None, "Could not generate flow match from pkt")
+
+    match.wildcards = ofp.OFPFW_ALL ^ofp.OFPFW_DL_SRC
         
-def Wildcard_All(self,of_ports,priority=0):
+    msg = message.flow_mod()
+    msg.out_port = ofp.OFPP_NONE
+    msg.command = ofp.OFPFC_ADD
+    msg.buffer_id = 0xffffffff
+    msg.match = match
+    if priority != None :
+        msg.priority = priority
+
+    act = action.action_output()
+    act.port = of_ports[1]
+    self.assertTrue(msg.actions.add(act), "could not add action")
+
+    rv = self.controller.message_send(msg)
+    self.assertTrue(rv != -1, "Error installing flow mod")
+    self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
+
+    return (pkt_MatchSrc,match)
+      
+def match_ethernet_dst_address(self,of_ports,priority=None):
+    #Generate Match_Ethernet_Dst_Address flow
+
+    #Create a simple tcp packet and generate match on ethernet dst address flow
+    pkt_matchdst = simple_tcp_packet(dl_dst='00:01:01:01:01:01')
+    match = parse.packet_to_flow_match(pkt_matchdst)
+    self.assertTrue(match is not None, "Could not generate flow match from pkt")
+
+    match.wildcards = ofp.OFPFW_ALL ^ofp.OFPFW_DL_DST
+    msg = message.flow_mod()
+    msg.out_port = ofp.OFPP_NONE
+    msg.command = ofp.OFPFC_ADD
+    msg.buffer_id = 0xffffffff
+    msg.match = match
+    if priority != None :
+        msg.priority = priority
+
+    act = action.action_output()
+    act.port = of_ports[1]
+    self.assertTrue(msg.actions.add(act), "could not add action")
+
+    rv = self.controller.message_send(msg)
+    self.assertTrue(rv != -1, "Error installing flow mod")
+    self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
+
+    return (pkt_matchdst,match)
+
+def wildcard_all(self,of_ports,priority=None):
 # Generate a Wildcard_All Flow 
 
-        #Create a simple tcp packet and generate wildcard all flow match from it.  
-        Pkt_Wildcard = simple_tcp_packet()
-        match2 = parse.packet_to_flow_match(Pkt_Wildcard)
-        self.assertTrue(match2 is not None, "Could not generate flow match from pkt")
-        match2.wildcards=ofp.OFPFW_ALL
-        match2.in_port = of_ports[0]
+    #Create a simple tcp packet and generate wildcard all flow match from it.  
+    pkt_wildcard = simple_tcp_packet()
+    match2 = parse.packet_to_flow_match(pkt_wildcard)
+    self.assertTrue(match2 is not None, "Could not generate flow match from pkt")
+    match2.wildcards=ofp.OFPFW_ALL
+    match2.in_port = of_ports[0]
 
-        msg2 = message.flow_mod()
-        msg2.out_port = ofp.OFPP_NONE
-        msg2.command = ofp.OFPFC_ADD
-        msg2.buffer_id = 0xffffffff
-        msg2.match = match2
-        act2 = action.action_output()
-        act2.port = of_ports[1]
-        self.assertTrue(msg2.actions.add(act2), "could not add action")
-        if priority != 0 :
-                msg2.priority = priority
+    msg2 = message.flow_mod()
+    msg2.out_port = ofp.OFPP_NONE
+    msg2.command = ofp.OFPFC_ADD
+    msg2.buffer_id = 0xffffffff
+    msg2.match = match2
+    act2 = action.action_output()
+    act2.port = of_ports[1]
+    self.assertTrue(msg2.actions.add(act2), "could not add action")
+    if priority != None :
+        msg2.priority = priority
 
-        rv = self.controller.message_send(msg2)
-        self.assertTrue(rv != -1, "Error installing flow mod")
-        self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
+    rv = self.controller.message_send(msg2)
+    self.assertTrue(rv != -1, "Error installing flow mod")
+    self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
 
-        return (Pkt_Wildcard,match2)
+    return (pkt_wildcard,match2)
 
-def Wildcard_All_Except_Ingress(self,of_ports,priority=0):
+def wildcard_all_except_ingress(self,of_ports,priority=None):
 # Generate Wildcard_All_Except_Ingress_port flow
         
 
-        #Create a simple tcp packet and generate wildcard all except ingress_port flow.
-        Pkt_MatchIngress = simple_tcp_packet()
-        match3 = parse.packet_to_flow_match(Pkt_MatchIngress)
-        self.assertTrue(match3 is not None, "Could not generate flow match from pkt")
-        match3.wildcards = ofp.OFPFW_ALL-ofp.OFPFW_IN_PORT
-        match3.in_port = of_ports[0]
+    #Create a simple tcp packet and generate wildcard all except ingress_port flow.
+    pkt_matchingress = simple_tcp_packet()
+    match3 = parse.packet_to_flow_match(pkt_matchingress)
+    self.assertTrue(match3 is not None, "Could not generate flow match from pkt")
+    match3.wildcards = ofp.OFPFW_ALL-ofp.OFPFW_IN_PORT
+    match3.in_port = of_ports[0]
 
-        msg3 = message.flow_mod()
-        msg3.command = ofp.OFPFC_ADD
-        msg3.match = match3
-        msg3.out_port = of_ports[2] # ignored by flow add,flow modify 
-        msg3.cookie = random.randint(0,9007199254740992)
-        msg3.buffer_id = 0xffffffff
-        msg3.idle_timeout = 0
-        msg3.hard_timeout = 0
-        msg3.buffer_id = 0xffffffff
+    msg3 = message.flow_mod()
+    msg3.command = ofp.OFPFC_ADD
+    msg3.match = match3
+    msg3.out_port = of_ports[2] # ignored by flow add,flow modify 
+    msg3.cookie = random.randint(0,9007199254740992)
+    msg3.buffer_id = 0xffffffff
+    msg3.idle_timeout = 0
+    msg3.hard_timeout = 0
+    msg3.buffer_id = 0xffffffff
        
-        act3 = action.action_output()
-        act3.port = of_ports[1]
-        self.assertTrue(msg3.actions.add(act3), "could not add action")
+    act3 = action.action_output()
+    act3.port = of_ports[1]
+    self.assertTrue(msg3.actions.add(act3), "could not add action")
 
-        if priority != 0 :
-                msg3.priority = priority
+    if priority != None :
+        msg3.priority = priority
 
-        rv = self.controller.message_send(msg3)
-        self.assertTrue(rv != -1, "Error installing flow mod")
-        self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
+    rv = self.controller.message_send(msg3)
+    self.assertTrue(rv != -1, "Error installing flow mod")
+    self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
 
-        return (Pkt_MatchIngress,match3)
-    
+    return (pkt_matchingress,match3)
+
+def wildcard_all_except_ingress1(self,of_ports,priority=None):
+# Generate Wildcard_All_Except_Ingress_port flow with action output to port egress_port 2 
+        
+
+    #Create a simple tcp packet and generate wildcard all except ingress_port flow.
+    pkt_matchingress = simple_tcp_packet()
+    match3 = parse.packet_to_flow_match(pkt_matchingress)
+    self.assertTrue(match3 is not None, "Could not generate flow match from pkt")
+    match3.wildcards = ofp.OFPFW_ALL-ofp.OFPFW_IN_PORT
+    match3.in_port = of_ports[0]
+
+    msg3 = message.flow_mod()
+    msg3.command = ofp.OFPFC_ADD
+    msg3.match = match3
+    msg3.out_port = of_ports[2] # ignored by flow add,flow modify 
+    msg3.cookie = random.randint(0,9007199254740992)
+    msg3.buffer_id = 0xffffffff
+    msg3.idle_timeout = 0
+    msg3.hard_timeout = 0
+    msg3.buffer_id = 0xffffffff
+       
+    act3 = action.action_output()
+    act3.port = of_ports[2]
+    self.assertTrue(msg3.actions.add(act3), "could not add action")
+    if priority != None :
+        msg3.priority = priority
+
+    rv = self.controller.message_send(msg3)
+    self.assertTrue(rv != -1, "Error installing flow mod")
+    self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
+
+    return (pkt_matchingress,match3)
+
+
+
+
+def match_vlan_id(self,of_ports,priority=None):
+    #Generate Match_Vlan_Id
+
+    #Create a simple tcp packet and generate match on ethernet dst address flow
+    pkt_matchvlanid = simple_tcp_packet(dl_vlan_enable=True,dl_vlan=1)
+    match = parse.packet_to_flow_match(pkt_matchvlanid)
+    self.assertTrue(match is not None, "Could not generate flow match from pkt")
+
+    match.wildcards = ofp.OFPFW_ALL ^ofp.OFPFW_DL_VLAN
+    msg = message.flow_mod()
+    msg.out_port = ofp.OFPP_NONE
+    msg.command = ofp.OFPFC_ADD
+    msg.buffer_id = 0xffffffff
+    msg.match = match
+    if priority != None :
+        msg.priority = priority
+
+    act = action.action_output()
+    act.port = of_ports[1]
+    self.assertTrue(msg.actions.add(act), "could not add action")
+
+    rv = self.controller.message_send(msg)
+    self.assertTrue(rv != -1, "Error installing flow mod")
+    self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
+
+    return (pkt_matchvlanid,match)
+
+def match_vlan_pcp(self,of_ports,priority=None):
+    #Generate Match_Vlan_Id
+
+    #Create a simple tcp packet and generate match on ethernet dst address flow
+    pkt_matchvlanpcp = simple_tcp_packet(dl_vlan_enable=True,dl_vlan=1,dl_vlan_pcp=10)
+    match = parse.packet_to_flow_match(pkt_matchvlanpcp)
+    self.assertTrue(match is not None, "Could not generate flow match from pkt")
+
+    match.wildcards = ofp.OFPFW_ALL ^ofp.OFPFW_DL_VLAN_PCP 
+    msg = message.flow_mod()
+    msg.out_port = ofp.OFPP_NONE
+    msg.command = ofp.OFPFC_ADD
+    msg.buffer_id = 0xffffffff
+    msg.match = match
+    if priority != None :
+        msg.priority = priority
+
+    act = action.action_output()
+    act.port = of_ports[1]
+    self.assertTrue(msg.actions.add(act), "could not add action")
+
+    rv = self.controller.message_send(msg)
+    self.assertTrue(rv != -1, "Error installing flow mod")
+    self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
+
+    return (pkt_matchvlanpcp,match)
+
+
+def match_mul_l2(self,of_ports,priority=None):
+    #Generate Match_Mul_L2 flow
+
+    #Create a simple eth packet and generate match on ethernet protocol flow
+    pkt_mulL2 = simple_eth_packet(dl_type=0x88cc,dl_src='00:01:01:01:01:01',dl_dst='00:01:01:01:01:02')
+    match = parse.packet_to_flow_match(pkt_mulL2)
+    self.assertTrue(match is not None, "Could not generate flow match from pkt")
+
+    match.wildcards = ofp.OFPFW_ALL ^ofp.OFPFW_DL_TYPE ^ofp.OFPFW_DL_DST ^ofp.OFPFW_DL_SRC
+    msg = message.flow_mod()
+    msg.out_port = ofp.OFPP_NONE
+    msg.command = ofp.OFPFC_ADD
+    msg.buffer_id = 0xffffffff
+    msg.match = match
+    if priority != None :
+        msg.priority = priority
+
+    act = action.action_output()
+    act.port = of_ports[1]
+    self.assertTrue(msg.actions.add(act), "could not add action")
+
+    rv = self.controller.message_send(msg)
+    self.assertTrue(rv != -1, "Error installing flow mod")
+    self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
+
+    return (pkt_mulL2,match)
+
+
+def match_mul_L4(self,of_ports,priority=None):
+    #Generate Match_Mul_L4 flow
+
+        #Create a simple tcp packet and generate match on tcp protocol flow
+    pkt_mulL4 = simple_tcp_packet(tcp_sport=111,tcp_dport=112)
+    match = parse.packet_to_flow_match(pkt_mulL4)
+    self.assertTrue(match is not None, "Could not generate flow match from pkt")
+    match.wildcards = ofp.OFPFW_ALL ^ofp.OFPFW_TP_SRC ^ofp.OFPFW_TP_DST 
+    msg = message.flow_mod()
+    msg.out_port = ofp.OFPP_NONE
+    msg.command = ofp.OFPFC_ADD
+    msg.buffer_id = 0xffffffff
+    msg.match = match
+    if priority != None :
+        msg.priority = priority
+
+    act = action.action_output()
+    act.port = of_ports[1]
+    self.assertTrue(msg.actions.add(act), "could not add action")
+
+    rv = self.controller.message_send(msg)
+    self.assertTrue(rv != -1, "Error installing flow mod")
+    self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
+
+    return (pkt_mulL4,match)  
+
+def match_ip_tos(self,of_ports,priority=None):
+    #Generate a Match on IP Type of service flow
+
+        #Create a simple tcp packet and generate match on Type of service 
+    pkt_iptos = simple_tcp_packet(ip_tos=3)
+    match = parse.packet_to_flow_match(pkt_iptos)
+    self.assertTrue(match is not None, "Could not generate flow match from pkt")
+
+    match.wildcards = ofp.OFPFW_ALL ^ofp.OFPFW_NW_TOS
+    msg = message.flow_mod()
+    msg.out_port = ofp.OFPP_NONE
+    msg.command = ofp.OFPFC_ADD
+    msg.buffer_id = 0xffffffff
+    msg.match = match
+    if priority != None :
+        msg.priority = priority
+    act = action.action_output()
+    act.port = of_ports[1]
+    self.assertTrue(msg.actions.add(act), "could not add action")
+
+    rv = self.controller.message_send(msg)
+    self.assertTrue(rv != -1, "Error installing flow mod")
+    self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
+
+    return (pkt_iptos,match)
+
+def match_tcp_src(self,of_ports,priority=None):
+    #Generate Match_Tcp_Src
+
+    #Create a simple tcp packet and generate match on tcp source port flow
+    pkt_matchtSrc = simple_tcp_packet(tcp_sport=111)
+    match = parse.packet_to_flow_match(pkt_matchtSrc)
+    self.assertTrue(match is not None, "Could not generate flow match from pkt")
+
+    match.wildcards = ofp.OFPFW_ALL ^ofp.OFPFW_TP_SRC  
+    msg = message.flow_mod()
+    msg.out_port = ofp.OFPP_NONE
+    msg.command = ofp.OFPFC_ADD
+    msg.buffer_id = 0xffffffff
+    msg.match = match
+    if priority != None :
+        msg.priority = priority
+
+    act = action.action_output()
+    act.port = of_ports[1]
+    self.assertTrue(msg.actions.add(act), "could not add action")
+
+    rv = self.controller.message_send(msg)
+    self.assertTrue(rv != -1, "Error installing flow mod")
+    self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
+
+    return (pkt_matchtSrc,match)  
+
+def match_tcp_dst(self,of_ports,priority=None):
+    #Generate Match_Tcp_Dst
+
+        #Create a simple tcp packet and generate match on tcp destination port flow
+    pkt_Matchtdst = simple_tcp_packet(tcp_dport=112)
+    match = parse.packet_to_flow_match(pkt_matchtdst)
+    self.assertTrue(match is not None, "Could not generate flow match from pkt")
+
+    match.wildcards = ofp.OFPFW_ALL ^ofp.OFPFW_TP_DST  
+    msg = message.flow_mod()
+    msg.out_port = ofp.OFPP_NONE
+    msg.command = ofp.OFPFC_ADD
+    msg.buffer_id = 0xffffffff
+    msg.match = match
+    if priority != None :
+        msg.priority = priority
+    act = action.action_output()
+    act.port = of_ports[1]
+    self.assertTrue(msg.actions.add(act), "could not add action")
+
+    rv = self.controller.message_send(msg)
+    self.assertTrue(rv != -1, "Error installing flow mod")
+    self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
+
+    return (pkt_matchtdst,match)        
+
+
+
+
+
+def match_ethernet_type(self,of_ports,priority=None):
+    #Generate a Match_Ethernet_Type flow
+
+    #Create a simple tcp packet and generate match on ethernet type flow
+    pkt_matchtype = simple_eth_packet(dl_type=0x88cc)
+    match = parse.packet_to_flow_match(pkt_matchtype)
+    self.assertTrue(match is not None, "Could not generate flow match from pkt")
+
+    match.wildcards = ofp.OFPFW_ALL ^ofp.OFPFW_DL_TYPE
+    msg = message.flow_mod()
+    msg.out_port = ofp.OFPP_NONE
+    msg.command = ofp.OFPFC_ADD
+    msg.buffer_id = 0xffffffff
+    msg.match = match
+    if priority != None :
+        msg.priority = priority
+
+    act = action.action_output()
+    act.port = of_ports[1]
+    self.assertTrue(msg.actions.add(act), "could not add action")
+
+    rv = self.controller.message_send(msg)
+    self.assertTrue(rv != -1, "Error installing flow mod")
+    self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
+
+    return (pkt_matchtype,match)
+
    
-def Strict_Modify_Flow_Action(self,egress_port,match,priority=0):
+   
+def strict_modify_flow_action(self,egress_port,match,priority=None):
 # Strict Modify the flow Action 
         
-        #Create a flow_mod message , command MODIFY_STRICT
-        msg5 = message.flow_mod()
-        msg5.match = match
-        msg5.cookie = random.randint(0,9007199254740992)
-        msg5.command = ofp.OFPFC_MODIFY_STRICT
-        msg5.buffer_id = 0xffffffff
-        act5 = action.action_output()
-        act5.port = egress_port
-        self.assertTrue(msg5.actions.add(act5), "could not add action")
+    #Create a flow_mod message , command MODIFY_STRICT
+    msg5 = message.flow_mod()
+    msg5.match = match
+    msg5.cookie = random.randint(0,9007199254740992)
+    msg5.command = ofp.OFPFC_MODIFY_STRICT
+    msg5.buffer_id = 0xffffffff
+    act5 = action.action_output()
+    act5.port = egress_port
+    self.assertTrue(msg5.actions.add(act5), "could not add action")
 
-        if priority != 0 :
-                msg5.priority = priority
+    if priority != None :
+        msg5.priority = priority
 
-        # Send the flow with action A'
-        rv = self.controller.message_send (msg5)
-        self.assertTrue(rv != -1, "Error installing flow mod")
-        self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
+    # Send the flow with action A'
+    rv = self.controller.message_send (msg5)
+    self.assertTrue(rv != -1, "Error installing flow mod")
+    self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
 
-def Modify_Flow_Action(self,of_ports,match,priority=0):
+def modify_flow_action(self,of_ports,match,priority=None):
 # Modify the flow action
         
-        #Create a flow_mod message , command MODIFY 
-        msg8 = message.flow_mod()
-        msg8.match = match
-        msg8.cookie = random.randint(0,9007199254740992)
-        msg8.command = ofp.OFPFC_MODIFY
-        #Will be ignored for flow adds and flow modify (here for test-case Add_Modify_With_Outport)
-        msg8.out_port = of_ports[3]
-        msg8.buffer_id = 0xffffffff
-        act8 = action.action_output()
-        act8.port = of_ports[2]
-        self.assertTrue(msg8.actions.add(act8), "could not add action")
+    #Create a flow_mod message , command MODIFY 
+    msg8 = message.flow_mod()
+    msg8.match = match
+    msg8.cookie = random.randint(0,9007199254740992)
+    msg8.command = ofp.OFPFC_MODIFY
+    #out_port will be ignored for flow adds and flow modify (here for test-case Add_Modify_With_Outport)
+    msg8.out_port = of_ports[3]
+    msg8.buffer_id = 0xffffffff
+    act8 = action.action_output()
+    act8.port = of_ports[2]
+    self.assertTrue(msg8.actions.add(act8), "could not add action")
 
-        if priority != 0 :
-                msg8.priority = priority
+    if priority != None :
+        msg8.priority = priority
 
-        # Send the flow with action A'
-        rv = self.controller.message_send (msg8)
-        self.assertTrue(rv != -1, "Error installing flow mod")
-        self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
+    # Send the flow with action A'
+    rv = self.controller.message_send (msg8)
+    self.assertTrue(rv != -1, "Error installing flow mod")
+    self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
+
+def enqueue(self,ingress_port,egress_port,egress_queue_id):
+#Generate a flow with enqueue action i.e output to a queue configured on a egress_port
+
+    pkt = simple_tcp_packet()
+    match = packet_to_flow_match(self, pkt)
+    match.wildcards &= ~ofp.OFPFW_IN_PORT
+    self.assertTrue(match is not None, 
+            "Could not generate flow match from pkt")
+    
+    match.in_port = ingress_port
+    request = message.flow_mod()
+    request.match = match
+    request.buffer_id = 0xffffffff
+    act = action.action_enqueue()
+    act.port     = egress_port
+    act.queue_id = egress_queue_id
+    self.assertTrue(request.actions.add(act), "Could not add action")
+    
+    logging.info("Inserting flow")
+    rv = self.controller.message_send(request)
+    self.assertTrue(rv != -1, "Error installing flow mod")
+    self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
+    return (pkt,match)
+
+
 
 
 ###########################   Verify Stats Functions   ###########################################################################################
+def get_flowstats(self,match):
+    # Generate flow_stats request
+    
+    stat_req = message.flow_stats_request()
+    stat_req.match = match
+    stat_req.table_id = 0xff
+    stat_req.out_port = ofp.OFPP_NONE
 
-def Verify_TableStats(self,active_entries=0,):
-#Verify Table_Stats
-        
-        #Send Table_Stats_Request        
-        request = message.table_stats_request()
-        response, pkt = self.controller.transact(request, timeout=1)
-        self.assertTrue(response is not None, "Did not get response")
-        active_count=0
-
-        #Verify active_count in the reply
-        for stat in response.stats:
-            active_count += stat.active_count
-        self.assertTrue(active_entries == active_count,"Incorrect no. of flows in Table")
+    logging.info("Sending stats request")
+    response, pkt = self.controller.transact(stat_req,
+                                                     timeout=5)
+    self.assertTrue(response is not None,"No response to stats request")
 
 
-def Verify_FlowStats(self,match,byte_count=0,packet_count=0):
-# Verify flow counters : byte_count and packet_count
+def get_portstats(self,port_num):
 
-        stat_req = message.flow_stats_request()
-        stat_req.match = match
-        stat_req.table_id = 0xff
-        stat_req.out_port = ofp.OFPP_NONE
-        test_timeout = 10
-        all_packets_received = 0
-        for i in range(0,test_timeout):
-            
-            response, pkt = self.controller.transact(stat_req,
-                                                     timeout=test_timeout)
-            self.assertTrue(response is not None, 
+# Return all the port counters in the form a tuple 
+    port_stats_req = message.port_stats_request()
+    port_stats_req.port_no = port_num  
+    response,pkt = self.controller.transact(port_stats_req)
+    self.assertTrue(response is not None,"No response received for port stats request") 
+    rx_pkts=0
+    tx_pkts=0
+    rx_byts=0
+    tx_byts=0
+    rx_drp =0
+    tx_drp = 0
+    rx_err=0
+    tx_err =0 
+    rx_fr_err=0
+    rx_ovr_err=0
+    rx_crc_err=0
+    collisions = 0
+    tx_err=0
+
+
+    for obj in response.stats:
+        rx_pkts += obj.rx_packets
+        tx_pkts += obj.tx_packets
+        rx_byts += obj.rx_bytes
+        tx_byts += obj.tx_bytes
+        rx_drp += obj.rx_dropped
+        tx_drp += obj.tx_dropped
+        rx_err += obj.rx_errors
+        rx_fr_err += obj.rx_frame_err
+        rx_ovr_err += obj.rx_over_err
+        rx_crc_err += obj.rx_crc_err
+        collisions+= obj.collisions
+        tx_err += obj.tx_errors
+
+    return (rx_pkts,tx_pkts,rx_byts,tx_byts,rx_drp,tx_drp,rx_err,tx_err,rx_fr_err,rx_ovr_err,rx_crc_err,collisions,tx_err)
+
+def get_queuestats(self,port_num,queue_id):
+#Generate Queue Stats request 
+
+    request = message.queue_stats_request()
+    request.port_no  = port_num
+    request.queue_id = queue_id
+    (queue_stats, p) = self.controller.transact(request)
+    self.assertNotEqual(queue_stats, None, "Queue stats request failed")
+
+    return (queue_stats,p)
+
+def get_tablestats(self):
+# Send Table_Stats request (retrieve current table counters )
+
+    stat_req = message.table_stats_request()
+    response, pkt = self.controller.transact(stat_req,
+                                                     timeout=5)
+    self.assertTrue(response is not None, 
                             "No response to stats request")
-            for obj in response.stats:
-                if ( obj.packet_count == packet_count and obj.byte_count == byte_count ) :
-                    all_packets_received = 1
+    current_lookedup = 0
+    current_matched = 0
+    current_active = 0 
 
-            if all_packets_received:
-                break
-            sleep(1)
+    for obj in response.stats:
+        current_lookedup += obj.lookup_count
+        current_matched  += obj.matched_count
+        current_active += obj.active_count
 
-        self.assertTrue(all_packets_received,
-                        "Flow counters are incorrect")
+    return (current_lookedup,current_matched,current_active)
 
-def Verify_PortStats(self,in_port,rx_dropped):
-#Verify Port counters like rx_dropped
 
-        port_stats_req = message.port_stats_request()
-        port_stats_req.port_no = in_port   
-        resp,pkt = self.controller.transact(port_stats_req)
-        self.assertTrue(resp is not None,"No response received for port stats request")        
-        self.assertTrue(resp.rx_dropped == rx_dropped, "Packets not dropped")
 
+def verify_tablestats(self,expect_lookup=None,expect_match=None,expect_active=None):
+
+    stat_req = message.table_stats_request()
+    
+    for i in range(0,60):
+
+        logging.info("Sending stats request")
+        # TODO: move REPLY_MORE handling to controller.transact?
+        response, pkt = self.controller.transact(stat_req,
+                                                     timeout=5)
+        self.assertTrue(response is not None,"No response to stats request")
+
+        lookedup = 0 
+        matched = 0 
+        active = 0
+
+        sleep(1)
+        
+        for item in response.stats:
+
+            lookedup += item.lookup_count
+            matched += item.matched_count
+            active += item.active_count
+
+            logging.info("Packets Looked up " + str(lookedup) + " packets")
+            logging.info("Packets matched " + str(matched) + "packets")
+            logging.info("Active flow entries" + str(active) + "flows")
+        
+        if expect_lookup != None and expect_lookup != lookedup:continue
+        if expect_match != None and expect_match != matched:continue
+        if expect_active != None and expect_active != active:continue
+        break
+
+        
+
+    if expect_lookup != None :
+        self.assertEqual(expect_lookup,item.lookup_count,"lookup counter is not incremented properly")
+    if expect_match != None :
+        self.assertEqual(expect_match,item.matched_count, "matched counter is not incremented properly")
+    if expect_active != None :
+        self.assertEqual(expect_active,item.active_count,"active counter is not incremented properly")
+
+
+def verify_flowstats(self,match,byte_count=None,packet_count=None):
+    # Verify flow counters : byte_count and packet_count
+
+    stat_req = message.flow_stats_request()
+    stat_req.match = match
+    stat_req.table_id = 0xff
+    stat_req.out_port = ofp.OFPP_NONE
+    
+    for i in range(0,60):
+        logging.info("Sending stats request")
+        # TODO: move REPLY_MORE handling to controller.transact?
+        response, pkt = self.controller.transact(stat_req,
+                                                     timeout=5)
+        self.assertTrue(response is not None,"No response to stats request")
+
+        packet_counter = 0
+        byte_counter = 0 
+
+        sleep(1)
+
+        for item in response.stats:
+            packet_counter += item.packet_count
+            byte_counter += item.byte_count
+
+            logging.info("Recieved" + str(item.packet_count) + " packets")
+           
+            logging.info("Received " + str(item.byte_count) + "bytes")
+           
+        if packet_count != None  and  packet_count != packet_counter: continue
+        if byte_count != None  and  byte_count != byte_counter: continue
+        break
+
+        
+    
+    if packet_count != None :
+        self.assertEqual(packet_count,item.packet_count,"packet_count counter is not incremented correctly")
+
+    if byte_count != None :   
+        self.assertEqual(byte_count,item.byte_count,"byte_count counter is not incremented correctly")
+
+
+def verify_portstats(self, port,tx_packets=None,rx_packets=None,rx_byte=None,tx_byte=None):
+
+    
+    stat_req = message.port_stats_request()
+    stat_req.port_no = port
+    
+    for i in range(0,60):
+        logging.info("Sending stats request")
+        response, pkt = self.controller.transact(stat_req,
+                                                timeout=5)
+        self.assertTrue(response is not None, 
+                       "No response to stats request")
+        self.assertTrue(len(response.stats) == 1,
+                       "Did not receive port stats reply")
+
+        sentp = recvp = 0
+        sentb = recvb = 0
+
+        sleep(1)
+        
+        for item in response.stats:
+            sentp += item.tx_packets
+            recvp += item.rx_packets
+            recvb += item.rx_bytes
+            sentb += item.tx_bytes
+           
+            
+            logging.info("Sent " + str(sentp) + " packets")
+            logging.info("Received " + str(recvp) + " packets")
+            logging.info("Received " + str(recvb) + "bytes")
+            logging.info("Sent" + str(sentb) + "bytes")
+    
+        if tx_packets != None  and  tx_packets != sentp: continue
+        if rx_packets != None  and  rx_packets != recvp: continue 
+        if rx_byte != None  and  rx_byte != recvb: continue
+        if tx_byte != None  and  tx_byte != sentb: continue
+        
+        break
+        
+        
+
+    if (tx_packets != None):
+        self.assertEqual(tx_packets,item.tx_packets,"rx_packets counter is not incremented correctly")
+    if (rx_packets != None):
+        self.assertEqual(rx_packets,item.rx_packets,"tx_packets counter is not incremented correctly")
+    if (rx_byte != None):
+        self.assertEqual(rx_byte,item.rx_bytes,"rx_bytes counter is not incremented correctly")
+    if (tx_byte != None):
+        self.assertEqual(tx_byte,item.tx_bytes,"tx_bytes counter is not incremented correctly")
+
+
+
+def verify_queuestats(self,port_num,queue_id,expect_packet=None,expect_byte=None):
+    
+    # Verify queue counters : tx_packets and tx_bytes
+
+    request = message.queue_stats_request()
+    request.port_no  = port_num
+    request.queue_id = queue_id
+    
+    for i in range(0,60):
+
+        logging.info("Sending stats request")
+     
+        (queue_stats, p) = self.controller.transact(request)
+        self.assertNotEqual(queue_stats, None, "Queue stats request failed")
+        packet_counter = 0
+        byte_counter = 0 
+
+        sleep(1)
+        
+        for item in queue_stats.stats:
+            packet_counter += item.tx_packets
+            byte_counter += item.tx_bytes
+
+            logging.info("Transmitted" + str(packet_counter) + " packets")
+            logging.info("Transmitted" + str(byte_counter) + "bytes")
+           
+        if expect_packet != None  and  packet_counter != expect_packet: continue
+        if expect_byte != None  and  byte_counter != expect_byte: continue
+        break
+
+        
+    
+    if expect_packet != None :
+        self.assertEqual(packet_counter,expect_packet,"tx_packets counter is not incremented correctly")
+
+    if expect_byte != None :   
+        self.assertEqual(byte_counter,expect_byte,"tx_bytes counter is not incremented correctly")
 
 
 ############################## Various delete commands #############################################################################################
 
-def Strict_Delete(self,match,priority=0):
+def strict_delete(self,match,priority=None):
 # Issue Strict Delete 
         
-        #Create flow_mod message, command DELETE_STRICT
-        msg4 = message.flow_mod()
-        msg4.out_port = ofp.OFPP_NONE
-        msg4.command = ofp.OFPFC_DELETE_STRICT
-        msg4.buffer_id = 0xffffffff
-        msg4.match = match
+    #Create flow_mod message, command DELETE_STRICT
+    msg4 = message.flow_mod()
+    msg4.out_port = ofp.OFPP_NONE
+    msg4.command = ofp.OFPFC_DELETE_STRICT
+    msg4.buffer_id = 0xffffffff
+    msg4.match = match
 
-        if priority != 0 :
-                msg4.priority = priority
-
-        rv = self.controller.message_send(msg4)
-        self.assertTrue(rv!= -1, "Error installing flow mod")
-        self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
+    if priority != None :
+        msg4.priority = priority
+    rv = self.controller.message_send(msg4)
+    self.assertTrue(rv!= -1, "Error installing flow mod")
+    self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
 
 
 
-def NonStrict_Delete(self,match,priority=0):
+def nonstrict_delete(self,match,priority=None):
 # Issue Non_Strict Delete 
         
-        #Create flow_mod message, command DELETE
-        msg6 = message.flow_mod()
-        msg6.out_port = ofp.OFPP_NONE
-        msg6.command = ofp.OFPFC_DELETE
-        msg6.buffer_id = 0xffffffff
-        msg6.match = match
+    #Create flow_mod message, command DELETE
+    msg6 = message.flow_mod()
+    msg6.out_port = ofp.OFPP_NONE
+    msg6.command = ofp.OFPFC_DELETE
+    msg6.buffer_id = 0xffffffff
+    msg6.match = match
 
-        if priority != 0 :
-                msg6.priority = priority
+    if priority != None :
+        msg6.priority = priority
 
-        rv = self.controller.message_send(msg6)
-        self.assertTrue(rv != -1, "Error installing flow mod")
-        self.assertEqual(do_barrier(self.controller),0, "Barrier failed")
+    rv = self.controller.message_send(msg6)
+    self.assertTrue(rv != -1, "Error installing flow mod")
+    self.assertEqual(do_barrier(self.controller),0, "Barrier failed")
 
 
 ###########################################################################################################################################################
 
-def SendPacket(obj, pkt, ingress_port, egress_port):
+def send_packet(obj, pkt, ingress_port, egress_port):
 #Send Packets on a specified ingress_port and verify if its recieved on correct egress_port.
 
     obj.dataplane.send(ingress_port, str(pkt))
@@ -307,3 +878,5 @@
         cache_supported_actions = reply.actions
     return cache_supported_actions
 
+##############################################################################################################################################################
+
diff --git a/tests/actions.py b/tests/actions.py
index 590a91c..330068c 100644
--- a/tests/actions.py
+++ b/tests/actions.py
@@ -411,7 +411,7 @@
         logging.info("Expecting packet on the egress_port")
         
         #Insert a all wildcarded flow
-        (pkt,match) = Wildcard_All(self,of_ports)
+        (pkt,match) = wildcard_all(self,of_ports)
         
         #Create a packet out message
         pkt_out =message.packet_out();
diff --git a/tests/counters.py b/tests/counters.py
new file mode 100644
index 0000000..daa3cb2
--- /dev/null
+++ b/tests/counters.py
@@ -0,0 +1,692 @@
+"""These tests fall under Conformance Test-Suite (OF-SWITCH-1.0.0 TestCases).
+    Refer Documentation -- Detailed testing methodology 
+    <Some of test-cases are directly taken from oftest> """
+
+"Test Suite 5 --> Counters"
+
+import logging
+
+import unittest
+import random
+
+from oftest import config
+import oftest.controller as controller
+import oftest.cstruct as ofp
+import oftest.message as message
+import oftest.dataplane as dataplane
+import oftest.action as action
+import oftest.parse as parse
+import oftest.base_tests as base_tests
+import time
+
+from oftest.testutils import *
+from time import sleep
+from FuncUtils import*
+
+
+def port_queues_get(self, queue_stats, port_num):
+            result = []
+            for qs in queue_stats.stats:
+                if qs.port_no != port_num:
+                    continue
+                result.append(qs.queue_id)
+            return result
+
+
+class PktPerFlow(base_tests.SimpleDataPlane):
+
+    """Verify Packet counters per flow are
+    incremented by no. of packets received for that flow"""
+
+    def runTest(self):
+
+        logging.info("Running PktPerFlow test")
+
+        of_ports = config["port_map"].keys()
+        of_ports.sort()
+        self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
+        
+        #Clear switch state      
+        rv = delete_all_flows(self.controller)
+        self.assertEqual(rv, 0, "Failed to delete all flows")
+
+        logging.info("Insert any flow")
+        logging.info("Sending N Packets matching the flow")
+        logging.info("Verify packet counters increment in accordance")
+        
+        #Create a Match on Ingress flow
+        (pkt,match) = wildcard_all_except_ingress(self,of_ports)
+       
+        #Send Packets matching the flow 
+        num_pkts = 5 
+        for pkt_cnt in range(num_pkts):
+            self.dataplane.send(of_ports[0],str(pkt))
+         
+        #Verify Recieved Packets/Bytes Per Flow  
+        verify_flowstats(self,match,packet_count=num_pkts)
+
+
+class BytPerFlow(base_tests.SimpleDataPlane):
+
+    """Verify Byte counters per flow are
+    incremented by no. of  bytes received for that flow"""
+
+    def runTest(self):
+
+        logging.info("Running BytPerFlow test")
+
+        of_ports = config["port_map"].keys()
+        of_ports.sort()
+        self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
+        
+        #Clear switch state      
+        rv = delete_all_flows(self.controller)
+        self.assertEqual(rv, 0, "Failed to delete all flows")
+
+        logging.info("Insert any flow")
+        logging.info("Sending N Packets matching the flow")
+        logging.info("Verify byte counters increment in accordance")
+        
+        #Create a Match on Ingress flow
+        (pkt,match) = wildcard_all_except_ingress(self,of_ports)
+       
+        #Send Packets matching the flow 
+        num_pkts = 5 
+        byte_count = num_pkts*len(str(pkt))
+        for pkt_cnt in range(num_pkts):
+            self.dataplane.send(of_ports[0],str(pkt))
+         
+        #Verify Recieved Packets/Bytes Per Flow  
+        verify_flowstats(self,match,byte_count=byte_count)
+
+
+class DurationPerFlow(base_tests.SimpleDataPlane):
+    
+    """Verify Duration_sec and Duration_nsec counters per flow varies in accordance with the amount of 
+    time the flow was alive"""
+
+    def runTest(self):
+        
+        logging.info("Running DurationPerFlow test")
+
+        of_ports = config["port_map"].keys()
+        of_ports.sort()
+        self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
+        
+        #Clear switch state
+        rc = delete_all_flows(self.controller)
+        self.assertEqual(rc, 0, "Failed to delete all flows")
+
+        logging.info("Insert any flow")
+        logging.info("Send Flow_stats request after n sec intervals")
+        logging.info("Verify duration_sec and nsec counters are incrementing in accordance with the life of flow")
+
+        #Create a flow with match on ingress_port
+        (pkt,match) = wildcard_all_except_ingress(self,of_ports)
+    
+        #Create flow_stats request 
+        test_timeout = 30
+        stat_req = message.flow_stats_request()
+        stat_req.match= match
+        stat_req.table_id = 0xff
+        stat_req.out_port = ofp.OFPP_NONE
+        
+        flow_stats_gen_ts =  range (10,test_timeout,10)
+        
+        for ts in range(0,test_timeout):
+            if ts in flow_stats_gen_ts:
+                response, pkt = self.controller.transact(stat_req)
+                
+                self.assertTrue(response is not None,"No response to stats request")
+                self.assertTrue(len(response.stats) == 1,"Did not receive flow stats reply")
+                
+                stat = response.stats[0]
+                self.assertTrue(stat.duration_sec == ts,"Flow stats reply incorrect")
+                logging.info("Duration of flow is " + str(stat.duration_sec) + str(stat.duration_nsec)) 
+            
+            sleep(1)
+
+
+class RxPktPerPort(base_tests.SimpleDataPlane):
+
+    """Verify that rx_packets counter in the Port_Stats reply
+        increments when packets are received on a port"""
+    
+    def runTest(self):
+
+        logging.info("Running RxPktPerPort test")
+
+        of_ports = config["port_map"].keys()
+        of_ports.sort()
+        self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
+        
+        # Clear Switch State
+        rv = delete_all_flows(self.controller)
+        self.assertEqual(rv, 0, "Failed to delete all flows")
+
+        logging.info("Insert a flow with match on ingress_port")
+        logging.info("Send N Packets on an ingress_port P ")
+        logging.info("Send Port_Stats Request for Port P , verify recieved packets counters are incrementing in accordance")
+        
+        #Insert a flow with match on all ingress port
+        (pkt, match ) = wildcard_all_except_ingress(self,of_ports)
+
+        # Send Port_Stats request for the ingress port (retrieve old counter state)
+        (counter) = get_portstats(self,of_ports[0])
+
+        # Send packets matching the flow
+        num_pkts = 5 
+        for pkt_cnt in range(num_pkts):
+            self.dataplane.send(of_ports[0],str(pkt))
+
+        pkts = num_pkts+counter[0]
+
+        #Verify recieved packet counters 
+        verify_portstats(self,of_ports[0],rx_packets=pkts)
+
+class TxPktPerPort(base_tests.SimpleDataPlane):
+
+    """Verify that tx_packets counter in the Port_Stats reply , increments when packets are transmitted by a port"""
+      
+    def runTest(self):
+
+        logging.info("Running TxPktPerPort test")
+
+        of_ports = config["port_map"].keys()
+        of_ports.sort()
+        self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
+        
+        #Clear switch state
+        rv = delete_all_flows(self.controller)
+        self.assertEqual(rv, 0, "Failed to delete all flows")
+
+        logging.info("Insert any flow matching on in_port=ingress_port, action output to egress_port T ")
+        logging.info("Send N Packets matching the flow on ingress_port P ")
+        logging.info("Send Port_Stats Request for Port T , verify transmitted packets counters are incrementing in accordance")
+        
+        #Insert a flow with match on all ingress port
+        (pkt,match) = wildcard_all_except_ingress(self,of_ports)
+        
+        # Send Port_Stats request for the ingress port (retrieve old counter state)
+        (counter) = get_portstats(self,of_ports[1])
+        
+        #Send packets matching the flow
+        num_pkts = 5
+        for pkt_cnt in range(num_pkts):
+            self.dataplane.send(of_ports[0],str(pkt))
+
+        pkts = num_pkts+counter[1]
+        
+        #Verify transmitted_packet counters 
+        verify_portstats(self,of_ports[1],tx_packets=pkts)
+
+
+
+class RxBytPerPort(base_tests.SimpleDataPlane):
+
+    """Verify that recieved bytes counter in the Port_Stats reply , increments in accordance with the bytes recieved on a port"""
+
+    def runTest(self):
+        
+        logging.info("Running RxBytPerPort test")
+
+        of_ports = config["port_map"].keys()
+        of_ports.sort()
+        self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
+         
+        #Clear switch State        
+        rv = delete_all_flows(self.controller)
+        self.assertEqual(rv, 0, "Failed to delete all flows")
+
+        logging.info("Insert any flow matching on in_port=ingress_port")
+        logging.info("Send N Packets matching the flow on ingress_port P ")
+        logging.info("Send Port_Stats Request for Port P , verify recieved bytes counters are incrementing in accordance")
+        
+        #Insert a flow with match on all ingress port
+        (pkt, match ) = wildcard_all_except_ingress(self,of_ports)
+
+        # Send Port_Stats request for the ingress port (retrieve current counter state)
+        (counter) = get_portstats(self,of_ports[0])
+           
+        #Send packets matching the flow.
+        num_pkts = 5
+        byte_count = num_pkts*len(str(pkt))
+        for pkt_cnt in range(num_pkts):
+            self.dataplane.send(of_ports[0],str(pkt))
+
+        byt_count = byte_count+counter[2]
+
+        #Verify recieved_bytes counters 
+        verify_portstats(self,of_ports[0],rx_byte=byt_count)
+
+
+class TxBytPerPort(base_tests.SimpleDataPlane):
+
+    """Verify that trasnsmitted bytes counter in the Port_Stats reply , increments in accordance with the bytes trasmitted by a port"""
+
+    def runTest(self):
+        
+        logging.info("Running TxBytPerPort test")
+
+        of_ports = config["port_map"].keys()
+        of_ports.sort()
+        self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
+         
+        #Clear switch State        
+        rv = delete_all_flows(self.controller)
+        self.assertEqual(rv, 0, "Failed to delete all flows")
+
+        logging.info("Insert any flow matching on in_port=ingress_port,action = output to egress_port T")
+        logging.info("Send N Packets matching the flow on ingress_port P ")
+        logging.info("Send Port_Stats Request for Port T , verify trasmitted bytes counters are incrementing in accordance")
+        
+        #Insert a flow with match on all ingress port
+        (pkt, match ) = wildcard_all_except_ingress(self,of_ports)
+
+        # Send Port_Stats request for the ingress port (retrieve current counter state)
+        (counter) = get_portstats(self,of_ports[1])
+        
+        #Send packets matching the flow.
+        num_pkts = 5
+        byte_count = num_pkts*len(str(pkt))
+        for pkt_cnt in range(num_pkts):
+            self.dataplane.send(of_ports[0],str(pkt))
+
+        byt_count = byte_count+counter[3]
+        
+        #Verify trasmitted_bytes counters 
+        verify_portstats(self,of_ports[1],tx_byte=byt_count)
+
+class ActiveCount(base_tests.SimpleDataPlane):
+
+    """Verify that active_count counter in the Table_Stats reply , increments in accordance with the flows inserted in a table"""
+
+    def runTest(self):
+
+        logging.info("Running Table_Counter_1 test")
+
+        of_ports = config["port_map"].keys()
+        of_ports.sort()
+        self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
+         
+        #Clear Switch state
+        rv = delete_all_flows(self.controller)
+        self.assertEqual(rv, 0, "Failed to delete all flows")
+
+        logging.info("Insert any flow matching on in_port=ingress_port,action = output to egress_port T ")
+        logging.info("Send Table_Stats, verify active_count counter is incremented in accordance")
+
+        #Insert a flow with match on all ingress port
+        (pkt, match ) = wildcard_all_except_ingress(self,of_ports)
+
+        #Generate  Table_Stats
+        verify_tablestats(self,expect_active=1)
+
+
+class LookupMatchedCount(base_tests.SimpleDataPlane):
+    
+    """Verify that lookup_count and matched_count counter in the Table_Stats reply 
+        increments in accordance with the packets looked up and matched with the flows in the table"""
+
+    def runTest(self):
+
+        logging.info("Running LookupMatchedCount test")
+
+        of_ports = config["port_map"].keys()
+        of_ports.sort()
+        self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
+         
+        #Clear Switch state
+        rv = delete_all_flows(self.controller)
+        self.assertEqual(rv, 0, "Failed to delete all flows")
+
+        logging.info("Insert any flow matching on in_port=ingress_port,action = output to egress_port")
+        logging.info("Send N packets matching the flow, N' packets not matching the flow")
+        logging.info("Send Table_Stats, verify lookup_count = N+N' & matched_count=N ")
+
+        #Get Current Table Stats
+        (current_lookedup,current_matched,current_active) = get_tablestats(self)
+
+        #Insert a flow with match on all ingress port
+        (pkt, match ) = wildcard_all_except_ingress(self,of_ports)
+
+        #send packet pkt N times (pkt matches the flow)
+        num_sends = 5
+        for pkt_cnt in range(num_sends):
+            self.dataplane.send(of_ports[0],str(pkt))
+
+        #send packet pkt N' (pkt does not match the flow)
+        num_sends2 = 5
+        for pkt_cnt in range(num_sends):
+            self.dataplane.send(of_ports[1],str(pkt))
+
+        new_lookup = num_sends+num_sends2+current_lookedup
+        new_matched = num_sends+current_matched
+
+        #Verify lookup_count and matched_count counters.
+        verify_tablestats(self,expect_lookup=new_lookup,expect_match=new_matched)
+
+class TxPktPerQueue(base_tests.SimpleDataPlane):
+
+    """Verify that tx_packets in the queue_stats reply increments in accordance with the number of transmitted packets"""
+    
+    def runTest(self):
+        logging.info("Running TxPktPerQueue test")
+
+        of_ports = config["port_map"].keys()
+        of_ports.sort()
+        self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
+        
+        # Get queue stats from switch (retrieve current state)
+        (queue_stats,p) = get_queuestats(self,ofp.OFPP_ALL,ofp.OFPQ_ALL)
+  
+        for idx in range(len(of_ports)):
+            ingress_port = of_ports[idx]
+            egress_port = of_ports[(idx + 1) % len(of_ports)]
+
+            queue_id = port_queues_get(self,queue_stats,egress_port)
+
+            for egress_queue_id in queue_id:
+
+                #Clear switch state
+                rv = delete_all_flows(self.controller)
+                self.assertEqual(rv, 0, "Failed to delete all flows")
+
+                # Get Queue stats for selected egress queue only
+                (qs_before,p) = get_queuestats(self,egress_port,egress_queue_id)
+
+                #Insert a flow with enqueue action to queues configured on egress_port
+                (pkt,match) = enqueue(self,ingress_port,egress_port,egress_queue_id)
+              
+                #Send packet on the ingress_port and verify its received on egress_port
+                send_packet(self,pkt,ingress_port,egress_port)
+                
+                expected_packets = qs_before.stats[0].tx_packets+1
+
+                verify_queuestats(self,egress_port,egress_queue_id,expect_packet=expected_packets)
+       
+
+class TxBytPerQueue(base_tests.SimpleDataPlane):
+
+    """Verify that tx_bytes in the queue_stats reply increments in accordance with the number of transmitted bytes"""
+    
+    def runTest(self):
+        logging.info("Running TxBytPerQueue test")
+
+        of_ports = config["port_map"].keys()
+        of_ports.sort()
+        self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
+        
+        # Get queue stats from switch (retrieve current state)
+        (queue_stats,p) = get_queuestats(self,ofp.OFPP_ALL,ofp.OFPQ_ALL)
+  
+        for idx in range(len(of_ports)):
+            ingress_port = of_ports[idx]
+            egress_port = of_ports[(idx + 1) % len(of_ports)]
+
+            queue_id = port_queues_get(self,queue_stats,egress_port)
+
+            for egress_queue_id in queue_id:
+
+                #Clear switch state
+                rv = delete_all_flows(self.controller)
+                self.assertEqual(rv, 0, "Failed to delete all flows")
+
+                # Get Queue stats for selected egress queue only
+                (qs_before,p) = get_queuestats(self,egress_port,egress_queue_id)
+
+                #Insert a flow with enqueue action to queues configured on egress_port
+                (pkt,match) = enqueue(self,ingress_port,egress_port,egress_queue_id)
+              
+                #Send packet on the ingress_port and verify its received on egress_port
+                send_packet(self,pkt,ingress_port,egress_port)
+                
+                expected_bytes = qs_before.stats[0].tx_bytes+len(str(pkt))
+
+                verify_queuestats(self,egress_port,egress_queue_id,expect_byte=expected_bytes)
+       
+       
+class RxDrops(base_tests.SimpleDataPlane):
+
+    """Verify that rx_dropped counters in the Port_Stats reply increments in accordance with the packets dropped by RX"""
+
+    def runTest(self):
+        
+        logging.info("Running Rx_Drops test")
+
+        of_ports = config["port_map"].keys()
+        of_ports.sort()
+        self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
+         
+        #Clear switch State        
+        rv = delete_all_flows(self.controller)
+        self.assertEqual(rv, 0, "Failed to delete all flows")
+
+        logging.info("Send Port_Stats Request")
+        logging.info("Verify reply has rx_dropped count ")
+
+        # Send Port_Stats request for the ingress port (retrieve current counter state)
+        (counter) = get_portstats(self,of_ports[0])
+
+        rx_drp = counter[4]
+        logging.info("recieved dropped count is :" + str(rx_drp))
+
+
+
+class TxDrops(base_tests.SimpleDataPlane):
+
+    """Verify that tx_dropped counters in the Port_Stats reply increments in accordance with the packets dropped by TX"""
+
+    def runTest(self):
+        
+        logging.info("Running Tx_Drops test")
+
+        of_ports = config["port_map"].keys()
+        of_ports.sort()
+        self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
+         
+        #Clear switch State        
+        rv = delete_all_flows(self.controller)
+        self.assertEqual(rv, 0, "Failed to delete all flows")
+
+        logging.info("Send Port_Stats Request")
+        logging.info("Verify reply has tx_dropped count ")
+
+        # Send Port_Stats request for the ingress port (retrieve current counter state)
+        (counter) = get_portstats(self,of_ports[1])
+        
+        tx_drp = counter[5]
+        logging.info("Transmitted dropped count is :" + str(tx_drp))
+
+
+class RxErrors(base_tests.SimpleDataPlane):
+
+    """Verify that rx_errors counters in the Port_Stats reply increments in accordance with number of recieved error  
+          This is a super-set of more specific receive errors and should be greater than or equal to the sum of all
+                  rx_*_err values"""
+
+    def runTest(self):
+        
+        logging.info("Running Rx_Errors test")
+
+        of_ports = config["port_map"].keys()
+        of_ports.sort()
+        self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
+         
+        #Clear switch State        
+        rv = delete_all_flows(self.controller)
+        self.assertEqual(rv, 0, "Failed to delete all flows")
+
+        logging.info("Send Port_Stats Request")
+        logging.info("Verify reply has rx_errors count ")
+
+        # Send Port_Stats request for the ingress port (retrieve current counter state)
+        (counter) = get_portstats(self,of_ports[0])
+
+        rx_err = counter[6]    
+        logging.info("Recieve Errors count is :" + str(rx_err))
+
+
+class TxErrors(base_tests.SimpleDataPlane):
+
+    """Verify that Tx_errors counters in the Port_Stats reply increments in accordance with number of trasmit error"""
+
+    def runTest(self):
+        
+        logging.info("Running Tx_Errors test")
+
+        of_ports = config["port_map"].keys()
+        of_ports.sort()
+        self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
+         
+        #Clear switch State        
+        rv = delete_all_flows(self.controller)
+        self.assertEqual(rv, 0, "Failed to delete all flows")
+
+        logging.info("Send Port_Stats Request")
+        logging.info("Verify reply has Tx_errors count ")
+
+        # Send Port_Stats request for the ingress port (retrieve current counter state)
+        (counter) = get_portstats(self,of_ports[0])
+        
+        tx_err = counter[7]
+        logging.info("Trasmit Error count is :" + str(tx_err))
+
+
+class RxFrameErr(base_tests.SimpleDataPlane):
+
+    """Verify that rx_frm_err counters in the Port_Stats reply increments in accordance with the number of frame alignment errors"""
+
+    def runTest(self):
+        
+        logging.info("Running Rx_Frame_Err test")
+
+        of_ports = config["port_map"].keys()
+        of_ports.sort()
+        self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
+         
+        #Clear switch State        
+        rv = delete_all_flows(self.controller)
+        self.assertEqual(rv, 0, "Failed to delete all flows")
+
+        logging.info("Send Port_Stats Request")
+        logging.info("Verify reply has rx_frame_err count ")
+
+        # Send Port_Stats request for the ingress port (retrieve current counter state)
+        (counter) = get_portstats(self,of_ports[0])
+        
+        rx_fr_err = counter[8]
+        logging.info("Recieve Frame Errors count is :" + str(rx_fr_err))
+
+
+
+class RxOErr(base_tests.SimpleDataPlane):
+
+    """Verify that rx_over_err counters in the Port_Stats reply increments in accordance with the number of with RX overrun"""
+
+    def runTest(self):
+        
+        logging.info("Running Rx_O_Err test")
+
+        of_ports = config["port_map"].keys()
+        of_ports.sort()
+        self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
+         
+        #Clear switch State        
+        rv = delete_all_flows(self.controller)
+        self.assertEqual(rv, 0, "Failed to delete all flows")
+
+        logging.info("Send Port_Stats Request")
+        logging.info("Verify reply has rx_over_err count ")
+
+        # Send Port_Stats request for the ingress port (retrieve current counter state)
+        (counter) = get_portstats(self,of_ports[0])
+        
+        rx_over_err = counter[9]
+        logging.info("Recieve Overrun Errors  count is :" + str(rx_over_err))
+
+
+
+
+class RxCrcErr(base_tests.SimpleDataPlane):
+
+    """Verify that rx_crc_err counters in the Port_Stats reply increments in accordance with the number of crc errors"""
+
+    def runTest(self):
+        
+        logging.info("Running Port_Counter_9 test")
+
+        of_ports = config["port_map"].keys()
+        of_ports.sort()
+        self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
+         
+        #Clear switch State        
+        rv = delete_all_flows(self.controller)
+        self.assertEqual(rv, 0, "Failed to delete all flows")
+
+        logging.info("Send Port_Stats Request")
+        logging.info("Verify reply has rx_crc_err count ")
+
+        # Send Port_Stats request for the ingress port (retrieve current counter state)
+        (counter) = get_portstats(self,of_ports[0])
+
+        rx_crc_err = counter[10]   
+        logging.info("Recieve CRC Errors  count is :" + str(rx_crc_err))
+
+
+
+class Collisions(base_tests.SimpleDataPlane):
+
+    """Verify that collisons counters in the Port_Stats reply increments in accordance with the collisions encountered by the switch """
+
+    def runTest(self):
+        
+        logging.info("Running Collisions test")
+
+        of_ports = config["port_map"].keys()
+        of_ports.sort()
+        self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
+         
+        #Clear switch State        
+        rv = delete_all_flows(self.controller)
+        self.assertEqual(rv, 0, "Failed to delete all flows")
+
+        logging.info("Send Port_Stats Request")
+        logging.info("Verify reply has Collisions count ")
+
+        # Send Port_Stats request for the ingress port (retrieve current counter state)
+        (counter) = get_portstats(self,of_ports[0])
+
+        collisions = counter[11]
+        logging.info("collisions count is :" + str(collisions))
+
+
+
+
+class TxErrorPerQueue(base_tests.SimpleDataPlane):
+
+    """Verify that tx_errors in the queue_stats reply increments in accordance with the number of packets dropped due to overrun """
+
+    def runTest(self):
+        
+        logging.info("Running TxErrorPerQueue test")
+
+        of_ports = config["port_map"].keys()
+        of_ports.sort()
+        self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
+         
+        #Clear switch State        
+        rv = delete_all_flows(self.controller)
+        self.assertEqual(rv, 0, "Failed to delete all flows")
+
+        logging.info("Send Queue_Stats Request")
+        logging.info("Verify reply has Tramitted Overrun errors count ")
+
+        # Send Port_Stats request for the ingress port (retrieve current counter state)
+        (counter) = get_portstats(self,of_ports[0])
+
+        tx_err = counter[12]
+        logging.info("Transmit Overrun Error count is :" + str(tx_err))
+
+
+
diff --git a/tests/detailed_contr_sw_messages.py b/tests/detailed_contr_sw_messages.py
index c969030..da1b046 100644
--- a/tests/detailed_contr_sw_messages.py
+++ b/tests/detailed_contr_sw_messages.py
@@ -43,14 +43,14 @@
         logging.info("Expecting switch to return an error")
 
         #Insert a flow F with wildcarded all fields
-        (pkt,match) = Wildcard_All(self,of_ports)
+        (pkt,match) = wildcard_all(self,of_ports)
 
         #Verify flow is active  
-        Verify_TableStats(self,active_entries=1)
+        verify_tablestats(self,expect_active=1)
         
         # Build a overlapping flow F'-- Wildcard All except ingress with check overlap bit set
-        Pkt_MatchIngress = simple_tcp_packet()
-        match3 = parse.packet_to_flow_match(Pkt_MatchIngress)
+        pkt_matchingress = simple_tcp_packet()
+        match3 = parse.packet_to_flow_match(pkt_matchingress)
         self.assertTrue(match3 is not None, "Could not generate flow match from pkt")
         match3.wildcards = ofp.OFPFW_ALL-ofp.OFPFW_IN_PORT
         match3.in_port = of_ports[0]
@@ -70,7 +70,7 @@
         self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
 
         # Verify Flow does not get inserted 
-        Verify_TableStats(self,active_entries=1)
+        verify_tablestats(self,expect_active=1)
 
         #Verify OFPET_FLOW_MOD_FAILED/OFPFMFC_OVERLAP error is recieved on the control plane
         (response, pkt) = self.controller.poll(exp_msg=ofp.OFPT_ERROR,         
@@ -103,16 +103,16 @@
         logging.info("Expecting switch to insert the flows without generating errors")
 
         #Build a flow F with wildcarded all fields.
-        (pkt,match) = Wildcard_All(self,of_ports)
+        (pkt,match) = wildcard_all(self,of_ports)
         
         #Verify flow is active  
-        Verify_TableStats(self,active_entries=1)
+        verify_tablestats(self,expect_active=1)
         
         # Build a overlapping flow F' without check overlap bit set.
-        Wildcard_All_Except_Ingress(self,of_ports)
+        wildcard_all_except_ingress(self,of_ports)
 
         # Verify Flow gets inserted 
-        Verify_TableStats(self,active_entries=2)
+        verify_tablestats(self,expect_active=2)
 
 
 class IdenticalFlows(base_tests.SimpleDataPlane):
@@ -135,25 +135,25 @@
         logging.info("Expecting switch to overwrite the first flow and clear the counters associated with it ")
         
         # Create and add flow-1, check on dataplane it is active.
-        (pkt,match) = Wildcard_All(self,of_ports)
+        (pkt,match) = wildcard_all(self,of_ports)
 
         # Verify active_entries in table_stats_request =1 
-        Verify_TableStats(self,active_entries=1)
+        verify_tablestats(self,expect_active=1)
         
         # Send Packet (to increment counters like byte_count and packet_count)
-        SendPacket(self,pkt,of_ports[0],of_ports[1])
+        send_packet(self,pkt,of_ports[0],of_ports[1])
 
         # Verify Flow counters have incremented
-        Verify_FlowStats(self,match,byte_count=len(str(pkt)),packet_count=1)
+        verify_flowstats(self,match,byte_count=len(str(pkt)),packet_count=1)
         
         #Send Identical flow 
-        (pkt1,match1) = Wildcard_All(self,of_ports)
+        (pkt1,match1) = wildcard_all(self,of_ports)
 
         # Verify active_entries in table_stats_request =1 
-        Verify_TableStats(self,active_entries=1)
+        verify_tablestats(self,expect_active=1)
 
         # Verify Flow counters reset
-        Verify_FlowStats(self,match,byte_count=0,packet_count=0)
+        verify_flowstats(self,match,byte_count=0,packet_count=0)
 
    
 class EmerFlowTimeout(base_tests.SimpleProtocol): 
@@ -245,7 +245,7 @@
         self.assertEqual(do_barrier(self.controller), 0, "Barrier failed") 
 
         #Verify the flow gets added i.e. active_count= 1
-        Verify_TableStats(self,active_entries=1)
+        verify_tablestats(self,expect_active=1)
 
 
 class ModifyAction(base_tests.SimpleDataPlane):
@@ -268,22 +268,22 @@
         logging.info("Expecting the flow action to be modified , but the flow-counters should be preserved")
            
         #Create and add flow-1 Match on all, except one wildcarded (src adddress).Action A , output to of_port[1]
-        (pkt,match) = Match_All_Except_Source_Address(self,of_ports)
+        (pkt,match) = match_all_except_source_address(self,of_ports)
 
         #Send Packet matching the flow thus incrementing counters like packet_count,byte_count
-        SendPacket(self,pkt,of_ports[0],of_ports[1])
+        send_packet(self,pkt,of_ports[0],of_ports[1])
 
         #Verify flow counters
-        Verify_FlowStats(self,match,byte_count=len(str(pkt)),packet_count=1)
+        verify_flowstats(self,match,byte_count=len(str(pkt)),packet_count=1)
 
         #Modify flow- 1 
-        Modify_Flow_Action(self,of_ports,match)
+        modify_flow_action(self,of_ports,match)
         
         # Send Packet matching the flow-1 i.e ingress_port=port[0] and verify it is recieved on corret dataplane port i.e port[2]
-        SendPacket(self,pkt,of_ports[0],of_ports[2])
+        send_packet(self,pkt,of_ports[0],of_ports[2])
         
         #Verify flow counters are preserved
-        Verify_FlowStats(self,match,byte_count=(2*len(str(pkt))),packet_count=2)
+        verify_flowstats(self,match,byte_count=(2*len(str(pkt))),packet_count=2)
 
 
 class StrictModifyAction(base_tests.SimpleDataPlane):
@@ -306,28 +306,28 @@
         logging.info("Expecting the flow action to be modified , but the flow-counters should be preserved")
         
         #Create and add flow-1 Match on all, except one wildcarded (src adddress).Action A
-        (pkt,match) = Match_All_Except_Source_Address(self,of_ports,priority=100)
+        (pkt,match) = match_all_except_source_address(self,of_ports,priority=100)
         
         #Create and add flow-2 , Match on ingress_port only, Action A
-        (pkt1,match1) = Wildcard_All_Except_Ingress(self,of_ports,priority=10)
+        (pkt1,match1) = wildcard_all_except_ingress(self,of_ports,priority=10)
         
         # Verify both the flows are active
-        Verify_TableStats(self,active_entries=2)
+        verify_tablestats(self,expect_active=2)
 
         #Send a packet matching the flows, thus incrementing flow-counters (packet matches the flow F-1 with higher priority)
-        SendPacket(self,pkt,of_ports[0],of_ports[1])
+        send_packet(self,pkt,of_ports[0],of_ports[1])
 
         # Verify flow counters of the flow-1
-        Verify_FlowStats(self,match,byte_count=len(str(pkt)),packet_count=1)
+        verify_flowstats(self,match,byte_count=len(str(pkt)),packet_count=1)
 
         # Strict-Modify flow- 1 
-        Strict_Modify_Flow_Action(self,of_ports[2],match,priority=100)
+        strict_modify_flow_action(self,of_ports[2],match,priority=100)
         
         # Send Packet matching the flow-1 i.e ingress_port=port[0] and verify it is recieved on corret dataplane port i.e port[2]
-        SendPacket(self,pkt,of_ports[0],of_ports[2])
+        send_packet(self,pkt,of_ports[0],of_ports[2])
         
         # Verify flow counters are preserved
-        Verify_FlowStats(self,match,byte_count=(2*len(str(pkt))),packet_count=2)
+        verify_flowstats(self,match,byte_count=(2*len(str(pkt))),packet_count=2)
 
 
 class DeleteNonexistingFlow(base_tests.SimpleDataPlane):
@@ -387,13 +387,13 @@
         logging.info("Expecting flow removed message only for F2")
 
         # Insert flow-1 with F without OFPFF_SEND_FLOW_REM flag set.
-        (pkt,match) = Wildcard_All_Except_Ingress(self,of_ports)
+        (pkt,match) = wildcard_all_except_ingress(self,of_ports)
 
         # Verify flow is inserted 
-        Verify_TableStats(self,active_entries=1)
+        verify_tablestats(self,expect_active=1)
 
         #Delete the flow-1
-        NonStrict_Delete(self,match,priority=0)
+        nonstrict_delete(self,match,priority=0)
 
         # Verify no flow removed message is generated for the FLOW-1
 
@@ -461,7 +461,7 @@
         
         # Delete the emergency flow
         
-        NonStrict_Delete(self,match)
+        nonstrict_delete(self,match)
         (response, pkt) = self.controller.poll(exp_msg=ofp.OFPFF_SEND_FLOW_REM ,
                                                timeout=2)
         self.assertTrue(response is None, 
@@ -489,69 +489,69 @@
         logging.info("Issue Strict Delete command , verify it gets deleted")     
         
         #Insert F with an exact Match 
-        (pkt,match) = Exact_Match(self,of_ports)  
-        Verify_TableStats(self,active_entries=1)
+        (pkt,match) = exact_match(self,of_ports)  
+        verify_tablestats(self,expect_active=1)
 
         #Issue Strict Delete Command , verify F gets deleted.
-        Strict_Delete(self,match)
-        Verify_TableStats(self,active_entries=0)
+        strict_delete(self,match)
+        verify_tablestats(self,expect_active=0)
 
         logging.info("Inserting two overlapping flows")
         logging.info("Issue Strict Delete command ")
         logging.info("Expecting only one flow gets deleted , because Strict Delete matches on wildcards as well")     
         
         #Insert Flow T with match on all , except one wildcarded ( say src adddress ). 
-        (pkt,match) = Match_All_Except_Source_Address(self,of_ports)
+        (pkt,match) = match_all_except_source_address(self,of_ports)
 
         #Insert another flow T' with match on ingress_port , wildcarded rest.  
-        (pkt1,match1) = Wildcard_All_Except_Ingress(self,of_ports)
-        Verify_TableStats(self,active_entries=2)
+        (pkt1,match1) = wildcard_all_except_ingress(self,of_ports)
+        verify_tablestats(self,expect_active=2)
 
         #Issue Strict Delete matching on ingress_port. Verify only T' gets deleted
-        Strict_Delete(self,match1)
-        Verify_TableStats(self,active_entries=1) 
+        strict_delete(self,match1)
+        verify_tablestats(self,expect_active=1) 
 
         logging.info("Inserting two overlapping flows")
         logging.info("Issue Non-Strict Delete command ")
         logging.info("Expecting both the flow gets deleted , because wildcards are active")    
 
         #Insert T and T' again . 
-        (pkt,match) = Match_All_Except_Source_Address(self,of_ports)
-        (pkt1,match1) = Wildcard_All_Except_Ingress(self,of_ports)
-        Verify_TableStats(self,active_entries=2)
+        (pkt,match) = match_all_except_source_address(self,of_ports)
+        (pkt1,match1) = wildcard_all_except_ingress(self,of_ports)
+        verify_tablestats(self,expect_active=2)
 
         #Issue Non-strict Delete with match on ingress_port.Verify T+T' gets deleted . 
-        NonStrict_Delete(self,match1)
-        Verify_TableStats(self,active_entries=0)
+        nonstrict_delete(self,match1)
+        verify_tablestats(self,expect_active=0)
 
         logging.info("Inserting three overlapping flows with different priorities")
         logging.info("Issue Non-Strict Delete command ")
         logging.info("Expecting all the flows to get deleted")  
   
         #Insert T , add Priority P (say 100 ) 
-        (pkt,match) = Match_All_Except_Source_Address(self,of_ports,priority=100)
+        (pkt,match) = match_all_except_source_address(self,of_ports,priority=100)
 
         #Insert T' add priority (200).
-        (pkt1,match1) = Wildcard_All_Except_Ingress(self,of_ports,priority=200)
+        (pkt1,match1) = wildcard_all_except_ingress(self,of_ports,priority=200)
         
         #Insert T' again add priority 300 --> T" . 
-        (pkt2,match2) = Wildcard_All_Except_Ingress(self,of_ports,priority=300)
-        Verify_TableStats(self,active_entries=3)
+        (pkt2,match2) = wildcard_all_except_ingress(self,of_ports,priority=300)
+        verify_tablestats(self,expect_active=3)
 
         #Issue Non-Strict Delete and verify all getting deleted
-        NonStrict_Delete(self,match1,priority=200)
-        Verify_TableStats(self,active_entries=0)
+        nonstrict_delete(self,match1,priority=200)
+        verify_tablestats(self,expect_active=0)
 
         logging.info("Inserting three overlapping flows with different priorities")
         logging.info("Issue Strict Delete command ")
         logging.info("Expecting only one to get deleted because here priorities & wildcards are being matched")  
 
         #Issue Strict-Delete and verify only T'' gets deleted. 
-        (pkt,match) = Match_All_Except_Source_Address(self,of_ports,priority=100)
-        (pkt1,match1) = Wildcard_All_Except_Ingress(self,of_ports,priority=200)
-        (pkt2,match2) = Wildcard_All_Except_Ingress(self,of_ports,priority=300)
-        Strict_Delete(self,match1,priority=200)
-        Verify_TableStats(self,active_entries=2)
+        (pkt,match) = match_all_except_source_address(self,of_ports,priority=100)
+        (pkt1,match1) = wildcard_all_except_ingress(self,of_ports,priority=200)
+        (pkt2,match2) = wildcard_all_except_ingress(self,of_ports,priority=300)
+        strict_delete(self,match1,priority=200)
+        verify_tablestats(self,expect_active=2)
 
         
    
@@ -577,10 +577,10 @@
         logging.info("Expecting switch to filter the delete command")
         
         #Build and send Flow-1 with action output to of_port[1]
-        (pkt,match) = Wildcard_All_Except_Ingress(self,of_ports)
+        (pkt,match) = wildcard_all_except_ingress(self,of_ports)
 
         # Verify active_entries in table_stats_request = 1
-        Verify_TableStats(self,active_entries=1)
+        verify_tablestats(self,expect_active=1)
 
         #Send delete command matching the flow-1 but with contraint out_port = of_port[2]
         msg7 = message.flow_mod()
@@ -594,7 +594,7 @@
         self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
 
         # Verify flow will not get deleted, active_entries in table_stats_request = 1
-        Verify_TableStats(self,active_entries=1)
+        verify_tablestats(self,expect_active=1)
 
         logging.info("Deleting the flow with out_port set to of_port[1]")
         logging.info("Expecting switch to delete the flow")
@@ -611,7 +611,7 @@
         self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
         
         #Verify flow gets deleted.
-        Verify_TableStats(self,active_entries=0)
+        verify_tablestats(self,expect_active=0)
 
 
 class IdleTimeout(base_tests.SimpleDataPlane):
@@ -645,7 +645,7 @@
         self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
 
         #Verify flow gets inserted
-        Verify_TableStats(self,active_entries=1)
+        verify_tablestats(self,expect_active=1)
         
         # Verify flow removed message is recieved.
         (response, pkt) = self.controller.poll(exp_msg=ofp.OFPT_FLOW_REMOVED,
@@ -678,22 +678,22 @@
         logging.info("Expecting switch to ignore out_port")
 
         # Create and add flow-1,Action A ,output to port of_port[1], out_port set to of_ports[2]
-        (pkt,match) = Wildcard_All_Except_Ingress(self,of_ports)
+        (pkt,match) = wildcard_all_except_ingress(self,of_ports)
 
         # Verify flow is active
-        Verify_TableStats(self,active_entries=1)
+        verify_tablestats(self,expect_active=1)
         
         # Send Packet matching the flow
-        SendPacket(self,pkt,of_ports[0],of_ports[1])
+        send_packet(self,pkt,of_ports[0],of_ports[1])
         
         # Insert Flow-Modify matching flow F-1 ,action A', output to port[2], out_port set to port[3]
-        Modify_Flow_Action(self,of_ports,match)
+        modify_flow_action(self,of_ports,match)
 
         # Again verify active_entries in table_stats_request =1 
-        Verify_TableStats(self,active_entries=1)
+        verify_tablestats(self,expect_active=1)
 
         #Verify action is modified
-        SendPacket(self,pkt,of_ports[0],of_ports[2])
+        send_packet(self,pkt,of_ports[0],of_ports[2])
 
 
 
@@ -729,7 +729,7 @@
         self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
 
         #Verify flow gets inserted
-        Verify_TableStats(self,active_entries=1)
+        verify_tablestats(self,expect_active=1)
 
         # Verify flow removed message is recieved.
         (response, pkt) = self.controller.poll(exp_msg=ofp.OFPT_FLOW_REMOVED,
@@ -793,7 +793,7 @@
                         'Recieved flow removed message ')
 
         # Verify no entries in the table
-        Verify_TableStats(self,active_entries=0)
+        verify_tablestats(self,expect_active=0)
 
 
 
diff --git a/tests/openflow_protocol_messages.py b/tests/openflow_protocol_messages.py
index 43ce062..80828c1 100644
--- a/tests/openflow_protocol_messages.py
+++ b/tests/openflow_protocol_messages.py
@@ -102,10 +102,10 @@
         logging.info("Expecting active_count=1 in table_stats_reply")
 
         #Insert a flow entry matching on ingress_port
-        (Pkt,match) = Wildcard_All_Except_Ingress(self,of_ports)
+        (pkt,match) = wildcard_all_except_ingress(self,of_ports)
 
         # Send Table_Stats_Request and verify flow gets inserted.
-        Verify_TableStats(self,active_entries=1)
+        verify_tablestats(self,expect_active=1)
 
 
 class ModifyStateDelete(base_tests.SimpleProtocol):
@@ -131,16 +131,16 @@
         logging.info("Expecting the active_count=0 in table_stats_reply")
 
         #Insert a flow matching on ingress_port 
-        (Pkt,match) = Wildcard_All_Except_Ingress(self,of_ports)
+        (pkt,match) = wildcard_all_except_ingress(self,of_ports)
 
         #Verify Flow inserted.
-        Verify_TableStats(self,active_entries=1)
+        verify_tablestats(self,expect_active=1)
 
         #Delete the flow 
-        NonStrict_Delete(self,match)
+        nonstrict_delete(self,match)
 
         # Send Table_Stats_Request and verify flow deleted.
-        Verify_TableStats(self,active_entries=0)
+        verify_tablestats(self,expect_active=0)
 
       
 
@@ -166,13 +166,13 @@
         logging.info("Expecting the Test Packet to implement the modified action")
 
         # Insert a flow matching on ingress_port with action A (output to of_port[1])    
-        (pkt,match) = Wildcard_All_Except_Ingress(self,of_ports)
+        (pkt,match) = wildcard_all_except_ingress(self,of_ports)
   
         # Modify the flow action (output to of_port[2])
-        Modify_Flow_Action(self,of_ports,match)
+        modify_flow_action(self,of_ports,match)
         
         # Send the Test Packet and verify action implemented is A' (output to of_port[2])
-        SendPacket(self,pkt,of_ports[0],of_ports[2])
+        send_packet(self,pkt,of_ports[0],of_ports[2])
                        
 
 class ReadState(base_tests.SimpleProtocol):
@@ -197,10 +197,10 @@
         logging.info("Expecting the a flow_stats_reply without errors")
 
         # Insert a flow with match on ingress_port
-        (pkt,match ) = Wildcard_All_Except_Ingress(self,of_ports)
+        (pkt,match ) = wildcard_all_except_ingress(self,of_ports)
         
         #Verify Flow_Stats request does not generate errors
-        Verify_FlowStats(self,match)
+        get_flowstats(self,match)
         
 class PacketOut(base_tests.SimpleDataPlane):
     
@@ -355,7 +355,7 @@
 
         #Send Barrier Request
         request = message.barrier_request()
-        (response, pkt) = self.controller.transact(request)
+        (response,pkt) = self.controller.transact(request)
         self.assertEqual(response.header.type, ofp.OFPT_BARRIER_REPLY,'response is not barrier_reply')
         self.assertEqual(request.header.xid, response.header.xid,
                          'response xid != request xid')
