XDR: External Data Representation Standard
RFC 1832

Document Type RFC - Draft Standard (August 1995; No errata)
Obsoleted by RFC 4506
Last updated 2013-03-02
Stream IETF
Formats plain text pdf html bibtex
Stream WG state (None)
Document shepherd No shepherd assigned
IESG IESG state RFC 1832 (Draft Standard)
Consensus Boilerplate Unknown
Telechat date
Responsible AD (None)
Send notices to (None)
Network Working Group                                      R. Srinivasan
Request for Comments: 1832                              Sun Microsystems
Category: Standards Track                                    August 1995

               XDR: External Data Representation Standard

Status of this Memo

   This document specifies an Internet standards track protocol for the
   Internet community, and requests discussion and suggestions for
   improvements.  Please refer to the current edition of the "Internet
   Official Protocol Standards" (STD 1) for the standardization state
   and status of this protocol.  Distribution of this memo is unlimited.


   This document describes the External Data Representation Standard
   (XDR) protocol as it is currently deployed and accepted.


   1. INTRODUCTION                                              2
   2. BASIC BLOCK SIZE                                          2
   3. XDR DATA TYPES                                            3
   3.1 Integer                                                  3
   3.2 Unsigned Integer                                         4
   3.3 Enumeration                                              4
   3.4 Boolean                                                  4
   3.5 Hyper Integer and Unsigned Hyper Integer                 4
   3.6 Floating-point                                           5
   3.7 Double-precision Floating-point                          6
   3.8 Quadruple-precision Floating-point                       7
   3.9 Fixed-length Opaque Data                                 8
   3.10 Variable-length Opaque Data                             8
   3.11 String                                                  9
   3.12 Fixed-length Array                                     10
   3.13 Variable-length Array                                  10
   3.14 Structure                                              11
   3.15 Discriminated Union                                    11
   3.16 Void                                                   12
   3.17 Constant                                               12
   3.18 Typedef                                                13
   3.19 Optional-data                                          14
   3.20 Areas for Future Enhancement                           15
   4. DISCUSSION                                               15
   5. THE XDR LANGUAGE SPECIFICATION                           17
   5.1 Notational Conventions                                  17

Srinivasan                  Standards Track                     [Page 1]
RFC 1832       XDR: External Data Representation Standard    August 1995

   5.2 Lexical Notes                                           17
   5.3 Syntax Information                                      18
   5.4 Syntax Notes                                            19
   6. AN EXAMPLE OF AN XDR DATA DESCRIPTION                    20
   7. TRADEMARKS AND OWNERS                                    21
   APPENDIX A: ANSI/IEEE Standard 754-1985                     22
   APPENDIX B: REFERENCES                                      24
   Security Considerations                                     24
   Author's Address                                            24


   XDR is a standard for the description and encoding of data.  It is
   useful for transferring data between different computer
   architectures, and has been used to communicate data between such
   diverse machines as the SUN WORKSTATION*, VAX*, IBM-PC*, and Cray*.
   XDR fits into the ISO presentation layer, and is roughly analogous in
   purpose to X.409, ISO Abstract Syntax Notation.  The major difference
   between these two is that XDR uses implicit typing, while X.409 uses
   explicit typing.

   XDR uses a language to describe data formats.  The language can only
   be used only to describe data; it is not a programming language.
   This language allows one to describe intricate data formats in a
   concise manner. The alternative of using graphical representations
   (itself an informal language) quickly becomes incomprehensible when
   faced with complexity.  The XDR language itself is similar to the C
   language [1], just as Courier [4] is similar to Mesa. Protocols such
   as ONC RPC (Remote Procedure Call) and the NFS* (Network File System)
   use XDR to describe the format of their data.

   The XDR standard makes the following assumption: that bytes (or
   octets) are portable, where a byte is defined to be 8 bits of data.
   A given hardware device should encode the bytes onto the various
   media in such a way that other hardware devices may decode the bytes
   without loss of meaning.  For example, the Ethernet* standard
   suggests that bytes be encoded in "little-endian" style [2], or least
   significant bit first.


   The representation of all items requires a multiple of four bytes (or
   32 bits) of data.  The bytes are numbered 0 through n-1.  The bytes
Show full document text