Joshua Bonsink avatar Joshua Bonsink committed 1cc2a56

Updated gui. Implemented a pcap to xml trace converter. Minor changes in other files.

Comments (0)

Files changed (13)

core/ns3/experiment/experiment.py

         SERVER_DESC = scen.config.Server()
         CLIENT_DESC = scen.config.Client()
                 
-        try:
-            if self.target_id is not None:
+        try:            
+            if self.target_id is not None:                
                 if self.get_node(self.target_id).NODE_TYPE == 'sim_ns3':
                     target_ip = self.get_node(self.target_id).GetObject(ns3.TypeId.LookupByName("ns3::Ipv4")).GetAddress(1, 0).GetLocal()            
                     BOTMASTER_DESC.command.hostname = str(target_ip)
         """Print the address of the server."""
         for i in self.server_id_set:
             ipv4Addr = self.get_node(i).GetObject(ns3.TypeId.LookupByName("ns3::Ipv4")).GetAddress(1, 0)
-            print 'The server addr of server [%i ]: '%(i), ipv4Addr
+            print 'The server addr of server [%i ]: '%(i), ipv4Addr

core/ns3/experiment/imalse_pure_sim_experiment.py

 import optparse
 
 import ns.core
+import ns3
 
 from core.ns3.node import ImalseNetnsSimNode
 from core.ns3.experiment import ImalseExperiment
+from core.ns3.util.netanim import AnimationInterface
 
 class ImalsePureSimExperiment(ImalseExperiment):
     
         parser.add_option("", "--SimulatorImpl", dest = "SimulatorImplementationType",
                 help="the simulator implementation Type, available options are['Realtime', 'Default', 'Visual']")
 
-
+        parser.set_defaults(ExportXML='false')
+        parser.add_option("", "--ExportXML", dest = "ExportXML", 
+                help ="Export XMLS used to animate network in NetAanim.")        
+        
         parser.set_defaults(numnodes = 2, simtime = 30)
         parser.add_option("-n", "--numnodes", dest = "numnodes", type = int,
                           help = "number of nodes; default = %s" %
         """Setup."""
         super(ImalsePureSimExperiment, self).setup()        
         ns.core.GlobalValue.Bind("SimulatorImplementationType",
-                ns.core.StringValue("ns3::%sSimulatorImpl"%(self.options.SimulatorImplementationType)))
+                ns.core.StringValue("ns3::%sSimulatorImpl"%(self.options.SimulatorImplementationType)))                       
 
     def run(self):
         """Run the simulation."""
         self.setup()
         print "running simulator for %s sec" % self.options.simtime
         
-        ns.core.Simulator.Stop(ns.core.Seconds(self.options.simtime))        
+        ns.core.Simulator.Stop(ns.core.Seconds(self.options.simtime)) 
+        anim = AnimationInterface("test.xml")
+        
+        #pointToPoint = ns3.PointToPointHelper()
+        #pointToPoint.EnablePcapAll("test.pcap");
+        
         ns.core.Simulator.Run()
+        anim.pcapToXML()
         self.cleanup()
         ns.core.Simulator.Destroy()
         

core/ns3/util/netanim.py

+from operator import itemgetter
+
+import ns3
+import ns
+
+import random 
+import settings
+from subprocess import check_call
+import os
+
+import time
+
+def export_to_txt(f_name, txt_f_name):
+    cmd = """tshark -o column.format:'"No.", "%%m", "Time", "%%t", "Source", "%%s", "Destination", "%%d", "srcport", "%%uS", "dstport", "%%uD", "len", "%%L", "Protocol", "%%p"' -r %s > %s""" % (f_name, txt_f_name)    
+    print('--> ', cmd)
+    check_call(cmd, shell=True)
+
+def fix_pcap(f_name):
+    cmd = "pcapfix " + f_name
+    print('--> ', cmd)
+    check_call(cmd, shell=True)
+    
+def parse_txt(f_name):    
+    FORMAT = dict(
+        seq=(0, int),
+        start_time=(1, float),
+        src_ip=(2, str),
+        dst_ip=(4, str),
+        # src_ip=(2, dotted_int),
+        # dst_ip=(4, dotted_int),
+        src_port=(5, int),
+        dst_port=(6, int),
+        length=(7, float),
+        protocol=(8, str),
+    )
+
+    NULL = lambda x: 0
+
+    FORMAT_ARP = dict(
+        seq=(0, int),
+        start_time=(1, float),
+        src_ip=(2, str),
+        dst_ip=(4, str),
+        length=(5, float),
+        protocol=(6, str),
+        src_port=(0, NULL),  # FIXME
+        dst_port=(0, NULL),  # FIXME
+    )
+
+    fid = open(f_name, 'r')
+    record = []
+    while True:
+        tline = fid.readline()
+        if not tline:
+            break
+        if tline == '\n':  # Ignore Blank Line
+            continue
+        item = tline.rsplit()
+        try:
+            f = [fmter(item[v]) for (v, fmter) in FORMAT.itervalues()]
+        except IndexError:
+            try:
+                f = [fmter(item[v]) for (v, fmter) in FORMAT_ARP.itervalues()]
+            except IndexError:
+                print('ignore packet, item: ', item)        
+        record.append(f)
+
+    fid.close()
+    return record
+
+class AnimationInterface():
+    
+    def __init__(self, fileName):
+        self.fileName = fileName        
+        self.topoMinX = 0
+        self.topoMinY = 0
+        self.topoMaxX = 2
+        self.topoMaxY = 2    
+        self.currentPacketCount = 0        
+        self.nodeLocation = []
+        self.nodeAddress = {}
+        self.nodeCounter = 0
+        
+        self.started = False
+        
+        self.startAnimation()
+        
+    def startAnimation(self):
+        self.determineTopologyDimensions()      
+        self.openAnimElement()
+        self.writeInformation()
+        self.openCloseTopology(self.topoMinX, self.topoMinY, self.topoMaxX, self.topoMaxY)
+        self.openCloseNode()
+        self.openCloseLinks()
+        
+        self.started = True
+        
+    def determineTopologyDimensions(self):
+        nodes = ns3.NodeList.GetNNodes()
+        
+        for i in range(nodes):
+            node = ns3.NodeList.GetNode(i)            
+            self.updatePosition(node)                
+         
+    def updatePosition(self, node):       
+        x = random.uniform(self.topoMinX, self.topoMaxX)
+        y = random.uniform(self.topoMinY, self.topoMaxY)
+        
+        self.nodeLocation.append((x, y))
+        
+    def openAnimElement(self, lp = 0):
+        self.writeLine("<anim lp = \"" + str(lp) + "\" >\n")
+    
+    def openCloseTopology(self, minX, minY, maxX, maxY):
+        self.writeLine("<topology minX = \"" + str(minX) + "\" minY = \"" + str(minY) + "\" maxX = \"" + str(maxX) + "\" maxY = \"" + str(maxY) + "\">\n")  
+    
+    def openCloseNode(self):
+        nodes = ns3.NodeList.GetNNodes()
+        
+        for i in range(nodes):
+            node = ns3.NodeList.GetNode(i)
+            ID = node.GetId()            
+                                    
+            pos = self.nodeLocation[i]
+            locX = pos[0]
+            locY = pos[1]
+            
+            self.writeLine("<node id = \"" + str(ID) + "\"" + " descr=\"\"" + " locX = \"" + str(locX) + "\" locY = \"" + str(locY) + "\" />\n")
+    
+    def openCloseLinks(self):
+        nodes = ns3.NodeList.GetNNodes()
+        
+        for i in range(nodes):
+            node = ns.network.NodeList.GetNode(i)
+            node1Id = node.GetId()   
+            numDevices = node.GetNDevices()         
+            
+            for i in range(numDevices):
+                dev = node.GetDevice(i)
+                channel = dev.GetChannel()
+                
+                if channel is None:
+                    continue
+                
+                channelType = channel.GetInstanceTypeId().GetName()
+                                 
+                #if (channelType == "ns3::PointToPointChannel"):
+                numChannelDevices = channel.GetNDevices()
+            
+                for j in range(numChannelDevices):
+                    channelDev = channel.GetDevice(j)
+                    node2Id = channelDev.GetNode().GetId()
+                    
+                    if node1Id < node2Id:
+                        self.writeLine("<link fromId=\"" + str(node1Id) + "\" toLp=\"0\" toId=\"" + str(node2Id) + "\"/>\n")   
+    
+    def writeInformation(self):
+        self.writeLine("<information><!-- \n\
+Description of attributes:\n\
+=========================\n\
+anim\n\
+topology\n\
+* minX = minimum X coordinate of the canvas\n\
+* minY = minimum Y coordinate of the canvas\n\
+* maxX = maximum X coordinate of the canvas\n\
+* maxY = maximum Y coordinate of the canvas\n\
+node\n\
+* id = Node Id\n\
+* locX = X coordinate\n\
+* locY = Y coordinate\n\
+link\n\
+* fromId = From Node Id\n\
+* toId   = To Node Id\n\
+packet\n\
+* fbTx = First bit transmit time\n\
+* lbTx = Last bit transmit time\n\
+rx\n\
+* toId = To Node Id\n\
+* fbRx = First bit Rx Time\n\
+* lbRx = Last bit Rx\n\
+wpacket\n\
+* fromId = From Node Id\n\
+* fbTx = First bit transmit time\n\
+* lbTx = Last bit transmit time\n\
+* range = Reception range\n\
+rx\n\
+* toId = To Node Id\n\
+* fbRx = First bit Rx time\n\
+* lbRx = Last bit Rx time-->\n\
+</information>\n")
+        
+    def pcapToXML(self):
+        path = settings.ROOT + "/res"     
+           
+        for dirEntry in os.listdir(path):
+            dirEntryPath = os.path.join(path, dirEntry)
+            if os.path.isfile(dirEntryPath):                
+                fix_pcap(dirEntryPath)
+                time.sleep(5)
+                
+        for dirEntry in os.listdir(path):
+            dirEntryPath = os.path.join(path, dirEntry)
+            if os.path.isfile(dirEntryPath):
+                if "fixed" in dirEntryPath:
+                    newName = dirEntryPath[:-4] + '.txt'                
+                    export_to_txt(dirEntryPath, newName)                
+                    time.sleep(5)
+        
+        packets = []
+        
+        for dirEntry in os.listdir(path):
+            dirEntryPath = os.path.join(path, dirEntry)
+            if os.path.isfile(dirEntryPath):
+                if ".txt" in dirEntryPath:
+                    packets.extend(parse_txt(dirEntryPath))            
+        
+        packets = sorted(packets, key=itemgetter(2))
+                    
+        for packet in packets:            
+            fbTx = packet[2]
+            
+            lbTx = fbTx + random.uniform(0.0005, 0.0005)
+            
+            fbRx = lbTx + random.uniform(0.007, 0.005)
+            lbRx = fbRx + random.uniform(0.0005, 0.0005)
+            
+            source = packet[4]
+            destination = packet[7]
+            
+            fromID = self.getNodeID(source)
+            toID = self.getNodeID(destination)
+            
+            if (fromID == None or toID == None):
+                continue
+            
+            line = "<packet fromId=\"" + str(fromID) + "\" fbTx=\"" + str(fbTx) + "\" lbTx=\"" + str(lbTx) + "\"><rx toId=\"" + str(toID) + "\" fbRx=\"" + str(fbRx) + "\" lbRx=\"" + str(lbRx) + "\"/></packet>\n"
+            self.writeLine(line)
+        
+        self.writeLine("</anim>")
+    
+    def getNodeID(self, address): 
+        if '255' in address:
+            return None
+        
+        for i in range(ns3.NodeList.GetNNodes()):
+            node = ns3.NodeList.GetNode(i)
+            ipv4 = node.GetObject(ns3.Ipv4.GetTypeId())
+      
+            for a in range(ipv4.GetNInterfaces()):
+                for b in range(ipv4.GetNAddresses(a)):
+                    local_addr = ipv4.GetAddress (a, b).GetLocal (); 
+                    if str(local_addr) == address:
+                        return node.GetId()
+        
+        print "cannot find node with address " + address
+        
+        """    
+        value = self.nodeAddress.get(address, None)
+        
+        if value == None:
+            self.nodeAddress[address] = self.nodeCounter
+            value = self.nodeCounter
+        self.nodeCounter += 1
+        """            
+        return None
+    
+    def writeLine(self, line):         
+        with open(self.fileName, 'r+U') as f:
+            try:
+                f.seek(-1, 2)
+                while f.read(1) == "\n":
+                    f.seek(-2, 1)      
+                                       
+            except IOError:            
+                f.seek(0)                     
+            else:
+                f.write("\n")
+                
+            f.write(line)          

