A NetInfo server locates a server for its parent domain by binding. A NetInfo client then connects to a server for a domain. When a client connects to a second-level or higher domain, it inherits the bindings of the netinfods.
Figure 2 shows what happens when a client requests a piece of information that isn't available from the local domain. In this example, the account information for the user eng has been requested. This example assumes the binding shown in Figure 1 has completed.
Packet Source Destination Protocol Message
1 ranger broadcast ARP request What is the Ethernet address for
Internet address 192.42.172.6?
2 cadet ranger ARP reply Ethernet address for IP 192.42.172.6
is 0:0:f:0:59:82.
3 ranger cadet Portmap RPC What is the UDP port for the netinfobind
program, version 1?
4 cadet ranger RPC reply Port 722.
5 ranger cadet netinfobind RPC getregister("network")
6 cadet ranger RPC reply UDP port 724, TCP port 726.
7 ranger cadet TCP Window size 4096?
8 cadet ranger TCP OK; window size 4096?
9 ranger cadet TCP Window size 4096 OK.
10 ranger cadet netinfo RPC root_directory()
11 cadet ranger RPC reply root directory's handle is {0,36}
(directory 0, instance 36).
12 ranger cadet netinfo RPC lookup({0, 36}, "name", "machines")
13 cadet ranger RPC reply /machines is [1,{0,36}]
(directory 1 in {0,36}).
14 ranger cadet netinfo RPC list(/machines, "serves")
15 cadet ranger RPC reply Each directory's ID number and
serves property values.
16 ranger cadet netinfo RPC listprops(/machines/cadet)
17 cadet ranger RPC reply The properties in /machines/cadet.
18 ranger cadet netinfo RPC readprop(/machines/cadet, ip_address)
19 cadet ranger RPC reply 192.42.172.6
20 ranger cadet netinfo RPC listprops(/machines/exec)
21 cadet ranger RPC reply The properties in /machines/exec.
22 ranger cadet netinfo RPC readprop(/machines/exec, ip_address)
23 cadet ranger RPC reply 192.42.172.4
24 ranger cadet netinfo RPC root_directory()
25 cadet ranger RPC reply {0,36}
26 ranger cadet netinfo RPC lookup({0,36}, "name", "users")
27 cadet ranger RPC reply [158, {0,36}]
28 ranger cadet netinfo RPC lookup_read(/users, "name", "eng")
29 cadet ranger RPC reply Contents of /users/eng.
30 ranger cadet TCP Receipt acknowledged.
Figure 2: Fetching information from a parent domain
First, the client process needs to contact the server for the second-level domain. Packets 1 through 4 obtain the address information for the nibindd running on cadet--recall that cadet is where the chosen netinfod network is running. Packets 5 and 6 get the addresses of the netinfod network running on cadet. Packets 7 through 9 are TCP protocol overhead, setting up a TCP connection to cadet's netinfod network on TCP port 726.
The client process now has a connection established to the chosen server.
After establishing the connection, the client obtains a list of the known servers of the domain, in case the chosen server for the domain fails and a new server must be contacted. Packets 10 through 13 obtain the ``handle'' for the /machines directory--a handle is how directories are referenced within NetInfo. First, it gets the handle for the root directory, then the handle for the directory machines within that root directory. Next, in packets 14 and 15 the client acquires the values for the serves properties in each subdirectory of /machines. From these, the client can determine which computers provide services for a parent netinfod, by finding serves properties with a dot (.) in the domain portion of the value. Then, in packets 16 through 23, the client on ranger requests the Internet address of each of the computers with a server for the parent domain. In this case, those servers are running on machines with Internet addresses 192.42.172.6 (cadet) and 192.42.172.4 (exec).
Finally, packets 24 through 29 read the properties in /users/eng. Again, the client requests the handle for the root directory. It then gets the handle for /users, and finally gets the actual data. Packet 30 is TCP overhead acknowledging receipt of the answer. Other TCP acknowledgments were piggybacked on top of request or reply packets (see Comer 1991).
Notice that the actual data lookup required only the last three packets, which include one packet of TCP overhead. Packets 1--23 establish the connection, and 24--27 get the handle for /users. In the case of lookupd, the primary NetInfo client, the connection is usually already established, and the handles for the root and the /users directories are usually cached. In the example in Figure 2, when a client on ranger needs to contact local's parent, it inherits the binding between netinfod local on ranger and the netinfod network running on cadet.
Contacting the third-level domain
When a client requests information that's in neither the first-level nor the second-level domain, the third level is contacted. Figure 3 shows the sequence of messages that get the account information for the user sandy, this time from the root domain.
Packet Source Destination Protocol Message
1 ranger cadet netinfo RPC remote_parent
2 cadet ranger RPC reply ["Rhino", 192.42.172.4]
3 ranger exec Portmap RPC getport(UDP, netinfobind, 1)
4 exec ranger RPC reply Port 658.
5 ranger exec netinfobind RPC getregister("Rhino")
6 exec ranger RPC reply UDP port 660, TCP port 662.
7 ranger exec TCP Window size 4096?
8 exec ranger TCP OK; window size 4096?
9 ranger exec TCP Window size 4096 OK.
10 ranger exec netinfo RPC root_directory()
11 exec ranger RPC reply {0,69}
12 ranger exec netinfo RPC lookup({0,69}, "name", "machines")
13 exec ranger RPC reply [3,{0,69}]
14 ranger exec netinfo RPC list(/machines, "serves")
15 exec ranger RPC reply Each directory's ID number and
serves property values.
16 ranger exec netinfo RPC listprops(/machines/super21)
17 exec ranger RPC reply The properties in /machines/super21.
18 ranger exec netinfo RPC readprop(/machines/super21,
ip_address)
19 exec ranger RPC reply 192.42.172.2
20 ranger exec netinfo RPC listprops(/machines/exec)
21 exec ranger RPC reply The properties in /machines/exec.
22 ranger exec netinfo RPC readprop(/machines/exec, ip_address)
23 exec ranger RPC reply 192.42.172.4
24 ranger exec netinfo RPC listprops(/machines/mustang)
25 exec ranger RPC reply The properties in /machines/mustang.
26 ranger exec netinfo RPC readprop(/machines/mustang,
ip_address)
27 exec ranger RPC reply 192.42.172.5
28 ranger exec netinfo RPC listprops(/machines/sabre)
29 exec ranger RPC reply The properties in /machines/sabre.
30 ranger exec netinfo RPC readprop(/machines/sabre, ip_address)
31 exec ranger RPC reply 192.42.172.66
32 ranger exec netinfo RPC listprops(/machines/chaparral)
33 exec ranger RPC reply The properties in /machines/chaparral.
34 ranger exec netinfo RPC readprop(/machines/chaparral,
ip_address)
35 exec ranger RPC reply 192.42.172.98
36 ranger exec netinfo RPC root_directory()
37 exec ranger RPC reply {0,69}
38 ranger exec netinfo RPC lookup({0,69}, "name", "users")
39 exec ranger RPC reply [308, {0,69}]
40 ranger exec netinfo RPC lookup_read(/users, "name", "sandy")
41 exec ranger RPC reply Contents of /users/sandy.
42 ranger exec TCP Receipt acknowledged.
Figure 3: Fetching information from a parent's parent
The sequence actually begins with a failure to find the requested information in the second-level domain. If the client already has a connection to the second-level domain, the exchange includes an analog to packet 29 from Figure 2, requesting the properties in /users/sandy, and a reply stating the information wasn't found. Operations continue with the conversation as shown in Figure 3.
Figure 3 is very similar to Figure 2. Indeed, packets 3 through 27 are exactly the initial connection process, although because the connection is to a different domain and different servers, the packets themselves are slightly different. Packets 28 through 34 repeat the acquisition of the properties in the /users subdirectory--/users/sandy in this case.
The new packets here are 1 and 2. These packets are the remote parent request and reply. When a NetInfo client communicates with a domain higher than the local domain's parent, it inherits the parent-to-grandparent binding.
If the NetInfo client on ranger needs to contact cadet/network's parent, it inherits the binding between cadet/network and netinfod Rhino, to which cadet/network is bound. It obtains this information using the NetInfo Remote Parent, or NI_RPARENT, request. NI_RPARENT requests the tag and the Internet address of the server of the parent of the receiving netinfod.
In this example, local's parent, cadet/network, is bound to the netinfod Rhino on exec (Internet address 192.42.172.4), exec/Rhino.
If the client had already obtained the binding to the third level, and if that domain's root and /users directories had already been referenced and cached, then the sequence would have been much simpler, involving only a failed attempt to read /users/sandy from the second-level domain and a successful attempt to read it from the third-level domain.