iperf非常适合此操作,并且可以在大多数Linux发行版和Windows中使用。
在侦听器方面:
% iperf -s -u -B 224.1.1.1 -i 1
------------------------------------------------------------
Server listening on UDP port 5001
Binding to local address 224.1.1.1
Joining multicast group 224.1.1.1
Receiving 1470 byte datagrams
UDP buffer size: 110 KByte (default)
------------------------------------------------------------
...,它将等待来自消息源的消息。在源上,开始发送:
% iperf -c 224.1.1.1 -u -T 32 -t 3 -i 1
------------------------------------------------------------
Client connecting to 224.1.1.1, UDP port 5001
Sending 1470 byte datagrams
Setting multicast TTL to 32
UDP buffer size: 110 KByte (default)
------------------------------------------------------------
[ 3] local 192.168.220.20 port 59347 connected with 224.1.1.1 port 5001
[ ID] Interval Transfer Bandwidth
[ 3] 0.0- 1.0 sec 129 KBytes 1.06 Mbits/sec
[ 3] 1.0- 2.0 sec 128 KBytes 1.05 Mbits/sec
[ 3] 2.0- 3.0 sec 128 KBytes 1.05 Mbits/sec
[ 3] 0.0- 3.0 sec 386 KBytes 1.05 Mbits/sec
[ 3] Sent 269 datagrams
同时,您将看到侦听器收到流量:
...
[ 3] local 224.1.1.1 port 5001 connected with 192.168.220.20 port 59347
[ ID] Interval Transfer Bandwidth Jitter Lost/Total Datagrams
[ 3] 0.0- 1.0 sec 128 KBytes 1.05 Mbits/sec 0.035 ms 0/ 89 (0%)
[ 3] 1.0- 2.0 sec 128 KBytes 1.05 Mbits/sec 0.015 ms 0/ 89 (0%)
[ 3] 2.0- 3.0 sec 128 KBytes 1.05 Mbits/sec 0.025 ms 0/ 89 (0%)
[ 3] 0.0- 3.0 sec 386 KBytes 1.05 Mbits/sec 0.068 ms 0/ 269 (0%)
通过-T 32
在发送方上指定选项,可以将TTL设置为32,这将确保可以路由通信(假设IGMP,PIM和路由器上的notnot正确配置)
顺便说一句,上一次我在这种情况下尝试使用VLC时,遇到了一个问题,其中VLC会忽略TTL设置,并且始终以TTL设置为1传输数据包。请阅读错误报告以获取解决方法。