OK, got it
Thank you

Zhao Jun

From: [email protected]
To: [email protected]
CC: [email protected]
Subject: Re: [Ryu-devel] [maybe a bug] dpset : multiple connections
Date: Sat, 16 Jan 2016 04:10:13 +0000






On Jan 15, 2016, at 10:24 PM, 俊 赵 <[email protected]> wrote:





from ryu.base import app_manager

from ryu.controller import ofp_event

from ryu.controller.handler import CONFIG_DISPATCHER, MAIN_DISPATCHER

from ryu.controller.handler import set_ev_cls

from ryu.controller.dpset import EventDPReconnected





@set_ev_cls(EventDPReconnected) def _switch_reconnected_handler(self, ev): 
print ev







So...you’re missing an argument to the set_ev_cls decorator.
My code to use that event looks like this:



    @set_ev_cls(dpset.EventDPReconnected, dpset.DPSET_EV_DISPATCHER)

    def datapath_change_handler(self, ev):

        PlexusController.router_datapath_change_handler(ev.dp)




The second thing you should keep in mind:
That event is intended for a very specific case - one in which a given datapath 
has disconnected, but, for whatever reason, Ryu has not noticed it yet.



Due to the nature of this event, an application may want to handle this case 
specially.
The switch may have flows programmed into it that the application author wants 
to leave undisturbed; these flows could be inspected in a handler that issues a 
FlowStatsRequest.
Similarly, the author may take a cautious approach, and just clear all flows 
from the switch before re-programming them all.



Regardless - a switch re-connecting is a distinct event from a switch that has 
newly connected - meaning that Ryu has no internal state representing it.



I have not yet begun trying to port my application to using ryu.topology - so I 
cannot really help you there; sorry.



Hope that helps,
Victor



--
Victor J. Orlikowski <> vjo@[cs.]duke.edu




                                          
------------------------------------------------------------------------------
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=267308311&iu=/4140
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to