omnetpp

中文使用者手冊
OMNeT++ version 5.0

http://omnetpp.org

資料來源:OMNeT++ version 5.0 User Manual

時間過很快,v4.6的手冊還沒寫完v5.0已經出來了,所以就直接放棄v4.6的撰寫移到v5.0。還是一樣時間有限有空才寫,所以這一份文件的完成沒有期限


章節目錄

1 簡介(Introduction)
2 概述 (Overview)
3 NED語言 (The NED Language)
4 簡單模組 (Simple Modules)
5 訊息與封包 (Messages and Packets)
6 訊息定義 (Message Definitions)
7 模擬資料庫 (The Simulation Library)
8 建立模擬程式 (Building Simulation Programs)
9 模擬組態設定 (Configuring Simulations)
10 執行模擬 (Running Simulations)
11 網路圖形與動畫 (Network Graphics And Animation)
12 結果紀錄與分析 (Result Recording and Analysis)
13 事件紀錄器 (Eventlog)
14 製作 NED和訊息文件 (Documenting NED and Messages)
15 測試 (Testing)
16 平行分散式模擬 (Parallel Distributed Simulation)
17 OMNET++擴展與客製化 (Customizing and Extending OMNeT++)
18 Embedding the Simulation Kernel
19 Appendix: NED Reference
20 Appendix: NED Language Grammar
21 Appendix: NED XML Binding
22 Appendix: NED Functions
23 Appendix: Message Definitions Grammar
24 Appendix: Display String Tags
25 Appendix: Configuration Options
26 Appendix: Result File Formats
27 Appendix: Eventlog File Format
28 Appendix: Figure Definitions

翻譯詞彙表

