Using the OpenDaylight SDN Controller with the Mininet Network Emulator
进入karaf
ubuntu@sdnhubvm:~/SDNHub_Opendaylight_Tutorial$ cd distribution/opendaylight-karaf/target/assembly
ubuntu@sdnhubvm:~/SDNHub_Opendaylight_Tutorial/distribution/opendaylight-karaf/target/assembly$ ./bin/karaf
Mininet
ubuntu@sdnhubvm:~$ sudo mn --topo single,3 --mac --switch
ovsk,protocols=OpenFlow13 --controller remote
ovsk,protocols=OpenFlow13 --controller remote
Dlux
ifconfig查看ip地址 docker0那个地址 172.17.42.1:8181/index.html
登录到opendaylight的web界面
这时候看到,界面中有一个switch
Topology
Now we see the network topology in the OpenDaylight controller’s topology tab.
您可以看到由Mininet网络仿真器模拟的网络。 您可以通过在Mininet中构建具有不同属性的不同网络拓扑以及使用OpenDaylight在仿真网络上运行实验来测试OpenDaylight功能。 例如,您可以在Mininet中断开交换机之间的链路,以测试网络如何响应故障。
Nodes
Click on the Nodes tab to see information about each switch in the network:
Click on the Node Connectors link in each row to see information about each port on the switch:
Yang UI
The OpenDaylight Yang UI is a graphical REST client for building and sending REST requests to the OpenDaylight data store. We can use the Yang UI to get information from the data store, or to build REST commands to modify information in the data store — changing network configurations.
Click on the Yang UI tab. Then click on the Expand all button to see all available APIs. Not all of them will work because we did not install all features. One API that will work is the Inventory API. Click on it, then navigate down to the nodes attribute and click on the Send button to send the GET API method to the controller.
了解Yang数据模型并学习如何读写数据存储是使用OpenDaylight控制器了解软件定义网络的关键。
Capturing OpenFlow Messages
要深入了解SDN控制器和交换机的操作方式,您可能需要查看网络中控制器和交换机之间交换的OpenFlow消息。
So the easiest way to view OpenFlow messages is to start Wireshark on the Mininet VM and capture data on the interface connected to the host-only network, which is eth0 in this case.
Start Wireshark
sudo wireshark &
Create a display filter for OpenFlow messages. Enter the text,
of
in the Filter window and click on Apply. Now you will see only OpenFlow messages in the Wireshark display, as shown below.
Shut down the project
On the Mininet VM, stop Mininet and clean up the node, then shut down the VM:
mininet> exit
mininet@mininet:~$ sudo mn -c
mininet@mininet:~$ sudo shutdown -h now
On the OpenDaylight VM, stop OpenDaylight and shut down the VM:
opendaylight-user@root> system:shutdown
brian@odl:~$ sudo shutdown -h now
Reference:http://www.brianlinkletter.com/using-the-opendaylight-sdn-controller-with-the-mininet-network-emulator/
评论
发表评论