Message Fragmentation in Disruptive Networks

0 downloads 0 Views 5MB Size Report
... 1 − eλx. In other examples X is distributed uniformly in [0, 1],2 and Y is ... of downlink epochs during successful transmission is ν(x)−1 by this assumption. ... is distributed approximately normally with mean E[Xf ]n and variance Var[Xf ]n. ... Assume that x = 30 and the first five uplink epochs are 10, 7, 5, 11, and 10 seconds.
Message Fragmentation in Disruptive Networks NRC-TR-2009-003; August 17, 2009

Philip Ginzboorg

Valtteri Niemi

J¨org Ott

Nokia Research Center, Finland [email protected]

Nokia Research Center, Switzerland [email protected]

TKK, Finland [email protected]

Abstract—In networks with unstable links fragmentation of a message into smaller pieces before transmission can reduce message blocking due to disrupted transmission and increase the utilization of contact durations; thus increasing the connectivity of the network for large messages. In this paper, we formalize message fragmentation in such networks, investigate the impact of fragmentation on message forwarding over a single link, and discuss fragmentation strategies for originating nodes.

I. I NTRODUCTION In Delay-tolerant Networks (DTNs) created by opportunistic interactions among mobile nodes, communication links will go up and down frequently and the achievable transmission rate will vary. The transmission capacity depends on the quality of the wireless channel during a contact and the mobility patterns that determine the contact durations and inter-contact times between the nodes. Given that transmission capacity during a contact is limited and that incompletely transmitted messages are lost, short contact durations may hinder message passing and thus limit the connectivity of the DTN. Message fragmentation is one way to improve connectivity [1]. In IP network, any node along the path is allowed to fragment packets which are then re-assembled at the destination. However, IP fragmentation is discouraged in practice, among other reasons, due to the increase in packet loss probability [2]. To avoid fragmentation, senders may dynamically determine the maximum transmission unit (MTU) for a given path, by probing with different packet sizes and setting the don’t fragment flag in the IP header. It also occurs that senders choose an MTU, e.g., based upon conservative expectations on the operating environment and the application demands. Path MTU discovery relies on the communication path being stable for some time beyond the MTU measurement; it will not work in networks with large variation of communication delays or frequently changing paths between sender and receiver. This variability may also make estimating a suitable MTU tricky. In such networks, the decision on the best way to communicate is somewhat similar to betting in financial markets and similar mathematical models may apply in both cases. During the work on [1], in which several fragmentation strategies in DTNs were evaluated by simulations, it became evident that a model of fragmented transmission over disruptive links would help to design fragmentation strategies and

interpret simulation results. This paper presents elements of such model. In essence, we apply methods of renewal theory to the question of fragmented transmission over disruptive links. We consider a node A intending to send a message of a given size x to another node B via a mobile DTN. A message will be tagged with a time-to-live (TTL) indicating the deadline of its usefulness to B. The communicating nodes (A, B and intermediate nodes) of the mobile DTN encounter each other opportunistically, the contact durations and intercontact times following mobility-dependent distributions. The resulting contact patterns define the “connectedness” of the network with respect to message size x. Node A can choose to transmit x in a single packet, thus requiring sufficiently long contact durations for x to fit. Or A may split x into fragments of size f , thus allowing transmission of message pieces during shorter contacts. The fragment size f may vary between messages. We investigate how A can reduce the number of fragments while still allowing in-time delivery of the message to B. We focus on a single hop: the more complicated multi-hop and multi-path cases cannot be treated properly without understanding the single-hop one. Moreover, some DTN routing protocols use direct transmission from A to B, e.g., Direct Delivery [3] and, for the last hop, Spray-and-Wait [4]. We assume that link disruptions are the only obstacle to in-time delivery: Other obstacles, like additional queuing delays and packet loss, could be added once the effect of link disruptions is understood. We present our system model in section II and formulate the fragmentation problem in section III. In section IV, we demonstrate that even when neglecting the effect of packet headers on the gross message size, the transmission time of a fragmented message does not have to increase monotonically with the fragment size f .1 We derive an upper bound on the probability of in-time transmission in section V and provide estimates on the mean transmission time in section VI, based upon which we describe and evaluate several algorithms to determine f in section VII. We review analytical work on fragmentation in section VIII and conclude in section IX with a brief assessment and future work topics. 1 This effect of data quantization should be kept in mind when designing fragmentation algorithms that search for suitable fragment size.

II. M ODEL OF TRANSMISSION OVER DISRUPTIVE LINK

software of the sending node, based on the properties of the link and, e.g., the validity time of the message that is chosen by the sending application. We will also assume that the fragment size f may vary between messages. 2. When a message is quantized into fragments of size f , then first, its size grows due to additional headers and, e.g., padding the last piece of data so that its size is f . In the following we will denote by xf the message size after it has been quantized, and by h the size of the header: 0 ≤ h ≤ f0 . For f = 0, we define x0 = x. For f ≥ f0 , x = k(f −h)+r, where k is a non-negative integer and 0 ≤ r < f − h. The quantized message will contain k fragments of size f , were x c if f > f0 and is zero otherwise; its total size xf k = b f −h depends on how the remainder r is quantized. As an example, the remaining part may be packaged into a single fragment of size f :

