You are on page 1of 22

CPEN 447- Advanced Teletraffic Engineering Project 1 Queuing Disciplines

Submitted By: Abeer Abou Hait Grace Yammine Nicole Tannous Farouk Jammal Submitted To: Professor J.Daba
24-04-2012

Introduction:
In this project, we will compute the latencies of all applications (services) for all queuing disciplines using both GPRS and EDGE technologies. We will generate graphs of latencies versus the various traffic classes. We will also discuss the Kleinrocks conservation law. Any queue consists of three components: an arrival process which determines when customers arrive at the queue and what there characteristics are; a buffer (also referred to as the queue itself) where customers wait to be served and a service time requirement for each customer at the server serving the queue. By convention, the term queue length includes the customer currently being served, if any. Thus for an empty queue, the server is idle. Customer's service time is determined by the demand

of the customer expressed in units of work and the service rate of the server specified by work units performed in unit time. Service time is then the demand divided by the rate. Queues are classified according to Kendalls notation which in its original form defines the class A/S/m as follows:

A describes the nature of the arrival process. If for example the arrival process is Poisson, A=M for Markovian or memoryless. If the inter-arrival times are constant, A=D for deterministic. For a general inter-arrival rate A=G. The arrival rate is conventionally denoted by which is the reciprical of the mean inter-arrival time. In general may depend on the number of customers in the queue

S' denotes the service time distribution. We could have S=M for Markovian service time, i.e. one with exponential distribution, S=D for deterministic or constant service times.

m denotes the number of servers available to give service to the customers in the queue. The Queueing discipline describes how the server decides which customer in the queue to pick next for service. Common disciplines are:

First in first out FIFO in which customers are served in strict order of arrival. Last in first out LIFO under which the most recent arrival is served first. Kendall's notation has been extended to include two additional fields that define the capacity of the buffer/waiting room, c, and the population of the customer pool, i.e. the maximum number of customers, p. The queue is then specified as A?S/m/c/p. If c and p are unspecified they are assumed to be infinite. Now, The latency L is obtained by calculating the sum of the waiting time Tw and the service time Ts. Ts= Average Frame Size / Channel Capacity. The Channel Capacity is given in Kbps so we multiply it by 1000 to get it in bits per second. The average frame size is given in bytes per frame, so we convert it to bits per frame by multiplying the value by 8. To compute the waiting time Tw we need to get the arrival rate, the variable service time, the inter arrival time and the variable inter arrival time. Arrival Rate = Mean bit arrival rate (Rb) / Average Frame Size. The mean bit arrival rate was given in Kbps so we multiplied it by 1000 to get it in bits per second and the average frame size was given in bytes per frame so we multiplied it by 8 to get it in bits per frame. varServiceTime = (64 * varFrameSize) / ( channelCapacity^2). varInterArrivalTime = ((SAR)^2) * (interArrivalTime^2).

For a D/D/1 and G/G/1 distribution, we compute the waiting time Tw using the following formula: Tw= (arrival Rate/2) * ((varServiceTime^2 + varInterArrivalTime^2) / (1 arrival Rate*service Time)) For an exponential M/G/1 distribution, a Pollaczek-Khintchine formula is used: Tw= ((arrivalRate^2 * ((service Time * (1 + SAR)) ^2)) / (2 * (1 arrival Rate * service Time)))/arrival rate.

I-

Type of queuing dispatching : FIFO

