官术网_书友最值得收藏!

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.

主站蜘蛛池模板: 铁岭市| 仁布县| 彰化市| 垫江县| 阳谷县| 突泉县| 宾川县| 阿合奇县| 中阳县| 治县。| 东阳市| 卓资县| 嘉荫县| 外汇| 道孚县| 本溪| 东方市| 资中县| 灌南县| 玉环县| 乌苏市| 齐河县| 怀化市| 镇宁| 兴仁县| 班玛县| 伊川县| 左权县| 香格里拉县| 班戈县| 东乌| 衡山县| 葫芦岛市| 浮山县| 呼伦贝尔市| 白朗县| 嘉祥县| 临朐县| 璧山县| 台东市| 洪江市|