标签:ima work images from imp red 程序代码 st3 sts
标签(空格分隔): SDN
参考链接:http://www.sdnlab.com/19189.html
拓扑如图所
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‘)
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, 2, 2)
self.addLink(switch1, switch4, 3, 1)
self.addLink(switch4, host3, 2, 1)
topos = {‘mytopo‘: (lambda: MyTopo())}
记得清空拓扑sudo mn -c
标签:ima work images from imp red 程序代码 st3 sts
原文地址:http://www.cnblogs.com/karen-m/p/7994545.html