[Chapters]

Table of Contents


  1 Introduction
    1.1 What Is OMNeT++?
    1.2 Organization of This Manual

  2 Overview
    2.1 Modeling Concepts
      2.1.1 Hierarchical Modules
      2.1.2 Module Types
      2.1.3 Messages, Gates, Links
      2.1.4 Modeling of Packet Transmissions
      2.1.5 Parameters
      2.1.6 Topology Description Method
    2.2 Programming the Algorithms
    2.3 Using OMNeT++
      2.3.1 Building and Running Simulations
      2.3.2 What Is in the Distribution

  3 The NED Language
    3.1 NED Overview
    3.2 NED Quickstart
      3.2.1 The Network
      3.2.2 Introducing a Channel
      3.2.3 The App, Routing, and Queue Simple Modules
      3.2.4 The Node Compound Module
      3.2.5 Putting It Together
    3.3 Simple Modules
    3.4 Compound Modules
    3.5 Channels
    3.6 Parameters
      3.6.1 Assigning a Value
      3.6.2 Expressions
      3.6.3 volatile
      3.6.4 Units
      3.6.5 XML Parameters
    3.7 Gates
    3.8 Submodules
    3.9 Connections
      3.9.1 Channel Specification
      3.9.2 Channel Names
    3.10 Multiple Connections
      3.10.1 Examples
      3.10.2 Connection Patterns
    3.11 Parametric Submodule and Connection Types
      3.11.1 Parametric Submodule Types
      3.11.2 Conditional Parametric Submodules
      3.11.3 Parametric Connection Types
    3.12 Metadata Annotations (Properties)
      3.12.1 Property Indices
      3.12.2 Data Model
      3.12.3 Overriding and Extending Property Values
    3.13 Inheritance
    3.14 Packages
      3.14.1 Overview
      3.14.2 Name Resolution, Imports
      3.14.3 Name Resolution With "like"
      3.14.4 The Default Package

  4 Simple Modules
    4.1 Simulation Concepts
      4.1.1 Discrete Event Simulation
      4.1.2 The Event Loop
      4.1.3 Events and Event Execution Order in OMNeT++
      4.1.4 Simulation Time
      4.1.5 FES Implementation
    4.2 Components, Simple Modules, Channels
    4.3 Defining Simple Module Types
      4.3.1 Overview
      4.3.2 Constructor
      4.3.3 Initialization and Finalization
    4.4 Adding Functionality to cSimpleModule
      4.4.1 handleMessage()
      4.4.2 activity()
      4.4.3 How to Avoid Global Variables
      4.4.4 Reusing Module Code via Subclassing
    4.5 Accessing Module Parameters
      4.5.1 Volatile and Non-Volatile Parameters
      4.5.2 Changing a Parameter's Value
      4.5.3 Further cPar Methods
      4.5.4 Emulating Parameter Arrays
      4.5.5 handleParameterChange()
    4.6 Accessing Gates and Connections
      4.6.1 Gate Objects
      4.6.2 Connections
      4.6.3 The Connection's Channel
    4.7 Sending and Receiving Messages
      4.7.1 Self-Messages
      4.7.2 Sending Messages
      4.7.3 Broadcasts and Retransmissions
      4.7.4 Delayed Sending
      4.7.5 Direct Message Sending
      4.7.6 Packet Transmissions
      4.7.7 Receiving Messages with activity()
    4.8 Channels
      4.8.1 Overview
      4.8.2 The Channel API
      4.8.3 Channel Examples
    4.9 Stopping the Simulation
      4.9.1 Normal Termination
      4.9.2 Raising Errors
    4.10 Finite State Machines
      4.10.1 Overview
    4.11 Navigating the Module Hierarchy
      4.11.1 Module Vectors
      4.11.2 Component IDs
      4.11.3 Walking Up and Down the Module Hierarchy
      4.11.4 Finding Modules by Path
      4.11.5 Iterating over Submodules
      4.11.6 Navigating Connections
    4.12 Direct Method Calls Between Modules
    4.13 Dynamic Module Creation
      4.13.1 When To Use
      4.13.2 Overview
      4.13.3 Creating Modules
      4.13.4 Deleting Modules
      4.13.5 Module Deletion and finish()
      4.13.6 Creating Connections
      4.13.7 Removing Connections
    4.14 Signals
      4.14.1 Design Considerations and Rationale
      4.14.2 The Signals Mechanism
      4.14.3 Listening to Model Changes
    4.15 Signal-Based Statistics Recording
      4.15.1 Motivation
      4.15.2 Declaring Statistics
      4.15.3 Statistics Recording for Dynamically Registered Signals
      4.15.4 Adding Result Filters and Recorders Programmatically
      4.15.5 Emitting Signals
      4.15.6 Writing Result Filters and Recorders

  5 Messages and Packets
    5.1 Overview
    5.2 The cMessage Class
      5.2.1 Basic Usage
      5.2.2 Duplicating Messages
      5.2.3 Message IDs
      5.2.4 Control Info
      5.2.5 Information About the Last Arrival
      5.2.6 Display String
    5.3 Self-Messages
      5.3.1 Using a Message as Self-Message
      5.3.2 Context Pointer
    5.4 The cPacket Class
      5.4.1 Basic Usage
      5.4.2 Identifying the Protocol
      5.4.3 Information About the Last Transmission
      5.4.4 Encapsulating Packets
      5.4.5 Reference Counting
      5.4.6 Encapsulating Several Packets
    5.5 Attaching Objects To a Message
      5.5.1 Attaching Objects
      5.5.2 Attaching Parameters

  6 Message Definitions
    6.1 Introduction
      6.1.1 The First Message Class
    6.2 Messages and Packets
      6.2.1 Defining Messages and Packets
      6.2.2 Field Data Types
      6.2.3 Initial Values
      6.2.4 Enums
      6.2.5 Fixed-Size Arrays
      6.2.6 Variable-Size Arrays
      6.2.7 Classes and Structs as Fields
      6.2.8 Pointer Fields
      6.2.9 Inheritance
      6.2.10 Assignment of Inherited Fields
    6.3 Classes
    6.4 Structs
    6.5 Literal C++ Blocks
    6.6 Using C++ Types
      6.6.1 Announcing Types to the Message Compiler
      6.6.2 Making the C++ Declarations Available
      6.6.3 Putting it Together
    6.7 Customizing the Generated Class
      6.7.1 Customizing Method Names
      6.7.2 Customizing the Class via Inheritance
      6.7.3 Abstract Fields
    6.8 Using Standard Container Classes for Fields
      6.8.1 Typedefs
      6.8.2 Abstract Fields
    6.9 Namespaces
      6.9.1 Declaring a Namespace
      6.9.2 C++ Blocks and Namespace
      6.9.3 Type Announcements and Namespace
    6.10 Descriptor Classes
    6.11 Summary

  7 The Simulation Library
    7.1 Fundamentals
      7.1.1 Using the Library
      7.1.2 The cObject Base Class
      7.1.3 Iterators
      7.1.4 Runtime Errors
    7.2 Logging from Modules
      7.2.1 Log Output
      7.2.2 Log Levels
      7.2.3 Log Statements
      7.2.4 Log Categories
      7.2.5 Composition and New lines
      7.2.6 Implementation
    7.3 Random Number Generators
      7.3.1 RNG Implementations
      7.3.2 Global and Component-Local RNGs
      7.3.3 Accessing the RNGs
    7.4 Generating Random Variates
      7.4.1 Component Methods
      7.4.2 Random Number Stream Classes
      7.4.3 Generator Functions
      7.4.4 Random Numbers from Histograms
      7.4.5 Adding New Distributions
    7.5 Container Classes
      7.5.1 Queue class: cQueue
      7.5.2 Expandable Array: cArray
    7.6 Routing Support: cTopology
      7.6.1 Overview
      7.6.2 Basic Usage
      7.6.3 Shortest Paths
      7.6.4 Manipulating the graph
    7.7 Pattern Matching
      7.7.1 cPatternMatcher
      7.7.2 cMatchExpression
    7.8 Collecting Summary Statistics and Histograms
      7.8.1 cStdDev
      7.8.2 cHistogram
      7.8.3 cPSquare
      7.8.4 cKSplit
    7.9 Recording Simulation Results
      7.9.1 Output Vectors: cOutVector
      7.9.2 Output Scalars
    7.10 Watches and Snapshots
      7.10.1 Basic Watches
      7.10.2 Read-write Watches
      7.10.3 Structured Watches
      7.10.4 STL Watches
      7.10.5 Snapshots
      7.10.6 Getting Coroutine Stack Usage
    7.11 Defining New NED Functions
      7.11.1 Define_NED_Function()
      7.11.2 Define_NED_Math_Function()
    7.12 Deriving New Classes
      7.12.1 cObject or Not?
      7.12.2 cObject Virtual Methods
      7.12.3 Class Registration
      7.12.4 Details
    7.13 Object Ownership Management
      7.13.1 The Ownership Tree
      7.13.2 Managing Ownership

  8 Graphics and Visualization
    8.1 Overview
    8.2 Placement of Visualization Code
      8.2.1 The refreshDisplay() Method
      8.2.2 Advantages
      8.2.3 Why is refreshDisplay() const?
    8.3 Smooth Animation
      8.3.1 Concepts
      8.3.2 Smooth vs. Traditional Animation
      8.3.3 The Choice of Animation Speed
      8.3.4 Holds
      8.3.5 Disabling Built-In Animations
    8.4 Display Strings
      8.4.1 Syntax and Placement
      8.4.2 Inheritance
      8.4.3 Submodule Tags
      8.4.4 Background Tags
      8.4.5 Connection Display Strings
      8.4.6 Message Display Strings
      8.4.7 Parameter Substitution
      8.4.8 Colors
      8.4.9 Icons
      8.4.10 Layouting
      8.4.11 Changing Display Strings at Runtime
    8.5 Bubbles
    8.6 The Canvas
      8.6.1 Overview
      8.6.2 Creating, Accessing and Viewing Canvases
      8.6.3 Figure Classes
      8.6.4 The Figure Tree
      8.6.5 Creating and Manipulating Figures from NED and C++
      8.6.6 Stacking Order
      8.6.7 Transforms
      8.6.8 Showing/Hiding Figures
      8.6.9 Figure Tooltip, Associated Object
      8.6.10 Specifying Positions, Colors, Fonts and Other Properties
      8.6.11 Primitive Figures
      8.6.12 Compound Figures
      8.6.13 Self-Refreshing Figures
      8.6.14 Figures with Custom Renderers
    8.7 3D Visualization
      8.7.1 Introduction
      8.7.2 The OMNeT++ API for OpenSceneGraph
      8.7.3 Using OSG
      8.7.4 Using osgEarth
      8.7.5 OpenSceneGraph/osgEarth Programming Resources

  9 Building Simulation Programs
    9.1 Overview
    9.2 Using opp_makemake and Makefiles
      9.2.1 Command-line Options
      9.2.2 Basic Use
      9.2.3 Debug and Release Builds
      9.2.4 Debugging the Makefile
      9.2.5 Using External C/C++ Libraries
      9.2.6 Building Directory Trees
      9.2.7 Dependency Handling
      9.2.8 Out-of-Directory Build
      9.2.9 Building Shared and Static Libraries
      9.2.10 Recursive Builds
      9.2.11 Customizing the Makefile
      9.2.12 Projects with Multiple Source Trees
      9.2.13 A Multi-Directory Example
    9.3 Project Features
      9.3.1 What is a Project Feature
      9.3.2 The opp_featuretool Program
      9.3.3 The .oppfeatures File
      9.3.4 How to Introduce a Project Feature

  10 Configuring Simulations
    10.1 The Configuration File
      10.1.1 An Example
      10.1.2 File Syntax
      10.1.3 File Inclusion
    10.2 Sections
      10.2.1 The [General] Section
      10.2.2 Named Configurations
      10.2.3 Section Inheritance
    10.3 Assigning Module Parameters
      10.3.1 Using Wildcard Patterns
      10.3.2 Using the Default Values
    10.4 Parameter Studies
      10.4.1 Iterations
      10.4.2 Named Iteration Variables
      10.4.3 Parallel Iteration
      10.4.4 Predefined Variables, Run ID
      10.4.5 Constraint Expression
      10.4.6 Repeating Runs with Different Seeds
      10.4.7 Experiment-Measurement-Replication
    10.5 Configuring the Random Number Generators
      10.5.1 Number of RNGs
      10.5.2 RNG Choice
      10.5.3 RNG Mapping
      10.5.4 Automatic Seed Selection
      10.5.5 Manual Seed Configuration
    10.6 Logging
      10.6.1 Compile-Time Filtering
      10.6.2 Runtime Filtering
      10.6.3 Log Prefix Format
      10.6.4 Configuring Cmdenv
      10.6.5 Configuring Tkenv and Qtenv

  11 Running Simulations
    11.1 Introduction
    11.2 Simulation Executables vs Libraries
    11.3 Command-Line Options
    11.4 Configuration Options on the Command Line
    11.5 Specifying Ini Files
    11.6 Specifying the NED Path
    11.7 Selecting a User Interface
    11.8 Selecting Configurations and Runs
      11.8.1 Run Filter Syntax
      11.8.2 The Query Option
    11.9 Loading Extra Libraries
    11.10 Stopping Condition
    11.11 Controlling the Output
    11.12 Debugging
    11.13 Debugging Leaked Messages
    11.14 Debugging Other Memory Problems
    11.15 Profiling
    11.16 Checkpointing
    11.17 Using Cmdenv
      11.17.1 Sample Output
      11.17.2 Selecting Runs, Batch Operation
      11.17.3 Express Mode
      11.17.4 Other Options
    11.18 The Qtenv Graphical User Interface
      11.18.1 Command-Line and Configuration Options
    11.19 The Tkenv Graphical User Interface
      11.19.1 Command-Line and Configuration Options
    11.20 Running Simulation Campaigns
      11.20.1 The Naive Approach
      11.20.2 Using opp_runall
      11.20.3 Exploiting Clusters
    11.21 Akaroa Support: Multiple Replications in Parallel
      11.21.1 Introduction
      11.21.2 What Is Akaroa
      11.21.3 Using Akaroa with OMNeT++

  12 Result Recording and Analysis
    12.1 Result Recording
      12.1.1 Using Signals and Declared Statistics
      12.1.2 Direct Result Recording
    12.2 Configuring Result Collection
      12.2.1 Result File Names
      12.2.2 Enabling/Disabling Result Items
      12.2.3 Selecting Recording Modes for Signal-Based Statistics
      12.2.4 Warm-up Period
      12.2.5 Output Vectors Recording Intervals
      12.2.6 Recording Event Numbers in Output Vectors
      12.2.7 Saving Parameters as Scalars
      12.2.8 Recording Precision
    12.3 The OMNeT++ Result File Format
      12.3.1 Output Vector Files
      12.3.2 Scalar Result Files
    12.4 SQLite Result Files
    12.5 Scavetool
      12.5.1 Commands
      12.5.2 Examples
    12.6 Result Analysis
      12.6.1 The Analysis Tool in the Simulation IDE
      12.6.2 Spreadsheets
      12.6.3 Using Python for Result Analysis
      12.6.4 Using Other Software

  13 Eventlog
    13.1 Introduction
    13.2 Configuration
      13.2.1 File Name
      13.2.2 Recording Intervals
      13.2.3 Recording Modules
      13.2.4 Recording Message Data
    13.3 Eventlog Tool
      13.3.1 Filter
      13.3.2 Echo

  14 Documenting NED and Messages
    14.1 Overview
    14.2 Documentation Comments
      14.2.1 Private Comments
      14.2.2 More on Comment Placement
    14.3 Referring to Other NED and Message Types
      14.3.1 Automatic Linking
      14.3.2 Tilde Linking
    14.4 Text Layout and Formatting
      14.4.1 Paragraphs and Lists
      14.4.2 Special Tags
      14.4.3 Text Formatting Using HTML
      14.4.4 Escaping HTML Tags
    14.5 Customizing and Adding Pages
      14.5.1 Adding a Custom Title Page
      14.5.2 Adding Extra Pages
      14.5.3 Incorporating Externally Created Pages
    14.6 File Inclusion

  15 Testing
    15.1 Overview
      15.1.1 Verification, Validation
      15.1.2 Unit Testing, Regression Testing
    15.2 The opp_test Tool
      15.2.1 Introduction
      15.2.2 Terminology
      15.2.3 Test File Syntax
      15.2.4 Test Description
      15.2.5 Test Code Generation
      15.2.6 PASS Criteria
      15.2.7 Extra Processing Steps
      15.2.8 Unresolved
      15.2.9 opp_test Synopsys
      15.2.10 Writing the Control Script
    15.3 Smoke Tests
    15.4 Fingerprint Tests
      15.4.1 Fingerprint Computation
      15.4.2 Fingerprint Tests
    15.5 Unit Tests
    15.6 Module Tests
    15.7 Statistical Tests
      15.7.1 Validation Tests
      15.7.2 Statistical Regression Tests
      15.7.3 Implementation

  16 Parallel Distributed Simulation
    16.1 Introduction to Parallel Discrete Event Simulation
    16.2 Assessing Available Parallelism in a Simulation Model
    16.3 Parallel Distributed Simulation Support in OMNeT++
      16.3.1 Overview
      16.3.2 Parallel Simulation Example
      16.3.3 Placeholder Modules, Proxy Gates
      16.3.4 Configuration
      16.3.5 Design of PDES Support in OMNeT++

  17 Customizing and Extending OMNeT++
    17.1 Overview
    17.2 Adding a New Configuration Option
      17.2.1 Registration
      17.2.2 Reading the Value
    17.3 Simulation Lifetime Listeners
    17.4 cEvent
    17.5 Defining a New Random Number Generator
    17.6 Defining a New Event Scheduler
    17.7 Defining a New FES Data Structure
    17.8 Defining a New Fingerprint Algorithm
    17.9 Defining a New Output Scalar Manager
    17.10 Defining a New Output Vector Manager
    17.11 Defining a New Eventlog Manager
    17.12 Defining a New Snapshot Manager
    17.13 Defining a New Configuration Provider
      17.13.1 Overview
      17.13.2 The Startup Sequence
      17.13.3 Providing a Custom Configuration Class
      17.13.4 Providing a Custom Reader for SectionBasedConfiguration
    17.14 Implementing a New User Interface

  18 Embedding the Simulation Kernel
    18.1 Architecture
    18.2 Embedding the OMNeT++ Simulation Kernel
      18.2.1 The main() Function
      18.2.2 The simulate() Function
      18.2.3 Providing an Environment Object
      18.2.4 Providing a Configuration Object
      18.2.5 Loading NED Files
      18.2.6 How to Eliminate NED Files
      18.2.7 Assigning Module Parameters
      18.2.8 Extracting Statistics from the Model
      18.2.9 The Simulation Loop
      18.2.10 Multiple, Coexisting Simulations
      18.2.11 Installing a Custom Scheduler
      18.2.12 Multi-Threaded Programs

  19 Appendix A: NED Reference
    19.1 Syntax
      19.1.1 NED File Name Extension
      19.1.2 NED File Encoding
      19.1.3 Reserved Words
      19.1.4 Identifiers
      19.1.5 Case Sensitivity
      19.1.6 Literals
      19.1.7 Comments
      19.1.8 Grammar
    19.2 Built-in Definitions
    19.3 Packages
      19.3.1 Package Declaration
      19.3.2 Directory Structure, package.ned
    19.4 Components
      19.4.1 Simple Modules
      19.4.2 Compound Modules
      19.4.3 Networks
      19.4.4 Channels
      19.4.5 Module Interfaces
      19.4.6 Channel Interfaces
      19.4.7 Resolving the C++ Implementation Class
      19.4.8 Properties
      19.4.9 Parameters
      19.4.10 Pattern Assignments
      19.4.11 Gates
      19.4.12 Submodules
      19.4.13 Connections
      19.4.14 Conditional and Loop Connections, Connection Groups
      19.4.15 Inner Types
      19.4.16 Name Uniqueness
      19.4.17 Parameter Assignment Order
      19.4.18 Type Name Resolution
      19.4.19 Resolution of Parametric Types
      19.4.20 Implementing an Interface
      19.4.21 Inheritance
      19.4.22 Network Build Order
    19.5 Expressions
      19.5.1 Constants
      19.5.2 Operators
      19.5.3 Referencing Parameters and Loop Variables
      19.5.4 The typename Operator
      19.5.5 The index Operator
      19.5.6 The exists() Operator
      19.5.7 The sizeof() Operator
      19.5.8 Functions
      19.5.9 Units of Measurement

  20 Appendix B: NED Language Grammar

  21 Appendix C: NED XML Binding

  22 Appendix D: NED Functions
    22.1 Category "conversion":
    22.2 Category "math":
    22.3 Category "misc":
    22.4 Category "ned":
    22.5 Category "random/continuous":
    22.6 Category "random/discrete":
    22.7 Category "strings":
    22.8 Category "units":
    22.9 Category "units/conversion":
    22.10 Category "xml":

  23 Appendix E: Message Definitions Grammar

  24 Appendix F: Display String Tags
    24.1 Module and Connection Display String Tags
    24.2 Message Display String Tags

  25 Appendix G: Figure Definitions
    25.1 Built-in Figure Types
    25.2 Attribute Types
    25.3 Figure Attributes

  26 Appendix H: Configuration Options
    26.1 Configuration Options
    26.2 Predefined Variables

  27 Appendix I: Result File Formats
    27.1 Native Result Files
      27.1.1 Version
      27.1.2 Run Declaration
      27.1.3 Attributes
      27.1.4 Module Parameters
      27.1.5 Scalar Data
      27.1.6 Vector Declaration
      27.1.7 Vector Data
      27.1.8 Index Header
      27.1.9 Index Data
      27.1.10 Statistics Object
      27.1.11 Field
      27.1.12 Histogram Bin
    27.2 SQLite Result Files

  28 Appendix J: Eventlog File Format
    28.1 Supported Entry Types and Their Attributes