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, from web.
8 If you want to start any other topology, just change the constructor MininetCluster with topology
11 from precompiler import TopoFromCompiler
12 from topotest import MiTopo
13 from mininet.node import RemoteController
14 from mininet.examples.clustercli import ClusterCLI as CLI
15 from mininet.log import setLogLevel
16 from mininet.topolib import TreeTopo
17 from mininet.examples.cluster import MininetCluster, SwitchBinPlacer, RemoteGRELink
18 "clusterGRE.py: Mininet Raspberry Pi Cluster"
22 IPs = '/home/pi/scripts/iplist'
23 c = RemoteController('c1', ip='192.168.25.2', port=6633)
24 servers = readIPs(IPs)
25 #servers = ['192.168.25.2', '192.168.25.3', '192.168.25.4','192.168.25.5','192.168.25.6']
26 # topo1 = TreeTopo(depth=2, fanout=2) # Topologia basica
27 # topo2 = MiTopo() # Topologia desde el archivo topotest
28 topo3 = TopoFromCompiler() # Topologia creada a partir del archivo data
29 # topo4 = TreeTopo(depth=4, fanout=4) # Topologia GRANDE en arbol
30 net = MininetCluster(topo=topo3, servers=servers,
31 link=RemoteGRELink, placement=SwitchBinPlacer, controller=c)
38 file = open(path, "r") # abre el archivo en read
40 servers = file.read().splitlines() # lee el archivo y lo divide por lineas
44 if __name__ == '__main__':