3 # usage: sudo mn --controller=remote,ip=<controller_ip> --switch=ovsk,protocols=OpenFlow13 --custom <path to createtopo.py> --topo loop ...
5 from mininet.topo import Topo
6 from mininet.net import Mininet
7 from mininet.node import RemoteController
8 from mininet.cli import CLI
11 def __init__(self, switches = 3, hosts_per = 1, **opts):
12 Topo.__init__(self, **opts)
15 for i in range(switches):
16 sw = self.addSwitch('s%s' % (i+ 1))
18 for _ in range(hosts_per):
20 host = self.addHost('h%s' % hnum)
21 self.addLink(sw, host)
28 topos = { 'loop': LoopTopo }