Some implementations of rarpd are multithreaded, and some will fork child processes. Solaris rarpd implementations will create a process or thread for each network interface the server has, plus one extra process or thread. The purpose of the extra thread or child process is to act as a delayed responder. Sometimes, rarpd gets a request but decides to delay its response by passing the request to the delayed responder, which waits a few seconds before sending the response. A per-interface rarpd thread/process chooses to send a delayed response if it decides it is not the best candidate to answer the request. To understand how this decision is made, we need to look at the process of converting Ethernet addresses into IP addresses in more detail. The client broadcasts a RARP request containing its 48-bit Ethernet address and waits for a reply. Using the ethers and hosts maps, any RARP server receiving the request attempts to match it to an IP address for the client. Before sending the reply to the client, the server verifies that it is the best candidate to boot the client by checking the /tftpboot directory (more on this soon). If the server has the client's boot parameters but might not be able to boot the client, it delays sending a reply (by giving the request to the delayed responder daemon) so that the correct server replies first. Because RARP requests are broadcast, they are received and processed in somewhat random order by all boot servers on the network. The reply delay compensates for the time skew in reply generation. The server that thinks it can boot the diskless client immediately sends its reply to the client; other machines may also send their replies a short time later. You may ask "Why should a host other than the client's boot server answer its RARP request?" After all, if the boot server is down, the diskless client won't be able to boot even if it does have a hostname and IP address. The primary reason is that the "real" boot server may be very loaded, and it may not respond to the RARP request before the diskless client times out. Allowing other hosts to answer the broadcast prevents the client from getting locked into a cycle of sending a RARP request, timing out, and sending the request again. A related reason for having multiple RARP replies is that the RARP packet may be missed by the client's boot server. This is functionally equivalent to the server not replying to the RARP request promptly: if some host does not provide the correct answer, the client continues to broadcast RARP packets until its boot server is less heavily loaded. Finally, RARP is used for other network services as well as for booting diskless clients, so RARP servers must be able to reply to RARP requests whether they are diskless client boot servers or not. After receiving any one of the RARP replies, the client knows its IP address, as well as the IP address of a boot server (found by looking in the packet returned by the server). In some implementations, a diskless client announces its IP addresses with a message of the form:% ps -eaf | grep rarpd root 274 1 0 Apr 16 ? 0:00 /usr/sbin/in.rarpd -a
A valid IP address is only the first step in booting; the client needs to be able to load the boot code if it wants to eventually get a Unix kernel running.Using IP address 192.9.200.1 = C009C801
The link names are the IP addresses of the clients in hexadecimal. The first client link -- 828D0E09 -- corresponds to IP address 130.141.14.9:[wahoo]% ls -l /tftpboot total 282 lrwxrwxrwx 1 root root 26 Feb 17 12:43 828D0E09 -> inetboot.sun4u.Solaris_2.7 lrwxrwxrwx 1 root root 26 Feb 17 12:43 828D0E09.SUN4U -> inetboot.sun4u.Solaris_2.7 lrwxrwxrwx 1 root root 26 Apr 27 18:14 828D0E0A -> inetboot.sun4u.Solaris_2.7 lrwxrwxrwx 1 root root 26 Apr 27 18:14 828D0E0A.SUN4U -> inetboot.sun4u.Solaris_2.7 -rw-r--r-- 1 root root 129632 Feb 17 12:21 inetboot.sun4u.Solaris_2.7 lrwxrwxrwx 1 root root 1 Feb 17 12:17 tftpboot -> .
Two links exist for each client -- one with the IP address in hexadecimal, and one with the IP address and the machine architecture. The second link is used by some versions of tftpboot that specify their architecture when asking for a boot block. It doesn't hurt to have both, as long as they point to the correct boot block for the client. The previous section stated that a server delays its response to a RARP request if it doesn't think it's the best candidate to boot the requesting client. The server makes this determination by matching the client IP address to a link in /tftpboot. If the link exists, the server is the best candidate to boot the client; if the link is missing, the server delays its response to allow another server to reply first. The client gets its boot block via tftp, sending its request to the server that answered its RARP request. When the inetd daemon on the server receives the tftp request, it starts an in.tftpd daemon that locates the right boot file by following the symbolic link representing the client's IP address. The tftpd daemon downloads the boot file to the client. In some implementations, when the client gets a valid boot file, it reports the address of its boot server:828D0E09 Insert dots to put in IP address format: 82.8D.0E.09 Convert back to decimal: 130.141.14.9
It's possible that the first host to reply to the client's RARP request can't boot it -- it may have had valid ethers and hosts map entries for the machine but not a boot file. If the first server chosen by the diskless client does not answer the tftp request, the client broadcasts this same request. If no server responds, the machine complains that it cannot find a tftp server. The tftpd daemon should be run in secure mode using the -s option. This is usually the default configuration in its /etc/inetd.conf entry:Booting from tftp server at 130.141.14.2 = 828D0E02
The argument after the -s is the directory that tftp uses as its root -- it does a chdir( ) into this directory and then a chroot( ) to make it the root of the filesystem visible to the tftp process. This measure prevents tftp from being used to take any file other than a boot block in tftpboot. The last directory entry in /tftpboot is a symbolic link to itself, using the current directory entry (.) instead of its full pathname. This symbolic link is used for compatibility with older systems that passed a full pathname to tftp, such as /tftpboot/C009C801.SUN4U. Following the symbolic link effectively removes the /tftpboot component and allows a secure tftp to find the request file in its root directory. Do not remove this symbolic link, or older diskless clients will not be able to download their boot files.tftp dgram udp wait root /usr/sbin/in.tftpd in.tftpd -s /tftpboot
8.2. Setting up a diskless client | 8.4. Managing client swap space |
Copyright © 2002 O'Reilly & Associates. All rights reserved.