You are on page 1of 6

JOURNAL OF COMPUTING, VOLUME 4, ISSUE 4, APRIL 2012, ISSN 2151-9617 https://sites.google.com/site/journalofcomputing WWW.JOURNALOFCOMPUTING.

ORG

164

A New Cache Replacement Policy Based on Neighbor nodes' condition in Mobile Environments
A. Sohail ghasemi and A. M. Rahmani
AbstractIn mobile environment, often users disconnect with network because limitation in battery power of mobile devices. In addition wireless lines bandwidth are rather less than wired lines and unstable wireless channel cause network congestion and lost the packets. Therefore data cache has use by the side of host mobile has used to reduce the competition wireless bandwidth and query as far as possible had answered local and as a result query latency increase to the least. Since cache memory is limited and it is impossible to caching all the data items, so data caching is limited. If limited disk memory is full and confront by new request that there wasnt in cache, should unessential data remove from cache and replace the wanted data. This way of choosing data for remove is called replacement policy. this research by study different cache management methods in mobile computing and by finding decreases of method previous replacement, accessed to optimized methods in replacement cache and a new Cache Replacement policy Based on Neighbor nodes' Condition in mobile environments is presented in that data cache of neighbor node is as a effective criterion in replacement and to inside data of determined cache that also in neighbor node cache is exist, allocate a priority for removing from cache. At the end by simulate the proposed model, this result is obtain that neighbor hit rate of proposed algorithm rather to classic algorithm is increased until response time query is reduced. Index TermsMobile Computing, Mobile Database, Data Management, Cache replacement, location-dependent information and neighbor node

1 INTRODUCTION
n lasts years, number of device mobile which have processing ability and transfer the information through the wireless network increase in notable form. Nowadays more than before mobile computing subject as a branch of computer engineer is lionize. Mobile computing on base of user necessity for access to information and also possibility to processing them in any time and place is formed. In mobile computing an effective method for increase the lately query, frugality in bandwidth and battery power is saving data in mobile unit. Data caching problem is the problem that also used in usual database for raising the efficiency from times ago, but in mobile database because of its features such low bandwidth, battery power find a special importance. Moreover wireless lines capacity is less than wiry lines and the unstable wireless channels cause network congestion and lose the package. By this reasons data cache has used from host side. Host use own data cache for computing that causes efficiency and accessibility are increased. Forasmuch as disk memory is limited and it is impossible to save all of data items in it so data caching is also nearly possible. If limited disk memory has full and confront with new request, that there wasnt in cache, should remove some of unessential data and requested data has replaced. Cache replacement techniques are for keeping the more necessity items. These techniques are for decrease the client relationship with saver that causes rising in efficiency and speed. In this outline different works is accomplished that has

results to do different act among MFU 1, FAR 2, LRU3, LNC-RA4 and PRAG 5 that altogether tried to improve the local hit rate. Toward this replacement politics, precaution mobile client move path is scrutinized and its effects on enter to valid domain has spotted. Data distance points to client actual location till valid domain data. When data value distance with valid domain is very much, probability to further use is less and data in other areas is invalid so this data should remove from cache and the new data has replaced [1], [5]. Predicting problem in cache replacement algorithm has notable effect on mobile computing efficiency. In previous researches on this basis several works has done like cache replacement algorithm based network distance [9], cache replacement algorithm based network density [9], cache replacement Algorithm based nodes motion direction [16], cache replacement algorithm based predicted region [11], replacement algorithm based motion pattern, that altogether can divide in a bigger group as "predicted necessity data in future", that most of them has estimate as for to move path of client and in this basis to predicate the other wireless network sources that can be effective in replacement algorithm any research has not done. So by attention to prediction importance in optimized the replacement algorithm and raising the efficiency, this topic has a more place to researches and our goal of this
0F 1F 2F 3F 4F

1 Most Frequently Used 2 Furthest Away Replacement 3 Least Recently Used 4 Least Normalized Cost. Replacement / Admission 5 Profit-based Replacement algorithm with Aging Counter

JOURNAL OF COMPUTING, VOLUME 4, ISSUE 4, APRIL 2012, ISSN 2151-9617 https://sites.google.com/site/journalofcomputing WWW.JOURNALOFCOMPUTING.ORG

