3 Written by: Felix G. Tejada
5 This is the principal script to start the project.
6 You can start different topology, but by default is starting anything from the precompiler
9 "clusterGRE.py: Mininet Raspberry Pi Cluster"
10 from mininet.examples.cluster import MininetCluster, SwitchBinPlacer, RemoteGRELink
11 from mininet.topolib import TreeTopo
12 from mininet.log import setLogLevel
13 from mininet.examples.clustercli import ClusterCLI as CLI
14 from mininet.node import RemoteController
15 from topotest import MiTopo
16 from precompiler import TopoFromCompiler
19 IPs = '/home/pi/scripts/iplist'
20 c = RemoteController('c1', ip='192.168.25.2', port=6633)
21 servers = readIPs(IPs)
22 #servers = ['192.168.25.2', '192.168.25.3', '192.168.25.4','192.168.25.5','192.168.25.6']
23 topo1 = TreeTopo(depth=2, fanout=2) # Topologia basica
24 topo2 = MiTopo() # Topologia desde el archivo topotest
25 topo3 = TopoFromCompiler() # Topologia creada a partir del archivo data
26 topo4 = TreeTopo(depth=3, fanout=3) # Topologia grande en arbol
27 net = MininetCluster(topo=topo3, servers=servers, link=RemoteGRELink, placement=SwitchBinPlacer, controller=c)
34 file = open(path, "r") #abre el archivo en read
36 servers = file.read().splitlines() #lee el archivo y lo divide por lineas
40 if __name__ == '__main__':