Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chap 2 Network Analysis and Queueing Theory 1. Two approaches to network design 1- “Build first, worry later” approach - More ad hoc, less systematic.

Similar presentations


Presentation on theme: "Chap 2 Network Analysis and Queueing Theory 1. Two approaches to network design 1- “Build first, worry later” approach - More ad hoc, less systematic."— Presentation transcript:

1 Chap 2 Network Analysis and Queueing Theory 1

2 Two approaches to network design 1- “Build first, worry later” approach - More ad hoc, less systematic 2- “Analyze first build later” is used extensively for telephone networks - More systematic, optimal, etc. A model is a mathematical abstraction: keep only the details that are relevant Mathematical modeling is one step that can provide useful approximations 2

3 2- Improve the system performance - Determine the service rate with tolerable waiting time (upgrade the system with more capacity incurs investment cost. But long waiting time would be annoying to users) - Provide guaranteed packet loss probability with large enough buffer (How large is enough?) Mathematical model can be used for: 1- Evaluate the system performance - Average queue length - Average waiting time - Loss probability due to buffer overflow 3

4 Roadmap Randomness in computer networks A review of probability Queuing theory 4

5 Randomness at the source (1/2) Communication is full of randomness during the data generation at the source and data transmission at the network 5 r Random data generation at the source m data: users randomly subscribe to download at any time (e.g., web browsing) m voice: dynamic changing of data flow based on the interactivity during the conversation m video: variable video rate

6 Randomness at the source (2/2) 6 r Voice communication: interactive communication r Video: variable length of video frames Bob speaks Dave speaks Frame 1 Frame 2Frame 3 Frame 4 r Video = moving picture (30 pics/s) r picture (frame) size depends on motion in pictures

7 Randomness at the network Data transmission encounters random delays and data rate – randomly changing physical channels (noise of wireless communication) – congestion in the backbone network (statistical multiplexing of data packets) – contention of transmission among users in access network 7

8 Buffers Buffers are used to absorb the randomness of network – Sender, routers, receivers all have buffers 8 random arrivalsreorganize data send to up-layers IP network Buffer at the receiver

9 Roadmap Randomness in computer networks A review of probability Queuing theory 9

10 A review of probability Definitions Random Variables Distribution of RVs Statistical Characterizations Useful Distributions 10

11 Definitions Experiment: a physical experiment with an observable outcome Random Experiment: an experiment with a non-deterministic outcome (e.g., packet transmission with random lost) Sample Space (S): the set of all possible well-defined outcomes of an experiment Event (E): a subset of the sample space Probability of an event E can be defined in terms of its relative frequency as: 11

12 Conditional Probability The conditional probability of an event E assuming that an event F occurs, denoted by P (E|F), defined as: Probability of joint events is: If A and B are independent

13 Total Probability Theorem (mutually disjoint) A is an arbitrary event in S, the total probability theorem is given as: Proof : A E1E1 E2E2 E3E3 E4E4 E5E5 E6E6 E7E7

14 Random Variables 14

15 Distribution of Random Variables 15

16 16 Discrete versus Continuous Random Variables Discrete Random VariableContinuous Random Variable Takes discrete values e.g. {0, 1, 2, 3} Infinite (continuous) Sample Space e.g. [0,1], [2.1, 5.3] Cumulative Distribution Function (CDF) Probability Density Function (PDF) Probability Mass Function (PMF)

17 Statistical Characterizations Expectation (Mean Value) of a random variable Variance of X 17

18 1- Binomial Distribution Binomial distribution (n, p) - A fixed number of trials, n, e.g., 15 tosses of a coin; - A binary outcome, called “success” and “failure”, e.g., head or tail in each toss of a coin Probability of success is p, probability of failure q = 1 – p - Constant probability for each observation (independent trials), e.g., probability of getting a tail is the same each time we toss the coin X is a r. v. that refers to the number of successes in n trials np = mean value 18