core/ns3/util/topology.py

     """Topology network with manual ip settings"""
 
     def _modify_address_helper(self, addressHelper, cidr_addr):
-        """Modify the netbase, mask and and base of the address helper."""
+        """Modify the netbase, mask and and base of the address helper."""                  
         addr, netBase, mask = cidr_to_subnet_mask(cidr_addr)
         netAddr = get_net_addr(addr, mask)
         addressHelper.SetBase(
 
         raise Exception('cannot find node with addr: '+ str(addr))
 
-
-
     def init_net_device(self, net_settings, *args, **kwargs):
         """Initialize the ip addresses and network devices."""
         self.net_settings = net_settings        
 
             j = -1
             ipic_tmp = []
-            for ip in ips:
-                j += 1
-                print('address, ', ip)
+            for ip in ips:                
+                j += 1        
+                print('address, ', ip)        
                 addressHelper = ns3.Ipv4AddressHelper()                
-                addressHelper = self._modify_address_helper(addressHelper, ip)
+                addressHelper = self._modify_address_helper(addressHelper, ip)                
                 ipc = addressHelper.Assign(ns3.NetDeviceContainer(self.get_link_ndc(i).Get(j)))
                 ipic_tmp.append(ipc)            
             ipic.append(ipic_tmp)
         """Create nodes, self.nodes will be a node container."""
         # get the number of nodes in the network
         max_node = []
-        for type_, desc in net_settings['nets'].iteritems():
-            max_node.append(max( max(v) for v in desc['IpMap'].keys()))
+        
+        try:
+            for type_, desc in net_settings['nets'].iteritems():
+                max_node.append(max( max(v) for v in desc['IpMap'].keys()))
+        except LookupError:
+            print("The netsettings file is not suitable for this experiment.")
+            exit(0)
+            
         node_num = max(max_node) + 1
 
         self.nodes = ns3.NodeContainer()
             addressHelper = ns3.Ipv4AddressHelper()
             i = -1
             for n, ip in zip(nodes, ips):
-                i += 1
+                i += 1                   
                 addressHelper = self._modify_address_helper(addressHelper, ip)
-                print('address for node ', n, ' has bee assigned, ip, ', ip)
+                print('address for node ', n, ' has been assigned, ip, ', ip)
                 ip = addressHelper.Assign(ns3.NetDeviceContainer(self.netDevices[nodes].Get(i)))
 
 

experiments/api.py

     class Experiment(ExperimentClass, BaseClass):
         
         def __init__(self):
-            ExperimentClass.__init__(self)
             BaseClass.__init__(self)            
+            ExperimentClass.__init__(self)            
         
         def setup(self):
-            ExperimentClass.setup(self)  
             BaseClass.setup(self)
-                              
+            ExperimentClass.setup(self)                             
     
     return Experiment()
-    
+    

experiments/complex_net_exp.py

         self.server_id_set = ns['server_id_set']
         self.botmaster_id_set = ns['botmaster_id_set']
         self.client_id_set = ns['client_id_set']
-        self.target_id = ns['target_id']
+        
+        try:    
+            self.target_id = self.target_id = ns['target_id']
+        except Exception:
+            self.target_id = self.server_id_set[0]        
         
         # parse the server address
         if len(ns['server_addr']) == 0:
         self.print_srv_addr()        
         self.set_server_info()
         self.start_nodes()
-        
+        

experiments/manual_topo_bt_exp.py

         self.server_id_set = ns['server_id_set']
         self.botmaster_id_set = ns['botmaster_id_set']
         self.client_id_set = ns['client_id_set']
-        self.target_id = ns['target_id']
+        try:    
+            self.target_id = self.target_id = ns['target_id']
+        except Exception:
+            self.target_id = self.server_id_set[0]  
         
         # parse the server address
         if len(ns['server_addr']) == 0:

experiments/manual_topo_exp.py

         try:    
             self.target_id = ns.target_id
         except Exception:
-            self.target_id = self.server_id_set
+            self.target_id = self.server_id_set[0]
         
         if len(ns.server_addr) == 0:
             self.SERVER_ADDR = ''
 
 from PyQt4 import QtGui, QtCore
 
-COMMON_SETTINGS = 1
-DDOS_FLOODING = 2
-FILE_EXFILTRATION = 3
-KEYLOGGER = 4
-SPAMMING = 5
+COMMON_SETTINGS = 'Common Settings'
+DDOS_FLOODING = 'DDOS Flooding'
+FILE_EXFILTRATION = 'File Exfiltration'
+KEYLOGGER = 'Keylogger'
+SPAMMING = 'Spamming'
 
 SCENARIOS = { 
     DDOS_FLOODING : 'ddos_flooding',
                 passed_entity = False
                 return
                 
-            f.write(line)    
-
+            f.write(line) 
 
 def searchAndGet(settings_type, entity, parameter):
     passed_entity = False
         file_menu.addAction(exitAction)
      
         # --- Tabs --- # 
-        tab_widget = QtGui.QTabWidget()
+        self.tab_widget = QtGui.QTabWidget()
                  
         tab_common = QtGui.QWidget()
-        tab_ddos_flooding = QtGui.QWidget()
-        tab_file_exfiltration = QtGui.QWidget()
-        tab_keylogger = QtGui.QWidget()
-        tab_spamming = QtGui.QWidget()
         tab_topology = QtGui.QWidget()
+        tab_terminal = QtGui.QWidget()
+        tab_netanim = QtGui.QWidget()
         
-        tab_widget.addTab(tab_common, "Common settings")
-        tab_widget.addTab(tab_topology, "Topology Editor")
-        tab_widget.addTab(tab_ddos_flooding, "DDOS Flooding")
-        tab_widget.addTab(tab_file_exfiltration, "File Exfiltration")
-        tab_widget.addTab(tab_keylogger, "Keylogger")
-        tab_widget.addTab(tab_spamming, "Spamming")
-         
-        self.setCentralWidget(tab_widget)
+        self.tab_ddos_flooding = QtGui.QWidget()
+        self.tab_file_exfiltration = QtGui.QWidget()
+        self.tab_keylogger = QtGui.QWidget()
+        self.tab_spamming = QtGui.QWidget()        
+        
+        self.tab_widget.addTab(tab_common, "Common settings")
+        self.tab_widget.addTab(tab_topology, "Topology Editor")
+        self.tab_widget.addTab(tab_terminal, "Terminal")
+        self.tab_widget.addTab(tab_netanim, "NetAnim")
+        
+        self.setCentralWidget(self.tab_widget)
 
         # --- Topology editor --- #
         tab_topology_layout = QtGui.QVBoxLayout(tab_topology)
         container = QtGui.QX11EmbedContainer()               
         tab_topology_layout.addWidget(container)
+                
+        container.show()
+        process = QtCore.QProcess(container)
+        executable = QtCore.QString("wish ./gui/TopologyEditor/core.tcl -use " + str(container.winId()))    
+        process.start(executable)        
+        container.resize(700, 616)
         
-        container.show()
-        #process = QtCore.QProcess(container)
-        #executable = QtCore.QString("wish ./gui/core.tcl")
-        #executable = QtCore.QString("xterm")
-        #arguments = QtCore.QStringList()  
-        #arguments.append(QtCore.QString("-into"))      
-        #arguments.append(QtCore.QString("-use"))      
-        #arguments.append(QtCore.QString.number(container.winId()))
-        print container.winId()
-        #process.start(executable, arguments)               
+        # --- Terminal --- #
+        tab_terminal_layout = QtGui.QVBoxLayout(tab_terminal)
+        self.container2 = QtGui.QX11EmbedContainer()               
+        tab_terminal_layout.addWidget(self.container2)
+                
+        self.container2.show()
+        self.processTerminal = QtCore.QProcess(self.container2)
+        executable = QtCore.QString("xterm -into " + str(self.container2.winId()))    
+        self.processTerminal.start(executable)  
         
+        # --- NetAnim -- #
+        tab_netanim_layout = QtGui.QVBoxLayout(tab_netanim)
+        container3 = QtGui.QX11EmbedContainer()
+        tab_netanim_layout.addWidget(container3)
+        
+        container3.show()
+        process = QtCore.QProcess(container3)
+        executable = QtCore.QString("./gui/NetAnim/NetAnim " + str(container3.winId()))    
+        process.start(executable)  
         
         # --- DDOS Flooding scenario --- #
-        tab_ddos_flooding_layout = QtGui.QVBoxLayout(tab_ddos_flooding)     
-        tool_box_ddos = QtGui.QToolBox(tab_ddos_flooding)
+        tab_ddos_flooding_layout = QtGui.QVBoxLayout(self.tab_ddos_flooding)     
+        tool_box_ddos = QtGui.QToolBox(self.tab_ddos_flooding)
         tab_ddos_flooding_layout.addWidget(tool_box_ddos)     
 
         ping_flood = QtGui.QWidget()
         groupbox_ping_flood.setTitle("Ping Flood attack parameters")
         hbox_ping_flood.addWidget(groupbox_ping_flood)        
         grid_groupbox_ping_flood = QtGui.QGridLayout()                        
+        grid_groupbox_ping_flood.setSpacing(10)
         hbox_groupbox_ping_flood = QtGui.QHBoxLayout(groupbox_ping_flood)
         hbox_groupbox_ping_flood.addLayout(grid_groupbox_ping_flood)
 
         current_value = searchAndGet(DDOS_FLOODING, PING_CMD, "self.hostname")        
         label_3 = QtGui.QLabel(groupbox_ping_flood)
         label_3.setText("Hostname")        
-        grid_groupbox_ping_flood.addWidget(label_3, 0, 0, 1, 2)   
-        spacerItem3 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
-        grid_groupbox_ping_flood.addItem(spacerItem3, 0, 1, 1, 2)                
+        grid_groupbox_ping_flood.addWidget(label_3, 0, 0)        
         lineEdit_4 = MyLineEdit(current_value, DDOS_FLOODING, PING_CMD, "self.hostname", groupbox_ping_flood)
         lineEdit_4.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignTrailing | QtCore.Qt.AlignVCenter)        
         lineEdit_4.setText(current_value)
-        grid_groupbox_ping_flood.addWidget(lineEdit_4, 0, 2, 1, 2)
+        grid_groupbox_ping_flood.addWidget(lineEdit_4, 0, 1)
          
         current_value = int(searchAndGet(DDOS_FLOODING, PING_CMD, "self.packet_size"))
         label_4 = QtGui.QLabel(groupbox_ping_flood)
         label_4.setText("Packet size")
-        grid_groupbox_ping_flood.addWidget(label_4, 1, 0, 1, 2)       
-        spacerItem4 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
-        grid_groupbox_ping_flood.addItem(spacerItem4, 1, 1, 1, 2)        
+        grid_groupbox_ping_flood.addWidget(label_4, 1, 0)               
         packet_size = MySpinBox(current_value, DDOS_FLOODING, PING_CMD, "self.packet_size", groupbox_ping_flood)            
         packet_size.setValue(current_value)
         packet_size.setMinimum(0)
         packet_size.setMaximum(100)
         packet_size.setSingleStep(1) 
-        grid_groupbox_ping_flood.addWidget(packet_size, 1, 2, 1, 2)       
+        grid_groupbox_ping_flood.addWidget(packet_size, 1, 1)       
 
         current_value = searchAndGet(DDOS_FLOODING, PING_CMD, "self.interval")
         label_5 = QtGui.QLabel(groupbox_ping_flood)
         label_5.setText("Ping interval")        
-        grid_groupbox_ping_flood.addWidget(label_5, 2, 0, 1, 2)  
-        spacerItem5 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
-        grid_groupbox_ping_flood.addItem(spacerItem5, 2, 1, 1, 2)        
+        grid_groupbox_ping_flood.addWidget(label_5, 2, 0)          
         lineEdit_4 = MyLineEdit(current_value, DDOS_FLOODING, PING_CMD, "self.interval", groupbox_ping_flood)
         lineEdit_4.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignTrailing | QtCore.Qt.AlignVCenter)        
         lineEdit_4.setText(current_value)
