2004:139 CIV

MASTER’S THESIS

A Queueing Theory Analysis of Wireless Radio Systems Applied to HS-DSCH

NIKLAS BRÄNNSTRÖM

MASTER OF SCIENCE PROGRAMME

Department of Mathematics

2004:139 CIV • ISSN: 1402 - 1617 • ISRN: LTU - EX - - 04/139 - - SE A Queueing Theory analysis of wireless radio systems –Applied to HS-DSCH

Niklas Br¨annstr¨om

May 2004

Examiner: Supervisor: Thomas Gunnarsson Arne Simonsson Department of Mathematics Ericsson Research Lule˚aUniversity of Technology Ericsson AB Lule˚a Abstract

This report is a theoretical approach, using queuing systems, to describe delay characteristics of wireless telecommunication systems. In the report we derive the waiting time and total time distributions for two classes of queuing systems, namely G/M/1andM/G/1. We give examples of particular queues belonging to each of these classes and analyse them. We find that the distributions are independent of packet size if the queuing discipline is first come first served, and that the total time distribution of the G/M/1 system is exponentially distributed regardless of the inter arrival process. We also apply the theories to a wireless radio system, HS-DSCH, and compare the theoretical results to simulation results. The M/E2/1 queue (with a constant delay added) is shown to be a good model of HS-DSCH. It also contains an example of how to use the calculated distributions to, given a certain delay tolerance, predict the behaviour of a new service in an existing system. The intended reader of this thesis is assumed to have some background in stochastic processes. Sammanfattning

Idenh¨ar rapporten f¨ors¨oker vi beskriva egenskaper hos f¨ordr¨ojningar itr˚adl¨osa radion¨at utg˚aende fr˚an k¨oteoretiska resonemang. I rapporten h¨arleds v¨antetidsf¨ordelning och totaltidsf¨ordelning f¨or tv˚a klasser av k¨oer, n¨amnligen M/G/1ochG/M/1. Det ges flera exempel p˚ak¨oer, och anal- yser av dessa, ur de b¨agge klasserna. De mest intressanta resultatenar ¨ att f¨ordelningarnaar ¨ oberoende av paketstorleken om k¨odisciplinenar ¨ f¨orst in f¨orst ut, och att totaltidsf¨ordelningen av G/M/1 systemetar ¨ exponen- tialf¨ordelad oavsett hur ankomstprocessen ser ut. Teorierna till¨ampas p˚a ett specifikt radion¨at, HS-DSCH. De teoretiska re- sultaten f¨or detta system j¨amf¨ors med simuleringsresultat, och vi visar att M/E2/1 k¨on (med en konstant f¨ordr¨ojning inkluderad)ar ¨ en bra modell av HS-DSCH. Vi visar ocks˚a, givet ett f¨ordr¨ojningskrav, hur de ber¨aknade f¨ordelningarna kan anv¨andas f¨or att ber¨akna egenskaperna hos en ny tj¨anst i ett befintligt system. Det f¨oruts¨atts att l¨asaren har viss kunskap om stokastiska processer. Prologue

This thesis constitutes the final part of my Master of Science program, Teknisk Fysik (Engineering Physics), at Lule˚a university of technology. The assigner of this thesis is Ericsson Research in Lule˚a, a part of Ericsson AB. I want to thank my supervisor Arne Simonsson for his great help with this thesis. His ”hands-on” knowledge of these systems is profound. He has also guided me through the jungle of three and four letter abbreviations of digerent radio standards, protocols and systems, helping me to get to the core of what I needed. I also wish to thank the rest of the stag at EAB/TBF for their occasional remarks, thoughts and encouragements. I would like to thank my examiner Thomas Gunnarsson, head of the mathematics department, for his useful remarks along the way. However busy, when needed, he has always managed to find gaps in his calendar. A I also appreciate the L TEX hints I have received from my fellow student Erik Astr¨˚ om. I am also very thankful for the hours Petri Juuso, at TietoEnator, spent restoring the contents of this thesis after my computer had broken down. Contents

1Introduction 5

1.1Theradioenvironment...... 7 1.1.1 HS-DSCH (High Speed Downlink Shared CHannel) . . 8 1.2OutlineoftheReport...... 8

2 Setting of the Problem 10 2.1GeneralProblem...... 10 2.2TheProblemstudied...... 11

3 Theory of Queues 13 3.1Notation...... 14 3.2KendallNotation...... 15 3.3M/G/1FCFS...... 17 3.3.1 M/M/1FCFS...... 19 3.3.2 M/Eq/1FCFS...... 20 3.3.3 M/Hq/1 ...... 23 3.3.4 M/D/1...... 26 3.4G/M/1...... 27 3.4.1 M/M/1FCFS...... 28 3.4.2 Eq/M/1FCFS...... 28 3.4.3 U/M/1FCFS...... 29 3.4.4 Hq/M/1FCFS...... 29 3.4.5 D/M/1FCFS...... 30 3.5M/M/1Round-Robin...... 30 3.6Queuingdisciplines...... 31 3.7ConstantDelay...... 31

4Analysis 32

4.1M/G/1FCFS...... 32 4.1.1 M/M/1FCFS...... 33 4.1.2 M/E2/1FCFS...... 38 4.1.3 The M/Eq/1familyofQueues...... 38 4.1.4 M/Hq/1 ...... 42 4.2G/M/1FCFS...... 45

3 4.2.1 Eq/M/1...... 45 4.3M/M/1Round-Robin...... 47

5 Application: HS-DSCH (High Speed Downlink Shared CHan- nel) 49 5.1Modelverification...... 49 5.2GeneralResults...... 51 5.3Streaming...... 53 5.4PushToTalk(PTT)...... 55 5.5Otherradioprotocols...... 57

6 Summary 59 6.1Conclusions...... 59 6.2Furtherstudies...... 60 6.3Epilogue...... 61

AAppendix 62 A.1 Classification of Markov Chains ...... 62 A.2PoissonProcesses...... 64 A.3 Derivation of total time distribution of the M/M/1 System . . 65 A.4 Derivation of total time distribution of the G/M/1 System . . 68 A.5 Derivation of total time distribution of the M/G/1 System . . 73

4 Chapter 1

Introduction

Mankind has always communicated with each other. This communication has taken various forms; ordinary conversations, drumbeating, smoke signals, telephone calls, e-mails etc. Common for all of them is that they use a media. Is this media shareable? Or rather, to which extent is the media shareable? For example, it is not possible to send two analogue radio programs on the same frequency (or it would be dicult to listen to them), so in this case the frequency is not shareable. But consider conversations around a dinner table, here multiple conversations may take place at the same time, they share the air. The issue of this report is to find to what extent a radio channel is share- able between the users, with respect to the quality of service they expect. The question at hand is to study how the throughput varies with the toler- able delay on the service. A major part of the radio networks of today are packet switched, like WLAN, GPRS, EDGE, which lends them well to radio channel sharing in order to increase the total capacity in the net. However, each specific service has a certain demand on maximum delay. For example an ordinary telephone call is very sensitive to delay, you do not want to have parts of the call getting stuck in a ”radio trac jam”. Other services though, like ftp downloading on the Internet is not sensitive to delay. In the latter case we can get more capacity from the channel. Compare with a transportation problem: Consider an airplane taking 10 passengers per flight, making 5 flights from A to B daily. Suppose the army wants to send 50 soldiers from A to B and wants them there by the end of the day, then the airplane can fly back and forth moving the soldiers from A to B. Now the capacity of the airline is fully used. Instead suppose that one day 50 businessmen want to fly into B for breakfast meetings. Now the airline can only service 10 of the businessmen. The remaining 40 businessmen, who did not get a seat on the first plane, will stay in A, because they cannot accept arriving several hours later in B. Now the throughput in the airline is only 20%. And the reason is that the businessmen cannot accept delays at the same extent as the soldiers can. What if the businessmen arrive at random

5 occasions at the airport, wanting a seat on the next plane, what would then be the capacity of the airline? To highlight a digerent aspect of a similar problem, consider a store sell- ing5digerent types of items: Item A, B, C, D, E priced 5, 4, 3, 2 and 1 respectively. There is no digerence in the time it takes to sell any of the items. If the customers entering the store can tolerate to wait (for a long time if necessary), and if the store is able to serve all customers before closing time, then the customers can be served in any order (in the natural order most likely). The flow of money into the cashmachine will be maximal any- way. Now suppose the customers cannot wait for more than a quarter of an hour before leaving the store, then the store manager has to rethink. If she wants to maximize her cashflow, then the customers wanting to buy item A should be served first, and then customers wanting to buy item B and so forth, always serving the customer with the most expensive item. Then her cashflow will be maximal, but at the risk of being considered unfair by many of her lost customers. This example shows another dimension of the problems with delay constraints, namely that order of service is important. The main reason for studying the relationship between throughput and delay is to be able to build systems of the right dimensions. If we want to introduce a service that tolerates a maximum delay of d seconds, then with the aid of the relationship we can tell how much capacity is needed in the system. So, knowing the relationship enables us to optimize the system, avoiding on the one hand too long delays and on the other hand overca- pacity (very costly). In this report we attempt to find analytical equations describing the dependence of capacity with respect to delay, and how diger- ent arrival processes to the queuing system agect capacity and delay. This is done using queuing theory and stochastic processes. Having such equations makes it far easier to build ecient systems. There are of course other ways to determine this relationship, simulating the system being the most rational one. However, these alternative methods are much more time consuming and not as accurate as the analytical method. Another downside of simulations is that they are likely to provide results but not much more than that. An an- alytical model also provides a better understanding of the problem. With a better understanding more ecient simulations can be made for non-solvable systems. Analytical models in combination with a thorough understanding of queueing systems will make prediction of capacity in conjunction with new services in existing systems easier. A major advantage of having an analyti- cal model of a problem is the ease with which we can solve for an entire range of a certain parameter, rather than for particular values of it. For example, if we want the required delay d 5 [a, b]. Finding an analytical solution to the problem is very beneficial.

6 1.1 The radio environment

In this section follows a brief description of the radio environment in which the queuing problems of this thesis are set. In mobile telephone systems, there are three major ways to allocate a radio resource:

• FDMA (Frequency Division Multiple Access)

• TDMA (Time Division Multiple Access)

• CDMA (Code Division Multiple Access)

The FDMA is the oldest variant, implemented in for example NMT. Here each user is allotted a certain frequency (channel), which the user, and this user only, ”owns” during the entire session. The TDMA systems are more advanced, and are implemented in GSM and PDC, both second generation mobile systems. The idea with TDMA is that the users no longer ”own” the frequencies, but share them with other users. This is done in a determin- istic way using time slots, the user is allotted a certain frequency (channel) and furthermore is allotted time slots on this frequency. This is a more ef- ficient way to use the radio resources. CDMA is also a second generation mobile system technique, but also the platform for the third generation mo- bile system WCDMA (Wideband CDMA), which significantly enhances the capacity. Here the main idea is to encode everything that is being transmit- ted and then the base station can direct the trac to the receiver with the aid of the code (like address tags), and finally the receiver decodes the mes- sage. Since the users can transmit at the same time it is important that the base station controls the egect with which they send, so that each signal has the same signal strength at the base station. Otherwise some (closeby) users would make so much noise that some other user’s (distant) signals would drown in it. In CDMA the code is used to spread the data over the bandwidth when transmitting and the code is used again when receiving the data. This coding leads to something called processing gain, i.e. the amplitude of the correct signal is increased by the spreading factor (when decoded), while other in- terfering signals (or noise) are not amplified when decoded. An interesting property following from this is that the transmitted signal’s egect can be below the thermal noise level. The processing gain also enables the carrier frequency to be reused in cells at closer distance, than otherwise would be possible, since the system is less sensitive to interference. The signal to in- terference ratio is abbreviated and denoted C/I. The C/I value is a measure of the channel conditions. In WCDMA the carrier bandwidth is increased to about5MHz(4.4to5MHzduetopossibleinterferencebetweencarriers). The WCDMA system also has 10 ms long time frames, in which each user has a constant bit rate. The bit rate may vary from time frame to time frame though. Thus WCDMA has adaptable bit rates.

