Ejemplo n.º 1
0
def test_l3_perf_tc_12_1():
    pre_test_l3_fwding()

    vars = st.get_testbed_vars()
    # Config 2 IPV4 interfaces on DUT.
    (tg1, _, tg_ph_1, _) = get_handles()
    dut1 = vars.D1
    port1 = vars.D1T1P1

    ipfeature.get_interface_ip_address(dut1, family="ipv4")
    ipfeature.get_interface_ip_address(dut1, family="ipv6")
    ipfeature.show_ip_route(dut1)
    interface_status_show(dut1)

    tr1 = create_l3_host(tg1, tg_ph_1, 8000)

    # Verified ARP and counters at the DUT.
    cmd = "show arp | grep Total"
    default_arp = arpapi.get_arp_count(dut1)
    st.log("Total ARP entries: {}".format(default_arp))
    measure_arp_learn_time(dut1, default_arp, 8000, cmd, False)

    #shut the link and make sure all the entries deleted from the hw
    interface_operation(dut1, port1, operation="shutdown")
    st.wait(15)
    cmd = 'bcmcmd "l3 l3table show" | wc -l'
    output = bcm_show(dut1, cmd)
    st.log(output)
    curr_arp = parse_route_output(output)

    if (curr_arp != default_arp):
        st.log("cleaning up host entries from HW failed" + str(curr_arp) +
               str(default_arp))

    interface_operation(dut1, port1, operation="startup")

    #Now measure the hardware performance
    cmd = 'bcmcmd "l3 l3table show" | wc -l'
    output = bcm_show(dut1, cmd)
    st.log(output)
    default_arp = parse_route_output(output)
    measure_arp_learn_time(dut1, default_arp, 8000, cmd, True)

    tg1.tg_traffic_control(action='stop', handle=tr1['stream_id'])
    tg1.tg_traffic_control(action='reset', port_handle=tg_ph_1)

    post_test_l3_fwding()
    st.report_pass("test_case_passed")
Ejemplo n.º 2
0
def test_l3_host_scaling_tc5_1():
    pre_test_l3_fwding()

    vars = st.get_testbed_vars()
    # Config 2 IPV4 interfaces on DUT.
    (tg1, _, tg_ph_1, _) = get_handles()
    dut1 = vars.D1
    ipfeature.get_interface_ip_address(dut1, family="ipv4")
    ipfeature.get_interface_ip_address(dut1, family="ipv6")
    ipfeature.show_ip_route(dut1)
    ifapi.interface_status_show(dut1)

    tr1 = create_l3_host(tg1, tg_ph_1, 8000, 5)
    st.wait(15)

    # Verified ARP and counters at the DUT.
    total_in_sw = arpfeature.get_arp_count(dut1)
    st.log("Total ARP entries: {}".format(total_in_sw))
    #We expect all 8k host entries should be programmed in hw within 32secs
    st.wait(20)
    output = bcm_show(dut1, 'bcmcmd "l3 l3table show" | wc -l')
    total_in_hw = parse_route_output(output)

    tg1.tg_traffic_control(action='stop', handle=tr1['stream_id'])
    tg1.tg_traffic_control(action='reset', port_handle=tg_ph_1)

    post_test_l3_fwding()
    if (total_in_sw >= data.max_host_1 and total_in_hw >= data.max_host_1):
        st.report_pass("test_case_passed")
    else:
        st.report_fail("test_case_failed")
Ejemplo n.º 3
0
def test_l3_perf_tc_14_1():
    pre_test_l3_fwding()

    vars = st.get_testbed_vars()
    # Config 2 IPV4 interfaces on DUT.
    (tg1, _, tg_ph_1, _) = get_handles()
    dut1 = vars.D1
    ipfeature.get_interface_ip_address(dut1, family="ipv4")
    ipfeature.show_ip_route(dut1)
    interface_status_show(dut1)

    tr1 = create_l3_host(tg1, tg_ph_1, 10000)

    st.wait(15)

    # Verified ARP and counters at the DUT.
    output = bcm_show(dut1, "time show arp")
    st.log(output)
    tg1.tg_traffic_control(action='stop',
                           handle=tr1['stream_id'],
                           max_wait_timer=10)
    tg1.tg_traffic_control(action='reset', port_handle=tg_ph_1)

    post_test_l3_fwding()
    st.report_pass("test_case_passed")
