swxtch-perf

Prev Next

Overview

To simulate traffic movement throughout the cloudswxtch overlay network you can use swxtch-perf to create producer and consumers on machines with the xNIC installed.

swxtch-perf producer has multiple parameters that can be configured to generate different traffic flows. There can be multiple instances of swxtch-perf generating traffic on a single machine.

swxtch-perf producer --sendto <MC_ADDRESS:DEST_PORT> --nic <NETWORK_INTERFACE>

swxtch-perf consumer will pick up the traffic generated by the producer(s) in the network.

swxtch-perf consumer --recvfrom <MC_ADDRESS:DEST_PORT> --nic <NETWORK_INTERFACE>
NOTE

<MC_ADDRESS> = Multicast Address
<DEST_PORT> = Destination Port
<NETWORK_INTERFACE> = Network Interface where xNIC conncted to. The network interface does not have to be specified in xNic V1, but must be specified in xNic V2. (See xNIC Linux Installation for V1 and V2 differences.

swxtch-perf

For a quick view at the functionality and usage of swxtch-perf use -h or -help.

swxtch-perf -h
Usage: swxtch-perf [options] command

Positional arguments:
command                 [producer|consumer] suported commands

Optional arguments:
-h --help               shows help message and exits [default: false]
-v --version            prints version information and exits [default: false]
--nic                   name of NIC to use this is Mandatory for swxtch-perf to work.
--recvfrom              IP:Port The IP and Port where packets come from [default: "239.5.69.2:10000"]
--sendto                IP:Port The IP and Port where packets are sent to [default: "239.5.69.2:10000"]
  --ssm_include           (consumer command only) List of SSM addresses to include (i.e. 192.168.2.1 193.168.2.4) [nargs: 1 or more]
  --ssm_exclude           (consumer command only) List of SSM addresses to exclude (i.e. 192.168.2.1 193.168.2.4) [nargs: 1 or more]
--payload_length        (producer command only) number of bytes for the multicast udp payload [default: 100]
--total_pkts            Total packets to send/receive. To run without this limit use 0 [default: 0]
--pps                   (producer command only) packet-rate or packet per seconds [default: 1]
--seconds               Number of seconds to run the application. To run without this limit use 0 [default: 0]
--loopback              Receives packets from --recvfrom and sends packets to --sendto [default: false]
--generic               (consumer command only) to consume generic packets [default: false]
--latency               Enables timestamp propagation and measurement of latency [default: false]
--broadcast             Enables broadcast packets in NIC, this overrides IP argument [default: false]
--generic-broadcast     Sends broadcast packets to 255.255.255.255, valid only with --broadcast argument [default: false]
--broadcast-port        Port for broadcast traffic, valid only with --broadcast argument [default: 10000]
--rtt-latency           Enables timestamp propagation and measurement of RTT/2 where RTT = round trip time [default: false]
--one-way-latency       Enables timestamp propagation and measurement of one way latency [default: false]
--latency-buckets       Enables histogram of latency. Use with --latency [default: false]
--dbg                   Enables more information in the logs [default: false]
--show-full-packet-bps  Shows the bps with all headers included

Parameters

Argument Description Default Value Valid Range Machine Type Operating System
h Shows commands that are available. All
v Shows version. Both All
nic Specify which network interface xNIC will listen to this command is Mandatory. -- Both All
recvfrom Specify the multicast group and port to listen for packets IPv4 addresses are valid; Ports: 1024 <= x <= 65535. Mandatory for Consumer Mode and Multicast. Consumer All
sendto Specify the multicast group and port to send packets, mandatory for producer if using multicast. All IPv4 addresses are valid; Ports: 1024 <= x <= 65535 Mandatory for Producer Mode and Multicast. Producer All
ssm_include List of SSM addresses to include (i.e. 192.168.2.1 193.168.2.4) 1 or more Consumer All
ssm_exclude List of SSM addresses to exclude (i.e. 192.168.2.1 193.168.2.4) 1 or more Consumer All
payload_length Number of bytes per packet. 100 8 and 65475 Producer All
total_pkts Number packets to receive or send before exiting iperf. 0 8 and 3750 Producer Windows
pps packet-rate or packets per second. 1 100000 Producer All
seconds Number of seconds to run the application, use 0 to run without a limit. 0 Both Windows
loopback Receives packets from recvfrom and sends packets to sendto. false true:false Both All
generic Consume generic packets. false true:false Consumer All
latency Enables timstamp propagation and measurement of latency. false true:false Both Linux
broadcast Sets swxtch-perf to use normal broadcast mode, when sending it will use the IP of the --nic argument. false true:false Both All
generic-broadcast Sets iperf to use broadcast mode using the IP of 255.255.255.255. false true:false Both All
broadcast-port Sets port to be used for broadcast, and is only valid with --broadcast and --generic-broadcast arguement and is Mandatory for --broadcast --generic-broadcast . Ports: 1024 <= x <= 65535 Both All
rtt-latency Enables timestamp propagation and measurement of RTT/2 where RTT = round trip time false Windows
one-way-latency Enables timestamp propagation and measure of one way latency false Windows
latency-buckets Enables histogram of latency. Use with --latency false Windows
dbg Enables more information in the logs false All
show-full-packet-bps Shows the bps with all headers included Both All

Multicast - Example

These examples can be run from one machine or across multiple machines. Parameters for NIC names assume default installation options.

EXAMPLE

Single Producer, Single Consumer, and one multicast group

Run this command on a VM to create a multicast group on the address 230.1.1.1 and port 3490:

Linux:
swxtch-perf producer --sendto 239.1.1.1:3490 --pps 1000 --nic swxtch-tun0
Windows:
swxtch-perf producer --sendto 239.1.1.1:3490 --pps 1000 --nic swxtch-tun

Example with results:

swxtch-perf producer --sendto 239.1.1.1:3490 --pps 1000 --nic swxtch-tun0
Trying to reach a packet-rate of 1000 pps
swxtch-perf producer threads started...  Ctrl+C to exit.
|-------------------------------------|-------------------------------|
|                 TOTALS              |         THIS PERIOD           |
|    TX PKTS    | TX BYTES | TX DROPS |  TX-PPS  |  TX-bps  | TX-DPS  |
|---------------|----------|----------|----------|----------|---------|
|         1,283 |    128KB |        0 |    1.28K |  1.0Mbps |       0 |
|         2,274 |    227KB |        0 |      991 |  792Kbps |       0 |
|         3,267 |    326KB |        0 |      993 |  794Kbps |       0 |
|         4,262 |    426KB |        0 |      995 |  796Kbps |       0 |

Run this command on one of the VMs to listen to traffic on the Multicast Address 230.1.1.1 port 13490 :

Linux:
swxtch-perf consumer --recvfrom 239.1.1.1:3490 --nic swxtch-tun0
Windows:
swxtch-perf consumer --recvfrom 239.1.1.1:3490 --nic swxtch-tun

Example with results:


testadmin@DSd-agent-102:~$ swxtch-perf consumer --recvfrom 239.1.1.1:3490 --nic swxtch-tun0
swxtch-perf consumer threads started...  Ctrl+C to exit.
|-------------------------------------|-------------------------------|
|                 TOTALS              |         THIS PERIOD           |
|    RX PKTS    | RX BYTES | RX DROPS |  RX-PPS  |  RX-bps  | RX-DPS  |
|---------------|----------|----------|----------|----------|---------|
|             0 |       0B |        0 |        0 |     0bps |       0 |
|             0 |       0B |        0 |        0 |     0bps |       0 |
|             0 |       0B |        0 |        0 |     0bps |       0 |
|           330 |  33.00KB |        0 |      330 |  264Kbps |       0 |
|         1,326 |    132KB |        0 |      996 |  796Kbps |       0 |
|         2,328 |    232KB |        0 |    1.00K |  801Kbps |       0 |
|         3,330 |    333KB |        0 |    1.00K |  801Kbps |       0 |
|         4,332 |    433KB |        0 |    1.00K |  801Kbps |       0 |
|         5,328 |    532KB |        0 |      996 |  796Kbps |       0 |
|         6,330 |    633KB |        0 |    1.00K |  801Kbps |       0 |

  • To add more consumers you simply run the same swxtch-perf command on new VMs.

Broadcast - Example

These examples can be run from one machine or across multiple machines. Parameters for NIC names assume default installation options.

EXAMPLE

Single Producer, Single Consumer, and broadcast

Run this command on a VM to create a broadcast

Linux:
swxtch-perf producer --broadcast --nic eth1 --pps 1000 --broadcast-port 1234
Windows:
swxtch-perf producer --broadcast --nic 'Ethernet 2' --pps 1000 --broadcast-port 1234

Example with results:

PS C:\Users\testadmin> swxtch-perf producer --broadcast --nic 'Ethernet 2' --pps 1000 --broadcast-port 1234
Config:
        Sending traffic to  broadcast address.
        Ip Address: 10.2.195.255
        Port      : 10000
        Interface IP Address: 45
        Running without a total packet counter limit
        Running the application without a timing limit
Sent 972 total packets, throughput: 890.383 pkts/sec
Sent 2047 total packets, throughput: 993.128 pkts/sec
Sent 3123 total packets, throughput: 991.82 pkts/sec
Sent 4198 total packets, throughput: 990.419 pkts/sec

Run this command on one of the VMs to listen for broadcast

Linux:
swxtch-perf consumer --broadcast --nic eth1--pps 1000
Windows:
swxtch-perf consumer --broadcast --nic 'Ethernet 3' --pps 1000