89f5958075d39d675af19d76f794bd6942dcbd6b
[csit.git] / docs / report / vpp_performance_tests / overview.rst
1 Overview
2 ========
3
4 Tested Physical Topologies
5 --------------------------
6
7 CSIT VPP performance tests are executed on physical baremetal servers hosted by
8 :abbr:`LF (Linux Foundation)` FD.io project. Testbed physical topology is shown
9 in the figure below.::
10
11     +------------------------+           +------------------------+
12     |                        |           |                        |
13     |  +------------------+  |           |  +------------------+  |
14     |  |                  |  |           |  |                  |  |
15     |  |                  <----------------->                  |  |
16     |  |       DUT1       |  |           |  |       DUT2       |  |
17     |  +--^---------------+  |           |  +---------------^--+  |
18     |     |                  |           |                  |     |
19     |     |            SUT1  |           |  SUT2            |     |
20     +------------------------+           +------------------^-----+
21           |                                                 |
22           |                                                 |
23           |                  +-----------+                  |
24           |                  |           |                  |
25           +------------------>    TG     <------------------+
26                              |           |
27                              +-----------+
28
29 SUT1 and SUT2 are two System Under Test servers (Cisco UCS C240, each with two
30 Intel XEON CPUs), TG is a Traffic Generator (TG, another Cisco UCS C240, with
31 two Intel XEON CPUs). SUTs run VPP SW application in Linux user-mode as a
32 Device Under Test (DUT). TG runs TRex SW application as a packet Traffic
33 Generator. Physical connectivity between SUTs and to TG is provided using
34 different NIC models that need to be tested for performance. Currently
35 installed and tested NIC models include:
36
37 #. 2port10GE X520-DA2 Intel.
38 #. 2port10GE X710 Intel.
39 #. 2port10GE VIC1227 Cisco.
40 #. 2port40GE VIC1385 Cisco.
41 #. 2port40GE XL710 Intel.
42
43 From SUT and DUT perspective, all performance tests involve forwarding packets
44 between two physical Ethernet ports (10GE or 40GE). Due to the number of
45 listed NIC models tested and available PCI slot capacity in SUT servers, in
46 all of the above cases both physical ports are located on the same NIC. In
47 some test cases this results in measured packet throughput being limited not
48 by VPP DUT but by either the physical interface or the NIC capacity.
49
50 Going forward CSIT project will be looking to add more hardware into FD.io
51 performance labs to address larger scale multi-interface and multi-NIC
52 performance testing scenarios.
53
54 For test cases that require DUT (VPP) to communicate with
55 VirtualMachines(VMs)/LinuxContainers(LXCs) over vhost-user/memif
56 interfaces, N of VM/LXC instances are created on SUT1 and SUT2. For N=1
57 DUT forwards packets between vhost/memif and physical interfaces. For
58 N>1 DUT a logical service chain forwarding topology is created on DUT by
59 applying L2 or IPv4/IPv6 configuration depending on the test suite. DUT
60 test topology with N VM/LXC instances is shown in the figure below
61 including applicable packet flow thru the DUTs and VMs/LXCs (marked in
62 the figure with ``***``).::
63
64     +-------------------------+           +-------------------------+
65     | +---------+ +---------+ |           | +---------+ +---------+ |
66     | |VM/LXC[1]| |VM/LXC[N]| |           | |VM/LXC[1]| |VM/LXC[N]| |
67     | |  *****  | |  *****  | |           | |  *****  | |  *****  | |
68     | +--^---^--+ +--^---^--+ |           | +--^---^--+ +--^---^--+ |
69     |   *|   |*     *|   |*   |           |   *|   |*     *|   |*   |
70     | +--v---v-------v---v--+ |           | +--v---v-------v---v--+ |
71     | |  *   *       *   *  |*|***********|*|  *   *       *   *  | |
72     | |  *   *********   ***<-|-----------|->***   *********   *  | |
73     | |  *    DUT1          | |           | |       DUT2       *  | |
74     | +--^------------------+ |           | +------------------^--+ |
75     |   *|                    |           |                    |*   |
76     |   *|            SUT1    |           |  SUT2              |*   |
77     +-------------------------+           +-------------------------+
78         *|                                                     |*
79         *|                                                     |*
80         *|                    +-----------+                    |*
81         *|                    |           |                    |*
82         *+-------------------->    TG     <--------------------+*
83         **********************|           |**********************
84                               +-----------+
85
86 For VM/LXC tests, packets are switched by DUT multiple times: twice for
87 a single VM/LXC, three times for two VMs/LXCs, N+1 times for N VMs/LXCs.
88 Hence the external throughput rates measured by TG and listed in this
89 report must be multiplied by (N+1) to represent the actual DUT aggregate
90 packet forwarding rate.
91
92 Note that reported DUT (VPP) performance results are specific to the SUTs
93 tested. Current :abbr:`LF (Linux Foundation)` FD.io SUTs are based on Intel
94 XEON E5-2699v3 2.3GHz CPUs. SUTs with other CPUs are likely to yield different
95 results. A good rule of thumb, that can be applied to estimate VPP packet
96 thoughput for Phy-to-Phy (NIC-to-NIC, PCI-to-PCI) topology, is to expect
97 the forwarding performance to be proportional to CPU core frequency,
98 assuming CPU is the only limiting factor and all other SUT parameters
99 equivalent to FD.io CSIT environment. The same rule of thumb can be also
100 applied for Phy-to-VM/LXC-to-Phy (NIC-to-VM/LXC-to-NIC) topology, but due to
101 much higher dependency on intensive memory operations and sensitivity to Linux
102 kernel scheduler settings and behaviour, this estimation may not always yield
103 good enough accuracy.
104
105 For detailed :abbr:`LF (Linux Foundation)` FD.io test bed specification and
106 physical topology please refer to `LF FD.io CSIT testbed wiki page
107 <https://wiki.fd.io/view/CSIT/CSIT_LF_testbed>`_.
108
109 Performance Tests Coverage
110 --------------------------
111
112 Performance tests are split into two main categories:
113
114 - Throughput discovery - discovery of packet forwarding rate using binary search
115   in accordance to :rfc:`2544`.
116
117   - NDR - discovery of Non Drop Rate packet throughput, at zero packet loss;
118     followed by one-way packet latency measurements at 10%, 50% and 100% of
119     discovered NDR throughput.
120   - PDR - discovery of Partial Drop Rate, with specified non-zero packet loss
121     currently set to 0.5%; followed by one-way packet latency measurements at
122     100% of discovered PDR throughput.
123
124 - Throughput verification - verification of packet forwarding rate against
125   previously discovered throughput rate. These tests are currently done against
126   0.9 of reference NDR, with reference rates updated periodically.
127
128 CSIT |release| includes following performance test suites, listed per NIC type:
129
130 - 2port10GE X520-DA2 Intel
131
132   - **L2XC** - L2 Cross-Connect switched-forwarding of untagged, dot1q, dot1ad
133     VLAN tagged Ethernet frames.
134   - **L2BD** - L2 Bridge-Domain switched-forwarding of untagged Ethernet frames
135     with MAC learning; disabled MAC learning i.e. static MAC tests to be added.
136   - **IPv4** - IPv4 routed-forwarding.
137   - **IPv6** - IPv6 routed-forwarding.
138   - **IPv4 Scale** - IPv4 routed-forwarding with 20k, 200k and 2M FIB entries.
139   - **IPv6 Scale** - IPv6 routed-forwarding with 20k, 200k and 2M FIB entries.
140   - **VMs with vhost-user** - virtual topologies with 1 VM and service chains
141     of 2 VMs using vhost-user interfaces, with VPP forwarding modes incl. L2
142     Cross-Connect, L2 Bridge-Domain, VXLAN with L2BD, IPv4 routed-forwarding.
143   - **COP** - IPv4 and IPv6 routed-forwarding with COP address security.
144   - **iACL** - IPv4 and IPv6 routed-forwarding with iACL address security.
145   - **LISP** - LISP overlay tunneling for IPv4-over-IPv4, IPv6-over-IPv4,
146     IPv6-over-IPv6, IPv4-over-IPv6 in IPv4 and IPv6 routed-forwarding modes.
147   - **VXLAN** - VXLAN overlay tunnelling integration with L2XC and L2BD.
148   - **QoS Policer** - ingress packet rate measuring, marking and limiting
149     (IPv4).
150   - **CGNAT** - Carrier Grade Network Address Translation tests with varying
151     number of users and ports per user.
152
153 - 2port40GE XL710 Intel
154
155   - **L2XC** - L2 Cross-Connect switched-forwarding of untagged Ethernet frames.
156   - **L2BD** - L2 Bridge-Domain switched-forwarding of untagged Ethernet frames
157     with MAC learning.
158   - **IPv4** - IPv4 routed-forwarding.
159   - **IPv6** - IPv6 routed-forwarding.
160   - **VMs with vhost-user** - virtual topologies with 1 VM and service chains
161     of 2 VMs using vhost-user interfaces, with VPP forwarding modes incl. L2
162     Cross-Connect, L2 Bridge-Domain, VXLAN with L2BD, IPv4 routed-forwarding.
163   - **IPSec** - IPSec encryption with AES-GCM, CBC-SHA1 ciphers, in combination
164     with IPv4 routed-forwarding.
165   - **IPSec+LISP** - IPSec encryption with CBC-SHA1 ciphers, in combination
166     with LISP-GPE overlay tunneling for IPv4-over-IPv4.
167
168 - 2port10GE X710 Intel
169
170   - **L2BD** - L2 Bridge-Domain switched-forwarding of untagged Ethernet frames
171     with MAC learning.
172   - **VMs with vhost-user** - virtual topologies with 1 VM using vhost-user
173     interfaces, with VPP forwarding modes incl. L2 Bridge-Domain.
174
175 - 2port10GE VIC1227 Cisco
176
177   - **L2BD** - L2 Bridge-Domain switched-forwarding of untagged Ethernet frames
178     with MAC learning.
179
180 - 2port40GE VIC1385 Cisco
181
182   - **L2BD** - L2 Bridge-Domain switched-forwarding of untagged Ethernet frames
183      with MAC learning.
184
185 Execution of performance tests takes time, especially the throughput discovery
186 tests. Due to limited HW testbed resources available within FD.io labs hosted
187 by :abbr:`LF (Linux Foundation)`, the number of tests for NICs other than X520
188 (a.k.a. Niantic) has been limited to few baseline tests. CSIT team expect the
189 HW testbed resources to grow over time, so that complete set of performance
190 tests can be regularly and(or) continuously executed against all models of
191 hardware present in FD.io labs.
192
193 Performance Tests Naming
194 ------------------------
195
196 CSIT |release| follows a common structured naming convention for all performance
197 and system functional tests, introduced in CSIT |release-1|.
198
199 The naming should be intuitive for majority of the tests. Complete description
200 of CSIT test naming convention is provided on `CSIT test naming wiki
201 <https://wiki.fd.io/view/CSIT/csit-test-naming>`_.
202
203 Methodology: Multi-Core and Multi-Threading
204 -------------------------------------------
205
206 **Intel Hyper-Threading** - CSIT |release| performance tests are executed with
207 SUT servers' Intel XEON processors configured in Intel Hyper-Threading Disabled
208 mode (BIOS setting). This is the simplest configuration used to establish
209 baseline single-thread single-core application packet processing and forwarding
210 performance. Subsequent releases of CSIT will add performance tests with Intel
211 Hyper-Threading Enabled (requires BIOS settings change and hard reboot of
212 server).
213
214 **Multi-core Tests** - CSIT |release| multi-core tests are executed in the
215 following VPP thread and core configurations:
216
217 #. 1t1c - 1 VPP worker thread on 1 CPU physical core.
218 #. 2t2c - 2 VPP worker threads on 2 CPU physical cores.
219
220 VPP worker threads are the data plane threads. VPP control thread is running on
221 a separate non-isolated core together with other Linux processes. Note that in
222 quite a few test cases running VPP workers on 2 physical cores hits the tested
223 NIC I/O bandwidth or packets-per-second limit.
224
225 Methodology: Packet Throughput
226 ------------------------------
227
228 Following values are measured and reported for packet throughput tests:
229
230 - NDR binary search per :rfc:`2544`:
231
232   - Packet rate: "RATE: <aggregate packet rate in packets-per-second> pps
233     (2x <per direction packets-per-second>)"
234   - Aggregate bandwidth: "BANDWIDTH: <aggregate bandwidth in Gigabits per
235     second> Gbps (untagged)"
236
237 - PDR binary search per :rfc:`2544`:
238
239   - Packet rate: "RATE: <aggregate packet rate in packets-per-second> pps (2x
240     <per direction packets-per-second>)"
241   - Aggregate bandwidth: "BANDWIDTH: <aggregate bandwidth in Gigabits per
242     second> Gbps (untagged)"
243   - Packet loss tolerance: "LOSS_ACCEPTANCE <accepted percentage of packets
244     lost at PDR rate>""
245
246 - NDR and PDR are measured for the following L2 frame sizes:
247
248   - IPv4: 64B, IMIX_v4_1 (28x64B,16x570B,4x1518B), 1518B, 9000B.
249   - IPv6: 78B, 1518B, 9000B.
250
251 All rates are reported from external Traffic Generator perspective.
252
253 Methodology: Packet Latency
254 ---------------------------
255
256 TRex Traffic Generator (TG) is used for measuring latency of VPP DUTs. Reported
257 latency values are measured using following methodology:
258
259 - Latency tests are performed at 10%, 50% of discovered NDR rate (non drop rate)
260   for each NDR throughput test and packet size (except IMIX).
261 - TG sends dedicated latency streams, one per direction, each at the rate of
262   10kpps at the prescribed packet size; these are sent in addition to the main
263   load streams.
264 - TG reports min/avg/max latency values per stream direction, hence two sets
265   of latency values are reported per test case; future release of TRex is
266   expected to report latency percentiles.
267 - Reported latency values are aggregate across two SUTs due to three node
268   topology used for all performance tests; for per SUT latency, reported value
269   should be divided by two.
270 - 1usec is the measurement accuracy advertised by TRex TG for the setup used in
271   FD.io labs used by CSIT project.
272 - TRex setup introduces an always-on error of about 2*2usec per latency flow -
273   additonal Tx/Rx interface latency induced by TRex SW writing and reading
274   packet timestamps on CPU cores without HW acceleration on NICs closer to the
275   interface line.
276
277
278 Methodology: KVM VM vhost
279 -------------------------
280
281 CSIT |release| introduced test environment configuration changes to KVM Qemu
282 vhost-user tests in order to more representatively measure |vpp-release|
283 performance in configurations with vhost-user interfaces and different Qemu
284 settings.
285
286 FD.io CSIT performance lab is testing VPP vhost with KVM VMs using following
287 environment settings:
288
289 - Tests with varying Qemu virtio queue (a.k.a. vring) sizes: [vr256] default 256
290   descriptors, [vr1024] 1024 descriptors to optimize for packet throughput;
291
292 - Tests with varying Linux :abbr:`CFS (Completely Fair Scheduler)` settings:
293   [cfs] default settings, [cfsrr1] CFS RoundRobin(1) policy applied to all data
294   plane threads handling test packet path including all VPP worker threads and
295   all Qemu testpmd poll-mode threads;
296
297 - Resulting test cases are all combinations with [vr256,vr1024] and
298   [cfs,cfsrr1] settings;
299
300 - Adjusted Linux kernel :abbr:`CFS (Completely Fair Scheduler)` scheduler policy
301   for data plane threads used in CSIT is documented in
302   `CSIT Performance Environment Tuning wiki <https://wiki.fd.io/view/CSIT/csit-perf-env-tuning-ubuntu1604>`_.
303   The purpose is to verify performance impact (NDR, PDR throughput) and
304   same test measurements repeatability, by making VPP and VM data plane
305   threads less susceptible to other Linux OS system tasks hijacking CPU
306   cores running those data plane threads.
307
308 Methodology: LXC Container memif
309 --------------------------------
310
311 CSIT |release| introduced new tests - VPP Memif virtual interface (shared memory
312 interface) tests interconnecting VPP instances over memif. VPP vswitch instance
313 runs in bare-metal user-mode handling Intel x520 NIC 10GbE interfaces and
314 connecting over memif (Master side) virtual interfaces to another instance of
315 VPP running in bare-metal :abbr:`LXC (Linux Container)` with memif virtual
316 interfaces (Slave side). LXC runs in a priviliged mode with VPP data plane worker
317 threads pinned to dedicated physical CPU cores per usual CSIT practice. Both VPP
318 run the same version of software. This test topology is equivalent to existing
319 tests with vhost-user and VMs.
320
321 Methodology: IPSec with Intel QAT HW cards
322 ------------------------------------------
323
324 VPP IPSec performance tests are using DPDK cryptodev device driver in
325 combination with HW cryptodev devices - Intel QAT 8950 50G - present in
326 LF FD.io physical testbeds. DPDK cryptodev can be used for all IPSec
327 data plane functions supported by VPP.
328
329 Currently CSIT |release| implements following IPSec test cases:
330
331 - AES-GCM, CBC-SHA1 ciphers, in combination with IPv4 routed-forwarding
332   with Intel xl710 NIC.
333 - CBC-SHA1 ciphers, in combination with LISP-GPE overlay tunneling for
334   IPv4-over-IPv4 with Intel xl710 NIC.
335
336 Methodology: TRex Traffic Generator Usage
337 -----------------------------------------
338
339 The `TRex traffic generator <https://wiki.fd.io/view/TRex>`_ is used for all
340 CSIT performance tests. TRex stateless mode is used to measure NDR and PDR
341 throughputs using binary search (NDR and PDR discovery tests) and for quick
342 checks of DUT performance against the reference NDRs (NDR check tests) for
343 specific configuration.
344
345 TRex is installed and run on the TG compute node. The typical procedure is:
346
347 - If the TRex is not already installed on TG, it is installed in the
348   suite setup phase - see `TRex intallation`_.
349 - TRex configuration is set in its configuration file
350   ::
351
352   /etc/trex_cfg.yaml
353
354 - TRex is started in the background mode
355   ::
356
357   $ sh -c 'cd /opt/trex-core-2.25/scripts/ && sudo nohup ./t-rex-64 -i -c 7 --iom 0 > /dev/null 2>&1 &' > /dev/null
358
359 - There are traffic streams dynamically prepared for each test, based on traffic
360   profiles. The traffic is sent and the statistics obtained using
361   :command:`trex_stl_lib.api.STLClient`.
362
363 **Measuring packet loss**
364
365 - Create an instance of STLClient
366 - Connect to the client
367 - Add all streams
368 - Clear statistics
369 - Send the traffic for defined time
370 - Get the statistics
371
372 If there is a warm-up phase required, the traffic is sent also before test and
373 the statistics are ignored.
374
375 **Measuring latency**
376
377 If measurement of latency is requested, two more packet streams are created (one
378 for each direction) with TRex flow_stats parameter set to STLFlowLatencyStats. In
379 that case, returned statistics will also include min/avg/max latency values.