ndb – Network database
The network database consists of files
describing machines known to the local
installation and machines known publicly.
The files comprise multi-line tuples made up of
attribute/value pairs of the form
or sometimes just
Each line starting without white space starts a new tuple.
Lines starting with
is the root of the database.
Other files are included in the
database if a tuple with an
attribute-value pair of attribute
and no value exists in
each pair with attribute
identifies a file to be included in the database. The files are searched
in the order they appear.
declares the database to be composed of the three files
is searched before the others.
may be included in the
to redefine its ordering.
Within tuples, pairs on the same line bind tighter than
pairs on different lines.
Programs search the database directly using the routines in
or indirectly using
and the routine
impose structure on the otherwise flat database by using
knowledge specific to the network.
The internet is made up of networks which can be subnetted
multiple times. A network must have an
attribute and is uniquely identified by the values of its
attributes. If the
is missing, the relevant Class A, B or C one is used.
A search for an attribute associated with a network or host starts
at the lowest level, the entry for the host or network itself,
and works its way up, bit by bit, looking at entries for nets/subnets
that include the network or host. The search ends when the attribute
For example, consider the following entries:
ipnet=murray-hill ip=220.127.116.11 ipmask=255.255.0.0
ipnet=plan9 ip=18.104.22.168 ipmask=255.255.255.0
ip=22.214.171.124 sys=anna dom=anna.cs.bell-labs.com
is on the subnet
which is in turn on the class B net
Assume that we’re searching for
The search starts by looking for an entry with
We find the anna entry. Since it has an
we’re done looking for that attribute.
To fulfill the NTP request, we continue by looking for networks
that include anna’s IP address.
We lop off the right most one bit from anna’s address and
look for an
Not finding one, we drop another bit and look for an
such an entry and it has the pair,
ending our search.
can be made to perform such network aware
searches by using metanames in the dialstring.
A metaname is a
followed by an attribute name.
looks up the attribute relative to the system it is running
on. Thus, with the above example, if a program called
dial("tcp!$smtp!smtp", 0, 0, 0);
the dial would connect to the SMTP port of
A number of attributes are meaningful to programs and thus
system name (a short name)
Internet fully-qualified domain name
v4 or v6.
IPv6 Internet address.
For DNS, an
Internet network name
Internet network mask
Internet gateway (ip address)
(must be lower-case hex)
Specific vendor attribute for dhcp and bootp
file to download for initial bootstrap;
to boot a PC via PXE.
an TFTP server to use for PXE bootstrap
Plan 9 file server to be used
Plan 9 authentication server to be used
Plan 9 authentication domain.
To specify an authentication server for a particular domain,
add a tuple containing both
attributes and values.
the NFS root for unix machines
the NFS server used with rootpath
a domain name that
adds onto any unrooted names when doing a search.
There may be multiple
a DNS server to use (for DNS and DHCP)
an NTP server to use (for DHCP)
an SMTP server to use (for DHCP)
a time server to use (for DHCP)
a Windows name server (for DHCP)
mail exchanger (for DNS and DHCP);
service location (for DNS);
start of area (for DNS)
a TCP service name
a UDP service name
a TCP or UDP port number
a TCP service that can be called only by ports numbered
less than 1024
a protocol supported by a host.
was needed by
in tuples for hosts that supported the IL protocol
to translate dotted names to IP addresses,
only consulting the database files if
cannot translate the name.
allows network entries with
attributes but no
Searches for the system name are resolved
by looking up the domain name with
is used during authentication to decide who has the power to ‘speak for’ other
A tuple for the CPU server, spindle.
Entries for the network
and its subnets.
ipnet=mh-astro-net ip=126.96.36.199 ipmask=255.255.255.0
Mappings between TCP service names and port numbers.
tcp=rexec port=512 restricted
first database file searched