165

paper is present a new policy that can effect on caching algorithms improvement. The remainder of this paper is organized as follows: Problem assumptions in section II, a new Cache Replacement policy Based on Neighbor nodes' Condition become propounded and on the base of that the algorithm is presented in section III. The results of the proposed algorithm simulation studies are presented in section IV. The paper concludes with section V.

2 PROBLEM ASSUMPTIONS
Every node has one connection domain that just can connect with domain inside nodes that these nodes are called neighbor nodes [12]. (A and B are neighbor if their distance be less than R and they connect to each other without intermediate). Cache discovery algorithm find requested data from nearest possible node and deliver them that confront with kinds of nether hits: If data was exist in client own cache, local hit is occurred. If data was detected from a neighbor node cache, neighborhood hit is occurred. If data was detected from server data base or other node cache, global hit is occurred. Forasmuch as local hit cost is less than neighborhood hit, centralization of all the researches that done before, were on increasing this kind hits .but beside increasing neighborhood hit also has too effect on increasing efficiency because data detection cost from neighbors is rather less than data detection cost from server. Almost in real life there are mobile teams which assist together in an area and they are neighbor for a long time (like user inside a train) and if they have common work topic, they need same data and can use this neighborhoods for optimizing the new replacement policy. In these cases instead a person of cache, a bigger cache group can have benefit. All data are supposing read only because of simplicity in work till ignore data inconsistency and concentrate on replacement methods. Data size are suppose same although data size in replacement algorithms is important and affect on efficiency but because of being a new policy ,aim is checking the total policy efficiency and pass up of data size effect in this article and postpone it to future work.

that with using the new policy, carry out a replacement process until mentioned policy be checking more by resolution and simulation of this policy. In this algorithm there are three important factor neighborhood, accessibly probability and validity that interfere in cache replacement. Neighborhood Factor: in this method every node provide a list of resent neighbors with their neighborhood possibility in future time and save them in a table as neighborhood possibility. In most simple situation, without spotting speed and user actual move direction, neighbors possibility computing in this way. In time window that include m time dot, is defined for A0 determined node. If in number of times that Ai and A0 were neighbor, be d, neighborhood possibility of Ai and A0 computing with (1):

(1) P ( Ai ) = d m It means if two nodes in most of past time were neighbor, in near future they possibly will be neighbor too. For predicate more exact neighborhood should spot other factors like move direction, nodes actual move speed and nodes move way. Neighborhood factor for every data inside cache can define in this way: possibility for being at least one neighbor in near future that has given data value. So for a given data value in cache like D that also exists in cache of n neighbor, act thus: Pointed that nodes compute neighborhood possibility with every node in near future and keeping in table and by this table neighborhood factor for D separate compute of (2) [14].
n n f ( N D ) = P i=1 Ai = P ( Ai ) ( Ai A j ) + i=1 i< j (2) n+1 P ( Ai A j Ak ) ...( 1) P ( A1 A2 ... An ) i < j <k

P ( Ai ) : A0 neighborhood possibility with i node


n P i=1 Ai : A0 node neighborhood possibility with A1, A2

An nodes A1, A2 An: neighbors that have D given data value in their cache
f ( N D ) : Neighborhood factor for D given data value in A0 given node As A0 neighborhood possibility with node1 is independent of neighborhood possibility with node2, sharing of two possibility compute of (3) [14]. (3) P ( A1 A2 ) = P ( A1 ).P ( A2 ) Hint: maybe there are nodes with high neighborhood possibility that have mentioned data but they have not computed in neighborhood factor because they arent A0 node neighbor now. Therefore in replacement algorithm for D data that also exist in other n neighbor cache, get a priority as neighborhood factor that is amount between 0 and 1. Access Probability Factor: Keeping data with high access probability, increase local hits and at the end have decreasing query latency average. For every data existent in cache access possibility compute of two coefficients. Forasmuch as data inside the cache that recently used,

A NEW CACHE REPLACEMENT POLICY BASED ON NEIGHBOR NODES' CONDITION