1. Network node A sends messages over an intermittent communication link to node B. The link speed during its “up” state is constant. This arrangement is depicted in Figure 1.

Fig. 1.

System model.

The duration of an uplink epoch is a random variable X and the duration of a downlink epoch is a random variable Y . We denote by FX (·) and FY (·) the distributions, and by fX (·) and fY (·) the densities of those random variables. We will assume that X and Y have finite mean and variance to simplify discussion. The following sections contain example calculations with exponentially distributed X: FX (x) = 1 − e−λx . In other examples X is distributed uniformly in [0, 1],2 and Y is distributed uniformly in [0, b], where b ≥ 0. But the scope and the results of this paper are not restricted to only exponentially or uniformly distributed X and Y . We assume that the distributions of X and Y stationary. This may not be the case in practice. But we believe that in many relevant scenarios, the change in distributions of X and Y within the time it takes to send a message is very small and can be neglected. We divide all message sizes by the speed of the link in “up” state, after which we measure messages in seconds. (For instance if link speed is 210 bits/s, then we say that size of a 210 bit message is one second.) We denote the size of A’s message by x. If the link fails during packet transmission, then node A will attempt to retransmit that packet on next uplink epoch. We denote the number of uplink epochs needed for successful transmission of x seconds by ν(x) and by N (x) the mean of ν(x): N (x) = E[ν(x)]. The sending node always starts to transmit (or retransmit) when the link changes state from “down” to “up”. The number of downlink epochs during successful transmission is ν(x) − 1 by this assumption. Let random variable t(x) be the time needed for successful transmission of x seconds. We denote by T (x) the mean of t(x): T (x) = E[t(x)]. We will assume that the sending node A has a lower bound f0 on a packet size and an upper bound L > f0 on the total transmission time t(x) of the message. Clearly, the message may be transmitted in time only if L ≥ x. The values of f0 and L can be set by the networking

xf = kf + f.

This quantization simplifies analysis, but is unlikely in practice, unless f = f0 . In a more realistic example, the remaining part will be packaged into a single fragment of size r + h: xf = kf + r + h.

(II.2)

