2019 SDN上机第4次作业

瘦欲@ 提交于 2019-12-05 05:30:39

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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!