what does XDR stand for? and what is it?

Randall Hopper aa8vb at yahoo.com
Wed Apr 26 06:39:27 EDT 2000


Shaun:
 |im here looking and trying to figure out the xdrlib module, 
...
 |my question is what is XDR? what does it stand for?

Fredrik and Richard already gave you the what's-it-stand-for and Richard
mentioned RPC (a Sun protocol using XDR).  Here's a bit more detail on the
what's-it-for.  XDR is for transparently exchanging data between systems
which may have different representations for basic data types.

"Data types" being things like ints, floats, double-precision floats,
characters, etc.  "Representations" meaning things like:  word sizes, byte
orderings, floating-point formats, etc.

You use XDR to "flatten your data structures" into stream of bytes so you
can send it over the net or write it to a file (similar in concept to
Python's marshal and pickle modules).  On the other end, you "build them
back up" from the data stream to construct the heirarchy of data structures
originally sent.  These two processes are called serialization and
deserialization, respectively.

As Richard mentioned, the main protocol Sun developed using XDR for a data
representation was RPC (remote procedure call), which is used by (among
other things) NFS -- Network File System.  

Most UNICes nowadays (and maybe MSWin too) provide XDR C APIs with the OS,
since they have to have them for NFS anyways.

-- 
Randall Hopper
aa8vb at yahoo.com




More information about the Python-list mailing list