Professional Documents
Culture Documents
1.
2.
1.2
Instructions ................................................................................................................9
2.1
2.2
2.2.1
2.2.2
2.2.3
2.2.4
2.2.5
2.3
3.
2.3.1
2.3.2
Manual
3.1.2
3.1.3
4.
safdar@uetpeshawar.edu.pk
3.2.1
3.2.2
3.2.3
3.3
3.1.1
3.2
3.3.1
3.3.2
Tasks ................................
.......................................................................................27
4.1
Task 1 ................................................................
...............................................27
4.2
Task 2 ................................................................
...............................................28
4.2.1
4.2.2
Instructions ................................................................
................................28
4.2.3
4.2.4
Explanation ...............................................................................................28
CHAPTER 1
1. Manual Objectives
n this manual, the use of the Project and Node Editors in OPNET [1] to set up queue
models (M/M/1, M/G/1 and M/D/1), collect statistics about the model, run
simulations, and mathematically analyze the statistical results of the simulation are
illustrated.
To create the M/M/1 queue, you will need several objects in the Node Editor, including
one queue and two processors. The source module generates packets and the sink
module is used to dispose of the packets generated by the source. The queue represents
the infinite buffer and the server.
The processor module is the general -purpose building block of the node model. Setting
the process model attribute of the module determines the behavior of a particular
processor module.
The source module (which the processor module represents) generates packets and
specifies the creation rate of generated packets in terms of packets/second. This rate is
specified by an exponential distribution of packet interarrivals (that is, the time
between packet arrivals at the queue).
The queue module can be used to represent the infinite buffer and also the server (the
reasons for using the queue to represent the server will be discussed later).
Although it is not a part of the M/M/1 queue system described earlier, a sink module
will be used in the node model to dispose of serviced packets. Destroying packets that
are no longer needed frees up memory to be reused during simulation.
The M/M/1 queue is generally depicted by a general process governing the arrival of
packets into an infinite buffer. When a packet reaches the head of the buffer, it is
processed by a server and sent to its destination. Thus, the queue model requires a mean
of generating, queuing, and serving packets, all of which can be done with existing node
modules provided in the Node Editor. The M/M/1 queue model is shown in Figure 1.2.
Packet streams are used to connect each of the modules in the Node Editor. To transfer
packets between the generator module, the queue module, and the sink module, you use
packet streams. These are the paths through which packets move from one module to
another.
CHAPTER 2
7
2. Instructions
n this chapter, the step-by-step instructions for setting up queuing models in OPNET are
provided.
1. Create a new project and a new scenario. Name the new project queuing_model and
the scenario mm1.
2. In the Startup Wizard, click Quit. You will set up the scenario after the node model
has been created.
3. Select File > New..., then select Node Model from the pull-down list and click OK.
The Node Editor opens as a new window.
10
11
12
2. Connect the src module to the queue module by clicking on the src icon, then clicking
on the queue icon.
6. Make sure the service_rate attribute is set to 9600, with generated mean packet size of
9600 bits the average service rate is 1 packet per second.
7. Click OK to close the dialog box.
3. Connect the queue module with the sink module by clicking on the queue icon, then
clicking on the sink icon. Remember to end the Create Packet Stream operation by
right-clicking.
13
14
CHAPTER 3
2. Make sure that the palette is in the Icon view (instead of the Tree view) by placing the
mouse cursor on the icon at the top left corner of the Object Palette. Clicking on this
icon enables toggling between tree and icon views.
Figure 2.11
3. Click on the Configure Palette... button in the object palette. This brings up a
number of options that allow you to customize your palette.
4. Click on the Model list radio button if it is not already selected.
Does the average time a packet waits in the queue exceed an acceptable limit?
Does the queue size increase monotonically, or does it reach steady state? If the queue
size does not reach steady state, that may be an indication that the system (especially
the server, in this case) is overloaded.
3.1.1 Results Collection
To collect these statistics, the following steps have to be taken.
1. Right-click on the M_M_1 node model and go to Choose Individual DES Statistics
2. Select Module Statistics -> queue -> queue -> queue size (packets) and queuing
delay (sec). (it is possible to right click on the chosen statistics and look at the statistic
description, collection mode, etc.)
2. In the Node Types table, change the Supported value to no for the mobile and
satellite types.
3. Click OK to close the Node Interfaces dialog box.
Select File > Save. Name the node mm1_model, then click Save and Close the Node Editor.
5. Click on the Clear button in the Configure Palette dialog box. This removes all
models from the palette except for the subnet icon, which is always present.
6. Click on the Node Models button to bring up the list of available node models.
7. Scroll in the table until you find the mm1_model node model. Click in the Status
column next to mm1_model to change it from not included to included.
8. Click OK to close the table.
9. Click OK in the Configure Palette dial og box to save the palette configuration. Enter
the name mm1_palette at the prompt and click Save.
2.3.2 Specify Network Model
1. Click and drag the mm1_model node model from the object palette to the projector
editor workspace. Remember to right-click to end the operation.
2. Right-click on the node objects and selects Set Name from the Object pop-up menu.
3. Enter M_M_1 as the name and then click OK.
4. Select File > Save. Click Save to accept the existing name queuing_model.
16
17
18
1. In the Project Editor, choose DES > Results > View Results
2. Select the queuing delay (sec) statistic.
3. From the pull-down list under Presentation, select average.
Figure 3.3
filter
4. Click on the Show button (the graph is shown in the following figure).
19
20
The large change early in the simulation reflects the sensitivity of averages to the relatively
small number of samples collected. Towards the end of the simulation, the average stabilizes.
6. Click on the Show button. The graph of the time-averaged queue size appears in the
following figure:
It is important to validate your simulation results for accuracy. Note that the mean queuing
delay for this simulation is around 2 seconds.
Another statistic of interest is the time -averaged queue size. This statistic can be viewed by
applying the time average filter to the queue size statistic collected during simulation.
21
It should be noticed that the queue reaches steady state at about 3 hours in the above figure.
You may have noticed that the graphs of the mean queuing delay and the time -averaged queue
size are very similar. It turns out that for this model, because of the large number of well dispersed queue insertions and removals that occur during the simulation, the difference
between the final values of the two statistics is negligible.
The final graph for this lesson is of the queue size versus the time-averaged queue size,
plotted on the same graph:
5. Select queue size (packets) statistic. From the pull -down list under Presentation,
select average.
22
23
8. Select File > Save to save the modified node model md1_model, and then Close the
Node Editor.
9. Right click on the M_M_1 node in the network model; change the name to M_D_1
and the model to md1_model, as shown in the following figure.
10. Click OK to close the dialog box.
24
1. Right-click on the graph of the time -averaged queue size, then choose Add Statistic
from the pop-up menu. A new View Results dialog box appears.
2. From the pull-down list Results for, select Current Project and place a check next to
queuing_model >mm1. Select Object Statistics >M_M_1 > queue > queue >
queuing delay (sec) in the View Results dialog box.
3. From the pull-down list under Presentation, select Cumulative Distribution (CDF).
4. Left-click on the Add box.
5. The graph of the CDF of queuing delay (sec) from mm1 scenario is added to the
existing time-averaged queue size graph (as shown in the following figure).
Figure 3.7: Comparison of current vs. average queue size over time
Figure 3.8: Changing node attributes
1. Duplicate the mm1 scenario (created in the last section) to a new s cenario. Name the
new scenario md1.
2. Select File > Open > Node Model > mm1_model
3. Select
to duplicate a new node model named md1_model
4. Right-click on the src processor to open its Attributes dialog box
5. Left-click in the Value column of the Packet Size attributes to open the Packet Size
Specification dialog box.
6. Change the Packet Size attribute so that Distribution Name is constant and Mean
Outcome is 9600. This sets the size of the generated packets to be constantly
distributed with a fixed size of 9600 bits per packet.
7. Click OK to close the Attributes dialog box.
Duration: 7 hours
Seed: 431
Values Per Statistic: 100
3. Click Run to begin the simulation.
In the Project Editor, choose DES > Results > View Results.
Select the queuing delay (sec) statistic.
From the pull-down list under Presentation, select Cumulative Distribution (CDF).
Click on the Show button.
25
Task: compare the average queue size (packets) with that in mm1 scenario.
26
CHAPTER 4
3.3.1
1. Duplicate the mm1 scenario (created in the last section) to a new scenario. Name the
new scenario mg1.
2. Select File > Open > Node Model > mm1_model
3. Select
to duplicate a new node model named mg1_model
4. Right-click on the src processor to open its Attributes dialog box
5. Left-click in the Value column of the Packet Size attributes to open the Packet Size
Specification dialog box.
6. Change the Packet Size attribute so that Distribution Name is uniform_int,
Minimum outcome is set to 0 and Maximum Outcome is 19200, as shown in
following figure.
4. Tasks
4.1 Task 1
Compare the queuing delay (sec) and queue size (packets) with previous two scenarios.
Fill in the following table.
M/M/1
M/D/1
Average system
delay
Figure 3.11: Changing node attributes
Figure 3.10: Setting packet size
Average number of
packets in the
system
Compare the simulation results with the theoretical calculations.
M/G/1
28
4.2 Task 2
Set up an M/M/1/N Queue with finite buffer.
29
30
7. Select File > Save to save the modified node model mm1n_model, and then
Close the Node Editor.
8. Right click on the M_M_1 node in the network model; change the name to
M_M_1_N and the model to mm1n_model, as shown in the following figure.
4.2.1 Explanation
Set up an M/M/1/N Queue with finite buffer size (max. 6 packets) to simulate a delay loss system. Since the buffer capacity is limited, there will be packet loss happening
when the buffer is overflow.
4.2.2 Instructions
1.
2.
3.
4.
5.
12. Right click on the overflow statistic, choose change collection mode to open
overflow capture mode dialog box and make sure that Advanced is checked.
Select all values in the capture mode, as shown in Figure 4.4.
31
32
33
Duration: 7 hours
Seed: 431
Values Per Statistic: 100
3. Click Run to begin the simulation.
4.2.4 View results
1. In the Project Editor, choose DES > Results > View Results
2. Select the overflows statistic.
3. Click on the Show button (the graph is shown in Figure 4.5).
BIBLIOGRAPHY
[1] "Application and Network Performance with OPNET (Last accessed: 20 January
2016)," [Online]. Available: http://www.opnet.com.