MobiSys 2007 - Earl Oliver

Selected Papers from
MobiSys 2007
Earl Oliver
Papers
• Improving Mobile Database Access Over
Wide-Area Networks Without Degrading
Consistency
• COMBINE: Leveraging the Power of
Wireless Peers through Collaborative
Downloading
Improving Mobile Database
Access Over Wide-Area
Networks Without Degrading
Consistency
Niraj Tolia, M. Satyanarayanan, and Adam
Wolbach (Carnegie Mellon University)
Problem
• Use of mobile database applications
growing (CRM, Sales, Insurance, etc.)
• Providing performance and consistency is
hard
– Limited bandwidth
– Previous performance solutions:
• Weaken consistency
• Per-application consistency model
Existing approach
Time
Client
Query
Result
Query Exec.
Database Server
(Master Copy)
SELECT query
Cedar overview
• New approach to mobile database access
– Avoids compromising consistency
• Exploits disk storage and processing power to reduce
network I/O
• Assumes weak WWAN connectivity
• Central master DB with mobile (lazily updated) replicas
• Implemented as JDBC stub
Application
Cedar
JDBC
JDBC
Driver
Driver
Replica
Network
Cedar Proxy
DB
High-level overview
Time
Client
Result
Query
Query
Exec.
Client Replica
Query +
RecipeResult
Database Server
(Master Copy)
∆(Result)
Query Exec. +
Result Comparison
SELECT query
UPDATE queries do directly to the server
Attributes of Cedar
• During periods of strong connectivity, Cedar directly
queries master DB and synchronizes replica.
• DB schema transparent
– So detecting differences in data is hard (explained later)
• Result deltas not applied to client replica
SELECT name,zip FROM users
SELECT name,address,zip FROM users
ID
Name
Address
1
John Doe
Mary Major
412 Avenue
2
821 Lane
Zip
Email
15213 [email protected]
15232 [email protected]
Commonality detection
• Exploit structure in results (tables)
SELECT name, address, zip, email FROM USERS
Name
Address
Zip
Email
John Doe
412 Avenue
15213 [email protected]
Hash1
Mary Major
821 Lane
15232 [email protected]
John Stiles
701 Street
00979 [email protected]
Hash2
Hash3
Recipe
Recipes
• Recipes can be large, especially for results with
small rows
– Each hash is 20 bytes for SHA-1, 32 bytes for SHA-256
0x 2fd4e1c6 7a2d28fc ed849ee1 bb76e739 1b93eb12
0x de9f2c7f d25e1b3a
Solution:fad3e85a
Only use 0bd17d9b
4 bytes as100db4b3
the row identifier
0x da39a3ee 5e6b4b0d 3255bfef 95601890 afd80709
• How can this ensure correctness?
–
–
–
–
–
Only compares results from same query: reduced key space
Therefore, a reduced probability of hash collisions
With 4 bytes and 10,000 hash values, Pr{collision} = 2.3 x 10-6
However, much lower than SHA-1, where Pr{collision} = 2-160
A hash over the entire result provides an end-to-end check
Rabin Fingerprinting vs. Structure
• Could Rabin fingerprinting be used?
– Extensive use in storage systems
– Chunks data using a stochastic process
`
– Works well for in-place updates, deletes,
insertions
– Does not work well for query results
• Reordering of data (ORDER BY)
• Also hard to pick average chunk size
Comparison to Rabin Fingerprinting
• Exploit structure is better than Rabin
fingerprinting
`
Rabin
`
`
`
Structure
Based
Putting it all together
 0x2fd4e1c6
 0x8c3aea3b
0x31b3887a30f020…
Client
0x2fd4e1c6
Authoritative
Result
?
Query
0x2fd4e1c6
0xda39a3ee
Tentative
Result
Client Replica
Database Server
Evaluation/Results
• Cedar evaluated using MobileSales
benchmark
– Based on TCP-App
– Using EVDO with various data rates
• Cedar improves average throughput of
read-write workloads by 39% - 224%
• Reduces average response time by 28%
to 79%
COMBINE: Leveraging the Power
of Wireless Peers through
Collaborative Downloading
Ganesh Ananthanarayanan, Venkat
Padmanabhan, Lenin Ravidranath,
Chandu Thekkath (Microsoft Research
India)
Problem
• Multi-homed mobile devices (laptops and
phones) are increasingly common
• How do we bridge the gap between the rangespeed dichotomy of these networks?
Speed
Coverage
WLAN (Wi-Fi, Bluetooth)
1 – 54 Mbps
Wi-Fi Hotspots
WWAN (3G, GPRS)
50 – 200 kbps
Cellular Network
Solution
• Pool WWAN bandwidths
• Using the WLAN to coordinate between
mobile devices
• How?
WiFi
COMBINE Approach
Initiator
GPRS
HTTP Server
Internet
COMBINE Approach
Search for collaborators
Wi-Fi or
Bluetooth
Initiator
GPRS
HTTP Server
Internet
COMBINE Approach
Connect to collaborators over Wi-Fi
Collaborator
Wi-Fi
Initiator
GPRS
HTTP Server
Wi-Fi
Internet
Collaborator
COMBINE Approach
Dynamically distribute the work
Collaborator
Wi-Fi
Initiator
GPRS
HTTP Server
Wi-Fi
Internet
Collaborator
Existing Work
• Collaboration via WLAN to increase the
coverage of the WWAN – UCAN
• Bandwidth Aggregation across WWAN links:
– Attached to same device – Horde, MAR, pTCP
– Across multiple devices – PRISM-IMUX,
MOPED, Handheld Routers
What’s new in COMBINE?
1. Incentives
– Promise of higher throughput may not be enough
– Energy is a critical resource
2. Accounting
– Ephemeral association – Tit-for-tat does not work
3. Node Discovery
– Collaboration happens at unpredictable times
– Idle power consumption is high
4. Work Distribution
– Centralized proxies hurt deployability (PRISM-IMUX)
1. Incentives
Participation costs:
• Monetary Cost
– Service provider fee
– Size of data transfer
• Energy Cost
– Battery energy depletion
• “Dynamic Market” for selling and buying unused
bandwidth
• Unify the monetary and energy costs
Cost (TC) = (Service Provider fee)/(Battery Remaining)
Estimating Battery Depletion
• Battery remaining likely to change during long
transfers
• Energy models for network interfaces exist…
– Require special hardware (compromise
deployability)
– Battery characteristics could change over
time
• Battery Depletion = (time_elapsed * BDt) +
(bytesWLAN * BDd_WLAN) + (bytesWWAN *
BDd_WWAN)
2. Accounting
How does money change hands?
• Central authority issues key-pair (keypub,
keypriv) to users
• Initiator signs IOU’s to the collaborator
• IOU = {keypub, amount, nonce, seq, exp}
sign(key_priv)
– keypub and keypriv identify the initiator (payer)
– exp is expiration time
– nonce and seq maintain authenticity of IOU
Collaborators are credited their price!
Issue IOU, redeem with central authority
IO
U
IO
U
Collaborator
GPRS
HTTP Server
Initiator
Internet
Central
Authority
IO
U
Collaborator
Central Authority
• Collaborators need not be online with
accounting authority (unlike electronic funds
transfers)
– Redemption can be periodic and offline
• Validity and freshness of IOU verified (unlike
digital cash schemes)
3. Node Discovery
Hello, anybody out there?
• Idle power consumption of Wi-Fi cards is
high
– Battery life reduces by a third
• Nodes cannot keep their Wi-Fi NICs on in
anticipation of neighbours
Energy-efficient discovery
• Waiting Mode
– Periodic beaconing of I-am-Alive (Price,
Supported bandwidth)
– Similar to Power Saving Mode
• Multiple radios
– Bluetooth for node discovery (future work)
• Keeping Bluetooth interface on is inexpensive
– Wi-Fi cards are switched on only for data
transfer
4. Work Distribution
Protocol Design
• Striping
– Application-level: HTTP byte-range requests
• Initiator willing to pay C units for a file of size
F bytes
• Dynamic environment
– Collaborator’s link characteristics vary
– Collaborator’s advertised price might exceed the
threshold (C/F)
– Personal activity to be given higher priority
Conservative Approach
• Group Selection
– Threshold-Price = (C/F)
– Initiator accumulates I-am-Alive messages (bids)
– Selects nodes with price ≤ Threshold-Price
• Work Distribution
– Work-queue with equal-sized work items
– Collaborators service work-queue by picking up one
work-item at a time
• faster nodes automatically service more work
items
– Chunk size needs to be optimum (experiments found
200 KB chunks for HTTP)
Analysis (brief)
• Group formation takes less than 8 seconds
• Near-linear speed-up for both laptops and
PPCs – download an 8 MB file across the
Internet
COMBINE Summary
• Collaborative downloading
– Software-only solution for bandwidth boost
• Practical cost and accounting scheme
• Easy-to-deploy striping mechanism
• Energy cognizance
Questions?