SDN第二次上机作业
1、安装floodlight 参考链接: http://www.sdnlab.com/19189.html 2、生成拓扑并连接控制器floodlight,利用控制器floodlight查看图形拓扑。 代码如下: from mininet.topo import Topo class MyTopo(Topo): def __init__(self): # initilaize topology Topo.__init__(self) # add hosts host1 = self.addHost('h1') host2 = self.addHost('h2') host3 = self.addHost('h3') # add switches switch1 = self.addSwitch('s1') switch2 = self.addSwitch('s2') switch3 = self.addSwitch('s3') switch4 = self.addSwitch('s4') # add links self.addLink(host1, switch2, 1, 1) self.addLink(switch2, switch1, 2, 1) self.addLink(host2, switch3, 1, 1) self.addLink(switch3, switch1,