Middleware Services for Network Disruption Tolerant Mobile Applications

The demand for mobile application services has increased recently. However mobile wireless access technologies so far are not mature enough to address concerns with the reliability of mobile services. Therefore, mobile services are prone to failures caused by disruption of active wireless access network connections due to device movement. It is important to have proper mechanisms for managing mobile application services in case of loss of network connections. In this paper, we propose a middleware services that transparently performs required functionality to users in order to provide efficient mobile services in case of network disruption. Such middleware service provides an effective disconnection tolerant mobile application services.


Introduction
Mobile co mputing is a computing environment allowing a mobile device to connect to a network wirelessly while moving freely. It is expected to become the future of computing technology. Stationary and mobile co mputing are distinct because the limited resources on mobile devices and the capacity of wireless network connectivity gives mobile devices a different focus. Because of these distinct features, the role of networks should be considered carefully when designing and implementing mobile application services. In addition, a reliable wireless connection has to be guaranteed to provide mobile application services properly.
The demand for mobile application services has increased recently. Ho wever mob ile wireless access technologies so far are not mature enough to address concerns with the reliability of mobile services. Therefore, mob ile services are prone to failures caused by disruption of active wireless access network connections due to device movement. It is important to have proper mechanis ms for managing mobile application services in case of loss of network connections.
In this paper, we investigate a novel architecture for network d isruption tolerant mobile applications, providing effective and efficient management for mobile services, network connections, resources and context handling.
The rest of the paper is structured as follows. Section 2 introduces cu rrent related wo rk. Sect ion 3 discusses the mobile service problem. Sect ion 4 introduced our proposed

Related Work
There have been some related works for disruption tolerant concerns with regard to applicat ion layer approach and Disruption Tolerant Network (DTN). So me approaches on application layer have been dealing with content modification on servers and others have been dealing with wireless applications within a mob ile ad-hoc network (MANET). Most approaches [1][2][3][4][5] on DTN have been dealing with end to end routing technology.
Liu et al. [6] propose disruption-tolerant content-aware video streaming using the notion of substitutable content summary frames and a method to select these frames. In this approach, summary frames are sent in advance to be displayed during disruption period. Su mmary frames, which are rep resented using shaded rectangles, are selected with the algorith m based on content difference of all ad jacent frames in the list. After selecting summary frames, all frames are rearranged so that summary frames could be sent ahead of complementary frames and be displayed during network disruption period.
Data loss, which can be effective fo r video quality, during disruption period and data handling, which is related to the provision of data in server side, after network recovers were not considered. Video sequence with additional summary frame has to be rearranged.
Moghadam et al. [7] propose a modular plat form to develop mobile disruption-tolerant applications based on previously proposed platform: 7DS which was developed to address network disruption problem in mobile networks by providing store-carry-forward commun ication. 7 DS stands for "Seven Degrees of Separat ion" [8].Applicat ions, which need file sharing and synchronization, are considered as mobile applications. Sharing document modification with others, potable classroom system and Bu llet in Board System (BBS) between teacher and students are examples as mobile applications in this paper. 7DS architecture mainly consists of discovery module, data sharing, and delta encoding. Discovery module enables mobile users to create an IP network automat ically without any server such as Dynamic Host Configuration Protocol (DHCP) or Do main Name System (DNS) and helps 7DS users in the physical pro ximity to announce and locate the presence of services so that all services over node are registered and advertised [7]. Date sharing module enables mobile peers to share and synchronize data with file synchronization module and bulletin board system module which is responsible to exchange data in push-based mode. Delta encoding module is responsible to make a more efficient use of network bandwidth by transferring a min imal description of changes instead of the entire new instance of the resource. Although 7DS is a platform that serves as an environment to develop mobile disruption-tolerant applications, it only concerns data as store-carry-fo rward manner for its own defined disruption-tolerant applications, which are not true mobile applications.
Kopena et al. [9] propose service-based computing for agents, which act as proxies for the sender, on disruption and delay prone networks. The domain challenges of proposed approach are latency, bandwidth, link errors, asymmetric lin ks, low connectivity, and others. Mobile agents and services are main used technologies. Satellite relays scenario has been made with some argu ments such as optimal networking, effective agents, reason, etc.. Since this approach is similar to store and carry method using an agent technology without any data loss, it does not provide any solution for real time mobile applications.

