XDR routines

Data exchanged between systems engaged in ONC RPC must always flow in a standard format specified by XDR, because different machine architectures have different representations of the same information.

Both client and server use XDR routines to convert the input and output parameters between XDR format and the local data format. You either write these yourself, or specify an XDR library function, as described below. In Figure 1, inproc and outproc are the XDR routines.
Figure 1. XDR routines used in a remote procedure call
Diagram showing a remote procedure in a server using inproc and outproc XDR routines, and a client caller also using inproc and outproc XDR routines, as described in the text.

Notice that in Figure 1, the same XDR routine, inproc, is used to encode and decode the data as it flows from client to server, and similarly for outproc as it flows back to the client. The source for inproc is the same in the client and server, but XDR library functions in the routines are compiled to encode or decode as appropriate. Such routines are termed bidirectional, and they help to ensure that the encoding and decoding is done symmetrically in the two routines.