Wednesday, October 8, 2014

OpenDaylight Helium Release on Raspberry Pi!

The question we've all been asking has finally been answered - yes, OpenDaylight Helium Release can run on Raspberry Pi!

If you're not familiar with Raspberry Pi it's a small, inexpensive computer which at its heart runs a 700 MHz Low Power ARM1176JZ-F Applications ProcessorCPU with 512MB ram.

My build utilizes a Debian based Linux distro, Raspbian, and an Arm compatible Oracle JDK build.

Out of the box I had to make three small modifications to the scripts found in the OpenDaylight distributions' bin folder.

  • The set environment script (setenv) had JVM parameters for PermGen and Max Memory set higher than the RPi could support. I set these values to 340MB for PermGen, and 400MB for Max Memory. These are not optimal settings, but will work well enough to get things going.
  • The karaf script used to start the container also required a memory setting to be adjusted from 512m down to 340m (just grep the script code for 512 and replace). 
  • Finally, in the karaf script the JVM "server" flag was not recognized by the Java installation on my RPi. Editing this out of the script allowed Karaf to start up happily.

w00t!
Once I had the OpenDaylight console banner displayed, I executed the console info command to see system environment information:
Now we're cooking with fire! Time to start making some toast...

Awesome! The Apache Karaf container environment OpenDaylight Helium uses appears to be stable. Next step was to try to deploy the OpenDaylight Toaster demo... which failed on not being able to find SSHD 0.12.0 :(

This turned out to be a minor inconvenience. A simple invocation of install -s mvn:org.apache.sshd/apache-sshd/0.12.0, and an edit to ODL_HOME/etc/config.properties to include a JDK 1.8 entry for osgi.ee and the ODL Toaster was installable, and running!
Helium on RPi can make toast!
I used jconsole to manipulate the makeToast and clearToastsMade operations exposed via JMX on the controller to verify their correct operation - using log:display I could view each operation's logging events.

RPi CPU Stats
This is an very impressive improvement over the previous OpenDaylight release which, despite my best efforts, I could not get to boot on RPi to a stable console out of the box. It's amazing how well OpenDaylight has taken to scaling from small PCs like the RPi to serious big iron servers we find in datacenters.

Its important to note that for my ODL on RPi test I've only installed the base ODL Helium distribution, SSHD 0.12.0, and performed a feature install on odl-toaster target. The Karaf based features mechanism took care of downloading, installing, and configuring all the plumbing required to get the demo running.

So, now that we know we can get OpenDaylight Helium running on an RPi, what should we program it to do? I'm looking forward to reading your ideas in the comments below :)

7 comments:

Unknown said...

Would be interesting to see two RPis each controlling a small network (mininet) and then have another system (doesn't need to be on RPi) query topology from the RPis and display a complete topology.

Then, of course, be able to create flows to the network through the RPi controllers, would be very cool to create a flow across the controller domains.

Unknown said...

This is amazing... but i have one query, how you connect another system or computer on raspberry pi, Rather we have only one LAN port on raspberry pi????

icbts said...

Having one NIC port is a limitation. I never expected RPi to be a fast host, just wanted to see if its even possible on such limited hardware.

Hans said...

What version of JDK did you install?

Hans said...

After booting into console banner screen, any command (including info) just throws a java null pointer exception. Did you do any special JDK install?

icbts said...

I used an Early Access version of JDK7 at the time.

Unknown said...

Hi,
what exactly do you mean by Oracle JDK ? Can you give a pointer to that ? I am also getting java null pointer exception after a few lines of output, but the bigger problem is that java seems to become a memory hog and hang the system in a few minutes. I am running jdk7, I believe.
thanks
--Raj