In this part a new Cache Replacement policy Based on Neighbor nodes' Condition (CRBNC6) in mobile environments is render that in this policy, existent data in neighbor nodes cache is spot as an effective cache replacement factor and to data in inside the specific cache that also there is in neighbors, give a priority for removing from cache. The main idea of this policy is concentration on increasing neighbor hits. Here on new algorithm is render
5F

6 Cache Replacement Based on Neighbor nodes' Condition

JOURNAL OF COMPUTING, VOLUME 4, ISSUE 4, APRIL 2012, ISSN 2151-9617 https://sites.google.com/site/journalofcomputing WWW.JOURNALOFCOMPUTING.ORG

166

in most probability it will be used again soon. Therefore first factor is resent use coefficient that every data inside cache coefficient show time of using this data toward other data. for compute this factor Accrue a number to every data that every time is used, its amount change to N namely same cache capacity (because data suppose in same size equal data numbers that situate in cache) and diminish 1 from other data counter. So for D data that exist in cache, resent use coefficient compute of (4): (4) LU D = S N LU D = D Data resent use coefficient N = data Numbers that situate in cache (cache capacity) S = Every data counter value Beside every data that is use continual, in most probably is use soon. Hereupon second factor is use repeat number coefficient, other variable accrue to every data inside cache that until the time it is inside of cache, increase 1 unit of value by every use. So for D data in cache use repeat number coefficient compute of (5):
RU D = KD NK 0 d

less access cost are choose for exit. Therefore data with low access possibility, high neighborhood factor and distance till valid scope immolate for new data. Though perhaps at the same time two neighbor altogether use this connection and remove data so before removing their data from cache, send a message to their neighbors and neighbors while having data, reflect acknowledgment and remove data then the mentioned node receive command acknowledgment. Of course cache distance till data source and also data size count in an important factor in replacement algorithms that for works simplicity, contained from them and this amounts is spot same.

4 SIMULATION RESULTS
The proposed algorithm by c# is simulated and it forasmuch as LRU and MFU replacement algorithm had uppermost efficiency, in this simulation also compares a new algorithm with this algorithms.

(5)

RU D = D Data use repeat number coefficient t K D = Repeat variable value of D data


N 0 Kd = Sum of repeat variables

At the end D data item access possibility factor getting from two fore factor. (6) PD = LU D RU D PD = D Data item access possibility factor Validity Factor: This amount for data that arent dependent to location always is one. For Location Dependent data, validity factor compute in this way; as regards every node equipped to GPS so data distance specified with valid scope, so if mobile node inside the valid scope is defined, D data validity factor equals one, Otherwise compute in this way that a determined length spot as a D data criterion distance, if node distance till valid scope is less than criterion distance, D data validity factor is equal criterion distance minus node distance till validity domain division to criterion distance. 0 if ( ds < d ) ds d (7) f (vsD ) = if (vs d ds ) ds if (data in vs) 1 d = Distance till valid scope dc = Criterion distance vs = Valid scope f (vs ) = D Data validity factor
D

A. Simulation aims In mentioned simulation unlike same simulation that just local hit rate was efficiency criterion, neighborhood hit rate and also query latency average are important. Because the most important aim of proposal algorithm is increase neighborhood hit rate that finish to decrease query latency average. In this form of simulations, obtained results have copious connection to entry, so simulation with analysis helps to exact evaluation of efficiency. This simulation aim is checking this algorithm efficiency toward other algorithms in different environment dimension, nodes different speed and various cache sizes. B. simulation scenario

Simulation scenario is in this manner: in square shape environment create 200 node that nodes are move in random form, radio domain (neighborhood ray) is100 meter, cache and data size suppose same, cache capacity is according to data number and total data number of data base spot 1000 and 200 data is define active, criterion distance spot 500 meter and validity domain ray counted in 200 meter. CRBNC algorithm overload time spot 0.05 second. Query latency in local hits spot 0.02 second, in neighborhood hits spot 0. 2 second and global hits spot 1 second for each node perform 150 queries in CBR form.

