Introduction to OPNET Modeler -...

50
1 1 Introduction to OPNET Modeler Karann Chew CCSR 2 Contents ?Session #1 Session #1 (week#6, Friday, 9 (week#6, Friday, 9-10am) 10am) ? Overview Overview ? OPNET Environment OPNET Environment – various editors various editors ?Session #2 Session #2 (week#7, Friday, 9 (week#7, Friday, 9-10am) 10am) ? Process Process Modelling Modelling ? Event and event list concept Event and event list concept ? Process Editor Process Editor ? Session #3 Session #3 (week#8, Friday, 9 (week#8, Friday, 9-10am) 10am) ? Simulation Execution & result collection Simulation Execution & result collection ? Others topics Others topics – model library, tools model library, tools ? Assignment Assignment

Transcript of Introduction to OPNET Modeler -...

Page 1: Introduction to OPNET Modeler - info.ee.surrey.ac.ukinfo.ee.surrey.ac.uk/CCSR/Internal/Docs/opnet-pres-0111.pdf · Materials are based on OPNET version 7? ... • Tutorial & online

1

11

Introduction to OPNET Modeler

Karann ChewCCSR

22

Contents??Session #1 Session #1 (week#6, Friday, 9(week#6, Friday, 9--10am)10am)

?? OverviewOverview?? OPNET Environment OPNET Environment –– various editorsvarious editors

??Session #2 Session #2 (week#7, Friday, 9(week#7, Friday, 9--10am)10am)?? Process Process ModellingModelling?? Event and event list conceptEvent and event list concept

?? Process EditorProcess Editor

??Session #3 Session #3 (week#8, Friday, 9(week#8, Friday, 9--10am)10am)?? Simulation Execution & result collectionSimulation Execution & result collection

?? Others topics Others topics –– model library, toolsmodel library, tools?? AssignmentAssignment

Page 2: Introduction to OPNET Modeler - info.ee.surrey.ac.ukinfo.ee.surrey.ac.uk/CCSR/Internal/Docs/opnet-pres-0111.pdf · Materials are based on OPNET version 7? ... • Tutorial & online

2

33

??Ask questions as they come up Ask questions as they come up –– do not hesitatedo not hesitate

??Materials are based on OPNET version 7Materials are based on OPNET version 7

??Prerequisites for OPNETPrerequisites for OPNET•• Ability to program in C or C++ or at least be Ability to program in C or C++ or at least be comfortable in reading/understanding C or C++ codecomfortable in reading/understanding C or C++ code•• Basic understanding of networksBasic understanding of networks

??Disclaimer:Disclaimer:•• Some materials are adopted from Some materials are adopted from OPNETWORK 2000OPNETWORK 2000

Prologue

44

Introduction?? Simulation is an abstract conceptSimulation is an abstract concept

?? Definition Definition -- a process that represents another a process that represents another process process

??GoalsGoals?? Study behavior of systems that are not well Study behavior of systems that are not well

understoodunderstood?? Allow measurement of difficult quantitiesAllow measurement of difficult quantities?? AnalyseAnalyse measurementmeasurement?? Allow modification of a system to see how it Allow modification of a system to see how it

performs when changedperforms when changed

Page 3: Introduction to OPNET Modeler - info.ee.surrey.ac.ukinfo.ee.surrey.ac.uk/CCSR/Internal/Docs/opnet-pres-0111.pdf · Materials are based on OPNET version 7? ... • Tutorial & online

3

55

A Simulation Study: Flow Diagram

Yes

End

Start

Results statistically

useful?

No

NoResults

sufficiently detailed?

Choosing input And running simulations

System results accurate?

Defining input and

output

Specifying the system model

No

Choosing aspects

to be modeled

Understanding your

goals for the simulation

Understanding the

system

66

Session IOPNET Overview

Page 4: Introduction to OPNET Modeler - info.ee.surrey.ac.ukinfo.ee.surrey.ac.uk/CCSR/Internal/Docs/opnet-pres-0111.pdf · Materials are based on OPNET version 7? ... • Tutorial & online

4

77

Agenda

?OPNET Overview?OPNET Hierarchy?Navigating Various Editors: Project, Node,

Process Editor?Other Editors: Packet format, ICI format,

Antenna, Modulation, PDF etc.

88

OPNET OVERVIEW??Originally developed at MIT, introduced in Originally developed at MIT, introduced in 1987 as the first commercial network simulator.1987 as the first commercial network simulator.

??An An IntegratIntegrateed Network Modellingd Network Modelling EEnvironmentnvironment•• Tools to build network Tools to build network model model -- LAN, WAN, LAN, WAN,

Wired, Wireless, Wired, Wireless, Mobile, & SatelliteMobile, & Satellite•• Tools to cTools to constructonstruct, execute, execute & debug & debug

simulationsimulation•• Tools to collect, analyse & present resultsTools to collect, analyse & present results•• Interactive debugging engineInteractive debugging engine•• BuiltBuilt--in & contributed model libraryin & contributed model library•• Tutorial & online documentationTutorial & online documentation

Page 5: Introduction to OPNET Modeler - info.ee.surrey.ac.ukinfo.ee.surrey.ac.uk/CCSR/Internal/Docs/opnet-pres-0111.pdf · Materials are based on OPNET version 7? ... • Tutorial & online

5

99

??Hierarchical network modelsHierarchical network models

??Finite state machine modelingFinite state machine modeling

?? Integrated analysis toolsIntegrated analysis tools

??Comprehensive library of detailed protocol and Comprehensive library of detailed protocol and application models and network devicesapplication models and network devices

??ObjectObject--oriented modelingoriented modeling

??Wireless, pointWireless, point--toto--point, and multipoint linkspoint, and multipoint links

??Geographical and mobility modelingGeographical and mobility modeling

??AnimationAnimation

?? Integrated debuggerIntegrated debugger