-        grid_groupbox_ping_flood.addWidget(lineEdit_4, 2, 2, 1, 2)       
+        grid_groupbox_ping_flood.addWidget(lineEdit_4, 2, 1)       
                   
         current_value = searchAndGet(DDOS_FLOODING, PING_CMD, "self.verbose")
         label_3 = QtGui.QLabel(groupbox_ping_flood)
         label_3.setText("Verbose")        
-        grid_groupbox_ping_flood.addWidget(label_3, 3, 0, 1, 2)   
-        spacerItem3 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
-        grid_groupbox_ping_flood.addItem(spacerItem3, 3, 1, 1, 2)        
+        grid_groupbox_ping_flood.addWidget(label_3, 3, 0)           
         lineEdit_4 = MyLineEdit(current_value, DDOS_FLOODING, PING_CMD, "self.verbose", groupbox_ping_flood)
         lineEdit_4.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignTrailing | QtCore.Qt.AlignVCenter)        
         lineEdit_4.setText(current_value)
-        grid_groupbox_ping_flood.addWidget(lineEdit_4, 3, 2, 1, 2)          
+        grid_groupbox_ping_flood.addWidget(lineEdit_4, 3, 1)          
         
         current_value = int(searchAndGet(DDOS_FLOODING, PING_CMD, "self.num_packets"))        
         label_4 = QtGui.QLabel(groupbox_ping_flood)
         label_4.setText("Number of packets")
-        grid_groupbox_ping_flood.addWidget(label_4, 4, 0, 1, 2)       
-        spacerItem4 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
-        grid_groupbox_ping_flood.addItem(spacerItem4, 4, 1, 1, 2)        
+        grid_groupbox_ping_flood.addWidget(label_4, 4, 0)               
         num_packets = MySpinBox(current_value, DDOS_FLOODING, PING_CMD, "self.num_packets", groupbox_ping_flood)                    
         num_packets.setMinimum(0)
         num_packets.setMaximum(99999999)        
         num_packets.setSingleStep(1)
         num_packets.setValue(current_value) 
-        grid_groupbox_ping_flood.addWidget(num_packets, 4, 2, 1, 2)       
+        grid_groupbox_ping_flood.addWidget(num_packets, 4, 1)       
         
         current_value = int(searchAndGet(DDOS_FLOODING, PING_CMD, "self.timeout"))
         label_4 = QtGui.QLabel(groupbox_ping_flood)
         label_4.setText("Timeout")
-        grid_groupbox_ping_flood.addWidget(label_4, 5, 0, 1, 2)       
-        spacerItem4 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
-        grid_groupbox_ping_flood.addItem(spacerItem4, 5, 1, 1, 2)        
+        grid_groupbox_ping_flood.addWidget(label_4, 5, 0)               
         timeout = MySpinBox(current_value, DDOS_FLOODING, PING_CMD, "self.timeout", groupbox_ping_flood)                    
         timeout.setMinimum(0)
         timeout.setMaximum(99999999)
         timeout.setSingleStep(1) 
         timeout.setValue(current_value)
-        grid_groupbox_ping_flood.addWidget(timeout, 5, 2, 1, 2)       
+        grid_groupbox_ping_flood.addWidget(timeout, 5, 1)       
         
         current_value = int(searchAndGet(DDOS_FLOODING, PING_CMD, "self.preload"))
         label_4 = QtGui.QLabel(groupbox_ping_flood)
         label_4.setText("Preload")
-        grid_groupbox_ping_flood.addWidget(label_4, 6, 0, 1, 2)       
-        spacerItem4 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
-        grid_groupbox_ping_flood.addItem(spacerItem4, 6, 1, 1, 2)        
+        grid_groupbox_ping_flood.addWidget(label_4, 6, 0)               
         preload = MySpinBox(current_value, DDOS_FLOODING, PING_CMD, "self.preload", groupbox_ping_flood)                    
         preload.setMinimum(0)
         preload.setMaximum(100)        
         preload.setSingleStep(1) 
         preload.setValue(current_value)
-        grid_groupbox_ping_flood.addWidget(preload, 6, 2, 1, 2)       
+        grid_groupbox_ping_flood.addWidget(preload, 6, 1)       
         
         button = QtGui.QPushButton('Start', self)
-        button.clicked.connect(lambda: self.startScenario(DDOS_FLOODING, PING_CMD))                     
-        grid_groupbox_ping_flood.addWidget(button, 7, 0, 1, 2)
+        button.clicked.connect(lambda: self.startScenario(DDOS_FLOODING, PING_CMD)) 
+        button.setSizePolicy(QtGui.QSizePolicy(button.sizeHint()))                           
+        grid_groupbox_ping_flood.addWidget(button, 7, 2)
         
         # --- HTTP Get Flood settings --- #
         http_get_flood.setGeometry(QtCore.QRect(0, 0, 660, 386))                
         groupbox_http_get.setTitle("HTTP GET attack parameters")
         hbox_http_get.addWidget(groupbox_http_get)        
         grid_groupbox_http_get = QtGui.QGridLayout()                        
+        grid_groupbox_http_get.setSpacing(10)
         hbox_groupbox_http_get = QtGui.QHBoxLayout(groupbox_http_get)
         hbox_groupbox_http_get.addLayout(grid_groupbox_http_get)
 
         current_value = searchAndGet(DDOS_FLOODING, HTTP_GET_CMD, "self.hostname")        
         label_3 = QtGui.QLabel(groupbox_http_get)
         label_3.setText("Hostname")        
-        grid_groupbox_http_get.addWidget(label_3, 0, 0, 1, 2)   
-        spacerItem3 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
-        grid_groupbox_http_get.addItem(spacerItem3, 0, 1, 1, 2)        
+        grid_groupbox_http_get.addWidget(label_3, 0, 0)           
         lineEdit_4 = MyLineEdit(current_value, DDOS_FLOODING, HTTP_GET_CMD, "self.hostname", groupbox_http_get)
         lineEdit_4.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignTrailing | QtCore.Qt.AlignVCenter)        
         lineEdit_4.setText(current_value)
-        grid_groupbox_http_get.addWidget(lineEdit_4, 0, 2, 1, 2)
+        grid_groupbox_http_get.addWidget(lineEdit_4, 0, 1)
          
         current_value = int(searchAndGet(DDOS_FLOODING, HTTP_GET_CMD, "self.port"))
         label_4 = QtGui.QLabel(groupbox_http_get)
         label_4.setText("Port")
-        grid_groupbox_http_get.addWidget(label_4, 1, 0, 1, 2)       
-        spacerItem4 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
-        grid_groupbox_http_get.addItem(spacerItem4, 1, 1, 1, 2)        
+        grid_groupbox_http_get.addWidget(label_4, 1, 0)               
         port = MySpinBox(current_value, DDOS_FLOODING, HTTP_GET_CMD, "self.port", groupbox_http_get)            
         port.setValue(current_value)
         port.setMinimum(0)
         port.setMaximum(99999)
         port.setSingleStep(1) 
-        grid_groupbox_http_get.addWidget(port, 1, 2, 1, 2)       
+        grid_groupbox_http_get.addWidget(port, 1, 1)       
         
         current_value = int(searchAndGet(DDOS_FLOODING, HTTP_GET_CMD, "self.num_requests"))        
         label_4 = QtGui.QLabel(groupbox_http_get)
         label_4.setText("Number of requests")
-        grid_groupbox_http_get.addWidget(label_4, 2, 0, 1, 2)       
-        spacerItem4 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
-        grid_groupbox_http_get.addItem(spacerItem4, 2, 1, 1, 2)        
+        grid_groupbox_http_get.addWidget(label_4, 2, 0)               
         num_requests = MySpinBox(current_value, DDOS_FLOODING, HTTP_GET_CMD, "self.num_requests", groupbox_http_get)                    
         num_requests.setMinimum(0)
         num_requests.setMaximum(99999999)        
         num_requests.setSingleStep(1)
         num_requests.setValue(current_value) 
-        grid_groupbox_http_get.addWidget(num_requests, 2, 2, 1, 2)       
+        grid_groupbox_http_get.addWidget(num_requests, 2, 1)       
         
         current_value = int(searchAndGet(DDOS_FLOODING, HTTP_GET_CMD, "self.num_threads"))
         label_4 = QtGui.QLabel(groupbox_http_get)
         label_4.setText("Number of threads")
-        grid_groupbox_http_get.addWidget(label_4, 3, 0, 1, 2)       
-        spacerItem4 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
-        grid_groupbox_http_get.addItem(spacerItem4, 3, 1, 1, 2)        
+        grid_groupbox_http_get.addWidget(label_4, 3, 0)        
         num_threads = MySpinBox(current_value, DDOS_FLOODING, HTTP_GET_CMD, "self.num_threads", groupbox_http_get)                    
         num_threads.setMinimum(0)
         num_threads.setMaximum(99999999)
         num_threads.setSingleStep(1) 
         num_threads.setValue(current_value)
-        grid_groupbox_http_get.addWidget(num_threads, 3, 2, 1, 2)       
+        grid_groupbox_http_get.addWidget(num_threads, 3, 1)       
         
         current_value = int(searchAndGet(DDOS_FLOODING, HTTP_GET_CMD, "self.speed"))
         label_4 = QtGui.QLabel(groupbox_http_get)
         label_4.setText("Speed")
-        grid_groupbox_http_get.addWidget(label_4, 4, 0, 1, 2)       
-        spacerItem4 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
-        grid_groupbox_http_get.addItem(spacerItem4, 4, 1, 1, 2)        
+        grid_groupbox_http_get.addWidget(label_4, 4, 0)               
         speed = MySpinBox(current_value, DDOS_FLOODING, HTTP_GET_CMD, "self.speed", groupbox_http_get)                    
         speed.setMinimum(0)
         speed.setMaximum(100)        
         speed.setSingleStep(1) 
         speed.setValue(current_value)
-        grid_groupbox_http_get.addWidget(speed, 4, 2, 1, 2)       
+        grid_groupbox_http_get.addWidget(speed, 4, 1)       
         
         button = QtGui.QPushButton('Start', self)
-        button.clicked.connect(lambda: self.startScenario(DDOS_FLOODING, HTTP_GET_CMD))                     
-        grid_groupbox_http_get.addWidget(button, 5, 0, 1, 2)
+        button.clicked.connect(lambda: self.startScenario(DDOS_FLOODING, HTTP_GET_CMD))  
+        button.setSizePolicy(QtGui.QSizePolicy(button.sizeHint()))                          
+        grid_groupbox_http_get.addWidget(button, 5, 2)
         
         # --- TCP Syn Flood settings --- #
         tcp_syn_flood.setGeometry(QtCore.QRect(0, 0, 660, 386))                
         groupbox_tcp_syn.setTitle("TCP Syn Flood attack parameters")
         hbox_tcp_syn.addWidget(groupbox_tcp_syn)        
         grid_groupbox_tcp_syn = QtGui.QGridLayout()                        
+        grid_groupbox_tcp_syn.setSpacing(10)
         hbox_groupbox_tcp_syn = QtGui.QHBoxLayout(groupbox_tcp_syn)
         hbox_groupbox_tcp_syn.addLayout(grid_groupbox_tcp_syn)
 
         current_value = searchAndGet(DDOS_FLOODING, TCP_SYN_CMD, "self.hostname")        
         label_3 = QtGui.QLabel(groupbox_tcp_syn)
         label_3.setText("Hostname")        