A- GPRS technology:
1) CS-1 time slot 1: channel capacity 9.05 Kbps a- Not peaky traffic: SAR=1
%FIF0 - GPRS - CS1 - 1 Time slot clear all; close all; classesNb = 6; waitingTime = zeros(1,6); i = 1; %%%%%%%%%%%%%%%%%%%%%%%%%%% % Traffic Classes % %%%%%%%%%%%%%%%%%%%%%%%%%%% % 1 Voice Messaging G/G/1 % % 2 Telnet M/G/1 % % 3 Audio Streaming G/G/1 % % 4 Video Streaming G/G/1 % % 5 Email M/G/1 % % 6 FTP G/G/1 % %%%%%%%%%%%%%%%%%%%%%%%%%%% % CS1 - 1 TS channelCapacity = 9.05 * 1000; % 1 Voice messaging %%%%%%%%%%%%%%%%%%%%%%%%%%% averageFrameSize = 31; arrivalRate = (1000 * 10.7) / (8 * averageFrameSize); serviceTime = 8 * averageFrameSize / channelCapacity; varFrameSize = 4; varServiceTime = (64 * varFrameSize) / ( channelCapacity^2); SAR = 1; interArrivalTime = 0.02308; varInterArrivalTime = ((SAR)^2) * (interArrivalTime^2); ETwSup = (arrivalRate/2) * ((varServiceTime^2 + varInterArrivalTime^2) / (1 arrivalRate*serviceTime)); ETqSup = ETwSup + serviceTime; waitingTime(i) = ETqSup; i = i + 1; % 2 Telnet %%%%%%%%%%%%%%%%%%%%%%%%%%% averageFrameSize = 64; arrivalRate = (1000 * 0.512) / (8 * averageFrameSize); throughput = arrivalRate;

serviceTime = 8 * averageFrameSize / channelCapacity; SAR = 1; ETs2 = (serviceTime * (1 + SAR))^2; %Mean buffer length ENw = (arrivalRate^2 * ETs2) / (2 * (1 - arrivalRate * serviceTime)); ETw = ENw / throughput; ETq = ETw + serviceTime; waitingTime(i) = ETq; i = i + 1; % 3 Audio streaming %%%%%%%%%%%%%%%%%%%%%%%%%%% averageFrameSize = 200; arrivalRate = (1000 * 20) / (8 * averageFrameSize); serviceTime = 8 * averageFrameSize / channelCapacity; varFrameSize = 4; varServiceTime = (64 * varFrameSize) / ( channelCapacity^2); SAR = 1; interArrivalTime = 0.08; varInterArrivalTime = ((SAR)^2) * (interArrivalTime^2); ETwSup = (arrivalRate/2) * ((varServiceTime^2 + varInterArrivalTime^2) / (1 arrivalRate*serviceTime)); ETqSup = ETwSup + serviceTime; waitingTime(i) = ETqSup; i = i + 1; % 4 Video streaming %%%%%%%%%%%%%%%%%%%%%%%%%%% averageFrameSize = 320; arrivalRate = (1000 * 64) / (8 * averageFrameSize); serviceTime = 8 * averageFrameSize / channelCapacity; varFrameSize = 4; varServiceTime = (64 * varFrameSize) / ( channelCapacity^2); SAR = 1; interArrivalTime = 0.04; varInterArrivalTime = ((SAR)^2) * (interArrivalTime^2); ETwSup = (arrivalRate/2) * ((varServiceTime^2 + varInterArrivalTime^2) / (1 arrivalRate*serviceTime)); ETqSup = ETwSup + serviceTime; waitingTime(i) = ETqSup; i = i + 1; % 5 Email %%%%%%%%%%%%%%%%%%%%%%%%%%% averageFrameSize = 500; arrivalRate = (1000 * 4) / (8 * averageFrameSize); throughput = arrivalRate; serviceTime = 8 * averageFrameSize / channelCapacity; SAR = 1; ETs2 = (serviceTime * (1 + SAR))^2; %Mean buffer length ENw = (arrivalRate^2 * ETs2) / (2 * (1 - arrivalRate * serviceTime)); ETw = ENw / throughput; ETq = ETw + serviceTime; waitingTime(i) = ETq; i = i + 1; % 6 FTP %%%%%%%%%%%%%%%%%%%%%%%%%%% averageFrameSize = 500; arrivalRate = (1000 * 55) / (8 * averageFrameSize); serviceTime = 8 * averageFrameSize / channelCapacity; varFrameSize = 4; varServiceTime = (64 * varFrameSize) / ( channelCapacity^2); SAR = 1;

interArrivalTime = 0.5; varInterArrivalTime = ((SAR)^2) * (interArrivalTime^2); ETwSup = (arrivalRate/2) * ((varServiceTime^2 + varInterArrivalTime^2) / (1 arrivalRate*serviceTime)); ETqSup = ETwSup + serviceTime; waitingTime(i) = ETqSup; i = i + 1; stem(waitingTime); grid on xlabel('Application Class Number') ylabel('Queueing Time') title('Latencies Versus Traffic Classes')