??Financial cost attribute for devicesFinancial cost attribute for devices

OPNET Features

1010

Modelling Methodology & Hierarchy

?OPNET utilizes different model format for topology, data flow, and control flow

?All fit together in a hierarchical fashion

??OPNET utilizes different model format for OPNET utilizes different model format for topology, data flow, and control flowtopology, data flow, and control flow

??All fit together in a hierarchical fashion All fit together in a hierarchical fashion

Network ModelNetwork ModelNetwork Model

Network ModelNetwork ModelNetwork Model

Node ModelNode ModelNode Model

Process ModelProcess ModelProcess Model

Page 6: Introduction to OPNET Modeler - info.ee.surrey.ac.ukinfo.ee.surrey.ac.uk/CCSR/Internal/Docs/opnet-pres-0111.pdf · Materials are based on OPNET version 7? ... • Tutorial & online

6

1111

??Network ModelNetwork Model -- define the position and define the position and interconnection of communicating entities, or nodes. interconnection of communicating entities, or nodes. Each node is described by a block structured data Each node is described by a block structured data flow diagram flow diagram

??Node ModelNode Model -- depicts the interrelation of depicts the interrelation of processes, protocols, and subsystems. Each processes, protocols, and subsystems. Each programmable block in a Node Model has its programmable block in a Node Model has its functionality defined by an process model functionality defined by an process model

??Process ModelProcess Model -- combines the graphical power of a combines the graphical power of a statestate--transition diagram with the flexibility of a transition diagram with the flexibility of a standard programming language and a broad library standard programming language and a broad library of preof pre--defined modeling functionsdefined modeling functions

Three-Tiered Hierarchy

1212

??Node model specifies object in network domainNode model specifies object in network domain?? Process model specifies object in node domainProcess model specifies object in node domain

Three-Tiered Hierarchy (cont.)

Network ModelNetwork Model Node ModelNode Model Process ModelProcess Model

Page 7: Introduction to OPNET Modeler - info.ee.surrey.ac.ukinfo.ee.surrey.ac.uk/CCSR/Internal/Docs/opnet-pres-0111.pdf · Materials are based on OPNET version 7? ... • Tutorial & online

7

1313

??Project Editor (Network Editor)Project Editor (Network Editor)•• Drag Nodes from the Object Palette & Drop It to the Drag Nodes from the Object Palette & Drop It to the

Desired PlaceDesired Place•• Connects nodes with links Connects nodes with links

??Node EditorNode Editor•• Select modules & connection them by streamsSelect modules & connection them by streams•• Specific process model for the modulesSpecific process model for the modules

??Process EditorProcess Editor•• Add states & connect them by transitionsAdd states & connect them by transitions•• Add in C/C++ codes & kernel functionsAdd in C/C++ codes & kernel functions

??Simulation ToolSimulation Tool•• Specify the simulation parameter & run simulationSpecify the simulation parameter & run simulation

Main Tools

1414

??Link EditorLink Editor??Packet EditorPacket Editor??ICI EditorICI Editor??Probe EditorProbe Editor??Antenna Pattern EditorAntenna Pattern Editor??Modulation Curve EditorModulation Curve Editor??PDF EditorPDF Editor??Filter EditorFilter Editor??Icon Database EditorIcon Database Editor

Other Tools

Page 8: Introduction to OPNET Modeler - info.ee.surrey.ac.ukinfo.ee.surrey.ac.uk/CCSR/Internal/Docs/opnet-pres-0111.pdf · Materials are based on OPNET version 7? ... • Tutorial & online

8

1515

Project/Scenario Workflow??Create projectCreate project??Create baseline scenarioCreate baseline scenario

•• Import or create topologyImport or create topology•• Import or create trafficImport or create traffic•• Choose results and reports to be collectedChoose results and reports to be collected•• Run simulationRun simulation•• View resultsView results

??Duplicate scenarioDuplicate scenario•• Make changesMake changes•• ReRe--run simulationrun simulation•• Compare resultsCompare results

1616

Project Editor

Page 9: Introduction to OPNET Modeler - info.ee.surrey.ac.ukinfo.ee.surrey.ac.uk/CCSR/Internal/Docs/opnet-pres-0111.pdf · Materials are based on OPNET version 7? ... • Tutorial & online

9

1717

Network Domain

Generic Devices Vendor Devices

?? Network models consist of Network models consist of nodesnodes, , links and subnets links and subnets deployed in a geographical contextdeployed in a geographical context

?? Nodes represent network devices and groups of devicesNodes represent network devices and groups of devices•• servers, workstations, routers, LAN nodes, IP clouds, etc.servers, workstations, routers, LAN nodes, IP clouds, etc.

?? Links represent pointLinks represent point--toto--point and bus linkspoint and bus links?? Icons assist the user in quickly locating the correct nodes Icons assist the user in quickly locating the correct nodes

and linksand links?? Vendor models are distinguished by a specific color and Vendor models are distinguished by a specific color and

logo for each companylogo for each company

1818

Network Domain HLR GGSN

SS7

SGSNs

GTP/UDP/IP

BSC

BTS

MN

Servers

CNs

IP Cloud

ParametersConfigurators

A GPRS Network ModelA GPRS Network Model

Page 10: Introduction to OPNET Modeler - info.ee.surrey.ac.ukinfo.ee.surrey.ac.uk/CCSR/Internal/Docs/opnet-pres-0111.pdf · Materials are based on OPNET version 7? ... • Tutorial & online

10

1919

Node Domain?? Basic building blocks include processors, queues, and Basic building blocks include processors, queues, and

transceiverstransceivers?? Processors are fully programmable via their process Processors are fully programmable via their process

modelmodel?? Queues also buffer and manage data packetsQueues also buffer and manage data packets?? Transceivers are a node’s interfaceTransceivers are a node’s interface

