[openib-general] mapping between IP address and device name
Roland Dreier
roland at topspin.com
Mon Jun 20 20:40:47 PDT 2005
Kevin> Maybe somebody could help me understand the proper way to
Kevin> map between an IP address assigned to a port to the "device
Kevin> name" and "port number" in the gen2 architecture. If I
Kevin> have an IP address can I map it to a name that i get back
Kevin> from ibv_get_device_name() or pass to ibv_open_device().
I think the question you have posed is not really the one you want to
answer. After all, even in a world without IB, there is no way to map
a local IP address uniquely to a network interface or ethernet port --
it is perfectly valid to have a host with multiple ethernet
interfaces, all of which have been configured with the same IP address.
It _is_ valid to ask, for a given remote IP address, which network
interface will be used to reach it based on the local host's routing
configuration.
In the IB world, we can hope that the network interface chosen by the
route table is an IPoIB device. From the IPoIB device, we can work
backwards to get a local IB port. For example the network device's
hardware address contains the associated port GID, and by searching
the GID tables of all the known IB devices, we can find which port has
that GID.
There was some discussion a while ago about an "IB address
translation" service proposed by the Voltaire crew, which would
encapsulate some of this. However, we didn't make much progress
towards a good API design, and the discussion fizzled out.
- R.
More information about the general
mailing list