• 沒有找到結果。

The Rearrangement of Scheduled Events

Rearrangement Algorithms for the IEEE 802.11e S-APSD

4.2 The Rearrangement of Scheduled Events

Rearrangement is a process to simultaneously schedule all existing TSs irrespective of the order they join the system. Let ni represent the number of TSs in Class i and assume that there are K TSs in the system, K = PC

i=1ni. Denote {O1, O2, ..., OK} the offsets of the K TSs. Given offsets Om and On, the distance between TS m and TS n, 1 ≤ m, n ≤ K, is defined as d(Xm, Xn) = d(Xm + Om, Xn + On) = min

−∞≤l,r≤∞|xn,l + On − xm,r Om|. Moreover, given {O1, O2, ..., OK}, the minimum distance of the system, denoted as min dist(O1, O2, ..., OK), is defined as

min dist(O1, O2, ..., OK) = min

1≤m,n≤Kd(Xm, Xn) (4.6)

which is defined as the minimum distance of the system. The goal of rearrangement is to determine the optimal offsets {O1, O2, ..., OK} which satisfies

{O1, O2, ..., OK } = arg max

{O1,O2,...,OK}min dist(O1, O2, ..., OK). (4.7)

1Please refer to Chapter 3 for the description of scheduling matrix.

2Since the impacts have been pre-calculated, the online complexity in determining the SST is much less than that of OAS-APSD.

4.2.1 The Brute-Force Searching Method

The brute-force searching method is to enumerate all possible combinations of the offset and derive the optimal solution {O1, O2, ..., OK}. Before the exhaustive search, the process to prepare d(Xm, Xn) is described below.

Without loss of generality, assume that TS 1 belongs to Class i with period pi and is assigned offset O1 = 0. Assume further that TS 2 belongs to Class j and is assigned offset O2. As described in the system model, we can pre-calculate an array Ai,j which stores

[ d(Xi, Xj+ 0) d(Xi, Xj + 1) ... d(Xi, Xj + Gi,j− 1) ], (4.8)

where the kth element, 0 ≤ k ≤ Gi,j− 1, represents the distance for a sequence with period pi

to a sequence with period pj when their relative offset modulo Gi,j is equal to k. Therefore, the distance between TS 1 and TS 2 can be obtained by

d(X1, X2) = Ai,j[(O2− O1) mod Gi,j]. (4.9) The reason why modulo operation is necessary is described as follows. By the periodicity of the distance, d(X1 + O1, X2 + O2) = d(X1 + O1, X2 + O2 + Gi,j), it seems that the offset O2 should be chosen from the range in between 0 and Gi,j − 1 since the same value repeats every shift of Gi,j; however, since the other K − 2 TSs may belong to classes other than i or j, the periodicity between Class j and other classes should also be considered in determining the offset. Therefore, the value that O2 can take is from 0 to GL2 − 1, where GL2 = lcm{G1,j, G2,j, ..., GC,j}, the least common multiple of the GCDs between the period of TS 2 (belonging to Class j) and those of other existing classes. Similarly, if O3 has been assigned and TS 3 belongs to Class k, we can obtain the distances between TS 3, TS 2, and TS 1, by further checking the value of d(X1, X3) and d(X2, X3) by looking up Ai,k and Aj,k, as shown in Eq. (4.9). Therefore, for a given set of {O1, O2, ..., OK}, we can have the distances between any pair of TSs, d(Xm, Xn), 1 ≤ m, n ≤ K, by looking up the corresponding Ai,j’s, 1 ≤ i, j ≤ C.

With the above setting, the brute-force searching is to examine all possible combinations of {O1, O2, ... , OK}and compare the derived min dist(O1, O2, ..., OK)’s. The complexity for this exhaustive search takes¡K

2 max-imum of system minmax-imum distance can be determined after QK

i=2pi comparisons. Clearly, this method becomes infeasible for real system since the complexity increases dramatically with the number of TSs. Therefore, alternate low-complexity solutions would be necessary.

4.2.2 The Naive Equal-Spacing Method

