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
asks the kernel for a directory's contents,
formats the results, and
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.
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