1 Remote Procedure Calls External Data Representation (Ch 19) RPC Concept (Ch 20)

Slides:



Advertisements
Similar presentations
1 Communication in Distributed Systems REKs adaptation of Tanenbaums Distributed Systems Chapter 2.
Advertisements

Introduction to Sockets Jan Why do we need sockets? Provides an abstraction for interprocess communication.
Socket Programming CS3320 Fall 2010.
MPI Message Passing Interface
CSE 486/586 Distributed Systems Remote Procedure Call
Programming with UDP – I Covered Subjects: IPv4 Socket Address Structure Byte Ordering Functions Address Access/Conversion Functions Functions: 1.socket()
Remote Procedure Call (RPC)
Remote Procedure Call Design issues Implementation RPC programming
Spring Remote Procedure Call (5.3) Outline Protocol Stack Presentation Formatting.
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.
Computing Systems 15, 2015 Next up Client-server model RPC Mutual exclusion.
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)
CS490T Advanced Tablet Platform Applications Network Programming Evolution.
COS 420 DAY 25. Agenda Assignment 5 posted Chap Due May 4 Final exam will be take home and handed out May 4 and Due May 10 Latest version of Protocol.
CSE331: Introduction to Networks and Security Lecture 11 Fall 2002.
Remote Procedure Call Chin-Chih Chang. Remote Procedure Call Remote Procedure Call (RPC) is a protocol that allows programs to call procedures located.
Jan 28, 2003CS475: Internetworking with UNIX TCP/IP1 XDR, RPC, NFS Internetworking with UNIX TCP/IP Winter
Client Server Model The client machine (or the client process) makes the request for some resource or service, and the server machine (the server process)
Practical Issues of RPCCS-4513, D-Term Remote Procedure Call Practical Issues CS-4513 Distributed Computing Systems (Slides include materials from.
Netprog RPC Overview1 Distributed Program Design n Communication-Oriented Design –Design protocol first. –Build programs that adhere to the protocol.
Chapter 5: Distributed objects and remote invocation Introduction Remote procedure call Events and notifications.
1 Network File System. 2 Network Services A Linux system starts some services at boot time and allow other services to be started up when necessary. These.
Client Software Design Objectives: Understand principles of C/S design, with focus on clients Review Windows implementations of Socket functions.
Linux RPC Comer Chapter 21 (RPCgen Concept) RFC 1057 – RPC Spec. UNIX Network Programming - Stevens 1.
1 Chapter Client-Server Interaction. 2 Functionality  Transport layer and layers below  Basic communication  Reliability  Application layer.
CSE 486/586 CSE 486/586 Distributed Systems Remote Procedure Call Steve Ko Computer Sciences and Engineering University at Buffalo.
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.
C Tokens Identifiers Keywords Constants Operators Special symbols.
Introduction to Distributed Systems Slides for CSCI 3171 Lectures E. W. Grundke.
Sun RPC also called ONC (Open Network Computing) RPC originally designed for client-server communication for Sun Network File System (NFS) provides an.
Chapter 4: Interprocess Communication‏ Pages
1 XDR External Data Representation Process A XDR Encode/Decode Transport Process B XDR Encode/Decode Transport.
1 Cisco Unified Application Environment Developers Conference 2008© 2008 Cisco Systems, Inc. All rights reserved.Cisco Public Introduction to Etch Scott.
Politecnico di Milano © 2001 William Fornaciari Operating Systems R P C Remote Procedure Call Lecturer: William Fornaciari Politecnico di Milano
NFS : Network File System SMU CSE8343 Prof. Khalil September 27, 2003 Group 1 Group members: Payal Patel, Malka Samata, Wael Faheem, Hazem Morsy, Poramate.
2002 Networking Operating Systems (CO32010) 1. Operating Systems 2. Processes and scheduling 4.
Page 1 Remote Procedure Calls Paul Krzyzanowski Distributed Systems Except as otherwise noted, the content of this presentation.
Netprog: RPC Programming1 RPC Programming with rpcgen Issues: –Protocol Definition File –Client Programming Creating an "RPC Handle" to a server Calling.
Linux RPC Comer Chapter 21 (RPCgen Concept) RFC 1057 – RPC Spec. UNIX Network Programming - Stevens 1.
1 Developing Application in Distributed Computing Environment (DCE)
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.
Slides created by: Professor Ian G. Harris Hello World #include main() { printf(“Hello, world.\n”); }  #include is a compiler directive to include (concatenate)
Remote Procedure Call RPC
Remote Procedure Call and Serialization BY: AARON MCKAY.
Computer Science Lecture 3, page 1 CS677: Distributed OS Last Class: Communication in Distributed Systems Structured or unstructured? Addressing? Blocking/non-blocking?
Chap 35 Remote Procedure Calls RPC allows one host to make a procedure call that appears to be part of a local process (fig 35.1), but is really executed.
RPC Part 3 More Linux RPC. Add RPC program Objectives: Pass multiple arguments from calling program to remote procedure Support multiple procedures within.
IST 201 Chapter 11 Lecture 2. Ports Used by TCP & UDP Keep track of different types of transmissions crossing the network simultaneously. Combination.
Prof. Leonardo Mostarda University of Camerino
CSE 486/586 Distributed Systems Remote Procedure Call
CMSC621: Advanced Operating Systems Advanced Operating Systems
Lecture 4: RPC Remote Procedure Call Coulouris et al: Chapter 5
Process-to-Process Delivery:
7. End-to-end data Rocky K. C. Chang Department of Computing
Govt. Polytechnic,Dhangar
Lecture 4: RPC Remote Procedure Call CDK: Chapter 5
Distributed Program Design
Introduction C is a general-purpose, high-level language that was originally developed by Dennis M. Ritchie to develop the UNIX operating system at Bell.
XDR External Data Representation
Distributed Computing
CS-502, Operating Systems Fall 2009 (EMC)
UNIX Network Programming - Stevens
2. Second Step for Learning C++ Programming • Data Type • Char • Float
Remote invocation (call)
Process-to-Process Delivery: UDP, TCP
Last Class: Communication in Distributed Systems
Presentation transcript:

1 Remote Procedure Calls External Data Representation (Ch 19) RPC Concept (Ch 20)

2 Client / Server Between Systems The Problem: Transfer of data between systems depends on local data representation. This can vary on at least 4 parameters: Data Size : integer may be 16 bits or 32 bits Byte Ordering: Big endian vs. little endian

3 Client / Server Between Systems The Problem: Transfer of data between systems depends on local data representation. This can vary on at least 4 parameters: Data Size : integer may be 16 bits or 32 bits Byte Ordering: Big endian vs. little endian Data Representation: Strings null terminated vs. length + value Alignment: May align on full word boundaries (16 or 32 or 64, etc.)

4 Client / Server Between Systems The Problem: If each program has to accommodate multiple serving platforms, complexity goes up. N 2 problem!! As the number of platforms goes up, the number of combinations becomes: (N)(N-1) 2

5 Client / Server Between Systems One Solution: eXternal Data Representation (XDR) Developed by Sun Microsystems A standard for representing data over the network. Includes a set of library routines for converting data between local format and XDR format (either direction).

6 XDR Data Types int32 bits unsigned int32 bits bool32 bits enum arbitrary hyper64 bits unsigned hyper64 bits float32 bits double64 bits opaque arbitrary String arbitrary fixed arrayarbitrary counted array arbitrary structure arbitrary discriminated union arbitrary. void0 symbolic constant arbitrary optional data arbitrary

7 XDR Data Conversion Objective: –Gather all parameter data into a buffer in XDR format Procedure: –Create a buffer (xdrmem_create)

8 XDR Data Conversion Objective: –Gather all parameter data into a buffer in XDR format Procedure: –Create a buffer (xdrmem_create) #include #define BUFSIZE XDR * xdrs; char buf[BUFSIZE]; xdrmen_create(xdrs, buf, BUFSIZE, XDR_ENCODE);

9 XDR Data Conversion Routines xdr_bool (xdrs, ptrBool); xdr_bytes (xdrs,str,strSize,maxsize); xdr_char (xdrs, ptrChar); xdr_double(xdrs, prtDouble); xdr_enum(xdrs, ptrInt); xdr_float(xdrs, ptrFloat); xdr_int (xdrs, ptrInt); xdr_long (xdrs, ptrLong); xdr_opaque (xdrs, ptrChar, count); xdr_pointer (xdrs, ptrObj, pbjSize, xdrObj); xdrs_short (xdrs, ptrShort); xdrs_u_char (xdrs, ptrUchar); xdrs_u_int (xdrs, ptrUint); xdrs_u_long (xdrs, ptrUlong); xdrs_u_short (xdrs, ptrUshort); xdr_union (xdrs, ptrDiscrim, ptrUnion, choiceFcn, default); xdr_vector (xdrs, ptrArray, size, elemSize, elemProc); xdr_void ( );

10 XDR Data Conversion –Add data items in order to the buffer (after converting to XDR format) int myInt;... myInt = 260; xdr_int(xdrs, &myInt);

11 XDR Data Example Query on remote user. Return logon time, void, or error code.

12 XDR Data Example Query on remote user. Return logon time, void, or error code. const MAX_TIME_BUF = 30; union time_results switch (int status) { case 0:char timeval [MAX_TIME_BUF]; case 1:void; case 2:int reason; };

13 Distributed Programming 2 Approaches Communications Oriented Design –Start with a protocol for distributed communication –Develop Program around that protocol

14 Distributed Programming 2 Approaches Communications Oriented Design –Start with a protocol for distributed communication –Develop Program around that protocol Application Oriented Design –Start with a working Application –Split the program and add a protocol that communicates between segments

15 Applications Conceptual Model Main proc1proc2proc3proc4 proc5proc6proc7

16 Applications Conceptual Model Main proc1proc2proc3 proc5proc6 proc7 proc4

17 Procedural Model 1 machine call A call B MainA B

18 Procedural Model 1 machine / multiple machines call A call B MainA B

19 Remote Procedure Arguments Programming languages use positional notation to identify arguments (1st argument, 2nd argument, etc.) Overhead associated with collecting and managing multiple arguments can be reduced by aggregating the needed procedure arguments into a single passed parameter (e.g. a C language struct). While multiple arguments are allowed with RPC, good programming suggests using only 1.

20 Remote Procedure Call Program Identification Program Name 32 bit value to identify program –0x x1fffffffSun Microsystems –0x x3fffffffLocal procedures –0x x5ffffffftransient –restreserved Program version number Procedure Number

21 RPC Communications Communications Semantics –May be specified using UDP or TCP RPC semantics defined in terms of the underlying protocol. Reliability not enforced by RPC, but by the underlying transport protocol.

22 RPC Retransmission RPC library includes a simple timer and retransmission capability. A response is characterized as “the remote procedure has been executed at least once”. No response is characterized as “the remote procedure was executes 0 or more times”.

23 RPC Retransmission RPC library includes a simple timer and retransmission capability. A response is characterized as “the remote procedure has been executed at least once”. No response is characterized as “the remote procedure was executes 0 or more times”. This implies that procedures that use UDP must be “idempotent”. (Multiple executions do not change the result.)

24 RPC Procedure Location RPC identifies procedures with a 32 bit number. –Allows for far more services than ports available –Typically only a few services running at any time. Need some sort of “directory service” that can correlate desired procedure with a protocol port number. This directory service is called the Portmapper server.

25 RPC Port Identification RPC portmapper at “well known port” 111 Programs register with the portmapper Stores data pairs of the form –(RPC program #, version #): protocol port #

26 Procedure Registration and Use RPC service Port Mapper RPC client

27 RPC Message Passing All data parameters are passed as a single “struct” struct rpc_msg { enum msg_type { unsigned int mesgid; CALL = 0; union switch (msg_type mesgt) REPLY = 1; {}; case CALL: call_body cbody; case REPLY: rply_body rbody; } body; };

28 RPC Message Passing struct call_body { unsigned int rpcvers; unsigned int rprog; unsigned int rprogvers; unsigned int rproc; opaque_auth cred; opaque_auth verf; /* args */ };

29 RPC Message Authentication Two parts to authentication –credentials (what info is provided) –verifier(who vouches for that info) 4 levels of authentication –none –UNIX –short form –secure (DES)

30 Example RPC Message Call to NFS to get attributes for a file Message ID Message type (0 for call) RPC Version Number (2) Remote Program (0x186a3 for NFS) Remote Program Version (2) Remote Procedure (1 for GETATTR) UNIX Authentication Arguments (if any)

31 Summary Remote Procedure Call communications method developed by Sun to facilitate inter-machine / interprocess communications XDR used to manage inter-platform data transfer RPC uses application oriented design approach Portmapper used to locate remote procedures RPC messages structured to maximize data reuse