p = p / K p

tim e

Figure 4.2: An illustration of strict-sense equal spacing scheduling (K = 5, K|p).

Assume that there are K TSs served by the same period p in the system. It is clear that p can be expressed as below:

p = K ×j p K

k

+ r, 0 ≤ r < K. (4.10)

A scheduling algorithm is wide-sense equal-spacing if it generates the minimum distance of bp/Kc for these K TSs. Note that, in general, there could be multiple wide-sense equal-spacing scheduling algorithms if r > 0. If r = 0, then wide-sense equal-equal-spacing becomes strict-sense equal-spacing because the relative distance between any two scheduled instants is equal to p/K. In this case, the offset for the mth TS relative to the first TS can be easily selected as Om = (m − 1) × p, 1 ≤ m ≤ K. We prove here a property of scheduling K TSs of the same period p.

Lemma 4.2. When there are K TSs to be served by the same period p, the maximum achievable minimum distance can only be obtained by performing wide-sense equal spacing scheduling for these K TSs.

Proof. Assume that there exists a non-wide-sense equal-spacing scheduling algorithm, say, Algorithm A, which provides a minimum distance d > bp/Kc. Let O1 = 0 and Om, 2 ≤ m ≤ K, represent the offset of the mth TS relative to the first TS, using scheduling algorithm A. Without loss of generality, assume that Om+1 > Om. Since it has been shown 3 that 0 ≤ Om ≤ p − 1, the offsets {O1, O2, ..., OK} shall produce K spacing between 0 and p. The mthspacing resulted by Algorithm A is left-bounded by Om and right-bounded by Om+1 and its length is denoted as dm = Om+1− Om, 1 ≤ m < K. In addition, we have dK = p − OK.

However, the result contradicts the fact that the sum of spacings should constitute the period p. This completes the proof of Lemma 4.2.

One naive scheduling algorithm is to schedule TSs with identical periods based on the wide-sense equal-spacing concept, treat the results as the scheduled instants of an aggregated TS, and find the optimal offsets for the aggregated TSs. Such an approach reduces complexity but often results in unsatisfactory results. To see this, let us consider the special case that ni|pi, 1 ≤ i ≤ C, so that strict-sense equal-spacing is adopted to obtain the aggregated TSs. Under this scenario, there are C aggregated TS and the one obtained for Class i TSs is periodic with period p0i = pi/ni. The intra-class offsets can be easily determined as oi,k = (k − 1) × p0i, 1 ≤ k ≤ ni.

Given the aggregated TSs, one can schedule them using greedy method or brute force search. Since the brute-force search requires high complexity, the greedy method is more

3Shown by Eq. (3.19) in Section 3.2.2.

preferable. However, unlike the greedy methods in [38] and [44] which schedule the TSs according to the order of joining, here we introduce the idea of scheduling period-revised TSs one by one according to ascending order of revised periods. The reason of adopting the scheduling by ascending order is stated as follows. The smaller period implies that the periodic scheduled instants would repeat more frequently than that of the larger ones.

Therefore, in a given repetition interval, there are more scheduling instants for the TS with shorter period to be placed into. Also, the choices for the SST are fewer for the TS with shorter period since it had been proved in Chapter 3 that the offset Oisatisfies 0 ≤ Oi ≤ pi−1.

Consequently, the shorter the period is, the higher the scheduling priority should be. We set the TS with shortest revised-period as the reference, and then, by the ascending order of size of the revised period, we add the remaining TSs one after another by gradually constructing the scheduling matrices as described in Chapter 3 and determining the inter-class offsets.

For convenience, this scheduling approach is referred to as the sorted greedy method in this work.

With the above setting, the naive equal-spacing method may, however, produce unsatis-factory result. Let p0iand p0j be the revised periods of aggregated TSs X0 and Y0, respectively.

If gcd(p0i, p0j) = 1, then, according to Lemma 4.1, we have d(X0, Y0 + k) = 0 for all k. This observation motivates us to develop designs to avoid any pair of the revised periods being coprime.