We denote by j(x) the number of fragments in message of size x: j(x) = dx/(f − h)e. If the quantization is according to Eq. (II.1), then the size of the last fragment, fj(x) , is f ; if the quantization is according to Eq. (II.2) then fj(x) = r + h. Second, in most cases3 only the part f bX/f c of an uplink epoch may be used for transmission, unless f = 0: If f = 0, then the whole of an uplink epoch X may be used for transmission. We denote that part by Xf : ( bX if f > 0, f cf Xf = (II.3) X if f = 0. The distribution of Xf when f > 0 is: FXf (xf ) = FX (xf ) − FX (xf − fj(x) ).

(II.4)

A quantized message starts its journey to B as a single group of j(x) consecutive fragments. This group may be divided during transmission at boundaries defined by f . The mean number of groups, each containing one or more consecutive fragments, that arrive at B is denoted by g(x): g(x) = Nf (x)P{Xf > 0}.

(II.5)

It is a measure of B’s message-assembling work. We denote by Sn (X) the sum of n independent and identically distributed random variables Xi . For example, S0 (X) is zero, Sn (Y ) is the sum Y1 + Y2 + · · · + Yn , and Sn (Xf ) is the sum Xf,1 + Xf,2 + · · · + Xf,n . The variable νf (xf ) can be defined in terms of Sn (Xf ): νf (xf ) = min{n : Sn (Xf ) ≥ xf }.

2 Table 1 in section VI-F contains also the results for the case of X distributed uniformly in [0, a], where a > 0.

NRC-TR-2009-003

(II.1)

(II.6)

3 Possible exceptions are the uplink epochs in which the remainder r + h is transmitted.

2

c Copyright 2009 Nokia

If n is large, then by the central limit theorem, Sn (Xf ) is distributed approximately normally with mean E[Xf ]n and variance Var[Xf ]n. It can be shown that if xf >> E[Xf ], then also νf (xf ) is distributed approximately normally with mean xf /E[Xf ] and variance Var[Xf ]xf /E[Xf ]3 . (See [5], p. 61 for an outline of a proof.) But in many practically interesting scenarios xf is in the order of E[Xf ], and this result does not apply. The values related to transmission duration: t(x), T (x), ν(x) and N (x), always depend on the size f of transmitted packets. Therefore, more accurate notation would be to use symbols tf (xf ), Tf (xf ), νf (xf ) and Nf (xf ), but whenever the value of f is clear from the context, we use the simpler notation.

IV. N ON - MONOTONICITY OF TRANSMISSION TIME As mentioned in section III, a decrease in fragment size f may effect the transmission time of the message in two opposite ways: One the one hand, the transmission time tf (xf ) increases as we decrease the fragment size f due to increase in the gross size of transmitted data xf , that is caused by extra headers and due to increase in the number of retransmissions caused by lost fragments. On the other hand, tf (xf ) decreases as we decrease the fragment size f , due to better utilization of uplink epochs. If we neglect the effect of extra headers and retransmissions, and assume that the gross size of transmitted data is a constant x independent of f , then tf (x) will in general decrease as we decrease the fragment size f . But even under this assumption, the decrease in transmission time tf (x) is not necessarily monotonic. We give a toy example to illustrate this. Assume that x = 30 and the first five uplink epochs are 10, 7, 5, 11, and 10 seconds with downlink epochs of 4 seconds in between them. If f = 6, then the whole message cannot be transmitted within these first five uplink epochs:

III. P ROBLEM STATEMENT 3. If X is an uplink time sample, such that X = kf + r, where k is a non-negative integer, then node A can transfer k packets of size f within X. The remainder r, which unused for transmission, decreases as f gets smaller. So, on the one hand, finer subdivision of the message should reduce total transmission time over a single link. But on the other hand, if node B is not the end receiver of A’s messages, then finer subdivision will increase the chance of losing that message, e.g., due to a misrouted or dropped fragment. Coarser subdivision may increase the chance of a message reaching its destination. Jelenkovi´c and Tan showed in [6] that the mean transmission time of unfragmented messages over a disruptive link may become arbitrary large in some cases, and introduced a fragmentation algorithm to mitigate this problem. In this this paper we investigate a related, but different problem: We will assume that the cost of transmitting a message of size x increases with the number of fragments j(x). Our target is to minimize that cost, provided that t(x) does not exceed L. Therefore, we seek the largest possible fragment size f for a given message size x and the constraint L on the message transmission time. The fragmentation question can be approached in two ways: First, what is the largest fragment size f , for which the inequality P{tf (xf ) ≤ L} ≥ p,

t6 (30) = 10 + 4 + 7 + 4 + 5 + 4 + 11 + 4 + 10 + · · · > 59 This is because no uplink epoch can accommodate more than one fragment and no fragment can fit into the third uplink epoch. If f = 5, then the whole message fits into the first four uplink epochs, and t5 (30) = 10 + 4 + 7 + 4 + 5 + 4 + 10 = 44. For f = 4, the message again cannot fit into first four uplink epochs, and t4 (30) = 10 + 4 + 7 + 4 + 5 + 4 + 11 + 4 + 8 = 57. Even for f = 3, the message would not fit into first four uplink epochs: t3 (30) = 52. Finally for f = 2, the message fits into four uplink epochs and t2 (30) = 44. We observed this effect repeatedly in our simulations presented in section VII-D. It would be an interesting combinatorial problem to characterize the cases where tf (x) decreases monotonically when f decreases. Also Nf (x) (and hence the mean transmission time Tf (x)), is not necessarily monotonic in f , even if we neglect the effect of extra headers. For example, if X is distributed uniformly in [0,1], f = 1/k and x ≤ 1, then by Eq. (VI.28):

(III.1)

is true? (The target probability p could be, e.g., 0.95.) Second, what is the largest fragment size f , for which inequality Tf (xf ) ≤ L.

Nf (x) = (k/(k − 1))j(x) . Assuming that x is slightly less than 1/2, e.g., 1/2 − 1/100, we tabulate below the values of j(x) and Nf (x) for several fragment sizes: f 1/2 1/3 1/4 1/5 1/6 1/7

(III.2)

is true?4

j(x) = dx/f e

4 There

are also other possible questions, e.g., “What fragment size minimizes tf (xf ) with probability l?” and “What fragment size minimizes Tf (xf )?” However, our model does not suit very well for these questions due to very simple modeling of penalties incurred by fragmentation. Therefore, we do not address these minimization problems in this paper.

NRC-TR-2009-003

1

2

2

3

3

4

Nf (x) 2 2.25 1.78 1.95 1.73 1.85 We see that similar non-monotonicity phenomenon appears again. 3

c Copyright 2009 Nokia

However, the transmission time is monotonic in x when the fragment size f is fixed in our model: as we increase message size while keeping f fixed, the transmission time never gets lower.

Thus, replacing P{ν(x) = n} in Eq. (V.3) with the right hand side of Eq. (V.4), gives another expression for the upper bound on the probability of in-time transmission: X P{t(x) ≤ L} ≤ P{Sn−1 (Y ) ≤ L − x} n>0 (V.6)  × (P{Sn−1 (Xf ) ≤ x} − P{Sn (Xf ) ≤ x}) .

V. P ROBABILITY OF IN - TIME DELIVERY 4. In this section we will derive from the distributions of Sn (Y ) and ν(x) (or equivalently Sn (Xf )), an upper bound on the probability of the event {t(x) ≤ L}. Since P{t(x) ≤ L} is zero when x > L, we will assume that x ≤ L in the rest of this section. The transmission time t(x) is the sum of tX (x), the total time spent in uplink state and tY (x), the total time spent in downlink state during successful transmission of x seconds:

Similarly, by Eq. (V.3) and (V.5) X P{Sn−1 (Y ) ≤ L − x} P{t(x) ≤ L} ≤ n>0 j(x)

×

X

 (P{Sn−1 (Xf ) = kf } − P{Sn (Xf ) = kf }) .

k=0

(V.1)

(V.7)

where tX (x) depends on transmission strategy and is at least x: tX (x) ≥ x, with equality in case of f = 0. The following inequality gives the upper bound on the probability of transmission lasting at most L seconds and completing in exactly n uplink epochs:

The possible inaccuracy in those inequalities when f > f0 is due to potential change in fragment size from f to r + h—that is less than f —when sending the last piece of the message, resulting in faster transmission of that piece. Eq. (V.6) and (V.7) do not take this change into account; their estimate of the upper bound on probability of in-time transmission may be lower than the actual one. 5. For example, when X is uniformly distributed in [0, 1], Y is uniformly distributed in [0, b] and f = 0, while 0 < x < L and 0 < L ≤ 1, then by Eq. (V.6) and (VI.20)

t(x) = tX (x) + tY (x),

P{t(x) ≤ L & ν(x) = n} = P{Sn−1 (Y ) ≤ L − tX (x) & ν(x) = n} ≤ P{Sn−1 (Y ) ≤ L − x & ν(x) = n} = P{Sn−1 (Y ) ≤ L − x}P {ν(x) = n}.

(V.2)

P{t(x) ≤ L}  X (L − x)n−1  xn−1 xn − = bn−1 (n − 1)! (n − 1)! n! n>0 X (L − x)n xn X (L − x)n xn = −x . bn n! n! bn n! (n + 1)!

The right and the left hand sides of Eq. (V.2) are equal when f = 0. Summing both sides of Eq. (V.2) over n, gives the upper bound on the probability of in-time transmission: X P{Sn−1 (Y ) ≤ L − x}P{ν(x) = n}. P{t(x) ≤ L} ≤

n≥0

(V.8)

n≥0

n>0

Recognizing Bessel functions in the sums of the last expression we obtain:

(V.3) As in Eq. (V.2), the right and the left hand sides of Eq. (V.3) are equal when f = 0. The probability P{ν(x) = n} in Eq. (V.3) can be converted into equivalent expressions that contain Sn (Xf ) and x, as follows. First, P{ν(x) = n} = P{ν(x) ≤ n} − P{ν(x) ≤ n − 1}. But since the two events {ν(x) ≤ n} and {Sn (Xf ) > x} are equivalent, the distribution of ν(x) is given by

P{t(x) ≤ L}  r xb  p   p I1 2 (L − x)x/b , = I0 2 (L − x)x/b − L−x (V.9) where I0 (z) and I1 (z) are modified Bessel functions of orders zero and one: X (z/2)2n I0 (z) = , (n!)2

P{ν(x) = n} = P{Sn (Xf ) > x} − P{Sn−1 (Xf ) > x} = P{Sn−1 (Xf ) ≤ x} − P{Sn (Xf ) ≤ x}.

n≥0

z X (z/2)2n I1 (z) = . 2 n!(n + 1)!

(V.4) Second, when f > 0, x contains j(x) fragments; the event {Sn (Xf ) ≤ x} is the union of events {Sn (Xf ) = kf }, where 0 ≤ k ≤ j(x). In this case the above equation can be written as

n≥0

Notice that when x = L, Eq. (V.8) formally reduces to 1 − x,5 which is the probability of sending the message within the first uplink epoch. Figure 2 shows the graphs of P{t(x) ≤ 0.4} and P{t(x) ≤ 0.8} when X and Y are uniformly distributed in [0, 1] and f = 0.

P{ν(x) = n} =

j(x) 

X

 P{Sn−1 (Xf ) = kf } − P{Sn (Xf ) = kf } .

k=0 5 This

(V.5) NRC-TR-2009-003

4

is because 0n equals to one when n = 0; and is zero otherwise.

c Copyright 2009 Nokia

or from the distribution of Sn (X): N (x) =

∞ X

P{Sn (Xf ) ≤ x}.

(VI.5)

n=0

The last equation can be obtained from Eq. (VI.4) and (V.4) by replacing probabilities involving ν(x) by equivalent ones involving Sn (x). Since Sn (Xf ) is the sum of two independent random variables: Sn−1 (Xf ) and Xf , its distribution P{Sn (Xf ) ≤ x} is given by the convolution j(x)

X

P{Sn−1 (Xf ) ≤ x − kf }P{Xf = kf }.

k=0

Substituting this expression into Eq. (VI.5), we obtain Nf (x) = P{S1 (Xf ) ≤ x}

Fig. 2. P{t(x) ≤ 0.4} and P{t(x) ≤ 0.8} when X and Y are uniformly distributed in [0, 1] and f = 0.

+

∞ j(x) X X

P{Sn−1 (Xf ) ≤ x − kf }P{Xf = kf }.

n=2 k=0

VI. M EAN TRANSMISSION TIME

Changing the order of summation in the second term and applying Eq. (VI.5) to the infinite sum gives

6. The mean transmission time T (x) is the sum of TX (x), the mean of the total time spent in uplink state and TY (x), the mean of the total time spent in downlink state after transmission has started:

j(x)

Nf (x)P{Xf = 0} +

X

Nf (x − kf )P{Xf = kf }

k=1

T (x) = TX (x) + TY (x).

(VI.1)

in place of the second term, and the above equation becomes Pj(x) FXf (x) + k=1 Nf (x − kf )P{Xf = kf } . Nf (x) = 1 − P{Xf = 0} (VI.6) This type of formula is called discrete renewal equation. Among other things, it facilitates computation of Nf (x) recursively, starting from Nf (0) = 0. Nf (x) is a non-decreasing function of x when f is fixed. Therefore, a value of Nf (x) computed assuming that the message is quantized into j(x) fragments of equal size f , according to Eq. (II.1), provides an upper bound on Nf (x) in the case that the last message part, that is less than f − h, is quantized into a smaller packet. Similarly, the value of Nf (x), computed assuming that the message is quantized into j(x) − 1 fragments of equal size f , provides a lower bound on N (x) in the above case. In section VI-E non-recursive equations for Nf (x) are given for uniformly and exponentially distributed X, again assuming that the message is quantized into fragments of equal size. It can be verified that a tighter lower bound may be obtained by replacing the integer j(x) with the fraction x/(f − h) in those equations. The integral renewal equation for the case f = 0 that follows, can be derived from Eq. (VI.5) similarly to the above. (See [5] pp. 62-63.) Z x N0 (x) = FX (x) + N (x − y)fX (y)dy. (VI.7)

TX (x) depends on transmission method and is clearly at least x seconds. If a value of N (x) is given, then TX (x) can be approximated as E[X] × N (x). (TX (x) can be estimated better in special cases. See sections VI-B and VI-E1 below.) Conversely, if a value of TX (x), is given, then N (x) can be approximated as TX (x)/E[X]. (See section VI-D below.) The expression for TY (x) is TY (x) = E[Y ] (N (x) − 1) .

(VI.2)

As mentioned in section II, the number of downlink epochs during successful transmission is one less than the number of uplink epochs. Multiplying N (x) − 1 by the mean downlink epoch, E[Y], we obtain Eq. (VI.2). The fact that TX (x) is at least x seconds, together with Eq. (VI.1) and (VI.2) define the lower bound on T (x). A message whose uninterrupted transmission within a single uplink epoch will take x seconds cannot be transmitted over disruptive link in less than N (x) uplink epochs and N (x) − 1 downlink epochs on the average: T (x) ≥ x + E[Y ](N (x) − 1).

(VI.3)

A. Computation of N (x) in the general case N (x) can be computed either from the distribution of ν(x): X N (x) = nP {ν(x) = n}, (VI.4) n≥0

NRC-TR-2009-003

y=0

5

c Copyright 2009 Nokia

When x >> E[X], Nf (x) obeys the following asymptotic relations: If f = 0, then N0 (x) →

x Var[X] + E[X]2 + . E[X] 2E[X]2

Therefore the length of those epochs is uniformly distributed between zero and xf with mean of xf /2 and xf TX (xf ) = xf + (N (xf ) − 1)  2 (VI.12) xf 1 = 1+ . 2 1 − xf

(VI.8)

(This relation corresponds to Eq. (3.1), p. 366, in [7].) If f > 0, then gaps of size ≥ f in the values taken by X, may cause corresponding gaps in those taken by Xf . For example, if P{X ∈ (f, 2f ]} > 0, while P{X ∈ / (f, 2f ]} = 0, then Xf is either zero, or 2f . Thus, in general, Xf takes its values from the sequence 0, df , 2df , 3df , · · · , where d is a positive integer, called the “period” of Xf , due to periodic gaps between the values of Xf when d > 1. The asymptotic relation is Nf (x) →

It is easy to see from Eq. (VI.12) that   if xf λ. TX (xf ) = 2xf +

P{X ≥ xf } = 1 − (FX (xf ) − P{X = xf }) . Thus, the probability P{ν(xf ) = n} in Eq. (VI.4) is that of n − 1 failures followed by a successful transmission during nth uplink state, and it can be verified that

C. Case of f = 0

(VI.10)

8. In this case there is no waste of contact time due to data quantization, and TX (x) = x. (VI.16)

If the distribution FX is continuous at xf , then fX (xf ) is finite. Therefore, the term P{X = xf } above, which equals to lim∆x→0 ∆xfX (xf ), tends to zero and can be neglected. For example, if X is distributed uniformly between zero and one, then FX (x) = x for 0 < x < 1, and is 1 for x ≥ 1. Thus, by Eq. (VI.10), ( 1 if 0 < xf < 1, N (xf ) = 1−xf (VI.11) ∞ if xf ≥ 1.

If X is uniformly distributed in [0, 1], then N0 (x) =

q X

(−1)k ex−k

k=0

(x − k)k , k!

(VI.17)

where q is the integer part of x: q = bxc. Feller gives Eq. (VI.17) as an exercise in [7] p. 385, and notes that this formula is frequently rediscovered—as, indeed, happened to us. Clearly, Nf (x) ≥ N0 (x). Thus, in case of X uniformly distributed in [0, 1]): ! q k X k x−k (x − k) T (x) ≥ x + E[Y ] (−1) e − 1 , (VI.18) k!

In general, the mean of the total time spent in uplink state TX (xf ) can be approximated as E[X] × N (xf ). But in the case of f = xf we can get a better estimate as follows. To derive the value of TX (xf ), notice that (i) the whole message must be transmitted in xf seconds during the last uplink epoch and that (ii) none of the ν(x) − 1 uplink epochs preceding successful transmission may equal or exceed xf . NRC-TR-2009-003

xλe−λx dx

0

and probability of success being

1 . 1 − (FX (xf ) − P{X = xf })

xf

1 = (1 − e−λxf (1 + λxf )). λ Inserting the above expressions for N (xf ) and E[(xf − X)+ ] into Eq. (VI.13) we obtain

P{X < xf } = FX (xf ) − P{X = xf }

N (x) =

(VI.13)

k=0

by Eq. (VI.3) and (VI.17). 6

c Copyright 2009 Nokia

must be smaller than x, because the sum is conditioned not to exceed x until the last, the ν(x)th, addition. Intuitively, when ν(x) is large, the difference between Sν(x)+1 (X) and Sν(x) (X) is the mean value of Xi , i.e. 1/2, because the random fluctuations in Xi cancel each other. Therefore, the growth rate of ν(x) as a function of Sν(x) (X) is the inverse of 1/2, i.e. 2, in this case. To illustrate this further we have plotted the derivative of N0 (x) in the right part of Figure 3. It can be observed that the derivative is ex in 0 < x < 1. After discontinuity7 at x = 1, the derivative wiggles up and down until, between x = 3 and x = 4, it settles on the value of 2. Thus, we may use a linear approximation to N0 (x) starting from some value of x, for instance 4: Substituting x = 4 into Eq. (VI.17) to compute N0 (4) and replacing all the terms for which the index n > 4, with a single linear term 2(x − 4), we obtain the following approximation to N0 (x):

9. To derive Eq. (VI.17), we used the following result from Feller [7] p. 27, for the sum of n independent random variables uniformly distributed between 0 and a:   n 1 X n P{Sn (X) ≤ x} = n (−1)k (x − ka)n+ , (VI.19) a n! k k=0

where (x)+ = x, if x ≥ 0 and is zero otherwise.6 When a = 1 and 0 ≤ x ≤ 1 Eq. (VI.19) reduces to xn , (VI.20) n! and the evaluation of the sum in Eq. (VI.5) results in N0 (x) = ex . Extending the range of x from 0 ≤ x ≤ 1 to 1 ≤ x ≤ 2 results in additional non-zero term: (1/n!)(−1) n1 (x − 1)n , in Eq. (VI.20). The increment from that term to the right hand side of Eq. (VI.5), i.e. the sum of a sequence composed from that term, when n runs from zero to ∞, is −ex−1 (x − 1). Therefore, N0 (x) = ex − ex−1 (x − 1) when 1 ≤ x ≤ 2. The general expression for N0 (x) is obtained by repeatedly extending the range of x to higher integers. 1) Behavior of the function N0 (x): 10. The left part of Figure 3 displays the graphs of Nf (x) computed according to to Eq. (VI.10) and Eq. (VI.17). We see that, even though P{Sn (X) ≤ x} =

