Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Add stateful linerate test #362

Closed
wants to merge 1 commit into from
Closed

Conversation

pudelkoM
Copy link
Member

@pudelkoM pudelkoM commented Aug 18, 2021

This PR adds a stateful linerate test.

Example output:

  qos_tests.StatefulTest ... {'global': {'active_flows': 0.0,
            'active_sockets': 0,
            'bw_per_core': 0.12813211977481842,
            'cpu_util': 0.20416809618473053,
            'cpu_util_raw': 0.0,
            'open_flows': 5008.0,
            'platform_factor': 1.0,
            'rx_bps': 3659770.25,
            'rx_core_pps': 1992.5047607421875,
            'rx_cpu_util': 0.07341904938220978,
            'rx_drop_bps': 525908.25,
            'rx_pps': 6471.4794921875,
            'socket_util': 0.0,
            'tx_expected_bps': 0.0,
            'tx_expected_cps': 0.0,
            'tx_expected_pps': 0.0,
            'tx_pps': 7467.5107421875,
            'tx_bps': 4185678.5,
            'tx_cps': 496.7500305175781,
            'total_servers': 0,
            'total_clients': 0,
            'total_alloc_error': 0,
            'queue_full': 0},
 0: {'opackets': 35778,
     'ipackets': 30728,
     'obytes': 2531620,
     'ibytes': 2163264,
     'oerrors': 0,
     'ierrors': 0,
     'tx_bps': 1975392.75,
     'tx_pps': 3484.928466796875,
     'tx_bps_L1': 2532981.3046875,
     'tx_util': 0.00633245326171875,
     'rx_bps': 1684511.125,
     'rx_pps': 2986.79345703125,
     'rx_bps_L1': 2162398.078125,
     'rx_util': 0.0054059951953125},
 1: {'opackets': 30728,
     'ipackets': 35778,
     'obytes': 2163264,
     'ibytes': 2531620,
     'oerrors': 0,
     'ierrors': 0,
     'tx_bps': 1684477.625,
     'tx_pps': 2986.7333984375,
     'tx_bps_L1': 2162354.96875,
     'tx_util': 0.005405887421875,
     'rx_bps': 1975259.125,
     'rx_pps': 3484.685791015625,
     'rx_bps_L1': 2532808.8515625,
     'rx_util': 0.00633202212890625},
 2: {'opackets': 10738,
     'ipackets': 0,
     'obytes': 708708,
     'ibytes': 0,
     'oerrors': 0,
     'ierrors': 0,
     'tx_bps': 525808.125,
     'tx_pps': 995.8487548828125,
     'tx_bps_L1': 685143.92578125,
     'tx_util': 0.001712859814453125,
     'rx_bps': 0.0,
     'rx_pps': 0.0,
     'rx_bps_L1': 0,
     'rx_util': 0.0},
 3: {'opackets': 0,
     'ipackets': 0,
     'obytes': 0,
     'ibytes': 0,
     'oerrors': 0,
     'ierrors': 0,
     'tx_bps': 0.0,
     'tx_pps': 0.0,
     'tx_bps_L1': 0,
     'tx_util': 0.0,
     'rx_bps': 0.0,
     'rx_pps': 0.0,
     'rx_bps_L1': 0,
     'rx_util': 0.0},
 'total': {'opackets': 77244,
           'ipackets': 66506,
           'obytes': 5403592,
           'ibytes': 4694884,
           'oerrors': 0,
           'ierrors': 0,
           'tx_bps': 4185678.5,
           'tx_pps': 7467.5106201171875,
           'tx_bps_L1': 5380480.19921875,
           'tx_util': 0.013451200498046876,
           'rx_bps': 3659770.25,
           'rx_pps': 6471.479248046875,
           'rx_bps_L1': 4695206.9296875,
           'rx_util': 0.011738017324218749},
 'traffic': {'client': {'m_active_flows': 0,
                        'm_est_flows': 0,
                        'm_tx_bw_l7_r': 17983.63078241005,
                        'm_tx_bw_l7_total_r': 17966.458452312963,
                        'm_rx_bw_l7_r': 8985.75367647059,
                        'm_tx_pps_r': 1871.35595703125,
                        'm_rx_pps_r': 1874.032958984375,
                        'm_avg_size': 0.9000862481716214,
                        'm_tx_ratio': 100.09557993937796,
                        'm_traffic_duration': 10.591256533636363,
                        'tcps_connattempt': 5008,
                        'tcps_connects': 5008,
                        'tcps_closed': 5008,
                        'tcps_segstimed': 20032,
                        'tcps_rttupdated': 20032,
                        'tcps_sndtotal': 25040,
                        'tcps_sndpack': 10016,
                        'tcps_sndbyte': 30048,
                        'tcps_sndbyte_ok': 30048,
                        'tcps_sndctrl': 5008,
                        'tcps_sndacks': 10016,
                        'tcps_rcvpack': 10016,
                        'tcps_rcvbyte': 15024,
                        'tcps_rcvackpack': 15024,
                        'tcps_rcvackbyte': 30048,
                        'tcps_rcvackbyte_of': 5008},
             'server': {'m_active_flows': 0,
                        'm_est_flows': 0,
                        'm_tx_bw_l7_r': 8992.35526127927,
                        'm_tx_bw_l7_total_r': 8979.962342946887,
                        'm_rx_bw_l7_r': 17977.005996573385,
                        'm_tx_pps_r': 1497.87451171875,
                        'm_rx_pps_r': 2248.13232421875,
                        'm_avg_size': 0.8999370008858756,
                        'm_tx_ratio': 100.1380063507963,
                        'm_traffic_duration': 10.586901838181818,
                        'tcps_accepts': 5008,
                        'tcps_connects': 5008,
                        'tcps_closed': 5008,
                        'tcps_segstimed': 15024,
                        'tcps_rttupdated': 15024,
                        'tcps_sndtotal': 20032,
                        'tcps_sndpack': 5008,
                        'tcps_sndbyte': 15024,
                        'tcps_sndbyte_ok': 15024,
                        'tcps_sndacks': 15024,
                        'tcps_rcvpack': 15024,
                        'tcps_rcvbyte': 30048,
                        'tcps_rcvackpack': 15024,
                        'tcps_rcvackbyte': 15024,
                        'tcps_rcvackbyte_of': 10016,
                        'tcps_preddat': 5008}},
 'latency': {0: {'hist': {'cnt': 10604,
                          'high_cnt': 1,
                          'histogram': [{'key': 10, 'val': 1}],
                          'max_usec': 18,
                          'min_usec': 10,
                          's_avg': 4.0,
                          's_max': 5.934545},
                 'stats': {'ignore_bytes': 0,
                           'ipv6_n_solic': 0,
                           'm_jitter': 0,
                           'm_l3_cs_err': 0,
                           'm_l4_cs_err': 0,
                           'm_length_error': 0,
                           'm_no_id': 0,
                           'm_no_ipv4_option': 0,
                           'm_no_magic': 0,
                           'm_pkt_ok': 10696,
                           'm_rx_check': 0,
                           'm_seq_error': 0,
                           'm_tx_pkt_err': 0,
                           'm_tx_pkt_ok': 10738,
                           'm_unsup_prot': 0,
                           'tx_arp': 0}},
             1: {'hist': {'cnt': 10646,
                          'high_cnt': 42,
                          'histogram': [{'key': 10, 'val': 25},
                                        {'key': 20, 'val': 16},
                                        {'key': 30, 'val': 1}],
                          'max_usec': 19,
                          'min_usec': 10,
                          's_avg': 5.0,
                          's_max': 6.207273},
                 'stats': {'ignore_bytes': 0,
                           'ipv6_n_solic': 0,
                           'm_jitter': 0,
                           'm_l3_cs_err': 0,
                           'm_l4_cs_err': 0,
                           'm_length_error': 0,
                           'm_no_id': 0,
                           'm_no_ipv4_option': 0,
                           'm_no_magic': 0,
                           'm_pkt_ok': 10738,
                           'm_rx_check': 0,
                           'm_seq_error': 0,
                           'm_tx_pkt_err': 0,
                           'm_tx_pkt_ok': 10696,
                           'm_unsup_prot': 0,
                           'tx_arp': 0}},
             2: {'hist': {'cnt': 0,
                          'high_cnt': 0,
                          'histogram': [],
                          'max_usec': 0,
                          'min_usec': 10,
                          's_avg': 0.0,
                          's_max': 0.0},
                 'stats': {'ignore_bytes': 0,
                           'ipv6_n_solic': 0,
                           'm_jitter': 0,
                           'm_l3_cs_err': 0,
                           'm_l4_cs_err': 0,
                           'm_length_error': 0,
                           'm_no_id': 0,
                           'm_no_ipv4_option': 0,
                           'm_no_magic': 0,
                           'm_pkt_ok': 0,
                           'm_rx_check': 0,
                           'm_seq_error': 0,
                           'm_tx_pkt_err': 0,
                           'm_tx_pkt_ok': 10738,
                           'm_unsup_prot': 0,
                           'tx_arp': 0}},
             3: {'hist': {'cnt': 0,
                          'high_cnt': 0,
                          'histogram': [],
                          'max_usec': 0,
                          'min_usec': 10,
                          's_avg': 0.0,
                          's_max': 0.0},
                 'stats': {'ignore_bytes': 0,
                           'ipv6_n_solic': 0,
                           'm_jitter': 0,
                           'm_l3_cs_err': 0,
                           'm_l4_cs_err': 0,
                           'm_length_error': 0,
                           'm_no_id': 0,
                           'm_no_ipv4_option': 0,
                           'm_no_magic': 0,
                           'm_pkt_ok': 0,
                           'm_rx_check': 0,
                           'm_seq_error': 0,
                           'm_tx_pkt_err': 0,
                           'm_tx_pkt_ok': 0,
                           'm_unsup_prot': 0,
                           'tx_arp': 0}}}}

