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