Testing Traffic¶
WHAT TO EXPECT
In this article, users will learn how to test simple multicast traffic production and consumption with the provided tools.
Provided Tools¶
groundSwXtch provides swx-tools, a set of tools to test simple multicast traffic production and consumption. The tools run in a Docker container.
swx-tools can be installed on the groundSwXtch host or on any other machine with the installer script (see Installing groundSwXtch):
This installs the tools as a Docker container named swx-tools. If Docker is not installed, the installer tries to install it, unless --skip-docker-install is given. To install Docker manually, see How to Install Docker on RHEL and Ubuntu.
Running swx-perf¶
swx-perf has two roles: a producer that sends multicast traffic and a consumer that receives it. Run them through docker exec:
sudo docker exec swx-tools swx-perf producer --nic swx0-lan --sendto 239.1.1.1:5555 --pps 1000 --seconds 30
sudo docker exec swx-tools swx-perf consumer --nic swx0-lan --recvfrom 239.1.1.1:5555 --seconds 30 --json-report
The key flags:
--nic— the interface to send on or receive from (see the note below on which one to use).--sendto/--recvfrom— the multicast group and port (group:port).--pps— packets per second for the producer.--seconds— how long the run lasts. Always set this so the producer and the consumer stop on their own.--json-report— prints a structured packet and loss summary at the end of the run.
To run swx-perf from an interactive bash shell inside the container:
Choosing the Network Interface¶
The most common cause of a "0 packets" result is the wrong --nic. At the end of the swx-tools install, the installer prints interface hints; on a VM that also runs groundSwXtch, follow the note below.
PLEASE NOTE
If the user is running the tools in a VM that's also running groundSwXtch, the network interface must be the virtual interface swx0-lan (gswx-lan on earlier builds). Only when generating traffic from a separate machine should the physical NIC (for example, enp0s5) be used.
Changing the LAN device between a virtual and a physical interface flushes the multicast subscriptions — they must be re-added afterward.
NOTES
- Ports must be 1024 or higher. Avoid 5000 and 6000 (reserved by SPP) and 9999 (reserved by the swXtch ecosystem); 5555 is a safe choice.
- A
docker execstarted without-itdoes not forwardCtrl+Cto swx-perf inside the container, so the producer keeps running as an orphan. Always bound the run with--seconds, or usedocker exec -it. To stop a stray producer:sudo docker exec swx-tools pkill -INT -f swx-perf.