>Hang on - no networking API has a notion of hosts _or_ interfaces. They
>have a notion of IP numbers, surely?
Yes, but the IP number is 1-1 with some particular interface.
>However, it seems the only query to obtain all of a host's API addresses
is
>to first obtain your own host name with either
>
> InetAddress.getLocalHost()
>or
> InetAddress.getByName(null)
>
>and then use that name in
>
> InetAddress.getAllByName(hostname)
>
>This is all perfectly sensible *if* a given host only has one hostname.
Is
>this true? Can a host associate different hostnames with different
>interfaces? If it does, should getAllByName() return only the IP
addresses
>associated with this hostname, or all the addresses associated with the
>host that has this name?
From the *outside*, a host may have multiple names, and these names may map to distinct IP addresses. This is exactly the situation in which a server may wish to say "bind port 80, but only on IP x.y.z".
> If port numbers are being remapped as well, how can the Vat and
> VLS cooperate to figure out a port number by which others can contact the
> Vat's listen port?
They cannot. In general, under these conditions, the port number used by an outside connection must be different from the port number used by an internal connection. In practice, remapping of port numbers is rare, and is used for protocols like FTP that build a back connection.
>It seems to me that if A is currently talking to B and wants to be able
>to talk to B again in the future, then it is up to B to tell A how to do
>that... (e.g. "use domain name X" or "connect to port Y on IP Z")
In the face of proxies and firewalls, this is simply not in general possible. Preventing this is, to some degree, the whole *point* of a firewall.
shap