A T 77.9020 S elected T opic Queueing Analysis of C om ... - AIT

Document Sample
A T 77.9020 S elected T opic Queueing Analysis of C om ... - AIT Powered By Docstoc
					                                                                                                   A MATLAB/Octave Simulations of Queueing Systems


                                                                                                        To visualize behaviors of queueing systems, we can perform
                 AT77.9020 Selected Topic:                                                              computer simulations using MATLAB/Octave.
        Queueing Analysis of Communication Networks                                                     NOTE: Either MATLAB or Octave can be used.
                                                                                                        Can look through sessions 1-4 and 9 of UG202 course (ignoring
                                                                                                        in-class projects) to get familiar with MATLAB/Octave.
                                Poompat Saengudomlert
                                                                                                                            www.tc.ait.ac.th/faculty/poompat/UG202
                               Asian Institute of Technology (AIT)


                                       Session 7, 2012                                                  Key features of MATLAB/Octave to be used initially
                                                                                                        - Basic matrix maniputations
                                                                                                        - Random number generators
                                                                                                        - Graph plotting



 Poompat Saengudomlert (AIT)      Queueing Analysis of Comm. Networks   Session 7, 2012   1 / 10    Poompat Saengudomlert (AIT)    Queueing Analysis of Comm. Networks   Session 7, 2012   3 / 10



Outlines                                                                                           A.1 Generations of Poisson Processes


                                                                                                   Task to do:
                                                                                                        Generate a Poisson process of rate λ.
  1   A MATLAB/Octave simulations of queueing systems                                                   Generate a total of P arrivals.
  2   A.1 Generations of Poisson processes                                                              Store results as P × 1 matrix containing arrival times.
      - Separated generations
      - Combined generations                                                                       Method:
  3   A.2 Traffic aggregation and Poisson processes                                                       Generate P exponential interarrival times.
      - Histogram of interarrival times
      - Justification of Poisson arrival models                                                                            int arr time = exprnd(1/lambda,P,1);
                                                                                                        Sum interarrival times to get arrival times.
                                                                                                                              arr time = cumsum(int arr time);



 Poompat Saengudomlert (AIT)      Queueing Analysis of Comm. Networks   Session 7, 2012   2 / 10    Poompat Saengudomlert (AIT)    Queueing Analysis of Comm. Networks   Session 7, 2012   4 / 10
Generations of multiple Poisson Processes                                                        Method 2: Splitting a Single Poisson Proces


Task to do:
     Generate N Poisson processes each with rate λ/N.                                                 Generate interarrival times for a process of rate λ.
     Generate a total of P arrivals for all processes.
                                                                                                                     all int arr time = exprnd(1/lambda,P,1);
     Store results as P × 1 matrix containing arrival times, and as another
     P × 1 matrix containing process number for each arrival.                                         Sum interarrival times to get arrival times.
                                                                                                                     all arr time = cumsum(all int arr time);
Example practical scenario:
                                                                                                      Generate process numbers associated with P arrivals.
     Each process can model traffic demand arrivals from one group of
     users.                                                                                                                     all pro num = unidrnd(N,P,1);
     The combined arrivals are served by a common network resource, e.g.
     a transmission link.



 Poompat Saengudomlert (AIT)    Queueing Analysis of Comm. Networks   Session 7, 2012   5 / 10    Poompat Saengudomlert (AIT)      Queueing Analysis of Comm. Networks   Session 7, 2012   7 / 10



Method 1: Separate Generations of Poisson Processes                                              A.2 Traffic Aggregation and Poisson Processes

     Generate interarrival times for N processes as well as process numbers
     associated with arrivals.
                int arr time = exprnd(N/lambda,P/N,N);                                           Compare interarrival time distributions from simulation and expression.
                pro num = ones(P/N,N)*diag(1:N);                                                      Generate P interarrival times with mean 1/λ
     Sum interarrival times to get arrival times.                                                                       int arr time = exprnd(1/lambda,P,1);
                           arr time = cumsum(int arr time);                                           Generate histogram normalized to total area 1
     Combine all arrival times and all process numbers into P × 1 matrices.                                                 x = 0:stepsize:5/lambda;
                        temp1 = reshape(arr time,P,1);                                                                      hist(int arr time,x,1/stepsize);
                        temp2 = reshape(pro num,P,1);
                                                                                                      Generate PDF curve from expression fX (x) = λe −λx .
     Sort all arrival times and create P × 1 matrix of process numbers
     corresponding to arrivals.                                                                                  hold on; plot(x,lambda*exp(-lambda*x),’r’);
                     [sort val,sort ind] = sort(temp1);
                     all arrival time = sort val;
                     all pro num = temp2(sort ind);
 Poompat Saengudomlert (AIT)    Queueing Analysis of Comm. Networks   Session 7, 2012   6 / 10    Poompat Saengudomlert (AIT)      Queueing Analysis of Comm. Networks   Session 7, 2012   8 / 10
Uniform Interarrival Times


Now try the following.
     Generate uniform instead of exponential interarrival times.
     (Use unifrnd instead of exprnd.)
     Generate separately N arrival processes.
     Each process has IID interarrival times according to uniform random
     PDF in interval [0, 2N/λ], i.e. mean equal to N/λ.
     Plot histogram of interarrival times from the combined process.
     Compare to exponential PDF with mean 1/λ.
     Vary N from 1, 2, to 4.
NOTE: Example results are on next slide.



 Poompat Saengudomlert (AIT)       Queueing Analysis of Comm. Networks        Session 7, 2012    9 / 10



          1
                                                    4
        0.8                            λ=1,P=10 ,stepsize=0.1,N=1
        0.6
        0.4
        0.2
          0
               0               1               2                3        4                 5

          1
                                                    4
        0.8                            λ=1,P=10 ,stepsize=0.1,N=2
        0.6
        0.4
        0.2
          0
               0               1               2                3        4                 5

          1
        0.8                            λ=1,P=104,stepsize=0.1,N=5
        0.6
        0.4
        0.2
          0
               0               1               2                3        4                 5

     NOTE: Traffic aggregation leads to exponential interarrival times.
 Poompat Saengudomlert (AIT)       Queueing Analysis of Comm. Networks       Session 7, 2012    10 / 10

				
DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
views:12
posted:3/24/2013
language:English
pages:3