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

相关推荐
AORO20256 小时前
卫星电话收费标准:每月10元起!
网络·5g·安全·智能手机·信息与通信
小小小糖果人7 小时前
Linux云计算基础篇(27)-NFS网络文件系统
linux·网络·云计算
本贾尼8 小时前
Linux系统下的终端,会话,shell,bash,进程组这几个概念的关系。
linux·服务器·网络·ubuntu·bash
虎头金猫8 小时前
我的远程开发革命:从环境配置噩梦到一键共享的蜕变
网络·python·网络协议·tcp/ip·beautifulsoup·负载均衡·pandas
渡我白衣8 小时前
网络层IP协议详解:互联网的灵魂所在
网络协议·tcp/ip·信号处理
zx_zx_1238 小时前
传输层协议 UDP
网络·网络协议·udp
马拉萨的春天16 小时前
RTC、UDP、TCP和HTTP以及直播等区别
tcp/ip·udp·实时音视频
asdfg125896318 小时前
如何判断一个地址是否可以用作主机 IP 地址?
服务器·网络·tcp/ip
爱吃甜品的糯米团子18 小时前
Linux 学习笔记之进程管理、网络基础与常用软件安装
linux·网络·学习
迷枫71219 小时前
19.1 TCP 和 UDP 有什么区别?
网络·tcp/ip·udp