Research Journal of Applied Sciences, Engineering and Technology 7(10): 20462057, 2014 DOI:10.19026/ajfst.7.498 ISSN: 20407459; eISSN: 20407467 © 2014 Maxwell Scientific Publication Corp. Submitted: June 25, 2013 Accepted: July 08, 2013 Published: March 15, 2014

Research Article Packet in Highspeed Networks Using Improved

Guikai Liu and Qing Li School of Computer Science and Engineering, Hunan University of Science and Technology, Xiangtan, 411201, China

Abstract: A variety of applications with different QoS requirements are supported simultaneously in the highspeed packetswitched networks, packet scheduling algorithms play a critical role in guaranteeing the performance of routing and switching devices. This study presents a simple, fair, efficient and easily implementary scheduling algorithm, called Successive Minimalweight Round Robin (SMRR). In each round, SMRR provides the same service opportunity, which is equivalent to the minimal weight of the current round, for all active data flows. On the basis of the concept of LatencyRate (LR) servers, we obtain the upper bound on the latency of SMRR and WRR (Weighted Round Robin) respectively and the results indicate that SMRR makes a significant improvement on the latency bound in comparison to WRR. We also discuss the fairness and implementation complexity of SMRR and the theoretical analysis shows that SMRR preserves the good implementation complexity of O (1) with respect to the number of flows and has better fairness than WRR.

Keywords: Complexity, highspeed networks, latency bound, minimal weight, packet scheduling, relative fairness, Weighted Round Robin (WRR)

INTRODUCTION SRR (Smoothed Round Robin) (Guo, 2001), the scheduler simply serves all nonempty queues in a There are many kinds of services with different roundrobin manner. These algorithms neither maintain QoS requirements in Internet. Packets belonging to a timestamp for every service flow, nor perform different traffic flows often share links in their sorting among the packets. Most of them have O (1) respective paths towards their destinations. Switches complexity with respect to the number of flows. As a and routers want to schedule these traffics for matter of fact, roundrobin is used in many other fields supporting different service levels; therefore, the besides packet scheduling due to its simple, applied and performances of routingswitching devices are tightly good efficiency. Research and application aiming at interrelated to the used packet scheduling algorithms. roundrobin algorithm are very broad (Hu et al ., 2008; Packet scheduling algorithms can be broadly classified Lin et al ., 2011; He et al ., 2012). into two categories: timestamp based scheduling and Timestamp based packet scheduling algorithms roundrobin based scheduling. Timestamp based are to approximately emulate the most ideal packet scheduling algorithms such as WFQ (Weighted Fair scheduling algorithmGPS (Generalized Processor Queuing) (Demers et al ., 1998), WF 2Q (Worstcase Sharing) (Parekh and Gallager, 1992). However, their Fair Weighted ) (Bennett and Zhang, design complexities are increased in order to get perfect 1996), VC (Virtual Clock) (Zhang, 1990), SCFQ (Self latency characteristics. So roundrobin based packet Clocked Fair Queuing) (Golestani, 1994) and SFQ scheduling algorithms are more attractive for (Starttime Fair Queuing) (Goyal et al ., 1997) maintain implementation in highspeed packet networks. In this two timestamps for each packet to indicate its start study, we present a new packet scheduling algorithm, serving time and endserving time respectively, then termed Successive Minimalweight Round Robin sort these time and send out the packet with the least (SMRR), with better fairness and latency characteristic endserving time. They achieve good fairness and low compared to Weighted Round Robin (WRR). In each latency. However, they are not very efficient due to the round, every flow always gains the equivalent service complexity involved in computing and sorting each opportunities to the least weight of the current round. It packet’s time. On the other hand, in roundrobin based efficiently avoids the situation that some flows cannot scheduling algorithms such as WRR (Weighted Round gain service probably for a long time. Generally the Robin) (Hemant and Madhow, 2003), DRR (Deficit opportunity of a flow, namely the number of packets RoundRobin) (Shreedhar and Varghese, 1996) and which are sent to the output link with permission in a

