"h32": 1,"s1": 0,"s2": 0,"s3": 0,"s4": 0,"s5": 0, "s6": 0,"s7": 0,"s8": 0,"s9": 0,"s10": 0,"s11": 0, "s12": 0,"s13": 0,"s14": 0,"s15": 0,"s16": 0,"s17": 1, "s18": 1,"s19": 1,"s20": 1,"s21": 1,"s22": 1,"s23": 1, "s24": 1,"s25": 1,"s26": 1,"s27": 1,"s28": 1,"s29": 1, "s30": 1,"s31": 1,"s32": 1,"s33": 0,"s34": 0,"s35": 0, "s36": 0,"s37": 0,"s38": 0,"s39": 0,"s40": 0,"s41": 1, "s42": 1,"s43": 1,"s44": 1,"s45": 1,"s46": 1,"s47": 1, "s48": 1,"s49": 0,"s50": 0,"s51": 0,"s52": 0,"s53": 1, "s54": 1,"s55": 1,"s56": 1,"s57": 0,"s58": 0,"s59": 1, "s60": 1,"s61": 0,"s62": 1,"s63": 0 } print "Hosts : ", len(topo.hosts()) n = len(topo.hosts()) print "Switches : ", len(topo.switches()) #print "Links :", topo.links() cluster = maxinet.Cluster(minWorkers=2,maxWorkers=2) #exp = maxinet.Experiment(cluster, topo, nodemapping=mapping) exp = maxinet.Experiment(cluster, topo) exp.setup() #print exp.get_node("h1").cmd("ifconfig") # call mininet cmd function of h1 #print exp.get_node("h4").cmd("ifconfig") print "waiting 5 seconds for routing algorithms on the controller to converge" sleep(5)
for i in xrange(depth-1, -1, -1): total_leaves = int (math.pow(total_workers, i)) print " * Level = ",i, ", Total leaves ", total_leaves for j in xrange(total_leaves): worker = j/ int(math.ceil(total_leaves/float(total_workers))) #print " ",str(sid)+" : "+str(worker) mapping['s'+str(sid)] = worker sid+=1 print "Creating",n,"host FatTree topology with BW:",bw,"Delay:",delay topo = FatTree(n, bw, delay) print "Total Hosts : ", len(topo.hosts()), n = len(topo.hosts()) print "Total Switches : ", len(topo.switches()) #print "Links :", topo.links() cluster = maxinet.Cluster(minWorkers=2,maxWorkers=2) print "Cluster num_workers:", cluster.num_workers print "Cluster hosts:", cluster.workers exp = maxinet.Experiment(cluster, topo, nodemapping=mapping) #exp = maxinet.Experiment(cluster, topo) exp.setup() #print exp.get_node("h1").cmd("ifconfig") # call mininet cmd function of h1 print "waiting 5 seconds for routing algorithms on the controller to converge" sleep(5) #worker1 = exp.get_worker("h1") print "\n Total Workers in this cluster:",exp.cluster.num_workers() workermap = exp.generate_hostname_mapping() print " Worker mapping:", workermap