Example #1
0
def run(args):
    run_id = mk_run_id(args)
    sock = setupControlerCommandChannel(args.ctrl_cmd_local_port)
    ctrlPrepare(sock, run_id, args.ctrl_ip, args.ctrl_cmd_port)
    # k switches n hosts
    topo = LinearTopo(k=args.switches,
                      n=args.hosts,
                      sopts={'protocols': 'OpenFlow13'})
    controller = RemoteController('c0',
                                  ip=args.ctrl_ip,
                                  port=args.ctrl_of_port)
    net = MininetCluster(topo=topo,
                         servers=args.mn_hosts,
                         controller=controller)
    net.start()
    createDirs(run_id, net, args.mn_hosts)
    try:
        pairs = designatePairs(net.hosts)
        setUpHostsFiles(run_id, pairs)
        info("**** CURRENT RUN ID: %s\n" % run_id)
        [generatePairSysConfigs(p, args.iterations) for p in pairs]
        [runPassiveHosts(p) for p in pairs]
        [ensurePassiveStarted(p, args.sleep_time) for p in pairs]
        [runActiveHosts(p) for p in pairs]
        waitForFinish(pairs, args.sleep_time)
    except Exception, arg:
        error("ERROR: %s \n" % arg)
Example #2
0
def clusterSanity():
    "Sanity check for cluster mode"
    topo = SingleSwitchTopo()
    net = MininetCluster( topo=topo )
    net.start()
    CLI( net )
    net.stop()
Example #3
0
def demo():
    "Simple Demo of Cluster Mode"
    servers = ['localhost', 'ubuntu2', 'ubuntu3']
    topo = TreeTopo(depth=3, fanout=3)
    net = MininetCluster(topo=topo, servers=servers, placement=SwitchBinPlacer)
    net.start()
    CLI(net)
    net.stop()
Example #4
0
def run():
    servers = ['localhost', 'mn2']
    topo = LinearTopo(k=2, n=2, sopts={'protocols': 'OpenFlow13'})
    controller = RemoteController('c0', ip='192.168.56.1', port=6653)
    net = MininetCluster(topo=topo, servers=servers, controller=controller)
    net.start()
    h1 = net.hosts[0]
    h2 = net.hosts[1]
    setupIperfPair(h1, h2)
    # CLI (net)
    net.stop()
Example #5
0
 def __init__(self, topo, port=6653, controller_port=6653, servers=None):
     self.clear()
     self.controller = Controller(controller_port)
     if not servers:
         self.network = Mininet(topo=topo,
                                controller=RemoteController(
                                    self.controller.name, port=port))
     else:
         self.network = MininetCluster(topo=topo,
                                       servers=servers,
                                       placement=SwitchBinPlacer,
                                       controller=RemoteController(
                                           self.controller.name, port=port))
     self.dpctl = DPCTL(self.network.switches)
     self.traffic_manager = TrafficManager(self.network)