-        grid_groupbox_tcp_syn.addWidget(label_3, 0, 0, 1, 2)   
-        spacerItem3 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
-        grid_groupbox_tcp_syn.addItem(spacerItem3, 0, 1, 1, 2)        
+        grid_groupbox_tcp_syn.addWidget(label_3, 0, 0)           
         lineEdit_4 = MyLineEdit(current_value, DDOS_FLOODING, TCP_SYN_CMD, "self.hostname", groupbox_tcp_syn)
         lineEdit_4.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignTrailing | QtCore.Qt.AlignVCenter)        
         lineEdit_4.setText(current_value)
-        grid_groupbox_tcp_syn.addWidget(lineEdit_4, 0, 2, 1, 2)
+        grid_groupbox_tcp_syn.addWidget(lineEdit_4, 0, 1)
          
         current_value = int(searchAndGet(DDOS_FLOODING, TCP_SYN_CMD, "self.port"))
         label_4 = QtGui.QLabel(groupbox_tcp_syn)
         label_4.setText("Port")
-        grid_groupbox_tcp_syn.addWidget(label_4, 1, 0, 1, 2)       
-        spacerItem4 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
-        grid_groupbox_tcp_syn.addItem(spacerItem4, 1, 1, 1, 2)        
+        grid_groupbox_tcp_syn.addWidget(label_4, 1, 0)               
         port = MySpinBox(current_value, DDOS_FLOODING, TCP_SYN_CMD, "self.port", groupbox_tcp_syn)            
         port.setValue(current_value)
         port.setMinimum(0)
         port.setMaximum(99999)
         port.setSingleStep(1) 
-        grid_groupbox_tcp_syn.addWidget(port, 1, 2, 1, 2)       
+        grid_groupbox_tcp_syn.addWidget(port, 1, 1)       
         
         current_value = int(searchAndGet(DDOS_FLOODING, TCP_SYN_CMD, "self.num_packets"))        
         label_4 = QtGui.QLabel(groupbox_tcp_syn)
         label_4.setText("Number of packets")
-        grid_groupbox_tcp_syn.addWidget(label_4, 2, 0, 1, 2)       
-        spacerItem4 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
-        grid_groupbox_tcp_syn.addItem(spacerItem4, 2, 1, 1, 2)        
+        grid_groupbox_tcp_syn.addWidget(label_4, 2, 0)               
         num_requests = MySpinBox(current_value, DDOS_FLOODING, TCP_SYN_CMD, "self.num_packets", groupbox_tcp_syn)                    
         num_requests.setMinimum(0)
         num_requests.setMaximum(99999999)        
         num_requests.setSingleStep(1)
         num_requests.setValue(current_value) 
-        grid_groupbox_tcp_syn.addWidget(num_requests, 2, 2, 1, 2)       
+        grid_groupbox_tcp_syn.addWidget(num_requests, 2, 1)       
         
         current_value = int(searchAndGet(DDOS_FLOODING, TCP_SYN_CMD, "self.num_threads"))
         label_4 = QtGui.QLabel(groupbox_tcp_syn)
         label_4.setText("Number of threads")
-        grid_groupbox_tcp_syn.addWidget(label_4, 3, 0, 1, 2)       
-        spacerItem4 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
-        grid_groupbox_tcp_syn.addItem(spacerItem4, 3, 1, 1, 2)        
+        grid_groupbox_tcp_syn.addWidget(label_4, 3, 0)               
         num_threads = MySpinBox(current_value, DDOS_FLOODING, TCP_SYN_CMD, "self.num_threads", groupbox_tcp_syn)                    
         num_threads.setMinimum(0)
         num_threads.setMaximum(99999999)
         num_threads.setSingleStep(1) 
         num_threads.setValue(current_value)
-        grid_groupbox_tcp_syn.addWidget(num_threads, 3, 2, 1, 2)   
+        grid_groupbox_tcp_syn.addWidget(num_threads, 3, 1)   
         
         button = QtGui.QPushButton('Start', self)
-        button.clicked.connect(lambda: self.startScenario(DDOS_FLOODING, TCP_SYN_CMD))                     
-        grid_groupbox_tcp_syn.addWidget(button, 4, 0, 1, 2)
+        button.clicked.connect(lambda: self.startScenario(DDOS_FLOODING, TCP_SYN_CMD))  
+        button.setSizePolicy(QtGui.QSizePolicy(button.sizeHint()))                          
+        grid_groupbox_tcp_syn.addWidget(button, 4, 2)
         
-        self.setCentralWidget(tab_widget)
-
         # --- File Exfiltration scenario --- #
-        tab_file_exfiltration_layout = QtGui.QVBoxLayout(tab_file_exfiltration)     
-        tool_box_file_exfiltration = QtGui.QToolBox(tab_file_exfiltration)
+        tab_file_exfiltration_layout = QtGui.QVBoxLayout(self.tab_file_exfiltration)     
+        tool_box_file_exfiltration = QtGui.QToolBox(self.tab_file_exfiltration)
         tab_file_exfiltration_layout.addWidget(tool_box_file_exfiltration)     
 
         ftp = QtGui.QWidget()
         groupbox_ftp.setTitle("Parameters")
         hbox_ftp.addWidget(groupbox_ftp)        
         grid_groupbox_ftp = QtGui.QGridLayout()                        
+        grid_groupbox_ftp.setSpacing(10)
         hbox_groupbox_ftp = QtGui.QHBoxLayout(groupbox_ftp)
         hbox_groupbox_ftp.addLayout(grid_groupbox_ftp)
 
         current_value = searchAndGet(FILE_EXFILTRATION, FTP_CMD, "self.hostname")        
         label_3 = QtGui.QLabel(groupbox_ftp)
         label_3.setText("Hostname")        
-        grid_groupbox_ftp.addWidget(label_3, 0, 0, 1, 2)   
-        spacerItem3 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
-        grid_groupbox_ftp.addItem(spacerItem3, 0, 1, 1, 2)        
+        grid_groupbox_ftp.addWidget(label_3, 0, 0)           
         lineEdit_4 = MyLineEdit(current_value, FILE_EXFILTRATION, FTP_CMD, "self.hostname", groupbox_ftp)
         lineEdit_4.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignTrailing | QtCore.Qt.AlignVCenter)        
         lineEdit_4.setText(current_value)
-        grid_groupbox_ftp.addWidget(lineEdit_4, 0, 2, 1, 2)
+        grid_groupbox_ftp.addWidget(lineEdit_4, 0, 1)
         
         current_value = searchAndGet(FILE_EXFILTRATION, FTP_CMD, "self.user")        
         label_3 = QtGui.QLabel(groupbox_ftp)
         label_3.setText("User")        
-        grid_groupbox_ftp.addWidget(label_3, 1, 0, 1, 2)   
-        spacerItem3 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
-        grid_groupbox_ftp.addItem(spacerItem3, 1, 1, 1, 2)        
+        grid_groupbox_ftp.addWidget(label_3, 1, 0)           
         lineEdit_4 = MyLineEdit(current_value, FILE_EXFILTRATION, FTP_CMD, "self.user", groupbox_ftp)
         lineEdit_4.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignTrailing | QtCore.Qt.AlignVCenter)        
         lineEdit_4.setText(current_value)
-        grid_groupbox_ftp.addWidget(lineEdit_4, 1, 2, 1, 2)
+        grid_groupbox_ftp.addWidget(lineEdit_4, 1, 1)
         
         current_value = searchAndGet(FILE_EXFILTRATION, FTP_CMD, "self.password")        
         label_3 = QtGui.QLabel(groupbox_ftp)
         label_3.setText("Password")        
-        grid_groupbox_ftp.addWidget(label_3, 2, 0, 1, 2)   
-        spacerItem3 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
-        grid_groupbox_ftp.addItem(spacerItem3, 2, 1, 1, 2)        
+        grid_groupbox_ftp.addWidget(label_3, 2, 0)           
         lineEdit_4 = MyLineEdit(current_value, FILE_EXFILTRATION, FTP_CMD, "self.password", groupbox_ftp)
         lineEdit_4.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignTrailing | QtCore.Qt.AlignVCenter)        
         lineEdit_4.setText(current_value)
-        grid_groupbox_ftp.addWidget(lineEdit_4, 2, 2, 1, 2)
+        grid_groupbox_ftp.addWidget(lineEdit_4, 2, 1)
         
         button = QtGui.QPushButton('Start', self)
-        button.clicked.connect(lambda: self.startScenario(FILE_EXFILTRATION, FTP_CMD))                     
-        grid_groupbox_ftp.addWidget(button, 3, 0, 1, 2)
+        button.clicked.connect(lambda: self.startScenario(FILE_EXFILTRATION, FTP_CMD)) 
+        button.setSizePolicy(QtGui.QSizePolicy(button.sizeHint()))                           
+        grid_groupbox_ftp.addWidget(button, 3, 2)
         
         # --- File Filter Command settings --- #
         file_filter.setGeometry(QtCore.QRect(0, 0, 660, 386))                
         groupbox_file_filter.setTitle("Parameters")
         hbox_file_filter.addWidget(groupbox_file_filter)        
         grid_groupbox_file_filter = QtGui.QGridLayout()                        
+        grid_groupbox_file_filter.setSpacing(10)
         hbox_groupbox_file_filter = QtGui.QHBoxLayout(groupbox_file_filter)
         hbox_groupbox_file_filter.addLayout(grid_groupbox_file_filter)
 
         current_value = searchAndGet(FILE_EXFILTRATION, FILE_FILTER_CMD, "self.suffix")        
         label_3 = QtGui.QLabel(groupbox_file_filter)
         label_3.setText("Suffix")        
-        grid_groupbox_file_filter.addWidget(label_3, 0, 0, 1, 2)   
-        spacerItem3 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
-        grid_groupbox_file_filter.addItem(spacerItem3, 0, 1, 1, 2)        
+        grid_groupbox_file_filter.addWidget(label_3, 0, 0)        
         lineEdit_4 = MyLineEdit(current_value, FILE_EXFILTRATION, FILE_FILTER_CMD, "self.suffix", groupbox_file_filter)
         lineEdit_4.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignTrailing | QtCore.Qt.AlignVCenter)        
         lineEdit_4.setText(current_value)
-        grid_groupbox_file_filter.addWidget(lineEdit_4, 0, 2, 1, 2)
+        grid_groupbox_file_filter.addWidget(lineEdit_4, 0, 1)
         
         current_value = searchAndGet(FILE_EXFILTRATION, FILE_FILTER_CMD, "self.pattern")        
         label_3 = QtGui.QLabel(groupbox_file_filter)
         label_3.setText("Pattern")        
-        grid_groupbox_file_filter.addWidget(label_3, 1, 0, 1, 2)   
-        spacerItem3 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
-        grid_groupbox_file_filter.addItem(spacerItem3, 1, 1, 1, 2)        
+        grid_groupbox_file_filter.addWidget(label_3, 1, 0)           
         lineEdit_4 = MyLineEdit(current_value, FILE_EXFILTRATION, FILE_FILTER_CMD, "self.pattern", groupbox_file_filter)
         lineEdit_4.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignTrailing | QtCore.Qt.AlignVCenter)        
         lineEdit_4.setText(current_value)
-        grid_groupbox_file_filter.addWidget(lineEdit_4, 1, 2, 1, 2)
+        grid_groupbox_file_filter.addWidget(lineEdit_4, 1, 1)
         
         current_value = searchAndGet(FILE_EXFILTRATION, FILE_FILTER_CMD, "self.directory")        
         label_3 = QtGui.QLabel(groupbox_file_filter)
         label_3.setText("Directory")        
-        grid_groupbox_file_filter.addWidget(label_3, 2, 0, 1, 2)   
-        spacerItem3 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
-        grid_groupbox_file_filter.addItem(spacerItem3, 2, 1, 1, 2)        
+        grid_groupbox_file_filter.addWidget(label_3, 2, 0)           
         lineEdit_4 = MyLineEdit(current_value, FILE_EXFILTRATION, FILE_FILTER_CMD, "self.directory", groupbox_file_filter)
         lineEdit_4.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignTrailing | QtCore.Qt.AlignVCenter)        
         lineEdit_4.setText(current_value)
