一 项目内容
二 思路
三 代码演示:
建立拓扑
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‘ )
# add links
self.addLink(host1,switch1)
self.addLink(switch1,switch2)
self.addLink(switch1,switch3)
self.addLink(switch2,switch3)
self.addLink(switch2,host2)
self.addLink(switch2,host3)
topos = { ‘mytopo‘: ( lambda: MyTopo() ) }
四 项目分工
作业要求:
负载均衡程序
演示视频
程序分工