OPNET Modeler Example - M/M/1 Queue Modeling


1. Routine overview

This routine is to use the node editor to build an M/M/1 queue model, and at the same time perform mathematical analysis on the statistical data collected by the simulation. The M/M/1 queue consists of first-in-first-out buffers. The arrival of data packets is subject to an exponential (Poisson) distribution. A processor called a service desk takes data packets out of the head of the buffer at a set service rate. and process it.
The performance of the M/M/1 queue is determined by the following parameters: packet arrival rate; packet size; service capacity.
If the combined average arrival rate and average size of packets exceeds the queue's serving capacity, the queue will no longer be stable. An unstable queue is meaningless in practice.
M/M/1 queue input process: call sources are unlimited, calls come individually and are independent of each other, the number of arrivals within a certain period of time obeys the Poisson distribution, and the arrival process is stable; M/M/1 queue queuing rule: single-pair queue
, Unlimited team leader, first come, first served;
M/M/1 queue processing mechanism: single processor, each call processing time is independent of each other, subject to the same exponential distribution.
Parameter setting of M/M/1 queue:
average arrival rate λ = 1 average interval time λ=\frac{1}{average interval time}l=average interval time1, average interval time = 1 λ \frac{1}{λ}l1, this routine sets it to 1.
Average service demand 1 μ \frac{1}{μ}m1, which is set to 9000 in this routine.
Service capacity C = 9600
Average service rate μC ≈ 1.067
Average delay D = 1 μ C − λ ≈ 15 D=\frac{1}{μC-λ} ≈ 15D=μ C λ115 s
average queue lengthL= λ μ C ( 1 − λ μ C ) ≈ 15 L=\frac{λ}{μC(1-\frac{λ}{μC})} ≈ 15L=μC ( 1 _μC _l)l15
This paper will also change the average interval time for comparison; modify the infinite queue to a finite queue; model and simulate the M/M/n queue on the basis of the M/M/1 queue.


2. Model construction

The node model is shown in the figure below.
insert image description here
The process model of src is simple_source, as shown in the figure below.
insert image description here
The properties of the src processor are set as follows.
insert image description here
The process model of queue is acb_fifo, as shown in the figure below.
insert image description here
"a" indicates that it is active (Active); "c" indicates that it can concentrate multiple incoming data packet streams on its only queuing resource; "b" indicates that the service time is a function of the data packet bit length; " fifo" indicates that the service order is first in first out.
The properties of the queue are set as follows.
insert image description here
The process model of sink is sink, as shown in the figure below.
insert image description here
The node interface only selects fixed nodes, and finds the newly created node model in the network model and places it in the project scene.


3. Simulation configuration and results

Set the simulation duration to 7 hours, and the random number seed to 431, and then start to run the simulation, and the simulation result is displayed as time_average.

1. M/M/1 queue

The time average curve of queue delay is shown in the figure below.
insert image description here
As can be seen from the figure above, the curve changes drastically at the beginning of the simulation, and as the simulation time progresses, the average delay approaches a stable value of 15, which is consistent with the previous theoretical calculation results.
The time average curve of the queue length is shown in the figure below.
insert image description here
The trend of the queue length curve is generally consistent with the trend of the delay, and finally the average value is also stable at around 15, which is consistent with the theoretical calculation results.
Plotting the queue length and the average delay together shows that as the queue length increases, the average delay also increases, as shown in the figure below.
insert image description here
Set the packet capacity of the queue to 35, and the result is shown in the figure below.
insert image description here
Set the packet capacity of the queue to 20, and the result is shown in the figure below.
insert image description here
It can be seen that as the infinitely long queue becomes a finitely long queue, the average delay of the queue will also decrease.

2. M/M/n queue

When the queue is infinitely long, set the number of processors to 2 (the process model of the queue node needs to be modified), and the simulation results are shown in the figure below.
insert image description here
Set the number of processors to 5, and the simulation results are shown in the figure below.
insert image description here
It can be seen that for an infinitely long queue, increasing the number of processors will also reduce the average delay.
The average interval time is 1, that is, the result of the exponential function is exponential(1), as shown in the figure below.
insert image description here
The average interval time is 2.5, that is, the result of the exponential function is exponential(2.5), as shown in the figure below.
insert image description here
The above two curves show that the system is stable when other conditions remain unchanged, and the average delay and queue length of data packets in the steady state decrease with the increase of the average interval time.
The results when the average interval time is 0.8 are shown in the figure below.
insert image description here
It can be seen that the queue is no longer stable in this case, that is, the service capacity of the current queue is exceeded, and it can be improved by increasing the number of processors.
When the average interval time is 0.8, increase the number of servers to 2 to get the result shown in the figure below.
insert image description here
When the average interval time is 0.8, increase the number of servers to 5 to get the result shown in the figure below.
insert image description here
It can be seen that increasing the number of servers can quickly stabilize the queue, and as the number of servers increases, the average length of the queue and the average delay will decrease.


Summarize

The above is the whole content of the OPNET Modeler routine - M/M/1 queue modeling. I hope this article will be helpful to your study!
Reference article:
M/M/1 queuing theory model
m/m/1 Baidu Encyclopedia
M/M/m queue simulation based on OPNET - Jia Xiaojiao, Fang Hongyu, Li Xiaohui

Guess you like

Origin blog.csdn.net/weixin_42570192/article/details/129994438