330 likes | 430 Views
CSE 4340/5349 Mobile Systems Engineering. M. Kumar Spring 2010 Week 5 Caching in Mobile Systems. Issues and Challenges. Disconnection and Mobility Heterogeneity Limited Resources Space Battery energy Acquire and Disseminate Data Consistency Proactive and Unobtrusive services.
E N D
CSE 4340/5349Mobile Systems Engineering M. Kumar Spring 2010 Week 5 Caching in Mobile Systems
Issues and Challenges • Disconnection and Mobility • Heterogeneity • Limited Resources • Space • Battery energy • Acquire and Disseminate • Data Consistency • Proactive and Unobtrusive services Kumar
Topics of interest • Pull and Push (Subscribe-Publish) • On-demand cache • Data Consistency • Prefetch • Passive prefetch • Caching continuous media information • Profiling and prototype system • Discussion Kumar
Architecture of a Mobile Distributed System Original Server Original Server Wired Network MSS 1 2 MSS 3 4 5 Mobile Device 6 7 Base Station Kumar
Documents to be purged Documents to be purged Overall Caching System Factors affecting utility Factors affecting utility Profiles and priorities Profiles and priorities values of documents values of documents New documents New documents CACHE CACHE Cached Cached Determine Determine Compute Compute And and Optimal Optimal Utility utility Cached Cached Cacheable Cacheable Set of Set of values of values of Prefetched Prefetched documents documents documents documents documents documents Broadcast Broadcast Kumar
Demand fetch and cache • Demand fetch • Remote data is fetched only when it is requested • Traditional cache • Repeatedly accessible remote data are retained in the local cache Cached data items Kumar
Mobile and Wireless Systems MSS acquires data from remote servers Kumar
Prefetch • In prefetching, remote data is fetched in anticipation of a future success • Prefetching is used to improve the speed of information access Cached and prefetched data items Kumar
Broadcast or Push Servers and remote stations broadcast data in anticipation of need by the client Broadcast data may compete for space with other data items Broadcast data may be ignored by clients. Accept or Ignore Kumar
Passive Prefetch popular Items requested Accept or Ignore Time Kumar
Consistency Updated? Item updated Invalidation Disconnects or sleeps Time Kumar
Cache Consistency • Cached data items at mobile user’s device can reduce data access delay • Maintaining cache consistency is difficult due to mobile user’s frequent disconnectedness and mobility • Efficiency • Scalability Kumar
Add IR Any data object update Any data object update IR List MSS MSS MSS Broadcast IR timing Broadcast IRs MH MH MH MH Time Stamp for consistency • Timestamp (TS) or Stateless • Synchronous and periodic broadcast invalidation report (IR) to mobile hosts • Cache can be accessed after each IR broadcast. • Simple management • Not scalable • Inefficient handling of mobile hosts’ disconnection and mobility. D. Barbara and T. Imielinksi, Sleeper and Workaholics: caching strategy in mobile environments, In Proceedings of the ACM SIGMOD, pp1-12, 1994. Kumar
Asynchronous or Stateful MH Cache State Data object update Is in any MH cache? • The server maintains a state for each mobile host to record all cache content. • Cache consistency is checked after each disconnection or roaming. • Handles disconnection and mobility • Cost overhead to maintain cache state yes Broadcast IR MSS MH MH MH MH A.Kahol, S. Khurana, S. Gupta and P.K. Srimani, A strategy to manage cache consistency in a distributed mobile wireless environment, IEEE Trans. on Parallel and Distributed System, 12(7), pp 686- 700, 2001. Kumar
Scalable Asynchronous Cache Consistency Scheme (SACCS) • Uses flag bits at server and mobile user’s cache to maintain cache consistency • Each entry has an ID in a mobile user’s cache • The ID is maintained after the items invalidation also • All valid entries of mobile user’s cache are rendered uncertain on wake up or reconnection Kumar
Timestamp data object 1 flag bit data object 2 flag bits Timestamp 00: valid 01: uncertain 10: ID-only 11: uncertain with query on wait SACCS • in server cache: • in mobile user’s cache: 0:IR not broadcast 1: IR broadcast Kumar
Fetch y from server Set (y,t4,1) Forward y Fetch y from server Set (y,t2,1) Forward y to MUs y updated Set (y,t3,0) X updated Set (x,t1,0) IR(x) Query(y) Data(y) Uncertain(y,t2) Data(y) IR(y) y y 0 1 Query for y y 0 z 0 z 1 z 0 lost z 1 y 1 z 1 Scalable Asynchronous Cache Consistency Scheme (SACCS) t3 t3 t1 t2 MSS MH x 0 Cache z 0 Kumar
x update set fx=0 fx = 1 Broadcast IR of x MSS Uncertain (x, tx) Invalid entry of x Missing IRx Awake MH Sleep MH wakeup Request x Awake MH Set x into uncertain Cache Consistency Maintenance Flag bits: 0--valid, 1--ID-only, 2-uncertain 3--uncertain with waiting query Kumar
Prefetch Kumar
y requested x available y available x requested time time prefetch y y available y requested Gain Prefetch Kumar
y requested x available x requested time y available time prefetchy z requested prefetch y time z available Additional time to wait The Risk Kumar
6 2 3 7 6 2 3 8 7 Binary knapsack problem (KP) items: 6 2 3 4 8 7 1 5 knapsack: V Possible solutions: Kumar
F (items to prefetch) D (items to replace) Prefetch and Cache • (Assume uniform item size). Interim F (Found by solving SKP) C (Items in cache) items with largest Piri items with smallest Piri item with smallest delay saving* * freqiri Compare Kumar
Motivation • Hybrid wireless networks Integrate ad hoc and infrastructure based wireless networks. Kumar
Hybrid Wireless Networks Advantageous: high bandwidth, low deployment cost, wide service area. • Limitations: • Battery power of MUs near to BS exhaust fast due to the frequent data exchange with the BS, • short service life of the whole network. • Channel bandwidth of BS is a bottleneck • congestion at BS degrades network throughput. • The MUs far away from the BS experience long data access latency. A cooperative caching scheme to enhance peer-to-peer data sharing among MUs **to overcome the limitations of hybrid wireless networks. Kumar
Cooperative Caching in Hybrid Wireless Networks If M1 knew M3 cached d3! M2 M1 M3 Request for d3? Kumar
Cooperative Caching in Hybrid Wireless Networks • Each mobile has a cache to store the frequently accessed data items • The cached items serve not only the MU’s own requests but also the data requests from other MUs. • The MUs in a proximity form a cooperation zone (CZ) by proactively exchanging cache index messages. • The size of CZ is determined by a time-to-live (TTL) • Each MU maintains a peer cache index table for information of other peers in its cooperation zone. • When a data request arrives, • local cache hit data item available. • local cache miss forward request to the nearest MU that cached the item in the cooperation zone. • peer cache miss forward request to the base station. Kumar
TTL=0 TTL=1 TTL=2 d4 d4 M4 d4 M4 d4 M4 A simple example of ECOR What’s the optimal value of TTL, if we desire to optimize energy consumption? cache TTL=3 d2 d3 d1 d1 M1 M1 M2 d3 M3 d2 d2 M2 M2 M3 M4 d1 M1 Peer cache index table Request for d4 Kumar
disconnect data update handoff Events of mobile devices • Data request, data update at the server, mobility handoff and disconnection of mobile devices follow Poisson processes. nth Request (n+1)th Request Time Kumar
An analytical model of cooperative caching • The energy cost (E) of each data access consists of two parts: • 1) Energy cost to exchange cache index messages (E1) • 2) Energy cost to retrieve the item (E2) • The energy cost (E1) of exchange messages: • The energy cost (E2) : • 1) Local cache hit (zero energy cost) • 2) Peer cache hit within the cooperation zone (e1) • 3) Peer cache hit at an MU in the routing path to BS (e2) • 4) Retrieval from the base station (e3) Kumar