22
Wireless Java RMI Stefano Campadello Oskari Koskimies, Kimmo Raatikainen Dept. of Computer Science, University of Helsinki Heikki Helin Sonera Ltd.

Wireless Java RMI

  • Upload
    ratana

  • View
    51

  • Download
    0

Embed Size (px)

DESCRIPTION

Wireless Java RMI. Stefano Campadello Oskari Koskimies, Kimmo Raatikainen Dept. of Computer Science, University of Helsinki Heikki Helin Sonera Ltd. Monads. ww.cs.helsinki.fi/research/monads Investigating the use of Adaptive Agents for Nomadic Users Intelligent & Mobile Agents - PowerPoint PPT Presentation

Citation preview

Page 1: Wireless Java RMI

Wireless Java RMI

Stefano Campadello

Oskari Koskimies, Kimmo RaatikainenDept. of Computer Science, University of Helsinki

Heikki HelinSonera Ltd.

Page 2: Wireless Java RMI

Edoc2000

2

Monads

ww.cs.helsinki.fi/research/monads

– Investigating the use of Adaptive Agents for Nomadic Users– Intelligent & Mobile Agents

– Partners: Nokia (M.P. and R.C.), Sonera and Tekes.

Page 3: Wireless Java RMI

Edoc2000

3

Wireless Environments

– Characteristics– Low bandwidth– Long and variable delays– Sudden or unwanted disconnection– High costs

– connection costs ($/sec)– transmission costs($/byte)

Page 4: Wireless Java RMI

Edoc2000

4

Remote Method Invocation

– RMI protocol interface lets Java objects on different hosts communicate with each other in a transparent way

– Clients can invoke methods of a remote object as if they were local methods

– Preserve the object oriented paradigm in distributed computing

Page 5: Wireless Java RMI

Edoc2000

5

Java RMI in a NutshellClient Server

RegistryRegistryRegistry

ServerServerServer

Server-stubStub-serverStub-server

DGC messages

ClientClientClient

Send the me stub

StubStub

Here is the stub

Hello is here

invokeMethod()

“ReturnValue”

Lookup(): where is Hello?

Page 6: Wireless Java RMI

Edoc2000

6

Java RMI in a NutshellClient Server

RegistryRegistryRegistry

ServerServerServer

Server-stubStub-serverStub-server

DGC messages

ClientClientClient

Send the me stub

StubStub

Here is the stub

Hello is here

invokeMethod()

“ReturnValue”

Lookup(): where is Hello?

Page 7: Wireless Java RMI

Edoc2000

7

“Hello World” Example

TCP 1

Header

Protocol Ack, EPId

EPId, Lookup()

ServerRef

Header

Protocol Ack, EPIdEPId, dirty()

LeasePing

Ping Ack

DGCAck

Ping

Ping Ack

sayHello()

“Hello World”

clean()

clean result

...

TCP 2

ParallelParallel

Client Registry Server

Page 8: Wireless Java RMI

Edoc2000

8

Data traffic analysis

Client to Server andRegistry(bytes)

Server andRegistry to

Client(bytes)

Total(bytes)

Registry Lookup 55 (6%) 276 (42%) 331 (20%)Invocation Data 41 (4%) 37 (6%) 78 (5%)

DGC Data 831 (85%) 305 (46%) 1136 (69%)ProtocolOverhead

52 (5%) 40 (6%) 92 (6%)

Total 979 (100%) 658 (100%) 1637 (100%)

Page 9: Wireless Java RMI

Edoc2000

9

RMI Optimization

– Maintain compatibility with Java RMI specifications

– Avoid redundancy in communication protocol

– Use compression and caching to minimize data transmission

Page 10: Wireless Java RMI

Edoc2000

10

Java RMI Optimization

– Protocol– Use of Mediators to minimize the exchange

of data through the wireless link.

– Data Communication– Optimized Communication: Compress and

Optimize data communication

– Stub&Class Loading– If possible, avoid to download stubs

Page 11: Wireless Java RMI

Edoc2000

11

Protocol Optimization

– The idea is to de-couple the connection between the client and the server using mediators.

Wireless Link

Mobile Node

RMIAgentRMIAgent

ClientClient

RMIProxyRMIProxy

NamingNaming

Access Node

Page 12: Wireless Java RMI

Edoc2000

12

Optimized RMIMobile Node

ClientClientClient

FakeStubsFakeStubFakeStub

ProxyProxyProxy

AgentAgentAgent

MonadsRegistry

MonadsRegistryMonadsRegistry

ClientClientClient

RegistryRegistryRegistry

ServerServerServer

RegistryRegistryRegistry

ServerServerServer

Access Node

Cac

he

Cac

he

Page 13: Wireless Java RMI

Edoc2000

13

Optimized RMIMobile Node

ClientClientClient

FakeStubsFakeStubFakeStub

ProxyProxyProxy

AgentAgentAgent

MonadsRegistry

MonadsRegistryMonadsRegistry

ClientClientClient

RegistryRegistryRegistry

ServerServerServer

RegistryRegistryRegistry

ServerServerServer

Access Node

Cac

he

Cac

he

Page 14: Wireless Java RMI

Edoc2000

14

Optimized Remote InvocationRMI AgentRMI Agent RegistryRegistry ServerServer

Header

Protocol Ack

Lookup() lookup

ServerRef

dirty()

Lease

ClientClient RMI ProxyRMI Proxy

In cache?

Lookup()

InternalRef

AgentRef Cache and markfor sync First?

Header

Protocol AckHeader

Protocol Ackdirty()

Leasecount[ref]++

DGCAckHeader

Protocol Ack

DGCAck

sayHello () sayHello()sayHello ()

“Hello World”“Hello World”“Hello World”

clean()

clean resultclean resultclean result

...clean() clean()Last?

Page 15: Wireless Java RMI

Edoc2000

15

Comparison between Normal RMI and Optimized RMI

RegistryInvocation

RemoteInvocation

Total

Java RMI 7.1 sec 1.3 sec 8.4 secOptimized

RMI1.7 sec 0.6 sec 2.3 sec

Improvement 417% 216% 365%

Page 16: Wireless Java RMI

Edoc2000

16

Test Arrangments

– Operating Systems– Clients:

– Windows98– Linux (Red Hat 6.1, kernel 2.2.14)

– Server– Windows NT (SP 6)– Linux (Red Hat 6.1, kernel 2.2.14)

Page 17: Wireless Java RMI

Edoc2000

17

Test Arrangements

– Java Virtual Machine– Sun JDK 1.2.2 (Linux and Windows)

– Wireless communication– GSM HSCSD (5 configurations)

– Benchmark Suite– KaRMI from University of Karlsruhe

Page 18: Wireless Java RMI

Edoc2000

18

Lookup Results (windows)

Page 19: Wireless Java RMI

Edoc2000

19

Lookup Differences

Page 20: Wireless Java RMI

Edoc2000

20

Invocation ResultsImage Uplink (Linux)

Page 21: Wireless Java RMI

Edoc2000

21

Invocation Results Two-way Text uplink

Page 22: Wireless Java RMI

Edoc2000

22

Conclusions

– Designers cannot just “plug-in” wireless communication to existing solutions

– Wireless issues extend their influence also to middleware component and eventually to applications

– Solutions are there, just mostly ignored