Commits

Jing Wang Thinkpad  committed 5fe095a

StaticRouting and TopoExperiment can work. Scenario cannot work in ComplexNetExperiment, maybe routing problems

  • Participants
  • Parent commits 127a097

Comments (0)

Files changed (16)

File core/BaseNode.py

     def _set_logger(self):
         logging.basicConfig()
         self.logger = logging.getLogger(self.name)
-        self.logger.setLevel(logging.DEBUG)
+        # self.logger.setLevel(logging.DEBUG)
+        self.logger.setLevel(logging.WARNING)
 
     def start(self):
         """start the node"""

File core/BotMaster.py

         """
         Bot Master that verify itself and send command. One command wil be
         sent automatically.
+
         - **desc** specify the server information
         - **master_password**
         - **interval** the interval between two consequent command.
         self.num = num
 
     def recv_ack(self):
+        """after receive the ack , botmaster will send password to verify
+        itself. After that, server will second commands out periodically.
+        This botmaster will take no responsibility to check whether the commands
+        have been excucted or not.
+        """
         self.logger.debug('botmaster one command recv_ack has been recorded')
         self.node.send(self.sock,
                 self._cmd_to_json('event=verify_master;password=%s;'%(self.master_password)))
-        print 'self.node.send(self.sock) finishe'
+
+        # Sleep for a while to make sure it has been verified
         self.node.sleep(self.interval)
-        print 'sleep has been called'
+
+        self.logger.info('Botmaster will start to issue the command [%s]'%(self.cmd_str))
         idx = self.num
         while True:
             if idx == 0: break
             idx -= 1
-            print 'send command out'
+            # print 'send command out', self.cmd_str
             self.node.send(self.sock,
                     self._cmd_to_json(self.cmd_str) )
             self.node.sleep(self.interval)
     def _set_logger(self):
         logging.basicConfig()
         self.logger = logging.getLogger(self.name)
-        self.logger.setLevel(logging.DEBUG)
+        # self.logger.setLevel(logging.DEBUG)
+        self.logger.setLevel(logging.WARNING)
 
     def _trigger(self, event_name, *argv, **kwargv):
         """trigger an event, event hander is a class member function"""

File core/Client.py

 
     def request_connect(self):
         """request a connection to server"""
-        self.logger.debug('request_connect')
         sock = self.node.create_sock({'type':'server', 'proto':'tcp'})
         self.sock = sock
         if self.node.NODE_TYPE.startswith('real'):
             event = self.node.connect(sock, (self.srv_addr, self.srv_port))
             self._trigger(event)
         elif self.node.NODE_TYPE.startswith('sim'):
-            self.logger.debug('sim connect')
             event = self.node.connect(sock, (self.srv_addr, self.srv_port))
 
     def connection_refused(self):
     def recv_ack(self):
         """call back when receive ack message from server"""
         self.logger.info("connection constructed")
+        print 'connection constructed'
         self.node.recv(self.sock, 512, self.dispatcher)
 
     def echo(self, sock, data):

File core/ns3/Node/ImalseNetnsSimNode.py

         sock.Listen()
 
     def recv(self, sock, bufsize, dispatcher=None, threaded=False):
+        # print('Node [%s] has set recv dispatcher [%s] for sock [%s]'%(self.name, dispatcher, str(sock)) )
         self.logger.debug('Node [%s] has set recv dispatcher [%s] for sock [%s]'%(self.name, dispatcher, str(sock)) )
         sock.SetRecvCallback(dispatcher)
         self.logger.debug('Node [%s] has finish set recv dispatcher for sock [%s]'%(self.name, str(sock)) )
         parse the data into approariate format and handle the data to
         cmd.dispatcher()
         """
+        print 'dispatcher'
 #FIXME this function was not exculated in pure simulation mode
         # if self.name == "sim_n%s" %(2):
             # import pdb;pdb.set_trace()
                 )
 
         def connect_succeeded(sock):
+            print 'Node [%s] connect succeeded'%(self.name)
             self.logger.debug('Node [%s] connect succeeded'%(self.name) )
-            self.recv(sock, 512, self.dispatcher)
+            # self.recv(sock, 512, self.dispatcher)
+            self.after(0, self.recv, sock, 512, self.dispatcher)
 
         def connect_failed(sock):
             self.logger.debug('Node [%s] connect failed'%(self.name) )
 
         sock.SetConnectCallback(connect_succeeded, connect_failed)
         ret = sock.Connect(inetAddr)
-        # print 'ret, ', ret
+        if ret == -1:
+            print 'node [%s] cannot connect to server'%(self.name)
+            # raise Exception('node [%s] cannot connect to server'%(self.name) )
+        print 'node %s connected to server'%(self.name)
+
+        # self.recv(sock, 512, self.dispatcher)
         # x = inetAddr.GetIpv4()
         # from inspect import getmembers
         # for a, b in getmembers(x): print a, b