N0 (x) ' N0 (4) + 2(x − 4), where x ≥ 4. Since the numerical value of N0 (4) is 8.666 . . . , the value of the constant N0 (4) − 8 in the above equation is 0.¯ 6, or 2/3, and so that equation can be written as 2 N0 (x) ' 2x + , 3

where x ≥ 4. This approximation facilitates computing N0 (x) for high values of x, where the evaluation of ex in Eq. (VI.17) poses numerical difficulties. As pointed by Feller in [7] p. 385, the fact that N0 (x) tends asymptotically to 2x + 2/3 as x grows, follows from the general relation (VI.8). In summary, the abrupt change in the behavior of N0 (x) between the regions 0 < x ≤ 1 and x > 1 is caused by discontinuity in the distribution of X at x = 1. Given a distribution FX (x) of X, such changes will exist at discontinuity points of FX (x); less abrupt changes will exist at inflection points of FX (x); and they will not occur when FX (x) has no such points. For instance, FX (x) is continuous and has no inflection points when X is distributed exponentially, N0 (x) behaves in the same way for all message sizes x > 0:

Fig. 3. Left: Nf (x) computed for the case f = xf (no fragmentation), and d f = 0 (every part of uplink epoch is utilized). Right: the derivative dx N0 (x).

N0 (x) = λx + 1.