?? Interfaces between blocksInterfaces between blocks?? Packet streamsPacket streams?? Statistic wiresStatistic wires

Receiver

Transmitter

Processor

Queue

Stat Wire Packet Stream

2020

Node Editor

Page 11: Introduction to OPNET Modeler - info.ee.surrey.ac.ukinfo.ee.surrey.ac.uk/CCSR/Internal/Docs/opnet-pres-0111.pdf · Materials are based on OPNET version 7? ... • Tutorial & online

11

2121

??OPNET process models consist ofOPNET process models consist of?? State transition diagramsState transition diagrams?? Blocks of C codesBlocks of C codes?? The library of OPNET The library of OPNET

Kernel Procedures (Kernel Procedures (KPsKPs) ) ?? State variables (private State variables (private

to each process)to each process)?? Temporary variablesTemporary variables

?? Processes can create additional child processes Processes can create additional child processes dynamicallydynamically

?? Processes respond to interruptsProcesses respond to interrupts

Process Domain

2222

Process Editor

Page 12: Introduction to OPNET Modeler - info.ee.surrey.ac.ukinfo.ee.surrey.ac.uk/CCSR/Internal/Docs/opnet-pres-0111.pdf · Materials are based on OPNET version 7? ... • Tutorial & online

12

2323

Simulation Tool

2424

Toolbar

Probe Workspace

1 2 3 4 5 6 7 8

Probe Editor

1. Global Statistic Probe2. Node Statistic Probe3. Link Statistic Probe4. Coupled Statistic Probe5. Attribute Probe6. Automatic Animation Probe7. Statistic Animation Probe8. Custom Animation Probe

?? The Probe Editor The Probe Editor -- to configure to configure wherewhere information information is collected and is collected and whatwhat statistics are measuredstatistics are measured

??Can save collections of probes to a file for use in Can save collections of probes to a file for use in different scenariosdifferent scenarios

Page 13: Introduction to OPNET Modeler - info.ee.surrey.ac.ukinfo.ee.surrey.ac.uk/CCSR/Internal/Docs/opnet-pres-0111.pdf · Materials are based on OPNET version 7? ... • Tutorial & online

13

2525

Links?? Link objects model physical layer effects between Link objects model physical layer effects between

nodes, such as delays, noise, etc.nodes, such as delays, noise, etc.

A radio link, established during a simulation, can be created between any radio transmitter-receiver channel pair. Satellite and mobile nodes must use radio links. Fixed nodes may use radio links. A radio link is not drawn but is established if nodes contain radio transceivers.

A bus link transfers data among many nodes and is a shared media.

A point -to-point link transfers data between two fixed nodes.

Radio link

2626

Link Editor

Page 14: Introduction to OPNET Modeler - info.ee.surrey.ac.ukinfo.ee.surrey.ac.uk/CCSR/Internal/Docs/opnet-pres-0111.pdf · Materials are based on OPNET version 7? ... • Tutorial & online

14

2727

Packets

??Carry information between objects in node and Carry information between objects in node and network domainsnetwork domains

??Can represent messages, packets, cellsCan represent messages, packets, cells?? Either formatted or unformattedEither formatted or unformatted??Data areasData areas

?? UserUser--defineddefined?? OPNET definedOPNET defined

2828

Packet Format Editor

Page 15: Introduction to OPNET Modeler - info.ee.surrey.ac.ukinfo.ee.surrey.ac.uk/CCSR/Internal/Docs/opnet-pres-0111.pdf · Materials are based on OPNET version 7? ... • Tutorial & online

15

2929

Antenna Pattern Editor

3030

Modulation Curve Editor

Page 16: Introduction to OPNET Modeler - info.ee.surrey.ac.ukinfo.ee.surrey.ac.uk/CCSR/Internal/Docs/opnet-pres-0111.pdf · Materials are based on OPNET version 7? ... • Tutorial & online

16

3131

Icon Database Editor

3232

Session IThe End

Q&A ?

Page 17: Introduction to OPNET Modeler - info.ee.surrey.ac.ukinfo.ee.surrey.ac.uk/CCSR/Internal/Docs/opnet-pres-0111.pdf · Materials are based on OPNET version 7? ... • Tutorial & online

17

3333

Session IIProcess Modeling

3434

Agenda

??EventEvent--driven simulationdriven simulation??Event and Event List conceptEvent and Event List concept??Simulation Kernel Simulation Kernel ??Process EditorProcess Editor??Process Modeling and ExecutionProcess Modeling and Execution??Kernel ProceduresKernel Procedures

Page 18: Introduction to OPNET Modeler - info.ee.surrey.ac.ukinfo.ee.surrey.ac.uk/CCSR/Internal/Docs/opnet-pres-0111.pdf · Materials are based on OPNET version 7? ... • Tutorial & online

18

3535

Event-Driven Simulation ?An event is a request for a particular activity to

occur at a certain time?OPNET simulations are event-driven? Simulation time advances when an event occurs?A different method might be to sample at regular

intervals…?…But disadvantages are as follows:

? Accuracy of results is limited by the sampling resolution? Simulation is inefficient if nothing happens for long periods

3636

Time Event Type Module0.0 Initialize src.gen0.0 Initialize src.rte4.3 Timer expires src.gen4.3 Packet arrivessrc.rte

Head

Event-List Concepts

?? Single global event listSingle global event list?? Shared simulation time clockShared simulation time clock?? Events scheduled in time Events scheduled in time

orderorder?? Event removed from event list Event removed from event list

when it completeswhen it completes

Page 19: Introduction to OPNET Modeler - info.ee.surrey.ac.ukinfo.ee.surrey.ac.uk/CCSR/Internal/Docs/opnet-pres-0111.pdf · Materials are based on OPNET version 7? ... • Tutorial & online

19

3737

The Simulation Kernel

?? The Simulation Kernel (SK) manages the event The Simulation Kernel (SK) manages the event listlist

