1 # Copyright 2015-2018 Intel Corporation., Tieto
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
7 # http://www.apache.org/licenses/LICENSE-2.0
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
15 # ############################
16 # Traffic gen configuration
17 # ############################
19 # log file for all traffic generator related commands
20 LOG_FILE_TRAFFIC_GEN = 'traffic-gen.log'
22 # TRAFFIC dictionary defines traffic parameters used by all traffic generators.
23 # Detailed description of TRAFFIC dictionary items follows:
25 # 'traffic_type' - One of the supported traffic types.
26 # E.g. rfc2544_throughput, rfc2544_back2back,
27 # rfc2544_continuous or burst
29 # Default value: "rfc2544_throughput".
30 # 'bidir' - Specifies if generated traffic will be full-duplex (True)
31 # or half-duplex (False)
33 # Supported values: "True", "False"
34 # Default value: "False".
35 # 'frame_rate' - Defines desired percentage of frame rate used during
36 # continuous stream tests.
39 # 'burst_size' - Defines a number of frames in the single burst, which is sent
40 # by burst traffic type. Burst size is applied for each direction,
41 # i.e. the total number of tx frames will be 2*burst_size in case of
42 # bidirectional traffic.
45 # 'multistream' - Defines number of flows simulated by traffic generator.
46 # Value 0 disables multistream feature
48 # Supported values: 0-65536 for 'L4' stream type
49 # unlimited for 'L2' and 'L3' stream types
51 # 'stream_type' - Stream type is an extension of the "multistream" feature.
52 # If multistream is disabled, then stream type will be
53 # ignored. Stream type defines ISO OSI network layer used
54 # for simulation of multiple streams.
57 # "L2" - iteration of destination MAC address
58 # "L3" - iteration of destination IP address
59 # "L4" - iteration of destination port
60 # of selected transport protocol
61 # Default value: "L4".
62 # 'pre_installed_flows'
63 # - Pre-installed flows is an extension of the "multistream"
64 # feature. If enabled, it will implicitly insert a flow
65 # for each stream. If multistream is disabled, then
66 # pre-installed flows will be ignored.
69 # "Yes" - flows will be inserted into OVS
70 # "No" - flows won't be inserted into OVS
71 # Default value: "No".
72 # 'flow_type' - Defines flows complexity.
75 # "port" - flow is defined by ingress ports
76 # "IP" - flow is defined by ingress ports
77 # and src and dst IP addresses
78 # Default value: "port"
79 # 'flow_control' - Controls flow control support by traffic generator.
81 # False - flow control is disabled
82 # True - flow control is enabled
83 # Default value: False
84 # Note: Currently it is supported by IxNet only
85 # 'learning_frames' - Controls learning frames support by traffic generator.
87 # False - learning freames are disabled
88 # True - learning freames are enabled
90 # Note: Currently it is supported by IxNet only
91 # 'l2' - A dictionary with l2 network layer details. Supported
93 # 'srcmac' - Specifies source MAC address filled by traffic generator.
94 # NOTE: It can be modified by vsperf in some scenarios.
96 # Default value: "00:00:00:00:00:00".
97 # 'dstmac' - Specifies destination MAC address filled by traffic generator.
98 # NOTE: It can be modified by vsperf in some scenarios.
100 # Default value: "00:00:00:00:00:00".
101 # 'framesize' - Specifies default frame size. This value should not be
102 # changed directly. It will be overridden during testcase
103 # execution by values specified by list TRAFFICGEN_PKT_SIZES.
106 # 'l3' - A dictionary with l3 network layer details. Supported
108 # 'enabled' - Specifies if l3 layer should be enabled or disabled.
110 # Default value: True
111 # NOTE: Supported only by IxNet trafficgen class
112 # 'srcip' - Specifies source MAC address filled by traffic generator.
113 # NOTE: It can be modified by vsperf in some scenarios.
115 # Default value: "1.1.1.1".
116 # 'dstip' - Specifies destination MAC address filled by traffic generator.
117 # NOTE: It can be modified by vsperf in some scenarios.
119 # Default value: "90.90.90.90".
120 # 'proto' - Specifies protocol type.
121 # Please check particular traffic generator implementation
122 # for supported protocol types.
124 # Default value: "udp".
125 # 'l4' - A dictionary with l4 network layer details. Supported
127 # 'enabled' - Specifies if l4 layer should be enabled or disabled.
129 # Default value: True
130 # NOTE: Supported only by IxNet trafficgen class
131 # 'srcport' - Specifies source port of selected transport protocol.
132 # NOTE: It can be modified by vsperf in some scenarios.
134 # Default value: 3000
135 # 'dstport' - Specifies destination port of selected transport protocol.
136 # NOTE: It can be modified by vsperf in some scenarios.
138 # Default value: 3001
139 # 'vlan' - A dictionary with vlan encapsulation details. Supported
141 # 'enabled' - Specifies if vlan encapsulation should be enabled or
144 # Default value: False
145 # 'id' - Specifies vlan id.
146 # Data type: int (NOTE: must fit to 12 bits)
148 # 'priority' - Specifies a vlan priority (PCP header field).
149 # Data type: int (NOTE: must fit to 3 bits)
151 # 'cfi' - Specifies if frames can or cannot be dropped during
152 # congestion (DEI header field).
153 # Data type: int (NOTE: must fit to 1 bit)
155 # 'capture' - A dictionary with traffic capture configuration.
156 # NOTE: It is supported only by T-Rex traffic generator.
157 # 'enabled' - Specifies if traffic should be captured
159 # Default value: False
160 # 'tx_ports' - A list of ports, where frames transmitted towards DUT will
161 # be captured. Ports have numbers 0 and 1. TX packet capture
162 # is disabled if list of ports is empty.
165 # 'rx_ports' - A list of ports, where frames received from DUT will
166 # be captured. Ports have numbers 0 and 1. RX packet capture
167 # is disabled if list of ports is empty.
170 # 'count' - A number of frames to be captured. The same count value
171 # is applied to both TX and RX captures.
174 # 'filter' - An expression used to filter TX and RX packets. It uses the same
175 # syntax as pcap library. See pcap-filter man page for additional
179 # 'scapy' - A dictionary with definition of a frame content for both traffic
180 # directions. The frame content is defined by a SCAPY notation.
181 # NOTE: It is supported only by the T-Rex traffic generator.
182 # Following keywords can be used to refer to the related parts of
183 # the TRAFFIC dictionary:
184 # Ether_src - refers to TRAFFIC['l2']['srcmac']
185 # Ether_dst - refers to TRAFFIC['l2']['dstmac']
186 # IP_proto - refers to TRAFFIC['l3']['proto']
187 # IP_PROTO - refers to upper case version of TRAFFIC['l3']['proto']
188 # IP_src - refers to TRAFFIC['l3']['srcip']
189 # IP_dst - refers to TRAFFIC['l3']['dstip']
190 # IP_PROTO_sport - refers to TRAFFIC['l4']['srcport']
191 # IP_PROTO_dport - refers to TRAFFIC['l4']['dstport']
192 # Dot1Q_prio - refers to TRAFFIC['vlan']['priority']
193 # Dot1Q_id - refers to TRAFFIC['vlan']['cfi']
194 # Dot1Q_vlan - refers to TRAFFIC['vlan']['id']
195 # '0' - A string with the frame definition for the 1st direction.
197 # Default value: 'Ether(src={Ether_src}, dst={Ether_dst})/'
198 # 'Dot1Q(prio={Dot1Q_prio}, id={Dot1Q_id}, vlan={Dot1Q_vlan})/'
199 # 'IP(proto={IP_proto}, src={IP_src}, dst={IP_dst})/'
200 # '{IP_PROTO}(sport={IP_PROTO_sport}, dport={IP_PROTO_dport})'
201 # '1' - A string with the frame definition for the 2nd direction.
203 # Default value: 'Ether(src={Ether_dst}, dst={Ether_src})/'
204 # 'Dot1Q(prio={Dot1Q_prio}, id={Dot1Q_id}, vlan={Dot1Q_vlan})/'
205 # 'IP(proto={IP_proto}, src={IP_dst}, dst={IP_src})/'
206 # '{IP_PROTO}(sport={IP_PROTO_dport}, dport={IP_PROTO_sport})',
207 # 'latency_histogram'
208 # - A dictionary with definition of a latency histogram provision in results.
209 # 'enabled' - Specifies if the histogram provisioning is enabled or not.
210 # 'type' - Defines how histogram is provided. Currenty only 'Default' is defined.
211 # 'Default' - Default histogram as provided by the Traffic-generator.
213 'traffic_type' : 'rfc2544_throughput',
216 'bidir' : 'True', # will be passed as string in title format to tgen
218 'stream_type' : 'L4',
219 'pre_installed_flows' : 'No', # used by vswitch implementation
220 'flow_type' : 'port', # used by vswitch implementation
221 'flow_control' : False, # supported only by IxNet
222 'learning_frames' : True, # supported only by IxNet
225 'srcmac': '00:00:00:00:00:00',
226 'dstmac': '00:00:00:00:00:00',
232 'dstip': '90.90.90.90',
254 '0' : 'Ether(src={Ether_src}, dst={Ether_dst})/'
255 'Dot1Q(prio={Dot1Q_prio}, id={Dot1Q_id}, vlan={Dot1Q_vlan})/'
256 'IP(proto={IP_proto}, src={IP_src}, dst={IP_dst})/'
257 '{IP_PROTO}(sport={IP_PROTO_sport}, dport={IP_PROTO_dport})',
258 '1' : 'Ether(src={Ether_dst}, dst={Ether_src})/'
259 'Dot1Q(prio={Dot1Q_prio}, id={Dot1Q_id}, vlan={Dot1Q_vlan})/'
260 'IP(proto={IP_proto}, src={IP_dst}, dst={IP_src})/'
261 '{IP_PROTO}(sport={IP_PROTO_dport}, dport={IP_PROTO_sport})',
263 'latency_histogram': {
269 #path to traffic generators directory.
270 TRAFFICGEN_DIR = os.path.join(ROOT_DIR, 'tools/pkt_gen')
272 # traffic generator to use in tests
273 #TRAFFICGEN = 'TestCenter'
275 #TRAFFICGEN = 'IxNet'
278 #TRAFFICGEN = 'Moongen'
281 # List of packet sizes to send.
282 # Expand like this: (64, 128, 256, 512, 1024)
283 TRAFFICGEN_PKT_SIZES = (64,)
285 TRAFFICGEN_DURATION = 30
287 TRAFFICGEN_RFC2544_TESTS = 1
288 TRAFFICGEN_RFC2889_TRIALS = 1
289 TRAFFICGEN_LOSSRATE = 0.0
291 ##############################
292 # DUMMY Configuration -- BEGIN
294 # By default, dummy traffic generator asks for "measured" values.
295 # Following dictionary allows to preconfigure these values and
296 # to avoid user interaction. It can be useful for automated
298 # Example of values for continuous traffic type:
299 # TRAFFICGEN_DUMMY_RESULTS{'frames rx': 500000,
300 # 'frames tx': 500000,
306 # 'avg latency': 2.5,
309 TRAFFICGEN_DUMMY_RESULTS = {}
311 # DUMMY Configuration -- END
312 ############################
314 #############################
315 # IXIA Configuration -- BEGIN
317 # path to 'ixos' install path
318 TRAFFICGEN_IXIA_ROOT_DIR = '/opt/ixos'
320 # network address of IXIA chassis
321 TRAFFICGEN_IXIA_HOST = ''
323 TRAFFICGEN_IXIA_CARD = ''
325 TRAFFICGEN_IXIA_PORT1 = ''
327 TRAFFICGEN_IXIA_PORT2 = ''
329 TRAFFICGEN_IXNET_LIB_PATH = '/opt/ixnetwork/lib/IxTclNetwork'
331 # IxNetwork host IP address
332 TRAFFICGEN_IXNET_MACHINE = ''
333 TRAFFICGEN_IXNET_PORT = ''
334 TRAFFICGEN_IXNET_USER = ''
335 TRAFFICGEN_IXNET_CHASSIS = ''
337 # The result directory on $TRAFFICGEN_IXNET_MACHINE
338 TRAFFICGEN_IXNET_TESTER_RESULT_DIR = ''
340 # The result directory on DUT. This needs to map to the same directory
341 # as the previous one
342 TRAFFICGEN_IXNET_DUT_RESULT_DIR = ''
344 # directory with 3rd party scripts generated by IXIA tools
345 TRAFFICGEN_IXIA_3RD_PARTY = os.path.join(ROOT_DIR, '3rd_party/ixia')
347 # default TCL script, which will be used for IXNETWORK configuration
348 TRAFFICGEN_IXNET_TCL_SCRIPT = 'ixnetrfc2544.tcl'
350 # IXIA Configuration -- END
351 ###########################
354 ###########################################
355 # Spirent TestCenter Configuration -- BEGIN
357 # Path to Python 2 executable
358 TRAFFICGEN_STC_PYTHON2_PATH = "/bin/python2.7"
360 # Path to the location of the TestCenter files
361 TRAFFICGEN_STC_TESTCENTER_PATH = os.path.join(ROOT_DIR, 'tools/pkt_gen/testcenter')
363 # Name of the TestCenter RFC2544 Tput helper python script
364 TRAFFICGEN_STC_RFC2544_TPUT_TEST_FILE_NAME = "testcenter-rfc2544-throughput.py"
366 # Name of the Testcenter RFC2899 Tput Helper Python Scripts
367 TRAFFICGEN_STC_RFC2889_TEST_FILE_NAME = "testcenter-rfc2889-rest.py"
369 # 2889 Port Locations
370 TRAFFICGEN_STC_RFC2889_LOCATION = ""
372 # The address of the Spirent Lab Server to use
373 TRAFFICGEN_STC_LAB_SERVER_ADDR = ""
375 # The address of the Spirent License Server in your environment
376 TRAFFICGEN_STC_LICENSE_SERVER_ADDR = ""
378 # The address of the TestCenter chassis that holds the east port
379 TRAFFICGEN_STC_EAST_CHASSIS_ADDR = ""
381 # The slot number of the card that holds the east port
382 TRAFFICGEN_STC_EAST_SLOT_NUM = ""
384 # The port number on the card that holds the east port
385 TRAFFICGEN_STC_EAST_PORT_NUM = ""
387 # The address of the TestCenter chassis that holds the west port
388 TRAFFICGEN_STC_WEST_CHASSIS_ADDR = ""
390 # The slot number of the card that holds the west port
391 TRAFFICGEN_STC_WEST_SLOT_NUM = ""
393 # The port number on the card that holds the west port
394 TRAFFICGEN_STC_WEST_PORT_NUM = ""
396 # The friendly name to identify the Spirent Lab Server test session
397 TRAFFICGEN_STC_TEST_SESSION_NAME = "RFC2544 Tput"
398 # The directory to copy results to
400 TRAFFICGEN_STC_RESULTS_DIR = os.path.join(ROOT_DIR, "Results")
401 # The prefix for the CSV results file
403 TRAFFICGEN_STC_CSV_RESULTS_FILE_PREFIX = "RFC2544_tput"
404 # The number of trials to execute during the test
406 TRAFFICGEN_STC_NUMBER_OF_TRIALS = "1"
408 # The duration of each trial executed during the test, in seconds
409 TRAFFICGEN_STC_TRIAL_DURATION_SEC = "60"
411 # The traffic pattern between endpoints, BACKBONE, MESH or PAIR
412 TRAFFICGEN_STC_TRAFFIC_PATTERN = "PAIR"
414 # The search mode used to find the throughput rate, COMBO, STEP or BINARY
415 TRAFFICGEN_STC_SEARCH_MODE = "BINARY"
417 # The learning mode used during the test, AUTO, L2_LEARNING, L3_LERNING, or NONE
418 TRAFFICGEN_STC_LEARNING_MODE = "AUTO"
420 # The minimum percent line rate that will be used during the test
421 TRAFFICGEN_STC_RATE_LOWER_LIMIT_PCT = "1.0"
423 # The maximum percent line rate that will be used during the test
424 TRAFFICGEN_STC_RATE_UPPER_LIMIT_PCT = "99.0"
426 # If SearchMode is BINARY, the percent line rate that will be used at the start of the test
427 TRAFFICGEN_STC_RATE_INITIAL_PCT = "99.0"
429 # When SearchMode is STEP, the percent increase in load per step
430 TRAFFICGEN_STC_RATE_STEP_PCT = "10.0"
432 # The minimum percentage of load adjustment between iterations
433 TRAFFICGEN_STC_RESOLUTION_PCT = "1.0"
435 # The frame size, in bytes
436 TRAFFICGEN_STC_FRAME_SIZE = "256"
438 # The maximum acceptable frame loss percent in any iteration
439 TRAFFICGEN_STC_ACCEPTABLE_FRAME_LOSS_PCT = "0.0"
441 # The address to assign to the first emulated device interface on the first east port
442 TRAFFICGEN_STC_EAST_INTF_ADDR = ""
444 # The gateway address to assign to the first emulated device interface on the first east port
445 TRAFFICGEN_STC_EAST_INTF_GATEWAY_ADDR = ""
447 # The address to assign to the first emulated device interface on the first west port
448 TRAFFICGEN_STC_WEST_INTF_ADDR = ""
450 # The gateway address to assign to the first emulated device interface on the first west port
451 TRAFFICGEN_STC_WEST_INTF_GATEWAY_ADDR = ""
453 # Print additional information to the terminal during the test
454 TRAFFICGEN_STC_VERBOSE = "True"
456 # Spirent TestCenter Configuration -- END
457 #########################################
459 #############################
460 # Xena Configuration -- BEGIN
462 # Xena traffic generator connection info
463 TRAFFICGEN_XENA_IP = ''
464 TRAFFICGEN_XENA_PORT1 = ''
465 TRAFFICGEN_XENA_PORT2 = ''
466 TRAFFICGEN_XENA_USER = ''
467 TRAFFICGEN_XENA_PASSWORD = ''
468 TRAFFICGEN_XENA_MODULE1 = ''
469 TRAFFICGEN_XENA_MODULE2 = ''
472 TRAFFICGEN_XENA_PORT0_IP = '192.168.199.10'
473 TRAFFICGEN_XENA_PORT0_CIDR = 24
474 TRAFFICGEN_XENA_PORT0_GATEWAY = '192.168.199.1'
475 TRAFFICGEN_XENA_PORT1_IP = '192.168.199.11'
476 TRAFFICGEN_XENA_PORT1_CIDR = 24
477 TRAFFICGEN_XENA_PORT1_GATEWAY = '192.168.199.1'
479 # Xena RFC 2544 options
480 # Please reference xena documentation before making changes to these settings
481 TRAFFICGEN_XENA_2544_TPUT_INIT_VALUE = '10.0'
482 TRAFFICGEN_XENA_2544_TPUT_MIN_VALUE = '0.1'
483 TRAFFICGEN_XENA_2544_TPUT_MAX_VALUE = '100.0'
484 TRAFFICGEN_XENA_2544_TPUT_VALUE_RESOLUTION = '0.5'
485 TRAFFICGEN_XENA_2544_TPUT_USEPASS_THRESHHOLD = 'false'
486 TRAFFICGEN_XENA_2544_TPUT_PASS_THRESHHOLD = '0.0'
488 # Xena RFC 2544 final verification options
489 TRAFFICGEN_XENA_RFC2544_VERIFY = False
490 TRAFFICGEN_XENA_RFC2544_VERIFY_DURATION = 120 # in seconds
491 # Number of verify attempts before giving up...
492 TRAFFICGEN_XENA_RFC2544_MAXIMUM_VERIFY_ATTEMPTS = 10
493 # Logic for restarting binary search, see documentation for details
494 TRAFFICGEN_XENA_RFC2544_BINARY_RESTART_SMART_SEARCH = True
496 # Xena Continuous traffic options
497 # Please reference xena documentation before making changes to these settings
498 TRAFFICGEN_XENA_CONT_PORT_LEARNING_ENABLED = True
499 TRAFFICGEN_XENA_CONT_PORT_LEARNING_DURATION = 3
501 # Xena Configuration -- END
502 ###########################
504 ###################################################
505 # MoonGen Configuration and Connection Info-- BEGIN
507 # Ex: TRAFFICGEN_MOONGEN_HOST_IP_ADDR = "192.10.1.1"
508 TRAFFICGEN_MOONGEN_HOST_IP_ADDR = ''
509 TRAFFICGEN_MOONGEN_USER = ''
510 TRAFFICGEN_MOONGEN_BASE_DIR = ''
511 TRAFFICGEN_MOONGEN_PORTS = ''
512 # Ex. 10 Gbps: TRAFFICGEN_MOONGEN_LINE_SPEED_GBPS = '10'
513 # Today only 10 Gbps is supported
514 TRAFFICGEN_MOONGEN_LINE_SPEED_GBPS = ''
516 # MoonGen Configuration and Connection Info-- END
517 #################################################
519 ################################################
520 # Trex Configuration and Connection Info-- BEGIN
522 # Example: TRAFFICGEN_TREX_HOST_IP_ADDR = "192.10.1.1"
523 # Example: TRAFFICGEN_TREX_USER = 'root'
524 # Example: TRAFFICGEN_TREX_BASE_DIR = '/traffic_gen/trex/'
525 # Example: TRAFFICGEN_TREX_PORT1 = '00:00:00:00:00:00'
526 TRAFFICGEN_TREX_HOST_IP_ADDR = ''
527 TRAFFICGEN_TREX_USER = ''
528 TRAFFICGEN_TREX_BASE_DIR = ''
529 TRAFFICGEN_TREX_PORT1 = ''
530 TRAFFICGEN_TREX_PORT2 = ''
531 # RFC2544 Throughput execution will end after threshold below is reached.
532 # It defines maximal difference between frame rate of successful (i.e. defined
533 # frameloss reached) and unsuccessful (i.e. frameloss exceeded) iterations.
534 TRAFFICGEN_TREX_RFC2544_TPUT_THRESHOLD = 0.05
535 # Latency statistics are collected by separate stream created for each interface.
536 # Parameter below defines frequency of packets used for latency measurement in PPS.
537 # Value 0 will disable latency specific streams.
538 TRAFFICGEN_TREX_LATENCY_PPS = 1000
539 # Enablement of learning packets before sending test traffic
540 TRAFFICGEN_TREX_LEARNING_MODE = True
541 TRAFFICGEN_TREX_LEARNING_DURATION = 5
542 # FOR SR-IOV or multistream layer 2 tests to work with T-Rex enable Promiscuous mode
543 TRAFFICGEN_TREX_PROMISCUOUS = False
544 # Enable below options to force T-rex api to attempt to use speed specified on server
545 # side when pushing traffic. For 40G use 40000. For 25G use 25000.
546 TRAFFICGEN_TREX_FORCE_PORT_SPEED = False
547 TRAFFICGEN_TREX_PORT_SPEED = 10000 # 10G
549 PATHS['trafficgen'] = {
553 'path': os.path.join(ROOT_DIR, 'src/trex/trex/scripts/automation/trex_control_plane/stl')
557 # TRex validation option for RFC2544
558 TRAFFICGEN_TREX_VERIFICATION_MODE = False
559 TRAFFICGEN_TREX_VERIFICATION_DURATION = 60
560 TRAFFICGEN_TREX_MAXIMUM_VERIFICATION_TRIALS = 10
561 # TREX Configuration and Connection Info-- END
562 ##############################################