The XDR Data Representation
- The representation used by XDR is defined fully in
RFC1014.
- XDR assumes that bytes (octets) are portable between architectures.
- The representation of all objects requires a multiple of 4 bytes,
numbered 0 to n-1.
- The bytes are read from and written to streams such that byte
m precedes byte m+1.
- If the object being represented is not a multiple of 4 bytes in length
then the n bytes are followed by enough 0
bytes to make the total byte count a multiple of 4.
- An unfortunate consequence of this is that sending a single character
will involve a 75% waste of bandwidth (!).
- The standard, however, defines representations for arrays of characters
to minimise this wastage in general use.
CITS3002 Computer Networks, Lecture 10, Architecture independent applications, p16, 8th May 2024.
|