FIX: Small inconsistencies in report sections
[csit.git] / docs / report / vpp_performance_tests / overview.rst
1 Overview
2 ========
3
4 .. _tested_physical_topologies:
5
6 Tested Physical Topologies
7 --------------------------
8
9 CSIT VPP performance tests are executed on physical baremetal servers hosted by
10 :abbr:`LF (Linux Foundation)` FD.io project. Testbed physical topology is shown
11 in the figure below.::
12
13         +------------------------+           +------------------------+
14         |                        |           |                        |
15         |  +------------------+  |           |  +------------------+  |
16         |  |                  |  |           |  |                  |  |
17         |  |                  <----------------->                  |  |
18         |  |       DUT1       |  |           |  |       DUT2       |  |
19         |  +--^---------------+  |           |  +---------------^--+  |
20         |     |                  |           |                  |     |
21         |     |            SUT1  |           |  SUT2            |     |
22         +------------------------+           +------------------^-----+
23               |                                                 |
24               |                                                 |
25               |                  +-----------+                  |
26               |                  |           |                  |
27               +------------------>    TG     <------------------+
28                                  |           |
29                                  +-----------+
30
31 SUT1 and SUT2 are two System Under Test servers (Cisco UCS C240, each with two
32 Intel XEON CPUs), TG is a Traffic Generator (TG, another Cisco UCS C240, with
33 two Intel XEON CPUs). SUTs run VPP SW application in Linux user-mode as a
34 Device Under Test (DUT). TG runs TRex SW application as a packet Traffic
35 Generator. Physical connectivity between SUTs and to TG is provided using
36 different NIC models that need to be tested for performance. Currently
37 installed and tested NIC models include:
38
39 #. 2port10GE X520-DA2 Intel.
40 #. 2port10GE X710 Intel.
41 #. 2port10GE VIC1227 Cisco.
42 #. 2port40GE VIC1385 Cisco.
43 #. 2port40GE XL710 Intel.
44
45 From SUT and DUT perspective, all performance tests involve forwarding packets
46 between two physical Ethernet ports (10GE or 40GE). Due to the number of
47 listed NIC models tested and available PCI slot capacity in SUT servers, in
48 all of the above cases both physical ports are located on the same NIC. In
49 some test cases this results in measured packet throughput being limited not
50 by VPP DUT but by either the physical interface or the NIC capacity.
51
52 Going forward CSIT project will be looking to add more hardware into FD.io
53 performance labs to address larger scale multi-interface and multi-NIC
54 performance testing scenarios.
55
56 For service chain topology test cases that require DUT (VPP) to communicate with
57 VirtualMachines (VMs) or with Linux/Docker Containers (Ctrs) over
58 vhost-user/memif interfaces, N of VM/Ctr instances are created on SUT1
59 and SUT2. Three types of service chain topologies are tested in CSIT |release|:
60
61 #. "Parallel" topology with packets flowing from NIC via DUT (VPP) to
62    VM/Container and back to VPP and NIC;
63
64 #. "Chained" topology (a.k.a. "Snake") with packets flowing via DUT (VPP) to
65    VM/Container, back to DUT, then to the next VM/Container, back to DUT and
66    so on until the last VM/Container in a chain, then back to DUT and NIC;
67
68 #. "Horizontal" topology with packets flowing via DUT (VPP) to Container,
69    then via "horizontal" memif to the next Container, and so on until the
70    last Container, then back to DUT and NIC. "Horizontal" topology is not
71    supported for VMs;
72
73 For each of the above topologies, DUT (VPP) is tested in a range of L2
74 or IPv4/IPv6 configurations depending on the test suite. A sample DUT
75 "Chained" service topology with N of VM/Ctr instances is shown in the
76 figure below. Packet flow thru the DUTs and VMs/Ctrs is marked with
77 ``***``::
78
79         +-------------------------+           +-------------------------+
80         | +---------+ +---------+ |           | +---------+ +---------+ |
81         | |VM/Ctr[1]| |VM/Ctr[N]| |           | |VM/Ctr[1]| |VM/Ctr[N]| |
82         | |  *****  | |  *****  | |           | |  *****  | |  *****  | |
83         | +--^---^--+ +--^---^--+ |           | +--^---^--+ +--^---^--+ |
84         |   *|   |*     *|   |*   |           |   *|   |*     *|   |*   |
85         | +--v---v-------v---v--+ |           | +--v---v-------v---v--+ |
86         | |  *   *       *   *  |*|***********|*|  *   *       *   *  | |
87         | |  *   *********   ***<-|-----------|->***   *********   *  | |
88         | |  *    DUT1          | |           | |       DUT2       *  | |
89         | +--^------------------+ |           | +------------------^--+ |
90         |   *|                    |           |                    |*   |
91         |   *|            SUT1    |           |  SUT2              |*   |
92         +-------------------------+           +-------------------------+
93             *|                                                     |*
94             *|                                                     |*
95             *|                    +-----------+                    |*
96             *|                    |           |                    |*
97             *+-------------------->    TG     <--------------------+*
98             **********************|           |**********************
99                                   +-----------+
100
101 In above "Chained" topology, packets are switched by DUT multiple times:
102 twice for a single VM/Ctr, three times for two VMs/Ctrs, N+1 times for N
103 VMs/Ctrs. Hence the external throughput rates measured by TG and listed
104 in this report must be multiplied by (N+1) to represent the actual DUT
105 aggregate packet forwarding rate.
106
107 For a "Parallel" and "Horizontal" service topologies packets are always
108 switched by DUT twice per service chain.
109
110 Note that reported DUT (VPP) performance results are specific to the SUTs
111 tested. Current :abbr:`LF (Linux Foundation)` FD.io SUTs are based on Intel
112 XEON E5-2699v3 2.3GHz CPUs. SUTs with other CPUs are likely to yield different
113 results. A good rule of thumb, that can be applied to estimate VPP packet
114 thoughput for Phy-to-Phy (NIC-to-NIC, PCI-to-PCI) topology, is to expect
115 the forwarding performance to be proportional to CPU core frequency,
116 assuming CPU is the only limiting factor and all other SUT parameters
117 equivalent to FD.io CSIT environment. The same rule of thumb can be also
118 applied for Phy-to-VM/Ctr-to-Phy (NIC-to-VM/Ctr-to-NIC) topology, but due to
119 much higher dependency on intensive memory operations and sensitivity to Linux
120 kernel scheduler settings and behaviour, this estimation may not always yield
121 good enough accuracy.
122
123 For detailed FD.io CSIT testbed specification and topology, as well as
124 configuration and setup of SUTs and DUTs testbeds please refer to
125 :ref:`test_environment`.
126
127 Similar SUT compute node can be arrived to in a standalone VPP setup by using a
128 `vpp-config configuration tool
129 <https://wiki.fd.io/view/VPP/Configuration_Tool>`_ developed within the
130 VPP project using CSIT recommended settings and scripts.
131
132 Performance Tests Coverage
133 --------------------------
134
135 Performance tests are split into two main categories:
136
137 - Throughput discovery - discovery of packet forwarding rate using binary search
138   in accordance to :rfc:`2544`.
139
140   - NDR - discovery of Non Drop Rate packet throughput, at zero packet loss;
141     followed by one-way packet latency measurements at 10%, 50% and 100% of
142     discovered NDR throughput.
143   - PDR - discovery of Partial Drop Rate, with specified non-zero packet loss
144     currently set to 0.5%; followed by one-way packet latency measurements at
145     100% of discovered PDR throughput.
146
147 CSIT |release| includes following performance test suites, listed per NIC type:
148
149 - 2port10GE X520-DA2 Intel
150
151   - **L2XC** - L2 Cross-Connect switched-forwarding of untagged, dot1q, dot1ad
152     VLAN tagged Ethernet frames.
153   - **L2BD** - L2 Bridge-Domain switched-forwarding of untagged Ethernet frames
154     with MAC learning; disabled MAC learning i.e. static MAC tests to be added.
155   - **L2BD Scale** - L2 Bridge-Domain switched-forwarding of untagged Ethernet
156     frames with MAC learning; disabled MAC learning i.e. static MAC tests to be
157     added with 20k, 200k and 2M FIB entries.
158   - **IPv4** - IPv4 routed-forwarding.
159   - **IPv6** - IPv6 routed-forwarding.
160   - **IPv4 Scale** - IPv4 routed-forwarding with 20k, 200k and 2M FIB entries.
161   - **IPv6 Scale** - IPv6 routed-forwarding with 20k, 200k and 2M FIB entries.
162   - **VMs with vhost-user** - virtual topologies with 1 VM and service chains
163     of 2 VMs using vhost-user interfaces, with VPP forwarding modes incl. L2
164     Cross-Connect, L2 Bridge-Domain, VXLAN with L2BD, IPv4 routed-forwarding.
165   - **COP** - IPv4 and IPv6 routed-forwarding with COP address security.
166   - **ACL** - L2 Bridge-Domain switched-forwarding and IPv4 and IPv6 routed-
167     forwarding with iACL and oACL IP address, MAC address and L4 port security.
168   - **LISP** - LISP overlay tunneling for IPv4-over-IPv4, IPv6-over-IPv4,
169     IPv6-over-IPv6, IPv4-over-IPv6 in IPv4 and IPv6 routed-forwarding modes.
170   - **VXLAN** - VXLAN overlay tunnelling integration with L2XC and L2BD.
171   - **QoS Policer** - ingress packet rate measuring, marking and limiting
172     (IPv4).
173   - **NAT** - (Source) Network Address Translation tests with varying
174     number of users and ports per user.
175   - **Container memif connections** - VPP memif virtual interface tests to
176     interconnect VPP instances with L2XC and L2BD.
177   - **Container K8s Orchestrated Topologies** - Container topologies connected
178     over the memif virtual interface.
179   - **SRv6** - Segment Routing IPv6 tests.
180
181 - 2port40GE XL710 Intel
182
183   - **L2XC** - L2 Cross-Connect switched-forwarding of untagged Ethernet frames.
184   - **L2BD** - L2 Bridge-Domain switched-forwarding of untagged Ethernet frames
185     with MAC learning.
186   - **IPv4** - IPv4 routed-forwarding.
187   - **IPv6** - IPv6 routed-forwarding.
188   - **VMs with vhost-user** - virtual topologies with 1 VM and service chains
189     of 2 VMs using vhost-user interfaces, with VPP forwarding modes incl. L2
190     Cross-Connect, L2 Bridge-Domain, VXLAN with L2BD, IPv4 routed-forwarding.
191   - **IPSecSW** - IPSec encryption with AES-GCM, CBC-SHA1 ciphers, in
192     combination with IPv4 routed-forwarding.
193   - **IPSecHW** - IPSec encryption with AES-GCM, CBC-SHA1 ciphers, in
194     combination with IPv4 routed-forwarding. Intel QAT HW acceleration.
195   - **IPSec+LISP** - IPSec encryption with CBC-SHA1 ciphers, in combination
196     with LISP-GPE overlay tunneling for IPv4-over-IPv4.
197   - **VPP TCP/IP stack** - tests of VPP TCP/IP stack used with VPP built-in HTTP
198     server.
199   - **Container memif connections** - VPP memif virtual interface tests to
200     interconnect VPP instances with L2XC and L2BD.
201
202 - 2port10GE X710 Intel
203
204   - **L2BD** - L2 Bridge-Domain switched-forwarding of untagged Ethernet frames
205     with MAC learning.
206   - **VMs with vhost-user** - virtual topologies with 1 VM using vhost-user
207     interfaces, with VPP forwarding modes incl. L2 Bridge-Domain.
208   - **Container memif connections** - VPP memif virtual interface tests to
209     interconnect VPP instances with L2XC and L2BD.
210   - **Container K8s Orchestrated Topologies** - Container topologies connected
211     over the memif virtual interface.
212
213 - 2port10GE VIC1227 Cisco
214
215   - **L2BD** - L2 Bridge-Domain switched-forwarding of untagged Ethernet frames
216     with MAC learning.
217
218 - 2port40GE VIC1385 Cisco
219
220   - **L2BD** - L2 Bridge-Domain switched-forwarding of untagged Ethernet frames
221      with MAC learning.
222
223 Execution of performance tests takes time, especially the throughput discovery
224 tests. Due to limited HW testbed resources available within FD.io labs hosted
225 by :abbr:`LF (Linux Foundation)`, the number of tests for NICs other than X520
226 (a.k.a. Niantic) has been limited to few baseline tests. CSIT team expect the
227 HW testbed resources to grow over time, so that complete set of performance
228 tests can be regularly and(or) continuously executed against all models of
229 hardware present in FD.io labs.
230
231 Performance Tests Naming
232 ------------------------
233
234 CSIT |release| follows a common structured naming convention for all performance
235 and system functional tests, introduced in CSIT rls1701.
236
237 The naming should be intuitive for majority of the tests. Complete description
238 of CSIT test naming convention is provided on :ref:`csit_test_naming`.
239
240 Methodology: Multi-Core and Multi-Threading
241 -------------------------------------------
242
243 **Intel Hyper-Threading** - CSIT |release| performance tests are executed with
244 SUT servers' Intel XEON processors configured in Intel Hyper-Threading Disabled
245 mode (BIOS setting). This is the simplest configuration used to establish
246 baseline single-thread single-core application packet processing and forwarding
247 performance. Subsequent releases of CSIT will add performance tests with Intel
248 Hyper-Threading Enabled (requires BIOS settings change and hard reboot of
249 server).
250
251 **Multi-core Tests** - CSIT |release| multi-core tests are executed in the
252 following VPP thread and core configurations:
253
254 #. 1t1c - 1 VPP worker thread on 1 CPU physical core.
255 #. 2t2c - 2 VPP worker threads on 2 CPU physical cores.
256 #. 4t4c - 4 VPP worker threads on 4 CPU physical cores.
257
258 VPP worker threads are the data plane threads. VPP control thread is
259 running on a separate non-isolated core together with other Linux
260 processes. Note that in quite a few test cases running VPP workers on 2
261 or 4 physical cores hits the I/O bandwidth or packets-per-second limit
262 of tested NIC.
263
264 Section :ref:`throughput_speedup_multi_core` includes a set of graphs
265 illustrating packet throughout speedup when running VPP on multiple
266 cores.
267
268 Methodology: Packet Throughput
269 ------------------------------
270
271 Following values are measured and reported for packet throughput tests:
272
273 - NDR binary search per :rfc:`2544`:
274
275   - Packet rate: "RATE: <aggregate packet rate in packets-per-second> pps
276     (2x <per direction packets-per-second>)";
277   - Aggregate bandwidth: "BANDWIDTH: <aggregate bandwidth in Gigabits per
278     second> Gbps (untagged)";
279
280 - PDR binary search per :rfc:`2544`:
281
282   - Packet rate: "RATE: <aggregate packet rate in packets-per-second> pps (2x
283     <per direction packets-per-second>)";
284   - Aggregate bandwidth: "BANDWIDTH: <aggregate bandwidth in Gigabits per
285     second> Gbps (untagged)";
286   - Packet loss tolerance: "LOSS_ACCEPTANCE <accepted percentage of packets
287     lost at PDR rate>";
288
289 - NDR and PDR are measured for the following L2 frame sizes:
290
291   - IPv4: 64B, IMIX_v4_1 (28x64B,16x570B,4x1518B), 1518B, 9000B;
292   - IPv6: 78B, 1518B, 9000B;
293
294 - NDR and PDR binary search resolution is determined by the final value of the
295   rate change, referred to as the final step:
296
297   - The final step is set to 50kpps for all NIC to NIC tests and all L2
298     frame sizes except 9000B (changed from 100kpps used in previous
299     releases).
300
301   - The final step is set to 10kpps for all remaining tests, including 9000B
302     and all vhost VM and memif Container tests.
303
304 All rates are reported from external Traffic Generator perspective.
305
306 Methodology: Packet Latency
307 ---------------------------
308
309 TRex Traffic Generator (TG) is used for measuring latency of VPP DUTs. Reported
310 latency values are measured using following methodology:
311
312 - Latency tests are performed at 10%, 50% of discovered NDR rate (non drop rate)
313   for each NDR throughput test and packet size (except IMIX).
314 - TG sends dedicated latency streams, one per direction, each at the rate of
315   10kpps at the prescribed packet size; these are sent in addition to the main
316   load streams.
317 - TG reports min/avg/max latency values per stream direction, hence two sets
318   of latency values are reported per test case; future release of TRex is
319   expected to report latency percentiles.
320 - Reported latency values are aggregate across two SUTs due to three node
321   topology used for all performance tests; for per SUT latency, reported value
322   should be divided by two.
323 - 1usec is the measurement accuracy advertised by TRex TG for the setup used in
324   FD.io labs used by CSIT project.
325 - TRex setup introduces an always-on error of about 2*2usec per latency flow -
326   additonal Tx/Rx interface latency induced by TRex SW writing and reading
327   packet timestamps on CPU cores without HW acceleration on NICs closer to the
328   interface line.
329
330
331 Methodology: KVM VM vhost
332 -------------------------
333
334 CSIT |release| introduced test environment configuration changes to KVM Qemu
335 vhost-user tests in order to more representatively measure |vpp-release|
336 performance in configurations with vhost-user interfaces and different Qemu
337 settings.
338
339 FD.io CSIT performance lab is testing VPP vhost with KVM VMs using following
340 environment settings:
341
342 - Tests with varying Qemu virtio queue (a.k.a. vring) sizes: [vr256] default 256
343   descriptors, [vr1024] 1024 descriptors to optimize for packet throughput;
344
345 - Tests with varying Linux :abbr:`CFS (Completely Fair Scheduler)` settings:
346   [cfs] default settings, [cfsrr1] CFS RoundRobin(1) policy applied to all data
347   plane threads handling test packet path including all VPP worker threads and
348   all Qemu testpmd poll-mode threads;
349
350 - Resulting test cases are all combinations with [vr256,vr1024] and
351   [cfs,cfsrr1] settings;
352
353 - Adjusted Linux kernel :abbr:`CFS (Completely Fair Scheduler)` scheduler policy
354   for data plane threads used in CSIT is documented in
355   `CSIT Performance Environment Tuning wiki <https://wiki.fd.io/view/CSIT/csit-perf-env-tuning-ubuntu1604>`_.
356   The purpose is to verify performance impact (NDR, PDR throughput) and
357   same test measurements repeatability, by making VPP and VM data plane
358   threads less susceptible to other Linux OS system tasks hijacking CPU
359   cores running those data plane threads.
360
361 Methodology: LXC and Docker Containers memif
362 --------------------------------------------
363
364 CSIT |release| introduced additional tests taking advantage of VPP memif virtual
365 interface (shared memory interface) tests to interconnect VPP instances. VPP
366 vswitch instance runs in bare-metal user-mode handling Intel x520 NIC 10GbE,
367 Intel x710 NIC 10GbE, Intel xl710 NIC 40GbE interfaces and connecting over memif
368 (Slave side) virtual interfaces to more instances of VPP running in
369 :abbr:`LXC (Linux Container)` or in Docker Containers, both with memif virtual
370 interfaces (Master side). LXCs and Docker Containers run in a priviliged mode
371 with VPP data plane worker threads pinned to dedicated physical CPU cores per
372 usual CSIT practice. All VPP instances run the same version of software.
373 This test topology is equivalent to existing tests with vhost-user and
374 VMs as described earlier in :ref:`tested_physical_topologies`.
375
376 More information about CSIT LXC and Docker Container setup and control
377 is available in :ref:`container_orchestration_in_csit`.
378
379 Methodology: Container Topologies Orchestrated by K8s
380 -----------------------------------------------------
381
382 CSIT |release| introduced new tests of Container topologies connected
383 over the memif virtual interface (shared memory interface). In order to
384 provide simple topology coding flexibility and extensibility container
385 orchestration is done with `Kubernetes <https://github.com/kubernetes>`_
386 using `Docker <https://github.com/docker>`_ images for all container
387 applications including VPP. `Ligato <https://github.com/ligato>`_ is
388 used to address the container networking orchestration that is
389 integrated with K8s, including memif support.
390
391 For these tests VPP vswitch instance runs in a Docker Container handling
392 Intel x520 NIC 10GbE, Intel x710 NIC 10GbE interfaces and connecting over memif
393 virtual interfaces to more instances of VPP running in Docker Containers
394 with memif virtual interfaces. All Docker Containers run in a priviliged mode
395 with VPP data plane worker threads pinned to dedicated physical CPU cores per
396 usual CSIT practice. All VPP instances run the same version of software. This
397 test topology is equivalent to existing tests with vhost-user and VMs as
398 described earlier in :ref:`tested_physical_topologies`.
399
400 More information about CSIT Container Topologies Orchestrated by K8s is
401 available in :ref:`container_orchestration_in_csit`.
402
403 Methodology: IPSec with Intel QAT HW cards
404 ------------------------------------------
405
406 VPP IPSec performance tests are using DPDK cryptodev device driver in
407 combination with HW cryptodev devices - Intel QAT 8950 50G - present in
408 LF FD.io physical testbeds. DPDK cryptodev can be used for all IPSec
409 data plane functions supported by VPP.
410
411 Currently CSIT |release| implements following IPSec test cases:
412
413 - AES-GCM, CBC-SHA1 ciphers, in combination with IPv4 routed-forwarding
414   with Intel xl710 NIC.
415 - CBC-SHA1 ciphers, in combination with LISP-GPE overlay tunneling for
416   IPv4-over-IPv4 with Intel xl710 NIC.
417
418 Methodology: TRex Traffic Generator Usage
419 -----------------------------------------
420
421 `TRex traffic generator <https://wiki.fd.io/view/TRex>`_ is used for all
422 CSIT performance tests. TRex stateless mode is used to measure NDR and PDR
423 throughputs using binary search (NDR and PDR discovery tests) and for quick
424 checks of DUT performance against the reference NDRs (NDR check tests) for
425 specific configuration.
426
427 TRex is installed and run on the TG compute node. The typical procedure is:
428
429 - If the TRex is not already installed on TG, it is installed in the
430   suite setup phase - see `TRex intallation`_.
431 - TRex configuration is set in its configuration file
432   ::
433
434   /etc/trex_cfg.yaml
435
436 - TRex is started in the background mode
437   ::
438
439   $ 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
440
441 - There are traffic streams dynamically prepared for each test, based on traffic
442   profiles. The traffic is sent and the statistics obtained using
443   :command:`trex_stl_lib.api.STLClient`.
444
445 **Measuring packet loss**
446
447 - Create an instance of STLClient
448 - Connect to the client
449 - Add all streams
450 - Clear statistics
451 - Send the traffic for defined time
452 - Get the statistics
453
454 If there is a warm-up phase required, the traffic is sent also before test and
455 the statistics are ignored.
456
457 **Measuring latency**
458
459 If measurement of latency is requested, two more packet streams are created (one
460 for each direction) with TRex flow_stats parameter set to STLFlowLatencyStats. In
461 that case, returned statistics will also include min/avg/max latency values.
462
463 Methodology: TCP/IP tests with WRK tool
464 ---------------------------------------
465
466 `WRK HTTP benchmarking tool <https://github.com/wg/wrk>`_ is used for
467 experimental TCP/IP and HTTP tests of VPP TCP/IP stack and built-in
468 static HTTP server. WRK has been chosen as it is capable of generating
469 significant TCP/IP and HTTP loads by scaling number of threads across
470 multi-core processors.
471
472 This in turn enables quite high scale benchmarking of the main TCP/IP
473 and HTTP service including HTTP TCP/IP Connections-Per-Second (CPS),
474 HTTP Requests-Per-Second and HTTP Bandwidth Throughput.
475
476 The initial tests are designed as follows:
477
478 - HTTP and TCP/IP Connections-Per-Second (CPS)
479
480   - WRK configured to use 8 threads across 8 cores, 1 thread per core.
481   - Maximum of 50 concurrent connections across all WRK threads.
482   - Timeout for server responses set to 5 seconds.
483   - Test duration is 30 seconds.
484   - Expected HTTP test sequence:
485
486     - Single HTTP GET Request sent per open connection.
487     - Connection close after valid HTTP reply.
488     - Resulting flow sequence - 8 packets: >S,<S-A,>A,>Req,<Rep,>F,<F,> A.
489
490 - HTTP Requests-Per-Second
491
492   - WRK configured to use 8 threads across 8 cores, 1 thread per core.
493   - Maximum of 50 concurrent connections across all WRK threads.
494   - Timeout for server responses set to 5 seconds.
495   - Test duration is 30 seconds.
496   - Expected HTTP test sequence:
497
498     - Multiple HTTP GET Requests sent in sequence per open connection.
499     - Connection close after set test duration time.
500     - Resulting flow sequence: >S,<S-A,>A,>Req[1],<Rep[1],..,>Req[n],<Rep[n],>F,<F,>A.