2
votes

I am trying to set up Opendaylight controller. Actually my intention is to connect it with mininet vm and have communication with Internet. (with mininet embedded controller communication to internet is possible). To perform this, from what I have understood, I have to write an application for Opendaylight controller in order to handle incoming and outgoing flows. Just connecting mininet with ODL controller, seems not enough for communication of the testbed with the Internet. Correct me if I miss something but downloading the distribution in order to write an application for Opendaylight controller, is also not enough. A new project needs to be created, right?

I downloaded Carbon 0.6.2 (Carbon SR2) from the official website, and based on this and following the tutorials: https://wiki.opendaylight.org/view/GettingStarted:Development_Environment_Setup#Edit_your_.7E.2F.m2.2Fsettings.xml and https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL:Startup_Project_Archetype

I try to create my project. The user guide seem to be outdated. I use Snapshot-Type=opendaylight.snapshot and Archetype-Version=1.5.0-SNAPSHOT. Archetype versions have not been updated in the user guide and I am not sure whether I use the proper one.

So I use maven command in the following way:

mvn archetype:generate -DarchetypeGroupId=org.opendaylight.controller -DarchetypeArtifactId=opendaylight-startup-archetype -DarchetypeRepository=http://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/ -DarchetypeCatalog=remote -DarchetypeVersion=1.5.0-SNAPSHOT

(I used that archetype version based on the archetype-catalog.xml:

<groupId>org.opendaylight.controller</groupId>
<artifactId>opendaylight-startup-archetype</artifactId>
<version>1.5.0-SNAPSHOT</version>)

Then I create my project and execute:

mvn clean install -DskipTests -Dcheckstyle.skip=true

Project is created successfully (no errors), but when I start the controller from this project, it seems that l2-switch related features are not listed and as a result cannot be installed.

Is this implemented to work as such? I would expect that every feature listed in the main distribution would be available also in the projects created based on this specific distribution. This feature is needed for communication of ODL controller with mininet over Openflow protocol. I use java 1.8 and maven 3.5.2

Could anybody help me clarify this? Opendaylight seems so promising but it's a pity documentation is not straight forward with so many dependencies. Thanks in advance for your help!

3
are you still facing the issue or it is resolved?abhilash_goyal
yes still facing the same issues. I am in communication with Opendaylight dev community and will update here when I have more info.Jimaras

3 Answers

2
votes

Executive summary:

If you would like the ability to install the l2-switch feature, just add the l2-switch dependecy to Karaf's pom.xml before you build the project.

Detailed workflow:

  • Pre-requisites
    • Install Java SDK and MVN source
    • Configure M2_HOME, MAVEN_OPTS and JAVA_HOME env variables
  • Generate ODL Maven project
    • Delete your old maven repository
    • Copy settings.xml from odlparent into ~/.m2/settings.xml
    • Execute your Maven archetype generation command
  • Build and run ODL w/ the l2-switch feature
    • Edit karaf/pom.xml to include l2-switch
    • Build and install ODL
    • Install the l2-switch feature

Generate ODL Maven project

Delete your existing repository

[workdir]$ rm -rf ~/.m2/repository/

Copy settings.xml from odlparent into ~/.m2/settings.xml

[workdir]$ curl https://raw.githubusercontent.com/opendaylight/odlparent/master/settings.xml --create-dirs -o ~/.m2/settings.xml

Execute your Maven archetype generation command

[workdir]$ mvn archetype:generate -DarchetypeGroupId=org.opendaylight.controller -DarchetypeArtifactId=opendaylight-startup-archetype -DarchetypeRepository=http://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/ -DarchetypeCatalog=remote -DarchetypeVersion=1.5.0-SNAPSHOT
Define value for property 'groupId': org.opendaylight.example
Define value for property 'artifactId': example
Define value for property 'version' 0.1.0-SNAPSHOT: : 
Define value for property 'package' org.opendaylight.example: : 
Define value for property 'classPrefix' Example: : ${artifactId.substring(0,1).toUpperCase()}${artifactId.substring(1)}
Define value for property 'copyright': FreshLEX, LLC
Define value for property 'copyrightYear' 2017: : 2018

Edit karaf/pom.xml to include l2-switch

[workdir]$ cd example/
[example]$ vim karaf/pom.xml

Add this right under the dependencies tag:

<dependency>
      <groupId>org.opendaylight.l2switch</groupId>
      <artifactId>features-l2switch</artifactId>
      <version>0.7.0-SNAPSHOT</version>
      <classifier>features</classifier>
      <type>xml</type>
      <scope>runtime</scope>
</dependency>

Build and run ODL w/ the l2-switch feature

[example]$ mvn clean install -DskipTests
[example]$ cd karaf/target/assembly/bin/
[bin]$ ./karaf
opendaylight-user@root>feature:install odl-l2switch-switch
opendaylight-user@root>
1
votes

The distro under the project's karaf directory is generated based on the project feature(s). The archetype doesn't know about every project in ODL. It's just a starting point - you add dependent bundles or features as you need them. So if you need an l2-switch feature then you would include that feature with your project's feature.

0
votes

To use OpenDaylight you dont need to build it from the source so you dont need Maven. Just get java 8 installed and your java home is set. Then download the tar file (https://www.opendaylight.org/technical-community/getting-started-for-developers/downloads-and-documentation) and extract it.

For the applications, activate restconf, netconf, openflow, and l2switch as described and your instance is ready to use.

Running mininet, you can set the contoller using ovs-vsctl set-controller bridge tcp::

and use ovs-vsctl show to see if the controller is connected.