Ejemplo n.º 4
0
def test_l3_perf_tc_14_2():
    vars = st.get_testbed_vars()
    dut2 = vars.D2

    if (data.l3_intf is False):
        output = bcm_show(dut2, 'bcmcmd "l3 intf show" | wc -l')
        st.log(output)
        default_intf_count = parse_route_output(output)

        create_l3_interface(dut2, 1000, 1, default_intf_count)
        data.l3_intf = True
        st.log(data.result)

        #data.oct1 = 10
        #data.oct2 = 0
        #data.oct3 = 1
        #data.oct4 = 1
        #create_l3_interface(dut1, 1000, 0, default_intf_count)
        #clean-up using range command
        #cmd = "config vlan range del 1 1000"

        st.report_pass("test_case_passed")
    else:
        if (data.result[4] == 1):
            st.report_pass("test_case_passed")
        else:
            st.report_pass("test_case_failed")
Ejemplo n.º 5
0
def test_l3_host_scaling_tc5_2():
    pre_test_l3_fwding()

    vars = st.get_testbed_vars()
    (tg1, _, tg_ph_1, _) = get_handles()
    dut1 = vars.D1
    ipfeature.get_interface_ip_address(dut1)

    cnt = 0
    pass_flag = True
    host_count = 32000
    curr_count = 8000
    wait_time = 15
    duration = 8

    #Send burst of 8k upto 32k max
    create_l3_host(tg1, tg_ph_1, host_count, duration)
    while (cnt <= 3 and pass_flag):
        st.wait(wait_time)

        # Verified ARP and counters at the DUT.
        total = arpfeature.get_arp_count(dut1)
        st.log("Total ARP entries: {}".format(total))

        bcm_show(dut1, 'bcmcmd "l3 l3table show" | wc -l')
        if (total >= curr_count):
            curr_count += 8000
        else:
            pass_flag = False
        cnt += 1

    #Make sure all the entries programmed in the hw
    st.wait(90)
    bcm_show(dut1, 'bcmcmd "l3 l3table show" | wc -l')

    post_test_l3_fwding()
    if (pass_flag):
        st.report_pass("test_case_passed")
    else:
        st.report_fail("test_case_failed")
Ejemplo n.º 6
0
def measure_arp_learn_time(dut1, default_arp, max_arp, cmd, hw):
    sleep_time = 10
    st.log("Number of ARP's in the beginning %d" % (default_arp))
    curr_arp = default_arp
    arp_in_this_poll = default_arp
    prev_poll_count = 0
    record_start_time = 0
    #initialize for error handling
    start_time = datetime.datetime.now()

    while (curr_arp < max_arp):
        now = datetime.datetime.now()
        output = bcm_show(dut1, cmd)
        prev_poll_count = arp_in_this_poll
        if (hw):
            arp_in_this_poll = parse_route_output(output) - curr_arp
        else:
            arp_in_this_poll = parse_output(output) - curr_arp

        #no more entries learnt, break!
        if (prev_poll_count == arp_in_this_poll):
            break

        if arp_in_this_poll > 0 and record_start_time == 0:
            start_time = now
            st.log("Time when the first arp was installed %s " %
                   (str(start_time)))
            sleep_time = 10
            record_start_time = 1
        #st.log start_time
        curr_arp = curr_arp + arp_in_this_poll
        after = datetime.datetime.now()
        st.log(" [%s]: increment %d curr_arp %d " %
               (str(after), arp_in_this_poll, curr_arp))
        if curr_arp == max_arp:
            break
        st.wait(sleep_time)

    end_time = datetime.datetime.now()
    st.log("Time when all the arp's were installed %s" % (str(end_time)))
    #st.log end_time
    diff = (end_time - start_time).total_seconds()
    st.log("total time is %d" % (int(diff)))
Ejemplo n.º 7
0
def measure_route_learn_time(dut1, default_route, max_route, cmd):
    sleep_time = 10
    st.log("Number of route's in the beginning %d" % (default_route))
    curr_route = default_route
    route_in_this_poll = default_route
    prev_poll_count = 0
    record_start_time = 0
    #initialize for error handling
    start_time = datetime.datetime.now()

    while (curr_route < max_route):
        now = datetime.datetime.now()
        output = bcm_show(dut1, cmd)
        prev_poll_count = route_in_this_poll
        route_in_this_poll = parse_route_output(output) - curr_route

        #no more entries learnt, break!
        if (prev_poll_count == route_in_this_poll):
            break

        if route_in_this_poll > 0 and record_start_time == 0:
            start_time = now
            st.log("Time when the first route was installed %s " %
                   (str(start_time)))
            sleep_time = 10
            record_start_time = 1
        #st.log start_time
        curr_route = curr_route + route_in_this_poll
        after = datetime.datetime.now()
        st.log(" [%s]: increment %d curr_route %d " %
               (str(after), route_in_this_poll, curr_route))
        if curr_route == max_route:
            break
        st.wait(sleep_time)

    end_time = datetime.datetime.now()
    st.log("Time when all the route's were installed %s" % (str(end_time)))
    #st.log end_time
    diff = (end_time - start_time).total_seconds()
    st.log("total time is %d" % (int(diff)))
