Introduction to SDN OpenDayLight

Hi Rene,

I have difficulties understanding this step. sorry, not so familiar with Linux commands:

Open the following file in your favorite text editor:

$ vim ~/.bashrc
And add the following line to set the JAVA_HOME variable:

export JAVA_HOME=/usr/lib/jvm/default-java
Save the file and execute the bashrc file:

$ source ~/.bashrc

Hello Hany

vim is a CLI text editor in Linux. You can find out more about vim and getting started with quick commands here.

Secondly, the command $ vim ~/.bashrc means open the “.bashrc” file (yes the full stop “.” is part of the file name) in the vim CLI text editor. The “~/” is just an indication of the user’s home directory. The $ just shows the prompt belongs to a normal user account.

So, the command $ vim ~/.bashrc essentially says a user wants to open the .bashrc file which is in the user’s home directory using the vim CLI text editor.

Now once you have it open, you should see its contents. Go to the end of the file (using the command keys indicated in the link provided above) and add the text “export JAVA_HOME=/usr/lib/jvm/default-java”

Finally, save and close the file (again using the commands from the link). Issue the final command. The source command essentially tells the operating system to run the .bashrc file. It executes the commands implemented in there including the additional export command you added.

I hope this has been helpful!

Laz

hello guys,

do you have any idea why get this issue ;

mininet@mininet-vm:~/distribution-karaf-0.6.4-Carbon$ ./bin/karaf
karaf: JAVA_HOME is not valid: /usr/lib/jvm/default-java

Hi Ali,

Looking at these posts:

https://ask.opendaylight.org/question/7019/java_home-not-avalid/

This error seems to occur when it can’t find Java. Did you install it? Otherwise, it seems you can fix it by setting the environment variable with the correct java folder.

You can try some of the docker containers out there. This saves quite some time. For example:

https://hub.docker.com/r/glefevre/opendaylight/

Rene

In case anyone wants to know more about NETCONF, RESTCONF, and gRPC…I just published a lesson that covers these three protocols:

Hi Rene,

I am trying to get OpenDaylight to work but I’m having some difficulty. I have installed your VM but now when i open ./bin/karaf… how do i get to the web GUI of Opendaylight? this is where im stuck.

Hello Edgar

In order to access the web GUI, you will have to input the URL in the web browser of your PC. You don’t access the interface from the actual VM itself. You will have to use the IP address that ens160 has obtained via DHCP to gain network access to the interface.

I hope this has been helpful!

Laz

1 Like

Thank you… I think thats where i got confused.

1 Like

Dear Rene,
I was able to follow all the lab except the part where I am supposed to run the script in python. I get the following syntax error:


Can you please tell me the mistake?


Regards,
–Gaby :slight_smile:

Btw, my python is operational:


Regards,
–Gaby

Hi Gaby,

Are you using python 3? The syntax for the print command is different for python 2 or 3.

Python 2:

ip_address = "1.2.3.4"
mac_address = "FC-77-74-EA-F2-FE"
print "Found host with MAC address %s and IP address %s" % (mac_address, ip_address)
Found host with MAC address FC-77-74-EA-F2-FE and IP address 1.2.3.4

Python 3:

ip_address = "1.2.3.4"
mac_address = "FC-77-74-EA-F2-FE"
print "Found host with MAC address %s and IP address %s" % (mac_address, ip_address)
SyntaxError: invalid syntax

In python 3 you have to use parenthesis for the print command like this:

print("hello")

Or in our example:

print("Found host with MAC address %s and IP address %s" % (mac_address, ip_address))
Found host with MAC address FC-77-74-EA-F2-FE and IP address 1.2.3.4

Python 2 is still the most popular version but will retire on 1-1-2020. When you use Python, it’s best to use version 3 now. I’ll update my material so it works on Python 3.

Hope this helps!

Rene

Hello Rene,
Yes, I am using Python 3. I will use the parenthesis as per your suggetion. I will let you know if it works.
Thanks!
MGO

Hello Rene,
Just letting you know that this worked. Thank you!!!

Hello Martha

That’s great, thanks for letting us know! It’s much appreciated…

Laz

Hi, I’m not so sure to understand how OpenDayLight can be useful.

Does these software interconnect with existing devices?
I’m not sure to understand if it can be used to recreate a network topology diagram based on existing devices.
Does this software create a virtual network devices ?

Hello Giovanni

OpenDayLight is just one of many available SDN controllers/frameworks on the market. The controller itself, which is essentially OpenDayLight software running on a server or VM, connects to the actual physical network devices using some SDN protocol such as OpenFlow. (The network devices must support this). The network administrator connects to the SDN controller via APIs, and can use a web interface, a mobile app as well as programming languages (such as python) to interact with the controller, and to automate network maintenance and modifications.

The software doesn’t create a virtual network device, but a centralized location from which the whole network can be controlled and configured as a single entity.

The introduction to SDN lesson explains this whole idea in a very clear and understandable way. Take a look at this first, which approaches SDN in general, and then take a look at the OpenDayLight lesson once again, to see an example of a particular SDN solution in action.

I hope this has been helpful!

Laz

In the SDN lesson with OpenDaylight Rene uses a lot of Linux commands. Are these commands just a matter of rote memorization of specific commands or is there a repository? Is Rene using his knowledge of individual switches and parameters to formulate the specific commands himself, if so do we need to be Linux experts to use automation or could we use Python with windows based command line as well?

Hello Daniel

The purpose of this lesson is to give you some experience with an SDN platform that is widely used, which is OpenDaylight. OpenDaylight is Linux-based only and cannot be run in a Windows environment. The particular steps shown in the lesson that have detailed Linux commands are there for the purpose of installation and setup of that particular program.

The same is true about the Mininet platform.

The lesson allows you to set up an environment in which you can experiment with RESTONCF API, Yang UI, Postman, and Python. The focus is on these SDN related tools, however, the setup required some Linux commands and related setup.

You are not expected to know in any detail these Linux commands for any Cisco certification exam, however, it is useful to learn the basics in order to be able to deploy similar environments on your own.

I hope this has been helpful!

Laz

Thanks Lazaros! When you or Rene are typing these commands from Linux with their specific parameters and switches are you doing so by memory or do you refer to a command table list or pre-set commands?

Hi Daniel

This depends on how often you use Linux. I don’t use it very often, so in most cases, I have to look up the commands involved. Rene who uses it more regularly is able to do a lot more from memory, but I’m sure that he looks things up too occasionally. It’s like the Cisco IOS command line as well, the more you use it, the more things you can do by memory simply because the commands and the logic are fresher in the mind.

I hope this has been helpful!

Laz