1807 report: added HW calibration sections to test_environment plus editing nits.
[csit.git] / docs / report / introduction / methodology.rst
1
2 .. _performance_test_methodology:
3
4 Performance Test Methodology
5 ============================
6
7 Throughput
8 ----------
9
10 Packet and bandwidth throughput are measured in accordance with
11 :rfc:`2544`, using FD.io CSIT Multiple Loss Ratio search (MLRsearch), an
12 optimized binary search algorithm, that measures SUT/DUT throughput at
13 different Packet Loss Ratio (PLR) values.
14
15 Following MLRsearch values are measured across a range of L2 frame sizes
16 and reported:
17
18 - **Non Drop Rate (NDR)**: packet and bandwidth throughput at PLR=0%.
19
20   - **Aggregate packet rate**: NDR_LOWER <bi-directional packet rate>
21     pps.
22   - **Aggregate bandwidth rate**: NDR_LOWER <bi-directional bandwidth
23     rate> Gbps.
24
25 - **Partial Drop Rate (PDR)**: packet and bandwidth throughput at
26   PLR=0.5%.
27
28   - **Aggregate packet rate**: PDR_LOWER <bi-directional packet rate>
29     pps.
30   - **Aggregate bandwidth rate**: PDR_LOWER <bi-directional bandwidth
31     rate> Gbps.
32
33 NDR and PDR are measured for the following L2 frame sizes (untagged
34 Ethernet):
35
36 - IPv4 payload: 64B, IMIX_v4_1 (28x64B, 16x570B, 4x1518B), 1518B, 9000B.
37 - IPv6 payload: 78B, 1518B, 9000B.
38
39 All rates are reported from external Traffic Generator perspective.
40
41 .. _mlrsearch_algorithm:
42
43 MLRsearch Algorithm
44 -------------------
45
46 Multiple Loss Rate search (MLRsearch) is a new search algorithm
47 implemented in FD.io CSIT project. MLRsearch discovers multiple packet
48 throughput rates in a single search, with each rate associated with a
49 distinct Packet Loss Ratio (PLR) criteria.
50
51 Two throughput measurements used in FD.io CSIT are Non-Drop Rate (NDR,
52 with zero packet loss, PLR=0) and Partial Drop Rate (PDR, with packet
53 loss rate not greater than the configured non-zero PLR). MLRsearch
54 discovers NDR and PDR in a single pass reducing required execution time
55 compared to separate binary searches for NDR and PDR. MLRsearch reduces
56 execution time even further by relying on shorter trial durations
57 of intermediate steps, with only the final measurements
58 conducted at the specified final trial duration.
59 This results in the shorter overall search
60 execution time when compared to a standard NDR/PDR binary search,
61 while guaranteeing the same or similar results.
62
63 If needed, MLRsearch can be easily adopted to discover more throughput rates
64 with different pre-defined PLRs.
65
66 .. Note:: All throughput rates are *always* bi-directional
67    aggregates of two equal (symmetric) uni-directional packet rates
68    received and reported by an external traffic generator.
69
70 Overview
71 ~~~~~~~~
72
73 The main properties of MLRsearch:
74
75 - MLRsearch is a duration aware multi-phase multi-rate search algorithm.
76
77   - Initial phase determines promising starting interval for the search.
78   - Intermediate phases progress towards defined final search criteria.
79   - Final phase executes measurements according to the final search
80     criteria.
81
82 - *Initial phase*:
83
84   - Uses link rate as a starting transmit rate and discovers the Maximum
85     Receive Rate (MRR) used as an input to the first intermediate phase.
86
87 - *Intermediate phases*:
88
89   - Start with initial trial duration (in the first phase) and converge
90     geometrically towards the final trial duration (in the final phase).
91   - Track two values for NDR and two for PDR.
92
93     - The values are called (NDR or PDR) lower_bound and upper_bound.
94     - Each value comes from a specific trial measurement
95       (most recent for that transmit rate),
96       and as such the value is associated with that measurement's duration and loss.
97     - A bound can be invalid, for example if NDR lower_bound
98       has been measured with nonzero loss.
99     - Invalid bounds are not real boundaries for the searched value,
100       but are needed to track interval widths.
101     - Valid bounds are real boundaries for the searched value.
102     - Each non-initial phase ends with all bounds valid.
103
104   - Start with a large (lower_bound, upper_bound) interval width and
105     geometrically converge towards the width goal (measurement resolution)
106     of the phase. Each phase halves the previous width goal.
107   - Use internal and external searches:
108
109     - External search - measures at transmit rates outside the (lower_bound,
110       upper_bound) interval. Activated when a bound is invalid,
111       to search for a new valid bound by doubling the interval width.
112       It is a variant of `exponential search`_.
113     - Internal search - `binary search`_, measures at transmit rates within the
114       (lower_bound, upper_bound) valid interval, halving the interval width.
115
116 - *Final phase* is executed with the final test trial duration, and the final
117   width goal that determines resolution of the overall search.
118   Intermediate phases together with the final phase are called non-initial phases.
119
120 The main benefits of MLRsearch vs. binary search include:
121
122 - In general MLRsearch is likely to execute more search trials overall, but
123   less trials at a set final duration.
124 - In well behaving cases it greatly reduces (>50%) the overall duration
125   compared to a single PDR (or NDR) binary search duration,
126   while finding multiple drop rates.
127 - In all cases MLRsearch yields the same or similar results to binary search.
128 - Note: both binary search and MLRsearch are susceptible to reporting
129   non-repeatable results across multiple runs for very bad behaving
130   cases.
131
132 Caveats:
133
134 - Worst case MLRsearch can take longer than a binary search e.g. in case of
135   drastic changes in behaviour for trials at varying durations.
136
137 Search Implementation
138 ~~~~~~~~~~~~~~~~~~~~~
139
140 Following is a brief description of the current MLRsearch
141 implementation in FD.io CSIT.
142
143 Input Parameters
144 ````````````````
145
146 #. *maximum_transmit_rate* - maximum packet transmit rate to be used by
147    external traffic generator, limited by either the actual Ethernet
148    link rate or traffic generator NIC model capabilities. Sample
149    defaults: 2 * 14.88 Mpps for 64B 10GE link rate,
150    2 * 18.75 Mpps for 64B 40GE NIC maximum rate.
151 #. *minimum_transmit_rate* - minimum packet transmit rate to be used for
152    measurements. MLRsearch fails if lower transmit rate needs to be
153    used to meet search criteria. Default: 2 * 10 kpps (could be higher).
154 #. *final_trial_duration* - required trial duration for final rate
155    measurements. Default: 30 sec.
156 #. *initial_trial_duration* - trial duration for initial MLRsearch phase.
157    Default: 1 sec.
158 #. *final_relative_width* - required measurement resolution expressed as
159    (lower_bound, upper_bound) interval width relative to upper_bound.
160    Default: 0.5%.
161 #. *packet_loss_ratio* - maximum acceptable PLR search criteria for
162    PDR measurements. Default: 0.5%.
163 #. *number_of_intermediate_phases* - number of phases between the initial
164    phase and the final phase. Impacts the overall MLRsearch duration.
165    Less phases are required for well behaving cases, more phases
166    may be needed to reduce the overall search duration for worse behaving cases.
167    Default (2). (Value chosen based on limited experimentation to date.
168    More experimentation needed to arrive to clearer guidelines.)
169
170 Initial phase
171 `````````````
172
173 1. First trial measures at maximum rate and discovers MRR.
174
175    a. *in*: trial_duration = initial_trial_duration.
176    b. *in*: offered_transmit_rate = maximum_transmit_rate.
177    c. *do*: single trial.
178    d. *out*: measured loss ratio.
179    e. *out*: mrr = measured receive rate.
180
181 2. Second trial measures at MRR and discovers MRR2.
182
183    a. *in*: trial_duration = initial_trial_duration.
184    b. *in*: offered_transmit_rate = MRR.
185    c. *do*: single trial.
186    d. *out*: measured loss ratio.
187    e. *out*: mrr2 = measured receive rate.
188
189 3. Third trial measures at MRR2.
190
191    a. *in*: trial_duration = initial_trial_duration.
192    b. *in*: offered_transmit_rate = MRR2.
193    c. *do*: single trial.
194    d. *out*: measured loss ratio.
195
196 Non-initial phases
197 ``````````````````
198
199 1. Main loop:
200
201    a. *in*: trial_duration for the current phase.
202       Set to initial_trial_duration for the first intermediate phase;
203       to final_trial_duration for the final phase;
204       or to the element of interpolating geometric sequence
205       for other intermediate phases.
206       For example with two intermediate phases, trial_duration
207       of the second intermediate phase is the geometric average
208       of initial_strial_duration and final_trial_duration.
209    b. *in*: relative_width_goal for the current phase.
210       Set to final_relative_width for the final phase;
211       doubled for each preceding phase.
212       For example with two intermediate phases,
213       the first intermediate phase uses quadruple of final_relative_width
214       and the second intermediate phase uses double of final_relative_width.
215    c. *in*: ndr_interval, pdr_interval from the previous main loop iteration
216       or the previous phase.
217       If the previous phase is the initial phase, both intervals have
218       lower_bound = MRR2, uper_bound = MRR.
219       Note that the initial phase is likely to create intervals with invalid bounds.
220    d. *do*: According to the procedure described in point 2,
221       either exit the phase (by jumping to 1.g.),
222       or prepare new transmit rate to measure with.
223    e. *do*: Perform the trial measurement at the new transmit rate
224       and trial_duration, compute its loss ratio.
225    f. *do*: Update the bounds of both intervals, based on the new measurement.
226       The actual update rules are numerous, as NDR external search
227       can affect PDR interval and vice versa, but the result
228       agrees with rules of both internal and external search.
229       For example, any new measurement below an invalid lower_bound
230       becomes the new lower_bound, while the old measurement
231       (previously acting as the invalid lower_bound)
232       becomes a new and valid upper_bound.
233       Go to next iteration (1.c.), taking the updated intervals as new input.
234    g. *out*: current ndr_interval and pdr_interval.
235       In the final phase this is also considered
236       to be the result of the whole search.
237       For other phases, the next phase loop is started
238       with the current results as an input.
239
240 2. New transmit rate (or exit) calculation (for 1.d.):
241
242    - If there is an invalid bound then prepare for external search:
243
244      - *If* the most recent measurement at NDR lower_bound transmit rate
245        had the loss higher than zero, then
246        the new transmit rate is NDR lower_bound
247        decreased by two NDR interval widths.
248      - Else, *if* the most recent measurement at PDR lower_bound
249        transmit rate had the loss higher than PLR, then
250        the new transmit rate is PDR lower_bound
251        decreased by two PDR interval widths.
252      - Else, *if* the most recent measurement at NDR upper_bound
253        transmit rate had no loss, then
254        the new transmit rate is NDR upper_bound
255        increased by two NDR interval widths.
256      - Else, *if* the most recent measurement at PDR upper_bound
257        transmit rate had the loss lower or equal to PLR, then
258        the new transmit rate is PDR upper_bound
259        increased by two PDR interval widths.
260    - If interval width is higher than the current phase goal:
261
262      - Else, *if* NDR interval does not meet the current phase width goal,
263        prepare for internal search. The new transmit rate is
264        (NDR lower bound + NDR upper bound) / 2.
265      - Else, *if* PDR interval does not meet the current phase width goal,
266        prepare for internal search. The new transmit rate is
267        (PDR lower bound + PDR upper bound) / 2.
268    - Else, *if* some bound has still only been measured at a lower duration,
269      prepare to re-measure at the current duration (and the same transmit rate).
270      The order of priorities is:
271
272      - NDR lower_bound,
273      - PDR lower_bound,
274      - NDR upper_bound,
275      - PDR upper_bound.
276    - *Else*, do not prepare any new rate, to exit the phase.
277      This ensures that at the end of each non-initial phase
278      all intervals are valid, narrow enough, and measured
279      at current phase trial duration.
280
281 Implementation Deviations
282 ~~~~~~~~~~~~~~~~~~~~~~~~~
283
284 This document so far has been describing a simplified version of MLRsearch algorithm.
285 The full algorithm as implemented contains additional logic,
286 which makes some of the details (but not general ideas) above incorrect.
287 Here is a short description of the additional logic as a list of principles,
288 explaining their main differences from (or additions to) the simplified description,
289 but without detailing their mutual interaction.
290
291 1. *Logarithmic transmit rate.*
292    In order to better fit the relative width goal,
293    the interval doubling and halving is done differently.
294    For example, the middle of 2 and 8 is 4, not 5.
295 2. *Optimistic maximum rate.*
296    The increased rate is never higher than the maximum rate.
297    Upper bound at that rate is always considered valid.
298 3. *Pessimistic minimum rate.*
299    The decreased rate is never lower than the minimum rate.
300    If a lower bound at that rate is invalid,
301    a phase stops refining the interval further (until it gets re-measured).
302 4. *Conservative interval updates.*
303    Measurements above current upper bound never update a valid upper bound,
304    even if drop ratio is low.
305    Measurements below current lower bound always update any lower bound
306    if drop ratio is high.
307 5. *Ensure sufficient interval width.*
308    Narrow intervals make external search take more time to find a valid bound.
309    If the new transmit increased or decreased rate would result in width
310    less than the current goal, increase/decrease more.
311    This can happen if the measurement for the other interval
312    makes the current interval too narrow.
313    Similarly, take care the measurements in the initial phase
314    create wide enough interval.
315 6. *Timeout for bad cases.*
316    The worst case for MLRsearch is when each phase converges to intervals
317    way different than the results of the previous phase.
318    Rather than suffer total search time several times larger
319    than pure binary search, the implemented tests fail themselves
320    when the search takes too long (given by argument *timeout*).
321
322 Maximum Receive Rate MRR
323 ------------------------
324
325 MRR tests measure the packet forwarding rate under the maximum
326 load offered by traffic generator over a set trial duration,
327 regardless of packet loss. Maximum load for specified Ethernet frame
328 size is set to the bi-directional link rate.
329
330 Current parameters for MRR tests:
331
332 - Ethernet frame sizes: 64B (78B for IPv6), IMIX, 1518B, 9000B; all
333   quoted sizes include frame CRC, but exclude per frame transmission
334   overhead of 20B (preamble, inter frame gap).
335
336 - Maximum load offered: 10GE and 40GE link (sub-)rates depending on NIC
337   tested, with the actual packet rate depending on frame size,
338   transmission overhead and traffic generator NIC forwarding capacity.
339
340   - For 10GE NICs the maximum packet rate load is 2* 14.88 Mpps for 64B,
341     a 10GE bi-directional link rate.
342   - For 25GE NICs the maximum packet rate load is 2* 18.75 Mpps for 64B,
343     a 25GE bi-directional link sub-rate limited by TG 25GE NIC used,
344     XXV710.
345   - For 40GE NICs the maximum packet rate load is 2* 18.75 Mpps for 64B,
346     a 40GE bi-directional link sub-rate limited by TG 40GE NIC used,
347     XL710. Packet rate for other tested frame sizes is limited by PCIe
348     Gen3 x8 bandwidth limitation of ~50Gbps.
349
350 - Trial duration: 10sec.
351
352 Similarly to NDR/PDR throughput tests, MRR test should be reporting bi-
353 directional link rate (or NIC rate, if lower) if tested VPP
354 configuration can handle the packet rate higher than bi-directional link
355 rate, e.g. large packet tests and/or multi-core tests.
356
357 MRR tests are used for continuous performance trending and for
358 comparison between releases. Daily trending job tests subset of frame
359 sizes, focusing on 64B (78B for IPv6) for all tests and IMIX for
360 selected tests (vhost, memif).
361
362 Packet Latency
363 --------------
364
365 TRex Traffic Generator (TG) is used for measuring latency of VPP DUTs.
366 Reported latency values are measured using following methodology:
367
368 - Latency tests are performed at 100% of discovered NDR and PDR rates
369   for each throughput test and packet size (except IMIX).
370 - TG sends dedicated latency streams, one per direction, each at the
371   rate of 9 kpps at the prescribed packet size; these are sent in
372   addition to the main load streams.
373 - TG reports min/avg/max latency values per stream direction, hence two
374   sets of latency values are reported per test case; future release of
375   TRex is expected to report latency percentiles.
376 - Reported latency values are aggregate across two SUTs due to three
377   node topology used for all performance tests; for per SUT latency,
378   reported value should be divided by two.
379 - 1usec is the measurement accuracy advertised by TRex TG for the setup
380   used in FD.io labs used by CSIT project.
381 - TRex setup introduces an always-on error of about 2*2usec per latency
382   flow additonal Tx/Rx interface latency induced by TRex SW writing and
383   reading packet timestamps on CPU cores without HW acceleration on NICs
384   closer to the interface line.
385
386 Multi-Core Speedup
387 ------------------
388
389 All performance tests are executed with single processor core and with
390 multiple cores scenarios.
391
392 Intel Hyper-Threading (HT)
393 ~~~~~~~~~~~~~~~~~~~~~~~~~~
394
395 Intel Xeon processors used in FD.io CSIT can operate either in HT
396 Disabled mode (single logical core per each physical core) or in HT
397 Enabled mode (two logical cores per each physical core). HT setting is
398 applied in BIOS and requires server SUT reload for it to take effect,
399 making it impractical for continuous changes of HT mode of operation.
400
401 |csit-release| performance tests are executed with server SUTs' Intel
402 XEON processors configured with Intel Hyper-Threading Disabled for all
403 Xeon Haswell testbeds (3n-hsw) and with Intel Hyper-Threading Enabled
404 for all Xeon Skylake testbeds.
405
406 More information about physical testbeds is provided in
407 :ref:`tested_physical_topologies`.
408
409 Multi-core Tests
410 ~~~~~~~~~~~~~~~~
411
412 |csit-release| multi-core tests are executed in the following VPP worker
413 thread and physical core configurations:
414
415 #. Intel Xeon Haswell testbeds (3n-hsw) with Intel HT disabled
416    (1 logical CPU core per each physical core):
417
418   #. 1t1c - 1 VPP worker thread on 1 physical core.
419   #. 2t2c - 2 VPP worker threads on 2 physical cores.
420   #. 4t4c - 4 VPP worker threads on 4 physical cores.
421
422 #. Intel Xeon Skylake testbeds (2n-skx, 3n-skx) with Intel HT enabled
423    (2 logical CPU cores per each physical core):
424
425   #. 2t1c - 2 VPP worker threads on 1 physical core.
426   #. 4t2c - 4 VPP worker threads on 2 physical cores.
427   #. 8t4c - 8 VPP worker threads on 4 physical cores.
428
429 VPP worker threads are the data plane threads running on isolated
430 logical cores. With Intel HT enabled VPP workers are placed as sibling
431 threads on each used physical core. VPP control threads (main, stats)
432 are running on a separate non-isolated core together with other Linux
433 processes.
434
435 In all CSIT tests care is taken to ensure that each VPP worker handles
436 the same amount of received packet load and does the same amount of
437 packet processing work. This is achieved by evenly distributing per
438 interface type (e.g. physical, virtual) receive queues over VPP workers
439 using default VPP round- robin mapping and by loading these queues with
440 the same amount of packet flows.
441
442 If number of VPP workers is higher than number of physical or virtual
443 interfaces, multiple receive queues are configured on each interface.
444 NIC Receive Side Scaling (RSS) for physical interfaces and multi-queue
445 for virtual interfaces are used for this purpose.
446
447 Section :ref:`throughput_speedup_multi_core` includes a set of graphs
448 illustrating packet throughout speedup when running VPP worker threads
449 on multiple cores. Note that in quite a few test cases running VPP
450 workers on 2 or 4 physical cores hits the I/O bandwidth or packets-per-
451 second limit of tested NIC.
452
453 VPP Startup Settings
454 --------------------
455
456 CSIT code manipulates a number of VPP settings in startup.conf for optimized
457 performance. List of common settings applied to all tests and test
458 dependent settings follows.
459
460 See `VPP startup.conf <https://git.fd.io/vpp/tree/src/vpp/conf/startup.conf?h=stable/1807>`_
461 for a complete set and description of listed settings.
462
463 Common Settings
464 ~~~~~~~~~~~~~~~
465
466 List of vpp startup.conf settings applied to all tests:
467
468 #. heap-size <value> - set separately for ip4, ip6, stats, main
469    depending on scale tested.
470 #. no-tx-checksum-offload - disables UDP / TCP TX checksum offload in DPDK.
471    Typically needed for use faster vector PMDs (together with
472    no-multi-seg).
473 #. socket-mem <value>,<value> - memory per numa. (Not required anymore
474    due to VPP code changes, should be removed in CSIT-18.10.)
475
476 Per Test Settings
477 ~~~~~~~~~~~~~~~~~
478
479 List of vpp startup.conf settings applied dynamically per test:
480
481 #. corelist-workers <list_of_cores> - list of logical cores to run VPP
482    worker data plane threads. Depends on HyperThreading and core per
483    test configuration.
484 #. num-rx-queues <value> - depends on a number of VPP threads and NIC
485    interfaces.
486 #. num-rx-desc/num-tx-desc - number of rx/tx descriptors for specific
487    NICs, incl. xl710, x710, xxv710.
488 #. num-mbufs <value> - increases number of buffers allocated, needed
489    only in scenarios with large number of interfaces and worker threads.
490    Value is per CPU socket. Default is 16384.
491 #. no-multi-seg - disables multi-segment buffers in DPDK, improves
492    packet throughput, but disables Jumbo MTU support. Disabled for all
493    tests apart from the ones that require Jumbo 9000B frame support.
494 #. UIO driver - depends on topology file definition.
495 #. QAT VFs - depends on NRThreads, each thread = 1QAT VFs.
496
497 KVM VMs vhost-user
498 ------------------
499
500 FD.io CSIT performance lab is testing VPP vhost with KVM VMs using
501 following environment settings:
502
503 - Tests with varying Qemu virtio queue (a.k.a. vring) sizes: [vr256]
504   default 256 descriptors, [vr1024] 1024 descriptors to optimize for
505   packet throughput.
506 - Tests with varying Linux :abbr:`CFS (Completely Fair Scheduler)`
507   settings: [cfs] default settings, [cfsrr1] CFS RoundRobin(1) policy
508   applied to all data plane threads handling test packet path including
509   all VPP worker threads and all Qemu testpmd poll-mode threads.
510 - Resulting test cases are all combinations with [vr256,vr1024] and
511   [cfs,cfsrr1] settings.
512 - Adjusted Linux kernel :abbr:`CFS (Completely Fair Scheduler)`
513   scheduler policy for data plane threads used in CSIT is documented in
514   `CSIT Performance Environment Tuning wiki <https://wiki.fd.io/view/CSIT/csit-perf-env-tuning-ubuntu1604>`_.
515 - The purpose is to verify performance impact (MRR and NDR/PDR
516   throughput) and same test measurements repeatability, by making VPP
517   and VM data plane threads less susceptible to other Linux OS system
518   tasks hijacking CPU cores running those data plane threads.
519
520 LXC/DRC Container Memif
521 -----------------------
522
523 |csit-release| includes tests taking advantage of VPP memif virtual
524 interface (shared memory interface) to interconnect VPP running in
525 Containers. VPP vswitch instance runs in bare-metal user-mode handling
526 NIC interfaces and connecting over memif (Slave side) to VPPs running in
527 :abbr:`Linux Container (LXC)` or in Docker Container (DRC) configured
528 with memif (Master side). LXCs and DRCs run in a priviliged mode with
529 VPP data plane worker threads pinned to dedicated physical CPU cores per
530 usual CSIT practice. All VPP instances run the same version of software.
531 This test topology is equivalent to existing tests with vhost-user and
532 VMs as described earlier in :ref:`tested_logical_topologies`.
533
534 In addition to above vswitch tests, a single memif interface test is
535 executed. It runs in a simple topology of two VPP container instances
536 connected over memif interface in order to verify standalone memif
537 interface performance.
538
539 More information about CSIT LXC and DRC setup and control is available
540 in :ref:`container_orchestration_in_csit`.
541
542 K8s Container Memif
543 -------------------
544
545 |csit-release| includes tests of VPP topologies running in K8s
546 orchestrated Pods/Containers and connected over memif virtual
547 interfaces. In order to provide simple topology coding flexibility and
548 extensibility container orchestration is done with `Kubernetes
549 <https://github.com/kubernetes>`_ using `Docker
550 <https://github.com/docker>`_ images for all container applications
551 including VPP. `Ligato <https://github.com/ligato>`_ is used for the
552 Pod/Container networking orchestration that is integrated with K8s,
553 including memif support.
554
555 In these tests VPP vswitch runs in a K8s Pod with Docker Container (DRC)
556 handling NIC interfaces and connecting over memif to more instances of
557 VPP running in Pods/DRCs. All DRCs run in a priviliged mode with VPP
558 data plane worker threads pinned to dedicated physical CPU cores per
559 usual CSIT practice. All VPP instances run the same version of software.
560 This test topology is equivalent to existing tests with vhost-user and
561 VMs as described earlier in :ref:`tested_physical_topologies`.
562
563 Further documentation is available in
564 :ref:`container_orchestration_in_csit`.
565
566 IPSec on Intel QAT
567 ------------------
568
569 VPP IPSec performance tests are using DPDK cryptodev device driver in
570 combination with HW cryptodev devices - Intel QAT 8950 50G - present in
571 LF FD.io physical testbeds. DPDK cryptodev can be used for all IPSec
572 data plane functions supported by VPP.
573
574 Currently |csit-release| implements following IPSec test cases:
575
576 - AES-GCM, CBC-SHA1 ciphers, in combination with IPv4 routed-forwarding
577   with Intel xl710 NIC.
578 - CBC-SHA1 ciphers, in combination with LISP-GPE overlay tunneling for
579   IPv4-over-IPv4 with Intel xl710 NIC.
580
581 TRex Traffic Generator
582 ----------------------
583
584 Usage
585 ~~~~~
586
587 `TRex traffic generator <https://wiki.fd.io/view/TRex>`_ is used for all
588 CSIT performance tests. TRex stateless mode is used to measure NDR and
589 PDR throughputs using binary search (NDR and PDR discovery tests) and
590 for quick checks of DUT performance against the reference NDRs (NDR
591 check tests) for specific configuration.
592
593 TRex is installed and run on the TG compute node. The typical procedure
594 is:
595
596 - If the TRex is not already installed on TG, it is installed in the
597   suite setup phase - see `TRex intallation`_.
598 - TRex configuration is set in its configuration file
599   ::
600
601   /etc/trex_cfg.yaml
602
603 - TRex is started in the background mode
604   ::
605
606   $ sh -c 'cd <t-rex-install-dir>/scripts/ && sudo nohup ./t-rex-64 -i -c 7 --iom 0 > /tmp/trex.log 2>&1 &' > /dev/null
607
608 - There are traffic streams dynamically prepared for each test, based on traffic
609   profiles. The traffic is sent and the statistics obtained using
610   :command:`trex_stl_lib.api.STLClient`.
611
612 Measuring Packet Loss
613 ~~~~~~~~~~~~~~~~~~~~~
614
615 Following sequence is followed to measure packet loss:
616
617 - Create an instance of STLClient.
618 - Connect to the client.
619 - Add all streams.
620 - Clear statistics.
621 - Send the traffic for defined time.
622 - Get the statistics.
623
624 If there is a warm-up phase required, the traffic is sent also before
625 test and the statistics are ignored.
626
627 Measuring Latency
628 ~~~~~~~~~~~~~~~~~
629
630 If measurement of latency is requested, two more packet streams are
631 created (one for each direction) with TRex flow_stats parameter set to
632 STLFlowLatencyStats. In that case, returned statistics will also include
633 min/avg/max latency values.
634
635 HTTP/TCP with WRK tool
636 ----------------------
637
638 `WRK HTTP benchmarking tool <https://github.com/wg/wrk>`_ is used for
639 experimental TCP/IP and HTTP tests of VPP TCP/IP stack and built-in
640 static HTTP server. WRK has been chosen as it is capable of generating
641 significant TCP/IP and HTTP loads by scaling number of threads across
642 multi-core processors.
643
644 This in turn enables quite high scale benchmarking of the main TCP/IP
645 and HTTP service including HTTP TCP/IP Connections-Per-Second (CPS),
646 HTTP Requests-Per-Second and HTTP Bandwidth Throughput.
647
648 The initial tests are designed as follows:
649
650 - HTTP and TCP/IP Connections-Per-Second (CPS)
651
652   - WRK configured to use 8 threads across 8 cores, 1 thread per core.
653   - Maximum of 50 concurrent connections across all WRK threads.
654   - Timeout for server responses set to 5 seconds.
655   - Test duration is 30 seconds.
656   - Expected HTTP test sequence:
657
658     - Single HTTP GET Request sent per open connection.
659     - Connection close after valid HTTP reply.
660     - Resulting flow sequence - 8 packets: >Syn, <Syn-Ack, >Ack, >Req,
661       <Rep, >Fin, <Fin, >Ack.
662
663 - HTTP Requests-Per-Second
664
665   - WRK configured to use 8 threads across 8 cores, 1 thread per core.
666   - Maximum of 50 concurrent connections across all WRK threads.
667   - Timeout for server responses set to 5 seconds.
668   - Test duration is 30 seconds.
669   - Expected HTTP test sequence:
670
671     - Multiple HTTP GET Requests sent in sequence per open connection.
672     - Connection close after set test duration time.
673     - Resulting flow sequence: >Syn, <Syn-Ack, >Ack, >Req[1], <Rep[1],
674       .., >Req[n], <Rep[n], >Fin, <Fin, >Ack.
675
676 .. _binary search: https://en.wikipedia.org/wiki/Binary_search
677 .. _exponential search: https://en.wikipedia.org/wiki/Exponential_search
678 .. _estimation of standard deviation: https://en.wikipedia.org/wiki/Unbiased_estimation_of_standard_deviation
679 .. _simplified error propagation formula: https://en.wikipedia.org/wiki/Propagation_of_uncertainty#Simplification