MobileSocket Toward Continuous Operation for Java Applications Tadashi OKOSHI Graduate School of...

Preview:

Citation preview

MobileSocketToward Continuous Operation for Java Applications

Tadashi OKOSHIGraduate School of Media and Governance

Keio University, JAPAN

slash@ht.sfc.keio.ac.jp

Eighth International Conference on Computer Communication and NetworksIEEE ICCCN’99 October 11-13, 1999 @Boston, USA

Research Abstract Goal: Communication Continuity

for network applications for users’ Work Continuity

MobileSocket… Is an application layer approach

implemented as an user-level library. Is effective for

Conventional Network Application Java Mobile Applications

With MobileSocket library… Java network applications can continue

their communication with the one continuous socket connection, even after the mobile host’s relocation.

No need to modify source code Additional APIs for adaptation

Today’s Outline 1. Research Background 2. Communication Continuity MobileSocket

3. Design 4. Implementation 5. Programming & Applications 6. Evaluation

7. Conclusion & Future Work

1. Background Mobile Computing Environment

Mobile hosts and users move around network even during applications are communicating with the remote.

Mobile HostMobile Host

Internet

AA

AA

BB

1. Background (Cont’d) Research Goal

To realize users’ “Continuous Operation”supported by the continuous behavior of applications

For network applications… “Communication Continuity” with

remote

2. Communication Continuity Communication Continuity consists

of… “Mobility” “Virtual Circuit Continuity”

Other Issues

“Mobility” Capability of the protocol

functionality in the both communication endpoints to identify each otheridentify each other independent of the location changes of the endpoints.

E.g.: Mobile IPIdentify each other

(Location Transparent ID)

“Virtual Circuit Continuity” Capability of keeping a virtual keeping a virtual

circuitcircuit connectionconnection alive, retaining reliability and the byte stream the byte stream consistencyconsistency independent of the location changes of the endpoints.

E.g.: TCP-R

Keep a virtual circuit connection

Toward Communication Continuity

For applications with… Datagram communication (e.g.UDP/IP)

Mobility support Virtual circuit communication (e.g.TCP/IP)

Mobility support Virtual circuit continuity support

⇒ Both “Mobility” and “VC Continuity” supports   are the requirements for communication continuity.

Other Issues for CommunicationContinuity Support

2) Simplified and minimized implementation

3) Avoidance of modification in existing applications

4) Adaptation interfaces for MobileSocket-aware applications

3. MobileSocket Design (1) mobility and connection continuity

support in application layerin application layer Dynamic Socket Switching (DSS) Application Layer Window (ALW)

(2) User-level library in Java (3) Supports both implicit & explicitimplicit & explicit

redirection operations (4) Adaptation APIs for applications

(1) Application Layer Approach

Application

IP Laye

rTCP Layer

Socket

Layer

Mobile IP

TCP-R

MSOCKM

obileSock

et Laye

r

MobileSocketApplication

Dynamic Socket Switching

IPCH

CH

CH

CH

IPMH1

MH1

MH1

MH1

Application(MobileHost)Application

(CorrespondentHost)

Internal SocketConnection (1)

Before

IP Laye

rTCP Layer

Socket

Layer

Mobile

Socket

Layer

Dynamic Socket Switching

IP Laye

rTCP Layer

Socket

Layer

Mobile

Socket

Layer

IPCH

CH

CH

CH

IPMH1

MH1

MH1

MH1

IPMH2

MH2

MH2

Application(MobileHost)

After

Application(Correspondent

Host)

Relocation

Internal SocketConnection (2)

Application Layer Window (ALW) User-level sliding window inside library Provides Byte Stream Consistency

MobileSocketin Sender

MobileSocketin Receiver

DataSocketDataData DataData

ACKACK

DataData

Application Application

ALW

DataData

ACKACK ACKACK

DataData

ALW_COUNTERALW_COUNTER

write() read()

recvflush

writestore

count

read

send

ControlSocket

