ONC+ Developer's Guide

Basic Block Size

Choosing the XDR block size requires a tradeoff. Choosing a small size such as 2 makes the encoded data small, but causes alignment problems for machines that are not aligned on these boundaries. A large size such as 8 means the data is aligned on virtually every machine, but causes the encoded data to grow too large. Four was chosen as a compromise. Four is big enough to support most architectures efficiently.

This basic block size of 4 does not mean that the computers cannot utilize standard XDR, just that they do so at a greater overhead per data item than 4-byte (32-bit) architectures. Four is also small enough to keep the encoded data restricted to a reasonable size.

The same data should encode into an equivalent result on all machines so that encoded data can be compared or checksummed. So, variable-length data must be padded with trailing zeros.