At the end replacement function for D determined data compute with compute of (8) and data with lesser PD are choose for immolate: (8) RD = f (vsD ) ( PD + (1 PD )(1 f ( N D ))) PD = D Data item access possibility factor f (vsD ) = D Data validity factor f ( N D ) = D Data item neighborhood factor During replacement process of this policy data with

JOURNAL OF COMPUTING, VOLUME 4, ISSUE 4, APRIL 2012, ISSN 2151-9617 https://sites.google.com/site/journalofcomputing WWW.JOURNALOFCOMPUTING.ORG

167

Algorithm 1: Cache Replacement Based on Neighbor nodes' Condition


Input: Xd , Yd: environment dimension S: nodes' speed SC: cache size Output: lhr: Local hit rate nhr: Neighborhood hit rate aql: Average query latency

Query latency of neighbor hite reat local Query latency of global hite reat local Query count Method of query creation

0.2 s 1s 150 CBR

SIMULATION IN WIRELESS DIFFERENT ENVIRONMENT DIMENSION

Procedure: 1: create 200 node in Xd *Yd environment dimension 2: random initialization to X,Y for each node in this Environment 3: random initial to cache 4: for each node i in this environment{ random initial to cache[cache size] for j = 0 to Query count{ query creation search in itself cache; if finding{ hitratelocal += 1 avrdelay += 0.02} Else if search in neighbor cache if finding { hitratenear += 1 avrdelay += 0.2} Else if{ avrdelay += 1 for (all data of itself cache ) RD[i]=f(vsDi) (PDi+(1PDi)(1f(NDi))) Victim=index of cache[min(RD[i])] Replace query instead of cache[Victim] }//else if }//for Change X,Y via nodes' speed} 5: hitratlocalall= (sum of all node hitratelocal)/( cont of all query) 6: hitratnearall = (sum of all node hitratenear)/( cont of all query) 7: avrdelayall = (sum of all node avrdelay)/( cont of all query)

In this part, above scenario, with 10 m/s fixed speed and cache size spot 200 data for each node that nether results obtained.

Fig. 1. CRBNC algorithm and the other algorithm simulation in wireless different environment dimension: (a) local hit rate; (b) neighborhood hit rate; (c) Average query latency;

Table 1: Simulation Parameters


parameter Node's Motion Environment formation Node's count Neighbourhood Radius All data counts Active data counts Distance sample Distance sample Radius time CRBNC over Query latency of local hite reat square 200 100m 1000 data 200 data 500 m 200 m 0.05 s 0.02 s value random

Figure 1 (a) shows that local hits in CRBNC algorithm rather to other algorithms have not much difference and environment dimension have not affect on local hits so may say realty algorithms manner reason is that environment situation like neighbors number, environment dimension, etc are not incoming in used algorithms for increasing local hits. Figure 1 (b) shows that in all algorithms, whatever environment is smaller, neighborhood hits are more. Reason of this mentioned manner is that in small environment the neighborhoods are more and consequently, also neighborhood hits are a lot but by growing the environment, neighborhoods become less. Forasmuch as LRU and MFU algorithm have not any predicate for increasing neighborhood hits so in vast environments, neighborhood hits decrease so much and in this situation CRBNC algorithm shows its efficiency. In Figure 1 (c) when wireless environment dimensions is very small, average query latency to search CRBNC algorithm is more than other algorithm and whenever environment is increased, suggested average query latency CRBNC algorithm is less than other algorithm, because CRBNC algorithm has overhead, therefore for selection sacrifice data , at first neighborhood factor must be calcu-

JOURNAL OF COMPUTING, VOLUME 4, ISSUE 4, APRIL 2012, ISSN 2151-9617 https://sites.google.com/site/journalofcomputing WWW.JOURNALOFCOMPUTING.ORG

168

lated for data and it should return to neighborhoods that of course this overhead in comparison with data receiving from out-of-the-way node is inconsiderable. ALGORITHM SIMULATION WITH DIFFERENT NODES' SPEED In this section, cache size for every node is 200 data and environment dimensions are 3000*3000m and nodes' speed has changed, since it was observed nodes' speed affect on algorithm behavior.

ALGORITHM SIMULATION IN DIFFERENT SIZES OF NODES CACHE In this section, it was considered steady speed is 10 m/s for every node and dimensions are 3000*3000m for wireless environment.

Fig. 3. CRBNC algorithm and the other algorithm simulation in different sizes of nodes cache: (a) local hit rate; (b) neighborhood hit rate; (c) Average query latency;

Fig. 2. CRBNC algorithm and the other algorithms simulation with different nodes' speed: (a) local hit rate; (b) neighborhood hit rate; (c) Average query latency;

In this section, cache size for every node is 200 data and environment dimensions are 3000*3000m and nodes' speed has changed, since it was observed nodes' speed affect on algorithm behavior. Figure 2 (a) show that nodes speed has not effect on local hit rat and algorithms behavior is similar to one another and nodes speed dont have effect on local hit. It was said that used algorithm for local hit, environment condition as nodes' speed, neighborhood count, and environment dimension are not efficient. Figure 2 (b )show that in other algorithms, speed nodes have no effect on neighborhood hit rat because neighborhood hit dont conform any algorithm, but in CRBNC algorithm whenever node speed is increased, neighborhood hit rat is decreased because neighborhood is changed early in high speed. As a result neighborhood hit is decreased and in the worst case (speed node is very high) neighborhood hit CRBNC algorithm in comparison to other algorithms is not decreased. In figure 2 (c) when speed changed, average query latency to search decreased but it is observed that in the worst case (when nodes speed is very high) neighborhood hit rate is equaled to LRU and MFU algorithm, on the other hand, new algorithm have some overhead that it resulted to increase average query latency in comparison to other algorithm in high speed.

In simulation, cache size has been supposed similar, so the meaning of cache size is cache size of all nodes. in Figure 3 (a) when cache size increased, local hit increased in all algorithm too, but cache couldnt consider very extensive indeed, because in fact when cache become extensive, respond time is increased in local hit, because search in extensive data base is time consuming and on the other hand, when data conflict is introduced growing the cache increased significantly the respond time to query ascended. So purpose is cache replacement improvement with small (appropriate) size. In Figure 3 (b) when cache size is very small, neighborhood hit is low partly, but CRBNC algorithm present more neighborhood hit than LRU and MFU. CRBNC algorithm have this prominent while cache size is appropriate, but when cache is increased and many hit are local, neighborhood hit rate of all the algorithms is decreased and is approached together ,so CRBNC algorithm for appropriate cache size, neighborhood hit increased (that is said purpose is replacement algorithm improvement whit appropriate cache size). Finally, Figure 3 (c) is previous studied two figure conformity that present when cache size is appropriate, CRBNC replacement policy have high efficiency. But when cache size is very extensive, CRBNC algorithm average query latency is more than the other algorithms, since CRBNC algorithm have overhead ,because, at first for selection sacrifice data, it must be calculated neighborhood factor for data and it referred to neighborhood that it was said replacement algorithm improvement purpose for cache size is small partly.

JOURNAL OF COMPUTING, VOLUME 4, ISSUE 4, APRIL 2012, ISSN 2151-9617 https://sites.google.com/site/journalofcomputing WWW.JOURNALOFCOMPUTING.ORG

169

C. Simulation consequences
Simulation and research in new replacement algorithm behavior in different situation and comparing to similar algorithm was resulted to that mentioned algorithm decreased respond delay in extensive wireless environments when cache has appropriate size but when speed nodes ascended, it is encountered to efficiency decrease and it acts in the worst similar case of other substitution algorithm. Therefore, however, CRBNC algorithm has overhead, in expected situations, cache efficiency increased and since, substitution algorithm improvement purpose for cache is small in extensive environment, therefore, new replacement algorithm has appropriate efficiency for to attain this purpose.

[7]

[8]

[9]

[10]

5 CONCLUSION
In this study ,efficiency algorithms and previous policy studied and it introduced a new Cache Replacement policy Based on Neighbor nodes' Condition (CRBNC) that in policy every node that has itself cache data in the neighborhood nodes cache precede to sacrifice new data. Therefore neighborhood hit rate in nodes increased and introducing an algorithm in accordance to policy and suggested algorithm simulation attained this outcome that new policy improve efficiency cache in extensive wireless environments with small cache and however, sometimes, in real world, there are mobile teams that corporate to another in a region and they neighbored for a long time and if they have similar work subject, they need similar data, in these cases, it can use extensive group cache instead of single cache. Therefore, purpose improve cache replacement algorithm for cache appropriate size in extensive environments. So, new replacement algorithm has appropriate efficiency to attain this aim and it decreased costs as energy, time, and bandwidth.

[11]

[12]

[13]

[14] [15]

[16]

[17]

A. Beloued, J. Gilliot , "Dynamic Data Replication and Consistency in Mobile Environments," Proceedings of the 2nd international doctoral symposium on Middleware, ACM, 2005. J. Cao, Y. Zhang, L. Xie and G. Cao, "Consistency of Cooperative Caching in Mobile Peer-to-Peer Systems over MANET Distributed Computing Systems Workshops ,25th IEEE International Conference , pp. 573 579, 2005. M. Magdalene Jane, F. Yaser Nouh, R. Nadarajan, and M Safar, "Network Distance Based Cache Replacement Policy for Location-Dependent Data in Mobile Environment," Ninth International Conference, Mobile Data Management Workshops, pp. 177-181, 2008. W. Li, E. Chan, and D. Chen , "Energy-efficient Cache Replacement Policies for Cooperative Caching in Mobile Ad Hoc Network," In Proceedings of IEEE Wireless Communications and Networking Conference (WCNC2007), pp.3347 3352, 2007. A. Kumar, M. M. Manojand and A. Sarje "A Predicted Region Based Cache Replacement Policy for Location Dependent Data in Mobile Mnvironment", WiCOM 2006, pp. 22-24, 2006. Y. Chen, H. Wang, X. Zheng and J. Yang, Prediction of Near Likely Nodes in Data-Centric Mobile Wireless Networks, in Proceedings of the IEEE Military Communications Conference, pp. 1 - 7, 2009. G. Anandhararja and R. anitha "An Improved Architecture For Complete cache management in mobile computing Environments", International Journal of soft computing, Vol:4, no: 3, pp.142-147, 2009. j. Behboodian. "introductory statistics and probability" ,2000 T. Imielinski and B. R. Badrinath, "Mobile Wireless Computing: Challenges in Data Management," 1994 Comm. ACM, vol. 37, no. 10, pp. 1828, 1994. Q. Ren and M.H. Dhunham, Using Semantic Caching to Manage Location Dependent Data in Mobile Computing, ACM/IEEE MobiCom, pp. 210-221, 2000. B. Zheng, J. Xu and D. L. Lee, Cache Invalidation and Replacement Strategies for Location-Dependent Data in Mobile Environments, IEEE Trans. on Comp., 51(10), 2002.

REFERENCES
[1] K. Shanmugavadivu and M. Madheswaran, "Caching Technique for Improving Data Retrieval Performance in Mobile Ad Hoc Networks," International Journal of Computer Science and Information Technologies, 2010. B. Zheng, J. Xu, and L. Lee, "Cache Invalidation and Replacement Strategies for Location-Dependent Data in Mobile Environments IEEE Transactions on Computers, Vol: 51 no:10, pp. 1141 - 1153, 2002. B. Y. Chan, A. Si, and H. V. Leong, " Cache Management for Mobile Databases: design and evaluation, " Data Engineering, 14th International Conference, pp. 54 63, 1998. J. Cao, Y. Zhang and G. Cao, "Data Consistency for Cooperative Caching in Mobile Environments," IEEE Computer, Vol: 40, no:4, pp. 60 66, 2007 H. Hiary, Q. Mishael and S. Al-Sharaeh ,"Investigating Cache Technique for Location of Dependent Information Services in Mobile Environments", European Journal of Scientific Research, 2009. C. K. Lee, W.-C. Lee, J. Winter, B. Zheng, and J. Xu. "CS Cache Engine: Data Access Accelerator for Location-Based Services in Mobile Environments", in Proceedings of the 25th ACM SIGMOD Int. Conf. on Management of Data (SIGMOD '06), 2006.

[2]

[3]

[4]

[5]

[6]

You might also like