Tuesday, October 7, 2014

Building Open Daylight SDN Controller from Source on Ubuntu 14.04

As of the early research efforts on xSDN, an (extensible/extended/extensive/..) Software-Defined Networking (SDN) solution, I have been revising the literature on SDN while building and testing the related core technologies. 

Open Daylight is an open source consortium of projects lead by the Linux Foundation. Recently, Linux Foundation also announced OPNFV, an open platform to accelerate NFV (Network Functions Virtualization). These technologies are open and are considered to have the potential to change the future of networking.

There is a list of projects under Open Daylight. You may check out some or all of these projects. To build the projects from the source code (trunk), first you should check out the code, and install the controller. Each of the components can then be installed following the respective README files inside the respective modules. 

The build was successful with Oracle jdk1.7.0_55 and Apache Maven 3.1.1, with the tests
$ mvn clean install



Challenges
The controller build failed, with tests for the java version, Oracle jdk1.8.0. The error logs are given below.

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 9.895s
[INFO] Finished at: Tue Oct 07 14:24:21 WEST 2014
[INFO] Final Memory: 136M/362M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.15:test (default-test) on project sal: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.15:test failed: The forked VM terminated without saying properly goodbye. VM crash or System.exit called ?
[ERROR] Command was/bin/sh -c cd /home/pradeeban/OpenDayLight/controller/opendaylight/sal/api && /home/pradeeban/programs/jdk1.8.0/jre/bin/java -Xmx1024m -XX:MaxPermSize=256m -javaagent:/home/pradeeban/.m2/repository/org/jacoco/org.jacoco.agent/0.6.2.201302030002/org.jacoco.agent-0.6.2.201302030002-runtime.jar=destfile=/home/pradeeban/OpenDayLight/controller/opendaylight/sal/api/target/code-coverage/jacoco.exec -jar /home/pradeeban/OpenDayLight/controller/opendaylight/sal/api/target/surefire/surefirebooter4105410834640395132.jar /home/pradeeban/OpenDayLight/controller/opendaylight/sal/api/target/surefire/surefire2666028028053803617tmp /home/pradeeban/OpenDayLight/controller/opendaylight/sal/api/target/surefire/surefire_02245232938517059667tmp
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn -rf :sal


Also, the code still failed even after skipping the tests (
mvn clean install -DskipTests). The error logs are given below.
 

