You are on page 1of 16

STUDENT NAME SULAIM BIN AB QAIS ID NUMBER

PACKET TRAFFIC USING


ERLANG C DISTRIBUTION
TITLE
MODEL OF M/M/1 USING
MATLAB

1|Page
TABLE OF CONTENT

INTRODUCTION Pg 3

METHODOLOGY Pg 6

DATA AND ANALYSIS Pg 14

CONCLUSION Pg 16

REFERENCE Pg 16

2|Page
INTRODUCTION
Telecommunication traffic or teletraffic engineering is the application of traffic engineering
to telecommunication. We use statistical data which include queuing theory, the nature of
traffic, and simulation to make predictions and plan telecommunication network or the
internet. As the result, reliable service with lower cost can be achieved.
This field is founded by A. K. Erlang for circuit-switch network. However, as packet -switch
network exhibit Markovian Properties which can be modelled by Poisson arrival process,
Erlang’s work is applicable for packet-switch network [1].

Queueing theory is the mathematical study of waiting lines or queues. The study is modelled
to predict probability of queue length and waiting time. This model is developed by A. K.
Erlang to describe the Copenhagen telephone exchange [2].

Erlang determine the probability of encountering delay, when traffic, A is offered to a


queuing system with N trunk/server as shown in figure 1.1:

Figure 1.1
Erlang’s solution depends on the following assumption:
1. Call arrival & termination are random in nature (pure-chance traffic)
2. Statistical equilibrium – probability of arriving call at busy hour equal to the
probability of ending the call (value of A must less N)
3. Full availability – server will directly process the memory/Queue traffic when
available
4. Calls which encounter congestion enter a queue are stored until server becomes free

Such system is sometimes known as M/M/N system. In queueing theory there were
several representation of queuing systems. M/M/1 queue represent the queue length with
single server. In this representation, arrivals are determined by poisson process. If A>N,
calls are entering the system at a greater rate than they leave. As the result, the length of
the queue must continually increase towards infinity. This is not statistical equilibrium.

3|Page
Let X be the total number of calls in the system.
Thus, when X<N, then X calls are being served and there is no delay or no congestion.
When X>N , all the servers are busy and incoming calls encounter delay; there are N calls
being served and X-N calls in the queue.
Probability of a call arrive in a very short period of time is given by :
(offered traffic x time)/mean service time.
Delay occurs if all servers are busy when X>N. When probability of delay increases the
Grade Of Service (GOS) increase. We wanted to have lower GOS as possible, thus a
design must have low delay probability.
Probability of delay denoted as E2,N(A) is significant only when X>=N. E2,N(A) is
known as Erlang delay formula and A is the offered traffic/ traffic intensity in Erlang
unit. E2,N(A) shows that when we increase offered traffic per server (A/N), the probability
of delay increase until it reaches probability of 1 which is 100% [3].

Erlang-A know as the first Erlang formula while Erlang-B known use in loss-network.
Erlang C is used in queuing network [4].

Erlang C is a mathematical equation that we use in this study. It calculates the probability
that a call waits (Pw) by applying N number of servers/trunks at a given traffic
Intensity/offered traffic (A).

Equation (1.1)

If we have 200 calls per hour, and the average duration of each call is 3 minutes, then we
have 600 minutes of total call duration per hour. 600 minutes is equal to 10 hours call
duration. Thus, the traffic intensity, A is 10 Erlangs (10 hour call duration observed in 1
hour). This means that we need minimum of 10 servers/trunks, N. This minimum server

4|Page
is only applicable if when all calls arrive at exactly the moment that the previous call has
finished and there is no queuing. Meaning we need to have more than 10 servers
Nevertheless, by using erlang C formula we can understand the probability a call waits
and work out on the service level.
To calculate the service level as formula below :

Equation (1.2)
Target time is the time calls are answered in second. This must be greater than average
speed of answer (ASA), we may need to check this first by referring equation 1.3.
AHT is the average handling time is the average call duration in second.
Service level is unitless which can be represented in percentage by multiplying by 100. If
our service level target is 80% and we get less than that, we need to increase the number
of server/trunk.
Average Speed of answer (ASA) is given as below [5]:

Equation (1.3)

