-->

How to connect Opendaylight to Mininet?

2019-08-04 10:55发布

问题:

I've been working in a simple Hello World project to learn the basics for Opendaylight (I was following this tutorial).

Now I want to connect this build of the controller to a network topology defined by Mininet but this is not working. I read that this may be due to I haven't installed odl-l2switch but when I type feature:list --installed the bundle doesn't appear and when I type feature:install odl-l2switch it doesn't appear neither.

Perhaps it is because the way I created the project:

mvn archetype:generate -DarchetypeGroupId=org.opendaylight.controller -DarchetypeArtifactId=opendaylight-startup-archetype -DarchetypeRepository=https://nexus.opendaylight.org/content/repositories/public/ -DarchetypeCatalog=remote -DarchetypeVersion=1.2.2-Boron-SR2

This is strange because I downloaded the Carbon release and I could connect this distribution with Mininet and it worked. Initially I was going to build the hello project in Carbon, the latest distribution, but it didn't work so I did the Hello-World in Boron release.

Can anyone help me?

This is my Github repository

回答1:

Following this link, the command to generate an ODL app is :

mvn archetype:generate -DarchetypeGroupId=org.opendaylight.controller 
-DarchetypeArtifactId=opendaylight-startup-archetype \
-DarchetypeRepository=http://nexus.opendaylight.org/content/repositories/<Snapshot-Type>/ \
-DarchetypeCatalog=remote -DarchetypeVersion=<Archetype-Version>

where you have to replace as following the proper and :

  • For the current Master (Carbon) use Snapshot-Type=opendaylight.snapshot Archetype-Version=1.4.0-SNAPSHOT
  • For the Carbon snapshot use Snapshot-Type=opendaylight.release Archetype-Version=1.3.0-Carbon
  • For Boron "SR0" use Snapshot-Type=opendaylight.release Archetype-Version=1.2.0-Boron
  • For Boron SR1 use Snapshot-Type=opendaylight.release Archetype-Version=1.2.1-Boron-SR1
  • For Boron SR2 use Snapshot-Type=opendaylight.release Archetype-Version=1.2.2-Boron-SR2
  • For the Boron snapshot use Snapshot-Type=opendaylight.snapshot Archetype-Version=1.2.2-SNAPSHOT

The command you use uses 1.2.2-Boron-SR2 as , but as you use public, which is not the appropriate . Replace public with opendaylight.release, as the above link suggests.



回答2:

When you run your ODL distribution , you have all the ODL projects which you can install it at anytime. To connect with mininet ,you have to install odl-l2switch-all feature.

In simple Hello project , you dont have l2switch feature to install. thats why you are not able to connect. Anyway you can install the l2switch feature by adding the l2switch dependency in Features/pom.xml and features.xml . You have to add the same odl version of l2switch.Be careful in this.

Please check feature:list | grep "l2switch" is available or not. If so, install it and launch the mininet !! You are done now !