N0 (x) is a sum of exponents of x multiplied by polynomials in x, it is a straight line at high values of x. The change in N0 (x) behavior starts at x = 1 and is due to the change in the distribution of uplink epochs Xi in the sum Sν(x) (X) = X1 +X2 +· · ·+Xν(x) , where ν(x) is the first index at which the sum exceeds x: When x ≥ 1, all Xi can take values in [0, 1]; but if 0 < x < 1, then the values of X1 , X2 , . . . , Xν(x)−1

(VI.22)

To derive Eq. (VI.22) notice first, that since E[X] = 1/λ and Var[X] = 1/λ2 in this case, the asymptotic relation (VI.8) evaluates to λx + 1. Second, ν(x) − 1 has Poisson distribution: P{ν(x) − 1 = n} = e−λx (λx)n /n!. The number ν(x) of uplink epochs that are needed for successful transmission of x seconds is one more than the number of events n counted by the Poisson process, because the first uplink epoch occurs at time zero with

6 This formula is proved by induction in the location cited. Feller also outlines in [8] exercise 20, p. 285, how to derive Eq. (VI.19) by passing to the limit the discrete case formula, obtained in exercises 18 and 19 from generating functions.

NRC-TR-2009-003

(VI.21)

7 It can be verified that the nth derivative of N (x) will have one extra 0 discontinuity at point x = n in addition to those of the (n − 1)th derivative.