File core/ns3/Topology.py

     """Load Topology File and Contruct the Network Accordingly"""
     routing_helper_list = {
             'static':0,
-            # 'nix':5,
+            'nix':5,
             'olsr':10,
             }
     def __init__(self, _input, _format, NodeCreator, *args, **kwargs):

File experiments/ComplexNetExperiment.py

         # print('finish running print_srv_addr')
         self._set_server_info()
         # print('finish running set_server_info')
+
         self.start_nodes()
         # print('finish running start nodes')
 
+        # create routing table
+        ns3.Ipv4GlobalRoutingHelper.PopulateRoutingTables()
+address for node  0  has bee assigned, ip,  10.20.30.9/24
+address for node  2  has bee assigned, ip,  10.20.30.1/24
+address for node  3  has bee assigned, ip,  10.20.30.2/24
+address for node  4  has bee assigned, ip,  10.20.30.3/24
+address for node  5  has bee assigned, ip,  10.20.30.4/24
+address for node  10  has bee assigned, ip,  10.20.30.6/24
+address for node  11  has bee assigned, ip,  10.20.30.7/24
+address for node  12  has bee assigned, ip,  10.20.30.8/24
+address for node  13  has bee assigned, ip,  10.20.30.5/24
+address for node  8  has bee assigned, ip,  2.3.5.6/24
+address for node  6  has bee assigned, ip,  1.1.1.10/24
+address for node  1  has bee assigned, ip,  10.200.1.1/24
+address for node  0  has bee assigned, ip,  10.200.1.3/24
+address for node  7  has bee assigned, ip,  1.1.1.1/24
+address for node  6  has bee assigned, ip,  2.3.5.10/24
+address for node  6  has bee assigned, ip,  5.6.8.10/24
+address for node  9  has bee assigned, ip,  5.6.8.9/24
+address for node  6  has bee assigned, ip,  10.1.1.1/24
+address for node  0  has bee assigned, ip,  10.1.1.5/24
+(i, j),  (0, 2)
+(i, j),  (1, 0)
+(i, j),  (2, 3)
+(i, j),  (3, 4)
+(i, j),  (4, 5)
+(i, j),  (5, 10)
+(i, j),  (6, 0)
+(i, j),  (6, 9)
+(i, j),  (7, 6)
+(i, j),  (8, 6)
+(i, j),  (10, 11)
+(i, j),  (11, 12)
+(i, j),  (12, 13)
+res,  ('10.200.1.3/24', '10.200.1.1/24')
+res,  ('10.20.30.6/24', '10.20.30.4/24')
+res,  ('10.20.30.6/24', '10.20.30.7/24')
+res,  ('10.20.30.8/24', '10.20.30.5/24')
+res,  ('10.20.30.2/24', '10.20.30.3/24')
+res,  ('1.1.1.10/24', '1.1.1.1/24')
+res,  ('10.1.1.5/24', '10.1.1.1/24')
+res,  ('10.20.30.1/24', '10.20.30.2/24')
+res,  ('10.20.30.8/24', '10.20.30.7/24')
+res,  ('10.20.30.3/24', '10.20.30.4/24')
+res,  ('2.3.5.6/24', '2.3.5.10/24')
+res,  ('5.6.8.9/24', '5.6.8.10/24')
+res,  ('10.20.30.9/24', '10.20.30.1/24')
+local,  2.3.5.6
+remote,  10.200.1.1
+add an onoff application with
+                start_time: 0.000000
+                end_time: 100.000000
+                local: 2.3.5.6,
+                remote: 10.200.1.1,
+                on_time: normal(4.000000, 0.000100),
+                off_time: exponential(0.500000)
+local,  2.3.5.6
+remote,  10.20.30.1
+add an onoff application with
+                start_time: 0.000000
+                end_time: 100.000000
+                local: 2.3.5.6,
+                remote: 10.20.30.1,
+                on_time: normal(4.000000, 0.000100),
+                off_time: exponential(0.500000)
+local,  2.3.5.6
+remote,  10.1.1.5
+add an onoff application with
+                start_time: 0.000000
+                end_time: 100.000000
+                local: 2.3.5.6,
+                remote: 10.1.1.5,
+                on_time: normal(4.000000, 0.000100),
+                off_time: exponential(0.500000)
+local,  2.3.5.6
+remote,  10.20.30.4
+add an onoff application with
+                start_time: 0.000000
+                end_time: 100.000000
+                local: 2.3.5.6,
+                remote: 10.20.30.4,
+                on_time: normal(4.000000, 0.000100),
+                off_time: exponential(0.500000)
+local,  2.3.5.6
+remote,  1.1.1.1
+add an onoff application with
+                start_time: 0.000000
+                end_time: 100.000000
+                local: 2.3.5.6,
+                remote: 1.1.1.1,
+                on_time: normal(4.000000, 0.000100),
+                off_time: exponential(0.500000)
+local,  2.3.5.6
+remote,  10.20.30.2
+add an onoff application with
+                start_time: 0.000000
+                end_time: 100.000000
+                local: 2.3.5.6,
+                remote: 10.20.30.2,
+                on_time: normal(4.000000, 0.000100),
+                off_time: exponential(0.500000)
+local,  2.3.5.6
+remote,  10.20.30.3
+add an onoff application with
+                start_time: 0.000000
+                end_time: 100.000000
+                local: 2.3.5.6,
+                remote: 10.20.30.3,
+                on_time: normal(4.000000, 0.000100),
+                off_time: exponential(0.500000)
+local,  2.3.5.6
+remote,  2.3.5.6
+add an onoff application with
+                start_time: 0.000000
+                end_time: 100.000000
+                local: 2.3.5.6,
+                remote: 2.3.5.6,
+                on_time: normal(4.000000, 0.000100),
+                off_time: exponential(0.500000)
+local,  5.6.8.9
+remote,  10.200.1.1
+add an onoff application with
+                start_time: 1000.000000
+                end_time: 1300.000000
+                local: 5.6.8.9,
+                remote: 10.200.1.1,
+                on_time: normal(4.000000, 0.000100),
+                off_time: exponential(0.500000)
+local,  10.1.1.5
+remote,  2.3.5.6
+add an onoff application with
+                start_time: 0.000000
+                end_time: 100.000000
+                local: 10.1.1.5,
+                remote: 2.3.5.6,
+                on_time: normal(4.000000, 0.000100),
+                off_time: exponential(0.500000)
+local,  10.1.1.5
+remote,  10.200.1.1
+add an onoff application with
+                start_time: 0.000000
+                end_time: 100.000000
+                local: 10.1.1.5,
+                remote: 10.200.1.1,
+                on_time: normal(4.000000, 0.000100),
+                off_time: exponential(0.500000)
+local,  10.1.1.5
+remote,  10.20.30.1
+add an onoff application with
+                start_time: 0.000000
+                end_time: 100.000000
+                local: 10.1.1.5,
+                remote: 10.20.30.1,
+                on_time: normal(4.000000, 0.000100),
+                off_time: exponential(0.500000)
+local,  10.20.30.9
+remote,  10.200.1.3
+add an onoff application with
+                start_time: 0.000000
+                end_time: 100.000000
+                local: 10.20.30.9,
+                remote: 10.200.1.3,
+                on_time: normal(4.000000, 0.000100),
+                off_time: exponential(0.500000)
+local,  10.20.30.9
+remote,  10.20.30.4
+add an onoff application with
+                start_time: 0.000000
+                end_time: 100.000000
+                local: 10.20.30.9,
+                remote: 10.20.30.4,
+                on_time: normal(4.000000, 0.000100),
+                off_time: exponential(0.500000)
+local,  10.20.30.9
+remote,  1.1.1.1
+add an onoff application with
+                start_time: 0.000000
+                end_time: 100.000000
+                local: 10.20.30.9,
+                remote: 1.1.1.1,
+                on_time: normal(4.000000, 0.000100),
+                off_time: exponential(0.500000)
+local,  10.200.1.3
+remote,  10.20.30.2
+add an onoff application with
+                start_time: 0.000000
+                end_time: 100.000000
+                local: 10.200.1.3,
+                remote: 10.20.30.2,
+                on_time: normal(4.000000, 0.000100),
+                off_time: exponential(0.500000)
+local,  10.20.30.9
+remote,  10.20.30.3
+add an onoff application with
+                start_time: 0.000000
+                end_time: 100.000000
+                local: 10.20.30.9,
+                remote: 10.20.30.3,
+                on_time: normal(4.000000, 0.000100),
+                off_time: exponential(0.500000)
+local,  10.200.1.1
+remote,  10.20.30.1
+add an onoff application with
+                start_time: 0.000000
+                end_time: 100.000000
+                local: 10.200.1.1,
+                remote: 10.20.30.1,
+                on_time: normal(4.000000, 0.000100),
+                off_time: exponential(0.500000)
+local,  10.200.1.1
+remote,  10.200.1.1
+add an onoff application with
+                start_time: 0.000000
+                end_time: 100.000000
+                local: 10.200.1.1,
+                remote: 10.200.1.1,
+                on_time: normal(4.000000, 0.000100),
+                off_time: exponential(0.500000)
+local,  10.200.1.1
+remote,  10.1.1.5
+add an onoff application with
+                start_time: 0.000000
+                end_time: 100.000000
+                local: 10.200.1.1,
+                remote: 10.1.1.5,
+                on_time: normal(4.000000, 0.000100),
+                off_time: exponential(0.500000)
+local,  10.200.1.1
+remote,  1.1.1.1
+add an onoff application with
+                start_time: 0.000000
+                end_time: 100.000000
+                local: 10.200.1.1,
+                remote: 1.1.1.1,
+                on_time: normal(4.000000, 0.000100),
+                off_time: exponential(0.500000)
+local,  10.200.1.1
+remote,  10.20.30.4
+add an onoff application with
+                start_time: 0.000000
+                end_time: 100.000000
+                local: 10.200.1.1,
+                remote: 10.20.30.4,
+                on_time: normal(4.000000, 0.000100),
+                off_time: exponential(0.500000)
+local,  10.200.1.1
+remote,  10.20.30.3
+add an onoff application with
+                start_time: 0.000000
+                end_time: 100.000000
+                local: 10.200.1.1,
+                remote: 10.20.30.3,
+                on_time: normal(4.000000, 0.000100),
+                off_time: exponential(0.500000)
+local,  10.200.1.1
+remote,  10.20.30.2
+add an onoff application with
+                start_time: 0.000000
+                end_time: 100.000000
+                local: 10.200.1.1,
+                remote: 10.20.30.2,
+                on_time: normal(4.000000, 0.000100),
+                off_time: exponential(0.500000)
+local,  10.200.1.1
+remote,  2.3.5.6
+add an onoff application with
+                start_time: 0.000000
+                end_time: 100.000000
+                local: 10.200.1.1,
+                remote: 2.3.5.6,
+                on_time: normal(4.000000, 0.000100),
+                off_time: exponential(0.500000)
+local,  10.20.30.1
+remote,  10.20.30.2
+add an onoff application with
+                start_time: 0.000000
+                end_time: 100.000000
+                local: 10.20.30.1,
+                remote: 10.20.30.2,
+                on_time: normal(4.000000, 0.000100),
+                off_time: exponential(0.500000)
+local,  10.20.30.1
+remote,  10.20.30.3
+add an onoff application with
+                start_time: 0.000000
+                end_time: 100.000000
+                local: 10.20.30.1,
+                remote: 10.20.30.3,
+                on_time: normal(4.000000, 0.000100),
+                off_time: exponential(0.500000)
+local,  10.20.30.1
+remote,  10.20.30.4
+add an onoff application with
+                start_time: 0.000000
+                end_time: 100.000000
+                local: 10.20.30.1,
+                remote: 10.20.30.4,
+                on_time: normal(4.000000, 0.000100),
+                off_time: exponential(0.500000)
+local,  10.20.30.1
+remote,  1.1.1.1
+add an onoff application with
+                start_time: 0.000000
+                end_time: 100.000000
+                local: 10.20.30.1,
+                remote: 1.1.1.1,
+                on_time: normal(4.000000, 0.000100),
+                off_time: exponential(0.500000)
+local,  10.20.30.1
+remote,  10.1.1.5
+add an onoff application with
+                start_time: 0.000000
+                end_time: 100.000000
+                local: 10.20.30.1,
+                remote: 10.1.1.5,
+                on_time: normal(4.000000, 0.000100),
+                off_time: exponential(0.500000)
+local,  10.20.30.1
+remote,  10.200.1.1
+add an onoff application with
+                start_time: 0.000000
+                end_time: 100.000000
+                local: 10.20.30.1,
+                remote: 10.200.1.1,
+                on_time: normal(4.000000, 0.000100),
+                off_time: exponential(0.500000)
+local,  10.20.30.1
+remote,  10.20.30.1
+add an onoff application with
+                start_time: 0.000000
+                end_time: 100.000000
+                local: 10.20.30.1,
+                remote: 10.20.30.1,
+                on_time: normal(4.000000, 0.000100),
+                off_time: exponential(0.500000)
+local,  10.20.30.1
+remote,  2.3.5.6
+add an onoff application with
+                start_time: 0.000000
+                end_time: 100.000000
+                local: 10.20.30.1,
+                remote: 2.3.5.6,
+                on_time: normal(4.000000, 0.000100),
+                off_time: exponential(0.500000)
+local,  10.20.30.2
+remote,  2.3.5.6
+add an onoff application with
+                start_time: 0.000000
+                end_time: 100.000000
+                local: 10.20.30.2,
+                remote: 2.3.5.6,
+                on_time: normal(4.000000, 0.000100),
+                off_time: exponential(0.500000)
+local,  10.20.30.2
+remote,  10.20.30.3
+add an onoff application with
+                start_time: 0.000000
+                end_time: 100.000000
+                local: 10.20.30.2,
+                remote: 10.20.30.3,
+                on_time: normal(4.000000, 0.000100),
+                off_time: exponential(0.500000)
+local,  10.20.30.2
+remote,  10.20.30.2
+add an onoff application with
+                start_time: 0.000000
+                end_time: 100.000000
+                local: 10.20.30.2,
+                remote: 10.20.30.2,
+                on_time: normal(4.000000, 0.000100),
+                off_time: exponential(0.500000)
+local,  10.20.30.2
+remote,  1.1.1.1
+add an onoff application with
+                start_time: 0.000000
+                end_time: 100.000000
+                local: 10.20.30.2,
+                remote: 1.1.1.1,
+                on_time: normal(4.000000, 0.000100),
+                off_time: exponential(0.500000)
+local,  10.20.30.2
+remote,  10.20.30.4
+add an onoff application with
+                start_time: 0.000000
+                end_time: 100.000000
+                local: 10.20.30.2,
+                remote: 10.20.30.4,
+                on_time: normal(4.000000, 0.000100),
+                off_time: exponential(0.500000)
+local,  10.20.30.2
+remote,  10.20.30.9
+add an onoff application with
+                start_time: 0.000000
+                end_time: 100.000000
+                local: 10.20.30.2,
+                remote: 10.20.30.9,
+                on_time: normal(4.000000, 0.000100),
+                off_time: exponential(0.500000)
+local,  10.20.30.2
+remote,  10.20.30.1
+add an onoff application with
+                start_time: 0.000000
+                end_time: 100.000000
+                local: 10.20.30.2,
+                remote: 10.20.30.1,
+                on_time: normal(4.000000, 0.000100),
+                off_time: exponential(0.500000)
+local,  10.20.30.2
+remote,  10.200.1.1
+add an onoff application with
+                start_time: 0.000000
+                end_time: 100.000000
+                local: 10.20.30.2,
+                remote: 10.200.1.1,
+                on_time: normal(4.000000, 0.000100),
+                off_time: exponential(0.500000)
+local,  10.20.30.3
+remote,  10.20.30.4
+add an onoff application with
+                start_time: 0.000000
+                end_time: 100.000000
+                local: 10.20.30.3,
+                remote: 10.20.30.4,
+                on_time: normal(4.000000, 0.000100),
+                off_time: exponential(0.500000)
+local,  10.20.30.3
+remote,  1.1.1.1
+add an onoff application with
+                start_time: 0.000000
+                end_time: 100.000000
+                local: 10.20.30.3,
+                remote: 1.1.1.1,
+                on_time: normal(4.000000, 0.000100),
+                off_time: exponential(0.500000)
+local,  10.20.30.3
+remote,  10.20.30.2
+add an onoff application with
+                start_time: 0.000000
+                end_time: 100.000000
+                local: 10.20.30.3,
+                remote: 10.20.30.2,
+                on_time: normal(4.000000, 0.000100),
+                off_time: exponential(0.500000)
+local,  10.20.30.3
+remote,  10.20.30.3
+add an onoff application with
+                start_time: 0.000000
+                end_time: 100.000000
+                local: 10.20.30.3,
+                remote: 10.20.30.3,
+                on_time: normal(4.000000, 0.000100),
+                off_time: exponential(0.500000)
+local,  10.20.30.3
+remote,  10.200.1.1
+add an onoff application with
+                start_time: 0.000000
+                end_time: 100.000000
+                local: 10.20.30.3,
+                remote: 10.200.1.1,
+                on_time: normal(4.000000, 0.000100),
+                off_time: exponential(0.500000)
+local,  10.20.30.3
+remote,  10.20.30.1
+add an onoff application with
+                start_time: 0.000000
+                end_time: 100.000000
+                local: 10.20.30.3,
+                remote: 10.20.30.1,
+                on_time: normal(4.000000, 0.000100),
+                off_time: exponential(0.500000)
+local,  10.20.30.3
+remote,  10.200.1.3
+add an onoff application with
+                start_time: 0.000000
+                end_time: 100.000000
+                local: 10.20.30.3,
+                remote: 10.200.1.3,
+                on_time: normal(4.000000, 0.000100),
+                off_time: exponential(0.500000)
+local,  10.20.30.3
+remote,  2.3.5.6
+add an onoff application with
+                start_time: 0.000000
+                end_time: 100.000000
+                local: 10.20.30.3,
+                remote: 2.3.5.6,
+                on_time: normal(4.000000, 0.000100),
+                off_time: exponential(0.500000)
+local,  10.20.30.4
+remote,  2.3.5.6
+add an onoff application with
+                start_time: 0.000000
+                end_time: 100.000000
+                local: 10.20.30.4,
+                remote: 2.3.5.6,
+                on_time: normal(4.000000, 0.000100),
+                off_time: exponential(0.500000)
+local,  10.20.30.4
+remote,  1.1.1.1
+add an onoff application with
+                start_time: 0.000000
+                end_time: 100.000000
+                local: 10.20.30.4,
+                remote: 1.1.1.1,
+                on_time: normal(4.000000, 0.000100),
+                off_time: exponential(0.500000)
+local,  10.20.30.4
+remote,  10.20.30.4
+add an onoff application with
+                start_time: 0.000000
+                end_time: 100.000000
+                local: 10.20.30.4,
+                remote: 10.20.30.4,
+                on_time: normal(4.000000, 0.000100),
+                off_time: exponential(0.500000)
+local,  10.20.30.4
+remote,  10.20.30.3
+add an onoff application with
+                start_time: 0.000000
+                end_time: 100.000000
+                local: 10.20.30.4,
+                remote: 10.20.30.3,
+                on_time: normal(4.000000, 0.000100),
+                off_time: exponential(0.500000)
+local,  10.20.30.4
+remote,  10.20.30.2
+add an onoff application with
+                start_time: 0.000000
+                end_time: 100.000000
+                local: 10.20.30.4,
+                remote: 10.20.30.2,
+                on_time: normal(4.000000, 0.000100),
+                off_time: exponential(0.500000)
+local,  10.20.30.4
+remote,  10.20.30.1
+add an onoff application with
+                start_time: 0.000000
+                end_time: 100.000000
+                local: 10.20.30.4,
+                remote: 10.20.30.1,
+                on_time: normal(4.000000, 0.000100),
+                off_time: exponential(0.500000)
+local,  10.20.30.4
+remote,  10.200.1.1
+add an onoff application with
+                start_time: 0.000000
+                end_time: 100.000000
+                local: 10.20.30.4,
+                remote: 10.200.1.1,
+                on_time: normal(4.000000, 0.000100),
+                off_time: exponential(0.500000)
+local,  10.20.30.4
+remote,  10.200.1.3
+add an onoff application with
+                start_time: 0.000000
+                end_time: 100.000000
+                local: 10.20.30.4,
+                remote: 10.200.1.3,
+                on_time: normal(4.000000, 0.000100),
+                off_time: exponential(0.500000)
+local,  1.1.1.1
+remote,  2.3.5.6
+add an onoff application with
+                start_time: 0.000000
+                end_time: 100.000000
+                local: 1.1.1.1,
+                remote: 2.3.5.6,
+                on_time: normal(4.000000, 0.000100),
+                off_time: exponential(0.500000)
+local,  1.1.1.1
+remote,  10.1.1.5
+add an onoff application with
+                start_time: 0.000000
+                end_time: 100.000000
+                local: 1.1.1.1,
+                remote: 10.1.1.5,
+                on_time: normal(4.000000, 0.000100),
+                off_time: exponential(0.500000)
+local,  1.1.1.1
+remote,  10.20.30.1
+add an onoff application with
+                start_time: 0.000000
+                end_time: 100.000000
+                local: 1.1.1.1,
+                remote: 10.20.30.1,
+                on_time: normal(4.000000, 0.000100),
+                off_time: exponential(0.500000)
+local,  1.1.1.1
+remote,  10.200.1.1
+add an onoff application with
+                start_time: 0.000000
+                end_time: 100.000000
+                local: 1.1.1.1,
+                remote: 10.200.1.1,
+                on_time: normal(4.000000, 0.000100),
+                off_time: exponential(0.500000)
+local,  1.1.1.1
+remote,  10.20.30.3
+add an onoff application with
+                start_time: 0.000000
+                end_time: 100.000000
+                local: 1.1.1.1,
+                remote: 10.20.30.3,
+                on_time: normal(4.000000, 0.000100),
+                off_time: exponential(0.500000)
+local,  1.1.1.1
+remote,  10.20.30.2
+add an onoff application with
+                start_time: 0.000000
+                end_time: 100.000000
+                local: 1.1.1.1,
+                remote: 10.20.30.2,
+                on_time: normal(4.000000, 0.000100),
+                off_time: exponential(0.500000)
+local,  1.1.1.1
+remote,  1.1.1.1
+add an onoff application with
+                start_time: 0.000000
+                end_time: 100.000000
+                local: 1.1.1.1,
+                remote: 1.1.1.1,
+                on_time: normal(4.000000, 0.000100),
+                off_time: exponential(0.500000)
+local,  1.1.1.1
+remote,  10.20.30.4
+add an onoff application with
+                start_time: 0.000000
+                end_time: 100.000000
+                local: 1.1.1.1,
+                remote: 10.20.30.4,
+                on_time: normal(4.000000, 0.000100),
+                off_time: exponential(0.500000)
+finish running set_trace
+The server addr of server [8 ]:  m_local=2.3.5.6; m_mask=255.255.255.0; m_broadcast=2.3.5.255; m_scope=2; m_secondary=0
+node [sim_n8] type [server] start at [0.000000]s
+node [sim_n2] type [client] start at [2.000000]s
+node [sim_n3] type [client] start at [4.000000]s
+node [sim_n4] type [client] start at [6.000000]s
+node [sim_n5] type [client] start at [8.000000]s
+node [sim_n6] type [client] start at [10.000000]s
+node [sim_n8] type [botmaster] start at [12.000000]s
+running simulator for 100.0 sec
+request_connect
+sim connect
+addr_port,  ('', 3333)
+server_addr,  2.3.5.6
+serval local,  2.3.5.6
+ret,  0
+request_connect
+sim connect
+addr_port,  ('', 3333)
+server_addr,  2.3.5.6
+serval local,  2.3.5.6
+request_connect
+sim connect
+addr_port,  ('', 3333)
+server_addr,  2.3.5.6
+serval local,  2.3.5.6
+request_connect
+sim connect
+addr_port,  ('', 3333)
+server_addr,  2.3.5.6
+serval local,  2.3.5.6
+request_connect
+sim connect
+addr_port,  ('', 3333)
+server_addr,  2.3.5.6
+serval local,  2.3.5.6
+request_connect
+sim connect
+addr_port,  ('', 3333)
+server_addr,  2.3.5.6
+serval local,  2.3.5.6
+ret,  0
+request_connect
+sim connect
+addr_port,  ('', 3333)
+server_addr,  2.3.5.6
+serval local,  2.3.5.6
+ret,  0
+simulator done
+
+Modules built:
+antenna                   aodv                      applications             
+bridge                    buildings                 config-store             
+core                      csma                      csma-layout              
+dsdv                      dsr                       emu                      
+energy                    flow-monitor              imalse                   
+internet                  lte                       mesh                     
+mobility                  mpi                       netanim (no Python)      
+network                   nix-vector-routing        olsr                     
+point-to-point            point-to-point-layout     propagation              
+spectrum                  stats                     tap-bridge               
+test (no Python)          tools                     topology-read            
+uan                       virtual-net-device        visualizer               
+wifi                      wimax                    
+
+Modules not built:
+click                     openflow                 
+
+--> cd /home/wangjing/Apps/imalse/tools/ns-allinone-3.14.1/ns-3.14.1 && ./waf --pyrun "/home/wangjing/Dropbox/imalse/simulate.py -e ComplexNetExperiment --net_settings=net_config/aro_demo/nf_net_settings.py -s file_exfiltration -t 100 --back_traf=net_config/aro_demo/back_traf.py"