[ERROR] Failed to execute goal org.codehaus.enunciate:maven-enunciate-plugin:1.28:docs (default) on project connectionmanager.northbound: Execution default of goal org.codehaus.enunciate:maven-enunciate-plugin:1.28:docs failed: A required class was missing while executing org.codehaus.enunciate:maven-enunciate-plugin:1.28:docs: com/sun/mirror/apt/AnnotationProcessorFactory
[ERROR] -----------------------------------------------------
[ERROR] realm =    plugin>org.codehaus.enunciate:maven-enunciate-plugin:1.28
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/home/pradeeban/.m2/repository/org/codehaus/enunciate/maven-enunciate-plugin/1.28/maven-enunciate-plugin-1.28.jar
[ERROR] urls[1] = file:/home/pradeeban/OpenDayLight/controller/opendaylight/sal/api/target/sal-0.9.0-SNAPSHOT.jar
[ERROR] urls[2] = file:/home/pradeeban/.m2/repository/org/apache/commons/commons-lang3/3.1/commons-lang3-3.1.jar
[ERROR] urls[3] = file:/home/pradeeban/.m2/repository/org/apache/felix/org.apache.felix.dependencymanager/3.1.0/org.apache.felix.dependencymanager-3.1.0.jar
[ERROR] urls[4] = file:/home/pradeeban/.m2/repository/org/osgi/org.osgi.compendium/4.2.0/org.osgi.compendium-4.2.0.jar
[ERROR] urls[5] = file:/home/pradeeban/.m2/repository/org/osgi/org.osgi.core/5.0.0/org.osgi.core-5.0.0.jar
[ERROR] urls[6] = file:/home/pradeeban/.m2/repository/org/slf4j/slf4j-api/1.7.2/slf4j-api-1.7.2.jar
[ERROR] urls[7] = file:/home/pradeeban/.m2/repository/org/codehaus/enunciate/enunciate-swagger/1.28/enunciate-swagger-1.28.jar
[ERROR] urls[8] = file:/home/pradeeban/.m2/repository/org/codehaus/jackson/jackson-mapper-asl/1.9.3/jackson-mapper-asl-1.9.3.jar
[ERROR] urls[9] = file:/home/pradeeban/.m2/repository/org/codehaus/jackson/jackson-core-asl/1.9.3/jackson-core-asl-1.9.3.jar
[ERROR] urls[10] = file:/home/pradeeban/OpenDayLight/controller/opendaylight/commons/logback_settings/target/commons.logback_settings-0.1.0-SNAPSHOT.jar
[ERROR] urls[11] = file:/home/pradeeban/.m2/repository/org/codehaus/enunciate/maven-enunciate-slim-plugin/1.28/maven-enunciate-slim-plugin-1.28.jar
[ERROR] urls[12] = file:/home/pradeeban/.m2/repository/org/apache/maven/plugins/maven-install-plugin/2.3.1/maven-install-plugin-2.3.1.jar
[ERROR] urls[13] = file:/home/pradeeban/.m2/repository/org/codehaus/plexus/plexus-digest/1.0/plexus-digest-1.0.jar
[ERROR] urls[14] = file:/home/pradeeban/.m2/repository/org/apache/maven/plugins/maven-deploy-plugin/2.7/maven-deploy-plugin-2.7.jar
[ERROR] urls[15] = file:/home/pradeeban/.m2/repository/org/apache/maven/enforcer/enforcer-api/1.0/enforcer-api-1.0.jar
[ERROR] urls[16] = file:/home/pradeeban/.m2/repository/junit/junit/3.8.1/junit-3.8.1.jar
[ERROR] urls[17] = file:/home/pradeeban/.m2/repository/org/apache/maven/shared/maven-filtering/1.0/maven-filtering-1.0.jar
[ERROR] urls[18] = file:/home/pradeeban/.m2/repository/org/apache/maven/reporting/maven-reporting-api/2.0.6/maven-reporting-api-2.0.6.jar
[ERROR] urls[19] = file:/home/pradeeban/.m2/repository/org/apache/maven/doxia/doxia-sink-api/1.0-alpha-7/doxia-sink-api-1.0-alpha-7.jar
[ERROR] urls[20] = file:/home/pradeeban/.m2/repository/commons-cli/commons-cli/1.0/commons-cli-1.0.jar
[ERROR] urls[21] = file:/home/pradeeban/.m2/repository/org/codehaus/plexus/plexus-interactivity-api/1.0-alpha-4/plexus-interactivity-api-1.0-alpha-4.jar
[ERROR] urls[22] = file:/home/pradeeban/.m2/repository/org/codehaus/plexus/plexus-interpolation/1.12/plexus-interpolation-1.12.jar
[ERROR] urls[23] = file:/home/pradeeban/.m2/repository/org/sonatype/plexus/plexus-build-api/0.0.4/plexus-build-api-0.0.4.jar
[ERROR] urls[24] = file:/home/pradeeban/.m2/repository/org/codehaus/plexus/plexus-utils/3.0/plexus-utils-3.0.jar
[ERROR] urls[25] = file:/home/pradeeban/.m2/repository/org/codehaus/enunciate/enunciate-core/1.28/enunciate-core-1.28.jar
[ERROR] urls[26] = file:/home/pradeeban/.m2/repository/org/codehaus/enunciate/enunciate-core-rt/1.28/enunciate-core-rt-1.28.jar
[ERROR] urls[27] = file:/home/pradeeban/.m2/repository/org/codehaus/enunciate/enunciate-core-annotations/1.28/enunciate-core-annotations-1.28.jar
[ERROR] urls[28] = file:/home/pradeeban/.m2/repository/javax/annotation/jsr250-api/1.0/jsr250-api-1.0.jar
[ERROR] urls[29] = file:/home/pradeeban/.m2/repository/javax/ws/rs/jsr311-api/1.1.1/jsr311-api-1.1.1.jar
[ERROR] urls[30] = file:/home/pradeeban/.m2/repository/javax/servlet/servlet-api/2.3/servlet-api-2.3.jar
[ERROR] urls[31] = file:/home/pradeeban/.m2/repository/org/freemarker/freemarker/2.3.19/freemarker-2.3.19.jar
[ERROR] urls[32] = file:/home/pradeeban/.m2/repository/net/sf/apt-jelly/apt-jelly-freemarker/2.15/apt-jelly-freemarker-2.15.jar
[ERROR] urls[33] = file:/home/pradeeban/.m2/repository/net/sf/apt-jelly/apt-jelly-core/2.15/apt-jelly-core-2.15.jar
[ERROR] urls[34] = file:/home/pradeeban/.m2/repository/commons-digester/commons-digester/2.1/commons-digester-2.1.jar
[ERROR] urls[35] = file:/home/pradeeban/.m2/repository/commons-beanutils/commons-beanutils/1.8.3/commons-beanutils-1.8.3.jar
[ERROR] urls[36] = file:/home/pradeeban/.m2/repository/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar
[ERROR] urls[37] = file:/home/pradeeban/programs/jdk1.8.0/jre/../lib/tools.jar
[ERROR] urls[38] = file:/home/pradeeban/.m2/repository/org/codehaus/enunciate/enunciate-top/1.28/enunciate-top-1.28.jar
[ERROR] urls[39] = file:/home/pradeeban/.m2/repository/org/codehaus/enunciate/enunciate-jaxws-support/1.28/enunciate-jaxws-support-1.28.jar
[ERROR] urls[40] = file:/home/pradeeban/.m2/repository/org/codehaus/enunciate/enunciate-jaxws-ri/1.28/enunciate-jaxws-ri-1.28.jar
[ERROR] urls[41] = file:/home/pradeeban/.m2/repository/org/codehaus/enunciate/enunciate-docs/1.28/enunciate-docs-1.28.jar
[ERROR] urls[42] = file:/home/pradeeban/.m2/repository/org/jdom/jdom/1.1.2/jdom-1.1.2.jar
[ERROR] urls[43] = file:/home/pradeeban/.m2/repository/org/codehaus/enunciate/enunciate-jersey/1.28/enunciate-jersey-1.28.jar
[ERROR] urls[44] = file:/home/pradeeban/.m2/repository/org/codehaus/enunciate/enunciate-jersey-rt/1.28/enunciate-jersey-rt-1.28.jar
[ERROR] urls[45] = file:/home/pradeeban/.m2/repository/org/codehaus/jackson/jackson-jaxrs/1.9.3/jackson-jaxrs-1.9.3.jar
[ERROR] urls[46] = file:/home/pradeeban/.m2/repository/org/codehaus/jackson/jackson-xc/1.9.3/jackson-xc-1.9.3.jar
[ERROR] urls[47] = file:/home/pradeeban/.m2/repository/com/sun/jersey/jersey-server/1.11/jersey-server-1.11.jar
[ERROR] urls[48] = file:/home/pradeeban/.m2/repository/asm/asm/3.1/asm-3.1.jar
[ERROR] urls[49] = file:/home/pradeeban/.m2/repository/com/sun/jersey/jersey-core/1.11/jersey-core-1.11.jar
[ERROR] urls[50] = file:/home/pradeeban/.m2/repository/com/sun/jersey/jersey-servlet/1.11/jersey-servlet-1.11.jar
[ERROR] urls[51] = file:/home/pradeeban/.m2/repository/javax/mail/mail/1.4.4/mail-1.4.4.jar
[ERROR] urls[52] = file:/home/pradeeban/.m2/repository/javax/activation/activation/1.1/activation-1.1.jar
[ERROR] urls[53] = file:/home/pradeeban/.m2/repository/com/sun/xml/bind/jaxb-impl/2.2.3/jaxb-impl-2.2.3.jar
[ERROR] urls[54] = file:/home/pradeeban/.m2/repository/org/codehaus/enunciate/enunciate-xml/1.28/enunciate-xml-1.28.jar
[ERROR] urls[55] = file:/home/pradeeban/.m2/repository/org/codehaus/enunciate/enunciate-java-client/1.28/enunciate-java-client-1.28.jar
[ERROR] urls[56] = file:/home/pradeeban/.m2/repository/org/codehaus/enunciate/enunciate-c/1.28/enunciate-c-1.28.jar
[ERROR] urls[57] = file:/home/pradeeban/.m2/repository/org/codehaus/enunciate/enunciate-obj-c/1.28/enunciate-obj-c-1.28.jar
[ERROR] urls[58] = file:/home/pradeeban/.m2/repository/org/codehaus/enunciate/enunciate-csharp/1.28/enunciate-csharp-1.28.jar
[ERROR] urls[59] = file:/home/pradeeban/.m2/repository/org/codehaus/enunciate/enunciate-ruby/1.28/enunciate-ruby-1.28.jar
[ERROR] urls[60] = file:/home/pradeeban/.m2/repository/org/codehaus/enunciate/enunciate-php/1.28/enunciate-php-1.28.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import  from realm ClassRealm[project>org.opendaylight.controller:forwarding.staticrouting:0.6.0-SNAPSHOT, parent: ClassRealm[maven.api, parent: null]]]
[ERROR]
[ERROR] -----------------------------------------------------: com.sun.mirror.apt.AnnotationProcessorFactory
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginContainerException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn
-rf :connectionmanager.northbound

