2019 SDN上机第6次作业
1.实验拓扑 构建拓扑代码 from mininet.topo import Topo from mininet.net import Mininet from mininet.node import RemoteController,CPULimitedHost from mininet.link import TCLink from mininet.util import dumpNodeConnections class MyTopo( Topo ): "Simple topology example." def __init__( self ): "Create custom topo." Topo.__init__( self ) switchs = [] for i in range(2): sw = self.addSwitch("s{}".format(i + 1)) switchs.append(sw) self.addLink(switchs[0], switchs[1],4,4) count = 1 for sw in switchs: for i in range(3): h = self.addHost("h{}".format(count)) self.addLink(sw, h,i+1,1) count += 1 topos = { 'mytopo':