-        grid_groupbox_file_filter.addWidget(lineEdit_4, 2, 2, 1, 2)
+        grid_groupbox_file_filter.addWidget(lineEdit_4, 2, 1)
         
         button = QtGui.QPushButton('Start', self)
         button.clicked.connect(lambda: self.startScenario(FILE_EXFILTRATION, FTP_CMD))                     
-        grid_groupbox_file_filter.addWidget(button, 3, 0, 1, 2)
+        button.setSizePolicy(QtGui.QSizePolicy(button.sizeHint()))       
+        grid_groupbox_file_filter.addWidget(button, 3, 2)
         
         # --- Keylogger scenario --- #
-        tab_keylogger.setGeometry(QtCore.QRect(0, 0, 660, 386))                
-        hbox_keylogger = QtGui.QHBoxLayout(tab_keylogger)        
+        self.tab_keylogger.setGeometry(QtCore.QRect(0, 0, 660, 386))                
+        hbox_keylogger = QtGui.QHBoxLayout(self.tab_keylogger)        
         groupbox_keylogger = QtGui.QGroupBox()      
         groupbox_keylogger.setTitle("Parameters")
         hbox_keylogger.addWidget(groupbox_keylogger)        
-        grid_groupbox_keylogger = QtGui.QGridLayout()                        
+        grid_groupbox_keylogger = QtGui.QGridLayout()
+        grid_groupbox_keylogger.setSpacing(10)
         hbox_groupbox_keylogger = QtGui.QHBoxLayout(groupbox_keylogger)
         hbox_groupbox_keylogger.addLayout(grid_groupbox_keylogger)               
         
         current_value = int(searchAndGet(KEYLOGGER, KEYLOG_CMD, "self.duration"))
         label_4 = QtGui.QLabel(groupbox_keylogger)
         label_4.setText("Duration")
-        grid_groupbox_keylogger.addWidget(label_4, 0, 0, 1, 2)       
-        spacerItem4 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
-        grid_groupbox_keylogger.addItem(spacerItem4, 0, 1, 1, 2)        
+        grid_groupbox_keylogger.addWidget(label_4, 0, 0)        
         duration = MySpinBox(current_value, KEYLOGGER, KEYLOG_CMD, "self.duration", groupbox_keylogger)                    
         duration.setMinimum(0)
         duration.setMaximum(100)        
         duration.setSingleStep(1) 
         duration.setValue(current_value)
-        grid_groupbox_keylogger.addWidget(duration, 0, 2, 1, 2)       
+        grid_groupbox_keylogger.addWidget(duration, 0, 1)       
         
         button = QtGui.QPushButton('Start', self)
         button.clicked.connect(lambda: self.startScenario(KEYLOGGER, KEYLOG_CMD))                     
-        grid_groupbox_keylogger.addWidget(button, 1, 0, 1, 2)
+        button.setSizePolicy(QtGui.QSizePolicy(button.sizeHint()))       
+        grid_groupbox_keylogger.addWidget(button, 1, 2)
         
         # --- Spamming scenario --- #
-        tab_spamming.setGeometry(QtCore.QRect(0, 0, 660, 386))                        
-        hbox_spamming = QtGui.QHBoxLayout(tab_spamming)        
+        self.tab_spamming.setGeometry(QtCore.QRect(0, 0, 660, 386))                        
+        hbox_spamming = QtGui.QHBoxLayout(self.tab_spamming)        
         groupbox_spamming = QtGui.QGroupBox()      
         groupbox_spamming.setTitle("Parameters")
         hbox_spamming.addWidget(groupbox_spamming)        
-        grid_groupbox_spamming = QtGui.QGridLayout()                        
+        grid_groupbox_spamming = QtGui.QGridLayout()
+        grid_groupbox_spamming.setSpacing(10)
         hbox_groupbox_spamming = QtGui.QHBoxLayout(groupbox_spamming)
         hbox_groupbox_spamming.addLayout(grid_groupbox_spamming)               
         
         current_value = searchAndGet(SPAMMING, CRAWL_CMD, "self.start_url")        
         label_3 = QtGui.QLabel(groupbox_spamming)
         label_3.setText("Start url")        
-        grid_groupbox_spamming.addWidget(label_3, 0, 0, 1, 2)   
-        spacerItem3 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
-        grid_groupbox_spamming.addItem(spacerItem3, 0, 1, 1, 2)        
+        grid_groupbox_spamming.addWidget(label_3, 0, 0)        
         lineEdit_4 = MyLineEdit(current_value, SPAMMING, CRAWL_CMD, "self.start_url", groupbox_spamming)
         lineEdit_4.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignTrailing | QtCore.Qt.AlignVCenter)        
         lineEdit_4.setText(current_value)
-        grid_groupbox_spamming.addWidget(lineEdit_4, 0, 2, 1, 2)
+        grid_groupbox_spamming.addWidget(lineEdit_4, 0, 1)
         
         current_value = searchAndGet(SPAMMING, CRAWL_CMD, "self.subject")        
         label_3 = QtGui.QLabel(groupbox_spamming)
         label_3.setText("Subject")        
-        grid_groupbox_spamming.addWidget(label_3, 1, 0, 1, 2)   
-        spacerItem3 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
-        grid_groupbox_spamming.addItem(spacerItem3, 1, 1, 1, 2)        
+        grid_groupbox_spamming.addWidget(label_3, 1, 0)           
         lineEdit_4 = MyLineEdit(current_value, SPAMMING, CRAWL_CMD, "self.subject", groupbox_spamming)
         lineEdit_4.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignTrailing | QtCore.Qt.AlignVCenter)        
         lineEdit_4.setText(current_value)
-        grid_groupbox_spamming.addWidget(lineEdit_4, 1, 2, 1, 2)
+        grid_groupbox_spamming.addWidget(lineEdit_4, 1, 1)
         
         current_value = searchAndGet(SPAMMING, CRAWL_CMD, "self.content")        
         label_3 = QtGui.QLabel(groupbox_spamming)
         label_3.setText("Content")        
-        grid_groupbox_spamming.addWidget(label_3, 2, 0, 1, 2)   
-        spacerItem3 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
-        grid_groupbox_spamming.addItem(spacerItem3, 2, 1, 1, 2)        
+        grid_groupbox_spamming.addWidget(label_3, 2, 0)        
         lineEdit_4 = MyLineEdit(current_value, SPAMMING, CRAWL_CMD, "self.content", groupbox_spamming)
         lineEdit_4.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignTrailing | QtCore.Qt.AlignVCenter)        
         lineEdit_4.setText(current_value)
-        grid_groupbox_spamming.addWidget(lineEdit_4, 2, 2, 1, 2)
+        grid_groupbox_spamming.addWidget(lineEdit_4, 2, 1)
         
         current_value = searchAndGet(SPAMMING, CRAWL_CMD, "self.max_iterations")        
         label_3 = QtGui.QLabel(groupbox_spamming)
         label_3.setText("Maximum iterations")        
-        grid_groupbox_spamming.addWidget(label_3, 3, 0, 1, 2)   
-        spacerItem3 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
-        grid_groupbox_spamming.addItem(spacerItem3, 3, 1, 1, 2)        
+        grid_groupbox_spamming.addWidget(label_3, 3, 0)           
         max_iterations = MySpinBox(current_value, SPAMMING, CRAWL_CMD, "self.max_iterations", groupbox_spamming)            
         max_iterations.setValue(0)
         max_iterations.setMinimum(0)
         max_iterations.setMaximum(9999)
         max_iterations.setSingleStep(1)
-        grid_groupbox_spamming.addWidget(max_iterations, 3, 2, 1, 2)
+        grid_groupbox_spamming.addWidget(max_iterations, 3, 1)
         
         current_value = searchAndGet(SPAMMING, CRAWL_CMD, "self.gmail_user")        
         label_3 = QtGui.QLabel(groupbox_spamming)
         label_3.setText("Gmail username")        
-        grid_groupbox_spamming.addWidget(label_3, 4, 0, 1, 2)   
-        spacerItem3 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
-        grid_groupbox_spamming.addItem(spacerItem3, 4, 1, 1, 2)        
+        grid_groupbox_spamming.addWidget(label_3, 4, 0)           
         lineEdit_4 = MyLineEdit(current_value, SPAMMING, CRAWL_CMD, "self.gmail_user", groupbox_spamming)
         lineEdit_4.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignTrailing | QtCore.Qt.AlignVCenter)        
         lineEdit_4.setText(current_value)
-        grid_groupbox_spamming.addWidget(lineEdit_4, 4, 2, 1, 2)
+        grid_groupbox_spamming.addWidget(lineEdit_4, 4, 1)
         
         current_value = searchAndGet(SPAMMING, CRAWL_CMD, "self.gmail_pwd")        
         label_3 = QtGui.QLabel(groupbox_spamming)
         label_3.setText("Gmail password")        
-        grid_groupbox_spamming.addWidget(label_3, 5, 0, 1, 2)   
-        spacerItem3 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
-        grid_groupbox_spamming.addItem(spacerItem3, 5, 1, 1, 2)        
+        grid_groupbox_spamming.addWidget(label_3, 5, 0)           
         lineEdit_4 = MyLineEdit(current_value, SPAMMING, CRAWL_CMD, "self.gmail_pwd", groupbox_spamming)
         lineEdit_4.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignTrailing | QtCore.Qt.AlignVCenter)        
         lineEdit_4.setText(current_value)
-        grid_groupbox_spamming.addWidget(lineEdit_4, 5, 2, 1, 2)
+        grid_groupbox_spamming.addWidget(lineEdit_4, 5, 1)
         
         button = QtGui.QPushButton('Start', self)
         button.clicked.connect(lambda: self.startScenario(SPAMMING, CRAWL_CMD))                     
-        grid_groupbox_spamming.addWidget(button, 6, 0, 1, 2)
+        button.setSizePolicy(QtGui.QSizePolicy(button.sizeHint()))       
+        grid_groupbox_spamming.addWidget(button, 6, 2)
         
         # --- Common settings --- #
         tab_common_layout = QtGui.QVBoxLayout(tab_common)     
         mode.setGeometry(QtCore.QRect(0, 0, 660, 386))
         self.vbox_mode = QtGui.QVBoxLayout(mode)
 
-        # --- Mode groupbox --- #
+        # --- Scenario settings groupbox --- #
+        groupbox_scenario = QtGui.QGroupBox()      
+        groupbox_scenario.setTitle("Scenario settings")
+        self.vbox_mode.addWidget(groupbox_scenario)        
+        grid_groupbox_scenario = QtGui.QGridLayout()
+        hbox_groupbox_scenario = QtGui.QHBoxLayout(groupbox_scenario)
+        hbox_groupbox_scenario.addLayout(grid_groupbox_scenario)        
+        label = QtGui.QLabel(groupbox_scenario)    
+        label.setText("Scenario")    
+        grid_groupbox_scenario.addWidget(label, 0, 0, 1, 1)        
+        spacerItem = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
+        grid_groupbox_scenario.addItem(spacerItem, 0, 1, 1, 1)        
+        self.scenario = QtGui.QComboBox(groupbox_scenario)            
+        self.scenario.addItem("Select a scenario")
+        self.scenario.addItem(DDOS_FLOODING)
+        self.scenario.addItem(FILE_EXFILTRATION)
+        self.scenario.addItem(KEYLOGGER)
+        self.scenario.addItem(SPAMMING)
+        self.scenario.activated['QString'].connect(self.scenarioSelected)        
+        grid_groupbox_scenario.addWidget(self.scenario, 0, 0, 1, 2)
+        
+        # --- Simulation Implementation groupbox --- #
+        groupbox_implementation = QtGui.QGroupBox()      
+        groupbox_implementation.setTitle("Simulation Implementation")
+        self.vbox_mode.addWidget(groupbox_implementation)        
+        grid_groupbox_implementation = QtGui.QGridLayout()
+        hbox_groupbox_implementation = QtGui.QHBoxLayout(groupbox_implementation)
+        hbox_groupbox_implementation.addLayout(grid_groupbox_implementation)        
+        label = QtGui.QLabel(groupbox_implementation)    
+        label.setText("implementation")    
+        grid_groupbox_implementation.addWidget(label, 0, 0, 1, 1)        
+        spacerItem = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
+        grid_groupbox_implementation.addItem(spacerItem, 0, 1, 1, 1)        
+        self.implementation = QtGui.QComboBox(groupbox_implementation)                    
+        self.implementation.addItem("Default")
+        self.implementation.addItem("Visual")         
+        grid_groupbox_implementation.addWidget(self.implementation, 0, 0, 1, 2)
+        
+        # --- Mode settings groupbox --- #
         groupbox_mode = QtGui.QGroupBox()      
         groupbox_mode.setTitle("Mode settings")
         self.vbox_mode.addWidget(groupbox_mode)        
         self.mode.addItem(NETNS3)
         self.mode.addItem(PURE_SIM)        
         self.mode.activated['QString'].connect(self.modeSelected)        