7 The very first release of WCDMA has data rates of up to 2 Mbit/s and supports both packet and circuit switched services. In the latest release, Rel. 5, the data rate is enhanced and ogers peak data rates of 10 Mbit/s.

1.1.1 HS-DSCH (High Speed Downlink Shared CHan- nel) High Speed Downlink Shared CHannel (HS-DSCH) is a solution which en- hances the data rate in WCDMA. (Downlink is the trac from the base sta- tion to the cellphone). HS-DSCH supports the three principles of fast link adaptation, fast hybrid ARQ (automatic repeat request) and fast schedul- ing. Which according to [6] have these definitions: Fast link adaptation is the process of rapidly adapting the coding format to the instantaneous chan- nel conditions. This optimizes the throughput of the radio channel. Fast hybrid ARQ is, among several things, rapid requests of retransmission of er- roneously received data packets. It keeps the delay of retransmissions down. The scheduling has to be fast since the time frames are of limited length (in this case 2ms). The scheduling takes into account the current radio condi- tions. The spreading factor is 16 and HS-DSCH is allotted a multiple n of n this, i.e. the bandwidth available to HS-DSCH is 16  5Mhz. [6] claims that the maximum throughput is obtained when all radio re- sources are assigned to the user with the best radio conditions. This is achieved by the C/I scheduler, which allows the user with the best radio conditions, at every instant, to transmit. Since the system is working at the maximum possible bitrate every instant the overall throughput is maximized. The major disadvantage with the C/I scheduling is the lack of fairness, a user with constantly poor radio conditions may, in the worst case, never get the chance to transmit. The fairness achieved is based on a belief that the ra- dio conditions of each user varies over time, letting all users transmit within reasonable time. Another way to put it is that the C/I scheduler maximizes the system throughput, but not the user throughput. The remedy is, for example, the round-robin (RR) scheduler, which is fairer. But then there is atradeog between maximum system throughput and fairness. For further reading on WCDMA see [9], and on particularly HS-DSCH see [6] and [12].

1.2 Outline of the Report

The structure of this report is as follows. Chapter 2 is an introduction to and definition of the problem we are to study in this report. In chapter 3 the mathematical theories governing our queueing systems are presented, in particular waiting time and total time distributions. In chapter 4 we analyse the results obtained in chapter 3. The philosophy in chapter 3 and 4 is to begin with simpler models progressing to more advanced ones, allowing for

8 the complexity to build up gradually. Finally we apply the theories to HS- DSCH in chapter 5, where some other radio protocols are also considered. Chapter 6 is a summary containing some conclusions. The Appendix is containing material which is supporting the presentation of the theories in chapter 3. The reader who is not interested in the mathematical background of the queues may skip chapter 3 and address the analysis in chapter 4 right away. The presentation of chapter 4 is not dependent on having read chapter 3 first.

9 Chapter 2 Setting of the Problem

2.1 General Problem

Suppose that we have N users sharing the same radio channel in time. Each user generates packets of data that are being stacked in a queue. When the channel is vacant a packet is picked from one of the queues and is served. After a certain time the channel is vacant again and a new packet is picked from one of the queues, and so on until all the queues are empty. This situation can be depicted as in figure 2.1. The task is to find the total time distribution for the packets being sent through the system. Having this we can determine, lets say, the 99th-percentile for the delay and compare it with the throughput. Thereby claiming that, statistically, 99% of all packets sent would suger at most a delay d [s] and the throughput for them will be  [kbps].

Figure 2.1: Schematic picture of the queuing model. (MAC is an algorithm that schedules the order in which the queues are served)

10 Therearemanyvariablestotakeintoaccount,tomentionafew:The number of users trying to share the channel and the activity of the users. What distribution models their inter arrival times best? Does the same distribution apply to every user, or do they behave digerently? What is the queuing discipline within the queues? What is the distribution of the packet size being sent from the users? What algorithm is the scheduler implementing, i.e. what is the queuing discipline among the queues? At what rate is the service station operating, i.e. what is the service time distribution? Is there an inter departure idle set up time in the service station? Do all users comply to the same delay requirement? In order to find a way through this complex problem some simplifications will be made in the modelling, which is discussed in the next section. The analysis of the following parameters are out of scope of this thesis: Digerent queuing disciplines. Multiple queues, single server systems. Single user behaviour.

2.2 The Problem studied

The problem studied in this report is a simplification of the model in the previous section. We have a system with a single incoming queue (that is, we do not distinguish the users), and the scheduling is first-come-first-served. Inthereportwestudyhowdigerent arrival processes agect the delay, and how digerent server distributions agect the delay. We give an answer to how the delay depends on packet size. We do, however, not distinguish the single users from each other, we just treat their trac as a whole. In real systems there is most often a constant delay present, we include this in the model in the simplest way possible by adding a delay after the server. Thus we end up studying a total time R, which is the sum of the waiting time W,servertime B and constant delay K, R = W + B + K. The queuing system is depicted in figure 2.2. The next thing we study is how valid these simplifications are. In other words, is this simplified queuing system a good model of any real radio sys- tem?

11 Figure 2.2: Schematic picture of the queuing model. (MAC is an algorithm that schedules the order in which the queues are served, here First Come First Served)

12 Chapter 3 Theory of Queues

Queuing theory is a large field within stochastic processes. A lot of research has been made over the years, but nevertheless the area is far from exhausted. The analysis of a model containing all the parameters mentioned in chap- ter 2 is still subject to active research. In this chapter we will begin with outlining some simpler models progressing to more complicated ones. The more complicated models taking care of a larger number of parameters. In the next chapter we investigate the validity of the models presented in this chapter. For further reading on queuing theory see [10], [11] and [17]. For a comprehensive guide to statistical distributions see [4].

The most important results that will be presented in this chapter is; The equations for calculating the waiting time and total time distribution for the M/G/1 queuing system, (3.7) and (3.8) respectively. Further we find the waiting time and total time distribution, as explicit equations, for the G/M/1 queuing system, (3.50) and (3.51) respectively. It is most interesting that the waiting time distribution is exponentially distributed regardless of the inter arrival process! An important but discouraging fact is that it is complicated, or not known how, to find the waiting time distribution for other queuing disciplines than FCFS.

What is a queueing model? A queueing model may be seen as a ”black box”, into which customers enter from one side and departs, after a while, from the other side, as shown in figure 3.1 a). What we are trying to establish in this report is how long ”after a while” is. The first intuitive way to think about a queueing model is an ordinary waiting line in a store. There is a line of customers waiting to served by the cashier, see figure 3.1 b). In general a queueing system can be said to consist of a queue, a server and a set of rules. The rules describe the process that governs the inter arrival times of the customers, the process that governs how fast the server is working, in which order the queuing customers are to be served and the number of potential customers. The Appendix contains preliminaries of queuing theory.

13 Figure 3.1: Schematic picture of a general queue system.

3.1 Notation

The following notation will be used throughout the report.

pdf Probability density function PDF Probability Distribution Function E[X] The expectation value of the stochastical variable X V [X] The variance of the stochastical variable X W(y) Waiting time probability distribution function w(y) Waiting time probability density function R(y) Total time (Response or System time) probability distribution function r(y) Total time (Response or System time) probability density function 4 Load of the system  Throughput of the system 1 b The expectation value of the interarrival time 1 µ The expectation value of the service time

Definition 3.1 The load 4 of a system is the ratio of the expected service

14 time and the expected inter arrival time, i.e.

b 4 = . (3.1) µ

Definition 3.2 The throughput of the system is the mean number of mes- sages served per unit time. The waiting time is the time that a packet spends in the queue. The system time is the time from a packet’s arrival to its departure from the system.

Definition 3.3 The waiting time distribution, i.e. the waiting time PDF, is defined as the probability

W(y)=P[queueing time  y]. (3.2)

3.2 Kendall Notation

There is a special notation, the Kendall notation, for representing queues. A particular queue is denoted

Q1/Q2/Q3/Q4/Q5 Qdisc, (3.3)

where Q1,... , Q5, Qdisc describe the properties of the queue. Q1 denotes the distribution of inter arrival times to the queue. Q2 denotes the distribution of the service time. Q3 denotes the number of servers. Q4 denotes the maximum number of slots in the queue. Q5 denotes the size of the population (potential members of the queue). Qdisc is the queuing discipline that governs in which order the members of the queue are being served. Q1 and Q2 is typically one of the following:

M Exponential distribution (Memoryless) D Deterministic distribution (i.e constant) Er Erlang-r distribution Hr Hyperexponential-r distribution G General distribution

Q3,Q4andQ5canbeassignednaturalnumbersorinfinity.Q4andQ5 may be omitted from the notation. If they are, their values are assumed to be infinity.

15 There is a vast amount of digerent queuing disciplines, we list a few com- mon values for Qdisc below. Qdisc may also be omitted from the notation, then Qdisc is assumed to be FCFS.

FCFS First Come First Served LCF S Last Come First Served RR Round-Robin

In a queue with FCFS discipline, the members of the queue are being served in the order they arrived to the queue. The first member is served first and he gets all the service he requires before the next member is served. In a queue with LCFS discipline, the members are being served in reverse orderoftheirarrival.Thelastmemberisservedfirstandhegetsallthe serviceherequiresbeforethenextmemberisserved. The RR discipline is a little bit more advanced. Here the members of the queue are being served in a FCFS fashion, but they do not get unlimited service time once being served. Instead they only receive a certain quanta of service time, if that is not sucient for them, they have to return to the end of the queue and wait for a new quantum of service time. This kind of scheduling favors members needing less service time, since they have to do no or few loops in the queue. See figure 3.2 for a schematic picture of this queuing discipline.

Figure 3.2: The principle of the Round Robin (RR) queuing discipline. If the server has not completed the job, the packet is placed in the queue again, having to wait for a new quanta of service time.

For example, M/D/2/20/200 FCFS is a queue where the inter arrival time of the customers are exponentially distributed, the time each customer spends with the cashier is deterministically distributed, there are two cashiers, a maximum of 20 customers may be standing in the queue and there are 200 potential customers in the world. Lastly the customers in the queue are served in a first-come-first-served fashion. For the system M/M/1//200 the customer’s inter arrival times are exponentially distributed, the service time is also exponentially distributed, there is only one cashier, the queuelength is

16 unlimited, there are 200 potential customers, and the customers in the queue are served in a first-come-first-served manner.

3.3 M/G/1 FCFS

Ideally we would like to study the G/G/1 system right away, but this is not an easy task. To make things a little simpler, we assume that one of the distributions is exponential (keep one of the ”M”s) and consider M/G/1 and G/M/1. In this section we consider digerent service time distributions, starting with some general results for these systems, then turning to some particular cases. An important result for us, even if it is discouraging, is that for the M/G/1 system it is in general not possible to give an explicit expression of the waiting time- and total time distributions, see [11]. In other words they are not analytically solvable. Anyway, let us consider the M/G/1 system. According to [10] the Laplace transform of the total time in the system is

s(1  4) rW(s)=bW(s) (3.4) s  b + bbW(s) where bW(s) is the Laplace transform of the service time pdf b(y). A derivation of (3.4) is given in Appendix A. The total time spent in the system is equal to the time spent in the queue plusthetimespentintheservicestation,wehavethesimplerelationship

R = W + B (3.5)

where R, W, B is total time, waiting time and service time respectively.

Theorem 3.1 If X and Y are independent stochastic variables, then the following holds for Z = X + Y

Z"

fZ (z)= fX(x)fY (z  x)dx. (3.6)

3"

Proof. See [2] or [10]. With the aid of theorem (3.1) and the convolution theorem for the Laplace transform we obtain

rW(s)=wW(s)bW(s), (3.7) whichinsertedinto(3.4) gives

s(1  4) wW(s)= . (3.8) s  b + bbW(s)

17 Remark 3.1 Why M is realistic. The exponential distribution of inter ar- rival times is very common and realistic. [2] provides the following motivation forthis.WearelookingforthetimebetweeneventsAthatoccurrandomly in time. Suppose that the probability that event A occurs in the domain (t, t + h)isbh + o(h)whereb is the rate. Thus the probability is propor- tional to length of the interval. Let P (t) be the probability that, counted from a certain time T , event A does not occur within time t. Then the probability that no event takes place within the time t + h is