Mobile Service Problem
As stated in [10], we may categorize many different kinds of mobile applications into mobile mu ltimed ia applicat ions, mobile interactive applications and mobile web applications based on data communicat ion patterns.
Mobile applications that are running on mobile devices need mobile services provided by servers in order to be played as mobile mu ltimedia applicat ions, mobile interactive applications, and mobile web applications. In this paper, we use the term mobile application to mean software running on mobile devices, and mobile service to mean a necessary support provided by servers for mobile mu lt imedia, interactive and web applicat ions.
There are t wo kinds of wireless access network disconnections: sudden disconnection and gradual disconnection. Sudden disconnection is caused by signal blocking while g radual disconnection is caused by device movement to other networks. Figure 1 shows a gradual disconnection scenario between base station 1 and base station 2 when a mobile device moves fro m point (a) to point (d). Mobile application services may not be provided properly during network d isconnection fro m point (b) to point (c) with the undesirable termination of mobile application services. In this paper, we consider that network disruption is caused by the situation in which no access network is available, due to mobile device movement or signal blocking. Since network disruption could be predicted based on some context, mobile application services could be prepared in case of wireless network d isconnections. Therefore, appropriate mechanisms are needed for preparing persistent and/or resumable mobile application services before the current wireless access network is lost.

System Overview
We could apply two kinds of strategies, an eager strategy and a lazy strategy, on network system integration to utilize resources effectively. The eager strategy means always preparing and taking actions for possible network disruptions as soon as a mobile device is turned on. The lazy strategy means not preparing and taking actions for possible network disruptions until it is sure that disruption will happen soon. For the eager strategy, we do not need to detect when disruption will happen, but for the lazy strategy, we do need it.
If we adopt the eager strategy for mobile mu lt imedia application services and mobile web application services, there would be network overhead/congestion and undesirable resource consuming on the mobile device. Since network disruptions are not occurred constantly and resources such as mobile device and network bandwidth are limited, it would be better to adopt the lazy strategy. On ly the eager strategy could be applied to mobile interactive application services, since they always need to be communicat ing to the third party server through an intermediary server, wh ich always keeps session information, for network disruption.
In the previous work [10,11], figure 2 illustrates the general model for Mobile Intelligent Server (M IS) [11] -based architecture. MIS is located in the fixed network and has reliable connections to the application server. When the disruption in the wireless access network occurs, the middleware on the mobile device will try to make the mobile application run as long as possible with limited resources until reconnection, and the MIS still collects data fro m the application server for future update to the mobile device when the network is reconnected between the mobile device and the MIS in case of mobile mu ltimed ia application services.
For mobile mult imedia application (e.g. video) services, the MIS sets higher sending rate when decision is made based on context informat ion so that the mobile device may reserve more data before network disruption.
For mob ile interactive application (e.g. game) services, the MIS makes mobile interactive services be recorded using recording engine during disconnection period and updated in the mobile device after reconnection.    For mob ile interactive applicat ion (e.g. web) services, the MIS makes the first level web pages be pre-patched using pre-patch engine when decision is made based on context informat ion in order to make mobile device be run able during disconnection period. Therefore, there are three main processes for comp leting our proposed mechanism. Figure 3 illustrates the architecture of the middleware services. Each of four co mponents in the middleware has a different responsibility. As mentioned in [4], the Serv ice Manager (SM) supports for different mobile application services. The Context Handler (CH) supports decision making based on context informat ion. The Connection Manager (CM) manages network connectivity. The Resource Manager (RM) manages required resources for mobile application services.

