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个字节以内?

相关推荐
JoySSLLian12 分钟前
手把手教你安装免费SSL证书(附宝塔/Nginx/Apache配置教程)
网络·人工智能·网络协议·tcp/ip·nginx·apache·ssl
Zach_yuan18 分钟前
自定义协议:实现网络计算器
linux·服务器·开发语言·网络
猫头虎42 分钟前
如何解决 OpenClaw “Pairing required” 报错:两种官方解决方案详解
网络·windows·网络协议·macos·智能路由器·pip·scipy
charlotte102410241 小时前
高并发:关于在等待学校教务系统选课时的碎碎念
java·运维·网络
Zaralike2 小时前
Linux 服务器网络不通排查 SOP(标准操作流程)
linux·服务器·网络
云姜.2 小时前
网络协议----OSI七层网络协议 和 TCP/IP四层(五层)网络协议
网络·网络协议
!chen2 小时前
LabVIEW TCP Server端工具TCP通信
网络·tcp/ip·labview
枷锁—sha3 小时前
【SRC】SQL注入快速判定与应对策略(一)
网络·数据库·sql·安全·网络安全·系统安全
郝学胜-神的一滴3 小时前
深入解析C/S模型下的TCP通信流程:从握手到挥手的技术之旅
linux·服务器·c语言·网络·网络协议·tcp/ip
池央3 小时前
CANN 算子诊断与故障定位:oam-tools 在异构计算错误解析中的作用
网络