如何为我的应用程序选择多播地址? [英] How do I choose a multicast address for my application's use?

查看:10
本文介绍了如何为我的应用程序选择多播地址?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我应该如何选择 IPv4 多播地址供我的应用程序使用?我可能需要不止一个(最终可能需要整个范围),但只是想避免与其他应用程序发生冲突.

How should I choose an IPv4 multicast address for my application's use? I may need more than one (a whole range perhaps ultimately) but just want to avoid conflicts with other applications.

  • 数据包将完全包含在一个管理域中,可能是一个 LAN
  • 如果我的应用程序的多个独立实例在同一个网络上使用,它们可以各自使用自己的多播地址 - 但如果不这样做,它们无论如何都可以共存,它们只会有少量忽略彼此的数据包的开销.
  • 我的数据包已经包含一个幻数"以避免出现问题
  • 我将检查发起方地址(我知道当然可以被欺骗)、TTL 和其他内容,以防止意外的数据包搞砸.

请出主意:)

目前我刚刚从本地使用"空间中分配了一个任意一个,239.255.42.99

Currently I've just allocated an arbitrary one from the "local use" space, 239.255.42.99

推荐答案

看来你已经找到了 http://www.iana.org/assignments/multicast-addresses,所以从 239.255/16 中选择一个地址是正确的做法代码>范围.

It seems you've already found http://www.iana.org/assignments/multicast-addresses, so you've done the right thing by picking an address from the 239.255/16 range.

由于这些范围完全供站点本地使用,您选择哪个特定地址与其他人无关,但您可能需要与网络管理员协调(假设不是您)来选择一个备用地址池.

As those ranges are entirely for site-local use it's no ones else's business which particular address you pick, but you may need to coordinate with the network manager (assuming that's not you) to pick an alternate address pool.

正如其他人所建议的那样,只要确保有一种简单的方法可以更改地址,以防它与本地 LAN 上的另一个地址发生冲突.

As others have suggested, just make sure there's an easy way to change the address just in case it does conflict with another address on the local LAN.

如果多个应用程序问题成为问题,请提供一个(本地)众所周知的多播地址,应用程序可以与之通信,该地址将发布唯一的本地范围 IP 地址供客户端使用.

If the multiple applications issue becomes a problem, provide a (locally) well-known multicast address which the applications can talk to which will issue unique local-scope IP addresses for clients' use.

这篇关于如何为我的应用程序选择多播地址?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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