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

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

问题描述

我应该如何选择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.

  • 数据包将完全包含在一个管理域中,可能是一个局域网
  • 如果同一网络上正在使用我的应用程序的几个独立实例,则每个实例都可以使用自己的多播地址-但是,如果不这样做,则无论如何它们都可以共存,它们的数量很少忽略彼此的数据包的开销.
  • 我的数据包已经包含一个幻数",以避免出现问题
  • 我将检查发起者的地址(我当然知道这是被欺骗的),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天全站免登陆