XDR External Data Representation

Slides:



Advertisements
Similar presentations
Chapter 21 Implementing lists: array implementation.
Advertisements

Socket Programming 101 Vivek Ramachandran.
STRING AN EXAMPLE OF REFERENCE DATA TYPE. 2 Primitive Data Types  The eight Java primitive data types are:  byte  short  int  long  float  double.
CSE 333 – SECTION 8 Networking and sockets. Overview Network Sockets IP addresses and IP address structures in C/C++ DNS – Resolving DNS names Demos.
Programming with UDP – I Covered Subjects: IPv4 Socket Address Structure Byte Ordering Functions Address Access/Conversion Functions Functions: 1.socket()
RPC Remote Procedure Call Dave Hollinger Rensselaer Polytechnic Institute Troy, NY.
Tam Vu Remote Procedure Call CISC 879 – Spring 03 Tam Vu March 06, 03.
Remote Procedure CallCS-4513, D-Term Remote Procedure Call CS-4513 Distributed Computing Systems (Slides include materials from Operating System.
CS6223: Distributed Systems Remote Procedure Call (RPC)
Lecture 20 Remote Procedure Call eXternal Data Representation CPE 401 / 601 Computer Network Systems slides are modified from Dave Hollinger.
Chapter 2: Communications
Socket Programming.
CS490T Advanced Tablet Platform Applications Network Programming Evolution.
Tutorial 8 Socket Programming
Jan 28, 2003CS475: Internetworking with UNIX TCP/IP1 XDR, RPC, NFS Internetworking with UNIX TCP/IP Winter
1 School of Computing Science Simon Fraser University CMPT 771/471: Internet Architecture and Protocols Socket Programming Instructor: Dr. Mohamed Hefeeda.
Chapter 4.1 Interprocess Communication And Coordination By Shruti Poundarik.
Interprocess Communication. Process Concepts Last class.
1 Tutorial on Socket Programming Computer Networks - CSC 458 Department of Computer Science Yukun Zhu (Slides are mainly from Monia Ghobadi, and Amin Tootoonchian,
TCP/IP Protocol Stack IP Device Drivers TCPUDP Application Sockets (Gate to network) TCP: –Establish connection –Maintain connection during the communication.
Fall 2000Datacom 11 Lecture 4 Socket Interface Programming: Service Interface between Applications and TCP.
Presentation Services  need for a presentation services  ASN.1  declaring data type  encoding data types  implementation issues  reading: text, section.
Internet Addresses. Universal Identifiers Universal Communication Service - Communication system which allows any host to communicate with any other host.
Introduction to Distributed Systems Slides for CSCI 3171 Lectures E. W
Communication Tran, Van Hoai Department of Systems & Networking Faculty of Computer Science & Engineering HCMC University of Technology.
Remote Procedure Calls Babak Esfandiari. RPC Introduced by Birrell & Nelson (1984) Remote Procedure Calls allow a program to make use of procedures executing.
CS 390- Unix Programming Environment CS 390 Unix Programming Environment Topics to be covered: Distributed Computing Fundamentals.
Introduction to Distributed Systems Slides for CSCI 3171 Lectures E. W. Grundke.
Chapter 4: Interprocess Communication‏ Pages
1 XDR External Data Representation Process A XDR Encode/Decode Transport Process B XDR Encode/Decode Transport.
Distributed Systems Concepts and Design Chapter 4.
Chapter 2 Applications and Layered Architectures Sockets.
The Socket Interface Chapter 21. Application Program Interface (API) Interface used between application programs and TCP/IP protocols Interface used between.
3.1 Silberschatz, Galvin and Gagne ©2009Operating System Concepts with Java – 8 th Edition Chapter 3: Processes.
CSE 451: Operating Systems Winter 2015 Module 22 Remote Procedure Call (RPC) Mark Zbikowski Allen Center 476 © 2013 Gribble, Lazowska,
Networking Tutorial Special Interest Group for Software Engineering Luke Rajlich.
Page 1 Remote Procedure Calls Paul Krzyzanowski Distributed Systems Except as otherwise noted, the content of this presentation.
Introduction to Socket
Remote Procedure Calls CS587x Lecture Department of Computer Science Iowa State University.
Remote Procedure CallCS-502 Fall Remote Procedure Call (continued) CS-502, Operating Systems Fall 2007 (Slides include materials from Operating System.
The Client-Server Model And the Socket API. Client-Server (1) The datagram service does not require cooperation between the peer applications but such.
2: Application Layer1 Chapter 2: Application layer r 2.1 Principles of network applications r 2.2 Web and HTTP r 2.3 FTP r 2.4 Electronic Mail  SMTP,
Computer Science Lecture 3, page 1 CS677: Distributed OS Last Class: Communication in Distributed Systems Structured or unstructured? Addressing? Blocking/non-blocking?
1 Remote Procedure Calls External Data Representation (Ch 19) RPC Concept (Ch 20)
Communications in Client-Server Systems the details…
Distributed Systems Ryan Chris Van Kevin. Kinds of Systems Distributed Operating System –Offers Transparent View of Network –Controls multiprocessors.
Socket programming in C. Socket programming Socket API introduced in BSD4.1 UNIX, 1981 explicitly created, used, released by apps client/server paradigm.
Introduction to Distributed Systems Slides for CSCI 3171 Lectures E. W. Grundke.
Presentation Services
Prof. Leonardo Mostarda University of Camerino
CSE 486/586 Distributed Systems Remote Procedure Call
Socket Interface 1 Introduction 11 Socket address formats 2 API 12 13
Remote Procedure Call present by :Enas Alkhoshi
CMSC621: Advanced Operating Systems Advanced Operating Systems
CSE 451: Operating Systems Winter 2006 Module 20 Remote Procedure Call (RPC) Ed Lazowska Allen Center
Lecture 4: RPC Remote Procedure Call Coulouris et al: Chapter 5
CSE 451: Operating Systems Autumn 2003 Lecture 16 RPC
CS703 - Advanced Operating Systems
7. End-to-end data Rocky K. C. Chang Department of Computing
CSE 451: Operating Systems Winter 2007 Module 20 Remote Procedure Call (RPC) Ed Lazowska Allen Center
Lecture 4: RPC Remote Procedure Call CDK: Chapter 5
CSE 451: Operating Systems Winter 2004 Module 19 Remote Procedure Call (RPC) Ed Lazowska Allen Center
CSE 451: Operating Systems Spring 2012 Module 22 Remote Procedure Call (RPC) Ed Lazowska Allen Center
CSE 451: Operating Systems Autumn 2009 Module 21 Remote Procedure Call (RPC) Ed Lazowska Allen Center
Remote invocation (call)
CSE 451: Operating Systems Autumn 2010 Module 21 Remote Procedure Call (RPC) Ed Lazowska Allen Center
CSE 451: Operating Systems Winter 2003 Lecture 16 RPC
TCP/IP Sockets in Java: Practical Guide for Programmers
Last Class: Communication in Distributed Systems
CSE 451: Operating Systems Messaging and Remote Procedure Call (RPC)
Presentation transcript:

XDR External Data Representation Process A Process B XDR Encode/Decode XDR Encode/Decode Transport Transport Network software - not Networking !!!! Objectives of the course - broad list of topics: networking The Unix model Interprocess communication Networking services Client/Server the Internet

XDR as a case study Sun RPC uses XDR. A good example of a “layer”. Interesting API. Powerful paradigm for creation of complex data structures.

XDR XDR provides a service associated with the OSI Presentation Layer. Common data representation Library (not part of the O.S.). Easy to port to new architectures. Independence from transport layer.

Data Conversion Asymmetric Data Conversion Symmetric Data Conversion client always converts to the server’s data representation. Symmetric Data Conversion both client and server convert to some standard representation.

XDR Data Types boolean char enumeration structure short string int long float double enumeration structure string fixed length array (1-D) variable length array (1-D) union opaque data

Implicit vs. Explicit Typing Explicit Typing means that each piece of data includes information about the type. Implicit typing means that the sender and receiver must agree on the order and type of all data. XDR uses Implicit Typing

XDR Programming Most XDR implementations are based on a buffer paradigm. A buffer is allocated that is large enough to hold an entire message. Individual data items are added to the buffer one at a time. XDR buffers can be attached to a file, pipe, socket or memory.

Conversion Terminology Converting from local representation to XDR representation is called Encoding. Converting from XDR representation to local representation is called Decoding. Sender Receiver ENCODE DECODE XDR

XDR Buffer Creation There are a number of buffer creation functions in the XDR library. xdrmem_create destination for encoding -or- source for decoding is a chunk of memory. xdrstdio_create destination for encoding -or- source for decoding is a file descriptor.

XDR filters The XDR library includes an extensive set of filters that perform encoding/decoding operations. Each XDR stream includes an attribute that determines the specific operation that will be performed by a filter (encoding or decoding).

XDR Filters The filter to encode/decode an integer is called xdr_int: bool_t xdr_int( XDR *xdrs, int *ip); the return value indicates success or failure. xdrs is a pointer to an XDR stream ip is a pointer to an integer.

xdr_int() If the XDR stream operation is XDR_ENCODE int count; XDR *xstream; xdr_int(xstream, &count); will convert (encode) the value of count to the integer representation used by XDR (big-endian) and put the result on the XDR stream.

xdr_int() If the XDR stream operation is XDR_DECODE int count; XDR *xstream; xdr_int(xstream, &count); will get an XDR integer from the stream, convert (decode) the value to local integer representation and put the result in count.

xdr_int() Source Encodes int count; xdr_int(xstream,&count); Destintation decodes int count; xdr_int(xstream,&count);

Complex Data Filters The XDR library includes a set of filters designed to translate complex C data structures to and from XDR representation. Many of these filters make use of the simpler filters to convert individual components.

xdr_array() The xdr_array() filter provides support for encoding/decoding a variable length array. bool_t xdr_array( XDR *xdrs, char *arrp, u_int *sizep, u_int maxsize, u_int elsize, xdrproc_t elproc); sizep is a pointer to the size of the array. elsize is the size of each element (in bytes). elproc is a pointer to a function that can encode/decode individual array elements.

xdr_array() Source Array -> elproc() Destination Array -> 1 2 3 1 2 3 elproc() Destination Array -> 1 2 3

Inside xdr_array() xdr_int(xdrs,&sizep); for (i=0;i<sizep;i++) encode/decode the number of elements in the array xdr_int(xdrs,&sizep); for (i=0;i<sizep;i++) elproc(xdrs,arrp+elsize*i); encode/decode each array element.

xdr_string() the string conversion filter is a little different since XDR strings have a maximum size. bool_t xdr_string( XDR *xdrs, char *string, u_int maxsize);

Problem!! We want to send an array of strings between processes. What is the problem (using xdr_array)? What is a possible solution?