A Framework for Mobile Collaborative Environments - CiteSeerX

2 downloads 22792 Views 698KB Size Report
desktop computers, hardware supporting mobile applications is more limited. In fact ... developed using Microsoft Visual Studio 2003 with C# code. The library ...
PROCEEDINGS OF WORLD ACADEMY OF SCIENCE, ENGINEERING AND TECHNOLOGY VOLUME 5 APRIL 2005 ISSN 1307-6884

A Framework for Mobile Collaborative Environments Hani Y. Diya, Hassan A. Artail, and Haidar Safa well as between mobile devices and neighboring PCs. The framework would constitute the infrastructure for developing MCE aware applications, which will be able to use resources on neighboring devices to get assistance in running applications, storing temporarily data, and access locally unavailable services (such as Internet Connection, GPS information and other sensor resources).

Abstract—Collaboration is a key word today in the mobile

development world. This paper introduces a new concept and methodology in Mobile Collaboration between Pocket PCs or between Pocket PCs and Desktop PCs. Work includes a developed framework in a layered and scalable approach that can be used by developers to allow devices share their resources using remote execution of code whenever Mobile Collaborative Environment (MCE) is present. Included in the paper are sample applications showing the effect of using the framework when collaborating between a Pocket PC and a Desktop PC.

II. SURVEY OF PREVIOUS WORK Many efforts have been made to enable devices share resources and collaborate with each other. However, none found so far that provides a complete solution or framework for building applications that are intelligent enough to check the surrounding for the possibility to remotely execute a code while doing or running another thread at the same time. Such an effort is the Pervasive Collaborative Computing Environment (PCCE) [1] project that offers an environment for supporting scientific collaborations. This environment houses various tools needed in collaborations such as a synchronous/asynchronous messaging, video conferencing, and file sharing/transfer. Such a project constitutes a high level of collaboration between individuals via the use of computers and wireless technologies. The lower level of collaboration on the other hand, exists when a given task is divided into smaller parts, distributed amongst a set of collaborators, processed, and then reassembled to yield the solved original problem. In addition, another form of this collaboration can be viewed when a specific device lacks the means to perform a computational job, such as text translation, and seeks the help of other devices to insure job completion. Several approaches have been proposed to provide aspects related to low-level collaboration and include the ones discussed in [2], [3], [4], [5], [6], and [7]. A compiler-directed remote task execution system was proposed in [2] for battery power management on mobile devices. Remote process execution was proven in [3] to save battery power through experiments that were conducted on portable computers. In [4] a model for distributed memory management between handhelds and workstations was proposed. In this model, inactive memory items (programs and data) are moved temporarily to other devices in order to make space for large programs. A power-aware cost-based distributed computation model is presented in [5] for the purpose of fairly allocating computational tasks among mobile devices in ad-hoc wireless networks. The use of parallel processing is suggested in [6] to overcome the shortage of

Keywords—Mobile Collaborative Environment, Pocket PCs, collaboration, Remote Code Execution, Resource Sharing.

I

I. INTRODUCTION

N recent years, the nature of the mobile phones market has changed. Sales are being driven by innovative new features combining voice, data, imaging and new wireless communication technologies such as wireless packet data and Bluetooth. Therefore, the new generation of mobiles phones, PDAs, and handhelds uses incredibly sophisticated software to assist in running multi purpose applications and satisfy the need for communication, data exchange, multimedia, and many other tasks. The need for running highly developed software on handhelds is restrained by the constraints imposed by the lack of resources due to mobile hardware limitations. In contrast to desktop computers, hardware supporting mobile applications is more limited. In fact, resources are scarce with a slower CPU and much less memory. In addition, there is no hard disk, which eliminates the backed virtual memory done on desktop PCs, and minimizes the room for program or data files. Adding memory and improving CPU speed in such devices causes a major increase in the price. In fact, the more the portability of the device increases, the harder and more expensive it becomes to extend its resources. The primary objective of this research is to develop a framework that allows collaboration among mobile devices, as Manuscript received March 31, 2005. Hani Diya and Dr. Hassan Artail are with the Electrical and Computer Engineering Department at the American University of Beirut (e-mails: [email protected] and [email protected]). Dr. Haidar Safa is with the Computer Science department at the American University of Beirut, P.O.Box: 11-0236, Riad El-Solh, Beirut 1107 2020, Lebanon. (e-mail: [email protected]).

PWASET VOLUME 5 APRIL 2005 ISSN 1307-6884

163

© 2005 WASET.ORG

PROCEEDINGS OF WORLD ACADEMY OF SCIENCE, ENGINEERING AND TECHNOLOGY VOLUME 5 APRIL 2005 ISSN 1307-6884