File scenario/ddos_ping_flooding/ClientCMD.py

         core.ClientCMD.__init__(self, desc)
 
     def send_ping(self, sock, data):
+        print 'send_ping in ClientCMD'
         self.node.ping(sock,data, threaded=True)
 
     def stop_ping(self, sock):

File scenario/ddos_ping_flooding/ServerCMD.py

         core.ServerCMD.__init__(self, desc)
 
     def forward_to_bots(self, sock, data):
+        print 'forward to bots has been excuted!'
         self.logger.info('start to echo_bots' )
         new_data = copy.deepcopy(data)
         new_data['event'] = data['bot_event']
         del new_data['bot_event']
         for client_sock in self.node.client_socks:
+            print 'send to socket, ', new_data
             self.node.send(client_sock, self._dump_json(new_data))

File share/__placeholder__.py

Empty file added.

File share/bg_net_settings_tmp.py

+ipv4_net_addr_base = '10.7.0.1/24'
+link_attr_default = ['2ms','5Mbps']
+link_attr = {   (0, 1): ['0.002s', '5000000bps'],
+    (0, 2): ['0.002s', '5000000bps'],
+    (0, 6): ['0.002s', '5000000bps'],
+    (2, 3): ['0.002s', '5000000bps'],
+    (3, 4): ['0.002s', '5000000bps'],
+    (4, 5): ['0.002s', '5000000bps'],
+    (6, 7): ['0.002s', '5000000bps'],
+    (8, 6): ['0.002s', '5000000bps'],
+    (9, 6): ['0.002s', '5000000bps'],
+    (10, 5): ['0.002s', '5000000bps'],
+    (10, 11): ['0.002s', '5000000bps'],
+    (12, 11): ['0.002s', '5000000bps'],
+    (12, 13): ['0.002s', '5000000bps']}
+link_to_ip_map = {   (0, 1): ('10.200.1.3/24', '10.200.1.1/24'),
+    (0, 2): ('10.20.30.9/24', '10.20.30.1/24'),
+    (0, 6): ('10.1.1.5/24', '10.1.1.1/24'),
+    (2, 3): ('10.20.30.1/24', '10.20.30.2/24'),
+    (3, 4): ('10.20.30.2/24', '10.20.30.3/24'),
+    (4, 5): ('10.20.30.3/24', '10.20.30.4/24'),
+    (6, 7): ('1.1.1.10/24', '1.1.1.1/24'),
+    (8, 6): ('2.3.5.6/24', '2.3.5.10/24'),
+    (9, 6): ('5.6.8.9/24', '5.6.8.10/24'),
+    (10, 5): ('10.20.30.6/24', '10.20.30.4/24'),
+    (10, 11): ('10.20.30.6/24', '10.20.30.7/24'),
+    (12, 11): ('10.20.30.8/24', '10.20.30.7/24'),
+    (12, 13): ('10.20.30.8/24', '10.20.30.5/24')}

