IPv6 区域解析

发布于 2024-07-30 01:09:12 字数 728 浏览 5 评论 0原文

首先,我对 IPv6 的细节还不熟悉,所以如果这只是对 IPv6 路由的误解,我不会感到惊讶。 考虑一下我正在运行 P2P 覆盖网络的情况,其中一部分位于单个 LAN 的边界内。 该 LAN 内的节点具有以下链接本地地址(如其自身所查看):

  • Peer 1 fe80::225:4bff:fea8:e200%en0
  • Peer 2 fe80: :225:4bff:fea8:e201%eth1
  • Peer 3 fe80::225:4bff:fea8:e202%en1

现在,假设每个对等点都能够通过某种方式发现其他对等点,并且拥有互相的地址。 每个对等点都在侦听一个端口,例如 12345。如果对等点 1 想与对等点 2 通信,他们可能会尝试使用 URI:

tcp://[fe80:225:4bff:fea8:e201%eth1]:12345

这是我遇到问题的地方。 对等点 1 没有名为“eth1”的适配器,因此它不知道该 IPv6 区域标识符。 如果从地址中删除区域 ID,则对等体 1 无法确定必须使用哪个适配器来联系主机。

那么问题来了:是否可以以标准方式解析 IPv6 地址的区域标识符? 如果没有,我是否必须向系统查询所有区域标识符,并尝试依次使用每个区域标识符连接到该地址,直到成功为止? 或者尝试使用链接本地地址进行通信从一开始就是一个愚蠢的想法?

Firstly, I'm new to the specifics of IPv6 so I wouldn't be surprised if this is just a mis-understanding of IPv6 routing. Consider the situation where I am running a P2P overlay network , part of which lives within the boundaries of a single LAN. The nodes within this LAN have the following link local addresses (as viewed by themselves):

  • Peer 1 fe80::225:4bff:fea8:e200%en0
  • Peer 2 fe80::225:4bff:fea8:e201%eth1
  • Peer 3 fe80::225:4bff:fea8:e202%en1

Now, assume each peer has been able to discover the others through some means, and have the addresses for each other. Each peer is listening on a port, say 12345. If peer 1 wanted to talk to peer 2, they might try and use the URI:

tcp://[fe80:225:4bff:fea8:e201%eth1]:12345

This is where I run into problems. Peer 1 does not have an adapter named "eth1", and so this IPv6 zone identifier is not known to it. If the zone ID is stripped off of the address, peer 1 cannot determine which of it's adapters it must use to contact the host.

So, the question: is it possible to resolve the zone identifier for an IPv6 address in a standard way? If not, do I have to query the system for all of the zone identifiers, and try connecting to the address using each zone identifier in turn until I get success? Or is attempting to communicate using link-local addresses a stupid idea in the first place?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

温馨耳语 2024-08-06 01:09:12

链接本地地址仅当您有某种机制可以自动定位有问题的其他节点,并连接、绑定到正确的接口。

如果您希望用户手动输入地址,则应使用 site-本地地址(或者更好的是,唯一本地地址)并拥有用户自行配置它们,或者在链路本地地址之上使用地址解析方法,例如 mDNS。

Link local addresses are only appropriate when you have some mechanism to automatically locate the other node in question, and connect, binding to the correct interface.

If you expect the user to be manually entering addresses, you should use site-local addresses (or better yet, Unique Local Addresses) and have the user configure them themselves, or have an address resolution method on top of link-local addresses, such as mDNS.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文