(2) User-Level Library

TCP/UDP

IP

Socket interface

TCP/UDP

IP

Socket interface

Application Application

Application Application

MobileSocket libMobileSocket lib MobileSocket libMobileSocket lib

(Mobile-IP)

(TCP-R)(MSOCKS)

(3) Connection Redirection Schemes

Implicit Redirection Mechanism by which a connection is

automatically redirected such that application is unaware of the relocation.

No need to modify and insert any additional lines to applications

No adaptability in applications behavior Explicit Redirection

(4) Explicit Redirection & Adaptation Interfaces

Implicit Redirection Explicit Redirection

Mechanism by which the application programmers can explicitly specify where the connection redirection takes place

Realized by specific APIs (suspend(); resume();suspend(); resume(); ) Adaptive behavior of application Need to modify application’s source code

4. MobileSocket Implementation State Transition Diagram Time Sequence

Connection Establishment Implicit Redirection Explicit Redirection

EstablishedEstablishedImplicitlySuspendedImplicitly

SuspendedExplicitly

SuspendedExplicitly

Suspended

ClosedClosedConnected to Server (DSS-EstablishmentPhase(Client) )

Connected from Client (DSS-EstablishmentPhase(Server) )

Lost IP address

Get IP address (Reconnect to CH, DSS-

ImplicitResume Phase)

Reconnected from MH(DSS-ImplicitResume Phase)

Called suspend()suspend() (send SUSPEND_SIGNAL, DSS-ExplicitSuspend Phase)

Called resume()resume() (Reconnect to CH, DSS- ExplicitResume Phase)

reconnected from MH(DSS-ExplicitResume Phase)

received SUSPEND_SIGNAL (DSS-ExplicitSuspend Phase)

DataSocket broken-pipe

Reconnected from MH(DSS-ImplicitResume Phase)

Called close()close()(close connection)

Called close()close()or timedout

(close connection)

Called close()close()(close connection)

Called close()close()(close connection)

Called close()close()or timedout

(close connection)

Normal Transitions for CHNormal Transitions for MH

Normal Transitions for ClientNormal Transitions for Server

Transition trigger(action)

START POINTSTART POINT

StateState

DSS(1) Establishment Phase

ClientClient ServerServerDataDataSocketSocket

ControlControlSocketSocket

connectconnect accept()accept()

ControlSocket port, AuthenticationSEED1

accept()accept()connect()

ACK

AuthenticationSEED1

DS

S-E

sta

blis

hm

ent

Ph

as

e

RedirectionRedirectionServSocketServSocket

RedirectionServer port, Next_SEED

Data

ALW ACK

DataDataSocketSocket

ControlControlSocketSocket

RedirectionRedirectionServSocketServSocket

CreateCreateSocketSocket

CreateCreateSocketSocket

CreateCreateSocketSocket

CreateCreateSocketSocket

DSS(2) Explicit Suspend Phase

Mobile HostMobile Host Correspondent HostCorrespondent HostDataDataSocketSocket

ControlControlSocketSocket

lock

ACK

SUSPEND_SIGNAL

DSS

-Exp

licitS

uspe

nd P

hase

RedirectionRedirectionServSocketServSocket

WRITE_COUNTER

DataDataSocketSocket

ControlControlSocketSocket

RedirectionRedirectionServSocketServSocket

lock

Compute DIFF Compute DIFF

Invoke Suspend SubPhase(if DIFF>0)

Invoke Suspend SubPhase(if DIFF>0)

ACK (DIFF_IS_ZERO)

CloseClose

Close

Susp

end

SubP

hase

DSS(3) Explicit Resume Phase

ControlControlSocketSocket

connect() accept()

ACK, ControlSocket port, AuthenticationSEED3

accept()connect()

ACK

AuthenticationSEED3

DSS

-Exp

licitR

esum

e Ph

ase

RedirectionRedirectionServSocketServSocket → DataSocket → DataSocket

RedirectionServer port, Next_SEED

Data

