Example #1
0
def get_CM():
    cm = ConnMatrix()

    cm.add('192.168.0.1', r'192.168.0.2')
    cm.add('192.168.0.2', r'192.168.0.3')
    cm.add('192.168.0.3', r'192.168.0.4')
    cm.add('192.168.0.4', r'192.168.0.1')
    return cm
Example #2
0
def try_it():
    host = ''
    cm = ConnMatrix()

    cm.add('192.168.0.1', r'192.168.0.2')
    cm.add('192.168.0.2', r'192.168.0.3')
    cm.add('192.168.0.3', r'192.168.0.4')
    cm.add('192.168.0.4', r'192.168.0.1')

    iperf_start_clients_new(host, cm)
Example #3
0
def exp_line(use):
    assert(use == "dot" or use == "new" or use == "old")

    host_out_dir = makeout('~/data/10_line', use)

    cm = ConnMatrix()
    cm.add('192.168.0.1', r'192.168.0.4')
    iperf_start_clients(host_out_dir, cm)

    run_react(host_out_dir, use)
Example #4
0
def iperf_test(c):
    """Tests iperf on one of the nodes. """
    global USERNAME
    global HOSTS
    group = ThreadingGroup(*HOSTS)

    cm = ConnMatrix()
    cm.add('192.168.0.1', r'192.168.0.2', '6Mbps')
    cm.add('192.168.0.2', r'192.168.0.3', '6Mbps')
    cm.add('192.168.0.3', r'192.168.0.4', '6Mbps')
    cm.add('192.168.0.4', r'192.168.0.1', '6Mbps')

    for conn in group:
        iperf_start_clients(conn, f"/users/{USERNAME}/", cm)
Example #5
0
def exp_concept(enable_react):
    enable_react = bool(strtobool(enable_react))

    subdir = 'react_on' if enable_react else 'react_off'
    host_out_dir = makeout('~/data/01_concept', subdir)

    cm = ConnMatrix()
    cm.add('192.168.0.1', r'192.168.0.2')
    cm.add('192.168.0.2', r'192.168.0.3')
    cm.add('192.168.0.3', r'192.168.0.4')
    cm.add('192.168.0.4', r'192.168.0.1')
    iperf_start_clients(host_out_dir, cm)

    run_react(host_out_dir, 'new' if enable_react else None)
Example #6
0
def exp_4con(use):
    assert(use == "dot" or use == "new" or use == "old" or use == 'oldest')

    host_out_dir = makeout('~/data/01_4con', use)

    cm = ConnMatrix()
    cm.add('192.168.0.1', r'192.168.0.2')
    cm.add('192.168.0.2', r'192.168.0.3')
    cm.add('192.168.0.3', r'192.168.0.4')
    cm.add('192.168.0.4', r'192.168.0.1')
    iperf_start_clients(host_out_dir, cm, tcp=True)

    if use != 'oldest':
        run_react(host_out_dir, use)
    else:
        run_react2(host_out_dir)
Example #7
0
    def start_exp(use):
        host_out_dir = makeout('~/data/star/{}'.format(use))

        if use == 'new':
            run_react(host_out_dir, use)
        else:
            stop_react()
            stop_react2()

        udp_cm = new_topo('star')
        rtp_cm = ConnMatrix()
        rtp_cm.add('192.168.0.1', r'192.168.0.5')
        # rtp_cm.add('192.168.0.2', r'NONE')
        # rtp_cm.add('192.168.0.3', r'NONE')
        # rtp_cm.add('192.168.0.4', r'NONE')
        rtp_cm.add('192.168.0.5', r'NONE')

        mm = MeasMatrix()
        mm.add('192.168.0.1', r'192.168.0.5')
        mm.add('192.168.0.5', r'NONE')

        setup_measurement(mm, host_out_dir)

        print('Starting iperf servers')
        iperf_start_servers()
        print('Starting opus receivers')
        opus_start_receivers_new(host_out_dir, rtp_cm)
        print('Waiting for servers to start up')
        time.sleep(10)

        print('Starting iperf streams')
        iperf_start_clients(host_out_dir, udp_cm, tcp=False)
        print('Waiting for iperf streams to start')
        time.sleep(5)
        print('Starting opus streamers')
        opus_start_streamers_new(host_out_dir, rtp_cm)

        print('Giving stream a while to start')
        time.sleep(10)

        print('Starting Qosium')
        start_qos_measurement(mm)

        print('Waiting -- Running experiment')
        time.sleep(120)

        stop_qos_measurement(mm)
