1. 安装轻量级网络仿真工具Mininet
通过老师给的文件直接导入
查看版本
2. 用字符命令搭建如下拓扑,要求写出命令
3. 利用可视化工具搭建如下拓扑,并要求支持OpenFlow 1.0 1.1 1.2 1.3,设置h1(10.0.0.10)、h2(10.0.0.11)、h3(10.0.0.12),拓扑搭建完成后使用命令验证主机ip,查看拓扑端口连接情况。
设置OpenFlow 1.0 1.1 1.2 1.3,设置h1(10.0.0.10)、h2(10.0.0.11)、h3(10.0.0.12)
运行拓扑
使用xterm命令和config命令
4. 利用Python脚本完成如下图所示的一个Fat-tree型的拓扑(交换机和主机名需与图中一致,即s1~s6,h1~h8,并且链路正确,请给出Mininet相关截图)
部分代码:
'''
from mininet.topo import Topo
class MyTopo(Topo):
def __init__(self): # initilaize topology Topo.__init__(self) # add hosts and switches host1 = self.addHost('h1') host2 = self.addHost('h2') host3 = self.addHost('h3') host4 = self.addHost('h4') host5 = self.addHost('h5') host6 = self.addHost('h6') host7 = self.addHost('h7') host8 = self.addHost('h8') switch1 = self.addSwitch('s1') switch2 = self.addSwitch('s2') switch3 = self.addSwitch('s3') switch4 = self.addSwitch('s4') switch5 = self.addSwitch('s5') switch6 = self.addSwitch('s6') # add links self.addLink(host3, switch4, 1, 1) self.addLink(host4, switch4, 1, 2) self.addLink(host1, switch3, 1, 1) self.addLink(host2, switch3, 1, 2) self.addLink(host5, switch5, 1, 1) self.addLink(host6, switch5, 1, 2) self.addLink(host7, switch6, 1, 1) self.addLink(host8, switch6, 1, 2) self.addLink(switch1, switch3, 1, 3) self.addLink(switch1, switch4, 2, 3) self.addLink(switch1, switch5, 3, 3) self.addLink(switch1, switch6, 4, 3) self.addLink(switch2, switch3, 1, 4) self.addLink(switch2, switch4, 2, 4) self.addLink(switch2, switch5, 3, 4) self.addLink(switch2, switch6, 4, 4)
topos = {'mytopo': (lambda: MyTopo())}
'''