?? The SK delivers each event, in sequence, to the The SK delivers each event, in sequence, to the appropriate moduleappropriate module

?? The SK receives requests from modules and The SK receives requests from modules and inserts new events in the event listinserts new events in the event list

3838

How Event List Work

New event reaches head of event list, causes Simulation

Kernel to deliver an interrupt to the

appropriate module

Simulation Kernel regains control from

module

Process within the module gains control and

processes interrupt

Simulation Kernel deletes event from event list, allowing new event to reach

head of list

Page 20: Introduction to OPNET Modeler - info.ee.surrey.ac.ukinfo.ee.surrey.ac.uk/CCSR/Internal/Docs/opnet-pres-0111.pdf · Materials are based on OPNET version 7? ... • Tutorial & online

20

3939

Interrupts

?? First event in the event list becomes an interruptFirst event in the event list becomes an interrupt??Delivered by the Simulation Kernel to the Delivered by the Simulation Kernel to the

designated moduledesignated module??Data associated with the event can be obtained Data associated with the event can be obtained

by the moduleby the module?? When an interrupt is delivered to a module, control passes When an interrupt is delivered to a module, control passes

from the Simulation Kernel to the modulefrom the Simulation Kernel to the module

?? Processors and queues can have Processors and queues can have BEGSIMBEGSIMinterruptsinterrupts

4040

Event-List Concepts? Some events must be entered in the event list at

the start of a simulation• A processor or queue module could have the begsim

interrupt attribute enabled

?An event list typically has a few events – each event spawns another event or two that is placed on the list as the spawning event is deleted

? The event list is always growing and shrinking?An event is pending until executed?A pending event can be cancelled

Page 21: Introduction to OPNET Modeler - info.ee.surrey.ac.ukinfo.ee.surrey.ac.uk/CCSR/Internal/Docs/opnet-pres-0111.pdf · Materials are based on OPNET version 7? ... • Tutorial & online

21

4141

Process Models?? Process models to represent both hardware and Process models to represent both hardware and

software software –– Finite State MachineFinite State Machine??OPNET process modelsOPNET process models describe the logic of realdescribe the logic of real--

world processes, such as:world processes, such as:?? Communications protocols and algorithmsCommunications protocols and algorithms?? SharedShared--resource managersresource managers?? Queuing disciplinesQueuing disciplines?? Specialized traffic generatorsSpecialized traffic generators?? StatisticStatistic--collection mechanismscollection mechanisms?? Operating systemsOperating systems

?? FSM + C/C++ programming code + library functionsFSM + C/C++ programming code + library functions?? FSMsFSMs are dynamic and can be spawned (by other are dynamic and can be spawned (by other

FSMsFSMs) during simulation in response to specific ) during simulation in response to specific eventsevents

?? The The Process EditorProcess Editor provides the necessary features provides the necessary features for specifying process modelsfor specifying process models

4242

Toolbar

1. Create state2. Create transition3. Set initial state 4. Edit state variable5. Edit temporary variable6. Edit header block7. Edit function block8. Edit diagnostic block9. Edit termination block10.Compile process model

1 2 3 4 5 6 7 8 9 10

Process Editor

Page 22: Introduction to OPNET Modeler - info.ee.surrey.ac.ukinfo.ee.surrey.ac.uk/CCSR/Internal/Docs/opnet-pres-0111.pdf · Materials are based on OPNET version 7? ... • Tutorial & online

22

4343

?Consists of:? State transition diagrams? The complete C programming language? The library of OPNET Kernel Procedures ? State variables (private to each process)? Temporary variables

Process Models

4444

Executive blocks??Each state has two executive blocksEach state has two executive blocks??Enter executives Enter executives are invoked on entering a stateare invoked on entering a state??Exit executives Exit executives are invoked before exiting a stateare invoked before exiting a state

Page 23: Introduction to OPNET Modeler - info.ee.surrey.ac.ukinfo.ee.surrey.ac.uk/CCSR/Internal/Docs/opnet-pres-0111.pdf · Materials are based on OPNET version 7? ... • Tutorial & online

23

4545

State Connections -Transitions

?? Transitions describe the possible movement of a Transitions describe the possible movement of a process from state to state and the conditions process from state to state and the conditions allowing such a changeallowing such a change

?? Exactly one condition must evaluate to trueExactly one condition must evaluate to true?? If the condition statement If the condition statement (x == y)(x == y) is true, the is true, the

transition executive transition executive ((Reset_TimersReset_Timers)) is invokedis invoked

Transition executiveCondition statement

4646

Forced States? Forced (green) and unforced

(red) states differ significantly in execution timing

? In a forced state, the process:? Invokes the enter executives? Invokes the exit executives? Evaluates all condition

statements? If exactly one condition

statement evaluates to true, the transition is traversed to the next state

Transition to next state

Transition to next state

Enter execs invoked

No blocking or waiting

Exit execs invoked

green

Enter execs invoked

No blocking or waiting

Exit execs invoked

Page 24: Introduction to OPNET Modeler - info.ee.surrey.ac.ukinfo.ee.surrey.ac.uk/CCSR/Internal/Docs/opnet-pres-0111.pdf · Materials are based on OPNET version 7? ... • Tutorial & online

24

4747

Unforced States

?? In an unforced state, In an unforced state, the process:the process:?? Invokes the enter Invokes the enter

executivesexecutives?? Places a marker at the Places a marker at the

middle of the statemiddle of the state?? Releases control to the Releases control to the

Simulation Kernel and Simulation Kernel and becomes idlebecomes idle

?? Resumes at the marker Resumes at the marker and processes the exit and processes the exit execs when next execs when next invokedinvoked

Transition to next state

Transition to next state

Exit execs processed Exit execs processed whenwhen invocation invocation

occursoccurs

Enter execs Enter execs invokedinvoked