Example #8
0
def exp_test(enable_react=False, tcp=True):
    if isinstance(enable_react, basestring):
        enable_react = bool(strtobool(enable_react))
    if isinstance(tcp, basestring):
        tcp = bool(strtobool(tcp))

    host_out_dir = makeout()

    cm = ConnMatrix()
    cm.add('192.168.0.1', r'192.168.0.2')
    cm.add('192.168.0.2', r'192.168.0.3')
    cm.add('192.168.0.3', r'192.168.0.4')
    cm.add('192.168.0.4', r'192.168.0.1')
    iperf_start_clients(host_out_dir, cm)

    if enable_react:
        run_react(host_out_dir, tcp=tcp)
Example #9
0
def ping_test(c):
    """Tests pings for the nodes."""
    global USERNAME
    global HOSTS
    group = ThreadingGroup(*HOSTS)

    cm = ConnMatrix()
    cm.add('192.168.0.1', r'192.168.0.3', '6Mbps')
    cm.add('192.168.0.3', r'192.168.0.1', '6Mbps')

    first = True
    for conn in group:
        if first:
            tos = '0xe0'
            first = False
        else:
            tos = '0x00'

        start_pings(conn, f"/users/{USERNAME}/", cm, tos=tos)
Example #10
0
    def multi(use, tcp):
        host_out_dir = multi_makeout(use, tcp)

        if use == 'react':
            status = json.loads(fab.run(
                    '{}/reservation/reserver.py get_status {}'.format(
                    project_path, get_my_ip())))
            capacity = float(status['capacity'])/100.0
            allocation = float(status['allocation'])/100.0
            run_react(host_out_dir, use, capacity=capacity, prealloc=allocation)
        else:
            stop_react()
            stop_react2()

        cm = ConnMatrix()
        cm.add('192.168.0.1', last)
        cm.add(last, r'NONE')
        #roadtrip_start_clients(host_out_dir, cm, tcp)
        iperf_start_clients(host_out_dir, cm, tcp)
Example #11
0
def exp_longline(dot, udp=True, flows=1):
    #NAME = '{}lowflow'.format(flows)
    NAME = 'manyflow'.format(flows)

    cm = ConnMatrix()
    cm.add('192.168.0.1', r'192.168.0.2$')
    cm.add('192.168.0.2', r'192.168.0.1$')
    cm.add('192.168.0.3', r'192.168.0.4$')
    cm.add('192.168.0.4', r'192.168.0.3$')
    cm.add('192.168.0.5', r'192.168.0.6$')
    cm.add('192.168.0.6', r'192.168.0.5$')
    cm.add('192.168.0.7', r'192.168.0.8$')
    cm.add('192.168.0.8', r'192.168.0.7$')
    cm.add('192.168.0.9', r'192.168.0.10$')
    cm.add('192.168.0.10', r'192.168.0.9$')

    trial = '{}_{}_{}'.format(NAME, 'udp' if udp else 'tcp',
            'dot' if dot else 'new')
    host_out_dir = makeout('~/data/11_longline', trial)

    iperf_start_clients(host_out_dir, cm, tcp=not(udp))
    #iperf_start_clients(host_out_dir, cm, rate='1M')
    run_react(host_out_dir, 'dot' if dot else 'new')