P (t + h)= |P{z(t}) |(1  bh{z+ o(h))}. (3.9) No event takes No event takes place place before t between t and t+h

Subtract P(t)fromeachside

P (t + h)  P (t)=P (t)(bh + o(h)) . (3.10)

Next divide by h and let it go to zero

P (t + h)  P (t) P (t)(bh + o(h)) lim = lim (3.11) h<0 h h<0 h i.e. d P(t)=bP (t). (3.12) dt The solution to this digerential equation is

P (t)=e3bt + C, (3.13) using the condition that P (0) = 1 (no event has occurred at t =0)weget that C =0. Let X be the time, counted from T, until A occurs. Since X>xis equivalent to that no A occurs within time x,countedfromT, we get

P(X>x)=e3bx, (3.14) hence

3bx FX (x)=P (X  x)=1 e . (3.15) ¡ ¢ 1 Thus the time X is exponentially distributed with parameter b . The result is valid for any starting time T .IfwechooseT to be the moment when a packet arrives, the time to the next arrival is exponentially distributed.

18 Figure 3.3: Schematic picture of the queue M/M/1 FCFS

Figure 3.4: Graph of states, the numbers indicate the number of packets in the queue.

3.3.1 M/M/1 FCFS The M/M/1 FCFS queue is the simplest queuing system which is not trivial. The exponentially distributed interarrival time and service time simplifies the calculations a lot. Figure 3.3 and figure 3.4 show two possible ways to depict the system. In figure 3.4 each state represents the number of packets 1 in the queue. b and µ are the rates for transitions between the states (i.e. µ 1 and are the expectation values for the transition time). b TheM/M/1queuehasthefollowingservicetimepdfandPDF ½ b(y)=µe3µy for y  0 . (3.16) B(y)=1 e3µy for y  0 Then µ bW(s)= , (3.17) s + µ which in (3.8) gives

(µ + b)(s + µ) wW(s)= . (3.18) µ(s  µ + b) Inverse Laplace transformation of wW(s) yields

µ + b ¡ ¢ w(y)= B(y)  be(3µ+b)y . (3.19) µ

19 dW Since w(y)= we get dy

W(y)=1 4e3µ(134)y for y  0. (3.20)

Next we solve (3.4) for the total time distribution µ ¶ s(1  4) µ µ  b rW(s)=wW(s)bW(s)= µ ¶ = . (3.21) µ s + µ s + µ  b s  b + b s + µ Inverse Laplace transformation gives the pdf for the total time as

r(y)=µ(1  4)e3µ(134)y for y  0. (3.22)

The corresponding PDF is given by

R(y)=1 e3µ(134)y for y  0, (3.23) 1 which in fact is an exponential distribution with E[Y ]= . µ(1  4) See Appendix A for an alternative derivation of the total time distribution for this system without using Laplace transforms.

3.3.2 M/Eq/1 FCFS

Figure 3.5: The server in a M/Eq/1 system is a series of q exponentially distributed servers each with rate qµ.

The M/Eq/1 FCFS queuing system is another, slightly more sophisti- cated, queuing system. Its server is depicted in figure 3.5. Here the service time distribution is an Erlang-q distribution with pdf

qµ(qµy)q31e3qµy b(y)= ,y 0, (3.24) (q  1)!

20 1 N where µ is the expectation value of the distribution and q 5 aparameter. This pdf is plotted for a few digerent values of q in figure 3.6. Note that by letting q $4the Eq distribution converges to the unit impulse function 1 B(y  ), which is the pdf for a deterministic stochastic process. Further, µ note that for q =1,i.e. E1 distribution, we have the ordinary exponential distribution. The variance of the Erlang q-distribution is 1 V [X]= . (3.25) qµ2

When q = 2 we find the total time PDF using the Laplace transformation, analogous to the M/M/1 case. The pdf is in this case b(y)=2µ(2µy)e32µy,y 0, (3.26) and its Laplace transform is 4µ2 bW(s)= . (3.27) (s +2µ)2 Insertion of (3.27) into (3.4) yields the Laplace transform of the total time 4µ(µ  b) rW(s)= . (3.28) s2 +4sµ +4µ2  bs  4bµ By inverse Laplace transformation and integration we obtain this expression for the total time PDF µ ³s ´ q 1/2 8 µ+ 2+4 µ y R(y)=8µ µe3 b b 3b 8 b µ + b2+ ³ ´ s 2 +4 e31/2 8 b µ+b +4 µ3b yµ2 ³s ´ 1/2 8 µ+ 2+4 µ y 5 µe3 b b 3b b ³ ´ q s 2 µe1/2 8 b µ+b 34 µ+b y 8 b µ + b2 ³s ´ 1/2 8 µ+ 2 4 µ+ y 4 e b b 3 b µ2 ³s ´ 1/2 8 µ+ 2 4 µ+ y +5 µe b b 3 b b (3.29) ³s ´ q 1/2 8 µ+ 2+4 µ y +b e3 b b 3b 8 b µ + b2 ³s ´ 1/2 8 µ+ 2+4 µ y +e3 b b 3b b2 ³s ´ q 1/2 8 µ+ 2 4 µ+ y +b e b b 3 b 8 b µ + b2 ³ ´ s 2 1/2 8 b µ+b 34 µ+b y 2 e p pb ´ 2 b (b +8µ)b +2 b (b +8µ)µ / µ ¶µ ¶ p q q b (b +8µ) 8 b µ + b2 +4µ  b 8 b µ + b2  4 µ + b .

21 For q = 3 this system is still analytically solvable. According to (3.24) the pdf for the service time is

3µ(3µy)2e33µy b(y)= , (3.30) 2! with Laplace transform

27µ3 bW(s)= . (3.31) (s +3µ)3

Using this expression in (3.4) yields

27µ2(µ  b) rW(s)= . (3.32) s3 +9s2µ +27sµ2 +27µ3  bs2  9sbµ  27bµ2 In order to find the inverse Laplace transform we have to find the roots of the polynomial in the denominator, i.e. solve

s3 +9s2µ +27sµ2 +27µ3  bs2  9sbµ  27bµ2 =0. (3.33)

Since this is a third order equation it is solvable. We first have to eliminate the second order term in the equation, which is accomplished by the change of variables (9µ  b) s = x  , (3.34) 3 yielding µ ¶ µ ¶ b2 2 x3 + x   3µb + 9bµ2  µb2  b3 = x3 + px + q =0, 3 27 (3.35) where µ ¶ b2 p =   3µb and µ 3 ¶ 2 q = 9bµ2  µb2  b3 . (3.36) 27

Let x = u + v and insert this in (3.35) to obtain

u3 + v3 +(u + v)(3uv + p)+q =0, (3.37) assuming 3uv + p = 0 gives the following system of equations ½ u3 + v3 + q =0 (3.38) 3uv + p =0.

22 The solution is ; r q A 3 2 3 2Zik A q q p 3 ? u =  2 + 4 + 27 e r q (3.39) A 3 q q2 p3 2Zik =A 3 3 v =  2  4 + 27 e k =0, 1, 2.

Having found u and v, we easily obtain the roots s of (3.33) by back- substitution. Real solutions exist, but the closed expression of the distri- bution is, however, hard to find. It is easier to find numerical solutions in each specific case.

Remark 3.2 The Erlang-q distribution was invented by A.K. Erlang, a Dan- ish mathematician and pioneer in queueing theory and its application to telecommunication systems, active in the beginning of the 20th century. At this time imbedded Markov chain analysis was not known and the Marko- vian properties of the exponential distribution was very nice when it came to solving queueing problems. But this distribution has a drawback, it does not model all real life occurring processes that well. So, Erlang invented his distribution, based on exponential distributions but able to approximate empirical distributions. If the mean and variance of an empirical distribution was known it was easy to fit a suitable member of the Erlang distributions 1 1 with mean µ and variance qµ2 .

3.3.3 M/Hq/1 Now let us consider server time distributions of the form Xq 3µiy b(y)= kiµie ,y 0(3.40) i=1 where Xq ki =1. (3.41) i=1 This pdf is a sum of q exponential distributions, and we may view the server as in figure 3.7, i.e. each customer chooses the exponentially distributed server with rate µi with probability ki. The distribution is called a hyperex- ponential distribution and is denoted Hq. This distribution is of particular interest due to its large variance à ! Xq Xq 2 k k V [Y ]=2 i  i . (3.42) µ2 µ i=1 i i=1 i

23 Figure 3.6: Some members of the Erlang-q family of distributions.

Figure 3.7: The server in a M/Hq/1 system consists of q exponential servers, where the probability that a packet is served by the server with rate µi is ki.

24 Consider the expression à ! à ! q q ³ ´ q s q 2 X X X 2 Cauchy X ki (3.41) s 2 ki ki 2 1 2 = ki 2  =(E[Y ]) = 2 , µ µ Inequality µ µ i=1 i i=1 i=1 i i=1 i hence à ! Xq Xq 2 k k 1 1 1 V [Y ]=2 i  i  2  = . (3.43) µ2 µ µ2 µ2 µ2 i=1 i i=1 i Thus the variance of the hyperexponential distribution is always larger than 1 the variance of the exponential distribution (assuming both to have E[Y ]= µ 1 ) V [Y ]exp = µ2 . As usual, we use equation (3.4) , (3.7) and (3.8) to obtain the waiting time and total time distributions. For example if we consider the H2-distribution µ ¶ 3 15µ 15µy 7 b(y)= e3( 43 ) + (5µ) e35µy, (3.44) 10 43 10

25 we obtain 216075 1 R(y)= p  (3.45) 2 2 ³ p 11222500  115240 b +1849b  134 11222500  115240 b +1849b2 p 2 8 b 11222500µ  115240 b +1849b ¶ 1 s 2 172 2 112225003115240 b+1849 b 37705+86 b y +89780 e µ ¶ 1 s 2 3 172 2 112225003115240 b+1849 b +7705386 b y 89780 eµ ¶ 1 s 2 172 2 112225003115240 b+1849 b 37705+86 b y +4pb e  2  11222500µ  115240 b +1849b ¶ 1 s 2 172 2 112225003115240 b+1849 b 37705+86 b y p67 e  2  11222500µ 115240 b +1849b ¶ 1 s 2 172 2 112225003115240 b+1849 b 37705+86 b y 23249 e µ ¶ b 1 s 2 172 2 112225003115240 b+1849 b 37705+86 b y 2 +1068 e µ ¶ b 1 s 2 3 172 2 112225003115240 b+1849 b +7705386 b y +4pb e  2  11222500µ  115240 b +1849b ¶ 1 s 2 3 172 2 112225003115240 b+1849 b +7705386 b y p67 e  2  11222500 µ 115240 b +1849b ¶ 1 s 2 3 172 2 112225003115240 b+1849 b +7705386 b y +23249 e µ ¶ b! 1 s 2 3 2 112225003115240 b+1849 b +7705386 b y 1068 e 172 b2  ³ p ´ 31  2 11222500  115240 b +1849b2 +7705 86 b  ³ p ´ 31  2 11222500  115240 b +1849b2  7705 + 86 b . Remark 3.3 When fitting an Erlang distribution to an empirical distribu- 1 tion, the variance had to be lower than µ2 . The Hyperexponential distribution solved this problem, still based on the exponential distribution, but with a 1 variance larger than µ2 .

3.3.4 M/D/1 This system has a deterministic server, i.e. the server times always have the same length. In other words the PDF is ½ 0ifyK

26 where H(y) is the Heaviside function. The pdf is given by d b(y)= B(y)=B(y  K). (3.47) dy The variance of this distribution is naturally 0, Z" Z" def V [Y ] = (y  µ)2b(y)dy = (y  K)2B(y  K)dy =0. (3.48)

3" 3" With this server distribution we encounter a problem when we try to solve (3.4) in order to find the total time distribution. Numerical solutions exhibit instability, in particular for higher loads. [5] claims to have found a solution without this deficiency for the M/D/c system. In the beginning of the 20th century Erlang presented an integral equation, the solution of which is the waiting time distribution of the M/D/1system.