I changed to version 1.7.x. The build started to progress further, and eventually it hanged due to the memory limitation. Ctrl + C produced the below error.

^C^CJava HotSpot(TM) 64-Bit Server VM warning: Exception java.lang.OutOfMemoryError occurred dispatching signal SIGINT to handler- the VM may need to be forcibly terminated
I had to kill the process manually, using kill -9 .

After increasing the memory allocation to maven, the build succeeded, even with the tests!
MAVEN_OPTS="-Xmx2048m -XX:MaxPermSize=1024m"

Monday, October 6, 2014

Recovering the mistakenly deleted images from your memory card..

Recently, I mistakenly deleted a bunch of photos from the memory card before copying them to my computer. But luckily, I just had to install TestDisk package and use its PhotoRec utility, a tool to recover deleted files using an Ubuntu/Linux Computer.

Install TestDisk
$ sudo apt-get install testdisk

Recover deleted images from the mounted memory
$ sudo photorec /dev/mmcblk0p1
Detailed instructions on this can be found here. Interestingly, it also retrieved images that were long deleted.

Wednesday, October 1, 2014

Building Cbench on Ubuntu - 14.04 LTS

Cbench (Controller Benchmark) is a handy tool for benchmarking OpenFlow controllers. It can be installed from source using the below commands on Ubuntu 14.04.

