Upload
francis-wilkerson
View
220
Download
1
Tags:
Embed Size (px)
Citation preview
Algorithms for Supporting Disconnected Write Algorithms for Supporting Disconnected Write Operations for Wireless Web Access in Mobile Operations for Wireless Web Access in Mobile
Client-Server EnvironmentsClient-Server EnvironmentsBy: Dr. Ing-Ray Chen, Ngoc Anh Phan, Dr. I-Ling YenBy: Dr. Ing-Ray Chen, Ngoc Anh Phan, Dr. I-Ling Yen
Presented in: IEEE Transactions on Mobile Computing, 2002Presented in: IEEE Transactions on Mobile Computing, 2002
CS 5214 Spring 2002, Paper Presentation
By:
Sapna George
Sharath Ramaraj
AgendaAgenda
Introduction Problem Definition Proposed Solution
– System Model– Algorithms– Numerical Analysis of algorithms– Proof by simulation
Applications Conclusion
IntroductionIntroduction
The Web, a ubiquitous medium for collaborative creation and sharing of information.
The explosive growth in mobile computing technologies
Problems in merging the two– Communication link problems– Mobile device problems– Lack of support in standard web model for
disconnected operations– Synchronous nature of web protocols
IntroductionIntroduction
The Web, a ubiquitous medium for sharing information (passive).
The Web, a medium for collaborative creation and sharing of information (active).– Simple to create, easy to deploy, easy to use, uniform
UI – the browser (despite the on going browser wars!)
IntroductionIntroduction
The explosive growth in mobile computing technologies– Wireless technologies provide on-going connection to
network based resources.– The wireless Internet – deliver information to and from
hand-held device users regardless of where they are and how they are connected.
– The Web browser as the end-user interface to resources.
IntroductionIntroduction
Applications
Distributed calendar tools – BAYOU Meeting room schedulers – ROVER Evolving design document/form editing by
multiple authors – WEBDAV Online newspaper/journalism/sports services
IntroductionIntroduction
Problems in merging the Web and mobile users– Communication Link problems
Low bandwidth – Slower than wired networks Unreliable – dropped connections, blockage etc Costly Security issues Assumptions of web protocols – computers are connected via
high-bandwidth, low latency, inexpensive, reliable links.
– On a LAN, server response time is the primary concern.– In wireless, bandwidth and latency are the dominating
factors.
IntroductionIntroduction
Problems in merging the Web and mobile users (contd..)– Mobile device problems
Small displays Limited memory Limited processing power Low battery Greater vulnerability to network problems and security
– Cannot stay connected continuously
IntroductionIntroduction
Problems in merging the Web and mobile users (contd..) – Problems with HTTP
HTTP uses text format for data transmission HTTP is very inefficient – numerous TCP/IP connections,
redundant headers Synchronous nature of web protocols – World Wide Wait No support for disconnected operations. Operations fail when
client is disconnected from the server.
IntroductionIntroduction
Solution - Support for disconnected operations.– Voluntary or involuntary disconnections to save battery
and reduce cost of communication.– Pre-fetch into local cache frequently used web pages
(hoarding)– Web access during disconnection – read and write
operations on only pre-fetched pages. Maintains a log.– Reintegration, using the log, upon reconnection.
IntroductionIntroduction
Few proposed schemes– eNetwork Express - IBM
Proxies and local request queues Concept of coherency interval - how often a cached web page
should be checked for changes
– Caubweb – Open Group Research Institute Client side proxy to stage updates while disconnected PUT requests upon reconnection Server side PUT scripts to accept changes
– ARTour Web Express Client side staging of updates Asynchronous and incremental flushing of updates
Problem DefinitionProblem Definition
Questions to be answered– How should staged updates be propagated to the server?– What performance metric should be used to compare
strategies?– When should updates be propagated so as to maximize
the performance metric?
Objectives of the paper– Design and analyze algorithms to support web write
operations in mobile client-server environments– Identify the best reconnection time for propagating
updates so as to optimize system performance
System ModelSystem Model
1. Web server is located in the fixed network and is not moved during a web session.
2. MH communicates with the server via an intelligent gateway on the fixed network, e.g. a base station.
3. A pre-fetching policy exists. The pages and their version are fetched from the server. After pre-fetch, the MH will voluntarily disconnect itself.
System ModelSystem Model
4. MH obtains from the server during pre-fetch, the update history of each cached page, i.e.
– Update rate of the page by all users of the system – λi
w
5. MH knows it’s update frequency of each cached page, i.e.
– Update rate of the page by the MH – λi
6. Reintegration - Staged updates are propagated to the server upon reconnection to resolve update conflicts.
System ModelSystem Model
7. Uses an enhanced HTTP protocol - one TCP/IP connection for all the updated web pages.
8. For each modified page, MH submits to the server:
1. Differences between original page pre-fetched from the server and the latest version that it modifies
2. Version number of the original version
System ModelSystem Model
9. Web server checks if page was modified during the MH’s disconnection period – compares version numbers of page at server and page submitted by MH.
10. If version numbers are same, update is accepted and server page is modified.
11. If not, update is rejected.
System ModelSystem Model
11. If update is rejected: 1. MH stays connected (on-line)2. Requests a write lock on the page Differences relative
to MH’s original version (before updating) are sent by server
3. MH performs application specific merge algorithm to resolve update differences
4. MH propagates final updates and releases lock5. If MH is forced to disconnect after locking the page,
the server will break the lock after a timeout period.
ParametersParameters
λiw Update rate of a page by all users of the system (world)
λi Update rate of a page by the MH
T1 One-way communication cost over the wireless link for a packet carrying the differences
T2 One-way communication cost over the wireless link for an acknowledgement/reply packet
sr Average size of an ack/reply packet
so Average size of a web page
pm Average fraction of any web page modified
B Bandwidth of the wireless channel
ParametersParameters
Relationship between parameters
T1 = pm so / B
T2 = sr / B
T = T1 + T2
T – Round-trip communication cost for propagating a web page that has been updated by the MH, but has not been updated by the server at the reconnection time.
Normally, T1 >> T2, so T = T1
Performance MetricPerformance Metric
Performance Metric: – Total communication (or reconnection) time between
the MH and the web server in the reintegration phase during which all updates are propagated to the web server.
Goals of the proposed solution: – Find best disconnection interval so that total
communication time for propagating updates is minimized
– For real-time applications, this interval should be such that the deadline is not missed
Performance Metric (Contd..)Performance Metric (Contd..)
Exclusions1) Constant Costs (e.g. Connection Setup time,
Server processing time).
2) Intelligent mobile hosts applying heuristics for deciding reconnection time.
3) Adaptive reconnection times based on external conditions.
Update Propagation Update Propagation AlgorithmsAlgorithms
Update Propagation Update Propagation Algorithms ( Non- Forced)Algorithms ( Non- Forced)Protocol Implemented during
reintegration:1. MH sends differences between its
current version and also the previous version number in a PUT request packet.This step takes time T1
2. If web page hasn’t been updated server sends ACK packet to MH. This step takes time T2. The communication cost in this case is T1 + T2
Update Propagation Update Propagation Algorithms (Non-Forced)Algorithms (Non-Forced)
3. If web page has been updated, the versions won’t match. Hence the following happens.
1.Web server sends a rejection packet to MH: Time taken = T2
2.On getting reject MH sends lock request o page: Time = T2
3.On getting lock request server sends latest version by differencing: Time taken = T1
4.MH applies a merge algorithm to resolve update conflict based on latest version received: Time taken = Dm
Update Propagation Update Propagation Algorithms (Non-Forced)Algorithms (Non-Forced)
5. MH sends request packet to server containing differences and command to release lock: Time Taken = T1
6. Server sends reply packet to complete update process: Time taken = T2
7. The total time taken to complete this operation is 3T1 + 3T2 + Dm. = 3T + Dm
8. Dm stands for average time taken to resolve update conflict by MH
Update Propagation Update Propagation Algorithms (Forced)Algorithms (Forced)Many Online applications need forced updates when
MH is reconnected to server. 1. Need to propagate updates to the server at a preset
interval to avoid missing the deadline
2. This implies that a special protocol is needed for pages that are not updated
3. Also implies that reconnection is necessary prior to real time deadline, to account for update propagation time
Update Propagation Update Propagation Algorithms (Forced)Algorithms (Forced)Protocol Implemented during
reintegration:1. MH sends inquiry packet with
version number for the page: Time taken = T2
2. The server responds in the following way
1. If web page has been updated server sends differences to MH along with a lock on that page. Time taken = T1
2. If page is current, server sends reply packet to MH approving validity of the page: Time Taken = T2. A lock on the page is granted in this case also.
Update Propagation Update Propagation Algorithms (Forced)Algorithms (Forced)
3. MH modifies the page: Time Taken = Dm
4. MH Propagates differences to server: Time Taken = T1
5. Server sends an ACK to the MH: Time = T2
6. If case 1 of step2 was true: Total Cost = 2T1 + 2T2 +Dm = 2T + Dm.
7. If case 2 of step2 was true: Total Cost = T1 + 3T2 +Dm = T + 2T2 + Dm.
Update Propagation Update Propagation Algorithms (Contd..)Algorithms (Contd..)Suppose Length of Disconnection time is L
Probability that server has modified the page during L = ri
ri = Prob { Server update time to page i <= L} Fsi(L)
Fsi(t) = CDF of time t that server updates page i.
Updates arrive as a poisson process with λiw and λi for updates
by the world and MH respectively.
ri = 1 – e-(λiw - λi )L
Update Propagation Update Propagation Algorithms (Contd..)Algorithms (Contd..)Since we need update propagation time we need the
probability that MH has updates to send
pi = Prob {MH update time to page i <= L} FMHi(L)
FMHi(t) = CDF of time t that MH updates page i.
Updates arrive as a poisson process with λi for updates by the MH.
pi = 1 – e-λiL
Update propagation algorithms are discussed based on these rates and probabilities
Single Page Update Single Page Update Propagation AlgorithmPropagation Algorithm1. Concept of Coherency Interval is applied to determine
the best disconnection period for the MH
2. By this method, access to a cached page is allowed as long as access time is within this interval. Else the MH has to reconnect to server to get a new copy if it is different.
3. The length of this interval was a heuristic in disconnected read algorithms. It is equal to L in this disconnected write algorithm
Single Page Update Single Page Update Propagation AlgorithmPropagation AlgorithmThe Algorithm
1. If time of modifying the page by the MH is < L, then modifications are allowed to proceed by recording differences between versions.
1. Subsequent updates are processed locally until time reaches L
2. When time reaches L, reconnection happens
3. Updates are propagated by non-forced update protocol
4. Communication Cost is 3T + Dm with probability ri or T with probability 1- ri
Single Page Update Single Page Update Propagation Algorithm (Propagation Algorithm (Contd…)Contd…)
The Algorithm
2. If time of modifying the page by the MH is > L, then modifications are allowed to proceed as follows.
1. When time reaches L, reconnection happens
2. Updates are propagated by Forced update protocol
3. Communication Cost is 2T + Dm with probability ri or T + 2T2 + Dm with probability 1- ri
Single Page Update Single Page Update Propagation Algorithm (Propagation Algorithm (Contd…)Contd…)
The Algorithm
2. Average Communication time for propagating update for a single page on reconnection is
Ci = pi x [ri x (3T + Dm) + (1-ri)T ]
+ (1-pi) x [ri x (2T + Dm) + (1-ri) x (T + 2T + Dm)]
3. To get the minimum of L, we equate the slope of Ci with respect to L to zero.
4. ri and pi depend on the inter-arrival time distribution
Single Page Update Single Page Update Propagation Algorithm (Propagation Algorithm (Contd…)Contd…)
The Algorithm1. (2T + Dm)(λi
w - λi ) e-(λiw - λi )L
2. + T λie-λiL + (T + 2T2 + Dm) λiw e-λiwL = 0
3. This means at λiw = λi best L would be at infinity
4. Thus Ci = T + 2T2 + Dm – pi(2T2 +Dm) = T is at its minimum with no forced update cost
5. Hence if the MH dominates the page update then λiw ~ λi and
reconnection should happen at time Lsubopt such that cost is close to minimum
6. In case of real time deadline tR the deadline should be upheld
Numerical ExampleNumerical Example
Effect of the parameters λw , λ , Dm, pm, s0 is verified numerically
1) Effect of λ / λw : Ratio between MH update rate and world update rate
2) Effect of time to execute a merge algorithm Dm
3) Effect of size differences between the versions pmso
Effect of λEffect of λ // λλww
1. T1 is fixed at 5 seconds, T2 = 0 and Dm = 100 secs
2. λ is allowed to vary from 0.2 λw to λw
3. For Single page λw is set at 10 updates per hour.
4. As MH’s update rate gets bigger the curve gets deeper
5. At λ = λw t there is no minimum point.
6. As MH’s update rate gets bigger the curve shifts right meaning reconnection time L is shorter when MH’s update rate is far below world update rate
Effect of DmEffect of Dm1) λ / λw is set to .8, T1 =5 , t2 = 0.1 and Dm varies from 30 to 180 secs
2) As Dm increases curve gets deeper. If merge operation takes more tme thanit is good to propagate update at the deadline
Effect of pEffect of pmmss001) λ / λw is set to .8 and Dm is set to 100. Pm varies in the range of 10% to
50%
2) As the size difference increases curve gets deeper. This means that if MH modifies a larger portion of the web page, it is good to propagate the update at optimal disconnection time.
SimulationSimulationUsing smpl. Generates random update arrivals times at MH and server following
exponential distribution – Tic, Ti
s, L in the range 0 to 3600sec
Accordingly there are 6 possible states for the web page.
Since cost is order independent. The number of states reduces to 4
Those states are
State1, State3, State4 and state5 in the diagram below.
The costs for each of these states is also shown
States Relations b/w times
1 Tis > L > Ti
c
2 L > Tic, Ti
s
3 Tic > L > Ti
s
4 Tic, Ti
s > L
SimulationSimulationBatch Means Analysis has been used to obtain average
communication cost C for a given L with 95 % accuracy.
Sample mean is given by
C = Sum(Ci)/k
Sample Variance is given by
S2 = (Sum(C2i) – k * C2 )/(k-1)
Confidence Level is determined as
Prob[ C – H <= mu <= C + H] = 1-alpha
H = talpha/2;k-1*S/sqrt(k)
Accuracy level is determined as H/C <= beta
K =10 in the simulation with 2000 simulations in one batch run
SimulationSimulation
SimulationSimulation
Multiple Page Update Multiple Page Update Propagation Algorithm 1Propagation Algorithm 1
System Operation
MH pre-fetches a set of cached web pages
All updates before L are staged and later propagated to the server at reintegration phase one page at a time.
All web pages not updated during L are forcibly updated
Multiple Page Update Multiple Page Update Propagation Algorithm 1Propagation Algorithm 1
The Algorithm
All the modified pages are propagated to the server one at a timeN – Number of pre-fetched pages
Ci – Reconnection time needed for propagating updates to page i, as given in equation 7.
N
Total reconnection time, CN = Σ Ci
i = 1
Numerical AnalysisNumerical Analysis
Effect of λ / λw RatioN = 5, T1 = 5, T2 = 0, Dm = 100 s
λw for the N pages = in the range of [0, 15] updates/hrλ – varied in the range of 0.2 λw to λw
As λ varies from 0.2 times to 1 times λw, the curves get deeper. So,use Lopt
At λ = λw, the Lopt is at infinity. Use Lsubopt
As λ approaches λw, Lopt shifts to the right, I.e., the reconnection interval is shorter when the MH update rate is far below the world update rate.
Numerical AnalysisNumerical Analysis
Effect of the Time to perform merge operations
λ / λw Ratio = 0.8, T1 = 5, T2 = 0
Vary Dm from 3 to 180 sec
As Dm increases from 30 sec to 180 sec, the curves get deeper.
MH can reduce communication cost by propagating updates at the optimal point L.
Numerical AnalysisNumerical Analysis
Effect of the size of differences between two versionsλ / λw Ratio = 0.8, Dm = 100sec
Vary pm in the range [10%, 50%]
Vary so in the range [50 KB, 250 KB]
Then, size of version differences pmso varies in the range [5 KB, 25KB]
As size increases, curves get deeper
SimulationSimulation
Random values generated :
Tic – exponential distr at λi per page.
Tis – exponential distr at λi
wper page.
L – 0 to 3600 sec.
States – 4N
States Relations b/w times
1 Tis > L > Ti
c
2 L > Tic, Ti
s
3 Tic > L > Ti
s
4 Tic, Ti
s > L
Multiple Page Update Multiple Page Update Propagation Algorithm 2Propagation Algorithm 2
System Operation
MH pre-fetches a set of web pages
All updates before L are staged and later propagated to the server at reintegration phase in a batch to shorten reconnection time.
All web pages not updated during L are forcibly updated
Multiple Page Update Multiple Page Update Propagation Algorithm 2Propagation Algorithm 2
1. MH to server – 1 msg– Bit vector A – updated/not
updated pages. – Vector B - original version
numbers.
– Time = T2
2. Server to MH – 1 msg– Bit vector C – accepted
/rejected/not updated– Vector D – current version
numbers.
– Time = T2
Multiple Page Update Multiple Page Update Propagation Algorithm 2Propagation Algorithm 2
3. Server to MH– 1 msg– Differences of rejected and
not updated pages. – Server locks these pages.
N
– Time = Σ riT1
i = 1
4. MH to Server – 1 msg– Differences of updated and
accepted pages
N
– Time = Σ pi(1-ri)T1
i = 1
Multiple Page Update Multiple Page Update Propagation Algorithm 2Propagation Algorithm 2
5. Server to MH– 1 msg– Acknowledgement for updates of
accepted pages.
– Time = T2
6. MH to Server– Forced updates of rejected and not
updated pages
– Differences of these pages
N
– Time = Σ ri(Dm +T1) +
N i = 1
Σ (1-pi)(1-ri)(Dm + T1) i = 1
Multiple Page Update Multiple Page Update Propagation Algorithm 2Propagation Algorithm 2
5. Server to MH– 1 msg– Acknowledgement for updates
of rejected and not updated pages.
– Time = T2
Total reconnection time
CN = 4T2 + Σ [ riT1 +
pi(1-ri) T1+ ri(Dm+T1)+
(1-pi)(1-ri)(Dm + T1)]
Numerical AnalysisNumerical Analysis
Effect of λ / λw RatioN = 5, T1 = 5, T2 = 0, Dm = 100 s
λw for the N pages = in the range of [0, 15] updates/hrλ – varied in the range of 0.2 λw to λw
As λ varies from 0.2 times to 1 times λw, the curves get deeper. So,use Lopt
At λ = λw, the Lopt is at infinity. Use Lsubopt
As λ approaches λw, Lopt shifts to the right, I.e., the reconnection interval is shorter when the MH update rate is far below the world update rate.
Numerical AnalysisNumerical Analysis
Effect of the Time to perform merge operations
λ / λw Ratio = 0.8, T1 = 5, T2 = 0
Vary Dm from 3 to 180 sec
As Dm increases from 30 sec to 180 sec, the curves get deeper.
MH can reduce communication cost by propagating updates at the optimal point L.
Numerical AnalysisNumerical Analysis
Effect of the size of differences between two versions
λ / λw Ratio = 0.8, Dm = 100sec
Vary pm in the range [10%, 50%]
Vary so in the range [50 KB, 250 KB]
Then, size of version differences pmso varies in the range [5 KB, 25KB]
As size increases, curves get deeper Multiple page update Algorithm 2
performs better than Algorithm 1.
SimulationSimulation
Random values generated :
Tic – exponential distr at λi per page.
Tis – exponential distr at λi
wper page.
L – 0 to 3600 sec.
States – 4N
States Relations b/w times
1 Tis > L > Ti
c
2 L > Tic, Ti
s
3 Tic > L > Ti
s
4 Tic, Ti
s > L
SimulationSimulation
SimulationSimulation
ResultsResults
Analytical results were validated by simulation Verified Inter-arrival time probability distributions -
exponential, hyper exponential, erlang, normal Analytical results and simulation produced virtually the
same curves with differences less than 0.1%. Different distributions slightly affect the exact position of
Lopt, but the shape of the curves are same. Lopt, lies in the range of [400, 600] in all cases
Conclusion – Analysis results reported are valid and are not sensitive to underlying probability distribution
ApplicationsApplications
Distributed calendar tools – BAYOU Meeting room schedulers – ROVER Evolving design document/form editing by
multiple authors – WEBDAV Online newspaper/journalism/sports services
Application ModelApplication Model
Web pages are updates by multiple users – stationary and/or mobile
There is a real time application dependent deadline by which pages must be updated – tR
Let (Lopt, Cmin) denote the optimum L point in the graphs at which cost is minimum
For real-time applications with deadline tR, – If Lopt + Cmin < tR choose Lopt
– Else choose largest L < Lopt such that L + C = tR
For non-real-time applications,– Always choose Lopt.
Application ModelApplication Model
For e.g, let tR = 25minλ = 0.5λw - two users updating same
set of pages at the same rate
Then, Lopt = 850s
Since Lopt + Cmin = 850 + 350 = 1200sec < tR
Let tR = 15min, Then, L = 540s,
Since L + C = 540 + 360 = 900 = tR
ConclusionsConclusions
Paper discussed algorithms for propagating updates made by the MH and analyzed their effect on performance in terms of communication time
Developed analytical arguments relating disconnection period and communication time based on system parameters
End result is a simple L-C graph that the MH can apply at run-time to determine how long it should stay disconnected, thus adapting to network changes
ConclusionsConclusions
Results– When MH update rate is a fraction of that of the world, there
exists an optimal L where communication cost is minimum– Optimal disconnection period increases as the MH update rate
approaches the world update rate– When only the MH update a page - cost is minimum at infinity.
Then MH can reconnect at a sub-optimal time where cost is close to minimum
– When world rate is much higher than MH rate - cost is minimum at time 0. World updates the page too often and resolving conflicts nullifies the benefit of disconnection
SMPL CodeSMPL Code
main() {smpl(0,"Single Page Update Propagation");ratios[0] = 1.0; ratios[1] = 0.9;ratios[2] = 0.8; ratios[3] = 0.6;ratios[4] = 0.4; ratios[5] = 0.2;for (i = 0; i <= 5; i++) {printf("\n\n lami = %f * lamw \n\n", ratios[i] );
lami = ratios[i]* lamw; for (L = 0; L <= 3600; L += 300) {
init_bm(200,2000); proceed = TRUE; Y = 0;H = 0; while (proceed) {
Tc = expntl(lami);if (lami == lamw) Ts = L + T1 + T2;
else Ts = expntl(lamw);
if (Ts > L && L > Tc) C = T1 + T2; else if (L > Tc && L > Ts)
C = 3*T1 + 3*T2 + Dm; else if (Tc > L && L > Ts)
C = 2*T1 + 2*T2 + Dm; else if (Tc > L && Ts > L)
C = T1 + 3*T2 + Dm;if (obs(C) == 1) proceed = FALSE;}civals(&Y, &H, &num_batches);printf("L = %d sec C = %f\n", L, Y ); }
} }
SMPL CodeSMPL Code
Main(){smpl(0,"Multiple Page Update Propagation
Algorithm 1");ratios[0] = 1.0; ratios[1] = 0.9;ratios[2] = 0.8; ratios[3] = 0.6;ratios[4] = 0.4; ratios[5] = 0.2;for (i = 0; i <= 5; i++) {for (j = 0; j < 5; j++) { r = uniform(0.0, 15.0);lamw[j] = 3600/r;lami[j] = ratios[i] * lamw[j];}
for (L = 0; L <= 3600; L += 300) {Cn = 0.0;
for (j = 0; j < 5; j++) { init_bm(200,2000); proceed = TRUE; Y = 0; H = 0;
while (proceed) {Tc = expntl(lami[j]);if (lami[j] == lamw[j]) Ts = L + T1 + T2;else Ts = expntl(lamw[j]); if (Ts > L && L > Tc) C = T1 + T2;else if (L > Tc && L > Ts) C = 3*T1 +
3*T2 + Dm;else if (Tc > L && L > Ts) C = 2*T1 + 2*T2 + Dm;else if (Tc > L && Ts > L) C =
T1 + 3*T2 + Dm; if (obs(C) == 1) proceed = FALSE;} Cn += C; }