目錄

  1 簡介 (Introduction)
    1.1 OMNeT++ 簡介 (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 使用OMNeT++ (Using OMNeT++)
2.3.1 建立與執行模擬 (Building and Running Simulations)
2.3.2 OMNeT++ 4.6版內容 (What Is in the Distribution)

  3 NED語言 (The NED Language)
    3.1 NED簡介 (NED Overview)
    3.2 NED快速學習 (NED Quickstart)
3.2.1 網路 (The Network)
3.2.2 通道的介紹 (Introducing a Channel)
3.2.3 簡單模組:App、Routing、以及Queue (The App, Routing, and Queue Simple Modules)
3.2.4 複合式模組:Node (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.7 閘 (Gates)
    3.8 子模組 (Submodules)
    3.9 連線 (Connections)
    3.10 複數連線 (Multiple Connections)
3.10.1 連線模板 (Connection Patterns)
    3.11 參數型子模組與連線型別 (Parametric Submodule and Connection Types)
3.11.1 參數型子模組型別 (Parametric Submodule Types)
3.11.2 參數型連線型別 (Parametric Connection Types)
    3.12 後設資料註解 (屬性) ((Metadata Annotations (Properties))
    3.13 繼承 (Inheritance)
    3.14 套件 (Packages)

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 Module IDs
4.11.3 Walking Up and Down the Module Hierarchy
4.11.4 Iterating over Submodules
4.11.5 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 Parameters and Objects
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.7 Pattern Matching
7.7.1 cPatternMatcher
7.7.2 cMatchExpression
    7.8 Statistics and Distribution Estimation
7.8.1 cStatistic and Descendants
7.8.2 Distribution Estimation
7.8.3 The k-split Algorithm
7.8.4 Transient Detection and Result Accuracy
    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 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 Display Strings
8.3.1 Syntax and Placement
8.3.2 Inheritance
8.3.3 Submodule Tags
8.3.4 Background Tags
8.3.5 Connection Display Strings
8.3.6 Message Display Strings
8.3.7 Parameter Substitution
8.3.8 Colors
8.3.9 Icons
8.3.10 Layouting
8.3.11 Changing Display Strings at Runtime
    8.4 Bubbles
    8.5 The Canvas
8.5.1 Overview
8.5.2 Creating, Accessing and Viewing Canvases
8.5.3 Figure Classes
8.5.4 Figure Hierarchy
8.5.5 Creating and Manipulating Figures from NED and C++
8.5.6 Transforms
8.5.7 Showing/Hiding Figures
8.5.8 Specifying Positions, Colors, Fonts and Other Properties
8.5.9 Primitive Figures
8.5.10 Compound Figures
8.5.11 Defining New Figure Types
    8.6 3D Visualization
8.6.1 Introduction
8.6.2 The OMNeT++ API for OpenSceneGraph
8.6.3 Using OSG
8.6.4 Using osgEarth
8.6.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 Automatic Include Dirs
9.2.8 Dependency Handling
9.2.9 Out-of-Directory Build
9.2.10 Building Shared and Static Libraries
9.2.11 Recursive Builds
9.2.12 Customizing the Makefile
9.2.13 Projects with Multiple Source Trees
9.2.14 A Multi-Directory Example
    9.3 Project Features
9.3.1 The opp_featuretool Program
9.3.2 What is a Project Feature
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.1.1 Running a Simulation Executable
11.1.2 Running a Shared Library
11.1.3 Controlling the Run
    11.2 Cmdenv: the Command-Line Interface
11.2.1 Example Run
11.2.2 Command-Line Options
11.2.3 Cmdenv Ini File Options
11.2.4 Interpreting Cmdenv Output
    11.3 The Tkenv Graphical User Interface
11.3.1 Command-Line and Configuration Options
    11.4 The Qtenv Graphical User Interface
11.4.1 Command-Line and Configuration Options
    11.5 Batch Execution
11.5.1 Using Cmdenv
11.5.2 Using Shell Scripts
11.5.3 Using opp_runall
    11.6 Akaroa Support: Multiple Replications in Parallel
11.6.1 Introduction
11.6.2 What Is Akaroa
11.6.3 Using Akaroa with OMNeT++
    11.7 Troubleshooting
11.7.1 Unrecognized Configuration Option
11.7.2 Stack Problems
11.7.3 Memory Leaks and Crashes
11.7.4 Simulation Executes Slowly

  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 Overview of the Result File Formats
12.3.1 Output Vector Files
12.3.2 Scalar Result Files
    12.4 The Analysis Tool in the Simulation IDE
    12.5 Scave Tool
12.5.1 The filter Command
12.5.2 The index Command
12.5.3 The summary Command
    12.6 Alternative Statistical Analysis and Plotting Tools
12.6.1 GNU R
12.6.2 NumPy, SciPy and MatPlotLib
12.6.3 MATLAB or Octave
12.6.4 Gnuplot
12.6.5 ROOT
12.6.6 Grace
12.6.7 Spreadsheet Programs

  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: 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 Operators
19.5.2 Referencing Parameters and Loop Variables
19.5.3 The index Operator
19.5.4 The sizeof() Operator
19.5.5 Functions
19.5.6 Units of Measurement

  20 Appendix: NED Language Grammar

  21 Appendix: NED XML Binding

  22 Appendix: 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 “xml”:

  23 Appendix: Message Definitions Grammar

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

  25 Appendix: Configuration Options
    25.1 Configuration Options
    25.2 Predefined Variables

  26 Appendix: Result File Formats
    26.1 Version
    26.2 Run Declaration
    26.3 Attributes
    26.4 Module Parameters
    26.5 Scalar Data
    26.6 Vector Declaration
    26.7 Vector Data
    26.8 Index Header
    26.9 Index Data
    26.10 Statistics Object
    26.11 Field
    26.12 Histogram Bin

  27 Appendix: Eventlog File Format
    27.1 Supported Entry Types and Their Attributes

  28 Appendix: Figure Definitions
    28.1 Built-in Figure Types
    28.2 Attribute Types
    28.3 Figure Attributes