The following is the graph of the latencies versus the various traffic classes.

b- Very Peaky traffic SAR=10 We used the same Matlab code as before but we replaced the SAR value by 10 instead of 1. The following is the obtained result.

2) CS-4 time slot 8: channel capacity 171.2 Kbps a- Not peaky traffic: SAR=1 The Matlab code used is the same as the previous one with the difference that the channel capacity is 171.2 Kbps now and the SAR value is 1. The following is the obtained result.

b- Very Peaky traffic SAR=10

The Matlab code used is the same as the previous one with the difference that the channel capacity is 171.2 Kbps now and the SAR value is 10. The following is the obtained result.

B- EDGE technology:
1) Time slot 1: channel capacity 69.2 Kbps a- Not peaky traffic: SAR=1 The Matlab code used is the same as the previous one with the difference that the channel capacity is 69.2 Kbps now and the SAR value is 1. The following is the obtained result.

b- Very Peaky traffic SAR=10 The Matlab code used is the same as the previous one with the difference that the channel capacity is 69.2 Kbps now and the SAR value is 10. The following is the obtained result.

2) Time slot 8: channel capacity 553.6 Kbps a- Not peaky traffic: SAR=1 The Matlab code used is the same as the previous one with the difference that the channel capacity is 553.6 Kbps now and the SAR value is 1. The following is the obtained result.

b- Very Peaky traffic SAR=10 The Matlab code used is the same as the previous one with the difference that the channel capacity is 553.6 Kbps now and the SAR value is 10. The following is the obtained result.

II-

Type of queuing dispatching: Priority Resume

A- GPRS technology:
1) CS-1 time slot 1: channel capacity 9.05 Kbps
% Priority Resume - GPRS - CS1 - 1 TimeSlot clear all; close all; classesNb = 6; %%%%%%%%%%%%%%%%%%%%% % Traffic Classes % %%%%%%%%%%%%%%%%%%%%% % 1 Voice Messaging % % 2 Telnet % % 3 Audio Streaming % % 4 Video Streaming % % 5 Email % % 6 FTP % %%%%%%%%%%%%%%%%%%%%% % CS1 - 1 TS channelCapacity = 9.05 * 1000; % Ascending order = Shortest packet first averageFrameSize = [31, 64, 200, 320, 500, 500]; arrivalRate = [10.7, 0.512, 20, 64, 4, 55]; priorities = zeros(1,classesNb); prioritizedArrivalRate = zeros(1,classesNb); prioritizedAverageFrameSize = zeros(1,classesNb); % Assigning priorities for traffic classes for i=1:classesNb priority = input ('Please assign class priority: '); prioritizedArrivalRate(i) = arrivalRate(priority); prioritizedAverageFrameSize(i) = averageFrameSize(priority); priorities(i) = priority; end % Getting the arrival rate vector in packet/sec with respect to the % assigned priorities for i=1:classesNb, arrivalRate(i) = 1000 * (prioritizedArrivalRate(i) / (8 * averageFrameSize(i))); end serviceTime = zeros(1, classesNb); % Computing the mean frame service time for i=1:classesNb, serviceTime(i) = 8 * prioritizedAverageFrameSize(i) / channelCapacity; end varFrameSize = zeros(1, classesNb); for i=1:classesNb, if(priorities(i)==1) varFrameSize(i)=0; elseif(priorities(i)==2) varFrameSize(i)=6; elseif(priorities(i)==3) varFrameSize(i)=0; elseif(priorities(i)==4) varFrameSize(i)=8; elseif(priorities(i)==5) varFrameSize(i)=8; elseif(priorities(i)==6) varFrameSize(i)=4; end end