Context Aware Decisions
As we stated in [11], the proposed context aware decision is for decision making on the question how we are ab le to know that a device is getting out of coverage area and going to be disconnected for gradual network disconnection. Since we could obtain the dynamic values of signal strength and data rate (device receiv ing data rate) fro m the network interface of mobile device as the movement of mobile device and they are inverse proportion with d istance from base station or access point, they are possible candidates.
But there are other factors for reducing device receiv ing data rate [12] such as packet dropping at receiver, interference, hardware quirk, link misalign ment, Mediu m Access Control (MAC) level, and Acknowledgement (ACK) timeout. Therefo re, only signal strength could be used for the first required decision.
Therefore, signal strength is used for context aware decision with incremental method in order to avoid mo mentary fading or shadowing. Since signal strength is usually used for handoff process, our simple decision using signal strength could be compared and referred with the usage of handoff process as shown in figure 4.
While the mobile device is moving fro m one network range A to another network range B, handoff is usually made at the point, wh ich is an intersecting point between decreasing signal level at range A and increasing signal level at rang B.
For our case, there is no availab le network wh ile the mobile device is moving form one network range A to another network range B as shown in figure 5. When the signal level A reaches to handoff threshold as the device moves, there has to some proper preparation for network disconnection.
Therefore, in order to make proper preparation for gradual network disconnection, we need two context aware decisions. With regard to the first context aware decision, we have to decide whether a device is getting out of coverage area and is going to be disconnected. We apply incremental method with signal strength. The decision only with signal strength is called simple decision. Table 1 shows context information for simp le decision making. The process of simp le decision making is as follows.
Let inc(N_SS t-n ) be the sum of K i for some period time (t-n ) fro m the start time (n) of applicat ion to current time (t ).
Let inc(N_SS T-t ) be the sum of K i for some period time (T-t ) fro m the current t ime (t ) to the running time (T). In this thesis, the running time (T) is defined as the arbitrarily chosen ongoing time fro m current time (t) for decision making. However, T has to be chosen by previous individual experience for proper decision making.
When N_SS t is less than or equal to handoff threshold and inc(N_SS t-n ) is less than zero, it indicates that the network signal strength is going to be decreasing if inc(N_SS T-t ) becomes less than 0. Therefore, we could predict that network disruption might occur.  Step 2. Making simp le decision Let ND be the network d isruption.
When N_SS t <=handoff threshold and inc(N_SS t-n ) < 0, ND = (inc(N_SS T-t ) < 0) Step 3. Preparing network disruption Requesting more data until N_SS t <= min imu m acceptable signal strength. Figure 6 provides an example for simp le decision making using illustration on a timeline the relative positions of n, t and T. Suppose the handoff threshold is 6. In this example, we have N_SS t < handoff threshold and inc(N_SS t-n ) < 0 for decision making step 1. Also, we have inc(N_SS T-t ) < 0 for decision making step 2. Therefore, we predict that a g radual network disruption will occur. With regard to the second context aware decision on mobile application services, we have to decide when the device should start to make preparat ion for gradual network disconnection based on network type, application bit rate, device type, device speed, and signal strength. The decision with above context informat ion is called moderate decision. Since the coverage range is different between WiFi network and cellular network, network type has to be considered appropriately. For examp le, since WiFi network has shorter coverage range than cellular network, the device on movement in WiFi network needs earlier time than in cellu lar network for preparing network disconnection. Multimedia files are usually encoded at proper bit rate based on estimated/target network bandwidth or throughput for effective playback on mobile device. Therefore, application bit rate has to be considered appropriately. For example, applications with higher application bit rate need to prepare network disconnection earlier. Since each mob ile device has different capacity for caching mult imed ia files, device type has to be considered appropriately. For examp le, mob ile devices with high capacity need to prepare network disconnection earlier. Since the question how early the mobile device is getting out of coverage range is important fact for the second required decision, device speed has to be considered appropriately. For examp le, faster mobile device need to prepare network disconnection earlier. Table 2 shows context information for moderate decision making. Since N_T is directly proportional to the running time T, T'= T* N_T should be applied, where T' is adjusted T with the value of contexts for the proper interval of co mparison. Since

