Ask Your Question

How to use services of Openflow plugins like IController ?

asked 2014-07-10 21:58:43 -0700

swarvanusg gravatar image

updated 2014-07-10 22:30:13 -0700

I am using the OpenDaylight Base Edition 1.0,

I am facing a problem related to openflow. I am trying to write an application in opendaylight using openflow plugins in AD-SAL. As per my requirement and understanding, I need the IController service. I have put protocolplugins.openflow version 0.4.1 in dependency and in plugins I have imported package ‘org.opendaylight.controller.protocolplugin.openflow.core’ for IController interface definition. I also have registered the dependent IController service in Activator.

When I trying to run my bundle, in OSGI the ‘org.opendaylight.controller.protocol_plugin.openflow.core’ package is not getting resolved. From what I could understand, is not being exported by any other bundle. I tried using ‘org.sdnhub.odl.openflow10’ as a replacement from [], but I am getting error in addMessageListner() signature in IController.

Q1) I am on the right understanding that ‘org.opendaylight.controller.protocol_plugin.openflow.core’ is not exposed by any bundle in the base edition?

Q2) Should I use org.sdnhub.odl.openflow10 as a openflow plugin.

Q3) I've used the addMessageListner() as:

controller.addMessageListener(OFType.GET_CONFIG_REPLY, configHandler);

where configHandler type is IMessageListener

and used org.opendaylight.controller.protocol_plugin.openflow.core.IController

and In org.sdnhub.odl.openflow10 addMessageListner() is defined as:

public void addMessageListener(OFType type, IMessageListener listener) {
        IMessageListener currentListener = this.messageListeners.get(type);
        if (currentListener != null) {
            logger.warn("{} is already listened by {}", type,
        this.messageListeners.put(type, listener);
        logger.debug("{} is now listened by {}", type, listener);
edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted

answered 2014-07-26 06:31:14 -0700

Madhu gravatar image

In OSGi, every import-package must have a corresponding matching export-package from a bundle that wishes to export a service. In this case, you are trying to have your dependency directly on org.opendaylight.controller.protocolplugin.openflow.core and hence importing this package with the hope to use the IController service.

But, the protocolplugin.openflow bundle doesn't "export" this service via its "export-package". This is because, according the OpenDaylight design, all the south-bound plugins are supposed to be exposed only through the SAL layer. And hence, an application should ideally not be directly dependent on the southbound plugin. Rather, you must look for a SAL service that will satisfy your needs.

If you still want your application to talk only with Openflow plugin (in this case to parse an OpenFlow message directly), then you have other options such as writing your bundle as an OSGi fragment. But that gets into an use-case specific mode and we would need more info to get you to the right place.

In any case, the general rule of thumb is to not depend directly on the south-bound plugin as much as possible and always look for a corresponding "export-package" to make sure the dependent services are being exported.

edit flag offensive delete publish link more


Hi madhu, Thanks a lot for the explanation. We got the concepts now. Could you please help us on the Below Problem, it will be very helpful :

swarvanusg ( 2014-08-27 08:56:34 -0700 )edit

Sure. Glad to help. I replied to your other question. BTW, if an answer helps solve your question, then please accept it so that others in the community can make effective use of

Madhu ( 2014-08-28 11:56:09 -0700 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

[hide preview]


Asked: 2014-07-10 21:58:43 -0700

Seen: 241 times

Last updated: Jul 26 '14