processing power in handheld devices. In the implementation, Java message passing was employed in the mobile ad-hoc network for task communication. A protocol was suggested in [7] for remote execution of processes based on the use of multicast for discovering computational resources.

° ° ° ° °

III. MCE FRAMEWORK

° ° °

A. Overview The Framework consists of a dynamic link library developed using Microsoft Visual Studio 2003 with C# code. The library contains two main classes: MCEServer and MCEClient. The code takes into consideration the .Net Compact Framework limitations and uses compatible classes and functions. The same library can be used as a reference for .Net projects intended for either Pocket PC or Desktop Windows PCs platforms. TCP/IP is used as a network layer protocol for the interdevice-communications.

A message ends with the string |END| that is used to know if the message is complete. If not complete, the server or client will wait until it is before processing the message. C. Sample Application The applications developed along with the framework intend to demonstrate the effect on using the MCE environment to tremendously decrease the time needed to run applications on Pocket PCs. The example uses the lengthy algorithm of producing a Pi with a certain number of decision digits. As shown in Table 1, the time taken to retrieve 2000 digits took more than an hour when run locally on the Pocket PC, and around six minutes when the Pocket PC requested assistance from a neighboring Desktop PC running an instance of an MCE Server.

B. How it Works The MCEServer is the main class used to create an MCE Device. In fact, the MCEClient is an inherited object of MCEServer, overriding few of its methods to fulfill a client’s required tasks. Each instance of a class (Whether Server or Client) has predefined states that can be checked at any time. The states relevant to Server are: ƒ WaitingForHelpRequest: Indicating it is ready to receive requests from clients ƒ InConversation: Indicating it is connected to a client and waiting for it to send code to be compiled and run remotely The states that are relevant to a Client are: ƒ Idle: Not doing any activity ƒ WaitingForHelpRequestAccept:Sent a Help Request to a Server and waiting to receive an Accept message. This is mandatory before being able to send code to be executed on the Server. ƒ InConversation: Client connected to a Server that accepted to help. Client can now send code messages to the server. Each message exchanged between a Server and a Client has a fixed header that is used to judge what type of message is being received. Standard header layout: ƒ Bytes: 000 - 015: MCEGuid :Unique Code used to identify version of Framework to avoid compatibility issues ƒ Bytes: 016 - 020: Sequence #: Can be used to track message sequences ƒ Bytes: 021 - 021: Opcode, used to judge what type of message is being received and takes one of the following values: ° Error: Unrecognizable message ° HelpRequest: Client is requesting help ° HelpRequestAccept: Server accepted to help

PWASET VOLUME 5 APRIL 2005 ISSN 1307-6884

HelpRequestDenied: Server refused to help CodeToCompile: Received a code to be compiled CodeRunOutput: Result of remote execution received LeaveConversation: Server is stopping collaboration TerminateConversation: Request to Terminate by Client Nack: Client received a message not meant for it MinOpCode = 1:Minimum valid OpCode MaxOpCode = Nack: Maximum valid OpCode

To run the application, the developer has to do the following to take advantage of the MCE environment: 1- Create Instance of an MCE Client. 2- Calls the SendHelpRequest method supplying it with the Server IP address and port number on which is listens. 3- Calls the SendCodeToCompile method supplying it with the path to the code to be compiled, the function to call and an array of parameters to pass it during execution. 4- Waits until the OnReceive event is fired, indicating that code execution result is received. 5- Display the result in the user’s interface Fig. 1Calculating 2000 Digits of Pi Comparison TABLE I TEST RESULTS USING MCE ENVIRONMENT Platform π Digits 10 100 150 200 300 400 500 1000 1250 1750 2000

164

Pocket PC Local Execution Time(s)

Execution Time when Collaborating with a Desktop PC

0 3 6 11 30 64 114 797 1142 3373 5261

2 5 5 6 7 7 9 52 98 242 367

© 2005 WASET.ORG

PROCEEDINGS OF WORLD ACADEMY OF SCIENCE, ENGINEERING AND TECHNOLOGY VOLUME 5 APRIL 2005 ISSN 1307-6884

time in minutes

Calculating Pi with x digits of precision

3/31/2005 10:35:43 Last Bytes plus a bit

100 90 80 70 60 50 40 30 20 10 0

PocketPC(s)

300

400

500

Using MCE

before: 3/31/2005 10:35:43 Message Incomplete, will go to Listen Mode again until message completes 3/31/2005 10:35:44 Last Bytes plus a bit before:Pi|1750||END| 3/31/2005 10:35:44 opCode Received is:CodeToCompile 3/31/2005 10:35:44 Sending Message to the Dispatcher to take action 3/31/2005 10:35:44 Received Code To Compile 3/31/2005 10:35:44 Library name that will be generated is:MCEcodelib1.dll 3/31/2005 10:35:46 Successfully Compiled Received Code 3/31/2005 10:35:46 Attempting to Run Code...Calling Function: CalculatePi 3/31/2005 10:35:46 Parameter 1 of 1 is: 1750

