Interfacing Trema with other application

25 views
Skip to first unread message

Bao Tri Nguyen

unread,
May 20, 2014, 11:00:23 PM5/20/14
to trem...@googlegroups.com
Hi developers and community!

I'm new to OpenFlow and Trema. I've been going through the tutorials and managed to write a simple controller in Ruby with some working functions.
Currently, I'm using virtual machines with OpenvSwitch to model the actual network.

May I know if there is a way for other application to communicate with Trema?
In my case, I need to let my web server/ application to inform Trema controller to set new flows.

Thank you for reading this.

Best regards,
Nguyen Bao Tri

nickkaranatsios

unread,
May 22, 2014, 9:04:22 AM5/22/14
to trem...@googlegroups.com
Hello Nguyen

One way for you to do could be for example set a periodic timer in your ruby controller and poll for changes from your web-server and perform your desired action.
You could for example use sockets to communicate with your web server or use any distributed K/V store, redis could be one.

Regards

Nick Karanatsios

PS. The trema c library provides the ability to set an external callback that would be called from inside the event loop but unfortunately this feature has not been implemented in ruby controller.

Bao Tri Nguyen

unread,
May 22, 2014, 12:13:02 PM5/22/14
to trem...@googlegroups.com
Hi Nick (I assume)

Thank you for your reply! I did a quick search and think redis will be my solution. However, I'm curious about using socket too.
I hope it will not be too greedy if I come back with more specific technical questions on the actual implementation.

Have a nice day!

Bao Tri Nguyen

unread,
May 26, 2014, 2:06:25 AM5/26/14
to trem...@googlegroups.com
Hi everyone!

As Nick suggested, I've been implementing Redis and initial testing shows that it works! :D

My web server is using LAMP with Predis library, running concurrently with a Redis server.
On the controller side, redis-rb will do the trick.
Both of these elements can now communicate with each other through write/read to Redis server.
Thanks Nick!

Cheers,
Nguyen Bao Tri
Reply all
Reply to author
Forward
0 new messages