IETF: MLRsearch draft update
[csit.git] / docs / ietf / draft-ietf-bmwg-mlrsearch-02.md
1 ---
2 title: Multiple Loss Ratio Search for Packet Throughput (MLRsearch)
3 abbrev: Multiple Loss Ratio Search
4 docname: draft-ietf-bmwg-mlrsearch-02
5 date: 2021-11-02
6
7 ipr: trust200902
8 area: ops
9 wg: Benchmarking Working Group
10 kw: Internet-Draft
11 cat: info
12
13 coding: us-ascii
14 pi:    # can use array (if all yes) or hash here
15   toc: yes
16   sortrefs:   # defaults to yes
17   symrefs: yes
18
19 author:
20       -
21         ins: M. Konstantynowicz
22         name: Maciek Konstantynowicz
23         org: Cisco Systems
24         role: editor
25         email: mkonstan@cisco.com
26       -
27         ins: V. Polak
28         name: Vratko Polak
29         org: Cisco Systems
30         email: vrpolak@cisco.com
31
32 normative:
33   RFC2544:
34
35 informative:
36   FDio-CSIT-MLRsearch:
37     target: https://docs.fd.io/csit/rls2101/report/introduction/methodology_data_plane_throughput/methodology_mlrsearch_tests.html
38     title: "FD.io CSIT Test Methodology - MLRsearch"
39     date: 2021-02
40   PyPI-MLRsearch:
41     target: https://pypi.org/project/MLRsearch/0.4.0/
42     title: "MLRsearch 0.4.0, Python Package Index"
43     date: 2021-04
44
45 --- abstract
46
47 This document proposes changes to [RFC2544], specifically to packet
48 throughput search methodology, by defining a new search algorithm
49 referred to as Multiple Loss Ratio search (MLRsearch for short). Instead
50 of relying on binary search with pre-set starting offered load, it
51 proposes a novel approach discovering the starting point in the initial
52 phase, and then searching for packet throughput based on defined packet
53 loss ratio (PLR) input criteria and defined final trial duration time.
54 One of the key design principles behind MLRsearch is minimizing the
55 total test duration and searching for multiple packet throughput rates
56 (each with a corresponding PLR) concurrently, instead of doing it
57 sequentially.
58
59 The main motivation behind MLRsearch is the new set of challenges and
60 requirements posed by NFV (Network Function Virtualization),
61 specifically software based implementations of NFV data planes. Using
62 [RFC2544] in the experience of the authors yields often not repetitive
63 and not replicable end results due to a large number of factors that are
64 out of scope for this draft. MLRsearch aims to address this challenge
65 in a simple way of getting the same result sooner, so more repetitions
66 can be done to describe the replicability.
67
68 --- middle
69
70 # Terminology
71
72 * Frame size: size of an Ethernet Layer-2 frame on the wire, including
73   any VLAN tags (dot1q, dot1ad) and Ethernet FCS, but excluding Ethernet
74   preamble and inter-frame gap. Measured in bytes (octets).
75 * Packet size: same as frame size, both terms used interchangeably.
76 * Device Under Test (DUT): In software networking, "device" denotes a
77   specific piece of software tasked with packet processing. Such device
78   is surrounded with other software components (such as operating system
79   kernel). It is not possible to run devices without also running the
80   other components, and hardware resources are shared between both. For
81   purposes of testing, the whole set of hardware and software components
82   is called "system under test" (SUT). As SUT is the part of the whole
83   test setup performance of which can be measured by [RFC2544] methods,
84   this document uses SUT instead of [RFC2544] DUT. Device under test
85   (DUT) can be re-introduced when analysing test results using whitebox
86   techniques, but this document sticks to blackbox testing.
87 * System Under Test (SUT): System under test (SUT) is a part of the
88   whole test setup whose performance is to be benchmarked. The complete
89   test setup contains other parts, whose performance is either already
90   established, or not affecting the benchmarking result.
91 * Bi-directional throughput tests: involve packets/frames flowing in
92   both transmit and receive directions over every tested interface of
93   SUT/DUT. Packet flow metrics are measured per direction, and can be
94   reported as aggregate for both directions and/or separately
95   for each measured direction. In most cases bi-directional tests
96   use the same (symmetric) load in both directions.
97 * Uni-directional throughput tests: involve packets/frames flowing in
98   only one direction, i.e. either transmit or receive direction, over
99   every tested interface of SUT/DUT. Packet flow metrics are measured
100   and are reported for measured direction.
101 * Packet Loss Ratio (PLR): ratio of packets received relative to packets
102   transmitted over the test trial duration, calculated using formula:
103   PLR = ( pkts_transmitted - pkts_received ) / pkts_transmitted.
104   For bi-directional throughput tests aggregate PLR is calculated based
105   on the aggregate number of packets transmitted and received.
106 * Effective loss ratio: A corrected value of measured packet loss ratio
107   chosen to avoid difficulties if SUT exhibits decreasing loss
108   with increasing load. Maximum of packet loss ratios measured at the same
109   duration on all loads smaller than (and including) the current one.
110 * Target loss ratio: A packet loss ratio value acting as an input for search.
111   The search is finding tight enough lower and upper bound in intended load,
112   so that the lower bound has smaller or equal loss ratio, and upper bound
113   has strictly larger loss ratio. For the tightest upper bound,
114   the effective loss ratio is the same as packet loss ratio.
115   For the tightest lower bound, the effective loss ratio can be higher
116   than the packet loss ratio, but still not larger than the target loss ratio.
117 * Packet Throughput Rate: maximum packet offered load DUT/SUT forwards
118   within the specified Packet Loss Ratio (PLR). In many cases the rate
119   depends on the frame size processed by DUT/SUT. Hence packet
120   throughput rate MUST be quoted with specific frame size as received by
121   DUT/SUT during the measurement. For bi-directional tests, packet
122   throughput rate should be reported as aggregate for both directions.
123   Measured in packets-per-second (pps) or frames-per-second (fps),
124   equivalent metrics.
125 * Bandwidth Throughput Rate: a secondary metric calculated from packet
126   throughput rate using formula: bw_rate = pkt_rate * (frame_size +
127   L1_overhead) * 8, where L1_overhead for Ethernet includes preamble (8
128   octets) and inter-frame gap (12 octets). For bi-directional tests,
129   bandwidth throughput rate should be reported as aggregate for both
130   directions. Expressed in bits-per-second (bps).
131 * Non Drop Rate (NDR): maximum packet/bandwidth throughput rate sustained
132   by DUT/SUT at PLR equal zero (zero packet loss) specific to tested
133   frame size(s). MUST be quoted with specific packet size as received by
134   DUT/SUT during the measurement. Packet NDR measured in
135   packets-per-second (or fps), bandwidth NDR expressed in
136   bits-per-second (bps).
137 * Partial Drop Rate (PDR): maximum packet/bandwidth throughput rate
138   sustained by DUT/SUT at PLR greater than zero (non-zero packet loss)
139   specific to tested frame size(s). MUST be quoted with specific packet
140   size as received by DUT/SUT during the measurement. Packet PDR
141   measured in packets-per-second (or fps), bandwidth PDR expressed in
142   bits-per-second (bps).
143 * Maximum Receive Rate (MRR): packet/bandwidth rate regardless of PLR
144   sustained by DUT/SUT under specified Maximum Transmit Rate (MTR)
145   packet load offered by traffic generator. MUST be quoted with both
146   specific packet size and MTR as received by DUT/SUT during the
147   measurement. Packet MRR measured in packets-per-second (or fps),
148   bandwidth MRR expressed in bits-per-second (bps).
149 * Trial: a single measurement step. See [RFC2544] section 23.
150 * Trial duration: amount of time over which packets are transmitted
151   in a single measurement step.
152
153 # MLRsearch Background
154
155 Multiple Loss Ratio search (MLRsearch) is a packet throughput search
156 algorithm suitable for deterministic systems (as opposed to
157 probabilistic systems). MLRsearch discovers multiple packet throughput
158 rates in a single search, each rate is associated with a distinct
159 Packet Loss Ratio (PLR) criterion.
160
161 For cases when multiple rates need to be found, this property makes
162 MLRsearch more efficient in terms of time execution, compared to
163 traditional throughput search algorithms that discover a single packet
164 rate per defined search criteria (e.g. a binary search specified by
165 [RFC2544]). MLRsearch reduces execution time even further by relying on
166 shorter trial durations of intermediate steps, with only the final
167 measurements conducted at the specified final trial duration. This
168 results in the shorter overall search execution time when compared to a
169 traditional binary search, while guaranteeing the same results for
170 deterministic systems.
171
172 In practice, two rates with distinct PLRs are commonly used for packet
173 throughput measurements of NFV systems: Non Drop Rate (NDR) with PLR=0
174 and Partial Drop Rate (PDR) with PLR>0. The rest of this document
175 describes MLRsearch with NDR and PDR pair as an example.
176
177 Similarly to other throughput search approaches like binary search,
178 MLRsearch is effective for SUTs/DUTs with PLR curve that is
179 non-decreasing with growing offered load. It may not be as
180 effective for SUTs/DUTs with abnormal PLR curves, although
181 it will always converge to some value.
182
183 MLRsearch relies on traffic generator to qualify the received packet
184 stream as error-free, and invalidate the results if any disqualifying
185 errors are present e.g. out-of-sequence frames.
186
187 MLRsearch can be applied to both uni-directional and bi-directional
188 throughput tests.
189
190 For bi-directional tests, MLRsearch rates and ratios are aggregates of
191 both directions, based on the following assumptions:
192
193 * Traffic transmitted by traffic generator and received by SUT/DUT
194   has the same packet rate in each direction,
195   in other words the offered load is symmetric.
196 * SUT/DUT packet processing capacity is the same in both directions,
197   resulting in the same packet loss under load.
198
199 MLRsearch can be applied even without those assumptions,
200 but in that case the aggregate loss ratio is less useful as a metric.
201
202 MLRsearch can be used for network transactions consisting of more than
203 just one packet, or anything else that has intended load as input
204 and loss ratio as output (duration as input is optional).
205 This text uses mostly packet-centric language.
206
207 # MLRsearch Overview
208
209 The main properties of MLRsearch:
210
211 * MLRsearch is a duration aware multi-phase multi-rate search algorithm:
212   * Initial Phase determines promising starting interval for the search.
213   * Intermediate Phases progress towards defined final search criteria.
214   * Final Phase executes measurements according to the final search
215     criteria.
216   * Final search criteria are defined by following inputs:
217     * Target PLRs (e.g. 0.0 and 0.005 when searching for NDR and PDR).
218     * Final trial duration.
219     * Measurement resolution.
220 * Initial Phase:
221   * Measure MRR over initial trial duration.
222   * Measured MRR is used as an input to the first intermediate phase.
223 * Multiple Intermediate Phases:
224   * Trial duration:
225     * Start with initial trial duration in the first intermediate phase.
226     * Converge geometrically towards the final trial duration.
227   * Track all previous trial measurement results:
228     * Duration, offered load and loss ratio are tracked.
229     * Effective loss ratios are tracked.
230       * While in practice, real loss ratios can decrease with increasing load,
231         effective loss ratios never decrease. This is achieved by sorting
232         results by load, and using the effective loss ratio of the previous load
233         if the current loss ratio is smaller than that.
234     * The algorithm queries the results to find best lower and upper bounds.
235       * Effective loss ratios are always used.
236     * The phase ends if all target loss ratios have tight enough bounds.
237   * Search:
238     * Iterate over target loss ratios in increasing order.
239     * If both upper and lower bound are in measurement results for this duration,
240       apply bisect until the bounds are tight enough,
241       and continue with next loss ratio.
242     * If a bound is missing for this duration, but there exists a bound
243       from the previous duration (compatible with the other bound
244       at this duration), re-measure at the current duration.
245     * If a bound in one direction (upper or lower) is missing for this duration,
246       and the previous duration does not have a compatible bound,
247       compute the current "interval size" from the second tightest bound
248       in the other direction (lower or upper respectively)
249       for the current duration, and choose next offered load for external search.
250     * The logic guarantees that a measurement is never repeated with both
251       duration and offered load being the same.
252     * The logic guarantees that measurements for higher target loss ratio
253       iterations (still within the same phase duration) do not affect validity
254       and tightness of bounds for previous target loss ratio iterations
255       (at the same duration).
256   * Use of internal and external searches:
257     * External search:
258       * It is a variant of "exponential search".
259       * The "interval size" is multiplied by a configurable constant
260         (powers of two work well with the subsequent internal search).
261     * Internal search:
262       * A variant of binary search that measures at offered load between
263         the previously found bounds.
264       * The interval does not need to be split into exact halves,
265         if other split can get to the target width goal faster.
266         * The idea is to avoid returning interval narrower than the current
267           width goal. See sample implementation details, below.
268 * Final Phase:
269   * Executed with the final test trial duration, and the final width
270     goal that determines resolution of the overall search.
271 * Intermediate Phases together with the Final Phase are called
272   Non-Initial Phases.
273 * The returned bounds stay within prescribed min_rate and max_rate.
274   * When returning min_rate or max_rate, the returned bounds may be invalid.
275     * E.g. upper bound at max_rate may come from a measurement
276       with loss ratio still not higher than the target loss ratio.
277
278 The main benefits of MLRsearch vs. binary search include:
279
280 * In general, MLRsearch is likely to execute more trials overall, but
281   likely less trials at a set final trial duration.
282 * In well behaving cases, e.g. when results do not depend on trial
283   duration, it greatly reduces (>50%) the overall duration compared to a
284   single PDR (or NDR) binary search over duration, while finding
285   multiple drop rates.
286 * In all cases MLRsearch yields the same or similar results to binary
287   search.
288 * Note: both binary search and MLRsearch are susceptible to reporting
289   non-repeatable results across multiple runs for very bad behaving
290   cases.
291
292 Caveats:
293
294 * Worst case MLRsearch can take longer than a binary search, e.g. in case of
295   drastic changes in behaviour for trials at varying durations.
296   * Re-measurement at higher duration can trigger a long external search.
297     That never happens in binary search, which uses the final duration
298     from the start.
299
300 # Sample Implementation
301
302 Following is a brief description of a sample MLRsearch implementation,
303 which is a simplified version of the existing implementation.
304
305 ## Input Parameters
306
307 1. **max_rate** - Maximum Transmit Rate (MTR) of packets to
308    be used by external traffic generator implementing MLRsearch,
309    limited by the actual Ethernet link(s) rate, NIC model or traffic
310    generator capabilities.
311 2. **min_rate** - minimum packet transmit rate to be used for
312    measurements. MLRsearch fails if lower transmit rate needs to be
313    used to meet search criteria.
314 3. **final_trial_duration** - required trial duration for final rate
315    measurements.
316 4. **initial_trial_duration** - trial duration for initial MLRsearch phase.
317 5. **final_relative_width** - required measurement resolution expressed as
318    (lower_bound, upper_bound) interval width relative to upper_bound.
319 6. **packet_loss_ratios** - list of maximum acceptable PLR search criteria.
320 7. **number_of_intermediate_phases** - number of phases between the initial
321    phase and the final phase. Impacts the overall MLRsearch duration.
322    Less phases are required for well behaving cases, more phases
323    may be needed to reduce the overall search duration for worse behaving cases.
324
325 ## Initial Phase
326
327 1. First trial measures at configured maximum transmit rate (MTR) and
328    discovers maximum receive rate (MRR).
329    * IN: trial_duration = initial_trial_duration.
330    * IN: offered_transmit_rate = maximum_transmit_rate.
331    * DO: single trial.
332    * OUT: measured loss ratio.
333    * OUT: MRR = measured receive rate.
334    Received rate is computed as intended load multiplied by pass ratio
335    (which is one minus loss ratio). This is useful when loss ratio is computed
336    from a different metric than intended load. For example, intended load
337    can be in transactions (multiple packets each), but loss ratio is computed
338    on level of packets, not transactions.
339
340    * Example: If MTR is 10 transactions per second, and each transaction has
341      10 packets, and receive rate is 90 packets per second, then loss rate
342      is 10%, and MRR is computed to be 9 transactions per second.
343
344    If MRR is too close to MTR, MRR is set below MTR so that interval width
345    is equal to the width goal of the first intermediate phase.
346    If MRR is less than min_rate, min_rate is used.
347 2. Second trial measures at MRR and discovers MRR2.
348    * IN: trial_duration = initial_trial_duration.
349    * IN: offered_transmit_rate = MRR.
350    * DO: single trial.
351    * OUT: measured loss ratio.
352    * OUT: MRR2 = measured receive rate.
353    If MRR2 is less than min_rate, min_rate is used.
354    If loss ratio is less or equal to the smallest target loss ratio,
355    MRR2 is set to a value above MRR, so that interval width is equal
356    to the width goal of the first intermediate phase.
357    MRR2 could end up being equal to MTR (for example if both measurements so far
358    had zero loss), which was already measured, step 3 is skipped in that case.
359 3. Third trial measures at MRR2.
360    * IN: trial_duration = initial_trial_duration.
361    * IN: offered_transmit_rate = MRR2.
362    * DO: single trial.
363    * OUT: measured loss ratio.
364    * OUT: MRR3 = measured receive rate.
365    If MRR3 is less than min_rate, min_rate is used.
366    If step 3 is not skipped, the first trial measurement is forgotten.
367    This is done because in practice (if MRR2 is above MRR), external search
368    from MRR and MRR2 is likely to lead to a faster intermediate phase
369    than a bisect between MRR2 and MTR.
370
371 ## Non-Initial Phases
372
373 1. Main phase loop:
374    1. IN: trial_duration for the current phase. Set to
375       initial_trial_duration for the first intermediate phase; to
376       final_trial_duration for the final phase; or to the element of
377       interpolating geometric sequence for other intermediate phases.
378       For example with two intermediate phases, trial_duration of the
379       second intermediate phase is the geometric average of
380       initial_trial_duration and final_trial_duration.
381    2. IN: relative_width_goal for the current phase. Set to
382       final_relative_width for the final phase; doubled for each
383       preceding phase. For example with two intermediate phases, the
384       first intermediate phase uses quadruple of final_relative_width
385       and the second intermediate phase uses double of
386       final_relative_width.
387    3. IN: Measurement results from the previous phase (previous duration).
388    4. Internal target ratio loop:
389       1. IN: Target loss ratio for this iteration of ratio loop.
390       2. IN: Measurement results from all previous ratio loop iterations
391          of current phase (current duration).
392       3. DO: According to the procedure described in point 2:
393          1. either exit the phase (by jumping to 1.5),
394          2. or exit loop iteration (by continuing with next target loss ratio,
395             jumping to 1.4.1),
396          3. or calculate new transmit rate to measure with.
397       4. DO: Perform the trial measurement at the new transmit rate and
398          current trial duration, compute its loss ratio.
399       5. DO: Add the result and go to next iteration (1.4.1),
400          including the added trial result in 1.4.2.
401    5. OUT: Measurement results from this phase.
402    6. OUT: In the final phase, bounds for each target loss ratio
403       are extracted and returned.
404       1. If a valid bound does not exist, use min_rate or max_rate.
405 2. New transmit rate (or exit) calculation (for point 1.4.3):
406    1. If the previous duration has the best upper and lower bound,
407       select the middle point as the new transmit rate.
408       1. See 2.5.3. below for the exact splitting logic.
409       2. This can be a no-op if interval is narrow enough already,
410          in that case continue with 2.2.
411       3. Discussion, assuming the middle point is selected and measured:
412          1. Regardless of loss rate measured, the result becomes
413             either best upper or best lower bound at current duration.
414          2. So this condition is satisfied at most once per iteration.
415          3. This also explains why previous phase has double width goal:
416             1. We avoid one more bisection at previous phase.
417             2. At most one bound (per iteration) is re-measured
418                with current duration.
419             3. Each re-measurement can trigger an external search.
420             4. Such surprising external searches are the main hurdle
421                in achieving low overall search durations.
422             5. Even without 1.1, there is at most one external search
423                per phase and target loss ratio.
424             6. But without 1.1 there can be two re-measurements,
425                each coming with a risk of triggering external search.
426    2. If the previous duration has one bound best, select its transmit rate.
427       In deterministic case this is the last measurement needed this iteration.
428    3. If only upper bound exists in current duration results:
429       1. This can only happen for the smallest target loss ratio.
430       2. If the upper bound was measured at min_rate,
431          exit the whole phase early (not investigating other target loss ratios).
432       3. Select new transmit rate using external search:
433          1. For computing previous interval size, use:
434             1. second tightest bound at current duration,
435             2. or tightest bound of previous duration,
436                if compatible and giving a more narrow interval,
437             3. or target interval width if none of the above is available.
438             4. In any case increase to target interval width if smaller.
439          2. Quadruple the interval width.
440          3. Use min_rate if the new transmit rate is lower.
441    4. If only lower bound exists in current duration results:
442       1. If the lower bound was measured at max_rate,
443          exit this iteration (continue with next lowest target loss ratio).
444       2. Select new transmit rate using external search:
445          1. For computing previous interval size, use:
446             1. second tightest bound at current duration,
447             2. or tightest bound of previous duration,
448                if compatible and giving a more narrow interval,
449             3. or target interval width if none of the above is available.
450             4. In any case increase to target interval width if smaller.
451          2. Quadruple the interval width.
452          3. Use max_rate if the new transmit rate is higher.
453    5. The only remaining option is both bounds in current duration results.
454       1. This can happen in two ways, depending on how the lower bound
455          was chosen.
456          1. It could have been selected for the current loss ratio,
457             e.g. in re-measurement (2.2) or in initial bisect (2.1).
458          2. It could have been found as an upper bound for the previous smaller
459             target loss ratio, in which case it might be too low.
460          3. The algorithm does not track which one is the case,
461             as the decision logic works well regardless.
462       2. Compute "extending down" candidate transmit rate exactly as in 2.3.
463       3. Compute "bisecting" candidate transmit rate:
464          1. Compute the current interval width from the two bounds.
465          2. Express the width as a (float) multiple of the target width goal
466             for this phase.
467          3. If the multiple is not higher than one, it means the width goal
468             is met. Exit this iteration and continue with next higher
469             target loss ratio.
470          4. If the multiple is two or less, use half of that
471             for new width if the lower subinterval.
472          5. Round the multiple up to nearest even integer.
473          6. Use half of that for new width if the lower subinterval.
474          7. Example: If lower bound is 2.0 and upper bound is 5.0, and width
475             goal is 1.0, the new candidate transmit rate will be 4.0.
476             This can save a measurement when 4.0 has small loss.
477             Selecting the average (3.5) would never save a measurement,
478             giving more narrow bounds instead.
479       4. If either candidate computation want to exit the iteration,
480          do as bisecting candidate computation says.
481       5. The remaining case is both candidates wanting to measure at some rate.
482          Use the higher rate. This prefers external search down narrow enough
483          interval, competing with perfectly sized lower bisect subinterval.
484
485 # FD.io CSIT Implementation
486
487 The only known working implementation of MLRsearch is in
488 the open-source code running in Linux Foundation
489 FD.io CSIT project [FDio-CSIT-MLRsearch] as part of
490 a Continuous Integration / Continuous Development (CI/CD) framework.
491
492 MLRsearch is also available as a Python package in [PyPI-MLRsearch].
493
494 ## Additional details
495
496 This document so far has been describing a simplified version of
497 MLRsearch algorithm. The full algorithm as implemented in CSIT contains
498 additional logic, which makes some of the details (but not general
499 ideas) above incorrect. Here is a short description of the additional
500 logic as a list of principles, explaining their main differences from
501 (or additions to) the simplified description, but without detailing
502 their mutual interaction.
503
504 1. Logarithmic transmit rate.
505    * In order to better fit the relative width goal, the interval
506      doubling and halving is done differently.
507    * For example, the middle of 2 and 8 is 4, not 5.
508 2. Timeout for bad cases.
509    * The worst case for MLRsearch is when each phase converges to
510      intervals way different than the results of the previous phase.
511    * Rather than suffer total search time several times larger than pure
512      binary search, the implemented tests fail themselves when the
513      search takes too long (given by argument *timeout*).
514 3. Intended count.
515    * The number of packets to send during the trial should be equal to
516      the intended load multiplied by the duration.
517      * Also multiplied by a coefficient, if loss ratio is calculated
518        from a different metric.
519        * Example: If a successful transaction uses 10 packets,
520          load is given in transactions per second, but loss ratio is calculated
521          from packets, so the coefficient to get intended count of packets
522          is 10.
523    * But in practice that does not work.
524      * It could result in a fractional number of packets,
525      * so it has to be rounded in a way traffic generator chooses,
526      * which may depend on the number of traffic flows
527        and traffic generator worker threads.
528 4. Attempted count. As the real number of intended packets is not known exactly,
529    the computation uses the number of packets traffic generator reports as sent.
530    Unless overridden by the next point.
531 5. Duration stretching.
532    * In some cases, traffic generator may get overloaded,
533      causing it to take significantly longer (than duration) to send all packets.
534    * The implementation uses an explicit stop,
535      * causing lower attempted count in those cases.
536    * The implementation tolerates some small difference between
537      attempted count and intended count.
538      * 10 microseconds worth of traffic is sufficient for our tests.
539    * If the difference is higher, the unsent packets are counted as lost.
540      * This forces the search to avoid the regions of high duration stretching.
541      * The final bounds describe the performance of not just SUT,
542        but of the whole system, including the traffic generator.
543 6. Excess packets.
544    * In some test (e.g. using TCP flows) Traffic generator reacts to packet loss
545      by retransmission. Usually, such packet loss is already affecting loss ratio.
546      If a test also wants to treat retransmissions due to heavily delayed packets
547      also as a failure, this is once again visible as a mismatch between
548      the intended count and the attempted count.
549    * The CSIT implementation simply looks at absolute value of the difference,
550      so it offers the same small tolerance before it starts marking a "loss".
551 7. For result processing, we use lower bounds and ignore upper bounds.
552
553 ### FD.io CSIT Input Parameters
554
555 1. **max_rate** - Typical values: 2 * 14.88 Mpps for 64B
556    10GE link rate, 2 * 18.75 Mpps for 64B 40GE NIC (specific model).
557 2. **min_rate** - Value: 2 * 9001 pps (we reserve 9000 pps
558    for latency measurements).
559 3. **final_trial_duration** - Value: 30.0 seconds.
560 4. **initial_trial_duration** - Value: 1.0 second.
561 5. **final_relative_width** - Value: 0.005 (0.5%).
562 6. **packet_loss_ratios** - Value: 0.0, 0.005 (0.0% for NDR, 0.5% for PDR).
563 7. **number_of_intermediate_phases** - Value: 2.
564    The value has been chosen based on limited experimentation to date.
565    More experimentation needed to arrive to clearer guidelines.
566 8. **timeout** - Limit for the overall search duration (for one search).
567    If MLRsearch oversteps this limit, it immediately declares the test failed,
568    to avoid wasting even more time on a misbehaving SUT.
569    Value: 600.0 (seconds).
570 9. **expansion_coefficient** - Width multiplier for external search.
571    Value: 4.0 (interval width is quadroupled).
572    Value of 2.0 is best for well-behaved SUTs, but value of 4.0 has been found
573    to decrease overall search time for worse-behaved SUT configurations,
574    contributing more to the overall set of different SUT configurations tested.
575
576
577 ## Example MLRsearch Run
578
579
580 The following list describes a search from a real test run in CSIT
581 (using the default input values as above).
582
583 * Initial phase, trial duration 1.0 second.
584
585 Measurement 1, intended load 18750000.0 pps (MTR),
586 measured loss ratio 0.7089514628479618 (valid upper bound for both NDR and PDR).
587
588 Measurement 2, intended load 5457160.071600716 pps (MRR),
589 measured loss ratio 0.018650817320118702 (new tightest upper bounds).
590
591 Measurement 3, intended load 5348832.933500009 pps (slightly less than MRR2
592 in preparation for first intermediate phase target interval width),
593 measured loss ratio 0.00964383362905351 (new tightest upper bounds).
594
595 * First intermediate phase starts, trial duration still 1.0 seconds.
596
597 Measurement 4, intended load 4936605.579021453 pps (no lower bound,
598 performing external search downwards, for NDR),
599 measured loss ratio 0.0 (valid lower bound for both NDR and PDR).
600
601 Measurement 5, intended load 5138587.208637197 pps (bisecting for NDR),
602 measured loss ratio 0.0 (new tightest lower bounds).
603
604 Measurement 6, intended load 5242656.244044665 pps (bisecting),
605 measured loss ratio 0.013523745379347257 (new tightest upper bounds).
606
607 * Both intervals are narrow enough.
608 * Second intermediate phase starts, trial duration 5.477225575051661 seconds.
609
610 Measurement 7, intended load 5190360.904111567 pps (initial bisect for NDR),
611 measured loss ratio 0.0023533920869969953 (NDR upper bound, PDR lower bound).
612
613 Measurement 8, intended load 5138587.208637197 pps (re-measuring NDR lower bound),
614 measured loss ratio 1.2080222912800403e-06 (new tightest NDR upper bound).
615
616 * The two intervals have separate bounds from now on.
617
618 Measurement 9, intended load 4936605.381062318 pps (external NDR search down),
619 measured loss ratio 0.0 (new valid NDR lower bound).
620
621 Measurement 10, intended load 5036583.888432355 pps (NDR bisect),
622 measured loss ratio 0.0 (new tightest NDR lower bound).
623
624 Measurement 11, intended load 5087329.903232804 pps (NDR bisect),
625 measured loss ratio 0.0 (new tightest NDR lower bound).
626
627 * NDR interval is narrow enough, PDR interval not ready yet.
628
629 Measurement 12, intended load 5242656.244044665 pps (re-measuring PDR upper bound),
630 measured loss ratio 0.0101174866190136 (still valid PDR upper bound).
631
632 * Also PDR interval is narrow enough, with valid bounds for this duration.
633 * Final phase starts, trial duration 30.0 seconds.
634
635 Measurement 13, intended load 5112894.3238511775 pps (initial bisect for NDR),
636 measured loss ratio 0.0 (new tightest NDR lower bound).
637
638 Measurement 14, intended load 5138587.208637197 (re-measuring NDR upper bound),
639 measured loss ratio 2.030389804256833e-06 (still valid PDR upper bound).
640
641 * NDR interval is narrow enough, PDR interval not yet.
642
643 Measurement 15, intended load 5216443.04126728 pps (initial bisect for PDR),
644 measured loss ratio 0.005620871287975237 (new tightest PDR upper bound).
645
646 Measurement 16, intended load 5190360.904111567 (re-measuring PDR lower bound),
647 measured loss ratio 0.0027629971184465604 (still valid PDR lower bound).
648
649 * PDR interval is also narrow enough.
650 * Returning bounds:
651 * NDR_LOWER = 5112894.3238511775 pps; NDR_UPPER = 5138587.208637197 pps;
652 * PDR_LOWER = 5190360.904111567 pps; PDR_UPPER = 5216443.04126728 pps.
653
654 # IANA Considerations
655
656 No requests of IANA.
657
658 # Security Considerations
659
660 Benchmarking activities as described in this memo are limited to
661 technology characterization of a DUT/SUT using controlled stimuli in a
662 laboratory environment, with dedicated address space and the constraints
663 specified in the sections above.
664
665 The benchmarking network topology will be an independent test setup and
666 MUST NOT be connected to devices that may forward the test traffic into
667 a production network or misroute traffic to the test management network.
668
669 Further, benchmarking is performed on a "black-box" basis, relying
670 solely on measurements observable external to the DUT/SUT.
671
672 Special capabilities SHOULD NOT exist in the DUT/SUT specifically for
673 benchmarking purposes. Any implications for network security arising
674 from the DUT/SUT SHOULD be identical in the lab and in production
675 networks.
676
677 # Acknowledgements
678
679 Many thanks to Alec Hothan of OPNFV NFVbench project for thorough
680 review and numerous useful comments and suggestions.
681
682 --- back