Experiments
We present detailed experiments, performance results and observations of three mobile application services based on data commun ication pattern: mobile mult imedia application services, mobile web applicat ion services and mobile interactive (game) application services. This chapter includes a complete description of experiments for the proposed approach and presents the observed measurements.
As shown in figure 7, we have two test environments for our experiments. The graph (a) and (b) in figure 7 illustrate the outline of experimental environment for obtaining signal strength for verifying decision making algorith ms. We obtain various actual data of WiFi signal strength from various areas. We use software named WirelessMon (version 4.0) for the signal strength measurement. The arrows indicate the appro ximate mov ing path. Experimental informat ion such as time, channel, percentage (%) of signal strength and signal strength (dBm) is described in appendix C. The graph (b) in figure 7 illustrates the outline of experimental environ ment for verify ing system effectiveness. We use one physical WiFi network with gradual network disruption due to the movements of the user since the purpose of our middleware system is providing mob ile application services effectively during disconnection period.
As mentioned before, our design and imp lementation target to disconnection tolerant mobile application services.
For the actual detailed graph (b) in figure 7, the mobile client uses an HTC Dev Phone and a Samsung Galaxy S that run on Android platform version 1.6 and version 2.1-update respectively. The MIS uses an IBM Th inkPad (T43) that runs on Ubuntu 8.04 (Hardy Heron). Since Android supported mu ltimed ia formats (video) are H.263, H.264 A VC and MPEG-4 SP, we decided to use a third party server for mobile mu lt imedia application services on the HP Co mpaq nx 6320 with Windows XP. The Samsung Galaxy S was used for the experiment on the comparison of mobile mu ltimed ia application services with MIS/ middleware and without MIS/ middleware. For other experiments, the HTC Dev phone was used. Figure 8 illustrates the overview of the experimental environment.
We designed the prototype of mobile application services to demonstrate the feasibility of applying our proposed techniques. We imp lemented the mobile services delivery using HTTP/TCP due to their widespread adoption for mobile devices such as mobile handsets and flexib ility in implementation.
For mobile mu ltimed ia applicat ion services, we analyze mu ltimed ia data (.mp4/ 11.3M ) received without decision and with context aware decision in order to show how effectively and efficiently we could get data before network disconnection with higher sending rate. Figure 9 illustrates comparison of received data based on sending rate using simp le decisions fro m MIS.  If the sending rate is higher, the total data transfer t ime is shorter as we expected. Therefore, we could reserve mo re data before network disconnection if simp le decision is made based on sending rate of the MIS. Note that a buffer overflow on mobile device is not considered for our experiments although it can be controlled within our proposed system. Figure 10 illustrates the comparison of decision making time for simp le decision and moderate decision when the device speed has been changed to 2 (fast). The decision making time has been reduced with a fast device speed.
For our experiments, we have co mpared the below tasks for a short (30 seconds, 60 seconds), a med iu m (90 seconds), and a long (120 seconds) network disconnection with MIS/ middleware and without MIS/middleware. 1. Total bytes received before network d isconnection with MIS and without MIS, 2. Total duration of playback during disconnection period with MIS and without MIS, 3. The downloading position of a media file after network reconnection, 4. The resuming time of a media file after network reconnection (ms) In order to obtain the same exact position where the network is disconnected for appropriate co mparison on each experiment case, we set 60 seconds after starting mult imed ia streaming fo r the network to be disconnected. Also, we set 30 seconds after starting mult imed ia streaming for the decision point with MIS. Note that decision making algorith ms are not applied for these experiments becase of the reason mentioned above, but decision making algorithms are applied fo r previous experiments. For these experiments, we use an .mp4/ 10.8M file and set the sending rate to 1 (15,630 KB/sec) and sending rate to 2 (31,260 KB/sec), the same as with previous experiments. The range of network bandwidth when these experiments were perfo rmed is fro m 24 Mbps to 52 Mbps. Note that the average total play ing time of the file is 215,392 ms and application bit rate encoding is 629 kbps. Table 3 describes the experiment result for the short network disconnection (30 Seconds).
The total duration of p layback during a disconnection period without MIS/middleware is 54,645ms. There was not a paused position during the disconnection period with MIS/ middleware because the buffered data could cover the disconnection period for playback. When the network was disconnected, the mobile application services without MIS/ middleware have kept running for 54,645 ms until the received data had been consumed. When the network is reconnected later, we needed to start to request mult imed ia again fro m the beginning. The med ia file with MIS/ middleware was downloaded again fro m the position at 6,401,897 bytes, which is the stop position with the network disconnection, after the network is reconnected. Figure 11 illustrates the comparison of total bytes received with MIS/ middleware and without MIS/middleware for the short network disconnection (30 seconds).
The line (1) indicates the decision point for the change of sending rate and the period between lines (2) and (3) indicates the disconnection period. Table 4 describes the experiment result for the short network disconnection (60 seconds).
The total duration of p layback during a disconnection period without MIS/middleware is 54,645ms. There was not a paused position during disconnection period with MIS/ middleware because the buffered data could cover the disconnection period for playback. When the network was disconnected, the mobile application services without MIS/ middleware kept running for 54,645ms until the received data had been consumed. When the network was reconnected later, we needed to start to request mult imed ia again fro m the beginning. The med ia file with MIS/ middleware was downloaded again fro m the position at 6,473,805 bytes, which is the stop position with the network disconnection, after the network is reconnected. Figure 12 illustrates comparison of total bytes received with MIS/ middleware and without MIS/middleware for the short network disconnection (60 Seconds).
The line (1) indicates the decision point for the change of sending rate and the period between lines (2) and (3) indicates the disconnection period. Table 5 describes the experiment result for the med iu m network disconnection (90 seconds). Figure 11. The comparison of total bytes received for the short network disconnection (30s)       The total duration of p layback during a disconnection period without MIS/middleware is 54,645 ms whereas the total duration of playback during disconnection period with MIS/ middleware is 87,378 ms. When the network was disconnected, the mobile application services without MIS/ middleware have kept running for 54,645 ms. When the network is reconnected later, we needed to start to request mu ltimed ia again fro m the beginning without MIS/ middleware. The med ia file with MIS/ middleware was downloaded again from the position at 7,281,809 bytes, which is the stop position with the network disconnection, after the network is reconnected. The starting time of the med ia file after the network reconnected is 16,590 ms. Figure 13 illustrates the comparison of total bytes received with MIS/ middleware and without MIS/middleware for the med iu m network disconnection (90 seconds) The line (1) indicates the decision point for the change of sending rate and the period between lines (2) and (3) indicates the disconnection period. Table 6 describes the experiment result for the long network disconnection (120 Seconds).
The total duration of playback during the disconnection period without MIS/middleware is 54,645 ms whereas the total duration of playback during disconnection period with MIS/ middleware is 77,044 ms. When the network was disconnected, the mobile application services without MIS/ middleware kept running for 54,645 ms. When the network reconnected later, we needed to start to request mu ltimed ia again fro m the beginning without MIS/ middleware. The med ia file with MIS/ middleware was downloaded again from the position at 6,836,153 bytes, which is the stop position with the network disconnection, after the network is reconnected. The starting time of the med ia file after the network reconnected is 24,128 ms. Figure 14 illustrates comparison of total bytes received with MIS/ middleware and without MIS/middleware for the med iu m network disconnection (120 seconds).   (2) and (3) indicates the disconnection period.
For mobile web application services, we use the UNB web site. Figure 15 illustrates URL parsing results for the first sub level of the current web document in the MIS in order to reduce network overhead when the mobile device makes simp le decision. It is a samp le of the full output. Figure 16 illustrates the process of sending obtained contents for the parsed URLs in the MIS fro m the server to the mobile device. It is a sample of the full output. Figure 17 illustrates the process of receiving contents from the MIS to the mobile device. It is a sample of the fu ll output.
As shown in the experiment, the mobile device can obtain the first level of the current web document before network disconnection so that the user may enjoy web services without undesirable termination during a network disconnection period. For some web sites such as www.m.naver.co m, we could not obtain the content informat ion for the current web page. There could be many different reasons within the design of these web sites such as redirection.
For interactive (e.g. game) applicat ion services, we use public game site http://www.fallensword.com. Figure 18 illustrates the way MIS obtains the information of a current session between a mobile device and server.
Process (1) indicates that the MIS requests interactive (game) service with user name, password and header informat ion provided by the mobile device. Process (2) indicates that the MIS obtains header informat ion including session data for game contents.
Therefore, if there is a simp le decision for handling network d isruption, the MIS keeps connection with the server based on the session information. After reconnection, the mobile device may resume the interactive service through the MIS.