@codecov
Copy link

codecov bot commented Aug 18, 2021

Codecov Report

Merging #362 (90d1c9a) into main (b4de3c4) will not change coverage.
The diff coverage is n/a.

❗ Current head 90d1c9a differs from pull request most recent head 2f7086a. Consider uploading reports for the commit 2f7086a to get more accurate results
Impacted file tree graph

@@            Coverage Diff            @@
##               main     #362   +/-   ##
=========================================
  Coverage     68.51%   68.51%           
  Complexity      489      489           
=========================================
  Files            39       39           
  Lines          3475     3475           
  Branches        356      356           
=========================================
  Hits           2381     2381           
  Misses          899      899           
  Partials        195      195           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b4de3c4...2f7086a. Read the comment docs.

@pudelkoM pudelkoM added the WIP Do not merge! label Aug 18, 2021
@pudelkoM pudelkoM force-pushed the stateful-linerate-tests branch from 1e63e07 to 2f7086a Compare August 23, 2021 17:25
Comment on lines +512 to +521
prog_c = ASTFProgram()
prog_c.send(payload)
prog_c.recv(len(payload))
prog_c.delay(1000) # wait for usecs
prog_c.send(payload)

prog_s = ASTFProgram()
prog_s.recv(len(payload))
prog_s.send(payload)
prog_s.recv(len(payload))
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is where the TCP "programs" are created. Statistics will reflect whether flows matched the expected pattern.

@ccascone
Copy link
Member

ccascone commented Sep 29, 2021

Superseded by #368. Thanks @pudelkoM for starting the stateful exploration.

@ccascone ccascone closed this Sep 29, 2021
@pudelkoM pudelkoM deleted the stateful-linerate-tests branch September 29, 2021 06:10
@pudelkoM
Copy link
Member Author

You're welcome. Glad request = b'foo' made it into the other PR 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
WIP Do not merge!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants