Manual:Tools/Traffic Generator: Difference between revisions

From MikroTik Wiki
Jump to navigation Jump to search
 
(37 intermediate revisions by 6 users not shown)
Line 1: Line 1:
{{Versions| v5 +}}
{{Versions| v6 +}}


__TOC__
__TOC__
Line 5: Line 5:
==Summary==
==Summary==


Traffic Generator is a tool that allows to generate and send RAW packets  over specific ports. Tool also collects latency and jitter values, tx/rx rates, it also counts lost packets and detects Out-of-Order packets.
Traffic Generator is a tool that allows to evaluate performance of DUT (Device Under Test) or SUT (System Under Test).
 
Tool can generate and send RAW packets  over specific ports. It also collects latency and jitter values, tx/rx rates, counts lost packets and detects Out-of-Order (OOO) packets.
 
Traffic Generator can be used similar to [[M:Tools/Bandwidth_Test | bandwidth test]] tool as well as generate packets that will be routed back to packet generator for advanced status collection.
Traffic Generator can be used similar to [[M:Tools/Bandwidth_Test | bandwidth test]] tool as well as generate packets that will be routed back to packet generator for advanced status collection.


{{Note | In device, which generates packets, it will not be possible to capture packets generated by traffic-generator with sniffer tool, torch or firewall on outgoing interface.}}
==General==
==General==
<p id="shbox"><b>Sub-menu</b> <code>/tool traffic-generator</code></p>
<p id="shbox"><b>Sub-menu</b> <code>/tool traffic-generator</code></p>
Line 23: Line 27:


{{Mr-arg-table
{{Mr-arg-table
|arg=latency-distribution-scale
|arg=latency-distribution-max
|type=integer [0..28]
|type=time
|default=10
|default=100us
|desc=
|desc=Maximal latency range for latency distribution measurements. Based on this value, RouterOS will decide what latency range to use as <var>latency-distribution-measure-interval</var> property
}}
 
{{Mr-arg-table
|arg=measure-out-of-order
|type=yes {{!}} no
|default=
|desc=Whether to measure Out-of-Order packets. Default value is based on CPU type (multi-core CPU default '''no'''; single-core CPU default '''yes'''). When the property is enabled on the multi-core device, a single stream will utilize only a single CPU core
}}
 
{{Mr-arg-table
|arg=stats-samples-to-keep
|type=integer
|default=100
|desc=How many data examples to collect
}}
}}


Line 47: Line 65:
|arg=latency-distribution-samples
|arg=latency-distribution-samples
|type=integer
|type=integer
|desc=
|desc=Shows how many individual time periods the <var>latency-distribution-measure-interval</var> is divided into
}}
}}


Line 53: Line 71:
|arg=latency-distribution-measure-interval
|arg=latency-distribution-measure-interval
|type=time
|type=time
|desc=
|desc=Shows total latency measurement range
}}
}}


Line 59: Line 77:
|arg=running
|arg=running
|type=yes {{!}} no
|type=yes {{!}} no
|desc= Shows whether traffic generator tool is started.
|desc=Shows whether traffic generator tool is started.
}}
}}


Line 73: Line 91:
|arg=quick
|arg=quick
|type=
|type=
|desc=This command allows to quickly start packet generator and print the stats output to the terminal. Command also accept several parameters that overrides settings in packet template and stream settings. Accepted parameters are '''duration, entries-to-show, freeze-frame-interval, mbps, num, packet-size, port, pps, stream, test-id, tx-template'''
|desc=This command allows to quickly start packet generator and print the stats output to the terminal. Command also accept several parameters that overrides settings in packet template and stream settings. Accepted parameters are '''duration, entries-to-show, freeze-frame-interval, id, interface, mbps, measure-out-of-order, packet-count, packet-size, port, pps, stream, test-id, tx-template'''
 
* <var>tx-template</var> - packet templates to generate traffic (max 16 templates)
* <var>duration</var> - how long to run the test
* <var>entries-to-show</var> - how many status lines print  to the terminal
* <var>freeze-frame-interval</var> - how often to update status to the terminal
The rest of the parameters are not command specific and are described elsewhere.
Parameters specified when running quick command overrides configured values. In case if parameter is specified only for one header then value is multiplied for all the other headers (if required).
}}
}}


Line 83: Line 106:
}}
}}


{{Mr-arg-ro-table-end
{{Mr-arg-ro-table
|arg=stop
|arg=stop
|type=
|type=
|desc=Command stops the started traffic generator tool by '''start''' command.
|desc=Command stops the started traffic generator tool by '''start''' command.
}}
{{Mr-arg-ro-table
|arg=inject
|type=
|desc=Inject raw data to interface.
}}
{{Mr-arg-ro-table-end
|arg=inject-pcap
|type=
|desc=Inject raw data directly from pcap file.
}}
}}


Line 92: Line 127:
<p id="shbox"><b>Sub-menu</b> <code>/tool traffic-generator packet-template</code></p>
<p id="shbox"><b>Sub-menu</b> <code>/tool traffic-generator packet-template</code></p>


This sub menu allows to build packet based on provided parameters. Based on parameters you can build ip packet with vlan tags and set udp ports. [[Raw packet template]] is generated based on provided parameters.
If you require more low level packet or take full advantage of traffic generator, then please use [[#Raw_Packet_Template | raw-packet-template]] builder to build the packet.
If same type of header is present in packet more than once then header field values are passed as comma separated list. (For example if there are two ip
headers then source addresses are given like "ip-src=1.1.1.1,2.2.2.2").
For quicker header construction many of the header field values are assumed. For example if header stack is "mac,ip" then traffic generator can assume that mac-protocol value is "ip". Or if "port" or "interface" setting is specified traffic generator can assume "mac-src" to be MAC address of interface).
Assumed values have distinct names that start with "assumed-" and are read only. Manually specified values override assumed ones.
{{Note | Assumed values are not automatically updated. New values are assumed after template edit. "packet-template set 0" is enough to trigger new assumed values }}




Line 100: Line 149:
|desc=Description
|desc=Description
}}
}}
{{Mr-arg-table-end
 
|arg=
{{Mr-arg-table
|arg=comment
|type=string
|default=
|desc=Short description of packet you are building.
}}
 
{{Mr-arg-table
|arg=compute-checksum-from-offset
|type=no-checksum {{!}} integer[0..4294967295]
|default=
|desc=specifies byte offset from where in the packet 2 byte checksum will be calculated  (Example: set to 14, to skip packets Ethernet header when calcucating checksum)
}}
 
{{Mr-arg-table
|arg=data
|type=incrementing {{!}} random {{!}} specific-byte {{!}} uninitialized
|default=uninitialized
|desc=Specifies how packet payload will be filled:
* '''uninitialized''' - packets data (after header) is uninitialized, but not zero. Fastest.
* '''specific-byte''' - works together with setting data-byte
* '''incrementing''' - packets data filled with "00 01 02 03" and so on
* '''random''' - packets data filled with random bytes. Slowest.
}}
 
{{Mr-arg-table
|arg=data-byte
|type=hex [0..FF]]
|default=0
|desc=Byte that will be used to fill packet payload.
}}
 
{{Mr-arg-table
|arg=interface
|type=string
|default=
|desc=Optional parameter of packet template. This is mutually exclusive with "port" setting. Specifying "interface" allows user not to create a port entry for interface in port menu. In fact a port entry is created dynamically. This is useful for running quick tests.
}}
 
{{Mr-arg-table
|arg=ip-dscp
|type=list of integer[0..255] (max 16 times)
|default=
|desc=Single or list of DS Fields that will be set in IP header (DS Field contains DSCP value and the ECN value)
}}
 
{{Mr-arg-table
|arg=ip-dst
|type=list of IP/Netmask (max 16 times)
|default=
|desc=List of destination IP addresses that will be used when generating IP headers.
}}
 
{{Mr-arg-table
|arg=ip-frag-off
|type=list of integer[0..65535] (max 16 times)
|default=
|desc=List of fragmentation offsets in IP header.
}}
 
{{Mr-arg-table
|arg=ip-gateway
|type=IP
|default=
|desc=In situations when sender and receiver is the same device, it is impossible to determine nexthop automatically from '''ip-dst'''. If ip-gateway is specified packet template will assume destination mac address based on resolved ip-gateway.
}}
 
{{Mr-arg-table
|arg=ip-id
|type=list of integer [0..65535]
|default=
|desc=
}}
 
{{Mr-arg-table
|arg=ip-protocol
|type=list of IP protocols (max 16 times)
|default=
|desc=
}}
 
{{Mr-arg-table
|arg=ip-src
|type=list of IP/Mask (max 16 times)
|default=
|desc=
}}
 
{{Mr-arg-table
|arg=ip-ttl
|type=list of integer [0..255] (max 16 times)
|default=
|desc=
}}
 
{{Mr-arg-table
|arg=mac-dst
|type=list of MAC/MASK (max 16 times)
|default=
|desc=
}}
 
{{Mr-arg-table
|arg=mac-protocol
|type=list of mac protocols (max 16 times)
|default=
|desc=
}}
 
{{Mr-arg-table
|arg=mac-src
|type=list of MAC/MASK (max 16 times)
|default=
|desc=
}}
 
{{Mr-arg-table
|arg=name
|type=string
|default=
|desc=Descriptive name of the template.
}}
 
{{Mr-arg-table
|arg=port
|type=string
|default=
|desc=Optional parameter of packet template. This suggests a port through which packets generated using this template should be sent out. Port can also be specified in other places such as in stream settings. This is mutually exclusive with interface setting.
}}
 
{{Mr-arg-table
|arg=raw-header
|type=string (max 16 times)
|default=
|desc=Raw packet header as string in hexadecimal format.
}}
 
{{Mr-arg-table
|arg=udp-dst-port
|type=list of port [0..65535]/mask [0..FFFF] (max 16 times)
|default=
|desc=
}}
 
{{Mr-arg-table
|arg=udp-src-port
|type=list of port [0..65535]/mask [0..FFFF] (max 16 times)
|default=
|desc=
}}
 
{{Mr-arg-table
|arg=vlan-id
|type=
|default=
|desc=
}}
 
{{Mr-arg-table
|arg=vlan-priority
|type=
|default=
|desc=
}}
 
{{Mr-arg-table
|arg=vlan-protocol
|type=
|type=
|default=
|default=
|desc=
|desc=
}}
{{Mr-arg-table-end
|arg=header-stack
|type=list of ip {{!}} mac {{!}} raw {{!}} udp {{!}} vlan (max 16 times)
|default=ip
|desc=Sequence of headers that a generated packet should have.
Currently supports:
* '''mac''' - Ethernet header (14 bytes)
* '''vlan''' - Ethernet VLAN tag (4 bytes)
* '''ip''' - IPv4 header (20 bytes)
* '''udp''' - UDP header (8 bytes)
* '''raw''' - arbitrary bytes specified as hex string
Most header types can be present in header multiple times. There can be only 2 ip headers and 1 udp header per packet. Some limitations are imposed on possible sequences of headers based on our practical experience with network protocols (for example vlan header can follow only a mac header or other vlan header).
Traffic generator suggests first header for a packet template (in port menu). But it is not enforced.
}}
}}


==Port Configuration==
==Port Configuration==
<p id="shbox"><b>Sub-menu</b> <code>/tool packet-generator port</code></p>
<p id="shbox"><b>Sub-menu</b> <code>/tool traffic-generator port</code></p>




This menu allows to specify ports (interfaces) that will be used to receive send generated packets.
This menu allows to configure ports that will be associated to specific interface and will be used to receive/send generated packets.




Line 139: Line 373:
|type=string
|type=string
|default=
|default=
|desc=Name of the interface which will be used for tx/rx
|desc=Name of the interface associated with the port.
}}
 
 
'''Read-Only Properties'''
 
{{Mr-arg-table-h
|prop=Property
|desc=Description
}}
 
{{Mr-arg-ro-table
|arg=dynamic
|type=yes {{!}} no
|desc=Whether port configuration is generated automatically.
}}
 
{{Mr-arg-ro-table
|arg=first-header
|type=ip {{!}} mac {{!}} raw {{!}} udp {{!}} vlan
|desc=Shows suggested first header for packets to be sent out of specified interface. This is information can be used when creating [[#Packet_Template | packet templates]].
}}
 
{{Mr-arg-ro-table-end
|arg=inactive
|type=yes {{!}} no
|desc=Whether port is inactive and can't participate in tx/rx of the packets.
}}
}}


Line 145: Line 405:
<p id="shbox"><b>Sub-menu</b> <code>/tool traffic-generator stats</code></p>
<p id="shbox"><b>Sub-menu</b> <code>/tool traffic-generator stats</code></p>


If traffic generator is not running in '''quick''' mode then all statistics about the test is stored in this menu.
===Latency Distribution===
<p id="shbox"><b>Sub-menu</b> <code>/tool traffic-generator stats latency-distribution</code></p>
This sub-menu shows how many packets are received in specific latency range. Latency range can be viewed by streams or by sequences (for example, '''print stream-num=3''', '''print seq=10''')
Here is an example output of the latency graph:
<pre>
[admin@test-host] /tool traffic-generator stats latency-distribution> print           
# LATENCY                COUNT        SHARE GRAPH                                             
0 0-15.5us                    0          0%
1 15.5us-31us                0          0%
2 31us-46.5us                0          0%
3 46.5us-62.1us              0          0%
4 62.1us-77.6us              0          0%
5 77.6us-93.1us              0          0%
6 93.1us-109us                0          0%
7 109us-124us                0          0%
8 124us-140us                0          0%
9 140us-155us                0          0%
10 155us-171us                0          0%
11 171us-186us                4          0% *                                                 
12 186us-202us                29          0% *                                                 
13 202us-217us                90      0.001% *                                                 
14 217us-233us              302      0.004% *                                                 
15 233us-248us              630      0.009% *                                                 
16 248us-264us              789      0.011% *                                                 
17 264us-279us            1 384      0.021% -*                                                 
18 279us-295us            1 990        0.03% --*                                               
19 295us-310us            2 966      0.045% ---*                                               
20 310us-326us            4 089      0.062% -----*                                             
21 326us-341us            4 958      0.075% ------*                                           
22 341us-357us            6 059      0.091% -------*                                           
23 357us-372us            6 660      0.101% --------*                                         
24 372us-388us            8 320      0.126% ----------*                                       
25 388us-403us            9 988      0.151% -------------*                                     
26 403us-419us            11 781      0.178% ---------------*                                   
27 419us-434us            12 512      0.189% ----------------*                                 
28 434us-450us            13 836        0.21% -----------------*                                 
29 450us-465us            15 681      0.238% --------------------*                             
30 465us-481us            17 740      0.269% ----------------------*                           
31 481us-496us            19 913      0.302% --------------------------*                       
32 496us-512us            21 106        0.32% ---------------------------*                       
33 512us-528us            22 848      0.346% -----------------------------*                     
34 528us-543us            25 059        0.38% --------------------------------*                 
35 543us-559us            26 593      0.403% ----------------------------------*               
36 559us-574us            27 663      0.419% -----------------------------------*               
37 574us-590us            29 351      0.445% -------------------------------------*             
38 590us-605us            31 265      0.474% ----------------------------------------*         
39 605us-621us            33 224      0.504% -------------------------------------------*       
40 621us-636us            34 464      0.523% --------------------------------------------*     
41 636us-652us            35 630        0.54% ----------------------------------------------*   
42 652us-667us            37 245      0.565% ------------------------------------------------* 
43 667us-683us            38 158      0.579% -------------------------------------------------* 
44 683us-698us            38 626      0.586% --------------------------------------------------*
45 698us-714us            38 985      0.591% --------------------------------------------------*
46 714us-729us            39 061      0.592% --------------------------------------------------*
47 729us-745us            39 750      0.603% ---------------------------------------------------*
48 745us-760us            39 145      0.594% --------------------------------------------------*
49 760us-776us            39 162      0.594% --------------------------------------------------*
50 776us-791us            38 197      0.579% -------------------------------------------------* 
51 791us-807us            37 811      0.573% -------------------------------------------------* 
52 807us-822us            37 364      0.567% ------------------------------------------------* 
53 822us-838us            36 770      0.558% -----------------------------------------------*   
54 838us-853us            35 831      0.543% ----------------------------------------------*   
55 853us-869us            35 380      0.536% ----------------------------------------------*   
56 869us-884us            34 472      0.523% --------------------------------------------*     
57 884us-900us            33 672      0.511% -------------------------------------------*       
58 900us-915us            33 799      0.513% --------------------------------------------*     
59 915us-931us            32 754      0.497% ------------------------------------------*       
60 931us-946us            32 339        0.49% ------------------------------------------*       
61 946us-962us            32 419      0.492% ------------------------------------------*       
62 962us-977us            32 107      0.487% -----------------------------------------*         
63 977us-993us            31 552      0.478% -----------------------------------------*         
64 0-993us            1 221 523      18.54%
</pre>




Line 154: Line 496:
}}
}}


{{Mr-arg-table-end
{{Mr-arg-ro-table
|arg=
|arg=count
|type=
|type=integer
|default=
|desc=Number of packets in current latency range
|desc=
}}
 
{{Mr-arg-ro-table
|arg=graph
|type=string
|desc=graphical representation of share
}}
 
{{Mr-arg-ro-table
|arg=latency
|type=string
|desc=latency range
}}
 
{{Mr-arg-ro-table-end
|arg=share
|type=precent
|desc=Percentage of packets falling in this latency range.
}}
}}


===Stream Stats===
<p id="shbox"><b>Sub-menu</b> <code>/tool traffic-generator stats stream</code></p>
This sub-menu stores statistics sorted by streams. Output is the same as in '''quick''' mode.
<pre>
[admin@test-host] /tool traffic-generator stats stream> print
# SEQ    NUM    TX-PACKET  TX-RATE    RX-PACKET  RX-RATE  LOST-PACKET LOST-RATE
0 1      3          43 064 499.5Mbps        25 180 292.0Mbps        17 884 207.4Mbps
1 1      4          43 062 499.5Mbps        39 946 463.3Mbps        3 116  36.1Mbps
2 1      TOT        86 126 999.0Mbps        65 126 755.4Mbps        21 000 243.6Mbps
3 2      3          43 544 505.1Mbps        30 449 353.2Mbps        13 095 151.9Mbps
4 2      4          43 543 505.0Mbps        42 982 498.5Mbps          561  6.5Mbps
5 2      TOT        87 087 1010.2...        73 431 851.7Mbps        13 656 158.4Mbps
...
59 20    TOT        87 277 1012.4...        73 755 855.5Mbps        13 522 156.8Mbps
60 21    3          43 546 505.1Mbps        30 605 355.0Mbps        12 941 150.1Mbps
61 21    4          43 546 505.1Mbps        42 682 495.1Mbps          864  10.0Mbps
62 21    TOT        87 092 1010.2...        73 287 850.1Mbps        13 805 160.1Mbps
63 TOT    3        913 942 504.8Mbps      629 210 347.5Mbps      284 732 157.2Mbps
64 TOT    4        913 939 504.8Mbps      898 374 496.2Mbps        15 565  8.5Mbps
65 TOT    TOT    1 827 881 1009.6...    1 527 584 843.8Mbps      300 297 165.8Mbps
[admin@test-host] /tool traffic-generator stats stre
</pre>
===Port Stats===
<p id="shbox"><b>Sub-menu</b> <code>/tool traffic-generator stats port</code></p>
This sub-menu stores statistics sorted by rx/tx ports.
<pre>
[admin@test-host] /tool traffic-generator stats port> print
# SEQ    PORT        RX-UNK-PACKET    RX-UNK-BYTE RX-UNK...    TX-PACKET  TX-RATE    RX-PACKET
0 1      port0:et...            0              0      0bps        43 064 499.5Mbps        39 946
1 1      port1:et...            0              0      0bps        43 062 499.5Mbps        25 180
2 1      TOT                    0              0      0bps        86 126 999.0Mbps        65 126
3 2      port0:et...            0              0      0bps        43 544 505.1Mbps        42 982
4 2      port1:et...            0              0      0bps        43 543 505.0Mbps        30 449
5 2      TOT                    0              0      0bps        87 087 1010.2...        73 431
6 3      port0:et...            0              0      0bps        43 540 505.0Mbps        42 615
7 3      port1:et...            0              0      0bps        43 540 505.0Mbps        30 191
8 3      TOT                    0              0      0bps        87 080 1010.1...        72 806
</pre>
===Raw Stats===
<p id="shbox"><b>Sub-menu</b> <code>/tool traffic-generator stats raw</code></p>
This sub-menu stores raw statistics data.
<pre>
[admin@test-host] /tool traffic-generator stats raw> print
# SEQ    PORT      NUM    TX-PACKET  TX-RATE    RX-PACKET  RX-RATE  LOST-PACKET LOST-RATE
0 1      port0:e... 3          43 064 499.5Mbps            0      0bps        43 064 499.5Mbps
1 1      port1:e... 3              0      0bps        25 180 292.0Mbps      -25 180 292.0Mbps
2 1      TOT        3          43 064 499.5Mbps        25 180 292.0Mbps        17 884 207.4Mbps
3 1      port0:e... 4              0      0bps        39 946 463.3Mbps      -39 946 463.3Mbps
4 1      port1:e... 4          43 062 499.5Mbps            0      0bps        43 062 499.5Mbps
5 1      TOT        4          43 062 499.5Mbps        39 946 463.3Mbps        3 116  36.1Mbps
6 1      port0:e... TOT        43 064 499.5Mbps        39 946 463.3Mbps        3 118  36.1Mbps
7 1      port1:e... TOT        43 062 499.5Mbps        25 180 292.0Mbps        17 882 207.4Mbps
8 2      port0:e... 3          43 544 505.1Mbps            0      0bps        43 544 505.1Mbps
9 2      port1:e... 3              0      0bps        30 449 353.2Mbps      -30 449 353.2Mbps
10 2      TOT        3          43 544 505.1Mbps        30 449 353.2Mbps        13 095 151.9Mbps
</pre>


==Streams==
==Streams==
Line 171: Line 604:
}}
}}


{{Mr-arg-table-end
{{Mr-arg-table
|arg=
|arg=disabled
|type=
|type=yes {{!}} no
|default=no
|desc=Whether stream is disabled
}}
 
{{Mr-arg-table
|arg=mbps
|type=integer [0..4294967295]
|default=0
|desc=Value in Mega bits per second that stream will try to generate.
}}
 
{{Mr-arg-table
|arg=name
|type=string
|default=
|default=
|desc=Descriptive name of the stream.
}}
{{Mr-arg-table
|arg=num
|type=integer [0..15]
|default=0
|desc=
|desc=
}}
{{Mr-arg-table
|arg=packet-size
|type=integer[1..65535] [-integer[1..65535]]
|default=0
|desc=Generated size of the packets in bytes. Can be set as the range for random packet size generation.
}}
{{Mr-arg-table
|arg=port
|type=string
|default=
|desc=Name of the port from [[#Port_Configuration | Port menu]] that will be used to transmit packets.
}}
{{Mr-arg-table
|arg=pps
|type=integer [0..4294967295]
|default=0
|desc=Packets per second that stream will try to generate.
}}
}}




{{Mr-arg-table-end
|arg=tx-template
|type=string
|default=
|desc=Name of the packet template from [[#Packet_Template | packet-template]] or [[#Raw_Packet_Template | raw-packet-template]] menus used as the packet content source.
}}


==Configuration Examples==
==Configuration Examples==
===IpSec tunnel performance test===
Consider following test setup
[[File:traffic-gen-routing-ipsec.png]]
System Under Test (SUT) consists of two routers connected to traffic generator server. The connection between both SUT routers is IPSec encrypted.
Traffic generator will run two streams:
* in direction from 1.1.1.0/24 network to 2.2.2.0/24 network
* in direction from 2.2.2.0/24 network to 1.1.1.0/24 network.
'''R1 routing and ipsec setup'''
<pre>
/ip address
add address=192.168.33.1/30 interface=ether1
add address=1.1.1.2/24 interface=ether2
/ip route
add dst-address=2.2.2.0/24 gateway=192.168.33.2
/ip ipsec proposal
set default enc-algorithms=aes-128
/ip ipsec peer
add address=192.168.33.2 secret=123
/ip ipsec policy
add sa-src-address=192.168.33.1 sa-dst-address=192.168.33.2 \
    src-address=1.1.1.0/24 dst-address=2.2.2.0/24 tunnel=yes
</pre>
'''R2 routing and ipsec setup'''
<pre>
/ip address
add address=192.168.33.2/30 interface=ether1
add address=2.2.2.2/24 interface=ether2
/ip route
add dst-address=1.1.1.0/24 gateway=192.168.33.1
/ip ipsec proposal
set default enc-algorithms=aes-128
/ip ipsec peer
add address=192.168.33.1 secret=123
/ip ipsec policy
add sa-src-address=192.168.33.2 sa-dst-address=192.168.33.1 \
    src-address=2.2.2.0/24 dst-address=1.1.1.0/24 tunnel=yes
</pre>
'''Traffic generator server setup'''
<pre>
/ip address
add address=1.1.1.1/24 interface=ether2
add address=2.2.2.1/24 interface=ether3
</pre>
First we will define which ports will be used as traffic generator tx/rx ports
<pre>
/tool traffic-generator port
add disabled=no interface=ether2 name=port0
add disabled=no interface=ether3 name=port1
</pre>
To construct actual packet that will be generated, [[#Packet Template | packet-template]] is used.
<pre>
/tool traffic-generator packet-template
add header-stack=mac,ip,udp ip-dst=2.2.2.1/32 ip-gateway=1.1.1.2 ip-src=1.1.1.1/32 \
    name=routing-1 port=port0
add header-stack=mac,ip,udp ip-dst=1.1.1.1/25 ip-gateway=2.2.2.2 ip-src=2.2.2.1/32 \
    name=routing-2 port=port1
</pre>
Notice that mac addresses were not specified since template generator can assume next-hop mac address automatically by sending ARP messages. Since we are doing routing and destination IP is not directly reachable, we have set '''ip-gateway''' parameter to determine next-hop mac-address.
When running '''print''' you can see all assumed (detected) values including mac addresses.
<pre>
[admin@test-host] /tool traffic-generator packet-template> print
0 name="routing-1" header-stack=mac,ip,udp port=port0
  assumed-mac-dst=00:0C:42:00:38:9D assumed-mac-src=00:0C:42:40:94:25
  assumed-mac-protocol=ip assumed-ip-dscp=0 assumed-ip-id=0
  assumed-ip-frag-off=0 assumed-ip-ttl=64 assumed-ip-protocol=udp
  ip-src=1.1.1.1/32 ip-dst=2.2.2.1/32 assumed-udp-src-port=100
  assumed-udp-dst-port=200 ip-gateway=1.1.1.2 data=uninitialized data-byte=0
1 name="routing-2" header-stack=mac,ip,udp port=port1
  assumed-mac-dst=00:0C:42:00:38:D1 assumed-mac-src=00:0C:42:40:94:26
  assumed-mac-protocol=ip assumed-ip-dscp=0 assumed-ip-id=0
  assumed-ip-frag-off=0 assumed-ip-ttl=64 assumed-ip-protocol=udp
  ip-src=2.2.2.1/32 ip-dst=1.1.1.1/32 assumed-udp-src-port=100
  assumed-udp-dst-port=200 ip-gateway=2.2.2.2 data=uninitialized data-byte=0
</pre>
For example, if any router in SUT were to change, assumed mac-addresses would not be updated automatically. To update packet templates simply issue command :
<code>/tool traffic-generator packet-template set [find]</code>
Last part is to configure streams
<pre>
/tool traffic-generator stream
add disabled=no mbps=500 name=str1 id=3 packet-size=1450 port=port0 pps=0 \
    tx-template=routing-1
add disabled=no mbps=500 name=str3 id=4 packet-size=1450 port=port1 pps=0 \
    tx-template=routing-2
</pre>
Notice that each stream has unique '''id''' value. This value identifies stream packets, otherwise traffic generator will not work.
Now we are ready to run the test. In this case '''quick''' mode will be used:
<pre>
[admin@test-host] /tool traffic-generator> quick mbps=450
SEQ    NUM    TX-PACKET  TX-RATE    RX-PACKET  RX-RATE        RX-OOO  LOST-PACKET LOST-RATE
37    4          39 488 458.0Mbps        39 270 455.5Mbps        15 509          218  2.5Mbps
37    TOT        78 976 916.1Mbps        76 485 887.2Mbps        22 529        2 491  28.8Mbps
38    3          38 957 451.9Mbps        37 657 436.8Mbps        7 078        1 300  15.0Mbps
38    4          38 958 451.9Mbps        38 402 445.4Mbps        14 763          556  6.4Mbps
38    TOT        77 915 903.8Mbps        76 059 882.2Mbps        21 841        1 856  21.5Mbps
39    3          38 816 450.2Mbps        37 893 439.5Mbps        7 307          923  10.7Mbps
39    4          38 815 450.2Mbps        38 642 448.2Mbps        15 110          173  2.0Mbps
39    TOT        77 631 900.5Mbps        76 535 887.8Mbps        22 417        1 096  12.7Mbps
40    3          39 779 461.4Mbps        37 415 434.0Mbps        7 136        2 364  27.4Mbps
40    4          39 780 461.4Mbps        39 567 458.9Mbps        15 908          213  2.4Mbps
40    TOT        79 559 922.8Mbps        76 982 892.9Mbps        23 044        2 577  29.8Mbps
41    3          39 218 454.9Mbps        37 089 430.2Mbps        7 075        2 129  24.6Mbps
41    4          39 218 454.9Mbps        38 663 448.4Mbps        15 752          555  6.4Mbps
41    TOT        78 436 909.8Mbps        75 752 878.7Mbps        22 827        2 684  31.1Mbps
42    3          39 188 454.5Mbps        37 906 439.7Mbps        6 729        1 282  14.8Mbps
42    4          39 187 454.5Mbps        38 954 451.8Mbps        15 565          233  2.7Mbps
42    TOT        78 375 909.1Mbps        76 860 891.5Mbps        22 294        1 515  17.5Mbps
TOT    3      1 645 468 454.4Mbps    1 568 201 433.1Mbps      280 174        77 267  21.3Mbps
TOT    4      1 645 464 454.4Mbps    1 626 896 449.3Mbps      627 480        18 568  5.1Mbps
TOT    TOT    3 290 932 908.9Mbps    3 195 097 882.4Mbps      907 654        95 835  26.4Mbps
</pre>
Stats shows throughput of each stream and total throughput of both streams, Out-of-order packet count, Lost rate, latency and jitter.





Latest revision as of 09:39, 26 July 2019

Applies to RouterOS: v6 +

Summary

Traffic Generator is a tool that allows to evaluate performance of DUT (Device Under Test) or SUT (System Under Test).

Tool can generate and send RAW packets over specific ports. It also collects latency and jitter values, tx/rx rates, counts lost packets and detects Out-of-Order (OOO) packets.

Traffic Generator can be used similar to bandwidth test tool as well as generate packets that will be routed back to packet generator for advanced status collection.

Note: In device, which generates packets, it will not be possible to capture packets generated by traffic-generator with sniffer tool, torch or firewall on outgoing interface.


General

Sub-menu /tool traffic-generator


This menu allows to set general traffic generator properties and contains commands to quickly start and stop the tool.


Properties

Property Description
latency-distribution-max (time; Default: 100us) Maximal latency range for latency distribution measurements. Based on this value, RouterOS will decide what latency range to use as latency-distribution-measure-interval property
measure-out-of-order (yes | no; Default: ) Whether to measure Out-of-Order packets. Default value is based on CPU type (multi-core CPU default no; single-core CPU default yes). When the property is enabled on the multi-core device, a single stream will utilize only a single CPU core
stats-samples-to-keep (integer; Default: 100) How many data examples to collect
test-id (integer [0..255]; Default: 0)


Read-Only Properties

Property Description
latency-distribution-samples (integer) Shows how many individual time periods the latency-distribution-measure-interval is divided into
latency-distribution-measure-interval (time) Shows total latency measurement range
running (yes | no) Shows whether traffic generator tool is started.


Commands

Property Description
quick () This command allows to quickly start packet generator and print the stats output to the terminal. Command also accept several parameters that overrides settings in packet template and stream settings. Accepted parameters are duration, entries-to-show, freeze-frame-interval, id, interface, mbps, measure-out-of-order, packet-count, packet-size, port, pps, stream, test-id, tx-template
  • tx-template - packet templates to generate traffic (max 16 templates)
  • duration - how long to run the test
  • entries-to-show - how many status lines print to the terminal
  • freeze-frame-interval - how often to update status to the terminal

The rest of the parameters are not command specific and are described elsewhere.

Parameters specified when running quick command overrides configured values. In case if parameter is specified only for one header then value is multiplied for all the other headers (if required).
start () Commands starts the traffic generator tool in the background. It accepts one parameter test-id
stop () Command stops the started traffic generator tool by start command.
inject () Inject raw data to interface.
inject-pcap () Inject raw data directly from pcap file.

Packet Template

Sub-menu /tool traffic-generator packet-template


This sub menu allows to build packet based on provided parameters. Based on parameters you can build ip packet with vlan tags and set udp ports. Raw packet template is generated based on provided parameters.

If you require more low level packet or take full advantage of traffic generator, then please use raw-packet-template builder to build the packet.


If same type of header is present in packet more than once then header field values are passed as comma separated list. (For example if there are two ip headers then source addresses are given like "ip-src=1.1.1.1,2.2.2.2").


For quicker header construction many of the header field values are assumed. For example if header stack is "mac,ip" then traffic generator can assume that mac-protocol value is "ip". Or if "port" or "interface" setting is specified traffic generator can assume "mac-src" to be MAC address of interface). Assumed values have distinct names that start with "assumed-" and are read only. Manually specified values override assumed ones.

Note: Assumed values are not automatically updated. New values are assumed after template edit. "packet-template set 0" is enough to trigger new assumed values



Properties

Property Description
comment (string; Default: ) Short description of packet you are building.
compute-checksum-from-offset (no-checksum | integer[0..4294967295]; Default: ) specifies byte offset from where in the packet 2 byte checksum will be calculated (Example: set to 14, to skip packets Ethernet header when calcucating checksum)
data (incrementing | random | specific-byte | uninitialized; Default: uninitialized) Specifies how packet payload will be filled:
  • uninitialized - packets data (after header) is uninitialized, but not zero. Fastest.
  • specific-byte - works together with setting data-byte
  • incrementing - packets data filled with "00 01 02 03" and so on
  • random - packets data filled with random bytes. Slowest.
data-byte (hex [0..FF]]; Default: 0) Byte that will be used to fill packet payload.
interface (string; Default: ) Optional parameter of packet template. This is mutually exclusive with "port" setting. Specifying "interface" allows user not to create a port entry for interface in port menu. In fact a port entry is created dynamically. This is useful for running quick tests.
ip-dscp (list of integer[0..255] (max 16 times); Default: ) Single or list of DS Fields that will be set in IP header (DS Field contains DSCP value and the ECN value)
ip-dst (list of IP/Netmask (max 16 times); Default: ) List of destination IP addresses that will be used when generating IP headers.
ip-frag-off (list of integer[0..65535] (max 16 times); Default: ) List of fragmentation offsets in IP header.
ip-gateway (IP; Default: ) In situations when sender and receiver is the same device, it is impossible to determine nexthop automatically from ip-dst. If ip-gateway is specified packet template will assume destination mac address based on resolved ip-gateway.
ip-id (list of integer [0..65535]; Default: )
ip-protocol (list of IP protocols (max 16 times); Default: )
ip-src (list of IP/Mask (max 16 times); Default: )
ip-ttl (list of integer [0..255] (max 16 times); Default: )
mac-dst (list of MAC/MASK (max 16 times); Default: )
mac-protocol (list of mac protocols (max 16 times); Default: )
mac-src (list of MAC/MASK (max 16 times); Default: )
name (string; Default: ) Descriptive name of the template.
port (string; Default: ) Optional parameter of packet template. This suggests a port through which packets generated using this template should be sent out. Port can also be specified in other places such as in stream settings. This is mutually exclusive with interface setting.
raw-header (string (max 16 times); Default: ) Raw packet header as string in hexadecimal format.
udp-dst-port (list of port [0..65535]/mask [0..FFFF] (max 16 times); Default: )
udp-src-port (list of port [0..65535]/mask [0..FFFF] (max 16 times); Default: )
vlan-id (; Default: )
vlan-priority (; Default: )
vlan-protocol (; Default: )
header-stack (list of ip | mac | raw | udp | vlan (max 16 times); Default: ip) Sequence of headers that a generated packet should have.

Currently supports:

  • mac - Ethernet header (14 bytes)
  • vlan - Ethernet VLAN tag (4 bytes)
  • ip - IPv4 header (20 bytes)
  • udp - UDP header (8 bytes)
  • raw - arbitrary bytes specified as hex string


Most header types can be present in header multiple times. There can be only 2 ip headers and 1 udp header per packet. Some limitations are imposed on possible sequences of headers based on our practical experience with network protocols (for example vlan header can follow only a mac header or other vlan header).

Traffic generator suggests first header for a packet template (in port menu). But it is not enforced.

Port Configuration

Sub-menu /tool traffic-generator port


This menu allows to configure ports that will be associated to specific interface and will be used to receive/send generated packets.


Properties

Property Description
disabled (yes | no; Default: no) Whether port is disabled and does not participate in receiving/sending of the packets
name (string; Default: ) Descriptive name of the port
interface (string; Default: ) Name of the interface associated with the port.


Read-Only Properties

Property Description
dynamic (yes | no) Whether port configuration is generated automatically.
first-header (ip | mac | raw | udp | vlan) Shows suggested first header for packets to be sent out of specified interface. This is information can be used when creating packet templates.
inactive (yes | no) Whether port is inactive and can't participate in tx/rx of the packets.

Stats

Sub-menu /tool traffic-generator stats


If traffic generator is not running in quick mode then all statistics about the test is stored in this menu.


Latency Distribution

Sub-menu /tool traffic-generator stats latency-distribution


This sub-menu shows how many packets are received in specific latency range. Latency range can be viewed by streams or by sequences (for example, print stream-num=3, print seq=10)


Here is an example output of the latency graph:

[admin@test-host] /tool traffic-generator stats latency-distribution> print            
 # LATENCY                 COUNT        SHARE GRAPH                                               
 0 0-15.5us                    0           0%
 1 15.5us-31us                 0           0%
 2 31us-46.5us                 0           0%
 3 46.5us-62.1us               0           0%
 4 62.1us-77.6us               0           0%
 5 77.6us-93.1us               0           0%
 6 93.1us-109us                0           0%
 7 109us-124us                 0           0%
 8 124us-140us                 0           0%
 9 140us-155us                 0           0%
10 155us-171us                 0           0%
11 171us-186us                 4           0% *                                                   
12 186us-202us                29           0% *                                                   
13 202us-217us                90       0.001% *                                                   
14 217us-233us               302       0.004% *                                                   
15 233us-248us               630       0.009% *                                                   
16 248us-264us               789       0.011% *                                                   
17 264us-279us             1 384       0.021% -*                                                  
18 279us-295us             1 990        0.03% --*                                                 
19 295us-310us             2 966       0.045% ---*                                                
20 310us-326us             4 089       0.062% -----*                                              
21 326us-341us             4 958       0.075% ------*                                             
22 341us-357us             6 059       0.091% -------*                                            
23 357us-372us             6 660       0.101% --------*                                           
24 372us-388us             8 320       0.126% ----------*                                         
25 388us-403us             9 988       0.151% -------------*                                      
26 403us-419us            11 781       0.178% ---------------*                                    
27 419us-434us            12 512       0.189% ----------------*                                   
28 434us-450us            13 836        0.21% -----------------*                                  
29 450us-465us            15 681       0.238% --------------------*                               
30 465us-481us            17 740       0.269% ----------------------*                             
31 481us-496us            19 913       0.302% --------------------------*                         
32 496us-512us            21 106        0.32% ---------------------------*                        
33 512us-528us            22 848       0.346% -----------------------------*                      
34 528us-543us            25 059        0.38% --------------------------------*                   
35 543us-559us            26 593       0.403% ----------------------------------*                 
36 559us-574us            27 663       0.419% -----------------------------------*                
37 574us-590us            29 351       0.445% -------------------------------------*              
38 590us-605us            31 265       0.474% ----------------------------------------*           
39 605us-621us            33 224       0.504% -------------------------------------------*        
40 621us-636us            34 464       0.523% --------------------------------------------*       
41 636us-652us            35 630        0.54% ----------------------------------------------*     
42 652us-667us            37 245       0.565% ------------------------------------------------*   
43 667us-683us            38 158       0.579% -------------------------------------------------*  
44 683us-698us            38 626       0.586% --------------------------------------------------* 
45 698us-714us            38 985       0.591% --------------------------------------------------* 
46 714us-729us            39 061       0.592% --------------------------------------------------* 
47 729us-745us            39 750       0.603% ---------------------------------------------------*
48 745us-760us            39 145       0.594% --------------------------------------------------* 
49 760us-776us            39 162       0.594% --------------------------------------------------* 
50 776us-791us            38 197       0.579% -------------------------------------------------*  
51 791us-807us            37 811       0.573% -------------------------------------------------*  
52 807us-822us            37 364       0.567% ------------------------------------------------*   
53 822us-838us            36 770       0.558% -----------------------------------------------*    
54 838us-853us            35 831       0.543% ----------------------------------------------*     
55 853us-869us            35 380       0.536% ----------------------------------------------*     
56 869us-884us            34 472       0.523% --------------------------------------------*       
57 884us-900us            33 672       0.511% -------------------------------------------*        
58 900us-915us            33 799       0.513% --------------------------------------------*       
59 915us-931us            32 754       0.497% ------------------------------------------*         
60 931us-946us            32 339        0.49% ------------------------------------------*         
61 946us-962us            32 419       0.492% ------------------------------------------*         
62 962us-977us            32 107       0.487% -----------------------------------------*          
63 977us-993us            31 552       0.478% -----------------------------------------*          
64 0-993us             1 221 523       18.54%


Properties

Property Description
count (integer) Number of packets in current latency range
graph (string) graphical representation of share
latency (string) latency range
share (precent) Percentage of packets falling in this latency range.


Stream Stats

Sub-menu /tool traffic-generator stats stream


This sub-menu stores statistics sorted by streams. Output is the same as in quick mode.

[admin@test-host] /tool traffic-generator stats stream> print 
 # SEQ    NUM     TX-PACKET   TX-RATE     RX-PACKET   RX-RATE   LOST-PACKET LOST-RATE
 0 1      3          43 064 499.5Mbps        25 180 292.0Mbps        17 884 207.4Mbps
 1 1      4          43 062 499.5Mbps        39 946 463.3Mbps         3 116  36.1Mbps
 2 1      TOT        86 126 999.0Mbps        65 126 755.4Mbps        21 000 243.6Mbps
 3 2      3          43 544 505.1Mbps        30 449 353.2Mbps        13 095 151.9Mbps
 4 2      4          43 543 505.0Mbps        42 982 498.5Mbps           561   6.5Mbps
 5 2      TOT        87 087 1010.2...        73 431 851.7Mbps        13 656 158.4Mbps

... 

59 20     TOT        87 277 1012.4...        73 755 855.5Mbps        13 522 156.8Mbps
60 21     3          43 546 505.1Mbps        30 605 355.0Mbps        12 941 150.1Mbps
61 21     4          43 546 505.1Mbps        42 682 495.1Mbps           864  10.0Mbps
62 21     TOT        87 092 1010.2...        73 287 850.1Mbps        13 805 160.1Mbps
63 TOT    3         913 942 504.8Mbps       629 210 347.5Mbps       284 732 157.2Mbps
64 TOT    4         913 939 504.8Mbps       898 374 496.2Mbps        15 565   8.5Mbps
65 TOT    TOT     1 827 881 1009.6...     1 527 584 843.8Mbps       300 297 165.8Mbps

[admin@test-host] /tool traffic-generator stats stre


Port Stats

Sub-menu /tool traffic-generator stats port


This sub-menu stores statistics sorted by rx/tx ports.


[admin@test-host] /tool traffic-generator stats port> print 
 # SEQ    PORT        RX-UNK-PACKET    RX-UNK-BYTE RX-UNK...     TX-PACKET   TX-RATE     RX-PACKET
 0 1      port0:et...             0              0      0bps        43 064 499.5Mbps        39 946
 1 1      port1:et...             0              0      0bps        43 062 499.5Mbps        25 180
 2 1      TOT                     0              0      0bps        86 126 999.0Mbps        65 126
 3 2      port0:et...             0              0      0bps        43 544 505.1Mbps        42 982
 4 2      port1:et...             0              0      0bps        43 543 505.0Mbps        30 449
 5 2      TOT                     0              0      0bps        87 087 1010.2...        73 431
 6 3      port0:et...             0              0      0bps        43 540 505.0Mbps        42 615
 7 3      port1:et...             0              0      0bps        43 540 505.0Mbps        30 191
 8 3      TOT                     0              0      0bps        87 080 1010.1...        72 806


Raw Stats

Sub-menu /tool traffic-generator stats raw


This sub-menu stores raw statistics data.

[admin@test-host] /tool traffic-generator stats raw> print 
 # SEQ    PORT       NUM     TX-PACKET   TX-RATE     RX-PACKET   RX-RATE   LOST-PACKET LOST-RATE
 0 1      port0:e... 3          43 064 499.5Mbps             0      0bps        43 064 499.5Mbps
 1 1      port1:e... 3               0      0bps        25 180 292.0Mbps       -25 180 292.0Mbps
 2 1      TOT        3          43 064 499.5Mbps        25 180 292.0Mbps        17 884 207.4Mbps
 3 1      port0:e... 4               0      0bps        39 946 463.3Mbps       -39 946 463.3Mbps
 4 1      port1:e... 4          43 062 499.5Mbps             0      0bps        43 062 499.5Mbps
 5 1      TOT        4          43 062 499.5Mbps        39 946 463.3Mbps         3 116  36.1Mbps
 6 1      port0:e... TOT        43 064 499.5Mbps        39 946 463.3Mbps         3 118  36.1Mbps
 7 1      port1:e... TOT        43 062 499.5Mbps        25 180 292.0Mbps        17 882 207.4Mbps
 8 2      port0:e... 3          43 544 505.1Mbps             0      0bps        43 544 505.1Mbps
 9 2      port1:e... 3               0      0bps        30 449 353.2Mbps       -30 449 353.2Mbps
10 2      TOT        3          43 544 505.1Mbps        30 449 353.2Mbps        13 095 151.9Mbps

Streams

Properties

Property Description
disabled (yes | no; Default: no) Whether stream is disabled
mbps (integer [0..4294967295]; Default: 0) Value in Mega bits per second that stream will try to generate.
name (string; Default: ) Descriptive name of the stream.
num (integer [0..15]; Default: 0)
packet-size (integer[1..65535] [-integer[1..65535]]; Default: 0) Generated size of the packets in bytes. Can be set as the range for random packet size generation.
port (string; Default: ) Name of the port from Port menu that will be used to transmit packets.
pps (integer [0..4294967295]; Default: 0) Packets per second that stream will try to generate.
tx-template (string; Default: ) Name of the packet template from packet-template or raw-packet-template menus used as the packet content source.

Configuration Examples

IpSec tunnel performance test

Consider following test setup

System Under Test (SUT) consists of two routers connected to traffic generator server. The connection between both SUT routers is IPSec encrypted.

Traffic generator will run two streams:

  • in direction from 1.1.1.0/24 network to 2.2.2.0/24 network
  • in direction from 2.2.2.0/24 network to 1.1.1.0/24 network.


R1 routing and ipsec setup

/ip address
add address=192.168.33.1/30 interface=ether1
add address=1.1.1.2/24 interface=ether2

/ip route 
add dst-address=2.2.2.0/24 gateway=192.168.33.2

/ip ipsec proposal
set default enc-algorithms=aes-128

/ip ipsec peer
add address=192.168.33.2 secret=123

/ip ipsec policy
add sa-src-address=192.168.33.1 sa-dst-address=192.168.33.2 \
    src-address=1.1.1.0/24 dst-address=2.2.2.0/24 tunnel=yes

R2 routing and ipsec setup

/ip address
add address=192.168.33.2/30 interface=ether1
add address=2.2.2.2/24 interface=ether2

/ip route 
add dst-address=1.1.1.0/24 gateway=192.168.33.1

/ip ipsec proposal
set default enc-algorithms=aes-128

/ip ipsec peer
add address=192.168.33.1 secret=123

/ip ipsec policy
add sa-src-address=192.168.33.2 sa-dst-address=192.168.33.1 \
    src-address=2.2.2.0/24 dst-address=1.1.1.0/24 tunnel=yes


Traffic generator server setup

/ip address
add address=1.1.1.1/24 interface=ether2
add address=2.2.2.1/24 interface=ether3


First we will define which ports will be used as traffic generator tx/rx ports

/tool traffic-generator port
add disabled=no interface=ether2 name=port0
add disabled=no interface=ether3 name=port1


To construct actual packet that will be generated, packet-template is used.

/tool traffic-generator packet-template
add header-stack=mac,ip,udp ip-dst=2.2.2.1/32 ip-gateway=1.1.1.2 ip-src=1.1.1.1/32 \
    name=routing-1 port=port0
add header-stack=mac,ip,udp ip-dst=1.1.1.1/25 ip-gateway=2.2.2.2 ip-src=2.2.2.1/32 \
    name=routing-2 port=port1

Notice that mac addresses were not specified since template generator can assume next-hop mac address automatically by sending ARP messages. Since we are doing routing and destination IP is not directly reachable, we have set ip-gateway parameter to determine next-hop mac-address.

When running print you can see all assumed (detected) values including mac addresses.

[admin@test-host] /tool traffic-generator packet-template> print 
 0 name="routing-1" header-stack=mac,ip,udp port=port0 
   assumed-mac-dst=00:0C:42:00:38:9D assumed-mac-src=00:0C:42:40:94:25 
   assumed-mac-protocol=ip assumed-ip-dscp=0 assumed-ip-id=0 
   assumed-ip-frag-off=0 assumed-ip-ttl=64 assumed-ip-protocol=udp 
   ip-src=1.1.1.1/32 ip-dst=2.2.2.1/32 assumed-udp-src-port=100 
   assumed-udp-dst-port=200 ip-gateway=1.1.1.2 data=uninitialized data-byte=0 

 1 name="routing-2" header-stack=mac,ip,udp port=port1 
   assumed-mac-dst=00:0C:42:00:38:D1 assumed-mac-src=00:0C:42:40:94:26 
   assumed-mac-protocol=ip assumed-ip-dscp=0 assumed-ip-id=0 
   assumed-ip-frag-off=0 assumed-ip-ttl=64 assumed-ip-protocol=udp 
   ip-src=2.2.2.1/32 ip-dst=1.1.1.1/32 assumed-udp-src-port=100 
   assumed-udp-dst-port=200 ip-gateway=2.2.2.2 data=uninitialized data-byte=0

For example, if any router in SUT were to change, assumed mac-addresses would not be updated automatically. To update packet templates simply issue command :

/tool traffic-generator packet-template set [find]


Last part is to configure streams

/tool traffic-generator stream
add disabled=no mbps=500 name=str1 id=3 packet-size=1450 port=port0 pps=0 \
    tx-template=routing-1
add disabled=no mbps=500 name=str3 id=4 packet-size=1450 port=port1 pps=0 \
    tx-template=routing-2

Notice that each stream has unique id value. This value identifies stream packets, otherwise traffic generator will not work.


Now we are ready to run the test. In this case quick mode will be used:

[admin@test-host] /tool traffic-generator> quick mbps=450
SEQ    NUM     TX-PACKET   TX-RATE     RX-PACKET   RX-RATE        RX-OOO   LOST-PACKET LOST-RATE 
37     4          39 488 458.0Mbps        39 270 455.5Mbps        15 509           218   2.5Mbps 
37     TOT        78 976 916.1Mbps        76 485 887.2Mbps        22 529         2 491  28.8Mbps 
38     3          38 957 451.9Mbps        37 657 436.8Mbps         7 078         1 300  15.0Mbps 
38     4          38 958 451.9Mbps        38 402 445.4Mbps        14 763           556   6.4Mbps 
38     TOT        77 915 903.8Mbps        76 059 882.2Mbps        21 841         1 856  21.5Mbps 
39     3          38 816 450.2Mbps        37 893 439.5Mbps         7 307           923  10.7Mbps 
39     4          38 815 450.2Mbps        38 642 448.2Mbps        15 110           173   2.0Mbps 
39     TOT        77 631 900.5Mbps        76 535 887.8Mbps        22 417         1 096  12.7Mbps 
40     3          39 779 461.4Mbps        37 415 434.0Mbps         7 136         2 364  27.4Mbps 
40     4          39 780 461.4Mbps        39 567 458.9Mbps        15 908           213   2.4Mbps 
40     TOT        79 559 922.8Mbps        76 982 892.9Mbps        23 044         2 577  29.8Mbps 
41     3          39 218 454.9Mbps        37 089 430.2Mbps         7 075         2 129  24.6Mbps 
41     4          39 218 454.9Mbps        38 663 448.4Mbps        15 752           555   6.4Mbps 
41     TOT        78 436 909.8Mbps        75 752 878.7Mbps        22 827         2 684  31.1Mbps 
42     3          39 188 454.5Mbps        37 906 439.7Mbps         6 729         1 282  14.8Mbps 
42     4          39 187 454.5Mbps        38 954 451.8Mbps        15 565           233   2.7Mbps 
42     TOT        78 375 909.1Mbps        76 860 891.5Mbps        22 294         1 515  17.5Mbps 
TOT    3       1 645 468 454.4Mbps     1 568 201 433.1Mbps       280 174        77 267  21.3Mbps 
TOT    4       1 645 464 454.4Mbps     1 626 896 449.3Mbps       627 480        18 568   5.1Mbps 
TOT    TOT     3 290 932 908.9Mbps     3 195 097 882.4Mbps       907 654        95 835  26.4Mbps

Stats shows throughput of each stream and total throughput of both streams, Out-of-order packet count, Lost rate, latency and jitter.


[ Top | Back to Content ]