19 19 Example: - Every packet has n bits. There is a probability p Β that a bit gets corrupted. What is the probability that a packet has exactly 1 corrupted bit? -What is the probability that a packet is not corrupted? - What is the probability that a packet is corrupted? At least one bit is corrupted

20 2- Geometric Distribution Example: what is the probability that we need k coin tossing in order to obtain a head? Independent trials - A binary outcome, called “success” and “failure”, e.g., head or tail in each toss of a coin Probability of success is p, probability of failure q = 1 – p Constant probability for each observation (independent trials), e.g., Probability of getting a tail is the same each time we toss the coin X is a r. v. that refers to the number of trials needed to obtain the first success 20

21 21 Example: A wireless network protocol uses a stop-and-wait transmission policy. Each packet has a probability p E of being corrupted or lost. What is the probability that the protocol will need 3 transmissions to send a packet successfully? – Solution: 3 transmissions is 2 failures and 1 success, therefore: What is the average number of transmissions needed per packet?

22 3- Poisson Distribution 2.Poisson distribution defines the probability that a random event occurs k times during a given interval s. is a positive real number, equal to the expected number of occurrences that occur during the given interval. 1.A discrete RV X follows the Poisson distribution with parameter if its probability mass function is: 22

23 Exponential distribution : A continuous RV X follows the exponential distribution with parameter, if its probability density function is: 4- Exponential Distribution Cumulative distribution function (CDF): Mean and Variance: 0 f (x) 23

24 Memoryless property: Past history has no influence on the future. The probability of having to wait at least x additional seconds given that one has already waited t seconds. 4- Exponential Distribution Proof: Exponential is the only continuous distribution with the memoryless property Let X be the amount of time a customer spends in a bank. X is exponentially distributed with mean 10 minutes. 24

25 5. Poisson Process with rate Random process : a collection of random variables indexed by a set T(“time"). A counting process where the number of arrivals in any time interval t follows Poisson distribution with parameter t and the inter-arrival times are independent, identically distributed and follows exponential distribution with parameter 25

26 5. Poisson Process with rate Inter-arrival times for a Poisson process are independent and follow exponential distribution with parameter 26

27 Merging & Splitting Poisson Processes - A 1,…, A k are independent Poisson processes with rates 1,…, k - Merged in a single Poisson process with rate = 1 +…+ k - A Poisson process with rate can be split into processes A 1 and A 2 independently, with rates p and (1-p) p (1-p) p 1-p 27

28 Roadmap Randomness in computer networks A review of probability Queuing theory 28

29 Queuing theory Introduction to queuing theory – What is queuing theory? – Why study queues? – Notations of queues Queuing Models – M/M/1 Queue – M/M/1/N Queue – M/M/m/m Queue – M/M/m Queue – Network of queues 29

30 What is queuing theory used for? A random variable describes the behavior of one random event – User arrivals in unit time; bandwidth capacity of a link; transmission power of a sender... How to model and analyze a system where multiple random events co-exist? – e.g., a router where multiple flows, with different rates, are injected and served with different policies Queuing theory: is the mathematical study of waiting lines 30

31 Why study queues? Whenever there is irregular demand for some service, taking a random time, there unavoidably appear queues. Only fully deterministic demand, and fully deterministic service (which never happens!) would eliminate the queueing effect. 31

32 Packet switching relies on queues - Queues are everywhere At the receiver At the sender Queue is everywhere 32

33 Queue is everywhere Computer network is a network of queues! Inbound flow Router Outbound flow 33

34 Goals Evaluate the system performance – Average queue length – Average waiting time – Loss probability due to buffer overflow – Improve the system performance – Determine the service rate with tolerable waiting time (upgrade the system with more capacity incurs investment cost. But long waiting time would be annoying to users) – Provide guaranteed packet loss probability with large enough buffer – (How large is enough?) – Control the queue to offer differentiated service to users 34

35 - The server is usually the transmission facility - The arrivals and the service time are random. - The service time: how long a packet will remain in service, directly related to the length of a packet - The buffer is the available space in the system. 1- Single Server Queuing Model Queuing Representation 35

36 2- Multi-Server Queue Arriving packets first go to empty servers. If more than one server is empty, any server is chosen randomly. Queuing Representation 36

37 Queues are represented via the notation: A/S/C/K - A: The arrival process of packets. M stands for Markovian (Poisson) process; λ is the arrival rate (the average number of packets arriving by unit time). The interarrival time is exponentially distributed with mean 1/λ. - S: The packet departure process. In case of M, the interdeparture time (the service time) is exponentially distributed with average service time 1/μ, where μ is the service rate. - C: the number of parallel servers in the system. - K: max. number of packets in the queue (the max. number of packets that can be accommodated in the buffer plus the number of servers). If K is missing, K = infinity. Ex: M/M/1 or M/M/1/N queue (Poisson arrivals, Exponential service time) 37

38 M/M/1 Queue - Packets arrival and departure follow Poisson distribution - Inter-arrival and inter-departure times follow exponential distribution -Why Poisson? Suitable to most real-world scenarios, where arrivals are independent

39 A simple queueing model (M/M/1 queue) 1 server, infinite buffer size Assumptions: 1) Customers arrive according to a Poisson distribution with parameter, where is the average number of arrivals per unit time. Let X be the number of arrival in [0,t ], 39