Ejemplo n.º 8
0
def measure_v4_route_scale_time(route_count, show_flag):
    vars = st.get_testbed_vars()
    dut = vars.D1
    default_route = 0
    #TG pumps 512k per sec so to make measure route install
    #time more accurate we start from 600k + route_count
    #base_route_count = 60000 + route_count
    base_route_count = route_count

    ipfeature.clear_ip_configuration(st.get_dut_names())
    ipfeature.clear_ip_configuration(st.get_dut_names(), 'ipv6')

    member3 = vars.D1T1P1
    member4 = vars.D1T1P2
    ipfeature.config_ip_addr_interface(dut,
                                       member3,
                                       data.my_ip_addr,
                                       data.ip_prefixlen,
                                       family="ipv4")
    ipfeature.config_ip_addr_interface(dut,
                                       member4,
                                       data.intf_ip_addr,
                                       data.ip_prefixlen,
                                       family="ipv4")

    ipfeature.get_interface_ip_address(dut, family="ipv4")
    ipfeature.show_ip_route(dut)
    interface_status_show(dut)

    bgpfeature.create_bgp_router(dut, data.as_num, '')
    bgpfeature.create_bgp_neighbor(dut, data.as_num, data.neigh_ip_addr,
                                   data.remote_as_num)

    (tg1, tg2, tg_ph_1, tg_ph_2) = get_handles()

    tg1.tg_traffic_control(action='reset', port_handle=tg_ph_1)
    tg2.tg_traffic_control(action='reset', port_handle=tg_ph_2)

    h1 = tg1.tg_interface_config(port_handle=tg_ph_1,
                                 mode='config',
                                 intf_ip_addr='10.10.10.2',
                                 gateway='10.10.10.1',
                                 src_mac_addr='00:0a:01:00:00:01',
                                 arp_send_req='1')
    st.log("INTFCONF: " + str(h1))
    h2 = tg2.tg_interface_config(port_handle=tg_ph_2,
                                 mode='config',
                                 intf_ip_addr='20.20.20.2',
                                 gateway='20.20.20.1',
                                 arp_send_req='1')
    st.log("INTFCONF: " + str(h2))

    conf_var = {
        'mode': 'enable',
        'active_connect_enable': '1',
        'local_as': '200',
        'remote_as': '100',
        'remote_ip_addr': '10.10.10.1'
    }
    route_var = {
        'mode': 'add',
        'num_routes': base_route_count,
        'prefix': '121.1.1.0',
        'as_path': 'as_seq:1'
    }
    ctrl_start = {'mode': 'start'}
    ctrl_stop = {'mode': 'stop'}

    # Configuring the BGP router.
    bgp_rtr1 = tgapi.tg_bgp_config(tg=tg1,
                                   handle=h1['handle'],
                                   conf_var=conf_var,
                                   route_var=route_var,
                                   ctrl_var=ctrl_start)

    st.log("BGP_HANDLE: " + str(bgp_rtr1))
    # Verified at neighbor.
    st.log("BGP neighborship established.")
    st.wait(10)

    tr1 = tg2.tg_traffic_config(
        port_handle=tg_ph_2,
        emulation_src_handle=h2['handle'],
        emulation_dst_handle=bgp_rtr1['route'][0]['handle'],
        circuit_endpoint_type='ipv4',
        mode='create',
        transmit_mode='continuous',
        length_mode='fixed',
        rate_pps=512000,
        enable_stream_only_gen='0')

    retval = bgpfeature.verify_bgp_summary(dut,
                                           neighbor=data.neigh_ip_addr,
                                           state='Established')

    if retval is True:
        output = bcm_show(dut, 'bcmcmd "l3 defip show" | wc -l')
        st.log(output)
        default_route = parse_route_output(output)

    route_count += default_route

    cmd = 'bcmcmd "l3 defip show" | wc -l'
    measure_route_learn_time(dut, default_route, route_count, cmd)

    if (show_flag):
        cmd = "time show ip route"
        bcm_show(dut, cmd)
        data.result_14_3 = True

    res = tg2.tg_traffic_control(action='stop', handle=tr1['stream_id'])
    st.log("TR_CTRL: " + str(res))
    tgapi.tg_bgp_config(tg=tg1,
                        handle=bgp_rtr1['conf']['handle'],
                        ctrl_var=ctrl_stop)
    ipfeature.delete_ip_interface(dut,
                                  member4,
                                  data.intf_ip_addr,
                                  data.ip_prefixlen,
                                  family="ipv4")
    ipfeature.delete_ip_interface(dut,
                                  member3,
                                  data.my_ip_addr,
                                  data.ip_prefixlen,
                                  family="ipv4")
    bgpfeature.delete_bgp_neighbor(dut, data.as_num, data.neigh_ip_addr,
                                   data.remote_as_num)
    delete_bgp_router(dut, '', data.as_num)

    tg2.tg_traffic_control(action='reset', port_handle=tg_ph_2)
    tg1.tg_interface_config(port_handle=tg_ph_1,
                            handle=h1['handle'],
                            mode='destroy')
    tg2.tg_interface_config(port_handle=tg_ph_2,
                            handle=h2['handle'],
                            mode='destroy')
    st.wait(20)
