IEICE TRANS. COMMUN., VOL.E91–B, NO.5 MAY 2008
1623
LETTER
A Token-Bucket Based Rate Control Algorithm with Maximum and Minimum Rate Constraints∗ Han Seok KIM† , Eun-Chan PARK† , Nonmembers, and Seo Weon HEO††a) , Member
SUMMARY We propose a token-bucket based rate control algorithm that satisfies both maximum and minimum rate constraints with computational complexity of O(1). The proposed algorithm allocates the remaining bandwidth in a strict priority queuing manner to the flows with different priorities and in a weighted fair queuing manner to the flows within the same priority. key words: token bucket, rate control, quality of service, maximum sustained rate, minimum reserved rate
1.
Introduction
The rate control mechanism is one of the most important features to be implemented for QoS (Quality of Service) provisioning, and the token-bucket based approach has been most widely used as a rate control mechanism [1]–[7]. In order to achieve fine-grained rate control and per-flow QoS provisioning, one may consider applying the rate limit to an individual flow. However, this approach does not assure high efficiency of bandwidth usage in a case where some flows are inactive while others are greedy. To avoid this problem, token-bank leaky bucket [1] and correlated token bucket [4] have been proposed. The key idea of TBFQ (token bank fair queueing) is to employ a token bank where each flow saves excessive tokens and borrows unused tokens. TBFQ has been studied in the literature of ATM networks and various wireless networks [1], [2], [4]. However, the previous token-bucket based rate control methods have focused on complying with the peak and minimum rate constraints. It should be noted that the peak rate is different from the maximum sustained rate. While the former is about instantaneous rate, the latter is about longterm average rate. Users want to be provided with the assured minimum bandwidth even in the case of congestion, while service providers want to intentionally limit the bandwidth usage of a flow or user to a given maximum value even though there remains available bandwidth. Especially, the IEEE 802.16 standard defines the maximum sustained rate and the minimum reserved rate for some QoS service classes. Furthermore, many service providers want to difManuscript received September 13, 2007. Manuscript revised December 4, 2007. † The authors are with Telecommunication R&D Center, Samsung Electronics Co., LTD., Suwon, Korea. †† The author is with School of Electrical and Electronic Engineering, Hongik University, Seoul, Korea. ∗ This work was supported by the Hongik University new faculty research support fund. a) E-mail:
[email protected] DOI: 10.1093/ietcom/e91–b.5.1623
ferentiate user classes by limiting the maximum sustained rate of, for example, best-effort service while guaranteeing the minimum reserved rate for QoS services. Therefore, it is crucial to assure maximum and minimum rate constraints at the same time. In this paper, we propose a simple and efficient rate control mechanism, named MTBQ (Modified Token Bank Queueing), aiming to satisfy maximum and minimum rate constraints for each flow and to allocate bandwidth in a fair manner. For this purpose, we first consider a conventional approach whose complexity is O(N) with respect to the number of flows. Next, we elaborate the token-bucket algorithm to relieve the complexity. The complexity of the proposed MTBQ algorithm is O(1), i.e., irrelevant to the number of flows. The MTBQ algorithm is conceptually based on the token bank, and it is modified to support WFQ (weighted fair queuing) and SPQ (strict priority queuing), while guaranteeing both maximum and minimum rate constraints. MTBQ assures the minimum rate requirement and limits the service rate up to the specified maximum sustained rate. Moreover, it allocates the remaining bandwidth in a WFQ manner to the flows within the same priority and in a SPQ manner to the flows with different priorities. The contributions of this paper are as follows: (i) to the best of our knowledge, it is the first attempt to address both constraints on maximum sustained rate and minimum reserved rate with priority differentiation based on the tokenbucket mechanism, (ii) it is flexible and extensible to support various QoS scheduling polices such as SPQ and WFQ, (iii) it is simple and scalable since its complexity is O(1). 2.
Conventional Approach
The existing TBFQ methods can be modified to support maximum rate by simply distributing tokens in the token bank at the rate not greater than each flow’s maximum rate for each event. Since such modification is quite straightforward, we name this as conventional approach. Throughout the paper, we define some notations and assumptions as follows: • • • • •
Rmin,i : minimum reserved rate of flow i Rmax,i : maximum sustained rate of flow i ΔRi := Rmax,i − Rmin,i rin,i (t) : input rate of flow i at time t rout,i (t) : output rate of flow i at time t
c 2008 The Institute of Electronics, Information and Communication Engineers Copyright
IEICE TRANS. COMMUN., VOL.E91–B, NO.5 MAY 2008
1624
• Rin,i := E{rin,i (t)} (ergodic and stationary) • Rout,i := E{rout,i (t)} (ergodic and stationary) • C : maximum service rate (or processing capacity) for the aggregate flow • Rmin,i ≤ Rmax,i ≤ C for each i • k Rmin,k ≤ C In order to assure minimum rate while satisfying maximum rate constraint, we can consider a conventional tokenbucket architecture consisting of a dedicated token bucket for each flow and a shared token bank for all the flows, as shown in Fig. 1. In the individual token bucket, tokens are generated at the rate of Rmin,i for flow i, to assure the minimum reserved rate. If Rin,i < Rmin,i , the token bucket (eventually) overflows and excessive tokens are saved in the token bank. And then, unused tokens in the token bank (denoted by shared token in Fig. 1) are distributed to flows which are short of tokens up to the rate of ΔRi = Rmax,i − Rmin,i . Here, we introduce a threshold Threshold borrow to determine whether a flow is permitted to borrow tokens from the token bank or not (see Fig. 1). In this way, the minimum rate is assured as long as rin,i (t) > Rmin,i and a greedy flow can be served up to its maximum sustained rate Rmax,i (= Rmin,i + ΔRi ) without wasting bandwidth. It is trivial that the throughput of a flow whose input rate is less than the minimum reserved rate is equal to its input rate, i.e., Rout,i = Rin,i if rin,i (t) ≤ Rmin,i . It is also obvious that Rout,i cannot be greater than Rmax,i no matter how big rin,i (t) is. Note that the unused tokens in the token bank are distributed in a WFQ manner, i.e., the number of tokens are distributed in proportion to ΔRi . When all the flows are greedy so that the bandwidth is fully utilized, i.e., rin,i (t) ≥ Rmax,i , ∀i and k Rmax,k ≥ C, the throughput of flow i can be represented as: Rmin,k , Rout,i = Rmin,i + wi C − (1)
3.
Proposed Approach
The complexity of the conventional approach in Sect. 2 is O(N), i.e., the complexity increases in proportion to the number of flows N. To reduce the computational complexity, we propose a practical method, MTBQ, whose complexity is O(1) and is irrelevant to the number of flows. Figure 2 illustrates the diagram and flow chart of the proposed MTBQ algorithm. Unlike the conventional approach, the MTBQ algorithm does not require for-loop when updating and distributing shared token, i.e., the complexity is reduced to O(1). The key idea is that the tokens of the token bank are
k
where ⎧ ΔR i ⎪ ⎪ ⎪ , if ΔRk > 0, ⎪ ⎨ k ΔRk k wi = ⎪ ⎪ ⎪ ⎪ ⎩ ΔRk = 0. 0, if k
(b)
Fig. 1
Conceptual diagram of the conventional approach.
Fig. 2 Illustration of the proposed approach. (a) Conceptual diagram, (b) Flow chart. The amount of computation is independent of the number of flows.
LETTER
1625
generated at the rate of C when each packet arrives and deducted when each packet is served. Remind that, in the case of conventional algorithm described in Sect. 2, the tokens of the token bank are generated at the rate of C − k Rmin,k and deducted not on serving every packet but on lending tokens. In MTBQ, however, shared token does not decrease when a flow logically borrows tokens from the token bank, but it decreases when a packet is served. It is trivial that MTBQ satisfies (i) the minimum reserved rate (as the dedicated tokens are generated at the rate of Rmin,i ) and (ii) the maximum sustained rate (as the shared tokens are borrowed at most at the rate of ΔRi ). The following proposition states that MTBQ keeps WFQ property during congestion. Proposition: If rin,i (t) ≥ Rmax,i for all i so that the number of tokens for each flow is always less than Threshold borrow, and if k Rmax,k ≥ C, then WFQ property described in (1) holds. Proof: First, we prove in the case of k ΔRk = 0. In this case, it is clear that Rmax,i = Rmin,i for all i, and hence, Rout,i = Rmin,i and (1) holds. Now, we prove when k ΔRk > 0. Due to the condition of congestion, all the flows try to borrow tokens whenever there exist tokens available in the token bank. Let us denote S (tk ) as the value of shared token when the k-th packet (among the entire flows) arrives at tk . It should be noted that the value of S (tk ) can be negative and it becomes positive and negative alternately since the aggregate input rate is greater than C. Thus, there exists a packet index of L such that S (tL ) ≤ 0 and S (tL+1 ) > 0. Also, there exists the smallest packet index of M such that M > L, S (t M ) > 0, and S (t M+1 ) ≤ 0. There are infinitely many L’s and M’s and let their indices as Lk and Mk , respectively. Let d+ (Lk ) := t Mk − tLk and d0 (Lk ) := tLk+1 − t Mk . In other words, d+ (Lk ) and d0 (Lk ) denote the durations when shared token is positive and non-positive, respectively. Also, Klet D+ := K d+ (Lk ) and D0 := limK→∞ K1 k=1 d0 (Lk ). limK→∞ K1 k=1 Consider the following three kinds of quantities: • Since shared token decreases for every served packet and the total throughput is equal to the capacity C while congested, the average amount of token deduction from the token bank during (d0 (Lk ) + d+ (Lk )) is (D0 + D+ )C. • Since shared token > 0 during d+ (Lk ), tokens are borrowed from the token bank at the rate of ΔRi , and the average amount of newly generated and bor
+ ΔRi = rowed tokens of all the flows is D R + k min,k D+ k Rmax,k . • Since shared token ≤ 0 during d0 (Lk ), no token is borrowed, and the average amount of newly generated tokens of all the flows is D0 k Rmin,k . Since the amount of deduction should be balanced with the amount of generation, we have (D0 + D+ )C = D+ Rmax,k + D0 Rmin,k . (2) k
k
After some manipulations of (2), we can calculate
P{shared token > 0} as: D+ P{shared token > 0} = D0 + D+
−1 C − k Rmin,k D0 = 1+ = . D+ k ΔRk
(3)
The throughput of flow i is given by Rmax,i D+ + Rmin,i D0 D0 + D+ D+ D0 = Rmax,i + Rmin,i D0 + D+ D0 + D+ D+ = Rmin,i + ΔRi . D0 + D+
Rout,i =
(4)
Applying (3) to (4), we derive (1). We now extend the MTBQ algorithm to support SPQ. Consider a case where a flow can borrow tokens from the token bank. As indicated in the diamond box at the center in Fig. 2(b), a flow can borrow tokens from the token bank if (i) the number of its own tokens is less than Threshold borrow and (ii) there exists tokens in the token bank. We introduce a new threshold, Threshold share[k], to differentiate service based on the priority of the flow; a flow with service class k can borrow tokens if shared token > Threshold share[k]. By setting Threshold share to zero for high-priority class and a proper positive value for low-priority class, the proposed method can emulate SPQ. It is clear that as the threshold for low-priority class becomes larger, the prioritization effect becomes more definite, i.e., a low-priority flow is less likely to borrow tokens that should be used to serve high-priority flows. We have observed from simulation study that a couple of times of the average packet size is enough to emulate SPQ. 4.
Numerical Experiments
In this section, we conduct simulations to validate the proposition and to evaluate the performance of MTBQ in several aspects. First, we focused on a case where all flows have the same priority and compared the actual per-flow throughput obtained from simulation with the analytical one derived from the proposition, for several values of Rmin , Rmax , and Rin . We observed that there exists negligible difference between them, confirming the proposition. Due to space limitation, we omit simulation results for this case. We only provide one simulation result where several flows with different priorities are served in the network. The capacity C is set to 1.5 Mb/s and Max token and Threshold borrow are set to 20 kbyte and 10 kbyte, respectively. Other simulation configurations are summarized in Table 1. In Table 1, Rin denotes the average input traffic rate whereas rin,i (t) is time-variant by setting both packet size and packet generation interval to follow exponential distributions. Note that, Threshold share of low-priority
IEICE TRANS. COMMUN., VOL.E91–B, NO.5 MAY 2008
1626 Table 2
Average per-flow throughput (Kb/s) for each period obtained from simulation and analysis. time (sec) simulation flow 1 analysis simulation flow 2 analysis simulation flow 3 analysis simulation flow 4 analysis simulation flow 5 analysis simulation total analysis
Table 1
Flow ID 1 2 3 4 5
Rmax (Kb/s) 1000 500 700 1000 400
0–20 20–40 40–60 60–100 100–120 120–140 140–180 1000 1000 586 300 1000 1000 592 300 500 500 340 385 500 500 355 409 414 200 200 200 408 200 200 200 360 615 1000 1000 345 591 1000 1000 300 300 300 400 300 300 300 400 1000 1500 1500 1500 1500 1500 1400 1000 1500 1500 1500 1500 1500 1400
Simulation configuration.
Rmin (Kb/s) 300 300 200 100 300
Rin (Kb/s) 2680 2680 800 1600 800
active time (sec) 0–100 20–120 40–140 60– 60–
priority low high low high low
reserved rates. Moreover, the link is fully utilized as long as it is allowed, e.g., during 20–140 sec. 5.
Conclusion
We have proposed a token-bucket based rate control algorithm, MTBQ, to assure the maximum sustained and minimum reserved rate constraints while supporting priority differentiation. The complexity of MTBQ is O(1); it does not increase with respect to the number of flows. Via analysis and simulation, we have demonstrated that each flow is guaranteed with its own minimum reserved rate and shares the remaining bandwidth in a WFQ manner with the weight of the difference between the maximum and minimum rates. We have also showed that it can be extended to support SPQ by differentiating threshold values. As future work, it will be of interest to generalize MTBQ to wireless networks with variable capacity. References
Fig. 3
Per-flow throughput with different service priority.
class (flow 1, 3, and 5) is set to 5 kbyte, while that of highpriority class (flow 2 and 4) is set to zero. Figure 3 shows per-flow throughput, as well as aggregate throughput. Moreover, Table 2 lists and compares the average throughputs for a given period obtained from simulation and analysis. As shown in Fig. 3 and Table 2, MTBQ satisfies both maximum and minimum rate constraints and supports SPQ among flows with different priorities and WFQ among flows with the same priority. During 40–60 sec, flow 2 (the only high-priority flow) borrows tokens as many as possible so that its throughput is equal to Rmax,2 and the remaining tokens are distributed to lowpriority flows in proportion to the value of ΔRi . During 60–100 sec, low-priority flows 1, 3, and 5 cannot borrow tokens at all because the sum of maximum sustained rate of high-priority flows is greater than link capacity, thus their throughputs become equal to the corresponding minimum
[1] S.-L. Wu and W.-S.E. Chen, The token-bank leaky bucket mechanism for group connections in ATM networks, pp.226–23, 1996. [2] D. Huang and J.J. Shi, “Radio resource management for quality of service in third generation mobile communications,” Proc. Vehicular Technology Conference (VTC), pp.1725–1727, 2002. [3] T.-H. Lee, “Correlated token bucket shapers for multiple traffic classes,” Proc. Vehicular Technology Conference (VTC), pp.4672– 4676, 2004. [4] W. Wong, H. Tang, and V. Leung, “Token bank fair queueing: A new scheduling algorithm for wireless multimedia services,” International Journal of Communication Systems, vol.17, pp.591–614, 2004. [5] R. Garroppo, S. Giordano, S. Lucetti, and E. Valori, “The wireless hierarchical token bucket: A channel aware scheduler for 802.11 networks,” Proc. IEEE International Symposium on a World of Wireless Mobile and Multimedia Networks (WoWMoM), pp.231–239, 2005. [6] C.-H. Jiang and T.-C. Tsai, “Token bucket based CAC and packet scheduling for IEEE 802.16 broadband wireless access networks,” Proc. IEEE Consumer Communications and Networking Conference, pp.183–187, 2006. [7] T.-C. Tsai, C.-H. Jiang, and C.-Y. Wang, “CAC and packet scheduling using token bucket for IEEE 802.16 networks,” J. Commun., vol.1, pp.30–37, 2006.