3.4 G/M/1

Now we shift our attention to the arriving process and let the server be expo- nentially distributed. In this section we consider arbitrary arriving process under the assumption that the arrivals are independent. Let the interarrival 1 time distribution A(y) be an arbitrary PDF with E[A(y)] = , and let the b 1 expectation value of the service time PDF be . The system is ergodic if µ b 4 = < 1, where ergodic means that the system converges to an asymp- µ totic solution (see Appendix A). If the system is ergodic then the functional equation j = aW(µ  µj), (3.49) where aW(s) is the Laplace transform of a(y), has a unique solution j 5 [0, 1[. Having determined this solution of (3.49) the waiting time PDF and the total time PDF are given by, see [10] and [1] respectively,

W(y)=1 je3µ(13j)y,y 0, (3.50)

R(y)=1 e3µ(13j)y,y 0. (3.51) The main diculty of obtaining these PDFs is to find the solution of (3.49) . A slight aid is to note that j = 1 is always a solution (though not the one sought). In the particular case, numerical methods are of course available. By the form of (3.50) and (3.51) we see that the waiting time and the total time is exponentially distributed, regardless of the interarrival time distribution! The interarrival time distribution only agects the value of j. Equation (3.50) isderivedin[10]andinAppendixA.

27 3.4.1 M/M/1 FCFS If the interarrival time PDF is an exponential distribution, i.e. A(y)=1 e3by,y 0 3by a(y)=be ,y 0 (3.52) b aW(s)= , s + b then, according to equation (3.49) , we have to solve b j = (3.53) µ  µj + b to find the total time PDF. Rewriting equation (3.53) as (j  1)(µj  b)=0, (3.54) b we find that the solution we are seeking is j = = 4, since 0  4 < 1. Then µ (3.50) and (3.51) give W(y)=1 4e3µ(134)y,y 0 (3.55) R(y)=1 e3µ(134)y,y 0, which is equivalent to (3.20) and (3.23) , as expected.

3.4.2 Eq/M/1 FCFS If the interarrival time distribution is an Erlang-2 distribution then the PDF and its Laplace transform are given in (3.26) and (3.27) respectively. To obtain the waiting time and total time distributions we have to find our j, i.e., using (3.49), solving 4b2 j = . (3.56) (µ  µj +2b)2 The solutions are

j1 =1 p µ 8µb + µ2 2b + + 1 1s j = 2 2 =24 + + 84 +1 , (3.57) 2 µ 2 2 1 1s j =24 +  84 +1 3 2 2 where j3 is the solution we are seeking, since 0  4 < 1 implies that 0  j3 < 1. Hence, by (3.55) , p 1 1 I 1 1 µ(1 (2 + 8 +1))y W (y)=1 (24 +  84 +1)e3 3 4 2 3 2 4 ,y 0(3.58), 2 2 and 1 1 I µ(1 (2 + 8 +1))y R(y)=1 e3 3 4 2 3 2 4 ,y 0. (3.59)

28 For any q 5 Z+, andaslongas0< 4 < 1, the system is ergodic (see Appendix) and a solution of (3.49) exists. With increasing q it is harder to find a closed expression for j,sonumericalmethodstosolveforj are more straightforward.

3.4.3 U/M/1 FCFS Here we consider a uniformly distributed interarrival time (hence the U in the title). Let the interarrival pdf be

b 2 a(y)= , 0  y  , (3.60) 2 b 1 because then E[Y ]= . Its Laplace transform is b 2s 3 b 1  e b aW(s)= . (3.61) 2 s Now, according to (3.49), the functional equation to be solved is

2(µ µ ) 3 3 j b 1  e b j = , or (3.62) 2 µ  µj 1 j 32 (13j) 2 (1  j)=1 e 4 . (3.63) 4 It is easily verified that j = 1 is a root, but determining the other roots analytically is not an easy task. In chapter 4 we will need the total time distribution for the U/M/1 system, and we will use numerically determined roots of equation (3.63) there. Once the right j is found the sought distri- butions are given by (3.50) and (3.51) .

Remark 3.4 Uniformly distributed inter arrival times is more of theoretical interest than practical use.

3.4.4 Hq/M/1 FCFS Since a hyperexponential distribution may be chosen with an arbitrarily large variance it is an interesting distribution to use as an arriving process. The Laplace transform of the pdf is inserted into (3.49) which is then solved for j to obtain the total time distribution. If we apply this method to the H2-distribution given in (3.44) we find the total time distribution, via (3.51), µ I ¶ 1 115 40000 2 6880 +1849 3µ 3 4 + 4 3 4 y R(y)=1 e 2 43 86 ,y 0. (3.64)

29 3.4.5 D/M/1 FCFS Deterministic interarrival times are much easier to handle than deterministic server times. Let the arrival process’ pdf be 1 a(y)=B(y  ),y 0, b > 0. (3.65) b The Laplace transform is s 3 aW(s)=e b . (3.66)

Inserting this into (3.49) gives

µ3µj 1 3 3 (13j) j = e b = e 4 . (3.67) This is a fixed point problem which is easily solved numerically by iteration. Having found 0 < j < 1 the total time and waiting time distributions are given by (3.51) and (3.50) .

3.5 M/M/1 Round-Robin

Round Robin is a much more realistic queuing discipline for radio systems than First Come First Served. However it turned out that RR is also much more dicult to handle mathematically than FCFS. I have not managed to find any article where the explicit total time distribution for the M/M/1 RR system is either derived or presented. In [3] the Laplace transform of the waiting time distribution conditioned on service time is derived. If the service time required by the packet is then the Laplace transform of the waiting time is

2 3b(13r) W (1  4)(1 4r ) e w (s| )= 2 (3.68) 2 µ (134r ) (1  4r)  4(1  r)2e3 r where r is the smaller root of

br2  r(b + µ + s)+µ =0. (3.69) To find the waiting time distribution we first have to take the inverse Laplace transform of (3.68)

w(x| )=L31 {wW(s| )} . (3.70)

Next we use the definition

def. fX,Y (x, y) fX|Y (x|y) = , (3.71) fY (y)

30 which gives us

wX,T (x, )=w(x| )fT ( ), (3.72) where fT ( ) is the pdf of the service time required by the packets. Then we have to integrate over to obtain the marginal pdf of the waiting time distribution

Z" Z"

wX(x)= wX,T (x, )d = w(x| )fT ( )d . (3.73) 0 0 Lastly we integrate over x to obtain the desired PDF of the waiting time distribution, i.e.

Z"

WY (y)= wX(x)dx. (3.74) 0 The expectation value of the total time is, see [3], 4 E[Y | ]= . (3.75) 1  4 3.6 Queuing disciplines

To change the queuing discipline from FCFS makes the analysis more com- plicated, especially for queues where the packets are allowed to overtake each other. A major obstacle then is that the queuing time of each packet is no longer independent of the packets that arrive after itself. A possible way to circumvent these problems might be to approximate the distribution instead of calculating it exactly, as suggested in [13]. [13] also stresses the impor- tance of finding the total time distribution instead of the mean value, since the users experience their own total time not the mean total time. In [16] Takagi derives explicit expressions for mean message total time and mean message total time conditioned on the message length for a system with N incoming queues, each with exponential arrivals of geometrically sized packets, and a deterministic server with constant delay.

3.7 Constant Delay

The empiricism says that constant delays are present in the radio systems, for example there might be a set up time (idle period) in the server before it can handle the next packet or perhaps the scheduler has an idle period. This constant delay is included in the model in the simplest way possible; to each packet’s total time we add a constant, see figure 2.2.

31 Chapter 4

Analysis

We begin by listing some of the interesting results found in this chapter. The waiting time and total time distributions of the queuing systems studied show thattheyareindependentofthepacketsize,whenthequeueingdisciplineis first come first served. We also show that the lower variance the server has the better the slowest users perform, something which is not in general true for the fastest users. On the other hand, if we alter the inter arrival process, the lower the variance of the inter arrival times the higher the bitrates become for all users, regardless of load and if the users are fast or slow. In chapter 5 the queuing theories are benchmarked with a simulated radio system, HS-DSCH, with fairly good results.

4.1 M/G/1 FCFS

In this section we analyse the models presented in chapter 3. A first general observation is that the packet size agects neither the waiting time nor the to- tal time that each bit spends in the system. (Naturally the packet size agects the value of the rate if it is measured packets/s, but not if it is measured in bits/s). This result comes from the fact that a change in packet size changes both the inter arrival process and the serverprocess. The average server rate Average server rate in bps and arrival rate are defined as µ = packet size =numberofpackets rate in bps servedperunittime,andb = packet size = number of arrival (packets) per unit time (which depends on the packet size). So, changing the packet size changes both processes, which may be represented as in figure 4.1. Note that this observation is made for the FCFS queuing discipline.

Remark 4.1 From this observation it is not possible to draw the conclusion that queuing discipline does not agect bitrate (i.e. waiting time). It would be tempting to say; Since the bitrate is independent of packet size, let each packet be 1 bit, then it does not matter in which order we serve the packets from the queue, the rate is still the same. The error in this argument is that the very distribution we make this observation from is in fact derived for

32 Figure 4.1: Realisation of the process for a) packet size = p and b) packet size =2p. The intensities in the events (both arrivals and departures) changes with a factor two. a certain queuing discipline, FCFS. If the queuing discipline is altered the distribution itself will change, and hence the bitrates too.

4.1.1 M/M/1 FCFS Since the M/M/1 FCFS queuing system is the easiest non-trivial system, there is an abundance of information available. We will therefore use this system as a reference when evaluating the other models. Equation (3.23) is the PDF of the total time spent in the M/M/1 FCFS system. If we make the assumption of a constant packet size, say 1500 bits/packet, and that the 64000 bitrate at the server is 64000 bps, then µ = 1500 packets/s. If we want 90% of all packets to have a delay that is shorter than d seconds, then we get the corresponding capacity for the 90th percentile as in figure 4.2. We see that if we require delays to be shorter than about 0.5 seconds then the throughput is dramatically reduced. In other words it is very expensive to guarantee delays below a certain value.But the distribution is independent of packet size, hence we may normalize the delay with respect to the packet 1 size, obtaining figure 4.3.Next we study how The total time spent in the system , i.e. packet rate, varies with load, see figure 4.4. The 90th percentile represents the lowest bitrate that 90% of the packets have. The 10% fastest packets have significantly higher packet rate than the rest of the packets, this is due to the exponential form of (3.23) . Are the percentiles linearly proportional to the median? That is, do there exist constants f10,f90 such that

The 90th percentile=f90  The 50th percentile, (4.1) where f90 is independent of load? (Analogous for f10). If the answer is positive, we only have to find the median of the system and then we get the other percentiles for free. This might simplify the calculations. From the PDF we obtain f10,f90 as in figure 4.5, i.e. they are independent of load.

33 Figure 4.2: Throughput as a function of the tolerated delay. 90th percentile.

This result is, in this case, easily verified analytically. By using equation (3.23) we find the total time for the P:th percentile as ¡ ¢ P ln 1  100 yP = , (4.2) µ(1  4) where 0  P<100. To find the ratio fP defined in equation (4.1) we form 1 yP ln(1¡  0.5)¢ fP = 1 = P , (4.3) y50 ln 1  100 which is independent of the load 4. To show what the egect the value of the service rate µ has, we consider figure 4.6. Here the load is constant and the figure reveals that µ only egect the absolute value of the percentiles, not its behaviours. In figure 4.4 we observe an interesting property with statistical queuing models like M/M/1, for low loads the 10th percentile has a very large bitrate compared to the average server rate. I.e. some packets are transmitted very fast, too fast perhaps, according to the model. From equation (4.2) we obtain the formula for the P:th percentile as

1 ¡µ(1  4)¢ = P . (4.4) yP ln 1  100 With 4 =0wehave 1 ¡ µ ¢ = P . (4.5) yP ln 1  100

34 Figure 4.3: 90th percentile of M/M/1 queueing system. Normalized through- put (as a fraction of serverrate) as a function of normalized delay (delay of packet / packet size).