Blocked, waiting Blocked, waiting for invocationfor invocation

red

Exit execs processed Exit execs processed whenwhen invocation invocation

occursoccurs

Enter execs Enter execs invokedinvoked

Blocked, waiting Blocked, waiting for invocationfor invocation

4848

Transitions Between States

? After completing the exit executives, the process evaluates the condition statements of all departing transitions from the state

? One and only one condition statement must evaluate to true

? The process traverses the transition associated with this condition statement

? A transition with condition = “default” is true if and only if no other conditions are true

? A transition with no condition set is termed unconditional and is always true

Page 25: Introduction to OPNET Modeler - info.ee.surrey.ac.ukinfo.ee.surrey.ac.uk/CCSR/Internal/Docs/opnet-pres-0111.pdf · Materials are based on OPNET version 7? ... • Tutorial & online

25

4949

Process Model - Example?Model with three forced states and one unforced

state:

3. Transition occurs.

6. Transition occurs.

2. Exit execs invoked immediately. Transition condition (pk_count== 0) evaluates to true. 5. Exit execs invoked

immediately.

8. Marker is placed and process stops here.

7. Enter execs invoked.

4. Enter execs invoked.1. Initial interrupt delivered

and the enter execs invoked.

5050

Event-List - Example

Node model: srcNetwork model

Page 26: Introduction to OPNET Modeler - info.ee.surrey.ac.ukinfo.ee.surrey.ac.uk/CCSR/Internal/Docs/opnet-pres-0111.pdf · Materials are based on OPNET version 7? ... • Tutorial & online

26

5151

Event-List Example (cont.)

? The network model has three nodes (src, dest1, dest2) relying on two node models (both destnodes use the same node model)

? In the src node model, packets are generated at gen and sent by queue to either transmitter (tx0 / tx1)

? Three modules (gen, queue, and sink) have process models associated with them

5252

The BEGSIM Interrupt? BEGSIM is a special type of interrupt that occurs at

simulation time 0.0, before any other type of interrupt

? A BEGSIM interrupt usually initializes a module and schedules future events

? Any processor or queue can have its begsim intrptattribute enabled, resulting in an event being placed on the event list for time 0

Page 27: Introduction to OPNET Modeler - info.ee.surrey.ac.ukinfo.ee.surrey.ac.uk/CCSR/Internal/Docs/opnet-pres-0111.pdf · Materials are based on OPNET version 7? ... • Tutorial & online

27

5353

Processing the First Interrupt

??Consider the process model specified by the Consider the process model specified by the src.gensrc.genmodulemodule

Node model: src

Process model: gen

5454

Starting the Simulation1. To start the simulation, the head of the event list

is processed and a BEGSIM interrupt is delivered to the process in module src.gen

2. Because this is the first interrupt, the process begins execution at the initial state, marked with a black arrow

3. Because this state is being entered, the enter execs are executed

Time Event Type Module0.0 BEGSIM src.gen0.0 BEGSIM src.queue

Page 28: Introduction to OPNET Modeler - info.ee.surrey.ac.ukinfo.ee.surrey.ac.uk/CCSR/Internal/Docs/opnet-pres-0111.pdf · Materials are based on OPNET version 7? ... • Tutorial & online

28

5555

Processing the First Interrupt in Process gen

Process model: gen

5656

Processing the First Interrupt in Process gen

4. Process invokes and completes the enter execs of Init.

5. Because Init is a forced (green) state, process immediately invokes and completes the exit execs.

6. Process evaluates all condition statements. This state has only one departing transition which evaluates to true.

7. Process transitions to Wait.

Page 29: Introduction to OPNET Modeler - info.ee.surrey.ac.ukinfo.ee.surrey.ac.uk/CCSR/Internal/Docs/opnet-pres-0111.pdf · Materials are based on OPNET version 7? ... • Tutorial & online

29

5757

Processing the First Interrupt in Process gen

8.8. Process invokes and completes the enter execs Process invokes and completes the enter execs of of WaitWait..

Process model

5858

Processing the First Interrupt in Process gen

9. One action in the enter execs (line 9) is to schedule a self interrupt by means of a KP. This adds an event to the event list.

10. Process places a marker at the middle of Wait.

11. Process becomes idle.

Time Event Type Module0.0 BEGSIM src.gen0.0 BEGSIM src.queue4.3 SELF src.gen

Marker

Page 30: Introduction to OPNET Modeler - info.ee.surrey.ac.ukinfo.ee.surrey.ac.uk/CCSR/Internal/Docs/opnet-pres-0111.pdf · Materials are based on OPNET version 7? ... • Tutorial & online

30

5959

Processing the Second Interrupt at module

src.queue12. Simulation Kernel removes the first event and advances

the next event to the head of the event list. The simulation time remains 0.0.

13. Simulation Kernel delivers a BEGSIM interrupt to src.queue.

14. Process in src.queue module gains control. It executes until it reaches an unforced (red) state, places a marker, and then becomes idle. (This model is not shown.)

Time Event Type Module0.0 BEGSIM src.queue4.3 SELF src.gen

First event is removed

6060

Processing the Next Interrupt at module src.gen

15.The Simulation Kernel removes the previous event and advances the next event to the head of the event list. The simulation time becomes 4.3 seconds.

16.The event at the head of the list causes a SELF interrupt to be delivered to the gen process. The process resumes at the marker in the middle of Wait.

17.Process invokes and completes the exit execs of Wait.

Time Event Type Module4.3 SELF src.gen

Page 31: Introduction to OPNET Modeler - info.ee.surrey.ac.ukinfo.ee.surrey.ac.uk/CCSR/Internal/Docs/opnet-pres-0111.pdf · Materials are based on OPNET version 7? ... • Tutorial & online

31

6161

Continuing the Process at gen

18. To leave Wait, the process evaluates all condition statements. This state has one outgoing transition and its condition statement (shown) evaluates to true.