7

c Copyright 2009 Nokia

probability one. Since the sum

X

ne−λx (λx)n /n! evaluates

1) Sub-case of 1/2 < f < 1: If 1/2 < f < 1, then m = 1 and a message of size 0 < x ≤ f requires an uninterrupted transmission of f seconds. Therefore, the expressions for N (x) and TX (x) are given by Eq. (VI.10) and (VI.12) with xf set to f : N (x) = N (f ) and TX (x) = TX (f ). If 1/2 < f < 1, then a message of size f < x < 1 requires two uninterrupted transmissions of f seconds each. Therefore, N (x) grows by a factor of two, compared to 0 < x ≤ f : N (x) = 2N (f ). In general, when x > f0 ,

n≥0

to λx, Eq. (VI.22) follows. D. Direct approximation of TX (x) 11. A linear approximation to TX (x) can be derived from Eq. (VI.16); N (x) is then estimated as TX (x)/E[X] and an approximate value of T (x) obtained from Eq. (VI.2) and (VI.1): An uplink epoch that is less than f cannot be used for transmission; when message is divided into fragments of size f , the proportion of the total uplink time Sν(x) = X1 +X2 + · · · + Xν(x) that is used for transmitting data is approximately P (Xi ≥ f ), i.e. 1 − FX (f ) + P{X = f }. Therefore, TX (xf ), which equals xf when f = 0, grows by a factor of 1/(1 − FX (f ) + P{X = f }). If the last fragment of a message is less than f , it may be transmitted in an uplink epoch that is less than f : Xν(x) < f . But as the number of fragments gets larger, the effect of an event {Xν(x) < f } on TX (xf ) gets smaller. Thus also in this case, TX (xf ) grows by a factor of 1/(1−FX (f )+P{X = f }) compared to when f = 0. Based on the above, TX (xf ) can be estimated as TX (xf ) ≈

