rpc, rmi and webservices 2

25
By Jihed Othmani Jing Wang Karim Jouini Mathieu Martin 1

Upload: groupe0d

Post on 25-May-2015

3.845 views

Category:

Technology


7 download

TRANSCRIPT

Page 1: Rpc, Rmi And Webservices 2

ByJihed Othmani

Jing WangKarim Jouini

Mathieu Martin

1

Page 2: Rpc, Rmi And Webservices 2

OutlineThe needRPC (Remote Procedure Call)

Quick introduction Samples Advantages & disadvantages Future?

RMI (Remote Method Invocation) Quick introduction Samples Advantages & disadvantages Future?

WebServices Quick introduction Samples Advantages & disadvantages

Recap & Conclusion2

Page 3: Rpc, Rmi And Webservices 2

The NeedMore and more devices are connected,

tempting us to take advantage of their computational capabilities.

We would like to communicate, reuse code, share services.There are a lot of opportunities to leverage

services offered by others and to make your application publicly available.

Provide a service without sharing code.So : we need a standardization of protocols to

ease communication at the application layer.That’s what we call middlewares.

3

Page 4: Rpc, Rmi And Webservices 2

4

Page 5: Rpc, Rmi And Webservices 2

RPC – Quick IntroductionFirst system to address the need to communicate

across process’ and machines boundaries.RPC was first described in 1976 by the RFC707.Xerox used RPC in the popular software “courier”,

1981.

Paradigm: The client process has to “know” the serving process

and instantiates the communication.The client process calls a distant procedure and

waits for the response (or fail).

5

Page 6: Rpc, Rmi And Webservices 2

RPC – SamplesA “simple” server (part 1)

6

Page 7: Rpc, Rmi And Webservices 2

A “simple” server (part 2)

7

Page 8: Rpc, Rmi And Webservices 2

A “simple” client using our previous server

8

Page 9: Rpc, Rmi And Webservices 2

RPC – AdvantagesAdvantages :

Very simple logic and very low level, gives to the programmer a lot of freedom to implement different mechanisms on top of it.

Can be implemented by any language (including C !).

RPC exists since 1976, so its maturity and solidity are undoubted.

9

Page 10: Rpc, Rmi And Webservices 2

RPC – DisadvantagesUsing RPC can become very complex

The complexity is exposed as the number of procedures

Interaction with such a module requires using all these interfaces in the right way and sequence.

A lot of code is needed for even simple applications.RPC gives no answer to fundamental questions:

How to find peers ? How to distribute the workload over multiple servers? How failure and recovery should be handled? How to send/receive complex data structures. Security? Sasser, blaster, etc … Are RPC-vulnerability

exploitsThere are multiple different and incompatible RPC

protocols.10

Page 11: Rpc, Rmi And Webservices 2

RPC – Future ?RPC is way too complex to be used as

middleware in modern software.RPC can be used as low level layer for more

powerful middleware layers, that would be able to provide us with :OOPLoad balancingFailure detection/correctionEtc …

11

Page 12: Rpc, Rmi And Webservices 2

12

Page 13: Rpc, Rmi And Webservices 2

RMI – Quick IntroductionThe Java Remote Method Invocation API, or Java

RMI, is a Java application programming interface for performing the object equivalent of Remote Procedure Calls.

There are two common implementations of the API. Java Remote Method Protocol (JRMP)In order to support servers running in a non-JVM

context, a CORBA version was later developed.

Uses HTTP or IIOP as communication layer. 13

Page 14: Rpc, Rmi And Webservices 2

RMI – SamplesHere is a Server publishing a “Hello” Object

14

Page 15: Rpc, Rmi And Webservices 2

RMI – SamplesHere is client invoking the previous “Hello”

Object and calling “HelloFromServer()” On it !

15

Page 16: Rpc, Rmi And Webservices 2

RMI – Advantages & disadvantagesAdvantages

Java, so portable and Oriented Object.NAT-Firewall traversal capabilities.Asynchronous possibilities with ARMI (Async’-RMI).Easier to use and setup than CORBA.RDMI enables dynamic invocation.First attempt to address security.Latest versions are CORBA-compatible (using IIOP).

DisadvantagesJava only…

16

Page 17: Rpc, Rmi And Webservices 2

RMI – Future ?RMI still needs to find answers to:

How to implement real server-level security ?How to perform load balancing ?How to use RMI in other languages ?

17

Page 18: Rpc, Rmi And Webservices 2

18

Page 19: Rpc, Rmi And Webservices 2

Web Services – Quick IntroductionA software system designed to support

interoperable machine-to-machine interaction over a network.

It refers to clients and servers that communicate over the HTTP protocol used on the Web.

Web services range from such major services as storage management down to much more limited services such as the furnishing of a stock quote.

19

Page 20: Rpc, Rmi And Webservices 2

Web Services – Advantages Universal Support. Protocol not Platform. Low Product Costs. Evolutionary thanks to XML. Business Oriented. The standardized nature of the pieces that implement a Web

service solves many problems related to intersystem communication. For example:

The HTTP standard allows more systems to communicate with one another.

SOAP (built on XML) standardizes the messaging capability on different systems.

UDDI standardizes the publishing and finding of Web services. WSDL standardizes the description of Web services, so providers and

requesters speak the same language.

Opportunities to take advantage of services offered by others and to make your applications available to others as a Web service. Mashups (ex: Jogli.com)

20

Page 21: Rpc, Rmi And Webservices 2

Web Services – Disadvantages No security standards: Web services are exposed to the

public using http-based protocols.Adopting open security standards like SSL or XML-

encryption may be a solution.Processing time and data traffic costs are significantly

higherVery verbose : Multiplication of the conveyed information

mass.But:

To buy a faster CPU is cheaper than employing a programmer and systems administrator capable of handling RMI.

Performance differences less marked for more realistic applications than for toys like “calculator”.

You can use cloud systems to easily scale.No load balancing at the protocol level.

21

Page 22: Rpc, Rmi And Webservices 2

Web Services – SamplesGoogle's Web Service - access the Google

search engine.Amazon's Web Service - access Amazon's

product information .XMethods - collection of information about

existing Web services.Getting the last stock quote.

22

Page 23: Rpc, Rmi And Webservices 2

23

Page 24: Rpc, Rmi And Webservices 2

Recap

24

RPC RMI Web Services

Birth 1976 - 1981 ~ 1990 ~ 2000

Platform Library and OS-dependant

Java Independent

Transport OS-Dependent

HTTP or IIOP HTTP(s)

Dev Cost Huge Reasonable Low

Security None Client-level Transport Level

Overhead None OOP + HTTP XML + HTTP

Dynamic invocation

None Yes, using RDMI

Natural

Versioning Huge problem Possible using RDMI

Natural

Service lookup Impossible Java Naming and Directory

UDDI

Page 25: Rpc, Rmi And Webservices 2

25