Figure 4.4: Bitrate as a function of load. 10th, median and 90th percentiles. The bitrate is presented as a ratio of the mean serverrate µ.

35 Figure 4.5: The 10th and 90th percentile’s ratio of the median in the M/M/1 FCFS system.

Then considering the 10th percentile we have P=10 and the bitrate is given by 1 ' 9.5µ, (4.6) y10 that is the bitrate for the fastest 10 percent is at least 9.5 times the av- erage server rate. This might be a drawback if we endeavor to model a non-exponential process with the much simpler M/M/1 configuration. From equation (4.5) we also see that the mean rate is obtained for the 63.2 per- centile, since ln(1  P )=1 for P=0.632. In many real queuing systems there is a constant delay present, which is often the case for radio networks. Here we are presenting some results for a M/M/1 + Constant Delay queueing system. Assume that the average server 3 0.3 rate is µ. Then we add a constant delay of µ s/bit and µ s/bit respectively, then we obtain the results shown in figure 4.7 and figure 4.8, where the 1 quotient Constant Delay is also plotted to provide a bound. In the figures we see that the constant delay has its largest impact on low loads. The constant delay also agects the fastest (those who have shortest delay) 10th percentile most. This reduces the problem with the previously mentioned problem with too high bitrates for the fastest 10th percentile. In figure 4.7 K  µ =3and in figure 4.8 K  µ =0.3, where K is the constant delay, in the first case the constant delay is the solely dominating factor for low loads, the upper bound 1 Constant Delay is almost reached.

36 Figure 4.6: Packet rate as a function of service rate µ under constant load 4 =0.5.

3 Figure 4.7: M/M/1 FCFS, with a constant delay of K = µ s/bit.

37 0.3 Figure 4.8: M/M/1 FCFS, with a constant delay K = µ s/bit.

In figure 4.9 the 90th percentile (the slowest 10 percent) is shown for various constant delays, µ  K varies between 0 and 60. The higher the constant delay the more dominating it gets.

4.1.2 M/E2/1 FCFS We do the same analysis for this system as the M/M/1 system. First we study how the delay is connected to the throughput (assuming no transmission errors), with average server rate µ see figure 4.10. This curve has the same characteristics as in the M/M/1 case, but the delay times are shorter for a given throughput. In the figure the delay curve of the M/M/1 system is plotted for reference. The bit rate dependence of load is shown in figure 4.11. Now we observe a digerence from the M/M/1 queue, refer to figure 4.4, the percentiles are no longer linearly dependent of 4.Cantheratiof90, defined in (4.1), be independent of the load as before? Figure 4.12 shows that this is not the case. From this figure several conclusions may be drawn; for the 10th percentile f10 has a large range, but for certain values of 4 (here 0 < 4 < 0.5) f10 is close to constant. Furthermore, the 90th percentile, which in general is the most interesting one of the ones displayed, has a small range for the entire range load 4.

4.1.3 The M/Eq/1 family of Queues

In this section we are going to study the behaviour of queues with Erlang distributed servers, M/Eq/1 queues. (Remember that the M/M/1 queue is

38 Figure 4.9: M/M/1 FCFS. The 90th percentile’s dependence of constant delays. The product constant delay * serverrate, K  µ, varies between 0 and 60.

Figure 4.10: Throughput as a function of the tolerated delay in a M/E2/1 system. 90th percentile. The delay of the 90th percentile of the M/M/1 system is included for reference.

39 Figure 4.11: Bitrate as a function of load in the M/E2/1system.The10th, 50th and 90th percentiles. The bitrate is given as a ratio of the average server rate µ.

Figure 4.12: The 10th and 90th percentile’s ratio of the median in the M/E2/1 FCFS system.

40 part of this family since E1 = M) First of all we study how the bitrates vary with q. In figure 4.13 and 4.14 the bitrates for M/M/1, M/E2/1and M/E5/1 are plotted, using (3.23) and (3.29). The total time distribution for

Figure 4.13: The 10th, median, 90th percentile for some members of the M/Eq/1 family of queues. The bitrate (as a ratio of the the average serverrate µ) is plotted as a function of load 4. the M/E5/1 queue is calculated numerically in Maple. (With increasing q it is more dicult to solve (3.4) for the total time distribution, for q =20 the calculations are very time-consuming). Figure 4.13 and 4.14 are showing the same data but with digerent y-axis scaling. In the figures we see that the queue which is best performing is dependent of the load, M/M/1per- forms best for ”low” loads and M/E5/1 for ”high” loads. Where high and low depends on which percentile we are interested in, for the 10th percentile the breakpoint is a load close to 1 whereas for the 90th percentile all loads 1 aretobeconsideredashigh.AllourE distributions have E[Y ]= , but q µ 1 the variance of the Erlang distribution is , hence decreasing with increas- qµ2 ing q. We conjecture that for a server distribution with lower variance the bitrates are reduced for ”low” loads, and improved for ”high” loads. For a given percentile the intersection between the M/M/1andM/Eq/1curves aremovedtotheleftforincreasingq. Consider the 90th percentile in figure 4.14. Assume that we want to guar- antee a bitrate of 0.5µ, then we see that the M/M/1systemcouldnotbe loaded at all, while the M/E5/1 system can tolerate a load of 4 =0.27 still keeping the guaranteed bitrate.

41 Figure 4.14: The median and the 90th percentile for some members of the M/Eq/1 family of queues. The bitrate (as a ratio of the the average serverrate µ) is plotted as a function of load 4.

We conclude that if we have a delay demand to meet (say, 95% should have a bitrate above b bits/s) then we are concerned with the percentiles where the lower variance servers outperforms those with higher variance in the entire interval. The behaviour is plotted in figure 4.15 for the 95th percentile,withsystemthroughput(i.e.loadinourmodel)asafunctionof delay in seconds. Since the Erlang distribution is converging to the dirac delta distribution when q $4we assume that the best performance with regard to delay demands are achieved in a M/D/1 system. But that is the queueing model of a wire not a wireless radio connection. The M/D/1 system requires more involving calculations to treat mathematically, see [5] where a solution is presented.

4.1.4 M/Hq/1 Now let us turn our attention to a queuing model with a hyperexponential server. This server has a variance which is bigger than that of the exponential, in contrary to the Erlang distributed server in the previous section. Figure 4.16 and 4.17 contains digerent scales of the plots of (3.45) and the total time distribution of a system with a server with pdf µ ¶ 4 8µ 8µ 1 b(y)= e3( 9 )y + (2µ) e32µy,y 0, (4.7) 5 9 5

42 Figure 4.15: System throughput as a function of normalized delay (sec- onds/bit) for M/E2/1, M/E5/1 and M/M/1 respectively. 95th percentile.

Figure 4.16: The 10th, median, 90th percentile for some members of the M/Hq/1 family of queues. The bitrate (as a ratio of the the average serverrate µ) is plotted as a function of load 4.

43 Figure 4.17: The 90th percentile and median for some members of the M/Hq/1 family of queues. The bitrate (as a ratio of the the average serverrate µ) is plotted as a function of load 4.

299 9 together with the M/M/1 queue. The servers have variance 75µ2 , 8µ2 and 1 µ2 respectively. These plots reveals that this family of curves behaves analo- gously to the M/Eq/1 family. We see that the server with the largest variance performs best for ”low” loads and the low variance servers performs best for ”high” loads. The definition of ”high” and ”low” regarding the loads is de- pendent of two things. First, the percentile we are studying has a major impact. ”Low” loads are 4 < 0.9 for the 10th percentile, while all loads 0 < 4 < 1 are to be considered as ”high” in the 90th percentile. Secondly, on a given percentile larger variance increases the interval of ”high” loads. One could reason like this; Since the variance is large the server may happen to serve to packets within a very short period of time or a very large period of time. For low loads this plays a significant role, as the queues are very short, making the fastest packets very fast and the slows down the slow ones. With increasing loads and growing queues this variance is not as significant for the total queuing time any longer. We find that for the Hq distributed servers, as was the case for the Eq distributed servers, higher bitrates can be guaranteed for high loads with low variance servers. We end this section with two remarks. First, in the M/Eq/1systemwe had the M/D/1modelasalowerboundwithvariance0,theM/Hq/1queue has no such bounds since the variance may be arbitrarily large. Secondly, studying this server model is more of theoretical interest than practical use, since these kind of servers are unrealistic.

44 4.2 G/M/1 FCFS

In this section we evaluate how the distribution of the arrival process agects the behaviour of the total system. We do this by varying the distribution of the arrival process while letting the server distribution be exponential in all cases.

4.2.1 Eq/M/1 The family of Erlang distributed arrivals have similar characteristics, see fig- ure 4.18 and 4.19 where 1/(Total time in system) is plotted with respect to load. In these figures the D/M/1 queue is also plotted since the Erlang

Figure 4.18: The 10th, median, 90th percentile for some members of the Eq/M/1 family of queues. The bitrate (as a ratio of the the average serverrate µ) is plotted as a function of load 4. distribution converges to this system as q $4.ThustheD/M/1system provides an upper bound for the family of Erlang distributed arrivals. Clearly, the more deterministic the arrivals are, the higher the bitrates become. Fur- thermore, conclusions about the sensitivity to increasing loads may be drawn from these figures. With decreasing variance the system is less sensitive to increasing loads (especially for low loads), thus giving higher bitrates or in other words shorter delays. In figure 4.20 the throughput (i.e. load, since no retransmissions occur) is plotted as a function of delay. In figure 4.20 we have chosen to represent the delay of the 95th percentile (i.e. statisti- cally 95% of the transmitted data will perform better). We see clearly that more deterministic arrivals perform better, for example assume that we have

45 Figure 4.19: The median and 90th percentile for some members of the Eq/M/1 family of queues. The bitrate (as a ratio of the the average serverrate µ) is plotted as a function of load 4.

Figure 4.20: Normalized system throughput as a function of normalized delay (seconds/bit) for M/M/1, E2/M/1 and D/M/1 respectively. 95th percentile.

46 ademandondelay< 0.7*1035 seconds/bit, then we can load the D/M/1 system up to 4 =0.6buttheM/M/1 system only stands a load of 4 =0.3. The result that arrival processes with lower variance perform better coincides with what common sense would have suggested. If the packets arrive in a deterministic manner the probability that a queue forms is less than in a system with arrivals with higher variance, where two or more packets may arrive in a very short timespan (building up a queue causing delays).

4.3 M/M/1 Round-Robin

It is in general complicated to explicitly perform the calculations in section 3.5 to find the waiting time distribution of the M/M/1 Round-robin system. However, in [3] the variance of the waiting time distribution is given by

24 24 ¡ ¢ V [Y | ]=  1  e3(134)µ , (4.8) µ(1  4)3 µ(1  4)4 whilethesamevarianceoftheM/M/1FCFSis 4 V [Y | ]= , (4.9) µ2(1  4) where is the service time required by the packet. We see that (4.8) is dependent on , i.e. dependent on the packet size, which is not the case for the FCFS discipline. To visualize this, we choose µ =1andplot(4.8) and (4.9) for some values of , then we see in figure 4.21 how the variance changes with . The conclusion is that the waiting time for RR varies less for small packets and moderate loads. Otherwise, when the loads increase and the packet size grows, the variance of the waiting time is lower for the FCFS discipline. The RR discipline favours small packets.

47 Figure 4.21: Standard deviation (seconds) of the waiting time as a function of load, for the M/M/1 queuing system. Comparison between the queuing disciplines FCFS and RR for some values of (0.25, 0.5, 1, 2, 3).

48 Chapter 5 Application: HS-DSCH (High Speed Downlink Shared CHannel)

5.1 Model verification