File share/bg_topology.inet

+14	13
+12	0.000000	0.000000
+13	0.000000	0.000000
+10	0.000000	0.000000
+11	0.000000	0.000000
+8	0.000000	0.000000
+9	0.000000	0.000000
+0	0.000000	0.000000
+1	0.000000	0.000000
+2	0.000000	0.000000
+3	0.000000	0.000000
+4	0.000000	0.000000
+5	0.000000	0.000000
+6	0.000000	0.000000
+7	0.000000	0.000000
+12	13	1
+12	11	1
+10	11	1
+10	5	1
+8	6	1
+9	6	1
+0	1	1
+0	2	1
+0	6	1
+2	3	1
+3	4	1
+4	5	1
+6	7	1

File share/net_settings_tmp.py

+ipv4_net_addr_base = '10.7.0.1/24'
+link_attr_default = ['2ms','5Mbps']
+link_attr = {   (0, 1): ['0.01s', '10000000bps'],
+    (0, 2): ['0.01s', '10000000bps'],
+    (0, 3): ['0.01s', '10000000bps'],
+    (0, 4): ['0.01s', '10000000bps'],
+    (0, 5): ['0.01s', '10000000bps'],
+    (0, 6): ['0.01s', '10000000bps'],
+    (0, 7): ['0.01s', '10000000bps'],
+    (8, 0): ['0.01s', '10000000bps'],
+    (9, 0): ['0.01s', '10000000bps']}
+link_to_ip_map = {   (0, 1): ('10.0.7.5/24', '10.0.7.4/24'),
+    (0, 2): ('10.0.8.5/24', '10.0.8.4/24'),
+    (0, 3): ('10.0.9.5/24', '10.0.9.4/24'),
+    (0, 4): ('10.0.10.5/24', '10.0.10.4/24'),
+    (0, 5): ('10.0.11.5/24', '10.0.11.4/24'),
+    (0, 6): ('10.0.12.5/24', '10.0.12.4/24'),
+    (0, 7): ('10.0.13.5/24', '10.0.13.4/24'),
+    (8, 0): ('10.0.14.4/24', '10.0.14.5/24'),
+    (9, 0): ('10.0.15.4/24', '10.0.15.5/24')}
+
+pcap_nodes = [0, 1, 2]
+pcap_links = [(0, 2)]
+botmaster_id_set = []
+client_id_set = []
+server_id_set = []
+server_addr = []

