コード例 #1
0
def run_mul_flow_test(num_flows, is_ccp, alg, filename, results_dir):
    paths.rm_cwnd_files()
    kill_procs()
    prefix = log_prefix(num_flows, is_ccp, alg, results_dir)
    downlink_log = "{}.log".format(prefix)
    ccp_log = "{}.ccp-log".format(prefix)
    mm_graph_pdf = "{}.pdf".format(prefix)

    if is_ccp:
        paths.start_ccp_congavoid(alg, ccp_log)
        paths.start_quic_server("ccp")
    else:
        paths.start_quic_server(alg)

    time.sleep(7)

    client_proc = run_mul_client_shell(downlink_log, num_flows, filename)
    client_proc.wait()
    kill_procs()

    ports = paths.find_port_numbers()
    paths.rm_cwnd_files()

    # do mm-graph with port numbers
    paths.mulflow_mm_graph_save(downlink_log, 20, mm_graph_pdf, ports)
コード例 #2
0
def run_single_lossy_exp(bw, delay, alg, filename, filesize, trial, results_dir, is_ccp, graph_cwnd, stats_file = None):
    paths.rm_cwnd_files()
    kill_rogue_processes()
    downlink_log = "{}.log".format(lossy_log_prefix(bw, delay, alg, filesize, trial, is_ccp, results_dir))
    epslog = "{}.eps".format(lossy_log_prefix(bw, delay, alg, filesize, trial, is_ccp, results_dir))
    if is_ccp:
        real_alg = "ccp {}".format(alg)
    else:
        real_alg = alg
    plot_title = "'Lossy, BW: {}, Delay: {}, Alg: {}, Filesize: {}MB, Trial: {}'".format(bw, delay, real_alg, filesize, trial)

    # if ccp, get ccp logname, and start ccp
    # function to start ccp depends on which algorithm is running
    if is_ccp:
        ccp_logname = "{}.ccp-log".format(lossy_exp_prefix(bw, delay, alg, filesize, trial, results_dir))
        if alg == RENO or alg == CUBIC:
            paths.start_ccp_congavoid(alg, ccp_logname)
        else: # alg must be BBR
            paths.start_ccp_bbr(ccp_logname)
        paths.start_quic_server("ccp")
    else:
        paths.start_quic_server(alg) # either reno, cubic, or bbr

    time.sleep(paths.SLEEPTIME) # wait for the server to setup before sending

    # start lossy client mahimahi
    client_proc = start_lossy_client_mahimahi(paths.gen_mahimahi_trace(bw), delay, downlink_log, filename)
    client_proc.wait()

    # kill ccp, kill quic server
    paths.kill_process("quic_server")
    paths.kill_process(alg)

    # move the cwnd log to the correct place
    if graph_cwnd:
        time.sleep(10)
        cwnd_log = "{}.cwnd-log".format(lossy_log_prefix(bw, delay, alg, filesize, trial, is_ccp, results_dir))
        paths.move_file(get_cwnd_file(), cwnd_log)

   # produce the mm-graph, and parse throughput delay information
    mm_graph_log = paths.mm_graph_save(downlink_log, int(delay*2), plot_title)
    info = paths.parse_mm_graph_output(mm_graph_log)
    if stats_file:
        info[ALG] = alg
        info[TRACE] = bw
        info[SCENARIO] = LOSSY
        info[DELAY] = delay
        info[FILESIZE] = filesize
        if is_ccp:
            info[IS_CCP] = "CCP"
        else:
            info[IS_CCP] = "QUIC"
        write_stats_file(stats_file, info)

    return
コード例 #3
0
def run_single_exp(results_folder, num_clients, alg, is_ccp, filename,
                   filesize, trial):
    kill_rogue_processes()
    if is_ccp:
        ccp_logname = get_ccp_logname(num_clients, alg, filesize, trial)
        full_alg_name = "ccp{}".format(alg)
        paths.start_ccp_congavoid(alg, ccp_logname)
        paths.start_quic_server("ccp")
    else:
        paths.start_quic_server(alg)

    time.sleep(10)
    client_procs = []
    for i in range(num_clients):
        client_process = start_localhost_client(
            filename,
            client_logname(i, num_clients, alg, filesize, trial, is_ccp))
        client_procs.append(client_process)
    for proc in client_procs:
        proc.wait()

    if is_ccp:
        paths.kill_process(alg)
        paths.move_file(get_ccp_logname(num_clients, alg, filesize, trial),
                        results_folder)
        paths.rm_cwnd_files()  # cleanup

    paths.kill_process("quic_server")

    # now go through client logs and get the timing information
    client_data = []
    for i in range(num_clients):
        logname = client_logname(i, num_clients, alg, filesize, trial, is_ccp)
        data = parse_time(logname)
        paths.move_file(logname, results_folder)
        try:
            timedata = float(data)
            bytes_transferred = quic_file_size(filesize)
            client_data.append({
                BYTES: bytes_transferred,
                TIME_TAKEN: timedata
            })
        except:
            timedata = 0
    return client_data