with probability at least 1 (2
n
+ 1)(3Wn
4e
n=10),S
0 can be covered by 2n
+ 1sequences of at most
n
8 steps each. Then the setS
0 partitions the other steps in theinterval into at most 2
n
+ 1 subintervals, such that the state is normal just before each subinterval, and no users start or stop during any subinterval. We perform the following analysis for each of these subintervals.By Lemma 4.6, once the system enters a synchronizing state, with probability at least 1 2
Wn
4e
n=10it will be in a starting state within 13n
7 steps. Once the systemis in a starting state, by Lemma 4.21 with probability at least 1 3
Wn
11e
n=10, itwill enter a synchronizing state at most
n
7+ 1 times, and each synchronizing phasewill last at most 13
n
7 steps.In total, the probability of not performing as stated above is at most (2
n
+ 1)(3Wn
4e
n=10+ 2Wn
4e
n=10+ 3Wn
11e
n=10)7Wn
12
e
n=10:
Finally, the set
S
0 can intersect at most (2n
+1)((n
8=n
4)+1) blocks of sizen
4. Then,in each of the 2
n
+1 subintervals of steps between those ofS
0, there are at mostn
7+2synchronizing phases, each of which can intersect at most ((13
n
7=n
4) + 1) blocks ofsize
n
4. Altogether, at most 27n
11 blocks of sizen
4 will contain non-normal steps. 2Corollary 4.23
Letx
be an integer in the range 0xn
29 54n
11. Suppose thatthe protocol is run with a given allowed sequence of user start/stop times after step
t
, and a given system state just before stept
. Focus on a particular non-empty queue at stept
. The probability that the queue remains non-empty for the nextxn
4+54n
15steps but fewer than
x
messages are delivered from it during this period is at most 7Wn
12e
n=10.Proof:
Divide the nextxn
4 + 54n
15n
33 steps into blocks of sizen
4. ByLemma 4.22, with probability at least 1 7
Wn
12e
n=10, at most 54n
11of these blockswill either contain a non-normal step, or precede a block which contains a non-normal step. The corollary follows by noting that if block
i
contains all normal steps and no synchronization is started in blocki
+ 1, then a message must have been sent fromthe queue during block
i
. 2Lemma 4.24
Suppose that the protocol is run with a given allowed sequence of user start/stop times after stept
, and a given system state just before stept
. Then the probability that the interval starting att
is light for a given user is at least 1 8Wn
12e
n=10.Proof:
As in the proof of Lemma 4.22, with probability at least 1 7Wn
12e
n=10,the non-normal steps could be covered by at most (2
n
+1)+(2n
+1)(n
7+2) subintervalsof at most
n
8steps each, and each of the subintervals would contribute at mostn
8+n
7messages to the queue (including the at most
n
7 that could be transferred from theuser's buer). If this were the case, at most 3
n
16 messages would be placed in thequeue during the interval. 2
Lemma 4.25
Suppose that the protocol is run with a given allowed sequence of user start/stop times after stept
, and a given system state just before stept
. The probability that the interval starting att
is productive for a given user is at least 1 7Wn
12e
n=10.Lemma 4.26
Suppose that the protocol is run with a given allowed sequence of user start/stop times before stept
. The probability that more thann
17+j
(n
33 +n
7)messages are in a queue just before step
t
is at moste
jn=30 forj
1 and at moste
n=30 forj
= 0.Proof:
For every non-negative integerj
, we will refer to the interval [t
(j
+ 1)n
33+1;:::;t jn
33] as \intervalj
". Choosek
such that the queue was empty justbefore some step in interval
k
, but was not empty just before any steps in intervals 0 to (k
1). We say that intervalj
is \bad" if it is not both productive and light for the user. The size of the queue increases by at mostn
33+n
7 during any interval. Ifinterval
k
is not bad, then the queue size increases by at mostn
17 during intervalk
.If interval
j
is not bad forj < k
, then the queue size decreases by at leastn
29=
2n
17during interval
k
. Thus, ifb
of intervals 0 tok
are bad, then the size of the queue just before stept
is at most(
k
+ 1)(n
33+n
7) (k
+ 1b
)(n
33+n
7+n
29=
2n
17) +n
17:
This quantity is at most
n
17 +i
(n
33+n
7) unlessb > i=
2 +k=
(8n
4). Thus, theprobability that the queue has more than
n
17+i
(n
33 +n
7) messages just beforestep
t
is at most the probability that, for some non-negative integerk
, more than (i=
2)+(k=
(8n
4)) of intervals 0 tok
are bad. By Lemmas 4.24 and 4.25, the probabilitythat a given interval is bad is at most 16
Wn
12e
n=10. LetX
= 16Wn
12e
n=10. Then,for
i
1, the failure probability is at most X k0k
b(i=
2) + (k=
(8n
4))c+ 1 !X
b(i=2)+(k=(8n 4)) c+1 X k0 (16en
4X
)b(i=2)+(k=(8n 4)) c+1 X k0 (16en
4X
)(i=2)+(k=(8n4)) (16en
4X
)i=2X k0 (16en
4X
)k=(8n4) (16en
4X
)i=28n
4 X k0 (16en
4X
)k 2(8n
4)(16en
4X
)i=2e
in=30:
For
i
= 0, this probability is at mostX k0
k
bk=
(8n
4)c+ 1 !X
bk=(8n 4) c+1 X k0 (16en
4X
)bk=(8n 4) c+1 (16en
4X
) X k0 (16en
4X
)bk=(8n 4) c 2(8n
4)(16en
4X
)e
n=30:
2Lemma 4.27
Suppose that the protocol is run with a given allowed sequence of user start/stop times after stept
+n
32. Suppose that no users start or stop during steps[
t T;:::;t
+n
32] and that the system state just before stept T
is given. Theprobability that an out-of-sync step occurs before a starting step after
t
is at most 4Wn
11e
n=10.Proof:
By Lemma 4.13, the probability of not having a start state just before any step in the subinterval [t T;:::;t T=
2] is at most 6Wn
4e
n=10. Then by (the proofof) Lemma 4.21, the probability of having an out-of-synch step before step
t
+n
32 isat most 3
Wn
11e
n=10. Finally, by Lemma 4.13, the probability of not having a startstate in the subinterval [
t;:::;t
+T=
2] is at most 6Wn
4e
n=10. The lemma followsby summing the failure probabilities. 2
Lemma 4.28
Suppose that the protocol is run with a given allowed sequence of user start/stop times after stept
, and a given system state just before stept
in which queueQ
contains at leastx
messages. Then the expected time until at leastx
messages have been sent fromQ
isO(xn
4+n
15).Proof:
Our rst case is whenx
n
29=
2. LetA
be the event that at leastx
messages are sent in steps
t;:::;t
+xn
4+ 54n
15 1. We refer to the interval [t
+xn
4+ 54n
15+ (k
1)n
33;:::;t
+xn
4+ 54n
15+kn
33 1] as \intervalk
". LetC
k bethe event that interval
k
is productive. LetE
x be the expected time to send thex
messages. Using Corollary 4.23 and Lemma 4.25,
E
x (xn
4+ 54n
15) +n
33Pr[A
] + X k>1n
33Pr[ ^ 1ik 1C
i]xn
4+ 54n
15+X k1n
33(7Wn
12e
n=10)k = O(xn
4+n
15):
Our second and last case is when
x > n
29=
2. Letr
= d2x=n
29e. Note that afterr
productive intervals, at leastx
messages will be sent. LetD
k be the event thatintervals 1 to
k
do not contain at leastr
productive intervals, but that intervals 1 to (k
+ 1) do containr
productive intervals.E
x X kr (k
+ 1)n
33Pr[D
k]n
33(2r
+ X k2r (k
+ 1)Pr[D
k])n
33(2r
+ X k2r (k
+ 1)k rk
! (7Wn
12e
n=10)k r)n
33(2r
+ X k2r (k
+ 1)2k(7Wn
12e
n=10)k r) = O(n
33r
) = O(xn
4):
2Theorem 4.29
Suppose that the protocol is run with a fig1in-dominated arrival
distribution, a given allowed sequence of user start/stop times in which no users start or stop during steps [
t n
33;:::;t
+n
33]. Suppose that a message is generated atstep
t
. The expected time that the message spends in the queue is O(1).Proof:
LetI
` be the interval [t `n
33+ 1;:::;t
(`
1)n
33]. LetA
0 be the eventthat the size of the queue is at most
n
17 1 just before stept n
33+1, and, fori
1,let
A
i be the event that the size of the queue just before stept n
33+ 1 is in therange [
n
17+ (i
1)(n
33+n
7);n
17+i
(n
33+n
7) 1]. LetB
the event that intervalI
1is light. Let
C
be the event that the message enters the queue. Lett
0 be the randomvariable denoting the smallest integer such that
t
0t
and the state of the system justbefore step
t
0 is a starting state. Lett
00be the random variable denoting the smallestinteger such that
t
00t
and stept
00 is out-of-sync. Let
F
be the event thatt
0< t
00.Let
X
be the random variable denoting the amount of time that the message spends in the queue. All probabilities in this proof will be conditioned on the state of the fact that no users start or stop during steps [t n
33;:::;t
+n
33].We start by bounding P i1E[
X
jA
i^C
]Pr[A
i^C
]. By Lemma 4.26, Pr[A
i]e
(maxfi 1;1g)n=30 so Pr[A
i^C
]e
(max fi 1;1g)n=30. By Lemma 4.28, E[X
jA
i^C
]E[t
0t
jA
i^C
] + O(n
4(n
17+ (i
+ 1)(n
33+n
7))):
(Since
A
i holds, there are at mostn
17+i
(n
33+n
7) messages in the queue beforeinterval
I
1 and at mostn
33+n
7 get added during intervalI
1.) By Lemma 4.18,E[
t
0t
jA
i ^C
] is at most P j1n
32(6Wn
4e
n=10)j 1 = O(n
32). Thus, E[X
jA
i^C
] = (i
+ 1)O(n
37). Thus, X i1 E[X
jA
i^C
]Pr[A
i^C
] X i1e
(maxfi 1;1g)n=30(i
+ 1)O(n
37) = O(1):
We now bound E[
X
jA
0 ^B
^C
]Pr[A
0 ^B
^C
]. By Lemma 4.24, Pr[B
]8
Wn
12e
n=10, so Pr[A
0 ^B
^C
] 8Wn
12e
n=10. As above, E[X
jA
0^B
^C
] =O(
n
37), soE[
X
jA
0^B
^C
]Pr[A
0^B
^C
](8Wn
12
e
n=10)O(n
37) = O(1):
Next, we bound E[
X
jA
0^F
^C
]Pr[A
0^F
^C
]. By Lemma 4.27, the probabilityof
F
is at most 4Wn
11e
n=10, so Pr[A
0 ^F
^C
] 4Wn
11e
n=10. As above, E[X
jA
0^F
^C
] is at most E[t
0t
j
A
0^F
^C
]+O(n
37). SinceC
occurs, the system is in asynchronization state just before some state in [
t;:::;t
+n
7]. SinceF
occurs, there isan out-of-sync step in [
t;:::;t
+ 14n
7]. By Lemma 4.18, the expected time from thisout-of-sync step until a starting state occurs is at mostP
j1
n
32(6Wn
4e
n=10)j 1= O(n
32). Thus, E[t
0t
jA
0^F
^C
] = O(n
32) and E[X
jA
0^F
^C
] = O(n
37). Thus, E[X
jA
0^F
^C
]Pr[A
0^F
^C
](4Wn
11e
n=10)O(n
37) = O(1):
Finally, we bound E[
X
jA
0^B
^F
^C
]Pr[A
0 ^B
^F
^C
]. By Lemma 4.19,the probability of
C
is at most 16n
22, so Pr[A
0^B
^F
^C
] 16n
22. We nowjust before step
t
is at most 2n
17. Suppose thatt
0> t
+ 2n
21+ 13n
7. Then, sinceF
holds, no step int;:::;t
+ 2n
21+ 13n
7 is out-of-sync. Suppose rst that no stepin
t;:::;t
+ 2n
21+ 13n
7 is out-of-sync and that the state is normal before each stepin
t;:::;t
+ 2n
21. Then all of the clocks will be the same, so at least 2n
17 messageswill be sent from the queue during this period. Suppose second that no step in
t;:::;t
+2n
21+13n
7 is out-of-sync, but that the state is not normal just before somestep in [
t;:::;t
+ 2n
21]. Then since no state int;:::;t
+ 2n
21+ 13n
7 is out-of-sync,t
0
t
+ 2n
21+ 13n
7. Finally, suppose thatt
0t
+ 2n
21+ 13n
7. By Lemma 4.28, E[X
jA
0^B
^C
^F
] is at mostt
0t
+ O(n
4 2n
17) = O(n
21). Thus, E[X
jA
0^B
^F
^C
]Pr[A
0^B
^F
^C
]16n
22O(n
21) = O(1):
2Observation 4.30
When the protocol is run, every message spends at mostn
7 stepsin the buer.
Theorem 4.31
Suppose that the protocol is run with a fig1in-dominated arrival
distribution and a given allowed sequence of user start/stop times. Suppose that a message is generated at step
t
. Then the expected time that the message spends in the queue isO(n
37).Proof:
LetX
be the random variable denoting the size of the queue just before stept
. By Lemma 4.26, fori
1, the probability thatX > n
17+i
(n
33+n
7) is atmost
e
in=30. Given a particular value ofX
, Lemma 4.28 shows that the expectedtime to send the message is O(
Xn
4+n
15). Thus, the overall expected time to sendthe message is O(
n
4(n
17+n
33+n
7)+n
15)+X i2 O(n
4(n
17+i
(n
33+n
7))+n
15)e
(i 1)n=30= O(n
37):
24.4 Final Results
For
v
2[n
], letT
v be the set of steps in which userv
is running.Theorem 4.32
Suppose that the protocol is run with a fig1in-Bernoulli arrival
distribution and a given sequence of user start/stop times in which each user runs for at least8
n
71 steps every time it starts. Then E[W
avg] = O(1).Proof:
First note that the sequence of user start/stop times is allowed. LetR
be the set of steps withinn
33 steps of the time that a user starts or stops. Lemma 4.33proves that if the f
ig1in-Bernoulli arrival distribution is conditioned on having
at most
m
messages arrive by timet
, the resulting arrival distribution isfig1 in-dominated. Therefore, the system described in the statement of the theorem satises the conditions of Lemma 4.34 with (from Theorem 4.17 and Theorem 4.29)
C
0 = O(1)and (from Theorem 4.31 and Observation 4.30)
C
= O(n
37). From the condition givenin the statement of this theorem, we can see that
S
= maxv 2V limsupt !1 jR
\T
v\[t
]j jT
v\[t
]jn
37:
(The worst case for
S
is when a user runs for 8n
71+ 6(n
1)n
33+ 2n
33 steps, andthe other
n
1 users have [ending, starting, ending, starting] times[2
in
33;
2(n
1)n
33+ 2in
33;
2(n
1)n
33+ 2in
33+ 8n
71;
4(n
1)n
33+ 2in
33+ 8n
71];
for 1
i
n
1. Then jR
j = 8(n
1)n
33 + 2n
33, including then
33 steps justafter the user starts and the
n
33 steps just before the user stops.) The theorem thenfollows from Lemma 4.34. (Note that
C
andC
0 are actually functions of , but isa constant.) 2
Lemma 4.33
Consider the distribution obtained from the fig1in-Bernoulli ar-
rivals distribution by adding the condition that at most
m
messages arrive by stept
. The resulting arrival distribution is fig1in-dominated.