NFS Client Networking  «Prev  Next»
Lesson 3 Remote procedure call
ObjectiveDefine and explain remote procedure call.

Remote Procedure Call

When users access NFS volumes, simple commands, like ls, must appear to retrieve remotely stored information over the network. However, ls does not understand networks at all; it just
  1. asks the kernel for a directory's contents,
  2. formats the results, and
  3. displays them.
There must be some transparent mechanism handling the network communications. Here, the kernel sees that the directory is mounted over NFS and makes a Remote Procedure Call (RPC).

RPC in Linux

When Linux needs a server to perform a service like accessing an NFS volume, it sends an RPC request packet to the server. The client then waits a predetermined amount of time before making the request again. Meanwhile, the server tries to perform the requested job and reply to the client with the results. Every single command does not need to know how to handle NFS; each command simply requests information from the kernel or appropriate daemon, which makes the RPC. The following SlideShow summarizes the process used to retrieve NFS information for the ls command from a server. Remote Procedure Call (RPC) is a communication protocol that enables a program on one computer to call a procedure on another computer, without requiring the programmer to worry about the underlying details of the communication. In an RPC system, a client program makes a procedure call to a server program, passing any necessary parameters. The client program then waits for the server to execute the procedure and return a response, which may include a result value or error message. This process appears to the programmer as if the procedure is being executed locally, even though it is actually being executed on a remote machine.
The RPC system typically handles the low-level details of communication, such as establishing connections, encoding and decoding data, and error handling. This allows programmers to focus on the high-level logic of their programs, without needing to worry about the details of network communication. RPC is commonly used in distributed systems, where multiple computers work together to perform a complex task. By allowing programs on different machines to communicate easily, RPC helps simplify the design and implementation of these systems.

Remote procedure call

1) user1 on host03 type ls /home/user1, a directory that is local on the NFS server, homespace.
1) user1 on host03 type ls /home/user1, a directory that is local on the NFS server, homespace. This ls command asks the kernel for the content of /home/user1.

2) The kernel on host03 recognizes that /home/user1 actually is located on homespace
2) The kernel on host03 recognizes that /home/user1 actually is located on homespace and sends a request for the directory contents there.

Red Hat Reference
3) homespace receives the request, processes it, and sends the contents of the directory back to host03.
3) homespace receives the request, processes it, and sends the contents of the directory back to host03.

4) The kernel on host03 gives the data to the ls command, which in turn displays the directory contents on users 1's screen.
4) The kernel on host03 gives the data to the ls command, which in turn displays the directory contents on users 1's screen.

Remote Procedure Call
One caveat to the RPC process is that the server and client must be running their respective portmap daemons. The daemons set up the communication channels between the RPC client and server. The next lesson shows you how to use the mount command to access NFS shares.

RPC NFS - Quiz

Before moving on to the next lesson, click the Quiz link below to review the basics of RPC and NFS.
RPC NFS - Quiz

Red Hat Reference