fp7-netide / Engine

App Engine to enable Network App programs to be executed, systematically tested, and refined on a variety of concrete SDN platforms
Eclipse Public License 1.0
10 stars 11 forks source link

Add support for ModuleAnnouncement in Backends #30

Open TimVinkemeier opened 9 years ago

TimVinkemeier commented 9 years ago

Add support for the new NetIP message types ModuleAnnouncement and ModuleAcknowledge to the existing backends (e.g. Ryu).

TimVinkemeier commented 9 years ago

This is how it works:

doriguzzi commented 9 years ago
The backend sends a ModuleAnnouncement message containing the name of the module (as defined in the CompositionSpecification) to the core

Any example?

TimVinkemeier commented 9 years ago

Register a firewall module called "fw" in the composition specification ([Header][Body]): Backend to core: [NetIDE Header with moduleId=<any value>, type=ModuleAnnouncement]["fw"] Core to Backend: [NetIDE Header with moduleId=<generated ID>, type=ModuleAcknowledge]["fw"]

doriguzzi commented 9 years ago

Do you have already defined an initial "dictionary" for the applications? E.g. fw=firewall, ls= learning switch etc.? If yes, where is it defined? Is there any configuration file in your sources?

TimVinkemeier commented 9 years ago

No, as I said, it is the name from the composition specification. "fw" was just an example of how a user might have named a firewall application. There is no dictionary, since that is user-defined.

doriguzzi commented 9 years ago

Ok, let me reformulate the question: is there already any available sample specification that I can use as an example and that people can use to test the Backend+Core+Shim? Since we want to provide the firewall and the learning switch as applications that can be used to test our framework, can we produce a sample specification with at least these two applications?

TimVinkemeier commented 9 years ago

Yes, available here: https://github.com/fp7-netide/Engine/blob/CoreImplementation/core/specification/CompositionSpecification.xml

doriguzzi commented 9 years ago

Done for the Ryu backend. For now I will use the original app name that I can get from objects.

doriguzzi commented 9 years ago

@TimVinkemeier : when waiting for the ModuleAcknowledge we receive two messages, the first is empty and the second contains the actual Ack. This is the output @sergiotamu is obtaining in the Ryu backend: ack_message: ['', '\x02\x05\x00\x0c\x00\x00\x00\x00\x00\x00\x01i\x00\x00\x00\x00\x00\x00\x00\x00SimpleSwitch']

Is it done on purpose?

doriguzzi commented 9 years ago

This is the way I send the Ack from my simple Core: backend.send_multipart([identity,ack_message]) and this is what the backend receives: ['\x02\x05\x00\x0c\x00\n\\p\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00SimpleSwitch']

TimVinkemeier commented 9 years ago

@doriguzzi It seems to be a problem between different ZeroMQ implementations. I use JeroMQ (the pure-Java implementation) and when I send a multipart message, it has to look like <destinationID>,'',<message>. The empty string '' in between is necessary in JeroMQ to delimit the destination and the actual message. I guess your Python implementation does not require that, therefore you see the empty part...