In this chapter, we describe a caching scheme, called AS [21], for wireless networksthat uses asynchronous invalidation reports call-backs to maintain cache consistency,i.e., reports are
Trang 1to establish a mobile office from which they can communicate with other users, access formation, and manage their work while staying mobile This feature is important for sup-porting ubiquitous services such as weather and forecasting services, financial market re-porting, yellow pages, road maps and directions, telematics, point-of-sale applications,in-field work dispatch, and law enforcement and military support to mobile users By na-ture, mobile computing environments have severe resource constraints and unstable oper-ating conditions, which add a new dimension to the technical challenges for data process-ing and computing
in-Many software problems associated with data management, transaction management,and data recovery have their origin in distributed database systems In mobile computing,however, these problems become more difficult to solve, mainly because of the narrowbandwidth of the wireless communication channels, the relatively short active life of thepower supply in mobile devices, and the changing locations of required information(sometimes in cache, sometimes in air, sometimes at the server) and users Further, inmany mobile database applications, data changes very rapidly (or even constantly) Usersneed to receive timely information in order to make critical decisions (e.g., stock marketinformation and trading)
Traditionally, data management is concerned with the modeling, efficient storage, trieval, and manipulation of information From a data management standpoint, mobility ofthe clients/nodes provides an interesting variation on distributed computing The mobilecomputing environment considered in this chapter is shown in Figure 26.1 In this envi-
re-553
Copyright © 2002 John Wiley & Sons, Inc ISBNs: 0-471-41902-8 (Paper); 0-471-22456-1 (Electronic)
Trang 2ronment, the mobile hosts (MHs) query the database servers that are connected to a staticnetwork The mobile hosts communicate with the servers via wireless cellular networksconsisting of mobile switching stations (MSS) and base stations In this environment, mo-bile databases can be distributed within the spectrum of the following two extreme config-urations:
1 The entire database can be distributed among the wired components, possibly withfull or partial replication A base station, with a DBMS-like functionality, has fullcontrol of its own database
2 the database is distributed among wired and wireless components Data ment responsibility is shared among base stations and mobile devices
manage-Thus, these different ways of managing data in mobile environments entail additional siderations and variation with regard to distributed database management
con-Moreover, location-based services are gaining a lot of momentum In addition to theFCC regulation that requires mobile service carriers to implement E911 in the near future,mobile users are interested in services that find locations of nearest emergency centers orthat notify of parking availability at an airport With integration of positioning technolo-
Figure 26.1 Mobile computing environment
Trang 3gies (e.g., GPS) in mobile devices and networks, location-based services will be availablesoon This also leads to a need for extending traditional database functions in mobile data-base systems
Finally, personal information management has gradually become an important part ofour daily lives While PDAs and mobile phones have to store and manage some informa-tion such as contacts and calendars internally, they usually have to synchronize with someunified information repository to make the intended applications effective Thus, an inter-esting issue is the architecture modeling of these device-driven mobile applications.Moreover, this model can be extended to enterprise applications In this environment,business logic is embedded in enterprise infrastructure and the mobile devices are the ter-minals How the mobile devices and network infrastructure combine to serve the users is
an interesting research issue and needs further development in mobile database systems
Mobile computing can possibly be viewed as a variation of traditional distributed ing from the data management point of view In general, there are two possible scenarios:the entire database is distributed only among the wired components, e.g., the mobileswitching stations (MSS), each base station managing its own share of the database withthe additional capability of locating the components of the databases that are not locallyavailable The other approach is also similar: the entire database is distributed over boththe wired and wireless components of the system There are several issues that generallycomplicate the various functionalities of a database management system, including:
comput-앫 Design of database Mobility of the hosts (clients) and frequent disconnection
be-tween clients and servers in an unpredictable manner compounds the problem ofglobal name resolution; also, the dynamic nature of the constantly changing locationinformation to be stored further complicates the design
앫 Replication of data Since the data is partially replicated in many places and the
availability of the duplicates changes rapidly with time (the expected scenario inmobile computing), the version control and consistency management are more chal-lenging In addition, providing correct execution of transactions, which are executed
at multiple base stations and multiple data sets, needs special attention due to ity and frequent disconnection of the mobile units
mobil-Most of these and other problems are handled, in some form or other, via caching data
in the mobile units and periodically validating these data using different techniques Theprotocols and frequency of validation of the data have a profound influence on the perfor-mance of the data management in mobile environments
Caching relevant data at the hosts is an effective tool for improving performance (queryresponse time and throughput) in any distributed system Important issues in designing an
Trang 4effective caching scheme include (1) what to cache (and when and for how long), (2)when and how to invalidate the cached items and at what granularity level, (3) data consis-tency provided to the user and at what cost Most of these concerns, especially the consis-tency management of cached data, are exacerbated in mobile computing environments.Mobile computing environments are characterized by slow wireless links (low bandwidthradio links) that are susceptible to frequent disconnections from the base station (server)and low battery power at the mobile clients (hosts), which necessitates the clients to mini-mize up-link queries as well as to voluntarily disconnect from the network to conservebattery power This unique feature of frequent disconnection adds a new dimension to thetask of maintaining consistent cache at the mobile client, since the underlying cache main-tenance protocol should make optimal use of the limited bandwidth In addition to beingtolerant of disconnections, these protocols should be energy-efficient and adaptive tovarying quality-of-service provided by the wireless network Various models have beensuggested in the literature to estimate the usefulness of caching in mobile environmentsunder different cost models [1–5] with encouraging results Our purpose in this chapter is
to consider the problem of management of cache consistency in a mobile wireless ronment, once the question of what to cache has been answered Frequent voluntary andinvoluntary disconnection of clients from servers makes this a very challenging problem[6]
envi-Efficient caching schemes for mobile environments should ideally take into accountthe following factors: data access pattern and update rates, communication/access costs,mobility pattern of the client, connectivity characteristics (disconnection pattern, availablebandwidth, etc.), and location dependence of the data Validation checks that are normallyused in an wired environment are not at all suitable for mobile environments since theywaste precious wireless bandwidth Almost all the cache coherency schemes proposed formobile environment are based on a call-back (invalidation report) mechanism A clientmay miss invalidation reports from the server if it is disconnected during the broadcast In
an attempt to solve this problem, Barbara and Imielinski [7] have developed a periodicbroadcast invalidation report scheme
In this chapter, we describe a caching scheme, called AS [21], for wireless networksthat uses asynchronous invalidation reports (call-backs) to maintain cache consistency,i.e., reports are broadcast by the server only when some data changes, and not periodical-
ly Each mobile client (host) (MH) maintains its own home location cache (HLC) to dealwith the problem of disconnections The HLC of an MH is maintained at a designatedhome mobile switching station (MSS) It has an entry for each data item cached by the
MH and needs to maintain only the time stamp at which that data item was last
invalidat-ed The HLC model fits perfectly into existing architectures to support mobility in less networks (e.g., Mobile IP [8]) which also uses the concept of a home agent for each
wire-MH At the cost of this extra memory overhead of maintaining an HLC, an MH can tinue to use its cache even after prolonged periods of disconnection from the network Weshow through a mathematical model and simulation studies that the hit rate and access la-tency of this scheme is better than its synchronous counterparts and very close to an opti-mal strategy that incurs no overhead of maintaining cache consistency
con-A mobile host can be in two modes: awake or sleep When a mobile host is awake nected to the server) it can receive messages Hence, this state includes both active and
Trang 5(con-dozing CPU modes A MH can be disconnected from the network either voluntarily or voluntarily From the perspective of the mobile host’s cache, it is irrelevant whether the in-validation were delayed due to voluntary disconnection (e.g., switching off the laptop) orinvoluntary disconnection (e.g., wireless link failure, hand-off delay) Hence, for our pur-poses, a disconnected client is in sleep mode; we use the term “wakeup” to indicate recon-nection
in-We consider the following computing scenario The application program runs on themobile host as a client process and communicates with the database server through mes-sages, i.e., the client sends an up-link request (query) for the data it needs to the databaseserver and the server responds by sending the requested data on the down-link In order tominimize the number of up-link requests, the client caches a portion of the database in itslocal memory The client-cached data is also referred to as active data [9] Caching data atclients necessitates a protocol between the client and the database server to ensure that theclient cache remains consistent with the shared database We next describe a cache invali-dation scheme for mobile environments The objective of this scheme is to minimize theoverhead for the MHs to validate their cache upon reconnection, to allow stateless servers,and to minimize the bandwidth requirement The general approach is to buffer the invali-dation messages at home location cache (HLC), which is a static trusted host on the staticnetwork and acts on behalf of a mobile host
In accordance with the mobility management scheme used in Mobile IP, each mobile hosthas a home address and a care-of-address The home address is the IP address on the homenetwork of the mobile host The care-of-address is the address indicating the current loca-tion of the mobile host Two architectural entities—home agent and foreign agent—areused in Mobile IP to deliver datagrams to mobile clients A home agent tunnels (encapsu-lates in another datagram packet) any datagrams sent to the mobile client at its home ad-dress to its current care-of-address(es) A foreign agent (in the case in which the mobileuses a foreign care-of-address) on the current network of the mobile client decapsulatesthe packet and delivers it to the mobile client to which the datagram is addressed (see Fig-ure 26.2) We assume that the mobility agents (home or foreign agent) (MAs) are located
mes-앫 An MH can detect whether or not it is connected to the network
앫 An MH informs its HLC before it stores (or updates) any data item in its localcache
Trang 6앫 The mobility agent that is nearest to the MH and maintains the HLC of the MH wards to the MH any invalidation it receives from the server
for-The caching architecture is shown in Figure 26.3 for-The home agent A preassigned statichost of any mobile host (MH) maintains its home location cache (HLC) If a mobile host
is roaming, its HLC is duplicated at the MSS of its foreign agent current cell Thus, anMSS always maintains a HLC for each MH in its coverage area at any given time Consid-
time stamp of the last invalidation of x The key feature of the AS scheme is that the
inval-idation reports are transmitted asynchronously and those reports are buffered at the MSS(in the HLCs of the mobile hosts) until an explicit acknowledgment is received from the
specific MH The invalid_ flag (in the HLC record for the specific data item) is set to
TRUE for data items for which an invalidation has been sent to the MH but no edgment has been received Note that the time stamp is the same as that provided by theserver in its invalidation message
acknowl-Each MH maintains a local cache of data items that it frequently accesses Before swering any queries from the application, it checks to see if the requested data is in a con-sistent state We use call-backs from a MSS to achieve this goal When a MSS receives aninvalidation from a server, the MSS determines the set of MHs that are using the data by
an-Figure 26.2 Delivering message to a MH in Mobile IP
Trang 7consulting the HLCs and sends an invalidation report to each of them When a MH ceives that invalidation message, it marks the particular data item in its local cache as in-valid When an MH receives (from the application layer) a query for a data item, it checksthe validity of the item in its local cache; if the item is valid, it satisfies the query from itslocal cache and saves on latency, bandwidth, and battery power; otherwise, an up-link re-quest to the MSS for the data item is required The MSS makes a request to the server forthe data item on behalf of the MH When the data item is received, the MSS adds an entry
re-to the HLC for the requested data item and forwards the data item re-to the MH Note that thedata item may or may not be cached at the MSS
A mobile host alternates between active mode and sleep mode In sleep mode, a bile client is unable to receive any invalidation messages sent to it by its HLC We usethe following time-stamp-based scheme by which the MA can decide which invalida-tions it needs to retransmit to the mobile host Each client maintains a time stamp for itscache called the cache time stamp The cache time stamp of a cache is the time stamp
mo-of the last message received by the MH from its MA The client includes the cache timestamp in all its communications with the MA The MA uses the cache time stamp fortwo purposes:
1 To discard invalidations it no longer needs to keep
2 To decide the invalidations it needs to resend to the client
Upon receiving a message with time stamp t, the MA discards any invalidation messages with time stamp less than or equal to t from the MH’s HLC Further, it sends an invalida- tion report consisting of all the invalidation messages with time stamp greater than t in
MH’s HLC to the MH When a MH wakes up after a sleep, it sends a probe message to itsHLC with its cache time stamp In response to this probe message, the HLC sends it an in-
Figure 26.3 System architecture
Trang 8validation report In this way, a MH can determine which data items changed while it wasdisconnected A MH defers all queries that it receives after waking up until it has receivedthe invalidation report from its HLC In this scheme, we do not need to know the time atwhich the MH got disconnected, and just by using the cache time stamp we can handleboth wireless link failures and voluntary disconnections Even if the MH wakes up andthen immediately goes back to sleep before receiving the invalidation report, consistency
of the cache is not compromised, as it would use the same value of the cache time stamp inits probe message after waking up and hence get the correct information in the invalida-tion report Thus, arbitrary sleep patterns of the MH can be easily handled
As an example, consider the scenario shown in Figure 26.4 Initially, the cache time
stamp of the MH is t0 and MH’s cache has two data items with ids x and z When MSS ceives an invalidation message notifying it that x has changed at the server at time t1, it
re-adds the invalidation message to MH’s HLC and also forwards the invalidation message to
the MH with (data item id and time stamp), i.e., (x, t1) On receiving the invalidation sage from the MSS, the MH updates its cache time stamp to t1 and deletes data item x from its cache Later, when MH wants to access y, it sends a data request with (y, t1) to the
mes-MSS In response to the data request, the MSS fetches and forwards the data item
associ-ated with y to the MH and adds (y, t2) to the MH’s HLC, where t2 is the last updassoci-ated time stamp provided by the data server The MH updates its time stamp to t2 and adds y to its
cache Now suppose MH gets disconnected from the network and the invalidation
mes-sage for y is lost due to this disconnection When MH wakes up, it ignores any invalidation
messages it receives (until the first query), since later, upon the first query after waking
up, it sends a probe message (invalidation check message) to the MSS The MSS uses thetime stamp in this probe message to determine the invalidations missed by the MH and
Figure 26.4 An example scenario
Trang 9sends an invalidation report with all the missed invalidations by the MH In this case, the
MSS determines from MH’s cache time stamp t2 that MH has missed invalidation for y and z, so it resends them to the MH.
26.4.1 Comparison of Different Schemes
Existing schemes [7, 10, 11] for maintaining cache consistency in the event of tions in a mobile environment are all based on the call-back mechanism The basic prob-lem is that the call-back break (invalidation) messages get lost when the client is discon-nected As noted above, Barbara and Imilienski [7] have developed a periodic
disconnec-broadcasting invalidation report scheme to address the problem In this scheme, every L
time units a server broadcasts invalidation reports that carry information about all data
items that changed during the past w = kL time units A client still has to discard its entire cache if it is disconnected from the network and misses k consecutive reports, and user queries generated during the past L time units are answered only after receiving an invali-
dation report Several other schemes have been proposed that extend the broadcasting validation report scheme with respect to optimizing the size of the invalidation [11] re-port, adjusting the periodicity of invalidation reports in accordance to the query rate andclient disconnection time [12], and restricting broadcast to the vicinity of the mobile client[10] Wu et al [13] have proposed an enhancement in which the mobile host sends back tothe server the ids of all cached data items, along with their time stamps, after a long dis-connection The server identifies the changed data items and returns a validity report Thisresults in wastage of bandwidth and unnecessary up-link requests and still does not solvethe problem of arbitrarily long sleeps, since the local cache has to be discarded after a dis-
in-connection time greater than W Jing et al [11] have proposed a bit sequence scheme in
which each data item in the database is represented by binary bits The bit sequence
struc-ture contains more update history information than the window w, but results in larger
in-validation reports when only a few things have changed The cache still has to be
discard-ed if more than half of the items in the database have changdiscard-ed Hu and Lee [12] havesuggested an adaptive algorithm that predominantly uses the TS and bit sequence ap-proaches but provides better tuning of the system according to the current invalidation andquery rates
The schemes based on synchronous broadcasting invalidation reports have the ing characteristics:
follow-1 They assume a stateless server and do not address the issue of mobility (except thework by Liu and Maguire [10])
2 The entire cache is invalid if the client is disconnected for a period longer than theperiod of the broadcast (or some multiple of it)
3 scalability for large database systems is not adequately addressed
The Coda file system [14, 15, 16] provides an alternate mechanism to providing port for disconnected operations on shared files in UNIX-like environments Coda alsouses two mechanisms for cache coherency When the client is reachable from at least one
Trang 10sup-server, the call-back mechanism is used When the disconnection occurs, access to bly stale data is permitted at a client for the sake of improving availability Upon recon-nection, only those modifications at the client that do not cause any conflict are commit-ted Balance between speed of validating cache (after a disconnection) and accuracy ofinvalidations is achieved by maintaining version time stamps on volumes (a subtree in thefile system hierarchy) However, validating the entire cache upon every reconnection mayput an unnecessary burden on the client Further, since Coda is a distributed file system, itassumes a stateful server that may not be appropriate for other applications such as webcaching Also, the server has to keep the cache state of each client and the client has toperform volume-by-volume validation checks after each reconnection
possi-26.4.2 Comparison with the AS Scheme
As has already been noted, all of the existing schemes are based on synchronous or odic broadcast of invalidation reports None of the cited works investigate the effect of us-ing these schemes on an actual wireless network All of the schemes are based on aggre-gating queries for a fixed period of time and then answering them after receiving aninvalidation report This provides very poor network utilization, as there is no traffic forlong periods of time followed by a very heavy burst This also results in higher queuingdelay for answering a query
peri-Unlike these strategies, all of which use synchronous invalidation reports and are based
on the basic scheme of [7], the AS scheme is asynchronous and stateful, hence the name
AS In order to compare the AS scheme with the sleepers and workaholics scheme of [7],
we note the salient features of that scheme as follows:
앫 Every L time units, a server broadcasts invalidation reports that carry information about all data items that changed during the past w = kL time units Two variations
of this basic scheme are suggested: (1) TS, where invalidation reports carry
infor-mation about changes in data items over a larger window (k > 1), and (2) AT, for which k = 1 (See Fig 26.5)
앫 Clients maintain local caches and use the information in invalidation reports to date their caches
up-앫 If a client is disconnected from the network and misses k consecutive reports, it
dis-cards its local cache
앫 Queries generated during the past L time units are answered only after receiving an
invalidation report
We also consider an “ideal scheme” to compare with the AS scheme The ideal schemehas the following characteristics: (1) whenever any data is changed at the MSS, the invali-dation information is available to the clients instantaneously at no cost; (2) the above holdseven when the MH is disconnected from the MSS, i.e., there is no overhead due to discon-nections Clearly, the ideal strategy is infeasible for any practical system; nevertheless, itprovides useful reference points on the achievable hit rate and delay Table 26.1 gives a
Trang 11comparison of the salient features of the proposed scheme with those of the TS and AT
schemes Quantitative bounds are shown in Table 26.2 for a system with N mobile hosts, each of which are caching M data items The improvement in performance is achieved at
the cost of maintaining additional buffer space at the MSS Since memory is cheap, cially at the stationary MSS, performance benefits outweigh this relatively minor cost
espe-Figure 26.5 Barbara and Imilienski’s TS/AT scheme (L = broadcast latency; w = window size;
k > 1 for the TS scheme and k = 1 for the AT scheme).
TABLE 26.1 Comparison of salient features of TS/AT and AS schemes
Server is stateless (no information about client Server is stateful (HLC maintained)
cache is maintained) Invalidation report broadcast only if anyInvalidation reports sent regardless of whether client has valid data in cache
clients have any data in cache Invalidation reports sent as and when data
Invalidation reports sent periodically at rate L changes (asynchronous)
(synchronous) Latency is governed only by the queuing
Average cache access latency is L/2 plus delay on the network
network queuing delay Queries are answered as they are generatedTraffic on the network is bursty as queries are Arbitrary sleep patterns can be supported
aggregated for a period of time L Mobility can be transparently supported byCache restored for sleep limited to a maximum using a mobility-aware network layer, e.g.,
duration of w (TS) or L (AT) Mobile IP
Mobility is supported by assuming a replication
of data across all stationary nodes
(not scalable)
Trang 1226.5 FORMAL DESCRIPTION OF THE SCHEME
26.5.1 Data Structures
Every data object has a unique identifier The letters x, y, and z will be used to denote data
with identifier x.
The following data structures are maintained at each MH:
home MSS
앫 First_Request: A flag set to TRUE when an MH wakes up and has yet to make its
first query after awakening The flag is set to FALSE once the the first request afterwaking up is made
앫 First_Waiting: A flag set to TRUE when an MH has made its first query after getting
reconnected to the network but the data for it has not been received
The following data structures are maintained at each MSS:
앫 HLC[1, , N]: an array of lists HLC[i] is a list of records of the type (x, T, valid_ flag), one for each data item x cached by MH i N is the total number of MHs that are in the cell of the MSS T is the time stamp of the last invalidation of x The invalid_ flag is set to TRUE for data items for which an invalidation report has been
in-sent but no implicit acknowledgment has been received
26.5.2 Messages
앫 INVALIDATION_REPORT (item_list, T, first_ flag): Sent to an MH by its home MSS to report invalidation of data items in item_list T is the time stamp associated with this report first_ flag is set if this invalidation report is in response to the first
query of the MH on waking up
TABLE 26.2 Comparison of cache invalidation strategies
Trang 13item x when x is not found in its local cache t is set to the time stamp t smaintained
by the MH The flag first_ request is set if this is the first data request after the MH
regains connectivity to the network
time stamp set to the current time at the MSS
re-2 Data item(s) updated at MSS The MSS sends an invalidation report to all the MHsthat are caching the changed data item and to whom a previous invalidation has notbeen sent for the same data It also updates the data time stamp in the HLC for theseMHs and marks those items as invalid
Each MH continuously executes a procedure called MH_Main The following eventsare handled:
1 MH generates a request for a data item If the MH has woken up after a sleep andthis is the first request, it sends a data request for the item and sets a flag
(Flag_Waiting) to indicate that the buffered invalidations during the sleep period
have not yet been received On receiving those invalidations, it answers successivequeries from the cache If the query is not the first after a wake up, the cache ischecked for that data item If the item is not in the cache, a data request is sent to theMSS and the query is answered once the data arrives from the MSS
2 MH receives an INVALIDATION_REPORT from the MSS The MH sets its cachetime stamp to the time stamp in the current message and invalidates in its cache allthe data items mentioned in the report All invalidations received between the time
an MH awakens and receives the first query are ignored
3 MH receives DATA from the MSS It updates its cache with the current informationand also updates its cache time stamp
4 MH wakes up after a disconnection It sets the First_Request flag to TRUE