In this chapter we are in the pursuit of a queuing model that captures the behaviour of the HS-DSCH radio trac.Atourhandwehaveasetof simulation results published by Ericsson, see [8], to benchmark our model with. The number of codes used in the simulation results is 5 out of 16 5 possible, i.e. the bandwidth used by HS-DSCH is 16  5 MHz. We had reason to believe that, if a constant delay was added, the M/E2/1system would model the general behaviour of the HS-DSCH and that the M/M/1 system would be in the vicinity of that. Constant delays are present in the radio system so this assumption is not particularly bold. For the M/M/1 queue, with a constant delay of 5 µs/bit, we obtain the result shown in figure (5.1). The 90th percentile of the M/M/1 queue (that is the slowest 10%) is below the simulation results and the 50th percentile is above. However, the fit is quite good taking into account that real servers do not have exponentially distributed server times and the real queuing discipline is not FCFS. (The real queuing discipline is best SIR or possibly RR) As mentioned before, the great advantage with exponential distributions is that they are easy to calculate with. A more trustworthy model is the one with Erlang distributed server times. The results for a 5µs/bit delay are shown in figure (5.2). This queuing system models the behaviour of the 90th percentile nicely, but the simulated 50th percentile performs poorer than the one in the queuing model. A possible improvement in fit, still using simple distributions, would per- haps have been obtained with a distribution being a mixture of Erlang and hyperexponential distributions. Ideally we would have liked to try the fol-

49 Figure 5.1: 1/(Total time in system) plotted with repect to load for the M/M/1 system and for the simulation results (14 W). A constant delay of 5µs/bit is added to the M/M/1 model. Serverrate 650 kpbs/s.

Figure 5.2: 1/(Total time in system) plotted with repect to load for the M/E2/1 system and for the simulation results (14 W). A constant delay of 5µs/bit is added to the M/E2/1 model. Serverrate 650 kpbs/s.

50 lowing distribution

XR b(x)= piB(x  si), (5.1) i=1 where si are serverrates and

XR pi =1, for some R 5 N. (5.2) i=1 1 (Still keeping the mean rate ). This is a good model since the transmis- µ sion rates in HS-DSCH is given in discrete steps, depending on the radio conditions (the C/I value). But being a variant of the M/D/1 system it is complicated to solve.

5.2 General Results

Since the M/E2/1 system fitted the HS-DSCH simulation results to a satis- fying extent we continue to analyse this model. First we use our model to show what the 95th and 99th percentiles look like in the bitrate versus load plot, see figure 5.3. Next we predict what will happen with the 90th, 95th

Figure 5.3: The bitrate as a function of load for the 90th, 95th and 99th percentile. and 99th percentiles if the number of codes used is changed from 5, see figure 5.4 and 5.5 and 5.6 respectively. The server rate depends of the number of

51 Figure 5.4: The 90th percentile’s dependence of the number of codes used n.

Figure 5.5: The 95th percentile’s dependence of the number of codes used n.

52 Figure 5.6: The 99th percentile’s dependence of the number of codes used n. codes n as follows, 650 µ(n)= nkbps. 5 Now we turn to the relation between delay and throughput. In figure 5.7 we have plotted the delay of the 90th, 95th and 99th percentile, when the number of codes used is 5. We see that short delays reduce the throughput dramatically. And that there is a large digerence between the 95th and 99th percentile for certain delays, in fact the delay is approximately twice as large for the 99th percentile. In figure 5.8 the delay for the 95th percentile is plotted for a number of digerent code usages.

5.3 Streaming

Suppose that we are interested in implementing a streaming service in HS- DSCH. Streaming is a way of downloading video and music, but instead of downloading the entire film before starting to watch it, the customer starts watching the film while still downloading. This put higher demands on the acceptable delays in the system. The user can start watching the film after the first d seconds are bugered, and the delay may never exceed d. We will use the results from the previous chapters to predict the performance of this service. We assume that the streaming buger is 5 s and that the streaming session is 60 s. Further we assume that the user has a bitrate of 55 kbps. The amount of bits to be downloaded is then b =55 103  60. None of these bits may have a delay exceeding 5 s since the buger size is 5 s. With the aid of

53 Figure 5.7: System throughput as a function of normalized delay for the 90th, 95th and 99th percentiles. (Number of codes used: 5)

Figure 5.8: System throughput as a function of normalized delay for a number of digerent code useages n. 95th percentile.

54 the total time distribution (3.29) we calculate the probability of a successful streaming session. Let An be the event that packet n is not delayed more than 5 s. Furthermore assume that An and Ai arepairwiseindependent.If b thepacketsizeisp then the number of packets in the session is m = . The p probability we are interested in is

indep. P (A1 _ A2 _ ···_ Am) = P (A1)P (A2) ···P (Am)(5.3)

In our model we have a constant delay of 5µs/bit, i.e. the delay caused by the rest of the system may not exceed y =5 p(5  1036) seconds. To calculate the desired probability (5.3) we first have to find that

(3.29) | (;i) P (Ai) = R(y) y=53p(5W1036) . (5.4) Hence

indep. m P (A1 _ A2 _ ···_ Am) =((P (Ai)) . (5.5)

This probability is plotted as a function of load for a range of packetsizes p 5 [1000, 100000] in figure 5.9, but for a bugersize of 1 second. If we set a tolerance of, say, 95% of all streaming sessions to be successful then we obtain an estimate of how much load the system can carry without endangering the delay demands. For example, from the figure we see that if the packet size is 100 000 bits we can not meet the delay demand at all, but if the packet size is 10 000 bits the system may be loaded to about 4 =0.9. What happens if we change the buger size? A realistic packet size is 1500 bytes or 12000 bits. We set the packet size to p = 12000 and investigate how the loadability depends on buger size. The result is plotted in figure 5.10 for a number of buger sizes 5 [0.5, 5] seconds. The loadability decreases fast with increasing demands on delay. If the delay is 5 s then we may load the system up to 4 =0.975, but with a 0.5 s delay tolerance we may only load the system to 4 =0.74. Nowwhenwehavedeterminedhowmuchwemayloadthesystem,thenext question is; how many simultaneous users is this equivalent to? The average Max. Load user has a bitrate of 55 kbps, on average we may admit 55W103 simultaneous 11 users to the channel. For a 5 s buger this gives  5 n simultaneous users, where n is the number of codes used. In other words the average capacity is about 2 simultaneous users per code used.

5.4 Push To Talk (PTT)

Push to talk (PTT) is a new service that has emerged in the mobile systems. PTT can be said to make the cellphone work like an ”over-and-out” walkie- talkie. The caller chooses a number of recipients on her phone, pushes a button and is then able to, almost instantaneously, transmit a voice message

55 Figure 5.9: Probability of a successful streaming session with repect to load of the system (M/E2/1+ Constant delay) for a number of packet sizes. The packet sizes varies from 1 000 bits to 100 000 bits in steps of 5 000 bits.

Figure 5.10: Probability of a successful streaming session with repect to load of the system (M/E2/1+ Constant delay) for a number of digerent delay tolerances. The delay tolerance varies from 0.5 s to 5 s in steps of 0.5 s. The packet size is fixed at 12 000 bits.

56 to them. The communication is semi-duplex since each user has to wait for their turn, i.e. it is not possible to talk at the same time, hence the walkie- talkie simile. Anyway, this service behaves like a streaming service, but there is a change of scales concerning the buger size and session duration. We make the following assumptions, the user bitrate is 7 kbps, the buger size is 0.5 seconds and the session length, or talkburst, is 10 seconds and the packet size is 12000 bits. If PTT would be implemented in HS-DSCH then we could use our model and the calculations in the streaming section to predict the behaviour of this service. The result is plotted in figure 5.11. Since the bugertime is only 0.5 seconds this service cannot stand loads higher than 4  0.87, if we are satisfied with a 90% probability of a successful PTT session. If we raise our demand to a 99% probability, then we have to lower Max. Load the load to 4  0.8. In this case, we may admit, on average, 7W103 = 650W0.8 n 7 5  15n simultaneous users, where n is the number of codes used. Thus we may admit 15 push to talk users per code used.

Figure 5.11: Probability of a successful PTT session with respect to load for the system (M/E2/1 + Constant delay, 5 codes).

5.5 Other radio protocols

There are of course other wireless systems with packet switched data trac. One example is WLAN (Wireless Local Area Network). WLAN is for exam- ple used for connecting laptops to data networks. The simulation results of WLAN nets have a peculiar look, the 10th percentile (the fastest 10%) looks as if the server variance is low (Erlang) but the 90th percentile looks as if

57 the server variance was high (Hyperexponential). Neither of the queueing models presented in chapter 3 fit these simulation results. A complicating circumstance is that the server process is dependent of the arrival process. In our models they were assumed to be independent. Another common radio environment is GPRS (General Packet Radio Ser- vice) which is a technique for packet data in the GSM mobile systems. Here the simulation results once again show a ”low-variance server” 10th percentile and a ”high-variance server” 90th percentile. In comparing HS-DSCH and GPRS there is a digerence in bandwidth between them, the former has a bandwidth of 5 MHz and the latter only 200 kHz. The explanation might hide in this fact. The GPRS channel has room for fewer users. The slow users have bad radio conditions so their bitrates may vary a lot. The fast users on the other hand have good radio conditions and have more deter- ministic server rates. This is also the case in the HS-DSCH channel, but here the number of users are higher, which should have the egectthatthe variance becomes much smaller due to averaging. What is the mathematical solution to this problem? Is there a dependence between the arrival process and server process or is it possible to construct a better (independent) server distribution that captures these egects? An idea would be to try a distri- butionwithanErlangstartandaHyperexponentialtail,withsomeproper ”middle” part.

58 Chapter 6 Summary

6.1 Conclusions

The most interesting results we have presented in this report are,

• The total time distribution is independent of the packet size if the queuing discipline is first come first served.

• The total time distribution of the G/M/1systemisalways exponen- tially distributed regardless of the inter arrival process.

• It is possible to model HS-DSCH with a M/E2/1(withaconstantdelay added) queuing system.

In the theoretical part of this report we found the equations for calculating the waiting time and total time distribution for the M/G/1 and G/M/1 queuing systems. It is not in general possible to find closed expressions for the distributions, but numerical solutions often exist. It is most interesting that the total time distribution is exponentially distributed regardless of the inter arrival process, however the distribution is not independent of the inter arrival process. An important but discouraging fact is that it is complicated, or even not known how, to find the waiting time distribution for other queuing disciplines than FCFS. When we analysed the theoretical results we found that the waiting time and total time distributions of the queuing systems studied are in fact inde- pendent of the packet size, as long as the queueing discipline is first come first served. We also showed that the lower variance the server has the better the slowest users perform, something which is not in general true for the fastest users. On the other hand, if we alter the inter arrival process, the lower the variance of the inter arrival times the higher the bitrates become for all users, regardless of load and if the users are fast or slow. Hence we would like to have services that have more deterministic inter arrival times. We also benchmarked our queuing systems with published simulation results. We found that our simple M/E2/1 queuing system does in fact model the

59 HS-DSCH surprisingly good, despite the fact that the queuing disciplines are digerent and that the model uses a continuous server distribution instead of a discrete one as in HS-DSCH. However, we also found examples of radio protocols that doesn’t yield to our simple models, like GPRS and WLAN. If the total time distribution of a system is known, then it is possible to use it for predicting the behaviour of both existing and new services in the system. For example, using our HS-DSCH model, we predicted that it is possible to admit 2 simultaneous streaming users per code used and 15 simultaneous push to talk users per code used.

6.2 Further studies

The models presented in this report need a lot of refinements to be applicable to more general systems. Interesting parameters to include in the model would be

• Queueing discipline. If a more advanced queueing discipline could be implemented in the model it would resemble the real systems better. • Variable packet size. If the queuing discipline is altered, then it is interesting to study how the waiting time distribution change if the packet size is given by an arbitrary distribution. • To analyse what would happen with the waiting time distribution if the server distribution is dependent on the inter arrival process.

In my opinion the most interesting parameter to attack in a future anal- ysis is the queuing discipline. If we consider a queuing system, the general components are an inter arrival process, a server process and a queuing dis- cipline. If we were to design a system we would have no influence on the inter arrival process (the users are out of our control), we would have some influence on the server process (usually the bandwidth is already given) but the queuing discipline is totally under our command. So, analysing the queu- ing discipline should be of great interest. But we still have to consider the two other components, since the optimal queuing discipline most likely is dependent of the arrival and server processes. To improve the understanding, it would probably be of interest to con- struct simple simulators of some radio system, for example GPRS, which only include the most important factors and then compare it to the theoretical results. A new way to analyse queuing problems has recently been presented, the PEPA (Performance Evaluation Process Algebra), by J. Hillston [7]. The aim of her theories is to simplify the analysis avoiding unnecessary simulations. This PEPA algebra could be of interest for the kind of system treated in this report, but the theories seem to require a lot of studies before they could be implemented.

60 6.3 Epilogue

Queuing theory is a good framework for treating problems concerning delay and throughputs of telecommunication systems. Real systems, however, are so complex that it is very complicated to construct theoretical models that take all parameters into account. Instead we are confined to making the cal- culations on simplified models, thus making the results less accurate. Today the most accurate results are probably obtained from good simulators of the systems. But that does not imply that queuing theory is superfluous, rather to the contrary. With a theoretical background in queuing theory it is much easier to understand why the systems behave as they do, i.e. it simplifies the analysis of the simulation results. Furthermore an understanding of queuing theory will improve the design of the systems and the simulators.

61 Appendix A Appendix

A.1 Classification of Markov Chains

An important subset of all queuing systems is the Markov chains.

{ }" Definition A.1 Let Xn n=0 be a discrete-time stochastic process that as- sumes non-negative integer values. It is called a discrete Markov chain if ; n  0 and ; outcomes i0,i1,... ,in+1

P (Xn+1 = in+1| Xn = in,Xn31 = in31,...,X0 = i0)= (A.1)

= P (Xn = in| Xn = in).

In other words, a Markov chain is completely determined by the present state Xn.ItshistoryX0,... ,Xn31 gives no further information about the future. If a queuing system is found to be a Markov chain the analysis is in general greatly simplified.

Remark A.1 A.A. Markov, 1856-1922, was a Russian mathematician active in St. Petersburg. His interests were politics and probabilities. The theory he developed, later known as the Markov theory, has had a huge impact on the probability theory.

A Markov chain may be classified into certain subgroups depending on what properties they possess. The properties we are interested in are re- ducible/ irreducible, transient/ recurrent and periodic/ aperiodic, all of which are defined below. Certain properties give the Markov chain special charac- teristics which may simplify the analysis a lot. Before we define the properties we have to introduce the notion of reachability.

Definition A.2 State i is reachable from state j if it is possible to jump from j to i in a finite number of steps, i.e. (m) N pji > 0,m5 . (A.2)

62 With this tool we make the following definition. Definition A.3 A Markov chain is said to be irreducible if every state is reachable from every other state. If this is not the case the chain is reducible.

Definition A.4 Let fj = P ( ever returning to state j). If fj =1then state j is recurrent and if fj < 1 state j is transient. If a state is recurrent we would like to know ”how recurrent” the state is, i.e. we define two categories of recurrent states. { }" Definition A.5 Let Xn n=0 be a Markov chain, let i be a recurrent state and let T =min{n>0| Xn = i} bethetimeuntilthenextreturntostatei. If the mean recurrence time

Mi = E [T | X0 = i] < 4, (A.3) the state is recurrent non-null otherwise state i is recurrent null.

(n) If fi = P ( first return to state i occurs n steps after leaving i), then X" (n) Mi = nfi . (A.4) n=1 Not only the mean recurrence time is of interest, but also the number of steps in which it is possible to return to state j. Definition A.6 Arecurrentstatej is periodic if the only way of returning to state j is in a multiple of k steps, i.e. k, 2k, 3k, . . . steps, where k>1 and k 5 N. If a state is not periodic it is aperiodic. Now we state a very useful theorem for classification of Markov chains. Theorem A.1 The states of an irreducible Markov chain are either all tran- sient or all recurrent non-null or all recurrent null. If periodic, then all states havethesameperiodk. Figure A.0 gives a summary of how Markov chains are classified.

Markov chain

Irreducible Reducible

Transient Recurrent Recurrent Null Non-Null

Periodic Aperiodic Figure A.0: Chart of classification of Markov chains.

63 Now follows the most important concept of them all; ergodicity.

Definition A.7 If a Markov chain is irreducible, recurrent non-null and aperiodic it is called ergodic. n o (n) If a Markov chain is ergodic the probability distribution Zj as a function of the number of steps n always converges to a limitingn o stationary { } (0) distribution Zj , independent of the starting distribution Zj . Ergod- icity is very important when we solve for the waiting time and total time distributions, it guarantees that the system will stabilize and reach the same distribution regardless of how the system is initialized.

A.2 Poisson Processes

The Poisson process is a subset of the Markov processes. Before we can define the Poisson process itself we have to consider the following definition.

Definition A.8 A stochastic process {X(t),t5 T} is said to have

Independent increments if X(t2)  X(t1),X(t3)  X(t2),... , a) X(tn)  X(tn31) is independent of every choice of t1

