Hi Mr Zarifis! Thank you very much for your detailed and very useful instructions. I can follow your first option and get the information of link down to my NOX controller.
I have another server which does the calculation for NOX, and I want to write a program for NOX to inform that server each time NOX receive the message of link down. As I understand, I have to write a socket to connect from NOX to my server from the beginning and after that use socket to send the signal to server. But my problem is I don't know how and where to write the socket in NOX controller for it to connect to my server. It's very nice if you give me some precious instructions about that. Thank you very much Trinh Minh Tri On Tue, Mar 27, 2012 at 5:34 PM, Kyriakos Zarifis <[email protected]>wrote: > Do you have any NOX code that handle the message OFPPR_MODIFY. >> > > The message is "ofp_port_status" and "OFPPR_MODIFY" is a possible value of > the member "uint8_t reason" of that message. This is described in the > section of the OF spec that I linked to you. > So the message ofp_port_status is a standard openflow message. All those > are defined in lib/pyopenflow.py for python, and your component can > register for them using functions defined in lib/core.py. > > So, specifically for this message, the handler is called > "register_for_port_status" and you can just use that to register for it and > link it to your custom handler, after you import core. > For an example, you can look at lines 72 (registration) and 387 > (handling) of netapps/spanning_tree/spanning_tree.py > > Or openflow switch code that handle link_event. >> > > The link_event is raised by the NOX component "discovery" and can be > handled by other NOX components. The event doesn't have to do anything with > the switches and the switches aren't aware of it. They don't raise it nor > can they do anything about it. > > A nox component can handle the event following the standard process just > like any component handles any event: by first importing/including it, then > registering it and then defining a handler for it. > For C++, you can see a specific example of handling the link_event > in netapps/topology/topology.cc > For python, you can see a specific example > in /netapps/tests/pyunittests/routing_test.py > (look for "link_event") > > >> >> So I can follow it to implement in my system. >> >> Best regard! >> Trinh Minh Tri >> >> On Tue, Mar 27, 2012 at 4:01 PM, Kyriakos Zarifis >> <[email protected]>wrote: >> >>> If a link/port is administratively down, the should should send a Port >>> Status change message with reason OFPPR_MODIFY (5.4.3 in the >>> specification<http://www.openflow.org/documents/openflow-spec-v1.0.0.pdf> >>> ) >>> These message will not necessarily always be sent when a link is >>> unavailable. >>> >>> While I don't think there is a standard way to specify if a link is >>> functioning with a 100% guarantee, another technique one could use is some >>> discovery process. For example, the component 'discovery' periodically >>> sends LLDP message between neighboring switch to verify connectivity, and >>> if one/some of them don't make it across, the component will raise a >>> link_event declaring that it thinks it's down (Keep in mind that this is >>> not openflow specific but rather it is a controller functionality) >>> >>> >>> On Tue, Mar 27, 2012 at 11:38 AM, Trinh Minh Tri <[email protected]>wrote: >>> >>>> Dear NOX dev! >>>> >>>> I would like to ask when there is a link down in openflow switch, what >>>> kind of openflow message that openflow switch will send to NOX? >>>> And do you have any code that NOX handle this kind of message? >>>> >>>> Thank you >>>> Trinh Minh Tri >>>> >>>> >>> >> >