* Installing the dependencines 
$ sudo apt-get install autoconf automake libtool libsnmp-dev libpcap-dev libconfig8-dev
 
* Checking-out the source code of OpenFlow 
$ git clone git://gitosis.stanford.edu/openflow.git
 
* Switch to released version 1.0.0 
$ cd openflow; git checkout -b mybranch origin/release/1.0.0 
 
* Checking-out the source code of Oflops 
Oflops is a package that contains the OpenFlow debugging tools, Cbench and OFlops (OpenFLow Operations Per Second).
$ git clone git://gitosis.stanford.edu/oflops.git
 

* Build the source code
$ cd oflops ; sh ./boot.sh ; ./configure --with-openflow-src-dir=; make 
 
In my case,
cd oflops ; sh ./boot.sh ; ./configure --with-openflow-src-dir=/home/pradeeban/openflow; make 
 
$ cd oflops ; sudo make install 
 
This will have installed Cbench inside the folder, /home/pradeeban/openflow/oflops/cbench.
 
* Execute Cbench  
Change to Cbench directory 
$ cd cbench/
 
Sample Execution 
$ cbench -c localhost -p 6633 -m 10000 -l 10 -s 16 -M 1000 -t
cbench: controller benchmarking tool
   running in mode 'throughput'
   connecting to controller at localhost:6633 
   faking 16 switches offset 1 :: 10 tests each; 10000 ms per test
   with 1000 unique source MACs per switch
   learning destination mac addresses before the test
   starting test with 0 ms delay after features_reply
   ignoring first 1 "warmup" and last 0 "cooldown" loops
   connection delay of 0ms per 1 switch(es)
   debugging info is off
controller msgbuf_read() = 0:   closed connection ... exiting 
 
Note: Failing to install libconfig8-dev in the first step will produce the below error logs.
 
make[2]: Entering directory `/home/pradeeban/openflow/oflops'
gcc -DHAVE_CONFIG_H -I.     -g -O2 -Wall -I/home/pradeeban/openflow/include -Wshadow `pkg-config --cflags libconfig` -MT oflops.o -MD -MP -MF .deps/oflops.Tpo -c -o oflops.o oflops.c
Package libconfig was not found in the pkg-config search path.
Perhaps you should add the directory containing `libconfig.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libconfig' found
In file included from oflops.c:11:0:
usage.h:4:23: fatal error: libconfig.h: No such file or directory
 #include
                       ^

Sunday, September 28, 2014

Fonte da Talha - Portugal's finest beaches

A big jellyfish found in Fonte da Talha
I decided to go to Fonte da Talha beach, yesterday, despite the fact that the weather forecast showed it had 50% probability of a rain. :D I took a bus (TST - 161) from Praça do Areeiro, Lisboa to Costa da Caparica (4.10 Euro. Comes once in 30 minutes). My plan was to take the beach train (Comboio da Praia) - more of a toy train, which I read somewhere in the Internet, that it operates in the weekends from 9 am - 7 pm (return trip, which costs 7.50 Euro). It had rained in the morning - the roads were wet, and it was still drizzling. When I got down from the bus, I asked the bus driver, "Could you please tell me, how to get the Comboio da Praia?" I repeated, "Comboio da Praia" Usually the people here are very very helpful. Just some of them do not speak good English. So, if you repeat the Portuguese phrases or destination clearly in Portuguese, you will surely get the help. But the bus driver spoke a very good English. "The train stopped on the 29th of August." He smiled, and continued, "Sorry, next year." :P The train seems to be seasonal.

