ipoib:检查具有给定 iboip 的 infiniband 节点是否可达
我需要检查对于给定的 ipoib IP 地址,关联的 IB 节点是否已连接到 infiniband 交换机。
这个想法是获取 IP 数据包发送到的 IB 端口的 guid,并使用 ibnodes 等命令检查该端口是否已连接/可达。
有人知道如何在用户空间 C 或命令行上实现这一点吗?我特别有兴趣将 IP 解析为 guid。
谢谢
I need to check if for an given ipoib IP address the associated IB node is connected to the infiniband switch.
The idea is to get the guid of the IB port to which the IP packets are send and check with a command like ibnodes if the port is connected/reachable.
Anybody have an idea how to realize this in userspace C or on the cmdline? Specially I'm interested to resolve the IP to an guid.
thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这里的答案有点棘手,恐怕你想做的事情实际上是不可能的。但我不确定你到底想做什么,所以让我解释一下可以做什么。
IPoIB 将 IP 地址解析为 GID 的方式是通过 ARP——以太网使用广播进行 ARP,而 IPoIB 使用 InfiniBand 多播,但在这两种情况下,ARP 请求都会发送到 IP 子网中的所有节点。地址的实际所有者使用其链路级地址进行响应,在 IPoIB 的情况下,该地址是 QP 编号(您不关心这一点)和 GID。
例如,在可以通过 IPoIB 到达 192.168.1.3 的系统上,
ip neigh
命令显示:其中该 lladdr 的最后 16 个字节是 GID;在配置了 192.168.1.3 的远程系统上,您可以看到 GID:
我认为这对您没有帮助的原因是,如果 IP 地址不可访问,则 ARP 将无法解析该地址,所以你将无法获得 GID 来检查。从某种意义上说,你的问题并不是很恰当,因为IP地址与IB端口没有固定的关联——你可以在任何IPoIB接口上放置你想要的任何IP地址,并随时更改它。
The answer here is a bit tricky, and I'm afraid that what you want to do is not really possible. But I'm not sure exactly what you really want to do, so let me explain what can be done.
The way that IPoIB resolves IP addresses to GIDs is via ARP -- Ethernet uses broadcast for ARP, while IPoIB uses InfiniBand multicast, but in both cases the ARP request is sent to all nodes in the IP subnet. The actual owner of the address responds with its link-level address, which in the case of IPoIB is the QP number (you don't care about that) and the GID.
For example, on a system that can reach 192.168.1.3 over IPoIB, the
ip neigh
command shows:where the last 16 bytes of that lladdr are the GID; on the remote system that is configured with 192.168.1.3, you can see the GID:
The reason I don't think this helps you is that if the IP address is not reachable then the ARP won't be able to resolve the address, and so you won't be able to get a GID to check. In a sense your question is not really well-posed, because there is no fixed association of IP address to IB port -- you could put any IP address you want on any IPoIB interface, and change it at any time.