40 A simple queueing model (M/M/1 queue) Suppose we observe an arrival at and the next arrival at, where is a random variable, then i.e. has an exponential distribution with parameter. 40

41 A simple queueing model (M/M/1 queue) (2) The single server takes a random length of time,, to serve each customer and these times are independent random variables for different customers. has an exponential distribution with parameter : where is the average number of customers being served per unit time. 41

42 A simple queueing model (M/M/1 queue) Property of the exponential distribution i.e., the probability of the completion of a service in the next seconds is a constant, independent of how long the service has being going on ! The service time has no memory. Both random variables and have no memory! Summary: A single server queue with Poisson arrival and exponential service times is denoted as M/M/1 queue (where M stands for Markov — a process with no memory). 42

43 Analysis of the M/M/1 queue State : There are customers in the system (including the one being served, if any) The process is called “birth - death” process 43

44 M/M/1 queue Let Pn( t ) denote the probability that the system is in state n at time t, then Let Δ t → 0, we have 44

45 M/M/1 queue This indicates the fundamental recursive relationship of the “birth– death” process with “birth” parameter and “death” parameter. Steady state solution: where is called the traffic intensity or utilization factor. 45

46 M/M/1: State Balance Equation flow in rate = flow out rate Pn is the steady state probability at state n Steady state: a r.v. becomes stable in statistics (mean, variance,...) State balance equation: P n ( λ + µ) =P n+1 µ + P n−1 λ P 0 λ =P 1 µ At each state: rate at which the process leaves = rate at which it enters

47 M/M/1 queue Find P 0 : The average number of customers in the system is: The average number of customers in the queue is: 47 Since, we have Then, a geometric distribution

48 M/M/1 queue The time a customer must wait in the queue is There are n customers in the system when a new customer arrives Let W denote the mean time that a customer has to wait from the moment he arrives until he departures then The mean number of customers in the system is 48

49 Little's Law The long term average number of customers in a queuing system is – E (N ) = λE (T ) – where E (N ) is the average number of customers in the system, λ is the average arrival rate of customers and E (T ) is the average time a customer spends in the system – T = time wait in the buffer + time receiving service

50 M/M/1 queue “Little’s Law” says that for any work-conserving 1 queueing system, the average occupancy of the system must equal the average delay for the system multiplied by the average arrival rate. As the utilization increases, the delay increases correspondingly. At ρ =0. 5, the delay is twice as the transmission time. The probability that the queue exceeds a specified number 50 1 Working-conserving: any traffic ready to be served must be served.