varServiceTime = zeros(1, classesNb); % Computing service time variance for i=1:classesNb, varServiceTime(i) = (64 * varFrameSize(i) ) / ( channelCapacity^2); end ETs2 = zeros(1, classesNb); % Computing service time second order statistics for i=1:classesNb, ETs2(i) = varServiceTime(i) + (serviceTime(i))^2; end ro = zeros(1, classesNb); ETw = zeros(1, classesNb); % Computing mean waiting time per class k for k=1:classesNb, ro(k) = arrivalRate(k) * serviceTime(k); end for k=1:classesNb, numerator = 0; denom1 = 0; denom2 = 0; for i=1:k, numerator = numerator + arrivalRate(i) * ETs2(i); end if(k==1) denom1 = 0; else for i=1:k-1, denom1 = denom1 + ro(i); end end for j=1:k, denom2 = denom2 + ro(j); end denominator = 2 * (1 - denom1) * (1 - denom2); ETw(k) = numerator / denominator; end % Computing mean queuing time (latency) per class k ETqk = ETw + serviceTime; % Kleinrock's Conservation Law sumRo = sum(ro); r = 0; for i=1:classesNb, r = r + arrivalRate(i) * ETs2(i); end R = 0.5*r; p1 = zeros(1, classesNb); for i=1:classesNb, p1(i) = ro(i) * ETw(i); end p2 = (( sumRo * R ) / (classesNb * ( 1 - sumRo))); e = zeros(1, classesNb); for i=1:classesNb, e(i) = p1(i) - p2; end sumE = sum(e); stem(ETqk); grid on xlabel('Application Class Number') ylabel('Queueing Time') title('Latencies Versus Traffic Classes') figure stem(p1,'b','LineWidth',3); grid on xlabel('Application Class Number') ylabel('Sum (ro * ETw)') title('Kleinrock Conservation Law') hold on for i=1:6, p2Line(i) = p2; end plot(p2Line,'r');

The following is a graph of latencies versus traffic classes and a graph showing if Kleinrock conservation law applies.

Note here that Kleinrock's conservation law does not apply

2) CS-4 time slot 8: channel capacity 171.2 Kbps The Matlab code used is the same as the previous one with the difference that the channel capacity is 171.2 Kbps now.

The following is a graph of latencies versus traffic classes and a graph showing if Kleinrock conservation law applies.

Note here that Kleinrock's conservation law does not apply

B- EDGE technology:
1) Time slot 1: channel capacity 69.2 Kbps

The Matlab code used is the same as the previous one with the difference that the channel capacity is 69.2 Kbps now. The following is a graph of latencies versus traffic classes and a graph showing if Kleinrock conservation law applies.

Note here that Kleinrock's conservation law does not apply

2) Time slot 8: channel capacity 553.6 Kbps

The Matlab code used is the same as the previous one with the difference that the channel capacity is 553.6 Kbps now. The following is a graph of latencies versus traffic classes and a graph showing if Kleinrock conservation law applies.

Note here that Kleinrock's conservation law does not apply

III- Type of queuing dispatching : Priority Non Resume


A- GPRS technology:

1) CS-1 time slot 1: channel capacity 9.05 Kbps


% Non Preemptive Resume - GPRS - CS1 - 1 TimeSlot clear all; close all; classesNb = 6; %%%%%%%%%%%%%%%%%%%%% % Traffic Classes % %%%%%%%%%%%%%%%%%%%%% % 1 Voice Messaging % % 2 Telnet % % 3 Audio Streaming % % 4 Video Streaming % % 5 Email % % 6 FTP % %%%%%%%%%%%%%%%%%%%%% % CS1 - 1 TS channelCapacity = 9.05 * 1000; % Ascending order = Shortest packet first averageFrameSize = [31, 64, 200, 320, 500, 500]; arrivalRate = [10.7, 0.512, 20, 64, 4, 55]; priorities = zeros(1,classesNb); prioritizedArrivalRate = zeros(1,classesNb); prioritizedAverageFrameSize = zeros(1,classesNb); % Assigning priorities for traffic classes for i=1:classesNb priority = input ('Please assign class priority: '); prioritizedArrivalRate(i) = arrivalRate(priority); prioritizedAverageFrameSize(i) = averageFrameSize(priority); priorities(i) = priority; end % Getting the arrival rate vector in packet/sec with respect to the % assigned priorities for i=1:classesNb, arrivalRate(i) = 1000 * (prioritizedArrivalRate(i) / (8 * averageFrameSize(i))); end serviceTime = zeros(1, classesNb); % Computing the mean frame service time for i=1:classesNb, serviceTime(i) = 8 * prioritizedAverageFrameSize(i) / channelCapacity; end varFrameSize = zeros(1, classesNb); for i=1:classesNb, if(priorities(i)==1) varFrameSize(i)=0; elseif(priorities(i)==2) varFrameSize(i)=6; elseif(priorities(i)==3) varFrameSize(i)=0; elseif(priorities(i)==4) varFrameSize(i)=8; elseif(priorities(i)==5) varFrameSize(i)=8; elseif(priorities(i)==6) varFrameSize(i)=4; end end varServiceTime = zeros(1, classesNb); % Computing service time variance for i=1:classesNb, varServiceTime(i) = (64 * varFrameSize(i) ) / ( channelCapacity^2);