Ejemplo n.º 9
0
def create_l3_interface(dut, count, add, default_intf_count):
    #Remove conflicting ip config from loopback0
    #cmd = "config interface ip remove Loopback0 10.1.0.1/32"
    #st.log(cmd)

    if (add):
        vapi.config_vlan_range(dut, "1 {}".format(count))
        st.wait(10)

    start_time = datetime.datetime.now()
    for i in range(1, count + 1):
        ip_addr = get_next_ip()
        #vapi.add_vlan_member(dut, i, vars.D1T1P1, tagging_mode=True)
        #st.log(ip_addr)
        if (add):
            ipfeature.config_ip_addr_interface(dut, "Vlan{}".format(i),
                                               ip_addr, 24)
        else:
            ipfeature.delete_ip_interface(dut, "Vlan{}".format(i), ip_addr, 24)
        # measure L3 interface create performance at various intervals
        if (i == 128):
            output = bcm_show(dut, 'bcmcmd "l3 intf show" | wc -l')
            st.log(output)
            curr_intf_count = parse_route_output(output)
            if (curr_intf_count + default_intf_count >= 128):
                end_time = datetime.datetime.now()
                if (add):
                    st.log("Time taken for creating 128 L3 interfaces =" +
                           str(end_time - start_time))
                else:
                    st.log("Time taken for deleting 128 L3 interfaces =" +
                           str(end_time - start_time))
                data.result[0] = 1
        elif (i == 256):
            output = bcm_show(dut, 'bcmcmd "l3 intf show" | wc -l')
            st.log(output)
            curr_intf_count = parse_route_output(output)
            if (curr_intf_count + default_intf_count >= 256):
                end_time = datetime.datetime.now()
                if (add):
                    st.log("Time taken for creating 256 L3 interfaces =" +
                           str(end_time - start_time))
                else:
                    st.log("Time taken for deleting 256 L3 interfaces =" +
                           str(end_time - start_time))
                data.result[1] = 1
        elif (i == 512):
            output = bcm_show(dut, 'bcmcmd "l3 intf show" | wc -l')
            st.log(output)
            curr_intf_count = parse_route_output(output)
            if (curr_intf_count + default_intf_count >= 512):
                end_time = datetime.datetime.now()
                if (add):
                    st.log("Time taken for creating 512 L3 interfaces =" +
                           str(end_time - start_time))
                else:
                    st.log("Time taken for deleting 512 L3 interfaces =" +
                           str(end_time - start_time))
                data.result[2] = 1
        elif (i == 1000):
            output = bcm_show(dut, 'bcmcmd "l3 intf show" | wc -l')
            st.log(output)
            curr_intf_count = parse_route_output(output)
            if (curr_intf_count + default_intf_count >= 1000):
                end_time = datetime.datetime.now()
                if (add):
                    st.log("Time taken for creating 1000 L3 interfaces =" +
                           str(end_time - start_time))
                else:
                    st.log("Time taken for deleting 1000 L3 interfaces =" +
                           str(end_time - start_time))
                data.result[3] = 1

    output = bcm_show(dut, "time show ip interface")
    st.log(output)
    data.result[4] = 1
