CS490T Advanced Tablet Platform Applications Network Programming Evolution.

Slides:



Advertisements
Similar presentations
Message Passing Vs Distributed Objects
Advertisements

CSE 486/586 Distributed Systems Remote Procedure Call
RPC Robert Grimm New York University Remote Procedure Calls.
Remote Procedure Call Design issues Implementation RPC programming
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.
Copyright © 2001 Qusay H. Mahmoud RMI – Remote Method Invocation Introduction What is RMI? RMI System Architecture How does RMI work? Distributed Garbage.
Remote Procedure CallCS-4513, D-Term Remote Procedure Call CS-4513 Distributed Computing Systems (Slides include materials from Operating System.
Remote Method Invocation
Remote Object Invocation
Distributed Systems Lecture #3: Remote Communication.
Sockets  Defined as an “endpoint for communication.”  Concatenation of IP address + port.  Used for server-client communication.  Server waits for.
CS3771 Today: network programming with sockets  Previous class: network structures, protocols  Next: network programming Sockets (low-level API) TODAY!
Introduction to Remote Method Invocation (RMI)
OCT 1 Master of Information System Management Organizational Communications and Distributed Object Technologies Lecture 5: Distributed Objects.
Remote Procedure CallCS-4513 D-term Remote Procedure Call CS-4513 Distributed Computing Systems (Slides include materials from Operating System Concepts,
Communication in Distributed Systems –Part 2
Client-Server Communication Sockets Remote Procedure Calls Remote Method Invocation (Java)
EEC-681/781 Distributed Computing Systems Lecture 4 Wenbing Zhao Department of Electrical and Computer Engineering Cleveland State University
An Introduction to Internetworking. Algorithm for client-server communication with UDP (connectionless) A SERVER A CLIENT Create a server-socket (listener)and.
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 12 Communicating over.
Remote Procedure CallCS-502 Fall Remote Procedure Call CS-502, Operating Systems Fall 2007 (Slides include materials from Operating System Concepts,
CSE 486/586 CSE 486/586 Distributed Systems Remote Procedure Call Steve Ko Computer Sciences and Engineering University at Buffalo.
CS 390- Unix Programming Environment CS 390 Unix Programming Environment Topics to be covered: Distributed Computing Fundamentals.
Lecture 15 Introduction to Web Services Web Service Applications.
11 September 2008CIS 340 # 1 Topics To examine the variety of approaches to handle the middle- interaction (continued) 1.RPC-based systems 2.TP monitors.
Introduction to Distributed Systems Slides for CSCI 3171 Lectures E. W. Grundke.
CS 153 Design of Operating Systems Spring 2015 Lecture 23: Inter-Process Communication (IPC) and Remote Procedure Call (RPC)
1 Java RMI G53ACC Chris Greenhalgh. 2 Contents l Java RMI overview l A Java RMI example –Overview –Walk-through l Implementation notes –Argument passing.
1 Lecture 5 (part2) : “Interprocess communication” n reasons for process cooperation n types of message passing n direct and indirect message passing n.
 Remote Procedure Call (RPC) is a high-level model for client-sever communication.  It provides the programmers with a familiar mechanism for building.
IT 344: Operating Systems Winter 2008 Module 19 Networking & Remote Procedure Call (RPC) Chia-Chi Teng CTB 265.
CSE 451: Operating Systems Winter 2015 Module 22 Remote Procedure Call (RPC) Mark Zbikowski Allen Center 476 © 2013 Gribble, Lazowska,
Distributed Computing A Programmer’s Perspective.
Page 1 Remote Procedure Calls Paul Krzyzanowski Distributed Systems Except as otherwise noted, the content of this presentation.
Hwajung Lee.  Interprocess Communication (IPC) is at the heart of distributed computing.  Processes and Threads  Process is the execution of a program.
Remote Procedure CallCS-502 Fall Remote Procedure Call (continued) CS-502, Operating Systems Fall 2007 (Slides include materials from Operating System.
Remote Procedure Call RPC
1 Chapter 38 RPC and Middleware. 2 Middleware  Tools to help programmers  Makes client-server programming  Easier  Faster  Makes resulting software.
Lecture 4 Mechanisms & Kernel for NOSs. Mechanisms for Network Operating Systems  Network operating systems provide three basic mechanisms that support.
Computer Science Lecture 3, page 1 CS677: Distributed OS Last Class: Communication in Distributed Systems Structured or unstructured? Addressing? Blocking/non-blocking?
UNIX Sockets Outline UNIX sockets CS 640.
Distributed objects and remote invocation Pages
1 RMI Russell Johnston Communications II. 2 What is RMI? Remote Method Invocation.
© Oxford University Press 2011 DISTRIBUTED COMPUTING Sunita Mahajan Sunita Mahajan, Principal, Institute of Computer Science, MET League of Colleges, Mumbai.
Distributed Systems Lecture 8 RPC and marshalling 1.
Computer Science Lecture 4, page 1 CS677: Distributed OS Last Class: RPCs RPCs make distributed computations look like local computations Issues: –Parameter.
Distributed Computing & Embedded Systems Chapter 4: Remote Method Invocation Dr. Umair Ali Khan.
Topic 4: Distributed Objects Dr. Ayman Srour Faculty of Applied Engineering and Urban Planning University of Palestine.
Distributed Web Systems Distributed Objects and Remote Method Invocation Lecturer Department University.
Object Interaction: RMI and RPC 1. Overview 2 Distributed applications programming - distributed objects model - RMI, invocation semantics - RPC Products.
03 – Remote invoaction Request-reply RPC RMI Coulouris 5
CSE 486/586 Distributed Systems Remote Procedure Call
MCA – 405 Elective –I (A) Java Programming & Technology
Programming Models for Distributed Application
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
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
CS-502, Operating Systems Fall 2009 (EMC)
An Introduction to Internetworking
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
Last Class: Communication in Distributed Systems
CSE 451: Operating Systems Messaging and Remote Procedure Call (RPC)
Presentation transcript:

CS490T Advanced Tablet Platform Applications Network Programming Evolution

Introduction Programming network applications has evolved with programming languages Programming network applications has evolved with programming languages Tools have been created at each step to make distributed applications as easy as writing local applications. Tools have been created at each step to make distributed applications as easy as writing local applications.

BSD Sockets Network sockets were introduced in the UNIX Berkeley Standard Distributions (BSD UNIX) Network sockets were introduced in the UNIX Berkeley Standard Distributions (BSD UNIX) They provided a common API to the TCP/IP stacks They provided a common API to the TCP/IP stacks They were written generically enough to be used for other protocols different than TCP/IP. That made them awkward to use. They were written generically enough to be used for other protocols different than TCP/IP. That made them awkward to use.

BSD Sockets They were very successful because they provided a portability path for network applications. They were very successful because they provided a portability path for network applications. An application written with sockets can be easily ported to other UNIX systems or Windows. An application written with sockets can be easily ported to other UNIX systems or Windows. Sockets provide a Sockets provide a –Stream interface for TCP –Message based interface for UDP

TCP Sockets In the stream interface for TCP reading/writing to the other network peer will be similar to reading/writing to a file or pipe. In the stream interface for TCP reading/writing to the other network peer will be similar to reading/writing to a file or pipe.

TCP Sockets Server Side The server does: The server does: Ms = Socket(…) – creates socket Bind(…) – bind socket to a specific port Listen(…) – puts socket in listen mode While(1) { ss = accept(ms, …) // Accept connection read(ss, …) // Read request write(ss, …) // Write reply write(ss, …) // Write reply}

TCP Sockets Client Side The client does the following The client does the following s= socket(…) // Creat socket bind(s, …) // Bind socket to a port connect(s) // Connect to server write(s, …) // Write request read(s,…) // Read reply close(s)

Disadvantage of Socket Programming Too complicated Too complicated Error prone. So many calls, so many possibilities of error. Error prone. So many calls, so many possibilities of error. Every communication detail has to be explicitly programmed. Every communication detail has to be explicitly programmed.

Examples of Socket Applications Lots of applications are implemented using sockets: Lots of applications are implemented using sockets: –FTP, SMTP, Finger, HTTP, …

Remote Procedure Calls (RPC) Abstract the network communication as a procedure call. Abstract the network communication as a procedure call. A program uses a method exported remotely as if it were local. A program uses a method exported remotely as if it were local. The interface of the procedure is described in a RPC description language. The interface of the procedure is described in a RPC description language. The RPC description is processed with an RPC preprocessor that generates code for the client and the server. The RPC description is processed with an RPC preprocessor that generates code for the client and the server.

RPCs Client Side For the client side the code generated includes procedure stubs that For the client side the code generated includes procedure stubs that –Defines the procedure with the same arguments –Connects to the remote server –Takes the arguments and send them through the network (marshaling). –Waits for a reply –Copies the result to the result of the procedure and returns. –The programmer uses these stubs transparently as if the procedures were executed locally.

RPC Server Side The RPC processor generates for the server a dispatcher server code that The RPC processor generates for the server a dispatcher server code that –Initializes the sockets –Starts the serving loop waiting for a new request –When a request arrives it copies the data from the network to the argument buffer (unmarshalling) –It invokes the procedure corresponding to the RPC id. –It sends the results of the procedure to the other side (marshaling) –The programmer of the server only implements the procedures themselves. The communication part is generated by the RPC processor.

RPC Issues The representation of numbers, strings etc. may be different in different machines. The representation of numbers, strings etc. may be different in different machines. In sockets that is not usually a problem since the communication is textually based in ASCII format. In sockets that is not usually a problem since the communication is textually based in ASCII format. In RPCs the data is sent in binary form. This saves processing time since no ASCII to decimal conversion is necessary but may cause problems in machines of different architecture. In RPCs the data is sent in binary form. This saves processing time since no ASCII to decimal conversion is necessary but may cause problems in machines of different architecture. The RPC generator also generates filters that convert the binary data if necessary. The RPC generator also generates filters that convert the binary data if necessary.

RPC Issues In SUN RPC, the data is always converted to an External Data Representation (XDR) before sending. In SUN RPC, the data is always converted to an External Data Representation (XDR) before sending. The data is converted back to the representation of the local machine when received. The data is converted back to the representation of the local machine when received. In RPC’s arguments and results can be passed only by value (int, string, float etc) In RPC’s arguments and results can be passed only by value (int, string, float etc) It is not possible to send data by reference (Object *this) so it is not easy to write object oriented programs. It is not possible to send data by reference (Object *this) so it is not easy to write object oriented programs.

RPC Examples The best known implementation of RPC’s is SUNRPC The best known implementation of RPC’s is SUNRPC SUNRPC defines an RPC language and provides an RPC processor called RPCgen SUNRPC defines an RPC language and provides an RPC processor called RPCgen Applications such as NFS, rusers, mount, yellow pages are implemented in SUN RPC. Applications such as NFS, rusers, mount, yellow pages are implemented in SUN RPC.

Remote Method Invocation (RMI) It was created because of the limitations that RPC has handling references to objects. It was created because of the limitations that RPC has handling references to objects. In RMI a reference to a remote object is represented as a pointer to a local representation to the object called “Proxy”. In RMI a reference to a remote object is represented as a pointer to a local representation to the object called “Proxy”. A method invocation to the proxy is forwarded to the remote object. A method invocation to the proxy is forwarded to the remote object. Invoking methods in the proxy will be transparent and it will look like we are invoking methods in the object as if it were local. Invoking methods in the proxy will be transparent and it will look like we are invoking methods in the object as if it were local.

Proxy Creation/Deletion When a reference to a remote object is received, a new proxy is created. When a reference to a remote object is received, a new proxy is created. When the reference to the remote object is no longer needed, the proxy is deleted. When the reference to the remote object is no longer needed, the proxy is deleted. Some cooperation from the local garbage collector is needed to identify unneeded proxies. Some cooperation from the local garbage collector is needed to identify unneeded proxies. Remote objects are removed when tere are no longer remote proxies pointing to it. Remote objects are removed when tere are no longer remote proxies pointing to it.

RMI Examples The proxy code is generated by a processor from a RMI description. The proxy code is generated by a processor from a RMI description. Some examples of RMI are: Java RMI, CORBA Orbix, DCOM, Modula 3 Remote Objects. Some examples of RMI are: Java RMI, CORBA Orbix, DCOM, Modula 3 Remote Objects.