Basic Block Size

The XDR language is based on the assumption that bytes (eight bits of data or an octet) can be ported to and encoded on media that preserve the meaning of the bytes across the hardware boundaries of data.

XDR does not represent bit fields or bitmaps. It represents data in blocks of multiples of four bytes (32 bits). The bytes are numbered from 0 to the value of n - 1, where the value (n mod 4) equals 0. They are read from or written to a byte stream in order, such that byte m precedes byte m + 1.

Bytes are ported and encoded from low order to high order in local area networks. Representing data in standardized formats resolves situations that occur when different byte-ordering formats exist on networked machines. This also enables machines with different structure-alignment algorithms to communicate with each other.

See the A Block figure (Figure 1) for a representation of a block.

Figure 1. A Block
The first line of the diagram shows the following: byte 0, byte 1, dots signifying the bytes between byte 1 and byte n -1, and then byte n -1. After byte n -1 are two residual bytes labeled zero; between these bytes are dots signifying any additional residual bytes would be included. The second line of the diagram shows the byte values of the first line. Byte 0 to byte n -1 is equal to n bytes and the residual zero bytes have a length of r bytes. The last line of the diagram shows an equation that spans the length of the diagram, the equation follows: n + r (where (n+r) mod 4 = 0) identifies the length.

In a graphics box illustration, each box is delimited by a + (plus sign) at the four corners and by vertical bars and dashes. Each box depicts a byte. The three sets of . . . (ellipsis) between boxes indicate 0 or more additional bytes, where required.