In packet traffic A is replaced with ρ which is the arrival rate. The arrival rate can be
calculated based on the bit rate over line speed or server speed.
In this paper we will answer the below question based on the MATLAB simulation.
Consider packets arrived in a network is according to Poisson processes; the packets
transmission times in nodes are assumed to be independent and exponentially distributed
based on M/M/1 queueing system. The link of the network is using E1 carrier and the lost
call delayed system is operating in the network. In average, the new packet arrival rate is
2980 per second with average packet length size of 55 bytes.
Evaluate the network capability in handling the arrival of the packets. Analyze the
probability of the packets being delayed and the average delay for all the packets to reach
the server. Next, compute the probability of the packets to be delayed exceeding 10 µsec
and the probability of the packets to be delayed more than 4 msec. Observe all the
situations and state your comment regarding the delay of the packets. Finally, set up the
transition diagram for this network system.

5|Page
METHODOLOGY
Measurement Tools: Hardware and software used in this analysis :
1. Desktop PC specification as below:
Operating System : Windows 10
Processor : Intel ® Core™ i7-6700K CPU @ 4GHz
Installed memory (RAM) : 8 GB (7.89GB usable)
System Type: 64-bit Operating system, x640based processor
2. MATLAB R2020a Software (Trial Version) with ‘SimEvent’ library

Experimental Setup : Installation of MATLAB R2020a software (trial version)


1. Go to link https://www.mathworks.com/campaigns/products/trials.html
2. Check ‘I agree’ radio button and click ‘SUBMIT’

3. Pick the ‘Simulink Essentials’ package as below by clicking on the image

4. Click ‘Select and Continue’

6|Page
5. Click on ‘Windows’. The software started downloading. The file size is about
222MB.

6. Open the downloaded file and run. The unzip process appeared as below :

7. Insert my email and click ‘Next’.

8. Insert your MATLAB account password.

7|Page
9. Check radio button ‘Agree’ and click ‘Next’.

10. Select your license and click ‘Next’. We can select either listed license that are in the
list.

11. Select the destination for MATLAB software installation and click ‘Next’.

12. Select the check list as below and click ‘Next’.

8|Page
13. Click ‘Next’ until landed on the page with button ‘Begin Install’. Click this button to
run the installation.

14. After we finish the installation open MATLAB Software from Desktop icon

Experimental Setup: Coding the Simulation:


1. Create a folder named ‘New folder’ in Desktop.
2. Get Erlang B and Erlang C function script from MATLAB forum as below:
Erlang B
function B = erlangb (n, A)
% This function computes the Erlang B probability that a system with n
% servers, no waiting line, Poisson arrival rate lambda, service rate
% (per server) mu, and intensity A = lambda / mu will have all servers
busy.
% The probability is B=(A^m / m!) / (sum (A^k / k!), k=0…m)
% The recurrence is B (0, A) = 1.
% B (n, A)=(A*B (n - 1, A) / n) / (1+A*B (n - 1, A) / n)
if ( (floor (n) ~= n) | (n < 1) )
warning ('n is not a positive integer');
A=NaN;
return;
end;

9|Page
if (A < 0.0)
warning ('A is negative!');
A=NaN;
return;
end;
B=1;
for k=1:n,
B=( (A*B) / k) / (1 + A*B / k);
end;
function C=erlangc (n, A)
% This function computes the Erlang C probability that a system with n
% servers, infinite waiting line, Poisson arrival rate lambda, service rate
% (per server) mu, and intensity A=lambda / mu will have all servers busy.
% It uses the formula C (n, A)=n*B (n, A) / (n-A*(1 - B (n, A) ) )
if ( (floor (n) ~= n) | (n < 1) )
warning ('n is not a positive integer');
A=NaN;
return;
end;
if (A < 0.0)
warning ('A is negative!');
A=NaN;
return;
end;
B=erlangb (n, A);
C=n*B / (n - A*(1 - B) );

Erlang C
function C=erlangc(n,A)
% This function computes the Erlang C probability that a system with n
% servers, infinite waiting line, Poisson arrival rate lambda, service rate
% (per server) mu, and intensity A=lambda / mu will have all servers busy.
% It uses the formula C (n, A)=n*B (n, A) / (n-A*(1 - B (n, A) ) )
if ( (floor (n) ~= n) | (n < 1) )
warning ('n is not a positive integer');
A=NaN;
return;
end;
if (A < 0.0)
warning ('A is negative!');
A=NaN;
return;
end;
B=erlangb (n, A);
C=n*B / (n - A*(1 - B) );

3. Copy and paste this script in separate notepad; one for erlang B and another for
Erlang C and save as erlangb.m and erlangc.m respectively inside the ‘New folder’.
4. In MATLAB window locate the folder and double click both erlangb.m and erlangc.m
to open the tab as picture shows.