Ejemplo n.º 10
0
def measure_v6_route_learning_time(route_count):
    vars = st.get_testbed_vars()
    dut = vars.D1

    ipfeature.clear_ip_configuration(st.get_dut_names())
    ipfeature.clear_ip_configuration(st.get_dut_names(), 'ipv6')

    member3 = vars.D1T1P1
    member4 = vars.D1T1P2
    ipfeature.config_ip_addr_interface(dut,
                                       member3,
                                       data.my_ipv6_addr,
                                       data.ipv6_prefixlen,
                                       family="ipv6")
    ipfeature.config_ip_addr_interface(dut,
                                       member4,
                                       data.intf_ipv6_addr,
                                       data.ipv6_prefixlen,
                                       family="ipv6")

    ipfeature.get_interface_ip_address(dut, family="ipv6")
    ipfeature.show_ip_route(dut, family="ipv6")

    bgpfeature.create_bgp_router(dut, data.as_num, '')
    bgpfeature.create_bgp_neighbor(dut,
                                   data.as_num,
                                   data.neigh_ipv6_addr,
                                   data.remote_as_num,
                                   family="ipv6")
    create_bgp_neighbor_route_map_config(dut, data.as_num,
                                         data.neigh_ipv6_addr, data.routemap)

    (tg1, tg2, tg_ph_1, tg_ph_2) = get_handles()
    tg1.tg_traffic_control(action='reset', port_handle=tg_ph_1)
    tg2.tg_traffic_control(action='reset', port_handle=tg_ph_2)

    h1 = tg1.tg_interface_config(port_handle=tg_ph_1,
                                 mode='config',
                                 ipv6_intf_addr='2000::2',
                                 ipv6_prefix_length='64',
                                 ipv6_gateway='2000::1',
                                 src_mac_addr='00:0a:01:00:00:01',
                                 arp_send_req='1')
    st.log("INTFCONF: " + str(h1))
    h2 = tg2.tg_interface_config(port_handle=tg_ph_2,
                                 mode='config',
                                 ipv6_intf_addr='2200::2',
                                 ipv6_prefix_length='64',
                                 ipv6_gateway='2200::1',
                                 arp_send_req='1')
    st.log("INTFCONF: " + str(h2))

    bgp_conf = tg1.tg_emulation_bgp_config(handle=h1['handle'],
                                           mode='enable',
                                           ip_version='6',
                                           active_connect_enable='1',
                                           local_as='200',
                                           remote_as='100',
                                           remote_ipv6_addr='2000::1')

    bgp_route = tg1.tg_emulation_bgp_route_config(handle=bgp_conf['handle'],
                                                  mode='add',
                                                  ip_version='6',
                                                  num_routes=route_count,
                                                  prefix='3300:1::',
                                                  as_path='as_seq:1')
    tg1.tg_emulation_bgp_control(handle=bgp_conf['handle'], mode='start')

    # Configuring the BGP router.
    st.log("BGP neighborship established.")

    tr2 = tg2.tg_traffic_config(port_handle=tg_ph_2,
                                emulation_src_handle=h2['handle'],
                                emulation_dst_handle=bgp_route['handle'],
                                circuit_endpoint_type='ipv6',
                                mode='create',
                                transmit_mode='continuous',
                                length_mode='fixed',
                                rate_pps=512000,
                                enable_stream_only_gen='0')

    tg2.tg_traffic_control(action='run', handle=tr2['stream_id'])

    output = bcm_show(dut, 'bcmcmd "l3 ip6route show" | wc -l')
    default_route = parse_route_output(output)

    #Assume default route as current number of routes in the system
    #and measure route_count perforamnce on top of it
    route_count += default_route
    cmd = 'bcmcmd "l3 ip6route show" | wc -l'
    measure_route_learn_time(dut, default_route, route_count, cmd)

    res = tg2.tg_traffic_control(action='stop', handle=tr2['stream_id'])
    st.log("TR_CTRL: " + str(res))
    # Withdraw the routes.
    st.wait(10)
    bgp_ctrl = tg1.tg_emulation_bgp_control(handle=bgp_conf['handle'],
                                            mode='stop')
    st.log("BGPCTRL: " + str(bgp_ctrl))
    tg2.tg_traffic_control(action='reset', port_handle=tg_ph_2)
    st.wait(50)

    tg1.tg_interface_config(port_handle=tg_ph_1,
                            handle=h1['handle'],
                            mode='destroy')
    tg2.tg_interface_config(port_handle=tg_ph_2,
                            handle=h2['handle'],
                            mode='destroy')