列出多播套接字 [英] listing multicast sockets

查看:67
本文介绍了列出多播套接字的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图列出Linux系统上所有打开的多播套接字?netstat -g列出虽然加入的组.为此,我还可以使用其他实用程序吗?

I am trying to list all opened multicast sockets on a linux system? netstat -g lists the groups joined though. Is there any other utility that I can use for this sake?

非常感谢您的帮助.

推荐答案

除了 netstat -g 之外,您还可以使用它来查看绑定到多播地址的所有套接字:

In addition to netstat -g you can use this to see all sockets which are bound to a multicast address:

netstat -anu|sort -nk4

这是所有UDP套接字的列表(无论是否多播).查找范围为224.0.0.0到239.255.255.255的所有地址.这些套接字绑定到多播地址,无论它们是否加入多播组.这些将接收该多播组的流量.

This is a list of all UDP sockets (whether multicast or not). Look for all addresses in the range 224.0.0.0 to 239.255.255.255. These are sockets bound to multicast addresses, regardless whether they joined the multicast group or not. These will only receive traffic for this multicast group.

但是:

实际上,用于接收多播流量的UDP套接字通常绑定到地址0.0.0.0.它们可以接收所有单播和多播地址的UDP数据包,并且服务器通常会基于源IP地址进行一些其他过滤.

In practice UDP sockets which are used to receive multicast traffic are usually bound to address 0.0.0.0. These can receive UDP packets for all unicast and multicast addresses, and the server usually does some additional filtering based on the source-IP-address.

因此,在上面的列表中,您可能还希望查看绑定到0.0.0.0的UDP套接字,例如0.0.0.0:5353,这很可能是mDNS(avahi,zeroconf)服务器.

So in that list above you may want to look also at UDP sockets bound to 0.0.0.0, for example 0.0.0.0:5353 which is most likely the mDNS (ava zeroconf) server.

这篇关于列出多播套接字的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