10 | P a g e
5. Click the + button to add a new tab.
6. Write the code as below to simulate the Erlang C calculation and to answer the
question given.
Lambda = 2980; % Packet arrival rate 2980 packet per second
L = 55*8; % packet average length 55Byte x 8 = 440 bits
S = 2048000; % speed of the server of 2.048Mbps
A = (Lambda*L)/S;%Arrival rate
n = 1; % number of server. Normally packet traffic we use 1 because of
point to point connection
C=erlangc (n,A);% p(delay>0)probability waiting happen.
h=A/Lambda; %Holding time
D = C*h/(n-A);% Average call delay in second = p(delay>0) x h/(n-A)
t = 0:0.00001:0.005; %x axis plot with resolution of 1us
Pd = C*exp(-(n-A)*(1/h)*t); %Pd is a probability packet to be delay
exceeding time t
plot (t,Pd, 'r');
xlabel ('Packet waiting time (s)');
ylabel ('Probability of arriving packet exceeding waiting time');

11 | P a g e
Experimental Setup: Flow Chart of MATLAB Code

12 | P a g e
Experimental Setup: Data collection technique:
1. Click the ‘Run’ icon and the script will run and generate the plot and calculate the
variable value.

2. Average packet delay acquired by writing “D” and enter in the Command Windows
and press ‘Enter’.
3. Probability of the packets being delayed acquired by writing “C” in the Command
Windows and press ‘Enter’.
4. Probability of the packets to be delayed exceeding certain time acquired by writing
‘Pd(t==[exceed time delay in s])’ and press ‘enter’.

13 | P a g e
DATA AND ANALYSIS
Answering the question based on the MATLAB Coding simulation:
1. Probability of the packets being delayed is equal to
= 0.6402
This value shows that 64.02% of the packet arrive will have some delay in this system
before enter the server for process. Thus, 35.98% of the packet will be directly
process by the server without any delay.

2. The average delay for all the packets to be processed by the server is equal to
= 3.8233e-04 s = 0.00038233s = 382.33us
This average delay shows that average packet will encounter 382.33us before
accepted by the server to be process.

3. Probability of the packets to be delayed exceeding 10 µsec


= 0.6296
The probability of the packet to delay more than z time is the probability of arriving
packet has to wait longer than z time. The probability of arriving packet has to wait
longer than 10us is 62.96%. Meaning, that 37.07% of the packet will not be delay
more than 10us.

4. Probability of the packets to be delayed more than 4 msec


= 7.8951e-04 = 0.0007895
The probability of the packet to delay more than z time is the probability of arriving
packet has to wait longer than z time. The probability of arriving packet has to wait
longer than 4 ms is 0.07895%. Meaning, that the 99.921% of the packet will not be
delay more than 4 ms.

The simulation probability of packet needs to wait is important in determining the


customer satisfaction of how much delay most of the service will suffer. As having
non-delay system is costly, by implementing some acceptable delay could save much
cost. Nevertheless, the implementation of delay system should be low as possible until
it is unnoticeable by the user.

14 | P a g e
Packet delay waiting time = 1.2

Figure 2.1 shows probability of arriving packet exceeded target waiting time

The probability of packet delay reduced exponentially as target waiting time increase. From
the plotting we can understand that 10% of the arrived packet need to wait more than 1.2 ms.
Thus, we can say that this system having 90% of the packet need to wait less than 1.2 ms.

2980 packet per second

Departure time = 0.0015s

Figure 2.2 shows the state transition diagram of M/M/1 system

15 | P a g e
CONCLUSION
We conclude that the MATLAB coding/simulation used in calculating waiting probability for
M/M/1 system is successful with expected result. MATLAB software will help researcher to
observe packet traffic more clearly.
Based on the result that we have this system is acceptable as 99.921% of the packet will be
delay less than 4ms.

REFERENCE:
1.https://en.wikipedia.org/wiki/Teletraffic_engineering
2. https://en.wikipedia.org/wiki/M/M/1_queue
3. https://www.youtube.com/watch?v=T7D5UxyOs8U
4.https://files.osf.io/v1/resources/jf5ry/providers/osfstorage/5ad022779c8e73000c20df1a?ver
sion=1&displayName=2018_Traffic+Unit+and+Mathematical+Model_Sigit+Haryadi-2018-
04-13T03:22:31.755Z.pdf&action=download&direct
5. https://www.callcentrehelper.com/erlang-c-formula-example-121281.htm

16 | P a g e

You might also like