예제 #1
0
    def setup(self):
        BaseClass.setup(self)
        # net_settings = self.load_net_settings()
        net_settings = self.load_para(
                f_name = settings.ROOT + '/' + self.options.net_settings,
                )
        self.load_exper_settings(net_settings)

        # Generate dot file that describe the background traffic.
        dot_file = self.gen_back_traf_dot(net_settings)

        ns3.LogComponentEnable("OnOffApplication", ns3.LOG_LEVEL_INFO)
        ns3.LogComponentEnable("V4PingApplication", ns3.LOG_LEVEL_INFO)
        self.load_exper_settings(net_settings)

        self.net = ManualTopologyNet(
                # os.path.abspath(self.options.topology_file),
                settings.ROOT + '/' + self.options.topology_file,
                self.options.topology_type,
                self.NodeCreator,
                net_settings,
                )
        bg_cofig = BackgroundTrafficConfig(dot_file, self.net)
        bg_cofig.config_onoff_app()

        self.net.set_trace()
        self._install_cmds(srv_addr = self.SERVER_ADDR)
        self.print_srv_addr()
        self._set_server_info()
        self.start_nodes()
예제 #2
0
    def setup(self):
        BaseClass.setup(self)

        net_settings = self.load_para(f_name=settings.ROOT + "/" + self.options.net_settings)
        self.load_exper_settings(net_settings)

        self.net = ComplexNet(self.NodeCreator, net_settings, routing_helper_list=self.routing_helper_list)

        ns3.LogComponentEnable("V4Ping", ns3.LOG_LEVEL_INFO)
        if self.options.back_traf:
            # Generate dot file that describe the background traffic.
            dot_file = self.gen_back_traf_dot(net_settings)
            ns3.LogComponentEnable("OnOffApplication", ns3.LOG_LEVEL_INFO)
            bg_cofig = BackgroundTrafficConfig(dot_file, self.net)
            bg_cofig.config_onoff_app()

        self.net.set_trace()
        print("finish running set_trace")
        self._install_cmds(srv_addr=self.SERVER_ADDR)
        # print('finish running install_cmds')
        self.print_srv_addr()
        # print('finish running print_srv_addr')
        self._set_server_info()
        # print('finish running set_server_info')

        self.start_nodes()
    def setup(self):
        BaseClass.setup(self)
        # net_settings = self.load_net_settings()
        net_settings = self.load_para(f_name=settings.ROOT + '/' +
                                      self.options.net_settings, )
        self.load_exper_settings(net_settings)

        # Generate dot file that describe the background traffic.
        dot_file = self.gen_back_traf_dot(net_settings)

        ns3.LogComponentEnable("OnOffApplication", ns3.LOG_LEVEL_INFO)
        ns3.LogComponentEnable("V4PingApplication", ns3.LOG_LEVEL_INFO)
        self.load_exper_settings(net_settings)

        self.net = ManualTopologyNet(
            # os.path.abspath(self.options.topology_file),
            settings.ROOT + '/' + self.options.topology_file,
            self.options.topology_type,
            self.NodeCreator,
            net_settings,
        )
        bg_cofig = BackgroundTrafficConfig(dot_file, self.net)
        bg_cofig.config_onoff_app()

        self.net.set_trace()
        self._install_cmds(srv_addr=self.SERVER_ADDR)
        self.print_srv_addr()
        self._set_server_info()
        self.start_nodes()