TestSpec: Add flow Classification section
[vswitchperf.git] / test_spec / vswitchperf_ltd.md
index c850c10..051e8b8 100755 (executable)
@@ -11,6 +11,7 @@
 - [2. Details of the Level Test Design](#DetailsOfTheLevelTestDesign)
   - [2.1. Features to be tested](#FeaturesToBeTested)
   - [2.2. Approach](#Approach)
+    - [2.2.1 Details of the Test Report](#TestReport)
   - [2.3. Test identification](#TestIdentification)
     - [2.3.1 Throughput tests](#ThroughputTests)
     - [2.3.2 Packet Delay Tests](#PacketDelayTests)
@@ -333,6 +334,9 @@ The following represents possible deployments which can help to determine the pe
 
  **Note**: For throughput tests unless stated otherwise, test configurations should ensure that traffic traverses the installed flows through the switch, i.e. flows are installed and have an appropriate time out that doesn't expire before packet transmission starts.
 
+#####Flow Classification:
+Virtual switches group packets into flows by processing and matching particular header fields in the packet or frame, or by matching packets based on the input ports into the vSwitch. Thus a flow is considered to be a sequence of packets that have a shared set of header field values or have arrived on the same port. Performance results can vary based on the parameters the vSwitch uses to match for a flow. The recommended  flow classification parameters for any vSwitch performance tests are: the input port, the source IP address, the destination IP address and the Ethernet protocol type field. It is essential to increase the flow time-out time on a vSwitch before conducting any performance tests that do not measure the flow set-up time. Normally the first packet of a particular flow will install the flow in the vSwitch which adds an additional latency, subsequent packets of the same flow are not subject to this latency if the flow is already installed on the vSwitch.
+
  #####Test Priority
   Tests will be assigned a priority in order to determine which tests should be implemented immediately and which tests implementations can be deferred.
 
@@ -442,6 +446,91 @@ The following represents possible deployments which can help to determine the pe
 
   = 14,880,952.38 frame per second (fps)
 
+####System isolation and validation
+A key consideration when conducting any sort of benchmark is trying to ensure the consistency and repeatability of test results between runs. When benchmarking the performance of a virtual switch there are many factors that can affect the consistency of results. This section describes these factors and the measures that can be taken to limit their effects. In addition, this section will outline some system tests to validate the platform and the VNF before conducting any vSwitch benchmarking tests.
+
+#####System Isolation
+When conducting a benchmarking test on any SUT, it is essential to limit (and if reasonable, eliminate) any noise that may interfere with the accuracy of the metrics collected by the test. This noise may be introduced by other hardware or software (OS, other applications), and can result in significantly varying performance metrics being collected between consecutive runs of the same test. In the case of characterizing the performance of a virtual switch, there are a number of configuration parameters that can help increase the repeatability and stability of test results, including:
+
+  - OS/GRUB configuration:
+    - maxcpus = n where n >= 0; limits the kernel to using 'n' processors. Only use exactly what you need.
+    - isolcpus: Isolate CPUs from the general scheduler. Isolate all CPUs bar one which will be used by the OS.
+    - use taskset to affinitize the forwarding application and the VNFs onto isolated cores. VNFs and the vSwitch should be allocated their own cores, i.e. must not share the same cores. vCPUs for the VNF should be affinitized to individual cores also.
+    - Limit the amount of background applications that are running and set OS to boot to runlevel 3. Make sure to kill any unnecessary system processes/daemons.
+    - Only enable hardware that you need to use for your test – to ensure there are no other interrupts on the system.
+    - Configure NIC interrupts to only use the cores that are not allocated to any other process (VNF/vSwitch).
+  - NUMA configuration: Any unused sockets in a multi-socket system should be disabled.
+  - CPU pinning: The vSwitch and the VNF should each be affinitized to separate logical cores using a combination of maxcpus, isolcpus and taskset.
+  - BIOS configuration: BIOS should be configured for performance where an explicit option exists, sleep states should be disabled, any virtualization optimization technologies should be enabled, and hyperthreading should also be enabled.
+
+#####System Validation
+System validation is broken down into two sub-categories: Platform validation and VNF validation. The validation test itself involves verifying the forwarding capability and stability for the sub-system under test. The rationale behind system validation is two fold. Firstly to give a tester confidence in the stability of the platform or VNF that is being tested; and secondly to provide base performance comparison points to understand the overhead introduced by the virtual switch.
+
+######Benchmark platform forwarding capability
+This is an OPTIONAL test used to verify the platform and measure the base performance (maximum forwarding rate in fps and latency) that can be achieved by the platform without a vSwitch or a VNF.
+
+The following diagram outlines the set-up for benchmarking Platform forwarding capability:
+<pre><code>
+                                                         __
+    +--------------------------------------------------+   |
+    |   +------------------------------------------+   |   |
+    |   |                                          |   |   |
+    |   |          l2fw or DPDK L2FWD app          |   |  Host
+    |   |                                          |   |   |
+    |   +------------------------------------------+   |   |
+    |   |                 NIC                      |   |   |
+    +---+------------------------------------------+---+ __|
+               ^                           :
+               |                           |
+               :                           v
+    +--------------------------------------------------+
+    |                                                  |
+    |                traffic generator                 |
+    |                                                  |
+    +--------------------------------------------------+
+</code></pre>
+
+######Benchmark VNF forwarding capability
+This test is used to verify the VNF and measure the base performance (maximum forwarding rate in fps and latency) that can be achieved by the VNF without a vSwitch. The performance metrics collected by this test will serve as a key comparison point for NIC passthrough technologies and vSwitches. VNF in this context refers to the hypervisor and the VM.
+
+The following diagram outlines the set-up for benchmarking VNF forwarding capability:
+<pre><code>
+                                                         __
+    +--------------------------------------------------+   |
+    |   +------------------------------------------+   |   |
+    |   |                                          |   |   |
+    |   |                 VNF                      |   |   |
+    |   |                                          |   |   |
+    |   +------------------------------------------+   |   |
+    |   |          Passthrough/SR-IOV              |   |  Host
+    |   +------------------------------------------+   |   |
+    |   |                 NIC                      |   |   |
+    +---+------------------------------------------+---+ __|
+               ^                           :
+               |                           |
+               :                           v
+    +--------------------------------------------------+
+    |                                                  |
+    |                traffic generator                 |
+    |                                                  |
+    +--------------------------------------------------+
+</code></pre>
+
+######Methodology to benchmark Platform/VNF forwarding capability
+The recommended methodology for the platform/VNF validation and benchmark is:
+  - Run [RFC2889] Maximum Forwarding Rate test, this test will produce maximum forwarding rate and latency results that will serve as the expected values. These expected values can be used in subsequent steps or compared with in subsequent validation tests.
+  - Transmit bidirectional traffic at line rate/max forwarding rate (whichever is higher) for at least 72 hours, measure throughput (fps) and latency.
+  - Note: Traffic should be bidirectional.
+  - Establish a baseline forwarding rate for what the platform can achieve.
+  - Additional validation: After the test has completed for 72 hours run bidirectional traffic at the maximum forwarding rate once more to see if the system is still functional and measure throughput (fps) and latency. Compare the measure the new obtained values with the expected values.
+
+**NOTE 1**: How the Platform is configured for its forwarding capability test (BIOS settings, GRUB configuration, runlevel...) is how the platform should be configured for every test after this
+
+**NOTE 2**: How the VNF is configured for its forwarding capability test (# of vCPUs, vNICs, Memory, affinitization…) is how it should be configured for every test that uses a VNF after this.
+
+####RFCs for testing switch performance
+The starting point for defining the suite of tests for benchmarking the performance of a virtual switch is to take existing RFCs and standards that were designed to test their physical counterparts and adapting them for testing virtual switches. The rationale behind this is to establish a fair comparison between the performance of virtual and physical switches. This section outlines the RFCs that are used by this specification.
+
   #####RFC 1242 Benchmarking Terminology for Network Interconnection Devices
   RFC 1242 defines the terminology that is used in describing performance benchmarking tests and their results. Definitions and discussions covered include: Back-to-back, bridge, bridge/router, constant load, data link frame size, frame loss rate, inter frame gap, latency, and many more.
 
@@ -478,6 +567,44 @@ The following represents possible deployments which can help to determine the pe
   #####RFC 6201 Device Reset Characterization
   RFC 6201 extends the methodology for characterizing the speed of recovery of the DUT from device or software reset described in RFC 2544.
 
+  <a name="TestReport"></a>
+  ####2.2.1 Details of the Test Report
+  There are a number of parameters related to the system, DUT and tests that can affect the repeatability of a test results and should be recorded. In order to minimise the variation in the results of a test, it is recommended that the test report includes the following information:
+
+  - Hardware details including:
+    - Platform details.
+    - Processor details.
+    - Memory information (type and size).
+    - Number of enabled cores.
+    - Number of cores used for the test.
+    - Number of physical NICs, as well as their details (manufacturer, versions, type and the PCI slot they are plugged into).
+    - NIC interrupt configuration.
+    - BIOS version, release date and any configurations that were modified.
+  - Software details including:
+    - OS version (for host and VNF)
+    - Kernel version (for host and VNF)
+    - GRUB boot parameters (for host and VNF).
+    - Hypervisor details (Type and version).
+    - Selected vSwitch, version number or commit id used.
+      - vSwitch launch command line if it has been parameterised.
+      - Memory allocation to the vSwitch – which NUMA node it is using, and how many memory channels.
+    - DPDK or any other SW dependency version number or commit id used.
+    - Memory allocation to a VM - if it's from Hugpages/elsewhere.
+    - VM storage type: snapshot/independent persistent/independent non-persistent.
+    - Number of VMs.
+    - Number of Virtual NICs (vNICs), versions, type and driver.
+    - Number of virtual CPUs and their core affinity on the host.
+    - Number vNIC interrupt configuration.
+    - Thread affinitization for the applications (including the vSwitch itself) on the host.
+    - Details of Resource isolation, such as CPUs designated for Host/Kernel (isolcpu) and CPUs designated for specific processes (taskset).
+  - Test duration.
+  - Number of flows.
+  - Traffic Information:
+    - Traffic type - UDP, TCP, IMIX / Other.
+    - Packet Sizes.
+  - Deployment Scenario.
+
+  Note: Tests that require additional parameters to be recorded will explicitly specify this.
 
 <a name="TestIdentification"></a>
 ###2.3. Test identification
@@ -750,7 +877,7 @@ The following represents possible deployments which can help to determine the pe
 
 <br/>
 
- - #####Test ID: LTD.Throughput.RFC2889.ForwardingRate
+ - #####Test ID: LTD.Throughput.RFC2889.MaxForwardingRate
 
   **Title**: RFC2889 Forwarding Rate Test
 
@@ -764,7 +891,7 @@ The following represents possible deployments which can help to determine the pe
 
   Traffic should be sent to the DUT at a particular rate (TX rate) starting with TX rate equal to the throughput rate. The rate of successfully received frames at the destination counted (in FPS). If the RX rate is equal to the TX rate, the TX rate should be increased by a fixed step size and the RX rate measured again until the Max Forwarding Rate is found.
 
-  The trial duration for each iteration should last for the period of time needed for the system to reach steady state for the frame size being tested. Under [RFC2889] test methodology, the test duration should run for a minimum period of 30 seconds, regardless whether the system reaches steady state before the minimum duration ends.
+  The trial duration for each iteration should last for the period of time needed for the system to reach steady state for the frame size being tested. Under [RFC2889] (Sec. 5.6.3.1) test methodology, the test duration should run for a minimum period of 30 seconds, regardless whether the system reaches steady state before the minimum duration ends.
 
   **Expected Result**:
   According to [RFC2889] The Max Forwarding Rate is the highest forwarding rate of a DUT taken from an iterative set of forwarding rate measurements. The iterative set of forwarding rate measurements are made by setting the intended load transmitted from an external source and measuring the offered load (i.e what the DUT is capable of forwarding). If the Throughput == the Maximum Offered Load, it follows that Max Forwarding Rate is equal to the Maximum Offered Load.
@@ -780,7 +907,7 @@ The following represents possible deployments which can help to determine the pe
  - #####Test ID: LTD.Throughput.RFC2889.ForwardPressure
   **Title**: RFC2889 Forward Pressure Test
 
-  **Prerequisite Test**: LTD.Throughput.RFC2889.ForwardingRate
+  **Prerequisite Test**: LTD.Throughput.RFC2889.MaxForwardingRate
 
   **Priority**:
 
@@ -789,7 +916,7 @@ The following represents possible deployments which can help to determine the pe
   The aim of this test is to determine if the DUT transmits frames with an inter-frame gap that is less than 12 bytes. This test overloads the DUT and measures the output for forward pressure. Traffic should be transmitted to the DUT with an inter-frame gap of 11 bytes, this will overload the DUT by 1 byte per frame. The forwarding rate of the DUT should be measured.
 
   **Expected Result**:
-  The forwarding rate should not exceed the maximum forwarding rate of the DUT collected by LTD.Throughput.RFC2889.ForwardingRate.
+  The forwarding rate should not exceed the maximum forwarding rate of the DUT collected by LTD.Throughput.RFC2889.MaxForwardingRate.
 
   **Metrics collected**
 
@@ -995,7 +1122,7 @@ The following represents possible deployments which can help to determine the pe
 - LTD.Throughput.RFC2544.Soak
 - LTD.Throughput.RFC2544.SoakFrameModification
 - LTD.Throughput.RFC6201.ResetTime
-- LTD.Throughput.RFC2889.ForwardingRate
+- LTD.Throughput.RFC2889.MaxForwardingRate
 - LTD.Throughput.RFC2889.ForwardPressure
 - LTD.Throughput.RFC2889.AddressCachingCapacity
 - LTD.Throughput.RFC2889.AddressLearningRate