aboutsummaryrefslogtreecommitdiffstats
path: root/tools/pkt_gen/trafficgen
diff options
context:
space:
mode:
authorMartin Klozik <martinx.klozik@intel.com>2016-03-07 09:52:22 +0000
committerMaryam Tahhan <maryam.tahhan@intel.com>2016-03-11 10:31:19 +0000
commita81278b11de6393390816c8b3b675a313cd0ce9f (patch)
treea0a741f36a10f9373e49e1c25b51c467633143b0 /tools/pkt_gen/trafficgen
parentf7366919b9d985b2b3d267750ea16667b636cdac (diff)
bugfix: Cleanup of traffic gen api and default traffic values
Both documentation and traffic generator API are updated to match current code logic. Additional default values are added into TRAFFIC_DEFAULTS dictionary. Constructor of TestCase class uses default values from TRAFFIC_DEFAULTS instead of magic numbers. Change-Id: Id2f4983945e4b123adddbc9a2a832f4a735b27f6 JIRA: VSPERF-253 Signed-off-by: Martin Klozik <martinx.klozik@intel.com> Reviewed-by: Maryam Tahhan <maryam.tahhan@intel.com> Reviewed-by: Al Morton <acmorton@att.com> Reviewed-by: Christian Trautman <ctrautma@redhat.com>
Diffstat (limited to 'tools/pkt_gen/trafficgen')
-rwxr-xr-xtools/pkt_gen/trafficgen/trafficgen.py23
-rw-r--r--tools/pkt_gen/trafficgen/trafficgenhelper.py10
2 files changed, 16 insertions, 17 deletions
diff --git a/tools/pkt_gen/trafficgen/trafficgen.py b/tools/pkt_gen/trafficgen/trafficgen.py
index 134db6b8..3953bbb1 100755
--- a/tools/pkt_gen/trafficgen/trafficgen.py
+++ b/tools/pkt_gen/trafficgen/trafficgen.py
@@ -1,4 +1,4 @@
-# Copyright 2015 Intel Corporation.
+# Copyright 2015-2016 Intel Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -86,7 +86,7 @@ class ITrafficGenerator(object):
configuration, for ``duration`` seconds.
Attributes:
- :param traffic: Detailed "traffic" spec, i.e. IP address, VLAN tags
+ :param traffic: Detailed "traffic" spec, see design docs for details
:param numpkts: Number of packets to send
:param duration: Time to wait to receive packets
@@ -99,17 +99,14 @@ class ITrafficGenerator(object):
"""
raise NotImplementedError('Please call an implementation.')
- def send_cont_traffic(self, traffic=None, duration=20, multistream=False):
+ def send_cont_traffic(self, traffic=None, duration=20):
"""Send a continuous flow of traffic.
Send packets at given framerate, using ``traffic`` configuration,
for ``duration`` seconds..
- :param traffic: Detailed "traffic" spec, i.e. IP address, VLAN tags
- from 1 to 64,000
+ :param traffic: Detailed "traffic" spec, see design docs for details
:param duration: Duration to transmit traffic.
- :param multistream: Enable multistream output by overriding the
- from 1 to 64,000
:returns: dictionary of strings with following data:
- Tx Throughput (fps),
- Rx Throughput (fps),
@@ -137,20 +134,17 @@ class ITrafficGenerator(object):
raise NotImplementedError('Please call an implementation.')
def send_rfc2544_throughput(self, traffic=None, trials=3, duration=20,
- lossrate=0.0, multistream=False):
+ lossrate=0.0):
"""Send traffic per RFC2544 throughput test specifications.
Send packets at a variable rate, using ``traffic``
configuration, until minimum rate at which no packet loss is
detected is found.
- :param traffic: Detailed "traffic" spec, i.e. IP address, VLAN tags
+ :param traffic: Detailed "traffic" spec, see design docs for details
:param trials: Number of trials to execute
:param duration: Per iteration duration
:param lossrate: Acceptable lossrate percentage
- :param multistream: Enable multistream output by overriding the
- UDP port number in ``traffic`` with values
- from 1 to 64,000
:returns: dictionary of strings with following data:
- Tx Throughput (fps),
- Rx Throughput (fps),
@@ -185,13 +179,10 @@ class ITrafficGenerator(object):
Send packets at a fixed rate, using ``traffic``
configuration, for duration seconds.
- :param traffic: Detailed "traffic" spec, i.e. IP address, VLAN
- tags
+ :param traffic: Detailed "traffic" spec, see design docs for details
:param trials: Number of trials to execute
:param duration: Per iteration duration
:param lossrate: Acceptable loss percentage
- :param multistream: Enable multistream output by overriding the
- UDP port number in ``traffic`` with values from 1 to 64,000
:returns: Named tuple of Rx Throughput (fps), Rx Throughput (mbps),
Tx Rate (% linerate), Rx Rate (% linerate), Tx Count (frames),
diff --git a/tools/pkt_gen/trafficgen/trafficgenhelper.py b/tools/pkt_gen/trafficgen/trafficgenhelper.py
index 97cf6377..0a240579 100644
--- a/tools/pkt_gen/trafficgen/trafficgenhelper.py
+++ b/tools/pkt_gen/trafficgen/trafficgenhelper.py
@@ -1,4 +1,4 @@
-# Copyright 2015 Intel Corporation.
+# Copyright 2015-2016 Intel Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -21,6 +21,14 @@ from collections import namedtuple
CMD_PREFIX = 'gencmd : '
TRAFFIC_DEFAULTS = {
+ 'traffic_type' : 'rfc2544',
+ 'frame_rate' : 100,
+ 'bidir' : False,
+ 'multistream' : 0,
+ 'stream_type' : 'L4',
+ 'pre_installed_flows' : 'No', # used by vswitch implementation
+ 'flow_type' : 'port', # used by vswitch implementation
+
'l2': {
'framesize': 64,
'srcmac': '00:00:00:00:00:00',