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 ) L1 = 2 s = [] for i in range( L1 ): sw = self.addSwitch( 's{}'.format( i + 1 ) ) s.append( sw ) count = 1 for sw1 in s: for i in range(3): host = self.addHost( 'h{}'.format( count ) ) self.addLink( sw1, host ) count += 1 self.addLink(s[0],s[1]) topos = { 'mytopo': ( lambda: MyTopo(