6262

Continuing the Process at gen (cont.)

19. The process transitions to Send.20. The process invokes the enter execs of Send

and calls op_pk_send ( ) to send a packet. This results in an event of type STRM being placed on the event list.

Time Event Type Module4.3 SELF src.gen4.3 STRM src.queue

Page 32: Introduction to OPNET Modeler - info.ee.surrey.ac.ukinfo.ee.surrey.ac.uk/CCSR/Internal/Docs/opnet-pres-0111.pdf · Materials are based on OPNET version 7? ... • Tutorial & online

32

6363

Continuing the Process at gen(cont.)

21. Because Send is a forced (green) state, the process immediately invokes and completes the exit execs.

22. Process evaluates all possible transitions. One evaluates to true.

23. Process transitions to Wait.24. Process invokes enter execs of Wait ,

schedules another SELF interrupt in the event list and becomes idle.

25. Simulation Kernel takes control and processes the next event in the list.

6464

Simulation Termination

? Simulations terminate in one of four ways:? The event list is emptied? Simulation attribute duration expires? A process calls for termination, using the KP

op_sim_end()? A fatal error occurs

Page 33: Introduction to OPNET Modeler - info.ee.surrey.ac.ukinfo.ee.surrey.ac.uk/CCSR/Internal/Docs/opnet-pres-0111.pdf · Materials are based on OPNET version 7? ... • Tutorial & online

33

6565

How Does Time Advance?

? Simulation time advances only when an event with a later time is taken from the event list

?No simulation time occurs during an invocation of a process model

?No time elapses during transitions between states

?A process model must always end in a red state so time can advance? Avoid endless looping between

forced (green) states

6666

Kernel Procedures??OPNET’sOPNET’s library functions that abstract difficult, library functions that abstract difficult,

tedious, or common operations. tedious, or common operations. ??KPsKPs free users from addressing memory management, free users from addressing memory management,

data structure, handling event processing, etc.data structure, handling event processing, etc.??Can be called within a process modelCan be called within a process model??KPsKPs focus on communication modelingfocus on communication modeling??CategorisedCategorised based on type of object to manipulatebased on type of object to manipulate??Categorized by primary function into 22 packages:Categorized by primary function into 22 packages:

Animation (Anim) Package, Distribution (Dist) Package , Event (Ev) Package, Interface Control (Ici) Package, Identification (Id) Package, Internal Model Access (Ima) Package, Interrupt (Intrpt) Package, Packet (Pk) Package, Programming (Prg) Package, Process (Pro) Package, Queue (Q) Package, Radio (Rad) Package, Routing (Rte) Package, Segmentation & Reassembly (Sar) Package, Simulation (Sim) Package, Statistic (Stat) Package, Stream (Strm) Package, Subqueue (Subq) Package, Table (Tbl) Package, Transmission Data (Td) Package, Traffic Import Model (Tim) Package, Topology (Topo) Package

Page 34: Introduction to OPNET Modeler - info.ee.surrey.ac.ukinfo.ee.surrey.ac.uk/CCSR/Internal/Docs/opnet-pres-0111.pdf · Materials are based on OPNET version 7? ... • Tutorial & online

34

6767

Kernel Procedures

Packet Package:op_pk_create ()op_pk_create_fmt ()op_pk_copy ()op_pk_get ()op_pk_total_size_get ()op_pk_nfd_set ()op_pk_nfd_get ()op_pk_send ()op_pk_send_delayed ()op_pk_destroy ()

Subq Package:op_subq_pk_insert ()op_subq_pk_remove ()

Interrupt Package:op_intrpt_schedule_self ()op_intrpt_type ()op_intrpt_strm ()op_intrpt_code ()Simulation and

Event Packages:op_ev_cancel ()op_sim_time ()

ID, Topo and Internal Model Access Packages:op_id_self ()op_topo_parent ()op_topo_child ()op_ima_obj_attr_get ()

Distribution Package:op_dist_load ()op_dist_outcome ()

??Naming convention for Kernel Procedures: Naming convention for Kernel Procedures: op_<package name>_<action>op_<package name>_<action>

?? Example:Example:•• op_pk_getop_pk_get()()•• op_intrpt_typeop_intrpt_type()()

??Commonly used Commonly used KPsKPs::

6868

Summary?? Process models Process models -- Finite state machinesFinite state machines?? Forced and unforced states differ in when they Forced and unforced states differ in when they

execute their instructionsexecute their instructions??Any processor or queue can have the attribute Any processor or queue can have the attribute begsimbegsim intrptintrpt enabled, scheduling an event for enabled, scheduling an event for time 0.0time 0.0

??Control passes dynamically between the Control passes dynamically between the Simulation Kernel and individual processesSimulation Kernel and individual processes

??Kernel ProceduresKernel Procedures

Page 35: Introduction to OPNET Modeler - info.ee.surrey.ac.ukinfo.ee.surrey.ac.uk/CCSR/Internal/Docs/opnet-pres-0111.pdf · Materials are based on OPNET version 7? ... • Tutorial & online

35

6969

Session IIThe End

Q&A ?

7070

Session IIISimulation Design &

Execution

Page 36: Introduction to OPNET Modeler - info.ee.surrey.ac.ukinfo.ee.surrey.ac.uk/CCSR/Internal/Docs/opnet-pres-0111.pdf · Materials are based on OPNET version 7? ... • Tutorial & online

36

7171

Agenda

?Running Simulation? Simulation Outputs ? Statistics

? Simulation Execution? Result Viewing & Analysis

?Model Libraries?Others Tools + Tips?Assignment

7272

Simulation Output? Three kinds of Simulation Outputs:

i) Vector Output?A series of values and associated time?monitor changes with time in one simuation

ii) Scalar Output?A single value in one simulation?Monitor average value during one simulation?Multiple simulation often needed to generate a seriess of

