rfc-5531

RPC: Remote Procedure Call Protocol Specification Version 2

R. Thurlow
date2009-05 streamIETF areawit wgnfsv4 statusDRAFT STANDARD pages63 canonicalhttps://www.rfc-editor.org/rfc/rfc5531 doi10.17487/RFC5531 errataview
This document describes the Open Network Computing (ONC) Remote Procedure Call (RPC) version 2 protocol as it is currently deployed and accepted. This document obsoletes RFC 1831. [STANDARDS-TRACK]

obsoletes

updated by

Extracted elements (30)

design-rationale §6

Binding a client to a particular service and transport is intentionally NOT part of the RPC protocol specification, leaving rendezvous to higher-level software (e.g., the RPC binder/portmapper) so the core protocol remains transport-independent.

design-rationale §13.4.2

Recent RPC security work focuses on new GSS-API mechanisms used with the existing RPCSEC_GSS flavor rather than defining new auth_flavor values, because RPCSEC_GSS already provides a negotiation framework (pseudo-flavors) for NFS security.

security

design-rationale §5

RPC does not implement reliability; applications running over unreliable transports (UDP) must implement their own timeouts, retransmission, and duplicate detection. Over TCP, a reply implies exactly-once execution, but no reply does not imply non-execution.

udp, tcp

design-rationale §5

The transaction ID (xid) is used only for matching replies to calls and detecting retransmissions; servers may use it to implement execute-at-most-once semantics by caching previously executed xids, but must not treat it as a sequence number.

interoperability-note §A

A server may return an AUTH_SHORT verifier containing an opaque shorthand credential; the client may subsequently use this shorthand in place of the full AUTH_SYS credential. If the server flushes the cache, it rejects with AUTH_REJECTEDCRED and the client must revert to AUTH_SYS.

security

interoperability-note §8.4.1

Batching uses reliable stream transports (TCP) where the client sends a sequence of calls without waiting for replies; a final non-batch call is used to flush the pipeline and obtain acknowledgement.

tcp

interoperability-note §8.1

When an RPC version mismatch occurs (RPC_MISMATCH), the server returns the lowest and highest supported RPC version numbers; when a program version mismatch occurs (PROG_MISMATCH), it returns the lowest and highest supported program version numbers, enabling client adaptation.

normative-requirement §5 SHOULD

Any new transport mechanism used to carry ONC RPC messages SHOULD be specified by means of a Standards Track RFC.

normative-requirement §14 MUST NOT

AUTH_DH is considered obsolete and insecure; it SHOULD NOT be used for services that permit clients to modify data, and MUST NOT be specified as RECOMMENDED or REQUIRED for any Standards Track RPC service.

security

normative-requirement §14 MUST NOT

AUTH_SYS SHOULD NOT be used for services that permit clients to modify data. AUTH_SYS MUST NOT be specified as RECOMMENDED or REQUIRED for any Standards Track RPC service.

security

normative-requirement §8.1 MUST

In version 2 of the RPC protocol, the rpcvers field in the call_body MUST be equal to 2. The first implementation of a new remote program MUST NOT use version number zero.

ip

normative-requirement §10 MUST

Null authentication (AUTH_NONE) MUST be available in all RPC implementations. It is the mandatory baseline authentication flavor.

security

normative-requirement §14 MUST

Standards Track RPC services MUST mandate support for RPCSEC_GSS and MUST mandate support for an authentication pseudo-flavor with appropriate levels of security covering authentication, integrity, or data privacy.

security

normative-requirement §9 MUST NOT

The server is not allowed to examine the xid field in any way except as a test for equality. It must not treat xid as a sequence number.

protocol-element §8.1

RPC programs are identified by a 32-bit program number, a version number (MUST NOT be zero), and a procedure number, all carried as unsigned integers in the call_body.

protocol-element §9

The accept_stat enumeration defines six values for accepted replies: SUCCESS=0, PROG_UNAVAIL=1, PROG_MISMATCH=2, PROC_UNAVAIL=3, GARBAGE_ARGS=4, SYSTEM_ERR=5.

protocol-element §8.2

The auth_flavor enumeration defines AUTH_NONE=0, AUTH_SYS=1, AUTH_SHORT=2, AUTH_DH=3, and RPCSEC_GSS=6, with additional values to be assigned by IANA.

security, registry

protocol-element §9

The auth_stat enumeration defines 15 authentication failure codes (AUTH_OK through RPCSEC_GSS_CTXPROBLEM=14), covering remote failures, local failures, deprecated Kerberos errors, and RPCSEC_GSS errors.

security, registry

protocol-element §9

The rejected_reply discriminates on RPC_MISMATCH (returns low/high supported RPC version numbers) and AUTH_ERROR (returns an auth_stat value). A PROG_MISMATCH accepted reply likewise returns low/high supported program version numbers.

registry §13.5

The Authentication Status (auth_stat) Number registry is maintained by IANA on a First Come First Served basis; new values may be added as new authentication flavors introduce new error conditions.

registry, security

registry §13.4

The RPC Authentication Flavor Number registry (transferred from Sun to IANA) assigns flavor numbers on a First Come First Served basis starting at 400000; RPCSEC_GSS pseudo-flavors for NFS are granted in the range 390000–390255.

registry, security

registry §13.3

The RPC Program Number registry (transferred from Sun to IANA) partitions the 32-bit space: 0x00000001–0x1fffffff assigned by IANA (starting at 400000), 0x20000000–0x3fffffff for local administrators, 0x40000000–0x5fffffff transient, remainder reserved.

registry

security-consideration §14

AUTH_SYS lacks a verifier to validate credentials and is therefore insecure; it must not be mandated for Standards Track services. AUTH_DH is obsolete and insecure per RFC 2695. All non-trivial new RPC programs should implement RPCSEC_GSS-based security.

security

security-consideration §14

RPCSEC_GSS (RFC 2203) using GSS-API mechanisms is the recommended security framework for ONC RPC, supporting simple authentication, integrity (non-repudiation), and data privacy as appropriate to the service.

security

state-machine §4

Basic call-reply state: client sends CALL with xid and blocks; server receives, processes, and sends REPLY with matching xid; client matches reply to call via xid and resumes. Server may cache xid to provide execute-at-most-once semantics on retransmissions.

wire-format §A

The AUTH_SYS credential (authsys_parms) encodes: stamp (unsigned int), machinename (string up to 255 bytes), uid (unsigned int), gid (unsigned int), and gids (array of up to 16 unsigned ints).

security

wire-format §9

The call_body contains four unsigned 32-bit fields (rpcvers, prog, vers, proc) followed by two opaque_auth fields (cred and verf), then procedure-specific parameters.

wire-format §8.2

The opaque_auth structure encodes an auth_flavor enum (32 bits) followed by a variable-length opaque body of at most 400 bytes.

security

wire-format §11

The Record Marking (RM) header for stream transports is a 4-byte big-endian value: the high-order bit is a boolean indicating the last fragment, and the remaining 31 bits encode the fragment data length in bytes (0 to 2^31-1). This encoding is NOT XDR standard form.

tcp

wire-format §9

The RPC message (rpc_msg) begins with a 32-bit unsigned transaction identifier (xid), followed by a discriminated union on msg_type selecting either a call_body or reply_body.