Evaluation
We have shown the effectiveness of the proposed middleware services in the previous section since our system is uniquely specialized fo r mobile applicat ion services in case of network disruption.
To verify the accuracy of our proposed (simple, moderate) decision making algorith ms for the second objective, we have tested the system with various actual data of WiFi signal strength while a user is moving in and out of the coverage range of access point from various areas. We have a total of 17 testing data sets. We apply the proposed decision making algorith ms to each data set. For ou r research purpose, we cons ider th at the s imp le o r mo d erate decis ion is co rrect when the cu rrent s ig nal st rength reaches zero after decision is mad e. W e cons id er that the s imp le o r mod erate d ecis ion is incorrect wh en the current signal st ren gth reaches a hand off t hresho ld again aft er decis io n mad e.
The accuracy rate is calculated by (the number of data sets with correct decision / total number of testing data sets) * 100. Since intelligent decision making uses distance between a mobile device and a location that experiences sudden network disruption for the decision making process, the distance is decreased when a user is moving toward the network d isruption location. Therefore, it is obvious that the accuracy of intelligent decision making algorith m will be similar to simple and moderate decisions. The simu lator developed in Java has been used for this verification. The process of simu lator is as follows: Step 1: Read each line of signal strength data from a file.
Step 2: Test the proposed algorithm with the data set described in section 4.5 and section 4.6.
Step 3: Make decision Step 4: Analyze decision accuracy If there is not enough data due to high speed movement in each data set to test simple decision making, we count that it is an unavailab le record. Table 7 indicates the accuracy of simp le decision with unavailable data. Table 8 indicates the accuracy of simp le decision without unavailable data.  We set the device speed to 2 to know the running time T' is affected by context informat ion for moderate decision. All records for simp le decision are affected by context informat ion. Also, Tab le 9 indicates the changes of Table 8-1 with moderate decision. Three unavailable data fro m Table 7 have become available, wh ich means that T' is affected by context info rmation, that is, device speed. Note that the number o f data sets used in the evaluation was rather small, e.g. there was only one "incorrect" data set, which may affect the accuracy of the evaluation. In future work, we will t ry to have more sufficient data sets to verify the accuracy of our proposed (simple, moderate) decision making algorith ms appropriately.

Concluding Remarks
In this paper, we exp lore middleware service for disconnection tolerant mobile application services. The proposed approach could play an important ro le of supporting the service mobility for mob ile application services.
For future work, we will further investigate on optimal algorith ms to improve accuracy rate for decision making cases and user event patterns for the continuation of mobile interactive applicat ion services