values with different input

iii) Animation?Visualize the activity of model, eg. Packets flow over links,

Node movement

? Vector & Scalar output file can be viewed and manipulated in built-in analysis tool

Page 37: Introduction to OPNET Modeler - info.ee.surrey.ac.ukinfo.ee.surrey.ac.uk/CCSR/Internal/Docs/opnet-pres-0111.pdf · Materials are based on OPNET version 7? ... • Tutorial & online

37

7373

Simulation Output

Vector Outputx axis = simulation time

?Example:

Scalar Outputx axis = traffic rate

7474

?Local Statistics• Used to collect the statistics generated by an object, eg. a node,

link, module etc.• Access by placing a probe to the specified object

?Global Statistics• Used to collect data generated by different objects in the model• Used to collect the statistics generated by the overall system• Access by their names

Type of Statistic

Page 38: Introduction to OPNET Modeler - info.ee.surrey.ac.ukinfo.ee.surrey.ac.uk/CCSR/Internal/Docs/opnet-pres-0111.pdf · Materials are based on OPNET version 7? ... • Tutorial & online

38

7575

Description is a text field to supply a brief description of the statistic.

Enter the Statistic name in Stat Name.

? Statistics - declared in the process model• Local statistics gather data from an individual process• Global statistics gather data from the system as a whole

Count is the number of dimensions in a Dimensioned

Statistic.

Mode is either Singleor Dimensioned.

Declaring Statistics

7676

Statistics Collection

?Probes - passive data collection devices

?Probe Editor used to create probes

?Type of Probesi Statistic – collect outputii Attribute – collect inputiii Animation – collect output

Page 39: Introduction to OPNET Modeler - info.ee.surrey.ac.ukinfo.ee.surrey.ac.uk/CCSR/Internal/Docs/opnet-pres-0111.pdf · Materials are based on OPNET version 7? ... • Tutorial & online

39

7777

Statistic Capture Modes??Normal mode: Every data point is Normal mode: Every data point is

collected from a statisticcollected from a statistic?? Sample mode: The data is collected Sample mode: The data is collected

according to a useraccording to a user--defined time defined time interval or sample countinterval or sample count

??Bucket mode: All the data points in Bucket mode: All the data points in a bucket are collected and a bucket are collected and processed according to a userprocessed according to a user--defined parameterdefined parameter

?? MaxMax?? MinMin?? SumSum?? CountCount?? Sample averageSample average?? Time averageTime average

7878

Running Simulation

?? From the Project Editor…From the Project Editor…?? Choosing results/probesChoosing results/probes?? Configuring & run Configuring & run

simulationsimulation?? Viewing collected resultsViewing collected results

Project Editor EnvironmentProject Editor Environment

Page 40: Introduction to OPNET Modeler - info.ee.surrey.ac.ukinfo.ee.surrey.ac.uk/CCSR/Internal/Docs/opnet-pres-0111.pdf · Materials are based on OPNET version 7? ... • Tutorial & online

40

7979

Configuring Simulations? Set simulation attributes by choosing “Configure

Simulation” from the Simulation menu

Simulation Dialog Box

Duration Duration –– durationduration of simulation, in simulation timeof simulation, in simulation time

Values per Statistic Values per Statistic –– number of values to be collected number of values to be collected for each statisticfor each statistic

Seed Seed -- Random number generation seedRandom number generation seed

Simulation Simulation AtrributeAtrribute –– Values for Values for atrributesatrributes relevant relevant to the network model being simulatedto the network model being simulated

Generate Web Report Generate Web Report –– If checked, the simulation will If checked, the simulation will produce a web report for the resultsproduce a web report for the results

8080

Running a Simulation?The simulation window shows

the progress of simulation and error messages, if any?During simulations, the elapsed

time bar monitors the status of the simulation?Appears after 1,000,000 events

?Progress: Simulation time elapsed and number of events processed?Time: Real time elapsed and

remaining?Simulation Log: Number of

entries present in the simulation log

Page 41: Introduction to OPNET Modeler - info.ee.surrey.ac.ukinfo.ee.surrey.ac.uk/CCSR/Internal/Docs/opnet-pres-0111.pdf · Materials are based on OPNET version 7? ... • Tutorial & online

41

8181

? Results can be displayed by:a. Selecting “View Results” from the Results

menub. Right-clicking the project workspace and

selecting from the pop-up menuc. Selecting the “View Results” button on the tool

bar

Viewing Results

?The “View Results” dialog box allows the user to select the results to displayNote: Only the statistics you chose for collection will be available

?The “Show” button in the “View Results” dialog box displays a graph of the selected statistics

View Result Dialog Box

8282

Viewing Results (cont.)?Multiple panels can be open at the same time? Each panel can contain one or more traces that

graphically depict data either Overlaid or Stacked

Graphs overlaid Graphs stacked

Page 42: Introduction to OPNET Modeler - info.ee.surrey.ac.ukinfo.ee.surrey.ac.uk/CCSR/Internal/Docs/opnet-pres-0111.pdf · Materials are based on OPNET version 7? ... • Tutorial & online

42

8383

Simulation Sequence Editor

? By promoting an object’s attribute to the simulation level, multiple values for that attribute can be set

? By left-clicking in a blank field under “Attribute”, the user can add a currently promoted attribute

? A sequence of Simulations will be run with each value

8484

Exporting Data

?Modeler allows the user to export collected statistics to a text file or to a user-specified spreadsheet application

?Users can specify the path of the desired spreadsheet application in the user preferences

? If no spreadsheet application is specified the data is written to an ASCII file

Page 43: Introduction to OPNET Modeler - info.ee.surrey.ac.ukinfo.ee.surrey.ac.uk/CCSR/Internal/Docs/opnet-pres-0111.pdf · Materials are based on OPNET version 7? ... • Tutorial & online

