博文

目前显示的是标签为“opendaylight”的博文

Sample Application: The Learning Switch Functionality

图片
Create a HashMap called mac_to_port On packet_in, parse packet to get source and destination MAC addresses Store in a hashmap mapping between src_mac and in_port Lookup dst_mac in mac_to_port map to find next hop If next hop is found, create flow_mod and send Else, flood like hub. Processing a Packet: System View The application's workflow when processing a packet is shown in the following figure. Steps 1-3 in the figure show pkt_in processing. Steps 4-7 show pkt_out processing (flooding if not match is found). finally, Steps 8-12 show flow programming to the switch. The sequence details are as follows: A packet_in is sent from the switch to controller The OpenFlow java library parses the packet and translates it into an MD-SAL format governed by the OpenFlow protocol model; the OpenFlow 1.0/1.3 Plugin creates an  MD-SAL Notification   and publishes it into the MD-SAL. MD-SAL routes the notification to all registered consumers , in this case ...

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/kar af  Mininet  ubuntu@sdnhubvm:~$ sudo mn --topo single,3 --mac --switch                         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:...

Mininet install and use

Ubuntu上安装Mininet详细: 1、更新软件 # apt-get update # apt-get upgrade 2、从github上获取Mininet源码。 #git clone git://github.com/mininet/mininet 3、获取完以后,查看当前获取的Mininet版本 #cd mininet #cat INSTALL 说明:在~/mininet目录下,我们可以通过git tag命令列出所有可用的Mininet版本,Mininet2.1.0p1及以后的版本可以原生支持OpenFlow1.3,所以我们这次安装的Mininet2.2.1版本支持OpenFlow1.3协议。 4、源码树获取成功以后,安装Mininet。 #mininet/util/install.sh[options] 这里典型的[options]主要有下面几种: “-a”:完整安装包括Mininet VM,还包括如Open vSwitch的依赖关系,以及像的OpenFlow Wireshark分离器和POX。默认情况下,这些工具将被安装在你的home目录中。 “-nfv”:安装Mininet、基于OpenFlow的交换机和Open vSwitch。 “-s mydir” :在其他选项使用前使用此选项可将源代码建立在一个指定的目录中,而不是在你的home目录。 所以,你可能会用到下面的某一个命令来安装Mininet: # install.sh –a ##完整安装(默认安装在home目录下) # install.sh -s mydir –a ##完整安装(安装在其他目录)  # install.sh –nfv ##安装Mininet+用户交换机+OVS(安装在home目录下) # install.sh -s mydir –nfv ##安装Mininet+用户交换机+OVS(安装在其他目录下) 这里选择的安装命令是: # mininet/util/install.sh –a 5、安装完成以后,通过简单的命令测试Mininet的基本功能。 #sudo mn --test pingall (From:http://www.linuxdiyf.com/li...

2.2 Karaf and feature creation&2.3 Config subsystem

Karaf and feature creation Now that we compiled our sample project, let's run the controller itself; preferably in a different terminal ubuntu@sdnhubvm:~$ cd  SDNHub_Opendaylight_Tutorial/ distribution/opendaylight-karaf/target/assembly ubuntu@sdnhubvm:~/SDNHub_Opendaylight_Tutorial/distribution/opendaylight-karaf/target/assembly$ ./bin/karaf  opendaylight-user@root> feature:list | grep sdnhub sdnhub-tutorial-tapapp                     | 1.0.0-SNAPSHOT      | x         | tutorial-features-1.0.0-SNAPSHOT      | SDN Hub Tutorial :: OpenDaylight :: Tap application sdnhub-tutorial-learning-switch            | 1.0.0-SNAPSHOT      |           | tutorial-features-1.0.0-SNAPSHOT      | SDN Hub Tutorial :: OpenDaylight :: Learning switch opendaylight-user@root> bundle:list -s | grep ...

Sample application

Tap application 流量监控tap应用程序是一个简单的主动流程序员,处理源,汇和流量类型。我们将按照前面描述的步骤构建此应用程序。 The model of the tap configuration data was described  在前面的步骤1中描述。基于该模型,我们执行以下操作使抽头工作: 1.在onDataChanged()事件处理期间从tap对象提取header信息 2.对于每个源端口,请执行以下步骤创建流 1.使用适当的构建器创建匹配对象 2.创建包含指定输出到sink-port的操作列表的操作列表 3.使用匹配和操作列表创建流对象。将此流对象写入节点的Flow表 For each source-port, perform following steps to create a flow Create match object using appropriate builders Create action list with a list of actions specifying output to sink-port Create flow object with match and action list. Write this flow object to the Flow table of the node 注意,流量类型是在YANG模型中定义的特殊枚举字段,以允许用户指定值得监控的特定重要流量类型,例如ARP,ICMP,DNS,DHCP,TCP,UDP。要将枚举转换为dl_type,nw_proto和tp_port的实际值,可以使用以下switch语句: Note that the traffic type is a special enum field defined in the YANG model to allow user to specific important traffic types worth monitoring, like ARP, ICMP, DNS, DHCP, TCP, UDP. For converting the enum to actual values for the  dl_type ,   nw_proto...