-        grid_groupbox_mode.addWidget(self.mode, 0, 0, 1, 2)        
-
+        grid_groupbox_mode.addWidget(self.mode, 0, 0, 1, 2)
+                        
         # --- Emulation Settings --- #
         self.groupbox_emulation = QtGui.QGroupBox()      
         self.groupbox_emulation.setTitle("Emulation settings")
         self.groupbox_complex_network = QtGui.QGroupBox()      
         self.groupbox_complex_network.setTitle("Complex Network Experiment parameters")
         self.vbox_mode.addWidget(self.groupbox_complex_network)        
-        grid_groupbox_complex_network = QtGui.QGridLayout()                        
+        grid_groupbox_complex_network = QtGui.QGridLayout()   
+        grid_groupbox_complex_network.setSpacing(10)                     
         hbox_groupbox_complex_network = QtGui.QHBoxLayout(self.groupbox_complex_network)
         hbox_groupbox_complex_network.addLayout(grid_groupbox_complex_network)
 
         label_1 = QtGui.QLabel(self.groupbox_complex_network)
         label_1.setText("Background Traffic file location")
-        grid_groupbox_complex_network.addWidget(label_1, 0, 0, 1, 2)        
-        spacerItem1 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
-        grid_groupbox_complex_network.addItem(spacerItem1, 0, 1, 1, 2)        
+        grid_groupbox_complex_network.addWidget(label_1, 0, 0)        
         self.complex_backtraf_location = QtGui.QLineEdit(self.groupbox_complex_network)
         self.complex_backtraf_location.setAlignment(QtCore.Qt.AlignLeft | QtCore.Qt.AlignTrailing | QtCore.Qt.AlignVCenter)
         self.complex_backtraf_location.setText("net_config/back_traf.py") 
         self.complex_backtraf_location.setMinimumWidth(360)       
-        grid_groupbox_complex_network.addWidget(self.complex_backtraf_location, 0, 2, 1, 2)
-        spacerItem2 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
-        grid_groupbox_complex_network.addItem(spacerItem2, 0, 3, 1, 2)
+        grid_groupbox_complex_network.addWidget(self.complex_backtraf_location, 0, 1)                
         button = QtGui.QPushButton('Select File', self)
         button.clicked.connect(lambda: self.showFileDialogBackTraf(COMPLEX))       
         button.setSizePolicy(QtGui.QSizePolicy(20, 5))       
-        grid_groupbox_complex_network.addWidget(button, 0, 4, 1, 2)
-
+        grid_groupbox_complex_network.addWidget(button, 0, 2)
+    
         label_2 = QtGui.QLabel(self.groupbox_complex_network)
         label_2.setText("Dot file location")
-        grid_groupbox_complex_network.addWidget(label_2, 1, 0, 1, 2)        
-        spacerItem3 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
-        grid_groupbox_complex_network.addItem(spacerItem3, 1, 1, 1, 2)        
+        grid_groupbox_complex_network.addWidget(label_2, 1, 0)       
         self.complex_dot_file_location = QtGui.QLineEdit(self.groupbox_complex_network)
         self.complex_dot_file_location.setAlignment(QtCore.Qt.AlignLeft | QtCore.Qt.AlignTrailing | QtCore.Qt.AlignVCenter)
         self.complex_dot_file_location.setText("net_config/ManualTopoBTConf.dot")        
-        grid_groupbox_complex_network.addWidget(self.complex_dot_file_location, 1, 2, 1, 2)
-        spacerItem4 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
-        grid_groupbox_complex_network.addItem(spacerItem4, 1, 3, 1, 2)
+        grid_groupbox_complex_network.addWidget(self.complex_dot_file_location, 1, 1)                
         button = QtGui.QPushButton('Select File', self)
         button.clicked.connect(lambda: self.showFileDialogDotFile(COMPLEX))       
         button.setSizePolicy(QtGui.QSizePolicy(20, 5))       
-        grid_groupbox_complex_network.addWidget(button, 1, 4, 1, 2)
-
+        grid_groupbox_complex_network.addWidget(button, 1, 2)
+        
         label_3 = QtGui.QLabel(self.groupbox_complex_network)
         label_3.setText("Net Settings file location")
-        grid_groupbox_complex_network.addWidget(label_3, 2, 0, 1, 2)        
-        spacerItem5 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
-        grid_groupbox_complex_network.addItem(spacerItem5, 2, 1, 1, 2)        
+        grid_groupbox_complex_network.addWidget(label_3, 2, 0)                
         self.complex_net_settings_location = QtGui.QLineEdit(self.groupbox_complex_network)
         self.complex_net_settings_location.setAlignment(QtCore.Qt.AlignLeft | QtCore.Qt.AlignTrailing | QtCore.Qt.AlignVCenter)
         self.complex_net_settings_location.setText("net_config/aro_demo/nf_net_settings.py")               
-        grid_groupbox_complex_network.addWidget(self.complex_net_settings_location, 2, 2, 1, 2)
-        spacerItem6 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
-        grid_groupbox_complex_network.addItem(spacerItem6, 2, 3, 1, 2)
+        grid_groupbox_complex_network.addWidget(self.complex_net_settings_location, 2, 1)        
         button = QtGui.QPushButton('Select File', self)
         button.clicked.connect(lambda: self.showFileDialogNetSettings(COMPLEX))       
         button.setSizePolicy(QtGui.QSizePolicy(20, 5))       
-        grid_groupbox_complex_network.addWidget(button, 2, 4, 1, 2)
-
+        grid_groupbox_complex_network.addWidget(button, 2, 2)        
+        button1 = QtGui.QPushButton('From TopologyEditor', self)
+        button1.clicked.connect(lambda: self.useTopologyEditorNetSettings(COMPLEX))       
+        button1.setSizePolicy(QtGui.QSizePolicy(20, 5))       
+        grid_groupbox_complex_network.addWidget(button1, 2, 3)
+        
+        
         label_4 = QtGui.QLabel(self.groupbox_complex_network)
         label_4.setText("Topology file location")
-        grid_groupbox_complex_network.addWidget(label_4, 3, 0, 1, 2)        
-        spacerItem7 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
-        grid_groupbox_complex_network.addItem(spacerItem7, 3, 1, 1, 2)        
+        grid_groupbox_complex_network.addWidget(label_4, 3, 0)                
         self.complex_topo_file_location = QtGui.QLineEdit(self.groupbox_complex_network)
         self.complex_topo_file_location.setAlignment(QtCore.Qt.AlignLeft | QtCore.Qt.AlignTrailing | QtCore.Qt.AlignVCenter)
         self.complex_topo_file_location.setText("net_config/Inet_small_toposample.txt")        
-        grid_groupbox_complex_network.addWidget(self.complex_topo_file_location, 3, 2, 1, 2)
-        spacerItem8 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
-        grid_groupbox_complex_network.addItem(spacerItem8, 3, 3, 1, 2)
+        grid_groupbox_complex_network.addWidget(self.complex_topo_file_location, 3, 1)        
         button = QtGui.QPushButton('Select File', self)
         button.clicked.connect(lambda: self.showFileDialogTopoFile(COMPLEX))       
         button.setSizePolicy(QtGui.QSizePolicy(20, 5))       
-        grid_groupbox_complex_network.addWidget(button, 3, 4, 1, 2)
-
+        grid_groupbox_complex_network.addWidget(button, 3, 2)        
+        button1 = QtGui.QPushButton('From TopologyEditor', self)
+        button1.clicked.connect(lambda: self.useTopologyEditorTopology(COMPLEX))       
+        button1.setSizePolicy(QtGui.QSizePolicy(20, 5))       
+        grid_groupbox_complex_network.addWidget(button1, 3, 3)
+        
         label_5 = QtGui.QLabel(self.groupbox_emulation)
         label_5.setText("Simulation duration")
-        grid_groupbox_complex_network.addWidget(label_5, 4, 0, 1, 2)        
-        spacerItem9 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
-        grid_groupbox_complex_network.addItem(spacerItem9, 4, 1, 1, 2)        
+        grid_groupbox_complex_network.addWidget(label_5, 4, 0)                
         self.complex_duration = QtGui.QSpinBox(self.groupbox_emulation)            
         self.complex_duration.setValue(0)
         self.complex_duration.setMinimum(0)
         self.complex_duration.setMaximum(3600)
         self.complex_duration.setSingleStep(1)        
-        grid_groupbox_complex_network.addWidget(self.complex_duration, 4, 2, 1, 2)
-
+        grid_groupbox_complex_network.addWidget(self.complex_duration, 4, 1)        
+        
         # --- Manual Topology Background Traffic Experiment Settings --- #
         self.groupbox_manual_topo_bt = QtGui.QGroupBox()      
         self.groupbox_manual_topo_bt.setTitle("Manual Topology Background Traffic Experiment parameters")
         self.vbox_mode.addWidget(self.groupbox_manual_topo_bt)        
         grid_groupbox_manual_topo_bt = QtGui.QGridLayout()                        
+        grid_groupbox_manual_topo_bt.setSpacing(10)
         hbox_groupbox_manual_topo_bt = QtGui.QHBoxLayout(self.groupbox_manual_topo_bt)
         hbox_groupbox_manual_topo_bt.addLayout(grid_groupbox_manual_topo_bt)
 
         label_1 = QtGui.QLabel(self.groupbox_manual_topo_bt)
         label_1.setText("Background Traffic file location")
-        grid_groupbox_manual_topo_bt.addWidget(label_1, 0, 0, 1, 2)        
-        spacerItem1 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
-        grid_groupbox_manual_topo_bt.addItem(spacerItem1, 0, 1, 1, 2)        
+        grid_groupbox_manual_topo_bt.addWidget(label_1, 0, 0)
         self.manual_bt_back_traf_location = QtGui.QLineEdit(self.groupbox_manual_topo_bt)
         self.manual_bt_back_traf_location.setAlignment(QtCore.Qt.AlignLeft | QtCore.Qt.AlignTrailing | QtCore.Qt.AlignVCenter)
         self.manual_bt_back_traf_location.setText("net_config/back_traf.py") 
         self.manual_bt_back_traf_location.setMinimumWidth(360)       
-        grid_groupbox_manual_topo_bt.addWidget(self.manual_bt_back_traf_location, 0, 2, 1, 2)
-        spacerItem2 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
-        grid_groupbox_manual_topo_bt.addItem(spacerItem2, 0, 3, 1, 2)
+        grid_groupbox_manual_topo_bt.addWidget(self.manual_bt_back_traf_location, 0, 1)        
         button = QtGui.QPushButton('Select File', self)
         button.clicked.connect(lambda: self.showFileDialogBackTraf(MANUAL_TOPO_BT))       
         button.setSizePolicy(QtGui.QSizePolicy(20, 5))       
