Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
OpenDaylight Cookbook

You're reading from   OpenDaylight Cookbook Deploy and operate software-defined networking in your organization

Arrow left icon
Product type Paperback
Published in Jun 2017
Publisher Packt
ISBN-13 9781786462305
Length 336 pages
Edition 1st Edition
Concepts
Arrow right icon
Authors (6):
Arrow left icon
Rashmi Pujar Rashmi Pujar
Author Profile Icon Rashmi Pujar
Rashmi Pujar
ICARO CAMELO ICARO CAMELO
Author Profile Icon ICARO CAMELO
ICARO CAMELO
Mohamed Elserngawy Mohamed Elserngawy
Author Profile Icon Mohamed Elserngawy
Mohamed Elserngawy
Jamie Goodyear Jamie Goodyear
Author Profile Icon Jamie Goodyear
Jamie Goodyear
Mathieu Lemay Mathieu Lemay
Author Profile Icon Mathieu Lemay
Mathieu Lemay
Yrineu Rodrigues Yrineu Rodrigues
Author Profile Icon Yrineu Rodrigues
Yrineu Rodrigues
+2 more Show less
Arrow right icon
View More author details
Toc

Table of Contents (9) Chapters Close

Preface 1. OpenDaylight Fundamentals FREE CHAPTER 2. Virtual Customer Edge 3. Dynamic Interconnects 4. Network Virtualization 5. Virtual Core and Aggregation 6. Intent and Policy Networking 7. OpenDaylight Container Customizations 8. Authentication and Authorization

Connecting OpenFlow switches

OpenFlow is a vendor-neutral, standard communications interface defined to enable the interaction between the control and forwarding channels of an SDN architecture. The OpenFlowPlugin project intends to support implementations of the OpenFlow specification as it evolves. It currently supports OpenFlow versions 1.0 and 1.3.2. In addition, to support the core OpenFlow specification, OpenDaylight Beryllium also includes preliminary support for the table type patterns and OF-CONFIG specifications.

The OpenFlow southbound plugin currently provides the following components:

  • Flow management
  • Group management
  • Meter management
  • Statistics polling

Let's connect an OpenFlow switch to OpenDaylight.

Getting ready

This recipe requires an OpenFlow switch. If you don't have any, you can use a Mininet-VM with OvS installed. You can download Mininet-VM from the following website:

https://github.com/mininet/mininet/wiki/Mininet-VM-Images

Any version should work.

The following recipe will be presented using a Mininet-VM with OvS 2.0.2.

How to do it...

Perform the following steps:

  1. Start the OpenDaylight distribution using the karaf script. Using this script will give you access to the Karaf CLI:
$ ./bin/karaf
  1. Install the user-facing feature responsible for pulling in all dependencies needed to connect an OpenFlow switch:
opendaylight-user@root>feature:install odl-openflowplugin-all  

It might take a minute or so to complete the installation.

  1. Connect an OpenFlow switch to OpenDaylight.

As mentioned in the Getting ready section, we will use Mininet-VM as our OpenFlow switch as this VM runs an instance of OpenVSwitch:

  • Log in to Mininet-VM using:
    • Username: mininet
    • Password: mininet
  • Let's create a bridge:
mininet@mininet-vm:~$ sudo ovs-vsctl add-br br0  
  • Now let's connect OpenDaylight as the controller of br0:
mininet@mininet-vm:~$ sudo ovs-vsctl set-controller br0 tcp: ${CONTROLLER_IP}:6633  
  • Let's look at our topology:
mininet@mininet-vm:~$ sudo ovs-vsctl show
0b8ed0aa-67ac-4405-af13-70249a7e8a96
Bridge "br0"
Controller "tcp: ${CONTROLLER_IP}:6633"
is_connected: true
Port "br0"
Interface "br0"
type: internal
ovs_version: "2.0.2"

${CONTROLLER_IP} is the IP address of the host running OpenDaylight.

We're establishing a TCP connection. For a more secure connection, we could use TLS protocol; however, this will not be included in this book as this is beyond the scope of the book.

  1. Have a look at the created OpenFlow node.

Once the OpenFlow switch is connected, send the following request to get information regarding the switch:

  • Type: GET
  • Headers:

Authorization: Basic YWRtaW46YWRtaW4=

  • URL: http://localhost:8181/restconf/operational/opendaylight-inventory:nodes/

This will list all the nodes under the opendaylight-inventory subtree of MD-SAL that stores OpenFlow switch information. As we connected our first switch, we should have only one node there. It will contain all the information that the OpenFlow switch has, including its tables, its ports, flow statistics, and so on.

How it works...

Once the feature is installed, OpenDaylight is listening to connections on port 6633 and 6640. Setting up the controller on the OpenFlow-capable switch will immediately trigger a callback on OpenDaylight. It will create the communication pipeline between the switch and OpenDaylight so they can communicate in a scalable and non-blocking way.

You have been reading a chapter from
OpenDaylight Cookbook
Published in: Jun 2017
Publisher: Packt
ISBN-13: 9781786462305
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image