NameServer Documentation
The NameServer maintains the global name space and allows processes to
find other processes by name. This means that there is only one fixed
port in the system - the NameServer port (12345). The NameServer
should always be running on each of the robots and cass. Note that
there will probably be multiple NameServers running and that they
share information for robustness.
Table of contents:
- Invoking NameServer
- Diagnostics - NameServerShow
- NameServer FAQ
- Design of NameServer
Invoking NameServer
NameServer [-d debug_level] [-p port] [-q findport] [-o number] [-x]
Diagnostics - NameServerShow
The program NameServerShow (which should be installed somewhere
public) lists all of the entries in the NameServer list.
NameServerShow contacts the closest/quickest NameServer and lists all
of the entries that it has. The format is a list of sets of entries
that belong to the NameServers on each host. Each set starts with the
hostname and is followed by the entries. The format for each entry is
the name of the process followed by a colon, a set of methods that the
process supports (INET, UNIX, QNX), the hostname, the IP address, the
inet socket, the unix socket and the pid of the process.
cass:~> NameServerShow
cass.nada.kth.se:
NameServer: INET UNIX cass.nada.kth.se 192.168.5.31 12345 12345 25379
NameServer FAQ
- 1. Why can't my process register itself with the NameServer?
- Processes send a UDP broadcast packet on the local subnet to
locate the NameServer. There must be a NameServer running on the same
subnet (and with reasonable communication performance) for things to
work. If the results are unreliable, then there is probably too much
communication delay (there is a timeout when locating the NameServer).
Check things by pinging between the host that you are running the
process on and the NameServer host.
- 2. Why can't my process find another process using the
NameServer?
- First check that the process that you are trying to locate has
been registered with the NameServer (using NameServerShow), then read
the answer to question 1.
Design of NameServer
The NameServer maintains the global name space and allows processes to
find other processes by name. There will probably be multiple
NameServers running and that they must share information for
robustness. In addition, the NameServer should continue to operate
even if some of it's peers disappear. This has motivated a two part
design for the NameServer with all of the critical tasks done in the
primary process and secondary tasks in the background process (which may
block sometimes).
Tasks for the primary process:
- Maintain a list of names and their addresses
- Supply addresses to client processes (allow name lookup)
Tasks for the secondary process:
- Periodically try to find other NameServers
- Periodically check each of the entries that the primary process
has to see if they are valid (delete them if not).
- Periodically check if other NameServers have disappeared (and
delete their entries from the primary process if so).
Note that some of the tasks for the secondary process can block
(specifically, trying to connect to each of the listed processes to
see if they still exist can take considerable time if the computer is
down).
The NameServer also provides a mechanism for instantiating processes
that do not currently exist but can be supplied by some unknown entity
(actually the StateManager).