Corresponding Author: Guikai Liu, School of Computer Science and Engineering, Hunan University of Science and Technology, Xiangtan, 411201, China This work is licensed under a Creative Commons Attribution 4.0 International License (URL: http://creativecommons.org/licenses/by/4.0/). 2046

Res. J. Appl. Sci. Eng. Technol., 7(10): 20462057, 2014

Fig. 1: Pseudocode for SMRR scheduling packets round, is proportional to its weight. WRR sends out all when a flow’s weight is the least, it can send out all of the packets whose number is equivalent with a flow’s its packets at a time. So SMRR can assure the service weight at a time and a flow with large weight may let opportunity of every flow and balance their waiting other flows be waiting for a long time. In contrast, latency. WRR is an earlier scheduling algorithm and SMRR sends a flow’s packets whose number is applied long before. In recent years, many literatures equivalent with its weight through many times; only put forward many queue scheduling algorithms based 2047

Res. J. Appl. Sci. Eng. Technol., 7(10): 20462057, 2014 on WRR. For example, according to the current queue will be removed from Surplus Flow List. If a data flow length, Pan and Zhang (2012) dynamically set the belongs to Surplus Flow List, it belongs to Active Flow maximum byte number that can be sent during a service List definitely, but not vice versa. time in order to guarantee latency characteristics and There are two types of rounds in SMRRprimary relative fairness of lowweighted services. BSTLRR round and secondary round. A primary round is defined (Xiong and Zhang, 2012) schedules those data flows as the process during which the data flows, included in firstly, which have higher realtime requirement. Active Flow List at a time instant T1 (T1>0), are TIIWRR (Zhang et al ., 2011) ameliorates UIWRR, also accessed by packet scheduling module. The newcome called WRR2 in (Hemant and Madhow, 2003), to solve flows or those become active once again can be the collision problem when UIWRR computes packet appended at the end of Active Flow List, but they will sending sequence. Based on the very limited buffering be accessed in the next round. The definition of capability of optical packet switching network, Cao secondary round, similar with primary round, is the et al . (2010) introduce an algorithm called United process during which the data flows included in Surplus Weight Round Robin (UWRR) for scheduling multi Flow List are accessed by packet scheduling module. A services in the network. As far as a scheduling primary round may involve one or more secondary algorithm is concerned, there are three very important rounds. attributes, namely latency, fairness and complexity. In order to express the number of data flows These three attributes have an effect on the practical wanted to be accessed in a round, SMRR introduces a application of a scheduling algorithm. Therefore, this counter, which is called “Visit Flow Count”, to record study will lay special stress on analyzing these three the number of data flows. At the beginning of a round, attributes of SMRR and compare them with WRR. Visit Flow Count equals the number of data flows in Surplus Flow List. When packet scheduling module SUCCESSIVE MINIMALWEIGHT finishes accessing a data flow, the value of Visit Flow ROUND ROBIN Count will be minus 1. At last, when Visit Flow Count equals 0, it means that the current round is over. A pseudocode implementation of the SMRR Another counter, called “Packet Number Count”, is scheduling algorithm is shown in Fig. 1, including used to record the number of packets that a data flow Initialize Module, Enqueue Module and Dequeue has sent out totally in a round and every data flow has a Module. The Initialize Module is to initialize the Packet Number Count. The initial value of Packet SMRR packet scheduler when network node has Number Count is 0 before a round begins and then demand on scheduling packets. Enqueue Module is Packet Number Count will be increased by 1 after the called whenever a new packet arrives at a flow. The corresponding flow sends out one packet. packet will enter into the correlative queue and wait for being sent. Dequeue Module schedules packets from SMRR LATENCY ANALYSIS the queues corresponding to different flows. Therefore, we can define the scheduling framework Stiliadis and Verma (1998) defined a general class of SMRR as: suppose there are n (n is a natural number of schedulers, called LatencyRate (LR) Servers. Here and n>0) data flows sharing one output link; packets of schedulers are those servers or devices which run each flow enter into correlative queue before being sent specific scheduling algorithm. The authors also to the output link; packet scheduling module uses developed and defined a notion of latency and SMRR algorithm to scheduling each packet so that the determined an upper bound on the latency for a number bandwidth resource of the output link is allocated fairly. of schedulers that belong to the class of LR servers. A data flow is defined as active if its queue is not There into the notion of latency is based on the length empty or its packets are being scheduling. All the active of time it takes a new flow to begin receiving service at flows are put into a list and this list is called “Active its guaranteed rate and pointed out latency is directly Flow List”. When a flow changes from active to relevant to the size of the playback buffers required in inactive, it will be removed from Active Flow List. realtime streaming applications. In this study, SMRR’s When a flow changes from inactive to active, it will be latency characteristic will be analyzed by using the appended at the end of Active Flow List. concept of LatencyRate Servers. Every data flow is designated a “weight” through Consider an output link of transmission rate r, which indicates its priority, QoS requirements and so access to which in controlled by the SMRR scheduler. on. When a flow’s weight (namely its service Let n be the total number of flows and let ρi be the opportunity) is not used up, we say that its “Surplus scheduling rate for flow i. Let ρmin be the lowest of these Weight” is more than zero. All the flows which have scheduling rates. Since all the flows share the same positive Surplus Weight are put into a list which is output link, the sum of the scheduling rates is no more called “Surplus Flow List”. When a flow’s weight is than the transmission rate of the output link, namely used up, namely its weight already equals 0; this flow ≤ . In order that each flow receives service 2048

Res. J. Appl. Sci. Eng. Technol., 7(10): 20462057, 2014 proportional to its guaranteed service rate, the SMRR Si (α i, t) ≥max {0, ρi (t αi Өi)} (3) scheduler assigns a weight to each flow. The weight assigned to flow i, wi is given by: As defined in Stiliadis and Verma (1998), a scheduler which satisfies Eq. (3) for some nonnegative ρ constant value of Өi is said to belong to the class of w = i (1) i ρ Latency Rate (LR) servers. min Note that even if the definition of the latency is

based on flow busy periods, actually it is easier to Apparently, for 1≤i≤n, w ≥1. i analyze scheduling algorithms based on the active Let Ф represent the amount of data that flow i is i period of a flow. permitted to send during each round robin service opportunity and let Φ min be the amount of data Lemma 1: Suppose there is a scheduling server S and permitted to the flow with the lowest scheduling rate. flow i becomes active at the instant of time τi. Let t>τi The amount of data permitted to flow i is given by be some instant of time such that the flow is Фi = wiΦmin . Thus, the amounts of data permitted to the continuously active during the time interval (τ , t). Let flows are in proportion of their scheduling rates. In i Өi΄ be the smallest nonnegative number such that the addition, let A i (τ, t) represent the number of arrived following is satisfied for all t: packets in flow i during the time interval (τ, t).

Sent i (τi, t) ≥max {0, ρi (t τi Өi΄)} (4) Definition 1: Define W as the sum of the weights of all active flows that are being served by the SMRR Even though (τi, t) may not be a continuously busy scheduler. period for flow i, the latency as defined by Eq. (3) is

bounded by Өi΄. Definition 2: An active period of a flow is defined as the maximal interval of time during which it has at least Proof: Since a busy period must be an active period, it one packet awaiting service or in service. A flow will be proven so long as any one busy period (α k, βk) remains continuously active during its active period. during active periods satisfies Eq. (3):

Definition 3: A busy period of flow i is defined as the If α k = τi, t ∈ (α k, βk), then S i (α k, t) = Sent i (α k, t) ≥max maximal interval of time (τ1, τ 2) such that at any time t∈ {0, ρ (t α Ө ΄)} (τ , τ ) the accumulated arrivals of flow i since the i k i 1 2 If α >τ , t ∈ (α , β ), then S (α , t) = Sent (τ , t) Sent beginning of the interval do not fall below the total k i k k i k i i i (τ , α ) service received during the interval at a rate of exactly i k

ρ . That is: i Since (τ , α ) is not the busy period of flow i, i k therefore, Sent (τ , α ) ≤A (τ , α ) <ρ (α τ ) and then S A (τ , t) ≥ρ (t τ ) (2) i i k i i k i k i i i 1 i 1 (α , t) = Sent (τ , t) Sent (τ , α ) >max {0, ρ (t τ k i i i i k i i Ө ΄)} ρ (α τ ) = max {0, ρ (t α Ө ΄)}. A flow is active during its busy period, but the i i k i i k i Synthetically, S (α , t) ≥max {0, ρ (t α Ө ΄)}. active period is different from the busy period of a i k i k i Hence S is LatencyRate server and the latency is less flow, in the sense that it reflects the actual behavior of than or equals Өi΄. the scheduler because the instantaneous service offered Lemma 1 allows us to determine the latency bound to the flow varies according to the number of active of a scheduler by considering only those periods during flows. Suppose Sent i (t 1, t2) represent the amount of which a flow is continuously active. service received by flow i during the time interval (t 1, t2). Let the time instant α i be the start of a busy period Lemma 2: The latency experienced by flow i during for flow i. Suppose t>α i and flow i is continuously busy the active period (τi, t) will reach its upper bound, Өi΄, during the time interval (α i, t). Define S i (α i, t) as the only if the time instant, τi, at which flow i becomes number of packets in flow i that arrive after time α i and active, is the start time of serving another flow. are scheduled during the interval of time (α i, t). Obviously, the busy period of a flow must be its active Proof: Assume that flow j (j ≠ i) receives its service period, but the active period is not always its busy opportunity during the time interval (t 1, t 2), t 1≤τit 1. That is, the time interval (t 1, τi) is a part of the service opportunity of flow j, but it is not included Definition 4: The latency of flow i is defined as the in the latency experienced by flow i. On the other hand, minimum nonnegative constant Өi that satisfies the when τi = t 1, τi is the start of the service opportunity of following for all possible busy period of the flow: flow j. So, the time for which flow i has 2049

Res. J. Appl. Sci. Eng. Technol., 7(10): 20462057, 2014

Fig. 2: SMRR time interval under consideration to wait before receiving any service will involve the For analyzing the latency bound, we need to select (k, v) time interval (t 1, t 2). Obviously, when τi is the start time a suitable time interval (τi, τ i ) such that the size of of the service opportunity of another flow, the latency this time interval is the maximum possible. The start experienced by flow i is always greater. time instant τi may or may not coincide with the start of a new primary round. Assume that the k 0th primary Lemma 3: The latency experienced by flow i during round is in progress or which starts exactly at time the active period (τi, t) will reach its upper bound, Өi΄. t instant τi and let the time instant th represent the start belongs to such a time set T i and T i is the set of all time time of the (k 0 + h)th primary round. Consider the case instants at which the scheduler begins serving flow i. when τ i does not coincide with the time instant t0, the start of primary round k0, i.e., τi>t0. In this case, the Proof: Assume that t 1 and t 2 are any two consecutive time interval (t 0, τi) will be excluded from the time time instants belong to T i. Consider an instant of time t, interval under consideration. On the other hand, when τi (k, v) t1

Res. J. Appl. Sci. Eng. Technol., 7(10): 20462057, 2014

On the basis of the discussion above, the time (k 0 +s, v) W 1 (k +s, v) τ i − τ i ≤ (sΦ min ) + [ w jΦ min + interval (τi, τ i 0 ) can be split into two subintervals: ∑ r r j∈G FIN (11)

w Φ +w Φ ] ∑ i min v −1 min • (τi, ts): This subinterval includes s primary rounds j∈(n−G FIN ) of execution of SMRR scheduler starting at j ≠i

primary round k . Now assume that primary round 0 Solving for s: (k 0 + h) is in progress during the time interval (t h, th+1 ). For all n flows: (k0 +s, v) r 1 (12) s ≥ (τ i −τi ) − [ ∑wj + ∑wi +wv−1] WΦmin W j∈GFIN j∈(n−GFIN ) W j≠i t − t = Φ (6) h+1 h r min Note that the total data transmitted by flow i during Summing the above over s rounds beginning with the time interval under consideration can be expressed primary round k : as the following summation: 0

Sent (τ , τ (s, v) ) = Sent (τ , t ) + Sent (t , τ (s, v) ) (13) W i i i i i s i s i t − τ = (sΦ ) (7) s i min (s, v) r As explained earlier, Sent i (t s, τi ) is the same as Sent i (s, v1). Sent i (τi, t s) can be obtained by summing (k +s, v) • (t s, τi 0 ): This subinterval includes the part of the amount of data of flow i over s primary rounds the (k 0 + s)th primary round prior to the start of the starting at primary round k 0. We get: service of flow i during the vth secondary round. (k +s, v) In the worstcase, flow i will be the last flow to Sent i (τi, τ i 0 ) = wi (sΦ min ) + wv1Φmin (14) receive service among all the flows. In this case, during the subinterval (t , τ (k +s, v) ), the service Using (12) to substitute for s in (14), we have: s i 0 received by flow i comes from the former v1

(k0 +s,v) wi r (k0 +s, v) secondary rounds, whereas the other n1 flows Senti (τ i ,τ i ) ≥ (τ i − τ i ) have completed the service of v secondary rounds. W w Φ If v = 1, then flow i does not receive service in this − i min [ w + w +w ] + w Φ W ∑ j ∑ i v−1 v−1 min subinterval. j∈GFIN j∈(n−GFIN ) j≠i

wi r (k0 +s, v) wi Φ min Let Sent i (k, v) represent the total service received = (τ i −τ i ) − by flow i since the start of the kth primary round until W W the time instant when SMRR scheduler finishes the wi Φ min [ ∑ w j + ∑ wi ] − wv−1 + wv−1Φ min service of the vth secondary round, then: j∈GFIN j∈(n−GFIN ) W j≠i

w r w Φ n = i (τ (k0 +s, v) −τ ) − i min (k0 +s, v) 1 (8) i i τ i −ts = [Senti (k0 + s,v − )1 + ∑Sentj (k0 + s,v)] W W (15) r j=1 j≠i (W − wi )Φ min [ ∑ w j + ∑ wi ] + wv−1 j∈GFIN j∈(n−GFIN ) W j≠i Sorting all the n weights in ascending order and let wv1 and wv represent the (v1)th and the vth weight In (15), if v = 1 then wi is the least among all respectively, we have: weights and. wv1 = 0; if v>1 then w v1≥1. Thereupon, introducing a parameter Ψ and its values as follows: 1 (k0 +s, v) (9) Ψ = 0 when wi is the least among n weights; Ψ = 1 in τ i − ts = [ ∑w j Φ min + ∑wvΦ min +wv−1Φ min ] r j∈GFIN j∈(n−GFIN ) other cases. So: j≠i w r Senti(τ ,τ (k0 +s,v) ) ≥ i (τ (k 0 +s, v) − τ ) Since wv≤w i, therefore: i i W i i (16) w Φ (W − w )Φ − i min [ w + w ] + Ψ i min (k +s, v) 1 ∑ j ∑ i 0 W W τ i − t s ≤ [ w j Φ min + wi Φ min +wv−1Φ min ] j∈GFIN j∈(n−GFIN ) ∑ ∑ j≠i r j∈GFIN j∈(n−GFIN ) j≠i (10) Now, since the sum of the scheduling rates is no Combining Eq. (7) and (10), we have: more than the link rate r and combing (1), we have: 2051

Res. J. Appl. Sci. Eng. Technol., 7(10): 20462057, 2014

w r Case II: for ∀j, 1≤j≤n, j ≠ I, ρi>> ρj ρ ≤ i (17) i W In this case, wi>> wj. Ψ = 1 and the set G FIN includes all ( n1) flows except flow i. Hence: Using Eq. (17) in (16), we get: 1 1 1 θ ≤ w Φ − ( − )Φ (k0 +s,v) (k 0 +s, v) i ∑ j min min Senti (τ i ,τ i ) ≥ ρ i (τ i − τ i ) r j∈GFIN ρ i r ρ Φ ρ 1 1 1 − i min [ w + w ] + Ψ 1( − i )Φ = (W − w )Φ − ( − )Φ ∑ j ∑ i min r i min ρ r min r j∈GFIN j∈(n−GFIN ) r i j≠i

Since ρi

= ρ (τ (k 0 +s, v) −τ − i i i Theorem 2: The WRR scheduler belongs to the class 1 1 1 1 ( w Φ + w Φ − Ψ( − )Φ )) of LR servers, with an upper bound on the latency Өi ∑ j min ∑ i min min for flow i given by: r j∈GFIN r j∈(n−GFIN ) ρ i r j≠i

1 (21) And then: θi ≤ (W − wi )Φ min r

(k0 +s,v) (k 0 +s, v) Sent i (τ i ,τ i ) ≥ max{ ,0 ρ i (τ i −τ i − (18) Proof: According to Lemma 1, the latency of an LR 1 1 1 1 ( w Φ + w Φ − Ψ( − )Φ ))} server can be estimated based on its behavior in the r ∑ j min r ∑ i min ρ r min j∈GFIN j∈(n−GFIN ) i flow active periods, so we will prove the theorem by j≠i showing that: Therefore: ' 1 θ ≤ (W − w )Φ 1 1 1 1 i i min θ ' ≤ w Φ + w Φ − Ψ( − )Φ r i ∑ j min ∑ i min min r j∈GFIN r j∈(n−GFIN ) ρi r j≠i Assume that flow i becomes active at time instant s τi and let τ i be the start time of the sth service The statement of the theorem is proved. opportunity of flow i. According to Lemma 3, in order Now, analyzing the latency of SMRR under two to determine upper bound on the latency of WRR, we boundary conditions: need to only consider time interval (τ , τ s) for all s. i i Figure 3 illustrates the time interval under consideration Case I: for ∀j, 1≤j≤n, j ≠ i, ρi<< ρj In this case, w = 1 and w << w . Also W>> w , the set for a given s. Note that the time instant τ i may or may i i j i not coincide with the end of a round and the start of the GFIN is empty and Ψ = 0. Hence: subsequent round. Let k 0 be the round which is in 1 1 1 progress at time instant τ i or which ends exactly at time θ ≤ w Φ = (n − )1 Φ << (W − w )Φ (19) i ∑ i min min i min instant τ i. Let the time instant t h mark the end of round r j∈(n−GFIN ) r r j≠i (k 0 + h 1) and the start of the subsequent round.

Fig. 3: WRR time interval under consideration 2052

Res. J. Appl. Sci. Eng. Technol., 7(10): 20462057, 2014

As shown in Fig. 3, assume that the time instant W 1 = (s − )1 Φ + (W − w )Φ (26) when flow i becomes active coincides with the time r min r i min instant when some flow g is about to start its service opportunity during the k 0th round. Let G i+ denote the Solving for s1: set of flows which receive service after flow i becomes active, i.e., during the time interval (τ , t ). Similarly, let i 1 r W − w G denote the set of flows which are served by the s i (27) i s −1 = (τ i −τ i ) − WRR scheduler before flow i becomes active, i.e., WΦ min W during the time interval (t 0, τi). Note that flow i is not included in either of these two sets since flow i will Note that during the time interval under s receive its first service opportunity only in the (k 0 + 1) consideration, (τ i, τi ), flow i receives service in s1 th round. If the time instant τ coincides with the time i rounds starting at round (k 0 + 1). We get: instant t 1, which marks the end of the k 0th round and the start of the (k + 1)th round, then the set G will be 0 i+ s (28) empty and all the n1 flows will be included in the set Senti (τ i ,τ i ) = wi (s − )1 Φ min Gi. In this case, flow i will be the last to receive service in the (k 0 + 1)th round and all subsequent rounds Using (27) to substitute for (s1) in (28), we have: during the time interval under consideration. The time interval (τ , τ s) can be split into the i i s w r s w (W − w ) following three subintervals: Sent (τ ,τ ) = i (τ −τ ) − i i Φ (29) i i i W i i W min

• (τ i, t1): This subinterval includes the part of the k 0 Since ≤ , hence: th round during which all the flows belonging to the set G i+ will be served by the WRR scheduler and then: ρ Sent (τ ,τ s ) ≥ ρ (τ s −τ ) − i (W − w )Φ i i i i i i r i min 1 (22) 1 t1 −τ i = ∑ w j Φ min s (30) r = ρi (τ i −τ i − (W − wi )Φ min ) j∈Gi+ r

• (t 1, ts): This subinterval includes s1 rounds of the We get: WRR scheduler starting from round (k 0 + 1). Assume that round (k + h) is in progress during the 0 s s 1 (31) time interval (t , t ), we get: Senti (τ i ,τ i ) ≥ max{ ,0 ρi (τ i −τ i − (W − wi )Φmin )} h h+1 r

W (23) And then: th+1 − th = Φ min r

' 1 Summing Eq. (23) over s1 rounds beginning with θi ≤ (W − wi )Φ min r round k +1: 0

The theorem is proved. W (24) t s − t1 = (s − )1 Φ min r COMPARATIVE ANALYSIS OF

s LATENCY UPPER BOUND • (t s, τ i ): This subinterval includes the part of the (k + s)th round during which all the flows 0 At first, we present a comparison of the latency belonging to the set G will be served by the WRR i upper bound of WRR derived in Theorem 2 with the scheduler and then: latency bound derived in (Stiliadis and Verma, 1998).

Let Ө new represent the latency bound derived in 1 i τ s − t = w Φ (25) Theorem 2. Thus: i s r ∑ j min j∈Gi− 1 θ new = (W − w )Φ (32) Combining Eq. (22), (24) and (25), we have: i r i min

s W 1 1 old τ −τ = (s − )1 Φ + w Φ + w Φ Let Өi represent the latency bound of WRR as i i r min r ∑ j min r ∑ j min j∈Gi+ j∈Gi− derived in (Stiliadis and Verma, 1998), namely: 2053

Res. J. Appl. Sci. Eng. Technol., 7(10): 20462057, 2014

Table 1: Comparison of latency bounds the maximum value of FM (t 1, t 2) over all possible time Scheduler Latency bound intervals (t , t ): 1 2

Sent (t ,t ) Sent j (t1 ,t2 ) | i 1 2 − | (35) ρi ρ j If a scheduling algorithm has FM = 0, it is obvious that this algorithm has good relative fairness. For example, GPS (Generalized Processor Sharing) (Parekh and Gallager, 1992) is proven to possess this property. However, this condition cannot be met by any packet bypacket algorithm since packet must be served F − Φ + L θ old = i c (33) exclusively. In such algorithms, we can only require i r that their FMs are bounded by a constant. Therefore, for a scheduling algorithm running on server S, it is In Eq. (33), F denotes the size of a WRR frame considered close to fair if its FM is a constant. In which is equal to WΦmin , the summation of the data particular, FM (t 1, t 2) should not depend on the size of S permitted to be sent by all the active flows. Lc is the the time interval. This constant is called F in (Stiliadis size of an ATM cell. Substituting for F in Eq. (33) we and Verma, 1998) and F S is called the fairness of server get: S. Apparently, FM≤F S.

old WΦ min − Φi + Lc 1 Lc Theorem 3: The SMRR schedulers have FM≤ . θ = = (W − w )Φ + (34) i r r i min r

Proof: Consider any two flows i and j that are Comparing Eq. (32) and (34), we have θ new <θ old . It i i continuously backlogged in a time interval (t , t ). Since illuminates that the upper bound on the latency of WRR 1 2 derived in Theorem 2 is lower. the maximal difference of the service opportunity Next, we compare the latency bound of SMRR between i and j is one secondary round, without loss of analyzed earlier with the latency bound of WRR. The generality, assume that two flows have passed through latency of SMRR, under two boundary conditions, are k primary rounds. In addition, flows i and j have passed shown in Eq. (19) and (20). Both of them are less than through v1 and v secondary rounds respectively. We have: ( − )Φ obviously, so the latency characteristic of SMRR is better than that of WRR. Sent (t , t ) = w (kΦ ) + w Φ Note that there is a special case: SMRR and WRR have i 1 2 i min v −1 min the same latency upper bound when all the n flows have the same weight. Table 1 summarizes each latency Sent j (t1 , t 2 ) = w j (kΦ min ) + w v Φ min upper bound and also making a comparison to these smrr latency bounds through Table 1. Hereinto, θi smrrlow And then: represents the latency upper bound of SMRR; θi smrrhigh and θi represent the latency upper bounds of Sent (t , t ) Sent j (t1 , t 2 ) SMRR under boundary conditions I and II respectively. | i 1 2 − =|| ρ i ρ j FAIRNESS w (kΦ ) w (kΦ ) w Φ w Φ i min − j min + v−1 min − v min | ρ ρ ρ ρ For fairness analysis, the fairness metric proposed i j i j in Golestani (1994) is more commonly employed. This metric, known as the Relative Fairness Bound (RFB), is According to (1), we have = , therefore: defined as the maximum difference in the service received by any two flows over all possible intervals of Sent (t ,t ) Sent (t ,t ) w Φ w Φ time. | i 1 2 − j 1 2 =|| v−1 min − v min | (36) ρ ρ ρ ρ i j i j Definition 5: For any two flows i and j of all the flows which have continuous packets queuing during the time The following case discussion: interval (t 1, t2), let FM (t 1, t 2) represent the maximum value of the following formula (35). FM is defined as When v = 1: 2054

Res. J. Appl. Sci. Eng. Technol., 7(10): 20462057, 2014

Sent (t ,t ) Sent (t ,t ) Sent (t ,t ) Sent (t ,t ) | i 1 2 − j 1 2 |= | i 1 2 − j 1 2 =|| ρi ρ j (37) ρ i ρ j (40)

w Φ w jΦ min Φ kΦ k'Φ kΦ (k − )1 Φ Φ Φ v min ≤ = min i − j |≤ i − j = j = min ρ j ρ j ρmin ρ i ρ j ρ i ρ j ρ j ρ min

When v>1, if: When,

wv−1Φ min wv Φ min kΦ k'Φ ≥ i ≤ j ρ ρ i j ρ i ρ j then: we have:

Senti (t1 ,t2 ) Sentj (t1 ,t2 ) Sent (t ,t ) Sent (t ,t ) | − | | i 1 2 − j 1 2 =|| ρ ρ i j (38) ρ i ρ j (41)

wv−1Φmin wvΦmin wv−1Φmin wvΦmin Φmin kΦ k'Φ k'Φ (k'− )1 Φ Φ Φ = − ≤ − < i − j |≤ j − i = i = min ρi ρ j ρv−1 ρ j ρmin ρ i ρ j ρ j ρ i ρ i ρ min

If: Combining (40) and (41), we get FM≤ . The w Φ w Φ theorem is proved. v−1 min ≤ v min From Theorem 3 and 4, we can see that both ρ i ρ j SMRR and WRR schedulers have FM≤ . The then: reason is that there is a special case mentioned above, namely all the n flows have the same weights, at which both SMRR and WRR schedulers have the same FM. Senti (t1,t2 ) Sentj (t1,t2 ) | − | Nevertheless, when flows have different weights, ρ ρ i j (39) SMRR scheduler has better fairness than WRR, which

wv Φmin wv−1Φmin wj Φmin wv−1Φmin Φmin can be derived by comparing (37)(39) with (40)(41). = − ≤ − < ρ j ρi ρ j ρi ρmin For example, in (38), we have:

w Φ w Φ Φ w Φ w Φ Combining (37), (38) and (39), we get FM≤ . v−1 min − v min = min − v min = 1( − v ) min ρ ρ ρ w ρ w ρ The theorem is proved. Next, analyzing the fairness v−1 j min j min j min of WRR: (42)

The result of (42) is less than absolutely. Theorem 4: The WRR schedulers have FM≤ .

Proof: Consider any two flows i and j that are IMPLEMENTATION COMPLEXITY continuously backlogged in a time interval (t 1, t2). Let k be the number of service opportunities given to flow i Implementation complexity is also an important index to evaluate a scheduling algorithm besides in interval (t 1, t2) and let k΄ be the number of service opportunities given to flow j in the same interval, then latency and fairness. Since a scheduling algorithm is |k k΄|≤1, namely k΄≥k1 and k≥k΄1. Thus, wanted to be implemented in highspeed networks generally, implementation complexity of a scheduling When, algorithm will affect its practical application. In addition, it is better that the implementation complexity does not depend on the number of the active flows. kΦ k 'Φ i ≥ j When a SMRR scheduler serves n flows, its ρ i ρ j implementation complexity is defined as the order of the time complexity, with respect to n, of enqueuing we have: and then dequeuing a packet for transmission. 2055

Res. J. Appl. Sci. Eng. Technol., 7(10): 20462057, 2014

Theorem 5: The implementation complexity of a REFERENCES SMRR scheduler is O (1). Bennett, J.C.R. and H. Zhang, 1996. WF2Q: Worst Proof: The theorem will be proved if we can prove that case fair . Proceedings of enqueuing and dequeuing a packet are each of time IEEE 15th Annual Joint Conference of the IEEE complexity O (1). Computer Societies. Networking the Next When a new packet arrives, enqueuing process of Generation (INFOCOM '96). San Francisco, CA, SMRR is executed. The operations include: pp: 120128. determining the queue at which the new packet arrives Cao, C., Y. Zhang and R. Chen, 2010. UWRR: A novel and it is an O (1) operation. If the flow to which the scheduling algorithm for selfsimilar multiservices new packet belongs is not already in the Active Flow in optical packet switching network. Proceedings List, it will be added to the end of the list. This addition of the 2010 Symposium on Photonics and is also an O (1) operation. Optoelectronic (SOPO 2010). Chengdu, China, pp: Now analyzing the time complexity of dequeuing a 14. packet. Since SMRR scheduler transmits at least one Demers, A., S. Keshav and S. Shenker, 1998. Design packet during each service opportunity given to a flow, and analysis of a fair queuing algorithm. the time complexity of dequeuing a packet is equal to or Proceedings of the ACM SIGCOMM. Austin, pp: less than the time complexity of all the operations 112. performed in euqueuing process of SMRR during each Golestani, S.J., 1994. A selfclocked fair queuing service opportunity. These operations involve: scheme for broadband applications. Proceedings of determining the next flow to be served; removing a IEEE INFOCOM’94. Toronto, pp: 636646. flow from the head of the Surplus Flow List and Goyal, P., H.M. Vin and H. Cheng, 1997. Starttime possibly adding a flow back at the tail. All of these fair queueing: A scheduling algorithm for integrated services packet switched networks. operations on a list can be finished in O (1) time. In IEEE T. Network., 5(5): 690704. addition, each service opportunity involves updating the Guo, C., 2001. SRR: An O (1) time complexity packet values of Visit Flow Count, Packet Number Count and scheduler for flows in multiservice packet Surplus Weight. All of these operations can be executed networks. Proceedings of the 2001 SIGCOMM. in constant time, therefore the time complexity of San Diego, CA, pp: 211222. dequeuing a packet is O (1). The theorem is proved. He, M., D. Zhao and L. Bao, 2012. An energy

efficiency polling access control protocol for CONCLUSION wireless sensor networks. CAAI T. Intell. Syst., 7(3): 265270, (Chinese). In this study, we have presented an improved Hemant, M. and U. Madhow, 2003. Fair scheduling version of weighted roundrobin called Successive with tunable latency: A round robin approach. Minimalweight Round Robin (SMRR). A primary IEEE/ACM T. Network., 11(4): 592601. round consists of one or more secondary rounds and in Hu, H., Y. Peng and Y. Guo, 2008. A fair service and every round each flow always gains the equivalent dynamic round robin scheduling algorithm. service opportunities to the least weight of the current J. Software, 19(7): 18561864, (Chinese). round. Firstly, we prove the relevant theorems to Lin, D., Y. Jiang and M. Hamdi, 2011. Selective determine the upper bound on latency of SMRR and request roundrobin scheduling for VOQ packet WRR; hereinto the latency upper bound of WRR is switch architecture. Proceedings of the IEEE smaller than that derived in other literature. Then, we International Conference on Communications discuss the fairness of SMRR and WRR. As a result of (ICC), pp: 15. comparative analysis, it shows that SMRR almost Pan, C. and J. Zhang, 2012. An improved queue always has better latency property and fairness than scheduling algorithm based on WRR. WRR. We also prove that the implementation Telecommun. Inform., 1: 3437, (Chinese). complexity of SMRR is O (1). Therefore, it can be Parekh, A.K. and R.G. Gallager, 1992. A generalized easily implemented in highspeed networks with large processor sharing approach to flow control the number of flows and carry out fair and efficient packet single node case. Proceedings of INFOCOM’92. scheduling. Florence, pp: 915924. Shreedhar, M. and G. Varghese, 1996. Efficient fair ACKNOWLEDGMENT queueing using deficit roundrobin. IEEE T. Network., 4(3): 375385. This study is supported by the S&T Plan Projects Stiliadis, D. and A. Verma, 1998. Latencyrate servers: of Hunan Province (No. 2010GK3045), Scientific A general model for analysis of traffic scheduling Research Fund of Hunan Provincial Education algorithms. IEEEACM T. Network., 6(5): Department (No. 10C0687). 611624. 2056

Res. J. Appl. Sci. Eng. Technol., 7(10): 20462057, 2014

Xiong, L. and S. Zhang, 2012. The optimization of the Zhang, X., G. Ni and F. Jin, 2011. A new WRR WRR algorithm in multiclass realtime data algorithm based on ideal packet interval time. scheduling. Comput. Eng. Sci., 34(7): 3538, Proceedings of the International Conference on (Chinese). Intelligent Computation Technology and Zhang, L., 1990. Virtual clock: A new traffic control Automation (ICICTA). Shenzhen, China, pp: algorithm for packet switching networks. 10391042. Proceedings of the ACM Symposium on Communications Architectures and Protocols (SIGCOMM '90). Philadelphia, pp: 1929.

2057