1、安装floodlight
2、生成拓扑并连接控制器floodlight,利用控制器floodlight查看图形拓扑
(1)代码:
from mininet.topo import Topo
class MyTopo( Topo ):
"Simple topology example."
def __init__( self ): # Initialize topology Topo.__init__( self ) s1 = self.addSwitch('s1') s2 = self.addSwitch('s2') s3 = self.addSwitch('s3') s4 = self.addSwitch('s4') h1 = self.addHost('h1') h2 = self.addHost('h2') h3 = self.addHost('h3') self.addLink(h1,s2,1,1) self.addLink(h2,s3,1,1) self.addLink(s2,s1,2,1) self.addLink(s3,s1,2,2) self.addLink(s1,s4,3,1) self.addLink(s4,h3,2,1)
topos = { 'mytopo': ( lambda: MyTopo() ) }
(2)命令行
(3)floodlight生成的拓扑结构
3、利用字符界面下发流表,使得‘h1’和‘h2’ ping 不通
流表:
结果截图:
4、利用字符界面下发流表,通过测试‘h1’和‘h3’的联通性,来验证openflow的hardtime机制
流表:
结果截图:
来源:https://www.cnblogs.com/bingrui/p/8001395.html