He suggested me to get a bus towards Fonte da Talha (TST - 130). While I was walking around to locate the bus stop, a 130 just passed by. So I missed one 130 - I waited for the next one. For around 30 minutes. Probably more than that. These buses are not frequent. Probably once in an hour, or once in two hours. Who knows? :P

I am not going to give up. I decided to try a taxi. Taxis were not frequent either, and all of them seem to come occupied. After some wait, I was able to get a taxi. I explained him I am going to the praia towards Fonte da Talha. He understood I am going to a beach, and he said, he cannot take me to the beach. But he can drop me closer in the main road. I said, "sure". :D

It costs me 5 Euros. Then I walked a long distance passing beach parties including a kids party hosted by different beach bars on the way, and sooner, I was on the beach. :D The area was quite active actually. I enjoyed the sun and the waves. Waves were pretty huge - probably because of the weather. The water was warm and comfortable though. After a few hours, I walked further south by the beach, as it started to drizzle with a strong (very very strong) wind, sky covered by black clouds. I finally reached the fishing village, Fonte da Talha. The village is kind of on top of the near by mountain. :D I attempted to climb it in search of the bus that would take me back to Costa da Caparica. The shower was getting stronger, and I gave up the idea to find the bus back.

Kite surfing in a windy day..
I returned to the previous bus stop near to the beach, where I found a TST bus (#127) that goes to Cacilhas. I remember last year I took a boat from Cais do Sodre to Cacilhas, and then a bus from Cacilhas to Costa da Caparica. :D I am going to do the same. To Cacilhas, and then a boat to Cais do Sodre. It cost me 4.10 again to go to Cacilhas. After a somewhat long bus ride, I was in Cacilhas. I still remembered the place very well, that I did not have to ask for directions anymore. The boat to Cais do Sodre comes once in 20 minutes, for 1.20 Euro. I finally reached Lisboa safely. :D

So I realized, to use the public transport to Fonte da Talha from Lisboa - the best option is to go to Cacilhas by boat from Cais do Sodre and to Fonte da Talha by bus from Cacilhas. The total transportation expense for my trip was, 14.40 Euro (4.10 Euro for Lis/Areeiro -> Costa da Caparica, 5 Euro for Taxi towards a nowhere zone, 4.10 Euro for Fonte da Talha -> Cacilhas, and 1.20 Euro for Cacilhas -> Lis/Cais do Sodre).

An update from the 5th of October: I went again to Fonte da Talha to explore the land side and the cliff. This time from Cais do Sodre -> Cacilhas by boat, and Cacilhas -> Fonte da Talha by bus TST 145. Total cost for the trip was (1.20 for boat one way + 3.20 for 3-zone TST bus, one way) * 2 -> 8.80 Euro. Had a long walk, enjoying the nice view, and so many kite surfers.

This may probably be my last beach trip for this summer. But time goes very fast. Within a very short time we will have our next summer. Hopefully. :)

Saturday, September 27, 2014

The Summer!

Caxias - view from the small fort in the park!
Though I have been in Portugal for more than two years, it is only this summer I got the opportunity (and interest) to enjoy some not-so-popular-among-Erasmus-students beaches. Earlier, I had already visited Cascais, Costa da Caparica, Troia, Lagos Meia Praia, Porto Matosinhos, and Estoril beaches. This summer, I visited Ilhas Desertas, Caxias (a small beach on the way to Cascais/Estoril from Lisbon. Very close to Lisbon by train towards Oeiras or Cascais), and Porto Covo in the Alentejo region (using Rede Expressos bus from Lisboa).

A trip to Santo André (Santiago do Cacém) and Porto Covo was not well prepared. But came out pretty well. During this trip, I realized that the bus tickets are not always sold from a separate office. I had to buy the ticket from a cafe in Santo Andre, and from a mini post office in Porto Covo. Porto Covo was stunning! Unfortunately I forgot to take my camera to this trip. So no photos. :(

The summer is almost finishing, and I had lost more than a month of summer in Portugal due to my thesis defence, and trips to Shenzhen, from 22nd Aug - 6th Sep (more on this later, probably), and Paris, from 8th Sep - 12th Sep. When I am done with my master thesis defence, it is almost autumn! But I am not giving up you summer, yet!