Hi,
How can I get a notification that a flow has been deleted? i am using the 
attached code for realizing when a specific flow entry was deleted and then 
measuring the flow setup time, but there is no EventOFPFlowRemoved event 
that i can catch it. why? would you please help me to fix it?
this is the code:

def _measure_flow_setup_time(self):
        while True:
            for dp in self.datapaths.values():
                if dp.id == 1:
                    ofp = dp.ofproto
                    ofp_parser = dp.ofproto_parser
                    
                    match = ofp_parser.OFPMatch(ipv4_src='10.10.10.100')
                    actions = [ofp_parser.OFPActionOutput(ofp.OFPP_NORMAL, 
0)]
                    inst = 
[ofp_parser.OFPInstructionActions(ofp.OFPIT_APPLY_ACTIONS, actions)]
                    req_add = ofp_parser.OFPFlowMod(dp, 
command=ofp.OFPFC_ADD, idle_timeout=0, hard_timeout=0, 
flags=ofp.OFPFF_SEND_FLOW_REM,
                                                priority=0, out_port=2, 
out_group=1, match=match, instructions=inst)
                    
                    dp.send_msg(req_add)
                    hub.sleep(1)
                    
               
                
                    req_del = ofp_parser.OFPFlowMod(dp, 
command=ofp.OFPFC_DELETE_STRICT, idle_timeout=0, hard_timeout=0, 
flags=ofp.OFPFF_SEND_FLOW_REM,
                                                priority=0, out_port=2, 
out_group=1, match=match, instructions=inst)
                                
                
                    dp.send_msg(req_del)
                    self.flow_del_send_time = time.time()
                    self.k += 1
                    hub.sleep(1)




    @set_ev_cls(ofp_event.EventOFPFlowRemoved, MAIN_DISPATCHER)
    def flow_removed_handler(self, ev):
        print "flow_removed_handler"
        msg = ev.msg
        dp = msg.datapath
        ofp = dp.ofproto

            
        if dp.id == 1:
            if msg.reason == ofp.OFPRR_IDLE_TIMEOUT:
                reason = 'IDLE TIMEOUT'
            elif msg.reason == ofp.OFPRR_HARD_TIMEOUT:
                reason = 'HARD TIMEOUT'
            elif msg.reason == ofp.OFPRR_DELETE:
                reason = 'DELETE'
                self.flow_removed_receive_time = time.time()
                
self.f4.write(str(self.k)+'\t'+str(((self.flow_removed_receive_time - 
self.flow_del_send_time) + self.execution_time)*1000)+'\n')

            elif msg.reason == ofp.OFPRR_GROUP_DELETE:
                reason = 'GROUP DELETE'
            else:
                reason = 'unknown'

            print reason


Thank you,
...................................................
 mehran shetabi
 PhD student
 Computer Engineering Department
 IUST
------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to