Now we are ready to define the Poisson process (sometimes the Poisson process is called a pure birth process).

Definition A.9 A Poisson process with intensity b > 0 is a stochastic pro- cess {N(t),t 0} such that

a) {N(t)} is integer valued, increasing and N(0) = 0. b) {N(t)} has independent and stationary increments. c) N(t) 5 Po(bt), i.e. Poisson distributed.

There is a strong connection between arrivals according to a Poisson pro- cess and the exponentially distributed inter arrival times considered in our queuing models. In fact, they are equivalent, which the following theorem states.

Theorem A.2 Let {N(t),t 0} be a Poisson process with intensity b and let Y1,Y2,... be the corresponding time distances between the events. Then 1 Yn 5 Exp( b ) for n =1, 2, 3,... and these variables are independent. Proof. See [14].

64 A.3 Derivation of total time distribution of the M/M/1 System

In this section we present an alternative derivation of the waiting time dis- tribution for the M/M/1 system. We do it by analysing the Markov Chain shown in figure 3.4 in chapter 3. Let Qn be the number of customers present when customer Cn arrives. Then we have the state transition rate matrix 5 6 bb 000··· 9 ··· : 9 µ (µ + b) b 00 : 9 ··· : 9 0 µ (µ + b) b 0 : 9 . . . : Q = qij = 9 00 µ ...... : . (A.5) 9 : 9 . .. .. : 7 . . 0 . 8 ...

This system is ergodic if 4 < 1 and therefore the solution of  = P will be unique, where P is the state transition probability matrix and  is the stationary probability distribution. Solving  = P is equivalent to solving P" Q = 0 with the condition Zi = 1, see [14]. With  =[Z0, Z1, Z2,...], i=0 Q = 0 isthesameas ½ bZ + µZ =0 0 1 . (A.6) bZi31  (b + µ)Zi + µZi+1 =0 i =1, 2,... The solution is µ ¶ b i Z = Z = 4iZ ,i=0, 1, 2,... , (A.7) i µ 0 0 P " and the condition i=0 Zi =1gives

X" X" 1 Z = 4Z = Z =1/ Z =1 4. (A.8) i 0 0 1  4 0 i=0 i=0 Hence

i Zi =(1 4)4 ,i=0, 1, 2,... (A.9)

Now we turn to the total time distribution. Let T be the total time a customer spends in the system. The total time for customer Cn may be considered as the sum

T = |{z}t1 +(|t2 + ...{z + tn}) + |{z}tn+1 . (A.10) The customer in service The service time of the queue Its own service time

65 All ti are exponentially distributed stochastic variables, independent of ea- chother. Then we express the total time distribution as

R(t)=P (T  t)= X" = P (n + 1 customers served  t | n customers in queue)  n=0 P (System is in state n)(A.11) X" = P (n + 1 customers served  t | n customers in queue)Zn n=0

To determine P (n + 1 customers served t | n customers in queue) we have to use the property that the service time of each customer is independent. If X and Y are both exponentially distributed then Z = X + Y has pdf

Z" Th.(3.1) fZ(z) = fX (x)fY (z  x) dx

3" Zz = µe3µxµe3µ(z3x) dx = µ2ze3µz,z 0. (A.12) 0

For X = X1 + ...+ Xn+1, all Xi exponentially distributed and independent, µ(µx)n f (x)= e3µx, (A.13) X n! which can be shown by induction. Then

P (n + 1 customers served  t | n customers in queue) = Zt Zt µ(µx)n = f (x) dx = e3µx dx.(A.14) X n! 0 0 Inserting this and (A.9) into (A.11) gives

Zt X" µ(µx)n R(t)= 4n(1  4) e3µx dx. (A.15) n! n=0 0 First we determine if this sum is convergent, that is we have to check if ¯ ¯ ¯ Zt ¯ ¯ n ¯ ¯ n µ(µx) µx ¯ n ¯4 e3 dx¯

66 We do this by considering the integral first, i.e.

Zt Zµt µ(µx)n yn e3µxdx =[y = µx]= e3ydy = n! n! 0 0 µ ¶ ¸  n n31 1 µt Integration y y y =  + + ···+ +1 e3y = by parts n! (n  1)! 1 0 µ µ ¶ ¶ (µt)n (µt)n31 (µt)1 (A.17) = 1  + + ···+ +1 e3µt = n! (n  1)! 1 µ µ ¶ ¶ n+1 Taylor (µt) = 1  eµt  eµwt e3µt = Series (n +1)! µ ¶ (µt)n+1 =  eµwte3µt , 0 < w < 1 (n +1)!

Taking the absolute value of this we find that ¯ ¯ ¯Zt ¯ ¯ ¯ ¯ n ¯ ¯ n+1 ¯ n+1 ¯ µ(µx) µx ¯ ¯ (µt) µt( 1)¯ (µt) ¯ e3 dx¯ = ¯ e w3 ¯  . (A.18) ¯ n! ¯ (n +1)! (n +1)! 0 Hence v u¯ ¯ s u¯ Zt ¯ u¯ n ¯ n+1 1/n lim n ¯ µ(µx) ¯ n (µt) µt(µt) n<" t¯4n e3µxdx¯  4n = 4 p $ 0, ¯ n! ¯ (n +1)! n (n +1)! 0 and thus the sum (A.15) converges. We now calculate the sum as

Zt X" µ(µx)n R(t)= 4n(1  4) e3µx dx = n! n=0 0 Zt à ! X" (4µx)n = µ(1  4)e3µx dx = n! 0 n=0 Zt = µ(1  4)e3µxe4µx dx =(A.19) 0  ¸t e3µ(134)x = µ(1  4) = µ(1  4) 0 =1 e3µ(134)t.

67 Hence the total time distribution is given by

R(y)=1 e3µ(134)y,y 0. (A.20) The waiting time distribution is derived in a similar way, see next section for analogous calculations.

A.4 Derivation of total time distribution of the G/M/1 System

To find the distribution of the waiting time for the G/M/1 system we will use an imbedded Markov chain analysis. Let the arriving process be arbitrary and denote its PDF by A(t). To find a suitable Markov chain let Qn be the number of customers already in the system when customer Cn arrives. Then {Qn | n  0} is a discrete Markov chain on n 5 Z+. (The next interarrival time is independent of the previous one, and since the server is memoryless (exponentially distributed) the remaining service time for the customer in service is independent of the past. Hence the next state Qn+1 is only dependent on the present state Qn.) Let Vn+1 be the number of customers who depart during the interarrival time of Cn and Cn+1. Then the following is true

Qn+1 = Qn +1 Vn+1,n 0. (A.21) Figure A.1 visualise this process. The number of departures takes place according to a Poisson process with rate µ.

Figure A.1: Realization of the G/M/1 system, with the Markov states shown.

NowwhenwehavetheMarkovchainwehavetosolvethesystemof equations

 = P (A.22)

68 b for the ergodic case (which is when 4 = < 1), where Zk = lim P (Qn = k). µ n<" The next thing to do is to find the state-transition matrix P = pij,where

pij = P (Qn+1 = j | Qn = i), (A.23) or in other words pij is the probability that i +1 j customers are served during the interarrival time. The possible transitions out of state i are shown in figure A.2.

Figure A.2: The transition probabilities out of state i for the G/M/1 imbed- ded Markov chain. Now, to determine the state transition probabilities we divide the matrix into four zones, as shown in figure A.3.