end ETs2 = zeros(1, classesNb); % Computing service time second order statistics for i=1:classesNb, ETs2(i) = varServiceTime(i) + (serviceTime(i))^2; end ro = zeros(1, classesNb); ETw = zeros(1, classesNb); % Computing mean waiting time per class k for k=1:classesNb, ro(k) = arrivalRate(k) * serviceTime(k); end for k=1:classesNb, numerator = 0; denom1 = 0; denom2 = 0; for i=1:classesNb, numerator = numerator + arrivalRate(i) * ETs2(i); end if(k==1) denom1 = 0; else for i=1:k-1, denom1 = denom1 + ro(i); end end for j=1:k, denom2 = denom2 + ro(j); end denominator = 2 * (1 - denom1) * (1 - denom2); ETw(k) = numerator / denominator; end % Computing mean queuing time (latency) per class k ETqk = ETw + serviceTime; % Kleinrock's Conservation Law sumRo = sum(ro); r = 0; for i=1:classesNb, r = r + arrivalRate(i) * ETs2(i); end R = 0.5*r; p1 = zeros(1, classesNb); for i=1:classesNb, p1(i) = ro(i) * ETw(i); end p2 = (( sumRo * R ) / (classesNb * ( 1 - sumRo))); e = zeros(1, classesNb); for i=1:classesNb, e(i) = p1(i) - p2; end sumE = sum(e); stem(ETqk); grid on xlabel('Application Class Number') ylabel('Queueing Time') title('Latencies Versus Traffic Classes') figure stem(p1,'b','LineWidth',3); grid on xlabel('Application Class Number') ylabel('Sum (ro * ETw)') title('Kleinrock Conservation Law') hold on for i=1:6, p2Line(i) = p2; end plot(p2Line,'r');

The following is a graph of latencies versus traffic classes and a graph showing if Kleinrock conservation law applies

Note here that the Kleinrock's conservation law applies and sumE is equal to zero

2) CS-4 time slot 8: channel capacity 171.2 Kbps The Matlab code used is the same as the previous one with the difference that the channel capacity is 171.2 Kbps now. The following is a graph of latencies versus traffic classes and a graph showing if Kleinrock conservation law applies.

Note here that the Kleinrock's conservation law applies and sumE is equal to zero

B- EDGE technology:
1) Time slot 1: channel capacity 69.2 Kbps

The Matlab code used is the same as the previous one with the difference that the channel capacity is 69.2 Kbps now. The following is a graph of latencies versus traffic classes and a graph showing if Kleinrock conservation law applies.

Note here that the Kleinrock's conservation law applies and sumE is equal to zero

2) Time slot 8: channel capacity 553.6 Kbps The Matlab code used is the same as the previous one with the difference that the channel capacity is 553.6 Kbps now.

The following is a graph of latencies versus traffic classes and a graph showing if Kleinrock conservation law applies.

Note here that the Kleinrock's conservation law applies and sumE is equal to zero

Discussion:

As we saw from the graphs verifying the Kleinrock's conservation law which states that The average waiting time for all classes weighted by the traffic (load) of the mentioned class, is independent of the queue discipline. We may thus give a small proportion of the traffic a very low waiting time, without increasing the average waiting time of the remaining customers very much. By various strategies we may allocate waiting times to individual customers according to our preferences.

You might also like