-        grid_groupbox_manual_topo_bt.addWidget(button, 0, 4, 1, 2)
+        grid_groupbox_manual_topo_bt.addWidget(button, 0, 2)
 
         label_2 = QtGui.QLabel(self.groupbox_manual_topo_bt)
         label_2.setText("Dot file location")
-        grid_groupbox_manual_topo_bt.addWidget(label_2, 1, 0, 1, 2)        
-        spacerItem3 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
-        grid_groupbox_manual_topo_bt.addItem(spacerItem3, 1, 1, 1, 2)        
+        grid_groupbox_manual_topo_bt.addWidget(label_2, 1, 0)
         self.manual_bt_dot_file_location = QtGui.QLineEdit(self.groupbox_manual_topo_bt)
         self.manual_bt_dot_file_location.setAlignment(QtCore.Qt.AlignLeft | QtCore.Qt.AlignTrailing | QtCore.Qt.AlignVCenter)
         self.manual_bt_dot_file_location.setText("net_config/ManualTopoBTConf.dot")        
-        grid_groupbox_manual_topo_bt.addWidget(self.manual_bt_dot_file_location, 1, 2, 1, 2)
-        spacerItem4 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
-        grid_groupbox_manual_topo_bt.addItem(spacerItem4, 1, 3, 1, 2)
+        grid_groupbox_manual_topo_bt.addWidget(self.manual_bt_dot_file_location, 1, 1)        
         button = QtGui.QPushButton('Select File', self)
         button.clicked.connect(lambda: self.showFileDialogDotFile(MANUAL_TOPO_BT))       
         button.setSizePolicy(QtGui.QSizePolicy(20, 5))       
-        grid_groupbox_manual_topo_bt.addWidget(button, 1, 4, 1, 2)
+        grid_groupbox_manual_topo_bt.addWidget(button, 1, 2)
 
         label_3 = QtGui.QLabel(self.groupbox_manual_topo_bt)
         label_3.setText("Net Settings file location")
-        grid_groupbox_manual_topo_bt.addWidget(label_3, 2, 0, 1, 2)        
-        spacerItem5 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
-        grid_groupbox_manual_topo_bt.addItem(spacerItem5, 2, 1, 1, 2)        
+        grid_groupbox_manual_topo_bt.addWidget(label_3, 2, 0)                
         self.manual_bt_net_settings_location = QtGui.QLineEdit(self.groupbox_manual_topo_bt)
         self.manual_bt_net_settings_location.setAlignment(QtCore.Qt.AlignLeft | QtCore.Qt.AlignTrailing | QtCore.Qt.AlignVCenter)
         self.manual_bt_net_settings_location.setText("net_config/net_settings.py")               
-        grid_groupbox_manual_topo_bt.addWidget(self.manual_bt_net_settings_location, 2, 2, 1, 2)
-        spacerItem6 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
-        grid_groupbox_manual_topo_bt.addItem(spacerItem6, 2, 3, 1, 2)
+        grid_groupbox_manual_topo_bt.addWidget(self.manual_bt_net_settings_location, 2, 1)        
         button = QtGui.QPushButton('Select File', self)
         button.clicked.connect(lambda: self.showFileDialogNetSettings(MANUAL_TOPO_BT))       
         button.setSizePolicy(QtGui.QSizePolicy(20, 5))       
-        grid_groupbox_manual_topo_bt.addWidget(button, 2, 4, 1, 2)
+        grid_groupbox_manual_topo_bt.addWidget(button, 2, 2)
+        button1 = QtGui.QPushButton('From TopologyEditor', self)
+        button1.clicked.connect(lambda: self.useTopologyEditorNetSettings(MANUAL_TOPO_BT))       
+        button1.setSizePolicy(QtGui.QSizePolicy(20, 5))       
+        grid_groupbox_manual_topo_bt.addWidget(button1, 2, 3)
 
         label_4 = QtGui.QLabel(self.groupbox_manual_topo_bt)
         label_4.setText("Topology file location")
-        grid_groupbox_manual_topo_bt.addWidget(label_4, 3, 0, 1, 2)        
-        spacerItem7 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
-        grid_groupbox_manual_topo_bt.addItem(spacerItem7, 3, 1, 1, 2)        
+        grid_groupbox_manual_topo_bt.addWidget(label_4, 3, 0)        
         self.manual_bt_topo_file_location = QtGui.QLineEdit(self.groupbox_manual_topo_bt)
         self.manual_bt_topo_file_location.setAlignment(QtCore.Qt.AlignLeft | QtCore.Qt.AlignTrailing | QtCore.Qt.AlignVCenter)
         self.manual_bt_topo_file_location.setText("net_config/Inet_small_toposample.txt")        
-        grid_groupbox_manual_topo_bt.addWidget(self.manual_bt_topo_file_location, 3, 2, 1, 2)
-        spacerItem8 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
-        grid_groupbox_manual_topo_bt.addItem(spacerItem8, 3, 3, 1, 2)
+        grid_groupbox_manual_topo_bt.addWidget(self.manual_bt_topo_file_location, 3, 1)        
         button = QtGui.QPushButton('Select File', self)
         button.clicked.connect(lambda: self.showFileDialogTopoFile(MANUAL_TOPO_BT))       
         button.setSizePolicy(QtGui.QSizePolicy(20, 5))       
-        grid_groupbox_manual_topo_bt.addWidget(button, 3, 4, 1, 2)
+        grid_groupbox_manual_topo_bt.addWidget(button, 3, 2)
+        button1 = QtGui.QPushButton('From TopologyEditor', self)
+        button1.clicked.connect(lambda: self.useTopologyEditorTopology(MANUAL_TOPO_BT))       
+        button1.setSizePolicy(QtGui.QSizePolicy(20, 5))       
+        grid_groupbox_manual_topo_bt.addWidget(button1, 3, 3)
 
         label_5 = QtGui.QLabel(self.groupbox_emulation)
         label_5.setText("Simulation duration")
-        grid_groupbox_manual_topo_bt.addWidget(label_5, 4, 0, 1, 2)        
-        spacerItem9 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
-        grid_groupbox_manual_topo_bt.addItem(spacerItem9, 4, 1, 1, 2)        
+        grid_groupbox_manual_topo_bt.addWidget(label_5, 4, 0)                
         self.manual_bt_duration = QtGui.QSpinBox(self.groupbox_emulation)            
         self.manual_bt_duration.setValue(0)
         self.manual_bt_duration.setMinimum(0)
         self.manual_bt_duration.setMaximum(3600)
         self.manual_bt_duration.setSingleStep(1)
-        grid_groupbox_manual_topo_bt.addWidget(self.manual_bt_duration, 4, 2, 1, 2)
+        grid_groupbox_manual_topo_bt.addWidget(self.manual_bt_duration, 4, 1)
 
         # --- Manual Topology Experiment Settings --- #
         self.groupbox_manual_topo = QtGui.QGroupBox()      
         self.groupbox_manual_topo.setTitle("Manual Topology Experiment parameters")
         self.vbox_mode.addWidget(self.groupbox_manual_topo)        
-        grid_groupbox_manual_topo = QtGui.QGridLayout()                        
+        grid_groupbox_manual_topo = QtGui.QGridLayout()   
+        grid_groupbox_manual_topo.setSpacing(10)                     
         hbox_groupbox_manual_topo = QtGui.QHBoxLayout(self.groupbox_manual_topo)
         hbox_groupbox_manual_topo.addLayout(grid_groupbox_manual_topo)
 
         label_1 = QtGui.QLabel(self.groupbox_manual_topo)
         label_1.setText("Net Settings file location")
-        grid_groupbox_manual_topo.addWidget(label_1, 0, 0, 1, 2)        
-        spacerItem5 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
-        grid_groupbox_manual_topo.addItem(spacerItem5, 0, 1, 1, 2)        
+        grid_groupbox_manual_topo.addWidget(label_1, 0, 0)        
         self.manual_net_settings_location = QtGui.QLineEdit(self.groupbox_manual_topo)
         self.manual_net_settings_location.setAlignment(QtCore.Qt.AlignLeft | QtCore.Qt.AlignTrailing | QtCore.Qt.AlignVCenter)
         self.manual_net_settings_location.setText("net_config/net_settings.py")               
-        grid_groupbox_manual_topo.addWidget(self.manual_net_settings_location, 0, 2, 1, 2)
-        spacerItem6 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
-        grid_groupbox_manual_topo.addItem(spacerItem6, 0, 3, 1, 2)
+        grid_groupbox_manual_topo.addWidget(self.manual_net_settings_location, 0, 1)        
         button = QtGui.QPushButton('Select File', self)
         button.clicked.connect(lambda: self.showFileDialogNetSettings(MANUAL_TOPO))       
         button.setSizePolicy(QtGui.QSizePolicy(20, 5))       
-        grid_groupbox_manual_topo.addWidget(button, 0, 4, 1, 2)
-
+        grid_groupbox_manual_topo.addWidget(button, 0, 2)
+        button1 = QtGui.QPushButton('From TopologyEditor', self)
+        button1.clicked.connect(lambda: self.useTopologyEditorNetSettings(MANUAL_TOPO))       
+        button1.setSizePolicy(QtGui.QSizePolicy(20, 5))       
+        grid_groupbox_manual_topo.addWidget(button1, 0, 3)
+        
         label_2 = QtGui.QLabel(self.groupbox_manual_topo)
         label_2.setText("Topology file location")
-        grid_groupbox_manual_topo.addWidget(label_2, 1, 0, 1, 2)        
-        spacerItem7 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
-        grid_groupbox_manual_topo.addItem(spacerItem7, 1, 1, 1, 2)        
+        grid_groupbox_manual_topo.addWidget(label_2, 1, 0)                
         self.manual_topo_file_location = QtGui.QLineEdit(self.groupbox_manual_topo)
         self.manual_topo_file_location.setAlignment(QtCore.Qt.AlignLeft | QtCore.Qt.AlignTrailing | QtCore.Qt.AlignVCenter)
         self.manual_topo_file_location.setText("net_config/Inet_small_toposample.txt")        
-        grid_groupbox_manual_topo.addWidget(self.manual_topo_file_location, 1, 2, 1, 2)
-        spacerItem8 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
-        grid_groupbox_manual_topo.addItem(spacerItem8, 1, 3, 1, 2)
+        grid_groupbox_manual_topo.addWidget(self.manual_topo_file_location, 1, 1)        
         button = QtGui.QPushButton('Select File', self)
         button.clicked.connect(lambda: self.showFileDialogTopoFile(MANUAL_TOPO))       
         button.setSizePolicy(QtGui.QSizePolicy(20, 5))       
-        grid_groupbox_manual_topo.addWidget(button, 1, 4, 1, 2)
-
+        grid_groupbox_manual_topo.addWidget(button, 1, 2)
+        button1 = QtGui.QPushButton('From TopologyEditor', self)
+        button1.clicked.connect(lambda: self.useTopologyEditorTopology(MANUAL_TOPO))       
+        button1.setSizePolicy(QtGui.QSizePolicy(20, 5))       
+        grid_groupbox_manual_topo.addWidget(button1, 1, 3)
+        
         label_3 = QtGui.QLabel(self.groupbox_manual_topo)
         label_3.setText("Simulation duration")
-        grid_groupbox_manual_topo.addWidget(label_3, 2, 0, 1, 2)        
-        spacerItem9 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
-        grid_groupbox_manual_topo.addItem(spacerItem9, 2, 1, 1, 2)        
+        grid_groupbox_manual_topo.addWidget(label_3, 2, 0)         
         self.manual_duration = QtGui.QSpinBox(self.groupbox_emulation)            
         self.manual_duration.setValue(0)
         self.manual_duration.setMinimum(0)
         self.manual_duration.setMaximum(3600)
         self.manual_duration.setSingleStep(1)
-        grid_groupbox_manual_topo.addWidget(self.manual_duration, 2, 2, 1, 2)
+        grid_groupbox_manual_topo.addWidget(self.manual_duration, 2, 1)
 
         # --- Topology Experiment Settings --- #
         self.groupbox_topo = QtGui.QGroupBox()      
         self.groupbox_topo.setTitle("Topology Experiment parameters")
         self.vbox_mode.addWidget(self.groupbox_topo)        
