Agree on types and four-byte units
01A shared data description gives byte sequences their meaning. XDR uses a common byte order and four-byte alignment across machines.
Without the chosen description, the illustration stops before interpreting the value. This is an application knowledge boundary, not a new XDR error packet.
Source for this drawing: RFC 4506 · Read RFC section 3 ↗
New to this? Start hereA quick picture + helpful background
First, agree how to read the message.
An encoding tells a reader how to interpret bytes. A format tells it how values fit together. Correctly reading a value does not make that value trustworthy.
Helpful first, if these ideas are unfamiliar
These pictures are analogies to help you learn. The linked RFC explains the actual rules.
Terms in this drawing
Related RFCs and changes
“Updates” changes part of an earlier RFC. “Obsoletes” replaces it. This list shows selected related documents.
The data description supplies types; encoded values are not a dump of native memory.
- XDR means External Data Representation. It is a language for describing data and an encoding for its values, used by protocols such as ONC RPC and NFS. It is not itself a transport or an authentication protocol. A shared description, often called a schema, tells an encoder and decoder what types and order to expect (§1).
- XDR uses implicit typing: the selected example sends encoded values without inserting a type name before every value. The surrounding application already knows the description. An application can explicitly carry a description or introduce type tags using a union, but those are additional choices, not an automatic XDR header (§§1,5 discussion6).
- Every ordinary encoded item occupies a multiple of four bytes; void occupies zero bytes. Bytes are read in order. Data needing a non-multiple of four is followed by zero to three residual ZERO bytes, enough to reach the next four-byte boundary (§§3,4.16). This is value encoding, not a promise about native memory addresses.
- Integer encodings put the most significant byte first. The illustrative unsigned integer0x01020304 is sent as 01 02 03 04 regardless of native host byte order (§§4.1–4.2,5). The byte-order discussion is distinct from the physical bit order used by an Ethernet medium (§1).
- RFC 4506 is the May 2006 Internet Standard, STD 67. It obsoletes RFC 1832 but explicitly makes no technical encoding changes: §2 says it adds IANA/security discussion and distinguishes normative/informative references. Do not invent an XDR version change or change older encoded values.
Illustrative values and bounded offline encoding/decoding models. Not a complete XDR compiler, RPC/NFS implementation, transport, memory allocator or security verifier.
Read the RFC section ↗