Esempio n. 1
0
#!/usr/bin/python2

#
# This example shows how to use MaxiNet's CommandLineInterface (CLI).
# Using the CLI, commands can be run interactively at emulated hosts.
# Thanks to our build-in py command you can dynamically change the
# topology.
#

from MaxiNet.Frontend import maxinet
from MaxiNet.tools import FatTree

topo = FatTree(4, 10, 0.1)
cluster = maxinet.Cluster()

exp = maxinet.Experiment(cluster, topo)
exp.setup()

exp.CLI(locals(), globals())

exp.stop()
Esempio n. 2
0
#!/usr/bin/python2

#
# Minimal example showing how to use MaxiNet
#

import time

from MaxiNet.Frontend import maxinet
from MaxiNet.tools import FatTree
from mininet.node import OVSSwitch

topo = FatTree(30, 10, 0.1)
cluster = maxinet.Cluster(minWorkers=7, maxWorkers=7)

exp = maxinet.Experiment(cluster, topo, switch=OVSSwitch)
exp.setup()

print exp.get_node("h1").cmd("ifconfig")  # call mininet cmd function of h1
print exp.get_node("h30").cmd("ifconfig")

print "waiting 5 seconds for routing algorithms on the controller to converge"
time.sleep(5)

print exp.get_node("h30").cmd("ping -c 100 10.0.0.1")

exp.stop()
#!/usr/bin/python2

#
# Minimal example showing how to use MaxiNet
#

import time

from MaxiNet.Frontend import maxinet
from MaxiNet.tools import FatTree
from mininet.node import OVSSwitch

topo = FatTree(5, 10, 0.1)

cluster = maxinet.Cluster(minWorkers=2, maxWorkers=2)

exp = maxinet.Experiment(cluster, topo, switch=OVSSwitch)
exp.setup()

print exp.get_node("h1").cmd("ifconfig")  # call mininet cmd function of h1
print exp.get_node("h5").cmd("ifconfig")

print "waiting 5 seconds for routing algorithms on the controller to converge"
time.sleep(5)

print exp.get_node("h5").cmd("ping -c 100 10.0.0.1")

exp.stop()
#!/usr/bin/python2

#
# Minimal example showing how to use MaxiNet
#

import time

from MaxiNet.Frontend import maxinet
from MaxiNet.tools import FatTree
from mininet.node import OVSSwitch

topo = FatTree(40, 10, 0.1)

cluster = maxinet.Cluster(minWorkers=2, maxWorkers=2)

exp = maxinet.Experiment(cluster, topo, switch=OVSSwitch)
exp.setup()

print exp.get_node("h1").cmd("ifconfig")  # call mininet cmd function of h1
print exp.get_node("h40").cmd("ifconfig")

print "waiting 5 seconds for routing algorithms on the controller to converge"
time.sleep(5)

print exp.get_node("h40").cmd("ping -c 100 10.0.0.1")

exp.stop()
Esempio n. 5
0
from MaxiNet.Frontend import maxinet
from MaxiNet.tools import FatTree



delays= [0.01, 0.1, 1, 10, 100]
#bandwidths = [10, 50, 100, 200, 400, 800, 1600, 2000]
bandwidths = [250]
flows= [1,2,4,8,16]
n = 32   #number of hosts you want to create

for bw in bandwidths:
   delay = 0.1
   print "##################################################"
   print "Creating 32 host FatTree topology with BW:",bw,"Delay:",delay
   topo = FatTree(n, bw, delay)

   mapping = {"h1": 0,"h2": 0,"h3": 0,"h4": 0,"h5": 0,"h6": 0,"h7": 0,
              "h8": 0,"h9": 0,"h10": 0,"h11": 0,"h12": 0,"h13": 0,
              "h14": 0,"h15": 0,"h16": 0,"h17": 1,"h18": 1,"h19": 1,
              "h20": 1,"h21": 1,"h22": 1,"h23": 1,"h24": 1,"h25": 1,
              "h26": 1,"h27": 1,"h28": 1,"h29": 1,"h30": 1,"h31": 1,
              "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,
Esempio n. 6
0
#!/usr/bin/python2

#
# Minimal example showing how to use MaxiNet
#

import time

from MaxiNet.Frontend import maxinet
from MaxiNet.tools import FatTree
from mininet.node import OVSSwitch

topo = FatTree(120, 10, 0.1)
cluster = maxinet.Cluster(minWorkers=2, maxWorkers=2)

exp = maxinet.Experiment(cluster, topo, switch=OVSSwitch)
exp.setup()

print exp.get_node("h1").cmd("ifconfig")  # call mininet cmd function of h1
print exp.get_node("h120").cmd("ifconfig")

print "waiting 5 seconds for routing algorithms on the controller to converge"
time.sleep(5)

print exp.get_node("h120").cmd("ping -c 100 10.0.0.1")


exp.stop()
   depth =  int(math.ceil(math.log(total_switches,total_workers)))
   print "\n*Total switch levels:",depth
   sid = 1
   
   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)
Esempio n. 8
0
#!/usr/bin/python2

#
# Minimal example showing how to use MaxiNet
#

import time

from MaxiNet.Frontend import maxinet
from MaxiNet.tools import FatTree
from mininet.node import OVSSwitch

topo = FatTree(20, 10, 0.1)

cluster = maxinet.Cluster(minWorkers=2, maxWorkers=2)

exp = maxinet.Experiment(cluster, topo, switch=OVSSwitch)
exp.setup()

print exp.get_node("h1").cmd("ifconfig")  # call mininet cmd function of h1
print exp.get_node("h20").cmd("ifconfig")

print "waiting 5 seconds for routing algorithms on the controller to converge"
time.sleep(5)

print exp.get_node("h20").cmd("ping -c 100 10.0.0.1")

exp.stop()
Esempio n. 9
0
from MaxiNet.Frontend import maxinet
from MaxiNet.tools import FatTree



delays= [0.01, 0.1, 1, 10, 100]
#bandwidths = [10, 50, 100, 200, 400, 800, 1600, 2000]
bandwidths = [250]
flows= [1,2,4,8,16]
n = 32   #number of hosts you want to create

for bw in bandwidths:
   delay = 0.1
   print "##################################################"
   print "Creating 32 host FatTree topology with BW:",bw,"Delay:",delay
   topo = FatTree(n, bw, delay)

   mapping = {"h1": 0,
              "h2": 0,
              "h3": 0,
              "h4": 0,
              "h5": 0,
              "h6": 0,
              "h7": 0,
              "h8": 0,
              "h9": 0,
              "h10": 0,
              "h11": 0,
              "h12": 0,
              "h13": 0,
              "h14": 0,