Example #12
0
def get_conn_matrices(type, qos_node_flow_type, qos_node):
    """Builds a ConnMatrix object based on the parameters passed in. Basically a 
    helper function to simplify the code in the screening() function. """

    extra_cm = None
    cm = ConnMatrix()
    qos_ip = '192.168.0.1'
    if type == 'complete':
        cm.add('192.168.0.1', r'192.168.0.2', '3Mbps')
        cm.add('192.168.0.2', r'192.168.0.3', '1Mbps')
        cm.add('192.168.0.3', r'192.168.0.4', '1Mbps')
        cm.add('192.168.0.4', r'192.168.0.1', '1Mbps')
        if qos_node_flow_type == 'BE_QoS':
            extra_cm = ConnMatrix()  # extra cm will always be the BE flow
            extra_cm.add('192.168.0.1', r'192.168.0.3', '1Mbps')
            extra_cm.add('192.168.0.3', r'NONE', '0.0Mbps')
        qos_ip = '192.168.0.1'
    elif type == 'line':
        if qos_node == 'node1':
            cm.add('192.168.0.1', r'192.168.0.2', '3Mbps')
            cm.add('192.168.0.2', r'192.168.0.1', '1Mbps')
            cm.add('192.168.0.3', r'192.168.0.4', '1Mbps')
            cm.add('192.168.0.4', r'192.168.0.3', '1Mbps')
            if qos_node_flow_type == 'BE_QoS':
                extra_cm = ConnMatrix()  # extra cm will always be the BE flow
                extra_cm.add('192.168.0.1', r'192.168.0.2', '1Mbps')
                extra_cm.add('192.168.0.2', r'NONE', '0.0Mbps')
            qos_ip = '192.168.0.1'
        elif qos_node == 'node2':
            cm.add('192.168.0.1', r'192.168.0.2', '1Mbps')
            cm.add('192.168.0.2', r'192.168.0.1', '3Mbps')
            cm.add('192.168.0.3', r'192.168.0.4', '1Mbps')
            cm.add('192.168.0.4', r'192.168.0.3', '1Mbps')
            if qos_node_flow_type == 'BE_QoS':
                extra_cm = ConnMatrix()  # extra cm will always be the BE flow
                extra_cm.add('192.168.0.2', r'192.168.0.3', '1Mbps')
                extra_cm.add('192.168.0.3', r'NONE', '0.0Mbps')
            qos_ip = '192.168.0.2'
        elif qos_node == 'node3':
            cm.add('192.168.0.1', r'192.168.0.2', '1Mbps')
            cm.add('192.168.0.2', r'192.168.0.1', '1Mbps')
            cm.add('192.168.0.3', r'192.168.0.4', '3Mbps')
            cm.add('192.168.0.4', r'192.168.0.3', '1Mbps')
            if qos_node_flow_type == 'BE_QoS':
                extra_cm = ConnMatrix()  # extra cm will always be the BE flow
                extra_cm.add('192.168.0.3', r'192.168.0.2', '1Mbps')
                extra_cm.add('192.168.0.2', r'NONE', '0.0Mbps')
            qos_ip = '192.168.0.3'
        elif qos_node == 'node4':
            cm.add('192.168.0.1', r'192.168.0.2', '1Mbps')
            cm.add('192.168.0.2', r'192.168.0.1', '1Mbps')
            cm.add('192.168.0.3', r'192.168.0.4', '1Mbps')
            cm.add('192.168.0.4', r'192.168.0.3', '3Mbps')
            if qos_node_flow_type == 'BE_QoS':
                extra_cm = ConnMatrix()  # extra cm will always be the BE flow
                extra_cm.add('192.168.0.4', r'192.168.0.3', '1Mbps')
                extra_cm.add('192.168.0.3', r'NONE', '0.0Mbps')
            qos_ip = '192.168.0.4'
    return cm, extra_cm, qos_ip
Example #13
0
def new_topo(tname):
    cm = ConnMatrix()
    if tname == 'star':
        cm.add('192.168.0.1', r'NONE')
        cm.add('192.168.0.2', r'192.168.0.5')
        cm.add('192.168.0.3', r'192.168.0.5')
        cm.add('192.168.0.4', r'192.168.0.5')
        cm.add('192.168.0.5', r'NONE')
    elif tname == '3hop':
        cm.add('192.168.0.1', r'192.168.0.2')
        cm.add('192.168.0.2', r'192.168.0.3')
        cm.add('192.168.0.3', r'192.168.0.2')
        cm.add('192.168.0.4', r'192.168.0.3')
    elif tname == 'complete_flow':
        cm.add('192.168.0.1', r'NONE')
        cm.add('192.168.0.2', r'192.168.0.3')
        cm.add('192.168.0.3', r'192.168.0.4')
        cm.add('192.168.0.4', r'192.168.0.1')
    elif tname == 'complete_cross':
        cm.add('192.168.0.1', r'192.168.0.3')
        cm.add('192.168.0.2', r'192.168.0.4')
        cm.add('192.168.0.3', r'192.168.0.1')
        cm.add('192.168.0.4', r'192.168.0.2')
    elif tname == 'single_hop_single_flow':
        cm.add('192.168.0.1', r'192.168.0.2')
        cm.add('192.168.0.2', r'NONE')
    elif tname == 'single_hop_duplex_flow':
        cm.add('192.168.0.1', r'192.168.0.2')
        cm.add('192.168.0.2', r'192.168.0.1')
    elif tname == 'new_single_udp':
        cm.add('192.168.0.1', r'192.168.0.2')
        cm.add('192.168.0.4', r'192.168.0.2')
        cm.add('192.168.0.3', r'192.168.0.2')
        cm.add('192.168.0.5', r'192.168.0.2')
        cm.add('192.168.0.6', r'192.168.0.2')
        cm.add('192.168.0.2', r'NONE')
    elif tname == 'new_single_rtp':
        cm.add('192.168.0.2', r'192.168.0.6')
        cm.add('192.168.0.6', r'NONE')
    elif tname == 'exposed':
        cm.add('192.168.0.2', r'192.168.0.1')
        cm.add('192.168.0.1', r'NONE')
        cm.add('192.168.0.3', r'192.168.0.4')
        cm.add('192.168.0.4', r'NONE')
    else:
        assert False, 'Topo does not exist right now mate'

    return cm