xf . 1 − FX (f ) + P{X = f }

N (x) = j(x)/(1 − f ).

We illustrate in Figure 4 the graphs of N (x) when f = 3/4 and when f = xf .

(VI.23) Fig. 4.

Dividing the estimate of TX (x) by the mean length of an uplink epoch, we obtain N (xf ) ≈

xf . E[X](1 − FX (f ) + P{X = f })

N (x) when f = 3/4 and when f = xf .

The value of TX (x) is given by   1 j(x) TX (x) = − (1 − f ) . 2 1−f

(VI.24)

Please note that in this approximation we do not make any assumptions about the starting point of the transmission. Therefore, a constant deviation occurs when comparing to values of N (x) and TX (x) given by the more accurate formulas, computed under the assumption that transmission attempt and beginning of uplink epoch coincide.

(VI.26)

This equation is a special case of the more general one: TX (x) = j(x) (E[(X − f )+ ] + (N (f ) − 1)E[(f − x)+ ]) − E[(X − f )+ ] + f, (VI.27) that is valid when FX (x) = 0 for x > a, and a/2 < f < a. (Those conditions enforce transmission of at most one fragment per uplink epoch.) Eq. (VI.27) can be derived using the following observations: (i) the mean length of the N (f ) − 1 uplink epochs preceding successful transmission of a single fragment is E[(f − X)+ ]; (ii) E[(X − f )+ ] is the mean length of the uplink epoch during which f is successfully transmitted; and (iii) the transmission ends after f seconds of Xν(x) . 2) Sub-case of f = 1/k: If f is a reciprocal of an integer greater than one: f = 12 , 31 , . . . , then m is an integer ≥ 2. In this case:  j(x)−km q ¯ X m (j(x) − km)k , (−1)k N (x) = m−1 k!(m − 1)k k=0 (VI.28) ¯ where (x)k is the rising factorial x(x + 1) · · · (x + k − 1), and as in Eq. (VI.17), q is the integer part of x: q = bxc.

E. Case of f0 ≤ f < x 12. In this section we will first derive an expression for Nf (xf ) when the length of an uplink epoch X is distributed uniformly between zero and one and the message is quantized into fragments of equal size, according to Eq. (II.1). Then, a similar result will be derived for exponentially distributed X. The subscript f will be omitted in most cases to simplify notation; e.g., we will write x and N (x), instead of xf and Nf (xf ). We denote by m the maximum number of fragments that may be sent within a single uplink epoch when X ∼ U(0,1): m = b1/(f − h)c. Clearly, when x ≤ mf , the values of j(x) are restricted to 1, 2, . . . , m. If the maximum length of an uplink epoch is not an integral multiple of f , then mf < 1 and j(x) is m + 1 when mf < x < 1. NRC-TR-2009-003

(VI.25)

8

c Copyright 2009 Nokia

m Notice, that the faction in the above equation is m−1 1 equal to that has appeared also in the previous case of 1−f at most one fragment per uplink epoch. Also, if f0 < x < 1, then q is zero, 1 ≤ j(x) ≤ m and Eq. (VI.28) reduces to  j(x) m . N (x) = m−1 Eq. (VI.28) is a discrete analogue of Eq. (VI.17) and was arrived at by similar steps, starting from the discrete analogue of Eq. (VI.19) in exercise 19, p. 285 of Feller [8]. It seems to be new; so far, we have not found references to Eq. (VI.28) in the literature. The top part of Figure 5, shows the graphs of N (x) on 0 < x ≤ 2 for f = 0, 12 , 14 and 18 , when X is distributed uniformly between zero and one. We see that, as expected,