1000 1250 1750 2000

number of digits of Pi

IV. MCE SERVER’S FUNCTIONALITY To understand the process of the inter-devicescommunications, the following debug output from the Server application example lists all the messages exchanged during the initialization of the server and up to received a request of calculating 1500 digits of precision for Pi:

//Now that code is executed: The Server shows the result and sends it to client before going to Listen Mode again 3/31/2005 10:38:40 Successfully Run Requested Code, result is:3.1415926535897932384626433832795028841971693993 75105820974944592307816406286208998628034825342117 06798214808651328230664709384

//Server Started Messages: 3/31/2005 10:22:46 MCE Instance Started 3/31/2005 10:22:46 Listen Flag set to: True 3/31/2005 10:22:46 State Set to: WaitingForHelpRequest 3/31/2005 10:22:47 Waiting For Someone To Request Assistance //When a Help Request is received: 3/31/2005 10:23:47 Connected to: 10.1.1.1:3125 3/31/2005 10:23:47 Going into Listening Mode 3/31/2005 10:23:47 Received 43 Bytes 3/31/2005 10:23:47 Last Bytes are:|END| 3/31/2005 10:23:47 Last Bytes plus a bit before: 3/31/2005 10:23:47 Message Checked and complete 3/31/2005 10:23:47 OpCode Received is:MinOpCode 3/31/2005 10:23:47 Sending Message to the Dispatcher 3/31/2005 10:23:47 Sending Help Request Accept to Client 3/31/2005 10:23:47 Sending data to remote end. 3/31/2005 10:23:47 State Set to: InConversation 3/31/2005 10:23:52 Going into Listening Mode //When a client sends a Compile Code message containing the Pi calculation class along with name of function to call and parameter(s) to pass (fragments of the output is shown): 3/31/2005 10:35:43 Received 536 Bytes 3/31/2005 10:35:43 Last Bytes are: 3/31/2005 10:35:43 Last Bytes plus a bit before:

Fig. 2 Snpshot of debug messages Fig. 3 Calculating 2000 digits localy Fig. 4 Calculating 2000 digits remotely

3/31/2005 10:35:43 Message Incomplete, will go to Listen Mode again until message completes 3/31/2005 10:35:43 Last Bytes are:

PWASET VOLUME 5 APRIL 2005 ISSN 1307-6884

165

© 2005 WASET.ORG

PROCEEDINGS OF WORLD ACADEMY OF SCIENCE, ENGINEERING AND TECHNOLOGY VOLUME 5 APRIL 2005 ISSN 1307-6884

fact, a java mobile device can establish a tcp/ip socket connection with an MCE server running on Windows platform, sends bytes adhering to the message structures, and send text files containing C# or VB code to be remotely executed. Among many possible and easy enhancements, future versions of the framework can be built to support sending compiled code rather than sending code files. This would enable MCE Pocket PC devices to communicate together rather than having to communicate with a Server running on a Desktop PC. ACKNOWLEDGMENT Acknowledgment goes to Walid Saad for providing the Pi algorithm, which was used to demonstrate the need for processing power. REFERENCES [1]

[2] [3] [4] [5] [6] [7]

D. Agarwal, C. McParland, and M. Perry, "Supporting Collaborative Computing and Interaction," Proceedings of the Grace Hopper Celebration of Women in Computing 2002 Conference, October 9-12, 2002, Vancouver, Canada. U. Kremer, J. Hicks, and J. Rehg, “Compiler-directed remote task execution for power management,” Workshop on Compilers and Operating Systems for Low Power, 2000. Rudenko, P. Reither, G. Popek, and G. Kuenning, “Saving portable computer battery power through remote process execution,” Mobile Computing and Communications Review, 2(1), 1998. Sathiaseelan and T. Radzik, “Using remote memory paging for handheld devices in a pervasive computing environment,” Asian Journal of Information Technology 2(1): 08-12, 2003. L. Shang, R. Dick, and N. Jha, “An economics-based power-aware protocol for computation distribution in mobile ad-hoc networks,” IEEE Transactions on Mobile Computing, 3(1): 33-45, 2004. R. Shepherd, J. Story, and S. Mansoor, “Parallel computation in mobile systems using Bluetooth Scatternets and Java,” School of Informatics, University of Wales, Bangor. S. Patwardhan and S. Pichumani, “Ether: a remote execution service for mobile devices,” School of Computing, University of Utah.

V. CONCLUSION Although using .Net development tools to code the framework, the usage of sockets will bring the MCE functionality to any device running any operating system. In

PWASET VOLUME 5 APRIL 2005 ISSN 1307-6884

166

© 2005 WASET.ORG