43

8585

Exporting Data -Spreadsheets

? User right-clicks inside graph on desired panel

? Selects “Export Graph Data to Spreadsheet”

? Modeler launches the appropriate program with data

8686

Generating Web Reports? Web Reports give the Modeler user a common interface with

non-Modeler users

? Reports are automatically generated and present data in a manner that is easy to use, navigate, and interpret

? Web Reports containing data and statistic graphics can be created after a simulation has run

? The reports will be HTML-formatted pages that can be read by any Web browser

Page 44: Introduction to OPNET Modeler - info.ee.surrey.ac.ukinfo.ee.surrey.ac.uk/CCSR/Internal/Docs/opnet-pres-0111.pdf · Materials are based on OPNET version 7? ... • Tutorial & online

44

8787

? Two methods for generating web reports

? Before running a simulation, check the option in the “Configure Simulation” dialog box

? After running a simulation, select “Generate Web Reports” from the Results menu

? Web Reports can take a while to generate due to the many graphic files that must be created

How to Generate Web Reports

8888

?A suite of models of network protocols, technologies, and applications available.

? OPNET Standard Models• Support majority of users• General Models • Protocol Models

?Specialised Models• Support user with particular interest in emerging or vendor-specific technologies

?Contributed Models • Free from OPNET user communities

Model Library

Page 45: Introduction to OPNET Modeler - info.ee.surrey.ac.ukinfo.ee.surrey.ac.uk/CCSR/Internal/Docs/opnet-pres-0111.pdf · Materials are based on OPNET version 7? ... • Tutorial & online

45

8989

?Application Models - Traffic Generator- Email, File Transfer, Web browsing, …

?Process Models – Queuing?Pipeline Stages

- Bus, Point- to- point, Radio?Modulation Functions

- BPSK, DPSK, MSK, …? Jammer Model?Maritime Satellite Model

- GEO Satellite, ALOHA Multiple Access?SWP - Sliding Window Protocol Model? ISDN / xDSL Models?Vendor Models

3Com, Ascend, Bay Networks, Cabletron, Cisco System, Fore Systems, Hewlett Packard, Newbridge , Novell, Xylan

Standard Model - General

9090

?Ethernet?FDDI?LANE, LAPB?Token Ring?X.25?Frame Relay?ATM? IP, IPX?Multicast?BGP, IGRP, RIP, OSPF ?RSVP?TCP, UDP, NCP

Standard Model –Protocol Specific

Page 46: Introduction to OPNET Modeler - info.ee.surrey.ac.ukinfo.ee.surrey.ac.uk/CCSR/Internal/Docs/opnet-pres-0111.pdf · Materials are based on OPNET version 7? ... • Tutorial & online

46

9191

Specialised Model?MPLS? IP Multicasting?UMTS?Circuit Switch

9292

?Contributed by OPNET user community?Freely Downloadable from OPNET website?Examples:

• Army Force: both voice and data packets in a militarymobile scenario.• Cellular Sample Models: use of the AMPS cellphonestandard models• GPRS• SS7• Mobile IP

Contributed Models

Page 47: Introduction to OPNET Modeler - info.ee.surrey.ac.ukinfo.ee.surrey.ac.uk/CCSR/Internal/Docs/opnet-pres-0111.pdf · Materials are based on OPNET version 7? ... • Tutorial & online

47

9393

Common Pitfalls

??OPNET is a powerful toolOPNET is a powerful tool??Common pitfall: “I will model everything”Common pitfall: “I will model everything”

•• Developing model without clear directionDeveloping model without clear direction•• No idea of questions to answerNo idea of questions to answer•• Perform more computation and use more memory than Perform more computation and use more memory than

necessarynecessary

??Model only what impacts resultsModel only what impacts results•• May be complex and time consuming to model everythingMay be complex and time consuming to model everything•• Some parts of the system don’t have a major impact on Some parts of the system don’t have a major impact on

overall performanceoverall performance

9494

Questions Should Drive Model Design

?Decide which questions to answer?Design model to answer those questions

• Don’t try to answer everything?Design multiple models

• Answer different questions• Study different aspects of your system

?Limit your model• Less fidelity pays off in higher performance

?Flexibility still important• Questions may change

Page 48: Introduction to OPNET Modeler - info.ee.surrey.ac.ukinfo.ee.surrey.ac.uk/CCSR/Internal/Docs/opnet-pres-0111.pdf · Materials are based on OPNET version 7? ... • Tutorial & online

48

9595

?An Integrated modeling, simulation & analysis environment

?Object Orientation• Objects & Attributes

?Hierarchical Models• Network, sub-network, nodes, module, process

?Graphical Specification• Visualising models, good presentation, animation

?Support of Node Mobility and Satellite orbit• Predefined or adaptive trajectories, orbits radio link models

?Vast set of model library

The Pluses of OPNET

9696

?Long learning period?Programming experience necessary?Longer debugging time – if using library model?Some library model are extremely complex

The Minuses of OPNET

Page 49: Introduction to OPNET Modeler - info.ee.surrey.ac.ukinfo.ee.surrey.ac.uk/CCSR/Internal/Docs/opnet-pres-0111.pdf · Materials are based on OPNET version 7? ... • Tutorial & online

49

9797

Summary

? Statistic declaration in Process model? Statistic collection Probe Editor?Configure & run simulation, view result in project

editor? Simulation Sequence Editor? Exporting topology and data to web?Model libraries

9898

More Information

?OPNET WWW page?OPNET Documentation?OPNET Support

• Contact Points in the University

Page 50: Introduction to OPNET Modeler - info.ee.surrey.ac.ukinfo.ee.surrey.ac.uk/CCSR/Internal/Docs/opnet-pres-0111.pdf · Materials are based on OPNET version 7? ... • Tutorial & online

50

9999

Session IIIThe End

Q&A ?