Пример #1
0
def run_iperf_experiment(exp_params):
    completed_experiment_procs = []
    exp = ''
    num_completed_experiments = 0
    for params in exp_params:
        try:
            num_flows = params[0]
            ccalg = params[1]
            duration = params[2]
            btlbw, rtt, queue_size = params[3]

            util.log_current_experiment(num_completed_experiments, exp_params,
                                        params)
            if (util.is_rtt_too_small(rtt)):
                continue

            experiment_name = '{}-{}bw-{}rtt-{}q-{}iperf-{}s'.format(
                ccalg, btlbw, rtt, queue_size, num_flows, duration)
            flow_structure = util.get_flow_structure(ccalg, duration, rtt)
            flows = util.create_flows(flow_structure, const.FLOW_KIND_IPERF,
                                      num_flows, HOST_CLIENT,
                                      const.CLIENT_PORT, const.SERVER_PORT)
            exp = util.create_experiment(btlbw, queue_size, flows,
                                         experiment_name, HOST_CLIENT,
                                         HOST_SERVER, None)
            logging.info('Running experiment: {}'.format(exp.name))
            util.clean_tcpdump(exp)
            flowImpl.start_bess_for_iperf(exp, duration)
            completed_experiment_procs = util.run_post_experiment_process(
                experiment_name, exp, completed_experiment_procs)
        except Exception as e:
            util.handle_exception(e, exp)
    return completed_experiment_procs
def create_iperf_flows(primaryWebsite, secondaryLink, rtt, duration,
                       number_of_flows, ccalg, client_port, server_port):
    flow_structure = util.get_flow_structure(ccalg, duration, rtt)
    flows = util.create_flows(flow_structure, const.FLOW_KIND_IPERF,
                              number_of_flows, HOST_CLIENT, client_port,
                              server_port)
    return flows, HOST_CLIENT
Пример #3
0
def run_web_video_experiment(exp_params):
    completed_experiment_procs = []
    exp = ''
    for params in exp_params:
        try:
            website, url = params[0]
            num_flows = params[1]
            duration = params[2]
            btlbw, rtt, queue_size = params[3]

            (url_ip, website_rtt, video_server_host,
             video_url_ip) = util.get_web_video_details(url)

            if website_rtt >= rtt:
                logging.warning(
                    'Skipping experiment with website RTT {} >= {}'.format(
                        website_rtt, rtt))
                continue
                # return (-1, '')

            (host_client) = util.get_host_client(url_ip)
            server_nat_ip = HOST_CLIENT.ip_wan

            experiment_name = '{}bw-{}rtt-{}q-{}-{}s'.format(
                btlbw, rtt, queue_size, website, duration)
            delay = rtt - website_rtt
            flow_structure = util.get_flow_structure(website, duration, delay)
            flows = util.create_flows(flow_structure,
                                      const.FLOW_KIND_WEB_VIDEO, 1,
                                      host_client, const.CLIENT_PORT,
                                      const.SERVER_PORT)
            exp = util.create_experiment(btlbw, queue_size, flows,
                                         experiment_name, host_client,
                                         HOST_SERVER, server_nat_ip)
            logging.info('Running experiment: {}'.format(exp.name))
            util.clean_tcpdump(exp)

            web_data = util.create_web_info(website, url, website_rtt, rtt,
                                            delay, url_ip, duration, 1,
                                            video_url_ip, video_server_host)
            flowImpl.start_bess_for_web_video(exp, duration, web_data)
            completed_experiment_procs = util.run_post_experiment_process(
                experiment_name, exp, completed_experiment_procs)
        except Exception as e:
            util.handle_exception(e, exp)
    return completed_experiment_procs
def create_website_flows(primaryWebsite, secondaryLink, rtt, duration,
                         number_of_flows, ccalg, client_port, server_port):
    url_ip, website_rtt = util.get_website_details(secondaryLink)

    if website_rtt >= rtt:
        logging.warning('Skipping experiment with website RTT {} >= {}'.format(
            website_rtt, rtt))
        raise Exception('Website RTT{} >= {}', website_rtt, rtt)

    (host_client) = util.get_host_client(url_ip)
    delay = rtt - website_rtt
    flow_structure = util.get_flow_structure(primaryWebsite, duration, delay)

    web_data = util.create_web_info(primaryWebsite, secondaryLink, website_rtt,
                                    rtt, delay, url_ip, duration,
                                    number_of_flows)

    flows = util.create_flows(flow_structure, const.FLOW_KIND_WEBSITE,
                              number_of_flows, host_client, client_port,
                              server_port, web_data)
    return flows, host_client