单播响应多播?
这可能是一个愚蠢的问题(但我是多播新手)。我有一个进程生成两个线程——一个用于侦听多播 IP (listener
),另一个用于向其广播 (speaker
)。我计划介绍其中许多流程。
我的问题是,如果侦听器收到多播数据包,它是否可以在不打开新的单播样式套接字的情况下向发送该数据包的进程的 speaker
发送单播响应?
编辑:至少,我可以提取扬声器的多播数据包的 IP 地址并连接到进程可能正在侦听的某个单播类型端口,对吧?
This may be a silly question (but I'm new to multicast). I have a process that spawns two threads -- one for listening to a multicast IP (listener
) and one for broadcasting to it (speaker
). I'm planning on introducing many of these processes.
My question is, if a listener
receives a multicast packet, can it send a unicast response to whichever process' speaker
sent it without opening a new unicast-style socket?
EDIT: at the very least, I can pull the IP address of the speaker
's multicast packet and connect to some unicast-style port that process may be listening on, right?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
多播数据包(实际上任何IP数据包)都有源IP和目标IP,多播中唯一的区别是目标地址是组而不是计算机,从224.0.xx开始
源始终是发送者的真实 IP(除非它位于 NAT 之后,在这种情况下它将是网关的 IP 地址)。
这意味着您可以提取发送者的 IP,并且 IF 该发送者有一个服务器(==侦听)套接字,并且所有网络配置(转发表和防火墙)都允许访问该套接字,您将能够与其启动 TCP 会话...
Multicast packets (actually any IP packets) have source and destination IP, the only difference in multicast is that destination addresses are of groups and not computers , starting with 224.0.x.x.
The source is always the real IP of the sender (unless it's behind NAT, in this case it will be the gateway's IP address).
This means that you can extract the IP of the sender, and IF this sender has a server (==listening) socket, and all network configurations (Forwarding table & Firewall) allow access to that socket, you will be able to initiate a TCP Session with it...