-        grid_groupbox_topo = QtGui.QGridLayout()                        
+        grid_groupbox_topo = QtGui.QGridLayout()         
+        grid_groupbox_topo.setSpacing(10)               
         hbox_groupbox_topo = QtGui.QHBoxLayout(self.groupbox_topo)
         hbox_groupbox_topo.addLayout(grid_groupbox_topo)
              
         label_2 = QtGui.QLabel(self.groupbox_topo)
         label_2.setText("Topology file location")
-        grid_groupbox_topo.addWidget(label_2, 0, 0, 1, 2)        
-        spacerItem7 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
-        grid_groupbox_topo.addItem(spacerItem7, 0, 1, 1, 2)        
+        grid_groupbox_topo.addWidget(label_2, 0, 0)                
         self.topo_file_location = QtGui.QLineEdit(self.groupbox_topo)
         self.topo_file_location.setAlignment(QtCore.Qt.AlignLeft | QtCore.Qt.AlignTrailing | QtCore.Qt.AlignVCenter)
         self.topo_file_location.setText("net_config/Inet_small_toposample.txt")        
-        grid_groupbox_topo.addWidget(self.topo_file_location, 0, 2, 1, 2)
-        spacerItem8 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
-        grid_groupbox_topo.addItem(spacerItem8, 0, 3, 1, 2)
+        grid_groupbox_topo.addWidget(self.topo_file_location, 0, 1)        
         button = QtGui.QPushButton('Select File', self)
-        button.clicked.connect(lambda: self.showFileDialogTopoFile(MANUAL_TOPO))       
+        button.clicked.connect(lambda: self.showFileDialogTopoFile(TOPOLOGY))       
         button.setSizePolicy(QtGui.QSizePolicy(20, 5))       
-        grid_groupbox_topo.addWidget(button, 0, 4, 1, 2)
+        grid_groupbox_topo.addWidget(button, 0, 2)
+        button1 = QtGui.QPushButton('From TopologyEditor', self)
+        button1.clicked.connect(lambda: self.useTopologyEditorTopology(TOPOLOGY))       
+        button1.setSizePolicy(QtGui.QSizePolicy(20, 5))       
+        grid_groupbox_topo.addWidget(button1, 0, 3)
 
         label_3 = QtGui.QLabel(self.groupbox_topo)
         label_3.setText("Simulation duration")
-        grid_groupbox_topo.addWidget(label_3, 1, 0, 1, 2)        
-        spacerItem9 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
-        grid_groupbox_topo.addItem(spacerItem9, 1, 1, 1, 2)        
+        grid_groupbox_topo.addWidget(label_3, 1, 0)                
         self.topo_duration = QtGui.QSpinBox(self.groupbox_topo)            
         self.topo_duration.setValue(0)
         self.topo_duration.setMinimum(0)
         self.topo_duration.setMaximum(3600)
         self.topo_duration.setSingleStep(1)
-        grid_groupbox_topo.addWidget(self.topo_duration, 1, 2, 1, 2)
+        grid_groupbox_topo.addWidget(self.topo_duration, 1, 1)
 
         # --- Static Route Experiment Settings --- #
         self.groupbox_static_route = QtGui.QGroupBox()      
         self.groupbox_static_route.setTitle("Static Route Experiment parameters")
         self.vbox_mode.addWidget(self.groupbox_static_route)        
-        grid_groupbox_static_route = QtGui.QGridLayout()                        
+        grid_groupbox_static_route = QtGui.QGridLayout()  
+        grid_groupbox_static_route.setSpacing(10)                      
         hbox_groupbox_static_route = QtGui.QHBoxLayout(self.groupbox_static_route)
         hbox_groupbox_static_route.addLayout(grid_groupbox_static_route)
 
         label_3 = QtGui.QLabel(self.groupbox_static_route)
         label_3.setText("Simulation duration")
-        grid_groupbox_static_route.addWidget(label_3, 0, 0, 1, 2)        
-        spacerItem9 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
-        grid_groupbox_static_route.addItem(spacerItem9, 0, 1, 1, 2)        
+        grid_groupbox_static_route.addWidget(label_3, 0, 0)                
         self.static_duration = QtGui.QSpinBox(self.groupbox_static_route)            
         self.static_duration.setValue(0)
         self.static_duration.setMinimum(0)
         self.static_duration.setMaximum(3600)
         self.static_duration.setSingleStep(1)
-        grid_groupbox_static_route.addWidget(self.static_duration, 0, 2, 1, 2)
+        grid_groupbox_static_route.addWidget(self.static_duration, 0, 2)
 
         self.groupbox_complex_network.hide()
         self.groupbox_manual_topo_bt.hide()
         self.setWindowTitle("IMALSE")
         self.show()
 
-    def modeSelected(self, text):            
-        self.statusBar().showMessage(text + ' was pressed')
+    def modeSelected(self, mode):            
+        self.statusBar().showMessage(mode + ' was pressed')
+        
+        if (mode == "Select a mode"):
+            self.hideAllModes()
+            self.hideAllExperiments()
+        
+        if (mode == EMULATION):
+            self.hideAllModes()
+            self.hideAllExperiments()
+            self.groupbox_emulation.show()                    
+            return
 
-        if (text == "Emulation"):
-         self.hideAllModes()
-         self.hideAllExperiments()
-         self.groupbox_emulation.show()                    
-         return
+        if (mode == NETNS3):
+            self.hideAllModes()
+            self.hideAllExperiments()
+            self.groupbox_netns3.show()                                 
+            return
 
-        if (text == "Netns3 Simulation"):
-         self.hideAllModes()
-         self.hideAllExperiments()
-         self.groupbox_netns3.show()                                 
-         return
-
-        if (text == "Pure Simulation"):
-         self.hideAllModes()
-         self.hideAllExperiments()
-         self.groupbox_pure.show()             
-         return
+        if (mode == PURE_SIM):
+            self.hideAllModes()
+            self.hideAllExperiments()
+            self.groupbox_pure.show()             
+            return
+    
+    def scenarioSelected(self, scenario):
+        
+        if (scenario == "Select a scenario"):
+            self.tab_widget.removeTab(4)
+            
+        if (scenario == DDOS_FLOODING):            
+            self.tab_widget.removeTab(4)
+            self.tab_widget.addTab(self.tab_ddos_flooding, "DDOS Flooding")
+            return
+            
+        if (scenario == FILE_EXFILTRATION):
+            self.tab_widget.removeTab(4)
+            self.tab_widget.addTab(self.tab_file_exfiltration, "File Exfiltration")
+            return
+            
+        if (scenario == KEYLOGGER):
+            self.tab_widget.removeTab(4)
+            self.tab_widget.addTab(self.tab_keylogger, "Keylogger")
+            return
+            
+        if (scenario == SPAMMING):
+            self.tab_widget.removeTab(4)
+            self.tab_widget.addTab(self.tab_spamming, "Spamming")       
+            return
      
     def experimentSelected(self, text):
         if (text == "Complex Network Experiment"):
             if exp == COMPLEX:
                 self.complex_topo_file_location.setText(file)            
             elif exp == MANUAL_TOPO_BT:
-                self.manual_topo_file_settings_location.setText(file)            
+                self.manual_bt_topo_file_location.setText(file)            
             elif exp == MANUAL_TOPO:
                 self.manual_topo_file_location.setText(file)
+            elif exp == TOPOLOGY:
+                self.topo_file_location.setText(file)
+    
+    def useTopologyEditorTopology(self, exp):        
+        location = 'gui/TopologyEditor/imalse_config/topology.inet'
+        if exp == COMPLEX:
+            self.complex_topo_file_location.setText(location)            
+        elif exp == MANUAL_TOPO_BT:
+            self.manual_bt_topo_file_location.setText(location)            
+        elif exp == MANUAL_TOPO:
+            self.manual_topo_file_location.setText(location)
+        elif exp == TOPOLOGY:
+            self.topo_file_location.setText(location)
+    
+    def useTopologyEditorNetSettings(self, exp):
+        location = 'gui/TopologyEditor/imalse_config/net_settings.py'
+        if exp == COMPLEX:
+            self.complex_net_settings_location.setText(location)                      
+        elif exp == MANUAL_TOPO_BT:
+            self.manual_bt_net_settings_location.setText(location)            
+        elif exp == MANUAL_TOPO:
+            self.manual_net_settings_location.setText(location)        
     
     def startEmulation(self, scenario):       
         cmd = 'sudo python ./emulate.py -s ' + scenario + ' -r server'   
         if bt_file != None:
             cmd += ' --back_traf ' + bt_file
         
-        cmd+= " --SimulatorImpl=Visual"
+        if self.implementation.itemText ( self.implementation.currentIndex() ) == 'Visual':
+            cmd += ' --SimulatorImpl=Visual'
         
         print cmd
-        os.system("gnome-terminal -e 'bash -c \"" + str(cmd) + "; exec bash\"'")
-          
+        #os.system("xterm -e 'bash -c \"" + str(cmd) + "; exec bash\"'")
+        executable = QtCore.QString('xterm -hold -into ' + str(self.container2.winId()) + ' -e "' + str(cmd) + '"')     
+        print executable   
+        self.processTerminal.start(executable)  
+        
     def startScenario(self, settings_type, attack):        
         open_f = choseCorrectFile(settings_type)
         
         scenario = SCENARIOS[settings_type]
         mode = self.mode.itemText( self.mode.currentIndex() )      
         old_value = searchAndGet(settings_type, BOTMASTER, "self.command")  
-        
+        ol_value = old_value[:-2]
+
         if attack not in old_value:
             searchAndReplace(settings_type, BOTMASTER, "self.command", old_value, attack+'()')            
         
                 self.startSim('netns3', scenario, MANUAL_TOPO, self.manual_bt_duration.value(), 
                     self.manual_topo_file_location.text(), self.manual_net_settings_location.text())                    
             
-        elif mode == PURE_SIM:               
+        elif mode == PURE_SIM:         
+            self.processTerminal.kill()
             experiment = self.pure_exp.itemText( self.pure_exp.currentIndex() )
             print experiment
             if experiment == "Complex Network Experiment":

scenario/ddos_flooding/config.py

     def __init__(self):
         """Initialize the botmaster description."""
         BotmasterDescription.__init__(self)
-        self.command =PingFloodCmd()
-        
+        self.command =TcpSynFloodCmd()
+   
 class Client(ClientDescription):
     
     """
     
     def __init__(self):
         """Initialize the client description."""
-        ClientDescription.__init__(self)
+        ClientDescription.__init__(self)        
         
 class Server(ServerDescription):
     
         self.verbose = True
         
         #Used in netns and emulation mode
-        self.num_packets = 113 
-    
+        self.num_packets = 99999 
+  
         #Only used in emulation mode
         self.timeout = 104
        

scenario/keylogger/config.py

     self.master_password = '1234'
     self.interval = 2 
     self.num_commands = 1
-    self.command = None
-    
-    """
+    self.command =KeylogCMD()
+   """
     
     def __init__(self):
         """Initialize the botmaster description."""
     E.g.: cidr_to_subnet_mask("10.7.2.1/24")
     returns: ('10.7.2.1', '10.7.2.0', '255.255.255.0')
 
-    """
-    addr, prefix_len = s_addr.rsplit('/')
-    mask = len2mask(int(prefix_len))
-    net = get_net(addr, mask)
+    """    
+    try:
+        addr, prefix_len = s_addr.rsplit('/')
+        mask = len2mask(int(prefix_len))
+        net = get_net(addr, mask)
+    except ValueError:
+        print "The netsettings file is not suitable for this experiment."
+        exit(0)
     return addr, net, mask
 
 def len2mask(length):
         return importlib.import_module('experiments.' + experiment)
     except ImportError as e:
         print e
-        print "Experiment could not be loaded."
+        print "Experiment " + experiment +  " could not be loaded."
         exit(0)
 
 def get_availabe_scenarios(scen_dir = settings.ROOT+'/scenario/'):
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.