4 On Applying Fair Queuing Discipline to Schedule Requests at
4.4 Analysis for Delay and Fairness
4.4.2 Delay Bound
Two models are introduced before the definition and analysis of delay bound. As shown in Fig. 4.6(a), we model MSF-RS as a multi-links fair queue to analyze the delay bound caused by MSF-RS in the worse case. Assume that W+ is fixed and each class has equal users in the residual analysis. The downlink with capacity C is conceptually divided into W+ sub-links and each sub-link has bandwidth c=C/W+. Besides the model for MSF-RS, we describe an ideal MSF-RS gateway, named MSF-RS*, as shown in Fig. 4.6(b). Under MSF-RS*, the downlink bandwidth C can be proportionally shared by N classes according to their weights. For example, if three classes of users receive their responses through the downlink and the ratio of their weights is 4:2:1, then the bandwidth C should be divided into 3 sub-links which bandwidth are 4/7C, 2/7C, and 1/7C, respectively. Besides, the bandwidth got by each class would be dynamically adjusted according to the number of non-empty class queues.
Fig. 4.6. The downlink can be conceptually divided into multiple sub-links.
Request
(a) If downlink is controlled by MSF-RS, then
(b) If downlink is controlled by MSF-RS*, then
(a) If downlink is controlled by MSF-RS, then
(b) If downlink is controlled by MSF-RS*, then
Fig. 4.5 The ratio on Ta of a MSF-RS gateway to an ordinary gateway TaMSF-RS/Taordinary
Definition 4.3: An active class represents that the class has transactions handled in the gateway. Also, an active period of Class i is the time during Class i is active.
Definition 4.4: A backlogged class represents that the class has a non-empty queue of requests.
Definition 4.5: The delay bound for a transaction in a MSF-RS gateway means TaMSF-RS-TaMSF-RS*, i.e. the additional time caused by MSF-RS, compared to an ideal MSF-RS gateway.
Such a delay may be contributed from two parts. The first is the queuing time of requests in the MSF-RS gateway. For the first request queued in a class, its queuing time under a MSF-RS* gateway is zero because MSF-RS* has W+=n and thus the request must be immediately forwarded. However, the request may be delayed in MSF-RS when all sub-links are busy. Another source to contribute the delay is the additional transmission time of responses if lower downlink bandwidth is allocated for a class than its allocated bandwidth, which is possible in MSF-RS. Since a MSF-RS gateway only affects the allocation of downlink bandwidth by controlling the releasing of uplink requests, it cannot directly adjust the downlink bandwidth used by each class.
Assume that ak denotes the time of a request k arriving at MSF-RS, bk denotes the time it departed from MSF-RS, and dk denotes the time that MSF-RS finished to return the whole response back to the client host. Similarly, bk*, and d*k denotes the corresponding times at MSF-RS*. The denotation a*k is unnecessary since the arrival times at MSF-RS and MSF-RS* are equal. Next, assume the total length of the response is Lk and dk bk Lk
= + r where r represents the receiving rate of the response.
Herein, the time between bk and receiving the first data of its response is ignored, since it is far smaller than the receiving time of the whole response.
Theorem 4.1: The delay in MSF-RS has a bound equal to
2L c
+ ,
where L+ is the maximum responses among all classes and c is the bandwidth of a sub-link. That is, for any request k, the time that MSF-RS finishes its transaction must not be 2L
c
+ later than that under MSF-RS*, i.e. dk d*k 2L c
− ≤ + . Proof:
Case 1: The request k arrives when W<W+.
In this case, bk=ak because MSF-RS immediately sends out requests if W<W+. Then,
k k k
d a L
= + c . Besides, dk* ak Lk
≥ + C because the capacity C of a link is the maximum bandwidth that a transaction can use in MSF-RS*. Thus,
* 1 k
Consider the transaction of the request k is the (m+1)th transaction in the same active period of Class i. Let us mark the transaction. Next, we calculate how many transactions will be served from other classes ahead of this marked transaction in the worst case. Assume n is the number of active classes now in the gateway and all W+ sub-links are serving transactions. Assume these transactions have responses of the largest size L+. That is, in the worst case the earliest time to release the next request from the gateway will be at ak L
+× of total responses, before their timestamps are assigned
to a value equal to that of Class i, where Li+ denotes the maximum response of Class i.
Moreover, as mentioned in Chapter 4.3.1.2, when all classes have the same timestamp, MSF-RS forwards requests from the class with the highest weight. Thus, if Class i has the qth highest weight, then its request will be forwarded at the rank of q among all classes with the same timestamp. Therefore, the time at which the marked transaction will be finished is given by
1 1
However, under MSF-RS* the request k will be forwarded once no requests queued in Class i. Besides, because a class with the qth highest weight must get no more bandwidth than the classes with weight equal to or higher than it, it can get at most
W c q
+ bandwidth. Therefore, the time at which the marked transaction will be finished under MSF-RS* is given by
1 1
Therefore, by subtracting Eq. (4.9) from Eq. (4.8) and considering Eq. (4.7), we get the delay bound under MSF-RS is given by
* 2
The fairness parameter that we use is based on the definition presented by Golestani [GOL94] for the analysis of self-clocked fair queuing. The parameter is defined as the maximum difference of the service got by any two backlogged classes over arbitrary time intervals. A scheduling algorithm has a zero value of fairness if it always provides equal service for any two classes even in a short time interval. The fairness of MSF-RS* is zero since the downlink bandwidth can be concurrently shared by all non-backlogged classes anytime. The following analyzes the fairness of MSF-RS.
where i and j could be the indexes of any two backlogged classes and i j
i j
L L
w w
+ +
≥ .
Proof: We consider two classes, Class i and Class j, through the following analysis because the definition of fairness only concerns two classes. The existence of more active classes does not affect the difference of services got between two classes.
Besides, let i j first request of Class i, where timestamp represents the value in SCi when the request arrives into Class i. Upon these requests arrives, MSF-RS will forward the first W+ ones and W is set to W+. Let k be the (W++1)th request, i.e. it would be the first request in the queue of Class i after t0. Since W+ requests of Class i would be served before k,
k will have a timestamp v’ expressed by
Assume that requests of Class j arrive right after the time t0, and the first request should have the timestamp v since the timestamp of the request latest released by the server is v. However, although the first request of Class j has timestamp v smaller than that of Class i, i.e. vk, no requests can be forwarded from Class j because all W+ sub-links are busy for Class i. Let the sub-links become idle at t1. Then, in the worse case all requests of Class j with a timestamp no larger than v’ will be forwarded before k. Assume the Class-j request with v’ asks a response with size equal to Lj+. Then, between t1 and t2 the maximum of the total responses received by Class j will
be 1
. However, as shown in Fig. 4.7, Class i does not get any service during the period. Thus, between t1 and t2, the difference of the service between the two classes is i j equals to another one, the additional service which the class can get must smaller than
i
Fig. 4.7. The difference of the service between Class i and Class j Time t0~t1 t1~t2 t2~
Max. difference of service between Class i and j i
4.5 Simulation Results
This section verifies the effects of MSF-RS by ns-2 [NS06] in terms of the fairness and -bandwidth sharing, user-perceived latency, the relationship between U and W+, the effect of U+ on latency.