Re: IP Addressing Problems: on my laptop Mark S. Miller (markm@erights.org)
Tue, 12 Jan 1999 11:52:42 -0800

At 11:11 AM 1/12/99 , Ben Laurie wrote:
>Hang on - no networking API has a notion of hosts _or_ interfaces. They
>have a notion of IP numbers, surely?

[+] In light of more recent mail message, I was confused when I wrote this.

I assumed that each interface was a separate TCP/IP socket world, and was distressed at the weakness with which Java's API scopes requests to interfaces. Now I understand that it's sensible to have operations scoped to host as well, so I'm much happier with Java's API. (The implementations of this API, however, still have the horrible non-invalidatable cache problem, but I've already flamed about that.)

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? If it's the former, is there any remaining hope for determining all the IP addresses of one's own host?

My hope is that a host must have exactly one hostname.

>An IP number maps to an interface
>(maybe - for example, transparent proxies will map different ports on
>the same IP to different IPs behind the proxy!) and an interface maps to
>a host.

[?] When proxies do map, do they normally change port numbers also? If they do, this creates further problems for E.

When a Vat contacts the VLS through IP remapping, if the VLS is on the open internet, the VLS knows that the incoming IP address is adequate for others to use to contact the Vat, independent of the Vat's own notion of its IP address.

However, 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?

>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" or "make a
>query with contents V to domain name W" [this last being a bit scary,
>but might include, for example, LDAP queries]). A cannot guess by
>looking at B's hostname, IP address or DNS.

[-] B doesn't have the information A needs, given the possible mapping proxies discussed above. If B is behind a firewall and being remapped, it has no idea what address to tell A so that A or his buddies can contact B. Fortunately, A can figure out a workable (for A) IP address for B from the connection with B. However, it also needs a workable port number.

>BTW, apologies for not using this [#,?,...] stuff - where is it defined?

[?] Ping?