UDP组播测试

支持组播的接口:

ip a | grep MULTICAST

环回接口虽然显示不支持组播,实际也可以用于本地测试。

添加路由(非必须?):

ip route add 239.0.0.0/24 via 10.10.10.206 dev eth0

开放防火墙:

查询:

firewall-cmd --query-port=2223/udp

添加:

firewall-cmd --permanent --add-port=2223/udp

firewall-cmd --reload

删除:

firewall-cmd --permanent --remove-port=2223/udp

或者开放iptables:

iptables -I INPUT -s ${bond} -p udp -m multiport --dport 18888 -j ACCEPT

查询已有的组播分组:

netstat -gn

ping -b 224.0.0.1

ss -u -a -n -l | grep MULTICAST

socat手册:

socat

组播绑定和接收、发送都不需要root权限。

socat接收组播:

socat -u udp-recv:2223,ip-add-membership=239.0.1.1:0.0.0.0 -

socat -u udp-recv:2223,ip-add-membership=239.0.1.1:127.0.0.1

socat发送组播:

echo "This is a multicast test" | socat STDIO udp-sendto:239.0.1.1:2223,ip-multicast-if=0.0.0.0

echo "This is a multicast test" | socat STDIO udp-sendto:239.0.1.1:2223,ip-multicast-if=127.0.0.1

echo "This is a multicast test" | socat STDIO udp-sendto:239.0.1.1:2223,broadcast,ip-multicast-if=0.0.0.0

echo "This is a multicast test" | socat STDIO udp-sendto:239.0.1.1:2223,broadcast,ip-multicast-if=127.0.0.1

组播压测:

iperf -u -c 224.0.0.1 -p 1234 -b 1M

局域网环境下的MTU:

UDP的数据长度控制在1472个字节以内?

相关推荐
Jony_2 天前
高可用移动网络连接
网络协议
chilix2 天前
Linux 跨网段路由转发配置
网络协议
DianSan_ERP4 天前
电商API接口全链路监控:构建坚不可摧的线上运维防线
大数据·运维·网络·人工智能·git·servlet
呉師傅4 天前
火狐浏览器报错配置文件缺失如何解决#操作技巧#
运维·网络·windows·电脑
gihigo19984 天前
基于TCP协议实现视频采集与通信
网络协议·tcp/ip·音视频
2501_946205524 天前
晶圆机器人双臂怎么选型?适配2-12寸晶圆的末端效应器有哪些?
服务器·网络·机器人
linux kernel4 天前
第七部分:高级IO
服务器·网络
数字护盾(和中)4 天前
BAS+ATT&CK:企业主动防御的黄金组合
服务器·网络·数据库
~远在太平洋~4 天前
Debian系统如何删除多余的kernel
linux·网络·debian
unfeeling_4 天前
Keepalived实验
linux·服务器·网络