Figure A.3: The four zones for which we calculate the transition probabilities.

Zone 1. i +1

pij =0,i+1

3µt P (1 departure within t sec. after Cn arrives | Qn =0)=1 e . (A.25)

69 With tn+1 being the interarrival time between Cn and Cn+1 we have

3µt P(Qn+1 =0| Qn =0,tn+1 = t)=1 e . (A.26)

But we are seeking p00 = P (Qn+1 =0| Qn = 0) so the condition on tn+1 has to be removed, i.e.

Z" µ ¶ d p = (1  e3µt) A(t) dt. (A.27) 00 dt 0 Zone 3. 1  j  i +1,i 1ori =0,j=1. In this case Cn is still in the system (either in the queue or being served) when Cn+1 arrives. This means that the servers are busy during the entire interarrival time tn+1. The service time is exponentially distributed and the number of served customers are Poisson distributed with parameter µ. We have (µt)k P (k customers served | t = t, the server is busy) = e3µt. (A.28) n+1 k! From this we obtain the state transition probability, removing the conditions on tn+1,as Z" µ ¶ d p = P (i +1 j served | t = t, the server busy) A(t) dt = ij n+1 dt t=0 Z" µ ¶ ½ (µt)i+13j d 1  j  i +1,i 1 = e3µt A(t) dt, . (A.29) (i +1 j)! dt or i =0,j=1 t=0 Zone 4. j<1

70 The solution of  = P is unique if it exist. We guess that the solution is geometric, i.e. £ ¤  = K, Kj,Kj2,... , (A.32) where 0 < j < 1. If the guess is true then the solution is found. Consider the kth equation where k  1, X" X" k Zk = Kj = Zipik = Zipik = i=0 i=k 1 5 3 3 46 Z" µ ¶ X" (µt)i+13k d = 7Kji C e3µt A(t) dtD8 . (A.33) (i +1 k)! dt i=k31 t=0 From this we obtain 3 4 Z" µ ¶ X" (µt)i+13k d Kjk = K ji C e3µt A(t) dtD (i +1 k)! dt i=k31 t=0 with K =0wehave6 3 4 Z" µ ¶ X" (µt)i+13k d jk = ji C e3µt A(t) dtD (i +1 k)! dt i=k31 t=0 or 3 4 Z" µ ¶ X" (µt)i+13k d j = ji+13k C e3µt A(t) dtD . (A.34) (i +1 k)! dt i=k31 t=0 Changing index, let i +1 k = n, we obtain 3 4 Z" µ ¶ X" (µt)n d j = jn C e3µt A(t) dtD = n! dt n=0 à t=0 ! Z" µ ¶ X" (µt)n d = jn e3µt A(t) dt = n! dt n=0 t=0 "à ! # Z" µ ¶ X" (µtj)n d = e3µt A(t) dt = n! dt t=0 n=0 Z" µ µ ¶¶ d = eµjte3µt A(t) dt. (A.35) dt t=0 In other words Z"µ µ ¶¶ d j = e3(µ3µj)t A(t) dt, (A.36) dt 0

71 which by the definition of the Laplace transform is equivalent to j = aW(µ  µj), (A.37) where a(t) is the pdf of the arriving process. Our guess was correct if we can find a solution 0 < j < 1tothisequation,and k Zk = Kj . (A.38) P" Since this is a probability solution Zk = 1, giving k=0 X" 1 1= Kjk = K / K =1 j. (A.39) 1  j k=0 Thus k Zk =(1 j)j ,k 0, (A.40) and our guess turned out to be correct. Now, having , weareableto find the waiting time distribution in a way similar to the M/M/1 case. Let W(t) be the waiting time distribution and T be the time customer Cn spends queuing (not including the service time Cn itself requires), T = |{z}t1 +(|t2 + ...{z + tn}) . (A.41) Remaining service time of C0 The service time of those in queue Since the server is exponentially distributed T is a sum of independent ex- ponentially distributed stochastic variables, as in the previous section. The waiting time distribution is given by W(t)=P (T  t)= = |P (T{z=0)} + No-one in queue P" + P (n customers served  t | n customers in queue) n=1 P (System is in state n)= Zt X" n31 (A.13) µ(µx) =(1 j)+ Z e3µx dx n (n  1)! n=1 0 Zt X" µ(µx)n31 =(1 j)+ (1  j)jn e3µx dx = (n  1)! n=1 0 Zt à ! X" (µjx)n31 =(1 j)+(1 j)µj e3µx dx = (n  1)! 0 n31=0 Zt =(1 j)+(1 j)µj e3µxeµjx dx = 0 =1 je3µ(13j)t,t 0. (A.42)

72 Hence

W(y)=1 je3µ(13j)y,y 0. (A.43)

If we want the total time distribution we define Tt to be the total time Cn spends in the system

Tt = |{z}t1 +(|t2 + ...{z + tn}) + |{z}tn+1 . (A.44) The customer in service The service time of the queue Its own service time

To find the distribution we do calculations similar to equation (A.19), i.e.

X" R(t)= P (n + 1 customers served  t | n customers in queue)  n=0 P (System is in state n) Zt X" µ(µx)n = jn(1  j) e3µx dx = n! n=0 0 Zt à ! X" (jµx)n = µ(1  j)e3µx dx = n! 0 n=0 Zt = µ(1  j)e3µxejµx dx = 0  ¸t e3µ(13j)x = µ(1  j) = µ(1  j) 0 =1 e3µ(13j)t,t 0. (A.45)

Thus

R(y)=1 e3µ(13j)y,y 0. (A.46)

A.5 Derivation of total time distribution of the M/G/1 System

To find the distribution of the total time for the M/G/1 system we once again have to use an imbedded Markov chain analysis. Let the arriving process be exponentially distributed and let the server process be arbitrary with PDF B(t). { }" The imbedded Markov chain in this case is Qn n=0 ,whereQn is the number of customers left behind in the system at the departure of customer

73 Figure A.4: Realization of the M/G/1 system, with the Markov states Qk shown.

Cn. Let Vn be the number of customers that arrive during the service time of customer Cn. Figure A.4 visualise this process. The next thing we do is to find the state-transition matrix P = pij, where as usual

pij = P (Qn+1 = j| Qn = i), (A.47) which is the probability that j+1i customer arrives during a inter departure time interval. It turns out to be somewhat less complicated than for the G/M/1 system since we only have to consider two cases. Case 1. j

pij =0,j

pij = P (Qn+1 = j| Qn = i)=P (j + i  1 customers arrives) =

= P (Vn+1 = j +1 i)=P (Vn+1 = k)=kk. (A.49)

Thus we have to determine kk. In order to do so, we note that the arrival process is independent of the state the chain is in. The distribution of Xn is given by B(x) and is independent of n.Thusweskipthesubscriptsand e e denote Xn by X and Vn by V.Now kk, by the law of total probability, may be written Z" e e e kk = P (V = k)= P (V = k, x < X

74 By conditional probabilities we further have Z" e e kk = P (V = k| X = x)b(x)dx. (A.51) 0 The probability P (Ve = k| Xe = x) is equivalent to the probability that k customers arrive during the time x in a Poisson process with intensity b. (The number of arrivals is Po(bt)). Thus e3bx(bx)k P (Ve = k| Xe = x)= . (A.52) k! Finally we get that Z" e3bx(bx)k k = b(x)dx. (A.53) k k! 0 The state-transition matrix P now has the following form 5 6 k0 k1 k2 k3 ··· 9 ··· : 9 k0 k1 k2 k3 : 9 . : 9 0 .. : 9 k0 k1 k2 : P = 9 .. : , (A.54) 9 00k0 k1 . : 9 : 9 .. : 7 000k0 . 8 ...... where kk is given by (A.53) . Next we want to find the relation between the number of arrivals Ve and theservicetime,wedefinez-transform of Ve as X" e V (z) def.= E[zV ] def.= P[Ve = k]zk = k=0 3 4 Z" X" e3bx(bx)k = C b(x)dxD zk = k! k=0 0 Ã ! Z" X" (bxz)k (A.55) = e3bx b(x)dx = k! 0 k=0

Z" Z" = e3bxebxzb(x)dx = e3(b3bz)xb(x)dx =

0 0

def. = bW(b  bz),

75 where the definition of the Laplace transform was used in the last step. Thus V (z)=bW(b  bz). (A.56)

Now consider figure A.5. All Qn have to arrive during the time Cn spends in the system. The situation in figure A.5 b) is the same as in a), i.e. there is a

Figure A.5: Realization of the process. In a) Vn Poisson arrivals occur during the time Xn. In b) Qn Poisson arrivals occur during the time Rn. number of independent arrivals according to a Poisson process with intensity b during a time Xn or Rn,whereXn and Rn is distributed according to the general distribution X(t)andR(t) respectively. Thus (A.56) holds in this case too, i.e. Q(z)=rW(b  bz). (A.57) Next we apply the Pollaczek-Khinchin transform equation, see [10], i.e. (1  4)(1  z) Q(z)=bW(b  bz) , (A.58) bW(b  bz)  z to (A.57) . The result is (1  4)(1  z) rW(b  bz)=bW(b  bz) . (A.59) bW(b  bz)  z

76 Making the substitution s = b  bz yields

s(1  4)bW(s) rW(s)= , (A.60) s  b + bbW(s) which is the Laplace transform of the total time distribution.

77 Bibliography

[1] Adan I., Resing J. (2001), Queueing Theory, URL: http://www.cs.duke.edu/ ˜fishhai/misc/queue.pdf {retrieved 15- 03-2004}

[2] Blom G. (1984), Sannolikhetsteori med till¨ampningar Bok A,2ndedi- tion, Lund: Studentlitteratur

[3] Cogman E.G., et al. (1970), Waiting Time Distributions for Processor- Sharing Systems, Journal of the Association for Computing Machinery, Vol. 17, No. 1, January 1970

[4] Evans M. et al.(2000), Statistical distributions, 3rd edition, New York: John Wiley & Sons, Inc.

[5] Franx G.J. (1998), A Simple Solution for the M/D/c Waiting Time Distribution, URL: http://www.math.vu.nl/obp/queueing/MDc.pdf {retrieved 03-05-2004}

[6] Furusk¨ar A. et al.(2002), Performance of WCDMA High Speed Packet Data, in proceedings of IEEE VTC 2002 (Spring)

[7] Hillston J., Performance Evaluation Process Algebra PEPA Homepage, URL: http://www.dcs.ed.ac.uk/pepa// {visited 09-05-2004}

[8] Hiltunen K., Magnusson S. (2003), Performance of Link Admission Con- trol in a WCDMA System with HS-DSCH and Mixed Services, in pro- ceedings of the Future Telecommunications Conference (FTC) 2003 in Beijing.

[9] Holma H., Toskala A. (Editors) (2000) WCDMA for UMTS Radio Ac- cess For Third Generation Mobile Communications, John Wiley & Sons, Ltd., Printed Chippenham: Antony Rowe Ltd.

[10] Kleinrock L. (1975), Queueing systems Vol. I: Theory, John Wiley & Sons, Inc.

[11] Kleinrock L. (1976), Queueing systems Vol. II: Computer Applications, New York: John Wiley & Sons, Inc.

78 [12] Parkvall S., et al. (2003), WCDMA evolved-High-speed packet-data ser- vices, Ericsson Review No. 2, 2003

[13] Raatikainen, K.E.E. (1989), Approximating Response Time Distribu- tions, Performance Evaluation Review Vol. 17, No.1 May 1989

[14] Ryd´en T., Lindgren G. (2000), Markovprocesser, 2nd edition (1st print), Lund: Lund University with Lund Institute of Technology. Mathemati- cal Statistics, Centre for Mathematical Sciences.

[15] R˚ade L., Westergren B. (1989-1998), Mathematics Handbook for Science and Engineering BETA, 4th ed., Lund: Studentlitteratur

[16] Takagi H. (1987), Exact analysis of round-robin scheduling of services, IBMJ.Res.Develop.Vol.31No.4July1987

[17] Wolg R. (1989), Stochastic modeling and the theory of queues, Prentice- Hall

79