Jump to content

External Data Representation: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
Ivmai77 (talk | contribs)
→‎See also: a new reference
read the RFC... there is no char type. there are unsigned integers.
Line 17: Line 17:
== XDR data types ==
== XDR data types ==
* [[boolean datatype|boolean]]
* [[boolean datatype|boolean]]
* char (8 bit integer/character)
* int (32 bit integer)
* int (32 bit integer)
* unsigned int (unsigned 32 bit integer)
* hyper (64 bit integer)
* hyper (64 bit integer)
* unsigned hyper (unsigned 64 bit integer)
* [[floating point|float]]
* [[floating point|float]]
* [[double precision|double]]
* [[double precision|double]]
Line 27: Line 28:
* [[string (computer science)|string]]
* [[string (computer science)|string]]
* fixed length [[Array data structure|array]]
* fixed length [[Array data structure|array]]
* variable length array
* variable length [[Array data structure|array]]
* [[union (computer science)|union]]
* [[Tagged_union|union]] - discriminated union
* opaque data
* fixed length [[Opaque_data_type|opaque]] data
* variable length [[Opaque_data_type|opaque]] data
* Optional data. It is notated similarly to C pointers, but is represented as the data type "pointed to" with a boolean "present or not" flag.
* void - zero byte quantity
* optional - Optional data is notated similarly to C pointers, but is represented as the data type "pointed to" with a boolean "present or not" flag.


XDR uses a base unit of 4 bytes. This means that data of types smaller than that occupy four bytes each after encoding. Variable-length types like string and opaque are padded to a total divisible by four bytes.
XDR uses a base unit of 4 bytes. This means that data of types smaller than that occupy four bytes each after encoding. Variable-length types like string and opaque are padded to a total divisible by four bytes.

Revision as of 20:28, 7 February 2010

eXternal Data Representation (XDR) is an IETF standard from 1995. It allows data to be wrapped in an architecture independent manner so data can be transferred between heterogeneous computer systems. Converting from the local representation to XDR is called encoding. Converting from XDR to the local representation is called decoding. XDR is implemented as a software library of functions that is portable between different operating systems and is also independent of the transport layer.

The XDR data format is in use by many systems, including:

XDR data types

  • boolean
  • int (32 bit integer)
  • unsigned int (unsigned 32 bit integer)
  • hyper (64 bit integer)
  • unsigned hyper (unsigned 64 bit integer)
  • float
  • double
  • quadruple (new in RFC1832)
  • enumeration
  • structure
  • string
  • fixed length array
  • variable length array
  • union - discriminated union
  • fixed length opaque data
  • variable length opaque data
  • void - zero byte quantity
  • optional - Optional data is notated similarly to C pointers, but is represented as the data type "pointed to" with a boolean "present or not" flag.

XDR uses a base unit of 4 bytes. This means that data of types smaller than that occupy four bytes each after encoding. Variable-length types like string and opaque are padded to a total divisible by four bytes.

See also

The XDR standard exists in three different versions in the following RFC's...

  • RFC 4506 2006 This document makes no technical changes to RFC 1832 and is published for the purposes of noting IANA considerations, augmenting security considerations, and distinguishing normative from informative references..
  • RFC 1832 1995 version. Added Quadruple precision floating point to RFC 1014
  • RFC 1014 Original 1987 version.