It can be verified that in this case p +1 N (x) = j(x) 1−p = j(x)(eλf − 1) + 1.

(VI.29)

The bottom part of Figure 5, shows the graphs of N (x) on 0 < x ≤ 2 for f = 0, 12 , 41 and 81 , when FX (x) = 1 − e−2x . F. Summary of results on mean transmission time For reference, we summarize in Table I the results on mean transmission time. In all cases x > 0. The leftmost column in the table contains the number of a section in which the corresponding expression has been introduced. The subscript f is omitted to simplify notation: e.g., we write x instead of xf . In subtable on uniformly distributed X, formulae for X uniformly distributed in [0, a], where a > 0, rather than in [0, 1], are given. Some of the results are obvious or easy to obtain, some are known. Still, we think collecting all these results into one place is useful to aid memory and understanding. VII. F RAGMENTATION ALGORITHMS

Fig. 5. N (x) when f = 0, X ∼ Exp(2).

1 1 1 , , 2 4 8

13. Returning to the question posed in section III, we describe how a sender can choose a suitable fragment size f ≥ f0 for a message, given the constraint L on its total transmission time. We divide the algorithms to achieve the sender’s goal into three classes based on the information known to the sender: O. Oracle-based: The sender knows the future sequence of X and Y . H. History-based: The sender knows the sequence of w past uplink epochs X and downlink epochs Y . D. Distribution-based: The sender knows the distributions FX (·) and FY (·) of X and Y . An oracle-based algorithm cannot be realized as such in practice because the future is unknown. The concept of oraclebased algorithm serves two purposes. First, the fragment size chosen by oracle-based algorithm may serve as a yardstick against which choices by practical algorithms in classes (H) and (D) are measured. Second, thinking about how an oracle could be used to solve the problem gives an insight into building practical algorithms. Since the distribution of X and Y can be estimated from empirical observation of their past values, class (D) of distribution--based algorithms is a subset of class (H). We will outline below example algorithms in each class.

and xf . Top: X ∼ U(0, 1). Bottom:

A. Oracle-based algorithms N (x) approaches N0 (x) from above, when f gets smaller. 3) Sub-case of exponentially distributed X: If X is distributed exponentially, then X P{b c = n} = FX (f (n + 1)) − FX (f n) f = e−λf n (1 − e−λf ),

14. Let us assume that the current time is zero, i.e. period of the next L seconds is [0, L]. The basic operation of oraclebased algorithm is as follows. If tf0 (xf0 ) > L given the sequence of link states in [0, L], then the message cannot be transmitted within that time8 and class (O) algorithm will set f = f0 ; otherwise, class (O)

where n = 0, 1, 2, · · · . Therefore, bX/f c is distributed geometrically, with parameter p = (1 − e−λf ).

8 As an example, consider the case in which the sum of uplink epochs within [0, L] is less than x.

NRC-TR-2009-003

9

c Copyright 2009 Nokia

§

f VI

VI-D

VI-B

f =x

VI VI-A

f =0

Summary for generally distributed X Results = ≥ = ≈

TX (x) + TY (x), x, E[Y ] (N (x) − 1), E[X]N (x).

TX (x) N (x)

≈ ≈

x/(1 − FX (f ) + P{X = f }), x/ (E[X](1 − FX (f ) + P{X = f })).

N (x) TX (x)

= =

1/(1 − FX (x) + P{X = x}), x + (N (x) − 1)E[(x − X)+ ].

TX (x) N (x)

= =

N (x)



N (x)

=

N (x)



f >0

VI-A

§

f

FX (x)+

Pj(x)

f

d×x

E[Xf ]

+

k=1

N (x−kf )P{Xf =kf }

2E[Xf ]2

N (x) TX (x)

= =

VI-C

f =0

N (x)

=

λx + 1.

VI-E3

f >0

N (x)

=

j(x)(eλf − 1) + 1.

§

f

f =0

VI-E1

a 2

VI-E2

f = ai , i=2, 3, . . .

Discrete renewal equation. .

Summary for exponentially distributed X Results

f =x

VI-C VI-C1

Renewal equation. See, e.g., [5], p. 63. x → ∞. See [7], p. 366, Eq. (3.1).

.

1−P{Xf =0} Var[Xf ]−E[Xf ]f +E[Xf ]2

VI-B

f =x

P{X = x} → 0, if FX is continuous at x. ( x if x > 0, (x)+ = 0 otherwise.

x Rx FX (x) + y=0 N (x − y)fX (y)dy, Var[X] +E[X]2 x + . E[X] 2E[X]2

eλx ,

VI-B

Notes

T (x) TX (x) TY (x) TX (x)

2x +

1 (1 λ

N (x)

1/(1 “ − x/a), ” x 1 1 + 1−x/a . 2

Pq

k x/a−k (x/a − k)k /k!, k=0 (−1) e 2x/a + 2/3, if x ≥ 4. a ” “ j(x) 1 TX (x) = − (1 − f /a) , 2 1−f /a N (x) = j(x)/(1 − f /a). “ ”j(x)−km ¯ Pq (j(x)−km)k m k . = k=0 (−1) m−1 k!(m−1)k

N (x) N (x)

Suggest Documents