File share/topology.inet

+10	9
+8	0.000000	0.000000
+9	0.000000	0.000000
+0	0.000000	0.000000
+1	0.000000	0.000000
+2	0.000000	0.000000
+3	0.000000	0.000000
+4	0.000000	0.000000
+5	0.000000	0.000000
+6	0.000000	0.000000
+7	0.000000	0.000000
+8	0	1
+9	0	1
+0	1	1
+0	2	1
+0	3	1
+0	4	1
+0	5	1
+0	6	1
+0	7	1
 # ./sim -e ComplexNetExperiment --net_settings=net_config/aro_demo/nf_net_settings.py -s file_exfiltration -t 1000 --Simulator=Visual
 # ./sim -e ComplexNetExperiment --net_settings=net_config/aro_demo/nf_net_settings.py -s file_exfiltration -t 100
 
-./sim -e ComplexNetExperiment --net_settings=net_config/aro_demo/nf_net_settings.py -s file_exfiltration -t 100 --back_traf=net_config/aro_demo/back_traf.py
+# ./sim -e ComplexNetExperiment --net_settings=net_config/aro_demo/nf_net_settings.py -s file_exfiltration -t 100 --back_traf=net_config/aro_demo/back_traf.py
+# ./sim -e ComplexNetExperiment --net_settings=net_config/aro_demo/nf_net_settings.py -s file_exfiltration -t 100
+# ./sim -e ComplexNetExperiment --net_settings=net_config/aro_demo/nf_net_settings.py -s ddos_ping_flooding -t 100
+./sim -e ComplexNetExperiment --net_settings=net_config/aro_demo/nf_net_settings.py -s file_exfiltration -t 100