51 M/M/1: System Performance The average number of customers in the whole system The average spending time of customers in the whole system (applying Little’s Law) – Increasing the mean service rate µ and reducing the mean arrival rate λ will reduce the sojourn time of customers in the system

52 M/M/1 queue Example: In an M/M/1 queue, customers arrive at the rate of λ =15 per hour. What is the minimum server rate to ensure that 1. the sever is idle at least 10% of the time 2. the expected value of the queue length is not to exceed 10? 3. the probability that at least 20people in the queue is at most 50%. Solution: λ =15 Note: for that at least 20 people in the queue, there are at least 21 people in the system. 52

53 M/M/1 queue Example 2.2: Consider a packet transmission system whose arrival rate (in packet/sec) is kλ, ( k> 1) and departure rate is kμ(service time is 1/( kμ) ). What is the average number of packets in the system? what is the average delay per packet? Solution: i) according to the Little’s Law ii) the average delay per packet is (Increasing the arrival and transmission rates by the same factor, the average delay is reduced by the factor) 53

54 M/M/1/N: Finite Buffer Queue – Arrival packets are dropped when the buffer is full – P B : blocking probability (prob. that buffer is full) State transition diagram

55 M/M/1/N: Blocking Probability P B

56 M/M/1/N queue Arrival rate: packet/sec; Blocking probability: ; Departure rate: packet/sec; Throughput : 56

57 Queues with dependence on state of system i) Multiserver situation; ii) Customer arrival rate decreasing with queue occupancy to keep the average occupancy down. Multiserver situation: λ and μ are function of n. The global balance equations for the steady-state probabilities are 57

58 Queues with dependence on state of system The global balance equations for the steady-state probabilities are 58 Derivation:

59 Queues with dependence on state of system Special case (M/M/N): With the condition,, we obtain 59

60 Queue with discouragement for (M/M/1) (as the queue size increase, the arrival rate drops accordingly), it can be derived: A finite birth-death, or state-dependent, queueing system with maximum queue size N The blocking probability: Throughput : 60

61 Example 2.3: Consider a M/M/m/m system (This model is in wide use in telephony or circuit switched networks). In this context, customers in the system correspond to active telephone conversations and the m servers represent a single transmission line consisting of m circuits. The principle quantity of interest here is the blocking probability, i.e., the steady-state probability that all circuits are busy, in which case an arriving call is refused service, and the blocked calls are lost. State representation: ) The balance condition is 61

62 Solving for P 0 in the equation Then, This equation is known as the Erlang B formula and find wide use in evaluating the blocking probability of telephone systems. 62

63 M/M/m/m: Multiple Server Finite Buffer Queue Telephone network: at most m calls can be connected at each time instant Arrival calls will be rejected if all m servers are busy – P B : blocking probability that an arrival call is rejected

64 M/M/m: m Parallel Servers with Infinite Buffer Performance metric: the probability that an arrival has to waiting in the queue (P Q )

65 M/M/m: Steady State Probability

66 M/M/m: Queuing Probability P Q All servers in the system are busy (Erlang's C formula)

67 Network of M/M/1 Queues 1 =  1 +  2 2 =  1 +  2 +  3 3 =  1 +  3 22 33 11 67

68 1 =  1 +  2 2 =  1 +  2 +  3 3 =  1 +  3 22 33 11 68

69 The time through the system is the sum of the time through each queuing component. 1 =  1 +  2 2 =  1 +  2 +  3 3 =  1 +  3 22 33 11 69

70 Summary of Chapter 2 With queueing theory, we construct model so that queue lengths and waiting time can be predicted. The results can be used to decide the resources needed to provide a service. – Determine the service rate with tolerable waiting time – Provide guaranteed packet loss probability with large enough buffer – Control the queue to offer differentiated service to users 70


Download ppt "Chap 2 Network Analysis and Queueing Theory 1. Two approaches to network design 1- “Build first, worry later” approach - More ad hoc, less systematic."

Similar presentations


Ads by Google