ALW ACK

DataDataSocketSocket

ControlControlSocketSocket

RedirectionRedirectionServSocketServSocket

Mobile HostMobile Host Correspondent HostCorrespondent HostNewNewRedirectionRedirectionServSocketServSocket

Next_SEED

unlock unlock

CreateSocketCreate

Socket

CreateSocket

DSS(4) Implicit Redirection

ControlSocket

connect() accept()

ACK, ControlSocket port, AuthenticationSEED3

accept()connect()

ACK

AuthenticationSEED3

DSS

-Impl

icitR

esum

e Ph

ase

RedirectionServSocket → DataSocket

RedirectionServer port, Next_SEED

DataSocket

ControlSocket

RedirectionServSocket

NewRedirectionServSocket

Next_SEED

unlock

READ_COUNTER

unACKed Data retransmit

~ disconnected~lose IP

get IP

CreateSocket

CreateSocket

CreateSocket

CreateSocket

ControlSocket

connect() accept()

ACK, ControlSocket port, AuthenticationSEED3

accept()connect()

ACK

AuthenticationSEED3

DSS

-Impl

icitR

esum

e Ph

ase

RedirectionServSocket → DataSocket

RedirectionServer port, Next_SEED

DataSocket

ControlSocket

RedirectionServSocket

Mobile HostMobile Host Correspondent HostCorrespondent HostNewRedirectionServSocket

Next_SEED

unlockunlock

READ_COUNTER

unACKed Data retransmit

~ disconnected~lose IPlose IP

get IPget IP

CreateSocket

CreateSocket

CreateSocket

CreateSocket

Disconnection Recognition in MH java.net.InetAddress#getLocalHost

returns IP address based on DNS.

“Checker” Thread as a adhoc solution Disconnection

(1)get local IP from java.net.Socket#getLocalAddress (2)make Socket to local IP address periodically.

Reconnection (1) make Socket to Correspondent Host IP address periodically.

5. Programming & Applications Class

Socket sock = new Socket(host, port);Socket sock = new Socket(host, port); MobileMobileSocket sock = new Socket sock = new MobileMobileSocket(host, port);Socket(host, port);

Explicit Redirection (Option) sock.suspend();sock.suspend(); sock.resume(); sock.resume();

Adaptation Event (Option) MobilityEventMobilityEvent Event , MobilityListenerMobilityListener Interface

Applications with MobileSocket “Serializable” MobileSocket class

for Mobile Applications and Agents

AppBAppB

Host-B

Host-A

AppAAppA

AppA’ObjectSerialization

MSockA (SocketX)

MSockA (SocketY)

Host-C

Applications with MobileSocket MobileSocket Exchanging

Host-A Host-B

Host-C

AppAAppA

AppCAppC

AppBAppBMSockA MSockB

MSockA’Send “MobileSocket” Objectvia ObjectSerialization

6. Evaluation Performance Measurement

Explicit Redirection Comparison with Related Works

Measurement Environment

Implementation JavaCoreAPI 1.1 jp.ac.keio.sfc.ht.MobileSocketjp.ac.keio.sfc.ht.MobileSocket package

Evaluation Environment Dynabook SS-R590 (Pentium 90MHz, 40MB) for MH S

ony PCG-737 (PentiumMMX 233MHz, 64MB) for CH Closed 10Base-T Network FreeBSD2.2.1R + JDK 1.1.6.V98-9-23 for FreeBSD

Performance Results at MH

Redirection Time (ms)Explicit Suspending 46.67Explicit Resuming 270.28Implicit Resuming 317.78

Explicit Redirection Performance Explicit Suspending

Steps Time (ms) %manage phase transition 1.76 3.77lock Socket 7.40 15.86kill sub-thread 8.12 17.40send SUSPEND_SIGNAL 1.17 2.50send WRITE_COUNTER 5.35 11.46receive ACK from CH 11.01 23.59receive port number 1.11 2.38receive auth seed 1.85 3.96close Socket 3.28 7.03prepare info of next Socket 1.02 2.19misc 4.60 9.86Total 46.67 100.00

