External Data Representation XDR
1 External Data Representation (XDR)
Introduction o Examines a de facto standard for external data representation and presentation as well as a set of library procedures used to perform data conversion o Describes the general motivations for using an external data representation and the details of one particular implementation
2 Introduction Examines a de facto standard for external data representation and presentation as well as a set of library procedures used to perform data conversion Describes the general motivations for using an external data representation and the details of one particular implementation
Introduction(cont) o The next chapter shows how an external data representation standard helps simplify client and server communication o It illustrates how a standard makes it possible to use a single, uniform remote access mechanism for client-server communication
3 Introduction (cont.) The next chapter shows how an external data representation standard helps simplify client and server communication It illustrates how a standard makes it possible to use a single, uniform remote access mechanism for client-server communication
Representation of Data o Fig. 20. 1 shows little endian(if it stores the lsb of an integer at the lowest memory address) and big endian representation for 32-bit integers o Programmers who create client and server software must contend with data representation because both endpoints must agree on the exact representation for all data sent across the communication channel between them otherwise conversion is required
4 Representation of Data Fig. 20.1 shows little endian (if it stores the LSB of an integer at the lowest memory address) and big endian representation for 32-bit integers Programmers who create client and server software must contend with data representation because both endpoints must agree on the exact representation for all data sent across the communication channel between them; otherwise, conversion is required
Asynchronous conversion and the n-squared problem o Designs that follow the paradigm of converting directly from one representation to the server s representation are said to use asymmetric data conversion because only one side needs to perform conversion
6 Asynchronous Conversion and the N-Squared Problem Designs that follow the paradigm of converting directly from one representation to the server’s representation are said to use asymmetric data conversion because only one side needs to perform conversion
Asynchronous Conversion and the N-Squared Problem(cont o If client-server software is designed to convert between the client's native data representation and the servers native data representation asymmetrically the number of versions of the software grows as the square of the number of architectures(N-Squared Conversion Problem
7 Asynchronous Conversion and the N-Squared Problem (cont.) If client-server software is designed to convert between the client’s native data representation and the server’s native data representation asymmetrically, the number of versions of the software grows as the square of the number of architectures (N-Squared Conversion Problem)
Network Standard Byte Order o The tcP/ip protocols use the same representation for all the data sent across a network in a protocol header(headers represent integer data in a standard machine-independent form) Such designs employ symmetric data converslon
8 Network Standard Byte Order The TCP/IP protocols use the same representation for all the data sent across a network in a protocol header (headers represent integer data in a standard, machine-independent form) ⚫ Such designs employ symmetric data conversion
Network Standard Byte Order(cont) o Symmetric data representation has an important consequence: only one version of protocol software 1s needed o The standard representation used for data traversing the network is known as the external data representation
9 Network Standard Byte Order (cont.) Symmetric data representation has an important consequence: only one version of protocol software is needed The standard representation used for data traversing the network is known as the external data representation
Network Standard Byte Order(cont) o The chief advantage lies in flexibility neither the client and the server needs to understand the architecture of the other o The total programming effort required vill be proportional to the number of machine architectures o The chief disadvantage of symmetric conversion is computation overhead even if the client and the server both operate at the same architecture
10 Network Standard Byte Order (cont.) The chief advantage lies in flexibility: neither the client and the server needs to understand the architecture of the other The total programming effort required will be proportional to the number of machine architectures The chief disadvantage of symmetric conversion is computation overhead even if the client and the server both operate at the same architecture
Network Standard Byte Order(cont) o Because the external representation may add information to the data or align it with word boundaries the conversion may result in a larger stream of bytes than necessary o Most programmers agree that using symmetric conversion is worthwhile 11
11 Network Standard Byte Order (cont.) Because the external representation may add information to the data or align it with word boundaries, the conversion may result in a larger stream of bytes than necessary Most programmers agree that using symmetric conversion is worthwhile