1 # Copyright (c) 2018 Cisco and/or its affiliates.
2 # Licensed under the Apache License, Version 2.0 (the "License");
3 # you may not use this file except in compliance with the License.
4 # You may obtain a copy of the License at:
6 # http://www.apache.org/licenses/LICENSE-2.0
8 # Unless required by applicable law or agreed to in writing, software
9 # distributed under the License is distributed on an "AS IS" BASIS,
10 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 # See the License for the specific language governing permissions and
12 # limitations under the License.
15 | Library | Collections
16 | Library | resources.libraries.python.topology.Topology
17 | Library | resources.libraries.python.NodePath
18 | Library | resources.libraries.python.DpdkUtil
19 | Library | resources.libraries.python.InterfaceUtil
20 | Library | resources.libraries.python.KubernetesUtils
21 | Library | resources.libraries.python.VhostUser
22 | Library | resources.libraries.python.TrafficGenerator
23 | Library | resources.libraries.python.TrafficGenerator.OptimizedSearch
24 | Library | resources.libraries.python.TrafficGenerator.TGDropRateSearchImpl
25 | Library | resources.libraries.python.Trace
26 | Resource | resources/libraries/robot/shared/default.robot
27 | Resource | resources/libraries/robot/shared/interfaces.robot
28 | Resource | resources/libraries/robot/shared/counters.robot
29 | Resource | resources/libraries/robot/shared/container.robot
30 | Resource | resources/libraries/robot/shared/memif.robot
31 | Resource | resources/libraries/robot/l2/l2_bridge_domain.robot
32 | Resource | resources/libraries/robot/l2/l2_xconnect.robot
33 | Resource | resources/libraries/robot/ip/ip4.robot
34 | Resource | resources/libraries/robot/ip/ip6.robot
35 | Resource | resources/libraries/robot/vm/qemu.robot
36 | Resource | resources/libraries/robot/l2/tagging.robot
37 | Documentation | Performance suite keywords - utilities to find and verify NDR
41 | Get Max Rate And Jumbo
43 | | ... | Argument framesize can be either integer in case of a single packet
44 | | ... | in stream, or IMIX string defining mix of packets.
45 | | ... | For jumbo frames detection, the maximal packet size is relevant.
46 | | ... | For maximal transmit rate, the average packet size is relevant.
47 | | ... | In both cases, encapsulation overhead (if any) has effect.
48 | | ... | The maximal rate is computed from line limit bandwidth,
49 | | ... | but NICs also have an independent limit in packet rate.
50 | | ... | For some NICs, the limit is not reachable (bps limit is stricter),
51 | | ... | in those cases None is used (meaning no limiting).
53 | | ... | This keyword returns computed maximal unidirectional transmit rate
54 | | ... | and jumbo boolean (some suites need that).
56 | | ... | *Arguments:*
57 | | ... | - bps_limit - Line rate limit in bps. Type: integer
58 | | ... | - framesize - Framesize in bytes or IMIX. Type: integer or string
59 | | ... | - overhead - Overhead in bytes. Default: 0. Type: integer
60 | | ... | - pps_limit - NIC limit rate value in pps. Type: integer or None
63 | | ... | - 2-tuple, consisting of:
64 | | ... | - Calculated unidirectional maximal transmit rate.
65 | | ... | Type: integer or float
66 | | ... | - Jumbo boolean, true if jumbo packet support has to be enabled.
67 | | ... | Type: boolean
71 | | ... | \| Get Max Rate And Jumbo | \${10000000} \| IMIX_v4_1 \
72 | | ... | \| overhead=\${40} \| pps_limit=\${18750000} \|
74 | | [Arguments] | ${bps_limit} | ${framesize}
75 | | ... | ${overhead}=${0} | ${pps_limit}=${None}
77 | | ${avg_size} = | Set Variable If | '${framesize}' == 'IMIX_v4_1'
78 | | ... | ${353.83333} | ${framesize}
79 | | ${max_size} = | Set Variable If | '${framesize}' == 'IMIX_v4_1'
80 | | ... | ${1518} | ${framesize}
81 | | # swo := size_with_overhead
82 | | ${avg_swo} = | Evaluate | ${avg_size} + ${overhead}
83 | | ${max_swo} = | Evaluate | ${max_size} + ${overhead}
84 | | ${jumbo} = | Set Variable If | ${max_swo} < 1522
85 | | ... | ${False} | ${True}
86 | | # For testing None see: https://groups.google.com/\
87 | | # forum/#!topic/robotframework-users/XntFz0ocD9E
88 | | ${limit_set} = | Set Variable | ${pps_limit != None}
89 | | ${rate} = | Evaluate | (${bps_limit}/((${avg_swo}+20)*8)).__trunc__()
90 | | ${max_rate} = | Set Variable If | ${limit_set} and ${rate} > ${pps_limit}
91 | | ... | ${pps_limit} | ${rate}
92 | | Return From Keyword | ${max_rate} | ${jumbo}
94 | Get Max Rate And Jumbo And Handle Multi Seg
96 | | ... | This keyword adds correct multi seg configuration,
97 | | ... | then returns the result of Get Max Rate And Jumbo keyword.
99 | | ... | See Documentation of Get Max Rate And Jumbo for more details.
101 | | ... | *Arguments:*
102 | | ... | - bps_limit - Line rate limit in bps. Type: integer
103 | | ... | - framesize - Framesize in bytes. Type: integer or string
104 | | ... | - overhead - Overhead in bytes. Default: 0. Type: integer
105 | | ... | - pps_limit - NIC limit rate value in pps. Type: integer or None
108 | | ... | - 2-tuple, consisting of:
109 | | ... | - Calculated unidirectional maximal transmit rate.
110 | | ... | Type: integer or float
111 | | ... | - Jumbo boolean, true if jumbo packet support has to be enabled.
112 | | ... | Type: boolean
116 | | ... | \| Get Max Rate And Jumbo And Handle Multi Seg | \${10000000} \
117 | | ... | \| IMIX_v4_1 \| overhead=\${40} \| pps_limit=\${18750000} \|
119 | | [Arguments] | ${bps_limit} | ${framesize}
120 | | ... | ${overhead}=${0} | ${pps_limit}=${None}
122 | | ${max_rate} | ${jumbo} = | Get Max Rate And Jumbo
123 | | ... | ${bps_limit} | ${framesize} | ${overhead} | ${pps_limit}
124 | | Run Keyword If | not ${jumbo} | Add no multi seg to all DUTs
125 | | Return From Keyword | ${max_rate} | ${jumbo}
129 | | ... | Calculate pps for given rate and L2 frame size,
130 | | ... | additional 20B are added to L2 frame size as padding.
132 | | ... | FIXME: Migrate callers to Get Max Rate And Jumbo
134 | | ... | *Arguments*
135 | | ... | - bps - Rate in bps. Type: integer
136 | | ... | - framesize - L2 frame size in Bytes. Type: integer
139 | | ... | - Calculated pps. Type: integer
143 | | ... | \| Calculate pps \| 10000000000 \| 64 \|
145 | | [Arguments] | ${bps} | ${framesize}
147 | | ${framesize}= | Get Frame Size | ${framesize}
148 | | ${ret}= | Evaluate | (${bps}/((${framesize}+20)*8)).__trunc__()
149 | | Return From Keyword | ${ret}
153 | | ... | Framesize can be either integer in case of a single packet
154 | | ... | in stream, or set of packets in case of IMIX type or simmilar.
155 | | ... | This keyword returns average framesize.
157 | | ... | FIXME: Migrate callers to Get Max Rate And Jumbo
159 | | ... | *Arguments:*
160 | | ... | - framesize - Framesize. Type: integer or string
164 | | ... | \| Get Frame Size \| IMIX_v4_1 \|
166 | | [Arguments] | ${framesize}
168 | | Return From Keyword If | '${framesize}' == 'IMIX_v4_1' | ${353.83333}
169 | | Return From Keyword | ${framesize}
171 | Find NDR using linear search and pps
173 | | ... | Find throughput by using RFC2544 linear search with non drop rate.
175 | | ... | *Arguments:*
176 | | ... | - framesize - L2 Frame Size [B]. Type: integer
177 | | ... | - start_rate - Initial start rate [pps]. Type: float
178 | | ... | - step_rate - Step of linear search [pps]. Type: float
179 | | ... | - topology_type - Topology type. Type: string
180 | | ... | - min_rate - Lower limit of search [pps]. Type: float
181 | | ... | - max_rate - Upper limit of search [pps]. Type: float
184 | | ... | - No value returned
188 | | ... | \| Find NDR using linear search and pps \| 64 \| 5000000 \
189 | | ... | \| 100000 \| 3-node-IPv4 \| 100000 \| 14880952 \|
191 | | [Arguments] | ${framesize} | ${start_rate} | ${step_rate}
192 | | ... | ${topology_type} | ${min_rate} | ${max_rate}
194 | | ${duration}= | Set Variable | ${perf_trial_duration}
195 | | Set Duration | ${duration}
196 | | Set Search Rate Boundaries | ${max_rate} | ${min_rate}
197 | | Set Search Linear Step | ${step_rate}
198 | | Set Search Frame Size | ${framesize}
199 | | Set Search Rate Type pps
200 | | Linear Search | ${start_rate} | ${topology_type}
201 | | ${rate_per_stream} | ${lat}= | Verify Search Result
202 | | ${tmp}= | Create List | 100%NDR | ${lat}
203 | | ${latency}= | Create List | ${tmp}
204 | | ${rate_50p}= | Evaluate | int(${rate_per_stream}*0.5)
205 | | ${lat_50p}= | Measure latency pps | ${duration} | ${rate_50p}
206 | | ... | ${framesize} | ${topology_type}
207 | | ${tmp}= | Create List | 50%NDR | ${lat_50p}
208 | | Append To List | ${latency} | ${tmp}
209 | | ${rate_10p}= | Evaluate | int(${rate_per_stream}*0.1)
210 | | ${lat_10p}= | Measure latency pps | ${duration} | ${rate_10p}
211 | | ... | ${framesize} | ${topology_type}
212 | | ${tmp}= | Create List | 10%NDR | ${lat_10p}
213 | | Append To List | ${latency} | ${tmp}
214 | | Display result of NDR search | ${rate_per_stream} | ${framesize} | 2
216 | | Traffic should pass with no loss | ${duration} | ${rate_per_stream}pps
217 | | ... | ${framesize} | ${topology_type} | fail_on_loss=${False}
219 | Find PDR using linear search and pps
221 | | ... | Find throughput by using RFC2544 linear search with partial drop rate
222 | | ... | with PDR threshold and type specified by parameter.
224 | | ... | *Arguments:*
225 | | ... | - framesize - L2 Frame Size [B]. Type: integer
226 | | ... | - start_rate - Initial start rate [pps]. Type: float
227 | | ... | - step_rate - Step of linear search [pps]. Type: float
228 | | ... | - topology_type - Topology type. Type: string
229 | | ... | - min_rate - Lower limit of search [pps]. Type: float
230 | | ... | - max_rate - Upper limit of search [pps]. Type: float
231 | | ... | - loss_acceptance - Accepted loss during search. Type: float
232 | | ... | - loss_acceptance_type - Percentage or frames. Type: string
236 | | ... | \| Find PDR using linear search and pps \| 64 \| 5000000 \
237 | | ... | \| 100000 \| 3-node-IPv4 \| 100000 \| 14880952 \| 0.5 \| percentage \|
239 | | [Arguments] | ${framesize} | ${start_rate} | ${step_rate}
240 | | ... | ${topology_type} | ${min_rate} | ${max_rate}
241 | | ... | ${loss_acceptance}=0 | ${loss_acceptance_type}='frames'
243 | | ${duration}= | Set Variable | ${perf_trial_duration}
244 | | Set Duration | ${duration}
245 | | Set Search Rate Boundaries | ${max_rate} | ${min_rate}
246 | | Set Search Linear Step | ${step_rate}
247 | | Set Search Frame Size | ${framesize}
248 | | Set Search Rate Type pps
249 | | Set Loss Acceptance | ${loss_acceptance}
250 | | Run Keyword If | '${loss_acceptance_type}' == 'percentage'
251 | | ... | Set Loss Acceptance Type Percentage
252 | | Linear Search | ${start_rate} | ${topology_type}
253 | | ${rate_per_stream} | ${lat}= | Verify Search Result
254 | | ${tmp}= | Create List | 100%PDR | ${lat}
255 | | ${latency}= | Create List | ${tmp}
256 | | Display result of PDR search | ${rate_per_stream} | ${framesize} | 2
257 | | ... | ${loss_acceptance} | ${loss_acceptance_type} | ${latency}
258 | | Traffic should pass with partial loss | ${duration} | ${rate_per_stream}pps
259 | | ... | ${framesize} | ${topology_type} | ${loss_acceptance}
260 | | ... | ${loss_acceptance_type} | fail_on_loss=${False}
262 | Find NDR using binary search and pps
264 | | ... | Find throughput by using RFC2544 binary search with non drop rate.
266 | | ... | *Arguments:*
267 | | ... | - framesize - L2 Frame Size [B]. Type: integer
268 | | ... | - binary_min - Lower boundary of search [pps]. Type: float
269 | | ... | - binary_max - Upper boundary of search [pps]. Type: float
270 | | ... | - topology_type - Topology type. Type: string
271 | | ... | - min_rate - Lower limit of search [pps]. Type: float
272 | | ... | - max_rate - Upper limit of search [pps]. Type: float
273 | | ... | - threshold - Threshold to stop search [pps]. Type: integer
277 | | ... | \| Find NDR using binary search and pps \| 64 \| 6000000 \
278 | | ... | \| 12000000 \| 3-node-IPv4 \| 100000 \| 14880952 \| 50000 \|
280 | | [Arguments] | ${framesize} | ${binary_min} | ${binary_max}
281 | | ... | ${topology_type} | ${min_rate} | ${max_rate} | ${threshold}
283 | | ${duration}= | Set Variable | ${perf_trial_duration}
284 | | Set Duration | ${duration}
285 | | Set Search Rate Boundaries | ${max_rate} | ${min_rate}
286 | | Set Search Frame Size | ${framesize}
287 | | Set Search Rate Type pps
288 | | Set Binary Convergence Threshold | ${threshold}
289 | | Binary Search | ${binary_min} | ${binary_max} | ${topology_type}
290 | | ${rate_per_stream} | ${lat}= | Verify Search Result
291 | | ${tmp}= | Create List | 100%NDR | ${lat}
292 | | ${latency}= | Create List | ${tmp}
293 | | ${rate_50p}= | Evaluate | int(${rate_per_stream}*0.5)
294 | | ${lat_50p}= | Measure latency pps | ${duration} | ${rate_50p}
295 | | ... | ${framesize} | ${topology_type}
296 | | ${tmp}= | Create List | 50%NDR | ${lat_50p}
297 | | Append To List | ${latency} | ${tmp}
298 | | ${rate_10p}= | Evaluate | int(${rate_per_stream}*0.1)
299 | | ${lat_10p}= | Measure latency pps | ${duration} | ${rate_10p}
300 | | ... | ${framesize} | ${topology_type}
301 | | ${tmp}= | Create List | 10%NDR | ${lat_10p}
302 | | Append To List | ${latency} | ${tmp}
303 | | Display result of NDR search | ${rate_per_stream} | ${framesize} | 2
305 | | Traffic should pass with no loss | ${duration} | ${rate_per_stream}pps
306 | | ... | ${framesize} | ${topology_type} | fail_on_loss=${False}
308 | Find PDR using binary search and pps
310 | | ... | Find throughput by using RFC2544 binary search with partial drop rate
311 | | ... | with PDR threshold and type specified by parameter.
313 | | ... | *Arguments:*
314 | | ... | - framesize - L2 Frame Size [B]. Type: integer
315 | | ... | - binary_min - Lower boundary of search [pps]. Type: float
316 | | ... | - binary_max - Upper boundary of search [pps]. Type: float
317 | | ... | - topology_type - Topology type. Type: string
318 | | ... | - min_rate - Lower limit of search [pps]. Type: float
319 | | ... | - max_rate - Upper limit of search [pps]. Type: float
320 | | ... | - threshold - Threshold to stop search [pps]. Type: integer
321 | | ... | - loss_acceptance - Accepted loss during search. Type: float
322 | | ... | - loss_acceptance_type - Percentage or frames. Type: string
326 | | ... | \| Find PDR using binary search and pps \| 64 \| 6000000 \
327 | | ... | \| 12000000 \| 3-node-IPv4 \| 100000 \| 14880952 \| 50000 \| 0.5 \
328 | | ... | \| percentage \|
330 | | [Arguments] | ${framesize} | ${binary_min} | ${binary_max}
331 | | ... | ${topology_type} | ${min_rate} | ${max_rate} | ${threshold}
332 | | ... | ${loss_acceptance}=0 | ${loss_acceptance_type}='frames'
334 | | ${duration}= | Set Variable | ${perf_trial_duration}
335 | | Set Duration | ${duration}
336 | | Set Search Rate Boundaries | ${max_rate} | ${min_rate}
337 | | Set Search Frame Size | ${framesize}
338 | | Set Search Rate Type pps
339 | | Set Loss Acceptance | ${loss_acceptance}
340 | | Run Keyword If | '${loss_acceptance_type}' == 'percentage'
341 | | ... | Set Loss Acceptance Type Percentage
342 | | Set Binary Convergence Threshold | ${threshold}
343 | | Binary Search | ${binary_min} | ${binary_max} | ${topology_type}
344 | | ${rate_per_stream} | ${lat}= | Verify Search Result
345 | | ${tmp}= | Create List | 100%PDR | ${lat}
346 | | ${latency}= | Create List | ${tmp}
347 | | Display result of PDR search | ${rate_per_stream} | ${framesize} | 2
348 | | ... | ${loss_acceptance} | ${loss_acceptance_type} | ${latency}
349 | | Traffic should pass with partial loss | ${duration} | ${rate_per_stream}pps
350 | | ... | ${framesize} | ${topology_type} | ${loss_acceptance}
351 | | ... | ${loss_acceptance_type} | fail_on_loss=${False}
353 | Find NDR using combined search and pps
355 | | ... | Find throughput by using RFC2544 combined search (linear+binary) with
356 | | ... | non drop rate.
358 | | ... | *Arguments:*
359 | | ... | - framesize - L2 Frame Size [B]. Type: integer
360 | | ... | - start_rate - Initial start rate [pps]. Type: float
361 | | ... | - step_rate - Step of linear search [pps]. Type: float
362 | | ... | - topology_type - Topology type. Type: string
363 | | ... | - min_rate - Lower limit of search [pps]. Type: float
364 | | ... | - max_rate - Upper limit of search [pps]. Type: float
365 | | ... | - threshold - Threshold to stop search [pps]. Type: integer
369 | | ... | \| Find NDR using combined search and pps \| 64 \| 5000000 \
370 | | ... | \| 100000 \| 3-node-IPv4 \| 100000 \| 14880952 \| 5000 \|
372 | | [Arguments] | ${framesize} | ${start_rate} | ${step_rate}
373 | | ... | ${topology_type} | ${min_rate} | ${max_rate} | ${threshold}
375 | | ${duration}= | Set Variable | ${perf_trial_duration}
376 | | Set Duration | ${duration}
377 | | Set Search Rate Boundaries | ${max_rate} | ${min_rate}
378 | | Set Search Linear Step | ${step_rate}
379 | | Set Search Frame Size | ${framesize}
380 | | Set Search Rate Type pps
381 | | Set Binary Convergence Threshold | ${threshold}
382 | | Combined Search | ${start_rate} | ${topology_type}
383 | | ${rate_per_stream} | ${lat}= | Verify Search Result
384 | | ${tmp}= | Create List | 100%NDR | ${lat}
385 | | ${latency}= | Create List | ${tmp}
386 | | ${rate_50p}= | Evaluate | int(${rate_per_stream}*0.5)
387 | | ${lat_50p}= | Measure latency pps | ${duration} | ${rate_50p}
388 | | ... | ${framesize} | ${topology_type}
389 | | ${tmp}= | Create List | 50%NDR | ${lat_50p}
390 | | Append To List | ${latency} | ${tmp}
391 | | ${rate_10p}= | Evaluate | int(${rate_per_stream}*0.1)
392 | | ${lat_10p}= | Measure latency pps | ${duration} | ${rate_10p}
393 | | ... | ${framesize} | ${topology_type}
394 | | ${tmp}= | Create List | 10%NDR | ${lat_10p}
395 | | Append To List | ${latency} | ${tmp}
396 | | Display result of NDR search | ${rate_per_stream} | ${framesize} | 2
398 | | Traffic should pass with no loss | ${duration} | ${rate_per_stream}pps
399 | | ... | ${framesize} | ${topology_type}
400 | | ... | fail_on_loss=${False}
402 | Find PDR using combined search and pps
404 | | ... | Find throughput by using RFC2544 combined search (linear+binary) with
405 | | ... | partial drop rate with PDR threshold and type specified by parameter.
407 | | ... | *Arguments:*
408 | | ... | - framesize - L2 Frame Size [B]. Type: integer
409 | | ... | - start_rate - Initial start rate [pps]. Type: float
410 | | ... | - step_rate - Step of linear search [pps]. Type: float
411 | | ... | - topology_type - Topology type. Type: string
412 | | ... | - min_rate - Lower limit of search [pps]. Type: float
413 | | ... | - max_rate - Upper limit of search [pps]. Type: float
414 | | ... | - threshold - Threshold to stop search [pps]. Type: integer
415 | | ... | - loss_acceptance - Accepted loss during search. Type: float
416 | | ... | - loss_acceptance_type - Percentage or frames. Type: string
420 | | ... | \| Find PDR using combined search and pps \| 64 \| 5000000 \
421 | | ... | \| 100000 \| 3-node-IPv4 \| 100000 \| 14880952 \| 5000 \| 0.5 \
422 | | ... | \| percentage \|
424 | | [Arguments] | ${framesize} | ${start_rate} | ${step_rate}
425 | | ... | ${topology_type} | ${min_rate} | ${max_rate} | ${threshold}
426 | | ... | ${loss_acceptance}=0 | ${loss_acceptance_type}='frames'
428 | | ${duration}= | Set Variable | ${perf_trial_duration}
429 | | Set Duration | ${duration}
430 | | Set Search Rate Boundaries | ${max_rate} | ${min_rate}
431 | | Set Search Linear Step | ${step_rate}
432 | | Set Search Frame Size | ${framesize}
433 | | Set Search Rate Type pps
434 | | Set Loss Acceptance | ${loss_acceptance}
435 | | Run Keyword If | '${loss_acceptance_type}' == 'percentage'
436 | | ... | Set Loss Acceptance Type Percentage
437 | | Set Binary Convergence Threshold | ${threshold}
438 | | Combined Search | ${start_rate} | ${topology_type}
439 | | ${rate_per_stream} | ${lat}= | Verify Search Result
440 | | ${tmp}= | Create List | 100%PDR | ${lat}
441 | | ${latency}= | Create List | ${tmp}
442 | | Display result of PDR search | ${rate_per_stream} | ${framesize} | 2
443 | | ... | ${loss_acceptance} | ${loss_acceptance_type} | ${latency}
444 | | Traffic should pass with partial loss | ${duration} | ${rate_per_stream}pps
445 | | ... | ${framesize} | ${topology_type} | ${loss_acceptance}
446 | | ... | ${loss_acceptance_type} | fail_on_loss=${False}
448 | Find NDR and PDR intervals using optimized search
450 | | ... | Find boundaries for RFC2544 compatible NDR and PDR values
451 | | ... | using an optimized search algorithm.
452 | | ... | Display results as formatted test message.
453 | | ... | Fail if a resulting lower bound has too high loss fraction.
454 | | ... | Proceed with Perform additional measurements based on NDRPDR result.
455 | | ... | Input rates are understood as uni-directional,
456 | | ... | reported result contains bi-directional rates.
458 | | ... | TODO: Should the trial duration of the additional
459 | | ... | measurements be configurable?
461 | | ... | *Arguments:*
462 | | ... | - frame_size - L2 Frame Size [B] or IMIX string. Type: int or str
463 | | ... | - topology_type - Topology type. Type: string
464 | | ... | - minimum_transmit_rate - Lower limit of search [pps]. Type: float
465 | | ... | - maximum_transmit_rate - Upper limit of search [pps]. Type: float
466 | | ... | - packet_loss_ratio - Accepted loss during search. Type: float
467 | | ... | - final_relative_width - Maximal width multiple of upper. Type: float
468 | | ... | - final_trial_duration - Duration of final trials [s]. Type: float
469 | | ... | - initial_trial_duration - Duration of initial trials [s]. Type: float
470 | | ... | - intermediate phases - Number of intermediate phases [1]. Type: int
471 | | ... | - timeout - Fail if search duration is longer [s]. Type: float
472 | | ... | - doublings - How many doublings to do when expanding [1]. Type: int
476 | | ... | \| Find NDR and PDR intervals using optimized search \| \${64} \| \
477 | | ... | 3-node-IPv4 \| \${100000} \| \${14880952} \| \${0.005} \| \${0.005} \
478 | | ... | \| \${30.0} \| \${1.0} \| \${2} \| ${600.0} \| ${2} \|
480 | | [Arguments] | ${frame_size} | ${topology_type} | ${minimum_transmit_rate}
481 | | ... | ${maximum_transmit_rate} | ${packet_loss_ratio}=${0.005}
482 | | ... | ${final_relative_width}=${0.005} | ${final_trial_duration}=${30.0}
483 | | ... | ${initial_trial_duration}=${1.0}
484 | | ... | ${number_of_intermediate_phases}=${2} | ${timeout}=${720.0}
485 | | ... | ${doublings}=${2}
487 | | ${result} = | Perform optimized ndrpdr search | ${frame_size}
488 | | ... | ${topology_type} | ${minimum_transmit_rate*2}
489 | | ... | ${maximum_transmit_rate*2} | ${packet_loss_ratio}
490 | | ... | ${final_relative_width} | ${final_trial_duration}
491 | | ... | ${initial_trial_duration} | ${number_of_intermediate_phases}
492 | | ... | timeout=${timeout} | doublings=${doublings}
493 | | Display result of NDRPDR search | ${result} | ${frame_size}
494 | | Check NDRPDR interval validity | ${result.pdr_interval}
495 | | ... | ${packet_loss_ratio}
496 | | Check NDRPDR interval validity | ${result.ndr_interval}
497 | | Perform additional measurements based on NDRPDR result
498 | | ... | ${result} | ${frame_size} | ${topology_type}
500 | Display single bound
502 | | ... | Display one bound of NDR+PDR search,
503 | | ... | in packet per seconds (total and per stream)
504 | | ... | and Gbps total bandwidth with untagged packet.
505 | | ... | Througput is calculated as:
506 | | ... | Measured rate per stream * Total number of streams
507 | | ... | Bandwidth is calculated as:
508 | | ... | (Throughput * (L2 Frame Size + IPG) * 8) / Max bitrate of NIC
509 | | ... | The given result should contain latency data as well.
511 | | ... | *Arguments:*
512 | | ... | - text - Flavor text describing which bound is this. Type: string
513 | | ... | - rate_total - Total (not per stream) measured Tr [pps]. Type: float
514 | | ... | - framesize - L2 Frame Size [B]. Type: integer
515 | | ... | - latency - Latency data to display if non-empty. Type: string
519 | | ... | \| Display single bound \| NDR lower bound \| \${12345.67} \
520 | | ... | \| \${64} \| show_latency=\${EMPTY} \|
522 | | [Arguments] | ${text} | ${rate_total} | ${framesize} | ${latency}=${EMPTY}
524 | | ${bandwidth_total}= | Evaluate | ${rate_total}*(${framesize}+20)*8/(10**9)
525 | | Set Test Message | ${\n}${text}: ${rate_total} pps, | append=yes
526 | | Set Test Message | ${bandwidth_total} Gbps (untagged) | append=yes
527 | | Return From Keyword If | not """${latency}"""
528 | | Set Test Message | ${\n}LATENCY usec [min/avg/max] per stream: ${latency}
531 | Display result of NDRPDR search
533 | | ... | Display result of NDR+PDR search, both quantities, both bounds,
534 | | ... | in packet per seconds (total and per stream)
535 | | ... | and Gbps total bandwidth with untagged packet.
536 | | ... | Througput is calculated as:
537 | | ... | Measured rate per stream * Total number of streams
538 | | ... | Bandwidth is calculated as:
539 | | ... | (Throughput * (L2 Frame Size + IPG) * 8) / Max bitrate of NIC
540 | | ... | The given result should contain latency data as well.
542 | | ... | *Arguments:*
543 | | ... | - result - Measured result data per stream [pps]. Type: NdrPdrResult
544 | | ... | - framesize - L2 Frame Size [B]. Type: integer
548 | | ... | \| Display result of NDRPDR search \| \${result} \| \${64} \|
550 | | [Arguments] | ${result} | ${framesize}
552 | | ${framesize}= | Get Frame Size | ${framesize}
553 | | Display single bound | NDR_LOWER
554 | | ... | ${result.ndr_interval.measured_low.transmit_rate} | ${framesize}
555 | | ... | ${result.ndr_interval.measured_low.latency}
556 | | Display single bound | NDR_UPPER
557 | | ... | ${result.ndr_interval.measured_high.transmit_rate} | ${framesize}
558 | | Display single bound | PDR_LOWER
559 | | ... | ${result.pdr_interval.measured_low.transmit_rate} | ${framesize}
560 | | ... | ${result.pdr_interval.measured_low.latency}
561 | | Display single bound | PDR_UPPER
562 | | ... | ${result.pdr_interval.measured_high.transmit_rate} | ${framesize}
564 | Check NDRPDR interval validity
566 | | ... | Extract loss ratio of lower bound of the interval.
567 | | ... | Fail if it does not reach the allowed value.
569 | | ... | *Arguments:*
570 | | ... | - interval - Measured interval. Type: ReceiveRateInterval
571 | | ... | - packet_loss_ratio - Accepted loss (0.0 for NDR). Type: float
575 | | ... | \| Check NDRPDR interval validity \| \${result.pdr_interval} \
576 | | ... | \| \${0.005} \|
578 | | [Arguments] | ${interval} | ${packet_loss_ratio}=${0.0}
580 | | ${lower_bound} = | Set Variable | ${interval.measured_low}
581 | | ${lower_bound_lf} = | Set Variable | ${lower_bound.loss_fraction}
582 | | Return From Keyword If | ${lower_bound_lf} <= ${packet_loss_ratio}
583 | | ${message}= | Catenate | SEPARATOR=${SPACE}
584 | | ... | Minimal rate loss fraction ${lower_bound_lf}
585 | | ... | does not reach target ${packet_loss_ratio}.
586 | | ${message_zero} = | Set Variable | Zero packets forwarded!
587 | | ${message_other} = | Set Variable | ${lower_bound.loss_count} packets lost.
588 | | ${message} = | Set Variable If | ${lower_bound_lf} >= 1.0
589 | | ... | ${message}${\n}${message_zero} | ${message}${\n}${message_other}
590 | | Fail | ${message}
592 | Perform additional measurements based on NDRPDR result
594 | | ... | Perform any additional measurements which are not directly needed
595 | | ... | for determining NDR nor PDR, but which are needed for gathering
596 | | ... | additional data for debug purposes.
597 | | ... | Currently, just "Traffic should pass with no loss" is called.
598 | | ... | TODO: Move latency measurements from optimized search here.
600 | | ... | *Arguments:*
601 | | ... | - result - Measured result data per stream [pps]. Type: NdrPdrResult
602 | | ... | - frame_size - L2 Frame Size [B] or IMIX string. Type: int or str
603 | | ... | - topology_type - Topology type. Type: string
606 | | ... | \| Perform additional measurements based on NDRPDR result \
607 | | ... | \| \${result} \| ${64} \| 3-node-IPv4 \|
609 | | [Arguments] | ${result} | ${framesize} | ${topology_type}
611 | | ${duration}= | Set Variable | 5.0
612 | | ${rate_per_stream}= | Evaluate
613 | | ... | ${result.ndr_interval.measured_low.target_tr} / 2.0
614 | | Traffic should pass with no loss | ${duration} | ${rate_per_stream}pps
615 | | ... | ${framesize} | ${topology_type} | fail_on_loss=${False}
617 | Display result of NDR search
619 | | ... | Display result of NDR search in packet per seconds (total and per
620 | | ... | stream) and Gbps total bandwidth with untagged packet.
621 | | ... | Througput is calculated as:
622 | | ... | Measured rate per stream * Total number of streams
623 | | ... | Bandwidth is calculated as:
624 | | ... | (Throughput * (L2 Frame Size + IPG) * 8) / Max bitrate of NIC
626 | | ... | *Arguments:*
627 | | ... | - rate_per_stream - Measured rate per stream [pps]. Type: string
628 | | ... | - framesize - L2 Frame Size [B]. Type: integer
629 | | ... | - nr_streams - Total number of streams. Type: integer
630 | | ... | - latency - Latency stats. Type: dictionary
634 | | ... | \| Display result of NDR search \| 4400000 \| 64 \| 2 \
635 | | ... | \| [100%NDR, [10/10/10, 1/2/3]] \|
637 | | [Arguments] | ${rate_per_stream} | ${framesize} | ${nr_streams} | ${latency}
639 | | ${framesize}= | Get Frame Size | ${framesize}
640 | | ${rate_total}= | Evaluate | ${rate_per_stream}*${nr_streams}
641 | | ${bandwidth_total}= | Evaluate | ${rate_total}*(${framesize}+20)*8/(10**9)
642 | | Set Test Message | FINAL_RATE: ${rate_total} pps
643 | | Set Test Message | (${nr_streams}x ${rate_per_stream} pps) | append=yes
644 | | Set Test Message | ${\n}FINAL_BANDWIDTH: ${bandwidth_total} Gbps (untagged)
646 | | Set Test Message | ${\n}LATENCY usec [min/avg/max] | append=yes
647 | | :FOR | ${lat} | IN | @{latency}
648 | | | Set Test Message | ${\n}LAT_${lat[0]}: ${lat[1]} | append=yes
650 | Display result of PDR search
652 | | ... | Display result of PDR search in packet per seconds (total and per
653 | | ... | stream) and Gbps total bandwidth with untagged packet.
654 | | ... | Througput is calculated as:
655 | | ... | Measured rate per stream * Total number of streams
656 | | ... | Bandwidth is calculated as:
657 | | ... | (Throughput * (L2 Frame Size + IPG) * 8) / Max bitrate of NIC
659 | | ... | *Arguments:*
660 | | ... | - rate_per_stream - Measured rate per stream [pps]. Type: string
661 | | ... | - framesize - L2 Frame Size [B]. Type: integer
662 | | ... | - nr_streams - Total number of streams. Type: integer
663 | | ... | - loss_acceptance - Accepted loss during search. Type: float
664 | | ... | - loss_acceptance_type - Percentage or frames. Type: string
665 | | ... | - latency - Latency stats. Type: dictionary
669 | | ... | \| Display result of PDR search \| 4400000 \| 64 \| 2 \| 0.5 \
670 | | ... | \| percentage \| [100%NDR, [10/10/10, 1/2/3]] \|
672 | | [Arguments] | ${rate_per_stream} | ${framesize} | ${nr_streams}
673 | | ... | ${loss_acceptance} | ${loss_acceptance_type} | ${latency}
675 | | ${framesize}= | Get Frame Size | ${framesize}
676 | | ${rate_total}= | Evaluate | ${rate_per_stream}*${nr_streams}
677 | | ${bandwidth_total}= | Evaluate | ${rate_total}*(${framesize}+20)*8/(10**9)
678 | | Set Test Message | FINAL_RATE: ${rate_total} pps
679 | | Set Test Message | (${nr_streams}x ${rate_per_stream} pps) | append=yes
680 | | Set Test Message | ${\n}FINAL_BANDWIDTH: ${bandwidth_total} Gbps (untagged)
682 | | Set Test Message | ${\n}LATENCY usec [min/avg/max] | append=yes
683 | | :FOR | ${lat} | IN | @{latency}
684 | | | Set Test Message | ${\n}LAT_${lat[0]}: ${lat[1]} | append=yes
686 | | ... | ${\n}LOSS_ACCEPTANCE: ${loss_acceptance} ${loss_acceptance_type}
689 | Measure latency pps
691 | | ... | Send traffic at specified rate. Measure min/avg/max latency
693 | | ... | *Arguments:*
694 | | ... | - duration - Duration of traffic run [s]. Type: integer
695 | | ... | - rate - Rate for sending packets. Type: integer
696 | | ... | - framesize - L2 Frame Size [B] or IMIX_v4_1. Type: integer/string
697 | | ... | - topology_type - Topology type. Type: string
701 | | ... | \| Measure latency \| 10 \| 4.0 \| 64 \| 3-node-IPv4 \|
703 | | [Arguments] | ${duration} | ${rate} | ${framesize} | ${topology_type}
705 | | Return From Keyword If | ${rate} <= 10000 | ${-1}
706 | | Send traffic on tg | ${duration} | ${rate}pps | ${framesize}
707 | | ... | ${topology_type} | warmup_time=0
708 | | Run keyword and return | Get latency
710 | Traffic should pass with no loss
712 | | ... | Send traffic at specified rate. No packet loss is accepted at loss
713 | | ... | evaluation.
715 | | ... | *Arguments:*
716 | | ... | - duration - Duration of traffic run [s]. Type: integer
717 | | ... | - rate - Rate for sending packets. Type: string
718 | | ... | - framesize - L2 Frame Size [B] or IMIX_v4_1. Type: integer/string
719 | | ... | - topology_type - Topology type. Type: string
720 | | ... | - fail_on_loss - If True, the keyword fails if loss occurred.
721 | | ... | Type: boolean
725 | | ... | \| Traffic should pass with no loss \| 10 \| 4.0mpps \| 64 \
726 | | ... | \| 3-node-IPv4 \|
728 | | [Arguments] | ${duration} | ${rate} | ${framesize} | ${topology_type}
729 | | ... | ${fail_on_loss}=${True}
731 | | Send traffic at specified rate | ${duration} | ${rate} | ${framesize}
732 | | ... | ${topology_type}
733 | | Run Keyword If | ${fail_on_loss} | No traffic loss occurred
735 | Traffic should pass with partial loss
737 | | ... | Send traffic at specified rate. Partial packet loss is accepted
738 | | ... | within loss acceptance value specified as argument.
740 | | ... | *Arguments:*
741 | | ... | - duration - Duration of traffic run [s]. Type: integer
742 | | ... | - rate - Rate for sending packets. Type: string
743 | | ... | - framesize - L2 Frame Size [B] or IMIX_v4_1. Type: integer/string
744 | | ... | - topology_type - Topology type. Type: string
745 | | ... | - loss_acceptance - Accepted loss during search. Type: float
746 | | ... | - loss_acceptance_type - Percentage or frames. Type: string
750 | | ... | \| Traffic should pass with partial loss \| 10 \| 4.0mpps \| 64 \
751 | | ... | \| 3-node-IPv4 \| 0.5 \| percentage \|
753 | | [Arguments] | ${duration} | ${rate} | ${framesize} | ${topology_type}
754 | | ... | ${loss_acceptance} | ${loss_acceptance_type}
755 | | ... | ${fail_on_loss}=${True}
757 | | Send traffic at specified rate | ${duration} | ${rate} | ${framesize}
758 | | ... | ${topology_type}
759 | | Run Keyword If | ${fail_on_loss} | Partial traffic loss accepted
760 | | ... | ${loss_acceptance} | ${loss_acceptance_type}
762 | Traffic should pass with maximum rate
764 | | ... | Send traffic at maximum rate.
766 | | ... | *Arguments:*
767 | | ... | - rate - Rate for sending packets. Type: string
768 | | ... | - framesize - L2 Frame Size [B] or IMIX_v4_1. Type: integer/string
769 | | ... | - topology_type - Topology type. Type: string
770 | | ... | - subsamples - How many trials in this measurement. Type:int
771 | | ... | - trial_duration - Duration of single trial [s]. Type: float
772 | | ... | - fail_no_traffic - Whether to fail on zero receive count. Type: boolean
776 | | ... | \| Traffic should pass with maximum rate \| 4.0mpps \| 64 \
777 | | ... | \| 3-node-IPv4 \| ${1} \| ${10.0} | ${False} \|
779 | | [Arguments] | ${rate} | ${framesize} | ${topology_type}
780 | | ... | ${trial_duration}=${perf_trial_duration} | ${fail_no_traffic}=${True}
781 | | ... | ${subsamples}=${perf_trial_multiplicity}
783 | | ${results} = | Send traffic at specified rate | ${trial_duration} | ${rate}
784 | | ... | ${framesize} | ${topology_type} | ${subsamples}
785 | | Set Test Message | ${\n}Maximum Receive Rate trial results
786 | | Set Test Message | in packets per second: ${results}
788 | | # TODO: Should we also report the percentage relative to transmit rate,
789 | | # so that people looking at console can decide how close to 100% it is?
790 | | Run Keyword If | ${fail_no_traffic} | Fail if no traffic forwarded
792 | Send traffic at specified rate
794 | | ... | Send traffic at specified rate.
795 | | ... | Return list of measured receive rates.
797 | | ... | *Arguments:*
798 | | ... | - trial_duration - Duration of single trial [s]. Type: float
799 | | ... | - rate - Rate for sending packets. Type: string
800 | | ... | - framesize - L2 Frame Size [B]. Type: integer/string
801 | | ... | - topology_type - Topology type. Type: string
802 | | ... | - subsamples - How many trials in this measurement. Type: int
806 | | ... | \| Send traffic at specified rate \| ${1.0} \| 4.0mpps \| 64 \
807 | | ... | \| 3-node-IPv4 \| ${10} \|
809 | | [Arguments] | ${trial_duration} | ${rate} | ${framesize}
810 | | ... | ${topology_type} | ${subsamples}=${1}
812 | | Clear and show runtime counters with running traffic | ${trial_duration}
813 | | ... | ${rate} | ${framesize} | ${topology_type}
814 | | Run Keyword If | ${dut_stats}==${True} | Clear all counters on all DUTs
815 | | Run Keyword If | ${dut_stats}==${True} and ${pkt_trace}==${True}
816 | | ... | VPP Enable Traces On All DUTs | ${nodes}
817 | | Run Keyword If | ${dut_stats}==${True}
818 | | ... | VPP enable elog traces on all DUTs | ${nodes}
819 | | ${results} = | Create List
820 | | :FOR | ${i} | IN RANGE | ${subsamples}
821 | | | Send traffic on tg | ${trial_duration} | ${rate} | ${framesize}
822 | | | ... | ${topology_type} | warmup_time=0
823 | | | ${rx} = | Get Received
824 | | | ${rr} = | Evaluate | ${rx} / ${trial_duration}
825 | | | Append To List | ${results} | ${rr}
826 | | Run Keyword If | ${dut_stats}==${True} | Show event logger on all DUTs
828 | | Run Keyword If | ${dut_stats}==${True} | Show statistics on all DUTs
830 | | Run Keyword If | ${dut_stats}==${True} and ${pkt_trace}==${True}
831 | | ... | Show Packet Trace On All Duts | ${nodes} | maximum=${100}
832 | | Return From Keyword | ${results}
834 | Clear and show runtime counters with running traffic
836 | | ... | Start traffic at specified rate then clear runtime counters on all
837 | | ... | DUTs. Wait for specified amount of time and capture runtime counters
838 | | ... | on all DUTs. Finally stop traffic
840 | | ... | *Arguments:*
841 | | ... | - duration - Duration of traffic run [s]. Type: integer
842 | | ... | - rate - Rate for sending packets. Type: string
843 | | ... | - framesize - L2 Frame Size [B] or IMIX_v4_1. Type: integer/string
844 | | ... | - topology_type - Topology type. Type: string
848 | | ... | \| Traffic should pass with partial loss \| 10 \| 4.0mpps \| 64 \
849 | | ... | \| 3-node-IPv4 \| 0.5 \| percentage \|
851 | | [Arguments] | ${duration} | ${rate} | ${framesize} | ${topology_type}
853 | | Send traffic on tg | -1 | ${rate} | ${framesize} | ${topology_type}
854 | | ... | warmup_time=0 | async_call=${True} | latency=${False}
855 | | Run Keyword If | ${dut_stats}==${True}
856 | | ... | Clear runtime counters on all DUTs | ${nodes}
857 | | Sleep | ${duration}
858 | | Run Keyword If | ${dut_stats}==${True}
859 | | ... | Show runtime counters on all DUTs | ${nodes}
860 | | Stop traffic on tg