Example #14
0
def topo(tname, host_out_dir, tcp):
    cm = ConnMatrix()

    if tname == 'star':
        cm.add('192.168.0.1', r'192.168.0.5')
        cm.add('192.168.0.2', r'192.168.0.5')
        cm.add('192.168.0.3', r'192.168.0.5')
        cm.add('192.168.0.4', r'192.168.0.5')
        cm.add('192.168.0.5', r'NONE')
    elif tname == '3hop':
        cm.add('192.168.0.1', r'192.168.0.2')
        cm.add('192.168.0.2', r'192.168.0.3')
        cm.add('192.168.0.3', r'192.168.0.2')
        cm.add('192.168.0.4', r'192.168.0.3')
    elif tname == 'bae':
        cm.add('192.168.0.1', r'192.168.0.2')
        cm.add('192.168.0.2', r'192.168.0.3')
        cm.add('192.168.0.3', r'192.168.0.4')
        cm.add('192.168.0.4', r'192.168.0.1')
    else:
        assert False, 'Topo does not exist right now mate'

    iperf_start_clients(host_out_dir, cm, tcp)
Example #15
0
    def multi(use, stream):
        host_out_dir = multi_makeout(use, stream) 
        print('OUT DIR: {}'.format(host_out_dir)) 
        if use == 'new':
            status = json.loads(fab.run(
                    '{}/reservation/reserver.py get_status {}'.format(
                    project_path, get_my_ip())))
            capacity = float(status['capacity'])/100.0
            allocation = float(status['allocation'])/100.0
            # if get_my_ip() == '192.168.0.1':
            #     allocation = 5.0/100.0
            # elif get_my_ip() == '192.168.0.2':
            #     allocation = 35.0/100.0
            # elif get_my_ip() == '192.168.0.3':
            #     allocation = 35.0/100.0
            # else:
            #     allocation = 5.0/100.0

            run_react(host_out_dir, use, capacity=capacity, prealloc=allocation)
        else:
            stop_react()
            stop_react2()

        cm = ConnMatrix()
        cm.add('192.168.0.1', last)
        cm.add(last, r'NONE')

        # congestion_cm = ConnMatrix()
        # congestion_cm.add('192.168.0.1', last)
        # congestion_cm.add(last, r'NONE')

        mm = MeasMatrix()
        mm.add('192.168.0.1', last)
        mm.add(last, r'NONE')

        setup_measurement(mm, host_out_dir)


        if stream == 'opus':
            print('Starting iperf servers')
            iperf_start_servers()
            print('Starting opus receivers')
            opus_start_receivers_new(host_out_dir, cm)
            print('Waiting for receivers to start up')
            time.sleep(10)

            # Below is the congestion streams, commented out to see RTP performance
            # print('Starting iperf streams')
            # iperf_start_clients(host_out_dir, congestion_cm, tcp=False)
            # print('Waiting for iperf streams to start')
            # time.sleep(5)
            print('Starting opus streamers')
            opus_start_streamers_new(host_out_dir, cm)

        elif stream == 'iperf':
            print('Starting iperf servers')
            iperf_start_servers()
            print('Waiting for server startup')
            time.sleep(10)

            print('Starting iperf clients -- 1G')
            iperf_start_clients(host_out_dir, cm, tcp=False)
        elif stream == 'iperf_low':
            print('Starting iperf servers')
            iperf_start_servers()
            print('Waiting for server startup')
            time.sleep(10)

            print('Starting iperf clients -- 1M')
            iperf_start_clients(host_out_dir, cm, tcp=False, rate='1M')

        print('Giving streams a while to start')
        time.sleep(10)

        print('Starting Qosium')
        start_qos_measurement(mm)

        print('Waiting -- running experiment')
        time.sleep(120)

        stop_qos_measurement(mm)