Steps Time (ms) %make new Socket 80.75 29.88switch Socket in stream 0.36 0.13auth check for DataSocket 2.95 1.09receive port of ControlSocket 1.11 0.41receive auth seed 1.89 0.70make new ControlSocket 80.80 29.90auth check for ControlSocket 3.30 1.22make new NextServerSocket 60.44 22.36exchange next port and seed 6.62 2.45restart sub thread 26.56 9.83manage phase transition 0.90 0.33misc 4.60 1.70Total 270.28 100.00

Steps Time (ms) %make new Socket 80.75 29.88switch Socket in stream 0.36 0.13auth check for DataSocket 2.95 1.09receive port of ControlSocket 1.11 0.41receive auth seed 1.89 0.70make new ControlSocket 80.80 29.90auth check for ControlSocket 3.30 1.22make new NextServerSocket 60.44 22.36exchange next port and seed 6.62 2.45restart sub thread 26.56 9.83manage phase transition 0.90 0.33misc 4.60 1.70Total 270.28 100.00

82.14%

Explicit Redirection Performance Explicit Resuming

Comparison with Related Works

Name Layer Connection Implementation Continuity MH CH Others

Mobile-IP IPIP Limited Limited KK HA,FAHA,FATCP-R TCPTCP Yes Yes KK KK - -MSOCKS SocketSocket Limited Limited U U ProxyProxy MobileSocket SocketSocket Yes Yes U U U U - -

upperupper

7. Conclusion Conclusion

Application Layer Mobility and Connection Continuity

User-Level library in Java Implicit & Explicit Redirection for Conventional Apps. & Mobile Apps.

Future Work More Optimization Security Issues

Fin

Eval.1 MobileSocket Overhead Conventional Java.net.Socket 100 MobileSocket (contains Mobility

Support)80?

90?

Eval.2 Socket Creation Overhead Why is Socket Creation so heavy

in Java? Where is bottle neck? C & Java

Java 80.4ms (71ms object constructor)

C

Eval.3 ALW In the case of large size ALW? Buffer overflow? Lock? Defined buffer size? ALW size and Transfer bandwidth

could not evaluate because of bug in JDK FreeBSD

Or Solaris ?

read & write mechanism

Adaptation in Application Java Event

DSS Time Sequence

Client Server

connect

MobilityPreparation

DSS-EstablishmentPhase

user data EstablishedStateEstablishedState

ClosedStateClosedState

Explicit Redirection Implicit Redirection

Connection Establishment

MH

ALWAdjustment

DSS-Explicit SuspendPhase

disconnectExplicitySuspended StateExplicitySuspended State

CHSuspend()

resume()

connect

MobilityPreparation

user data EstablishedStateEstablishedState

DSS-Explicit ResumePhase

EstablishedStateEstablishedState

Explicit Redirection

MH

ImplicitlySuspended StateImplicitlySuspended State

CH

connect

ALWAdjustment

user data EstablishedStateEstablishedState

DSS-Implicit ResumePhase

EstablishedStateEstablishedState

lose IP(Disconnect)

Brokenpipe

Implicit Redirection

MobilityPreparation

Mobile Computing Environment

“Work Continuity” for users

Mobile HostMobile Host

Internet

AA

AA

BB

??

MobileSocket Applications (1)

Java network applications

Mobile HostMobile Host

Internet

AA

AA

BB

MobileSocket Applications (2)

Java Mobile Applications

AppBAppB

Host-B

Host-A

AppAAppA

AppA’ObjectSerialization

MSockA (SocketX)

MSockA (SocketY)

Host-C

MobileSocket Applications (3)

Even Exchanging Socket...

Host-A Host-B

Host-C

AppAAppA

AppCAppC

AppBAppBMSockA MSockB

MSockA’Send “MobileSocket” Objectvia ObjectSerialization

Recommended