2019 SDN上机第6次作业
2019 SDN上机第6次作业 1.实验拓扑 实验拓扑 要求:使用Python脚本完成拓扑搭建,并连接ryu控制器 (1)python拓扑代码 from mininet.topo import Topo class MyTopo(Topo): def __init__(self): # initilaize topology Topo.__init__(self) # add hosts and switches h1 = self.addHost('h1') h2 = self.addHost('h2') h3 = self.addHost('h3') h4 = self.addHost('h4') h5 = self.addHost('h5') h6 = self.addHost('h6') s1 = self.addSwitch('s1') s2 = self.addSwitch('s2') # add links self.addLink(h1, s1, 1, 1) self.addLink(h2, s1, 1, 2) self.addLink(h3, s1, 1, 3) self.addLink(s1, s2, 4, 4) self.addLink(h4, s2, 1, 1) self.addLink(h5, s2, 1, 2) self.addLink(h6, s2,