And here is my script
Code: Select all
@echo off
REM Script to make a dummy join and leave of a multicast group
REM Executes multicast receive program for 5s and then exits
cd "C:\Program Files (x86)\<your folder for mcreceive>"
set /a min = 100
set /a max = 199
set /a lowip = %RANDOM% * (%max% - %min% + 1) / 32768 + %min%
echo 224.0.0.%lowip%
Start "" /b mcreceive.exe 224.0.0.%lowip% 6000
timeout /T 5 /nobreak >nul
taskkill /IM mcreceive.exe /F
EXIT
You need to put the mcreceive.exe file somewhere and point it out in the script. The problem is that the site that provided the multicast toolbox where mcreceive.exe was part seems to have moved or disappeared. I dont know if I can somehow post my mcreceive.exe file here. But it's just an multicast receiver for testing purposes. Maybe there is a similar program somewhere.
this post was very helpful, but the utility mreceive.exe is almost impossible to get. I have cygwin installed on windows 10,
which I used to install iperf.exe
I converted the cmd script into a bash script equivalent, I run the shell script in a cygwin terminal
you can use notepad and name the file mcast.sh into
open terminal
chmod +x mcast.sh
then
execute
./mcast.sh
I've had to do it execute ./mcast.sh multiple times
there is also a standalone iperf3 you can google and download, I didn't test that as it comes with a .dll file also
and that dll version would conflict with my cygwin version i already have installed
mreceive to iperf command argument comparison, i've added 30sec the other options i've found in google searches
the iperf with %lowip% is what you'd use if you tried to run iperf from a windows .cmd script from "pen" original post
if you are not familiar with cygwin, and linux paths/scripts in a windows environment
then going that route maybe your better option.
Code: Select all
mcreceive.exe 224.0.0.%lowip% 6000
vs
iperf -c 224.0.0.%lowip% -p 6000 -u -T 32 -t 30 -i 1
Code: Select all
#!/bin/bash
RANDOM=$$
min=100
max=199
DIFF=$((max-min+1))
R=$(($(($RANDOM%$DIFF))+min))
echo "ip= 224.0.0.${R}"
iperf -c 224.0.0.${R} -p 6000 -u -T 32 -t 30 -i 1