wireless java rmi
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 PresentationTRANSCRIPT
Wireless Java RMI
Stefano Campadello
Oskari Koskimies, Kimmo RaatikainenDept. of Computer Science, University of Helsinki
Heikki HelinSonera Ltd.
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.
Edoc2000
3
Wireless Environments
– Characteristics– Low bandwidth– Long and variable delays– Sudden or unwanted disconnection– High costs
– connection costs ($/sec)– transmission costs($/byte)
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
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?
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?
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
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%)
Edoc2000
9
RMI Optimization
– Maintain compatibility with Java RMI specifications
– Avoid redundancy in communication protocol
– Use compression and caching to minimize data transmission
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
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
Edoc2000
12
Optimized RMIMobile Node
ClientClientClient
FakeStubsFakeStubFakeStub
ProxyProxyProxy
AgentAgentAgent
MonadsRegistry
MonadsRegistryMonadsRegistry
ClientClientClient
RegistryRegistryRegistry
ServerServerServer
RegistryRegistryRegistry
ServerServerServer
Access Node
Cac
he
Cac
he
Edoc2000
13
Optimized RMIMobile Node
ClientClientClient
FakeStubsFakeStubFakeStub
ProxyProxyProxy
AgentAgentAgent
MonadsRegistry
MonadsRegistryMonadsRegistry
ClientClientClient
RegistryRegistryRegistry
ServerServerServer
RegistryRegistryRegistry
ServerServerServer
Access Node
Cac
he
Cac
he
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?
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%
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)
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
Edoc2000
18
Lookup Results (windows)
Edoc2000
19
Lookup Differences
Edoc2000
20
Invocation ResultsImage Uplink (Linux)
Edoc2000
21
Invocation Results Two-way Text uplink
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