The portmapper Daemon The etcrpc File

15.3.1 The portmapper Daemon

An application may contain many procedures; for example, the NFS contains more than a dozen procedures, one for each filesystem operation read block, write block, create file, etc.. However, RPC services still must use TCPUDP port numbers to fit the underlying protocols. The mapping of RPC program numbers to port numbers is handled by the portmap daemon named portmapper. When an RPC server is initialized, it registers its service with the portmapper, telling it which port it will listen on for incoming requests. An RPC client contacts the portmapper on the server side to learn the port number used by the RPC server; or the client may ask the portmapper to call the server indirectly on its behalf. This is presented in Figure 15.5. In either case, the RPC call from a client to a server must be made with the portmapper running. Without a running portmapper, all serving RPC−based applications are effectively stopped. Figure 15.5: The RPC clientserver communication. The port number where an RPC client can find portmapper is specified in the etcservices file: cat etcservices | grep rpc portmap 111udp sunrpc SUN Remote Procedure Call portmap 111tcp sunrpc

15.3.2 The etcrpc File

The file etcrpc contains the RPC service program number database; these are readable entries with the following information: name of server for the RPC program RPC program number Aliases Items are separated by any number of blanks and or tab characters. A pound sign indicates the beginning of a comment, and characters up to the end of the line are not interpreted by the routines that search the file. 354 cat etcrpc rpc 1.19 1227 portmapper 100000 portmap sunrpc rstatd 100001 rstat rup perfmeter rusersd 100002 rusers nfs 100003 nfsprog ypserv 100004 ypprog mountd 100005 mount showmount ypbind 100007 walld 100008 rwall shutdown ..... ..... ypxfrd 100069 ypxfr pcnfsd 150001 We have already mentioned that Sun Microsystems were the first to develop the RPC; the developed version was known as ONC RPC ONC stands for open network computing. Simultaneously, certain RPC−related tools and specialized commands were introduced. One of them is the rpcinfo command, which reports RPC information; it makes an RPC call to an RPC server and reports on its findings. The command has a number of options. The following example shows all of the RPC services registered on the local machine. rpcinfo −p program vers proto port 100000 2 tcp 111 portmapper 100000 2 udp 111 portmapper 100004 2 udp 660 ypserv 100004 2 tcp 661 ypserv 100004 1 udp 660 ypserv 100004 1 tcp 661 ypserv 100069 1 udp 662 ypxfrd 100069 1 tcp 664 ypxfrd 100007 2 tcp 1024 ypbind 100007 2 udp 1027 ypbind ..... ..... 100068 2 udp 1044 100068 3 udp 1044 100083 1 tcp 1026

15.4 Configuring the Network Interface