Introduction 1. A Simulator Modular (Component-based) Open-architecture For Discrete Event...

Preview:

Citation preview

Introduction

OMNeT++

1

A Simulator Modular (Component-based) Open-architecture For Discrete Event Networks

What is OMNeT++?

Various simulation models and frameworks For Specific Application Areas Mostly Open Source Developed Independently of OMNeT++

3

OMNeT++ ; A Framework Approach

Simulation Frameworks Based on OMNeT++: Mobility Framework

Mobile & Wireless Simulations INET Framework

Wired & Wireless TCP/IP Based Simulations Castalia

Wireless Sensor Networks MiXiM

Mobile & Wireless Simulations

OMNET++ Frameworks

OverSim Overlay and Peer-to-Peer Networks (INET-based)

NesCT OS simulations

Consensus Positif and MAC Simulator for sensor networks

CDNSim content distribution networks, youtube

PAWiS Power Aware Wireless Sensor Networks Simulation

Framework Other:

FIELDBUS, ACID SimTools, X-Simulator5

Simulators Based on OMNeT++

OMNeT++ Important Features

6

Flexibility Programming model Model management Debugging, tracing, and experiment

specifications Simulation Modes

Core framework for discrete event simulation.Different add-ons for specific purposes.

Fully implemented in C++.

Functionality added by deriving classes following specified rules.

7

Flexibility

Simulated objects are represented by modules• Simple or Compound• Communicate by messages (directly or via

gates)• Consists of

• Interface description (.NED file)• Behavior description (C++ class)

Modules, gates and links can be created:• Statically - at the beginning of the simulation

(NED file)• Dynamically – during the simulation

Programming model

Clear separation among simulation kernel and developed models.

Easiness of packaging developed modules for reuse.

No need for patching the simulation kernel to install a model.

9

Model management

Build models and combine like KOONESAZI blocks

Supports Recording data vectors and scalars in output

files Random numbers with several distributions

and different starting seeds displaying info about the module’s activity,

snapshots, breakpointsEasy to configure using .ini fileBatch execution of the same simulation

for different parameters is also included

Debugging and tracking

Command line Interactive GUI

Tcl/Tk windowing, allows view what’s happening and modify parameters at run-time.

11

Simulation Modes

The topology of a model is specified using the NED language.

Edit it with GNED or other text editor.

NED Overview

Import directives Channel definitions Simple and compound module definitions Network definitions

Components of a NED description

import "ethernet"; // imports ethernet.ned import "Router", "StandardHost", "FlatNetworkConfigurator";

Import directives

channel LeasedLine delay 0.0018 // sec error 1e-8 datarate 128000 // bit/sec

endchannel

Channel definitions

simple TrafficGen parameters:

interarrivalTime, numOfMessages : const,

address : string; gates:

in: fromPort, fromHigherLayer; out: toPort, toHigherLayer;

endsimple

Simple module definitionsApplication Layer

TrafficGen

MAC Layer

module CompoundModule parameters: //... gates: //... submodules: //... connections: //...

endmodule

Compound module definitions

module CompoundModule //... submodules:

submodule1: ModuleType1 parameters: //... gatesizes: //...

submodule2: ModuleType2 parameters: //... gatesizes: //...

endmodule

Compound module definitions - submodules

module CompoundModule parameters:

param1: numeric, param2: numeric, useParam1: bool;

submodules: submodule1: Node

parameters: p1 = 10, p2 = param1+param2, p3 = useParam1==true ? param1 :

param2; //...

endmodule

Assigning values to submodule parameters

module CompoundModule parameters: //... gates: //... submodules: //... connections:

node1.output --> node2.input; node1.input <-- node2.output; //...

endmodule

Connections

network wirelessLAN: WirelessLAN parameters:

numUsers=10, httpTraffic=true, ftpTraffic=true, distanceFromHub=truncnormal(100,60);

endnetwork

Network definitions

// // Ethernet Modeling//

simple EtherMAC { parameters: string address; // others omitted for

brevity gates:

input phyIn; // to physical layer or the network

output phyOut; // to physical layer or the network

input llcIn; // to EtherLLC or higher layer output llcOut; // to EtherLLC or higher

layer }

Simulation Model

// // Host with an Ethernet interface // module EtherStation {

parameters: ... gates: ...

input in; // connect to switch/hub, etcoutput out;

submodules: app: EtherTrafficGen; llc: EtherLLC; mac: EtherMAC;

connections: app.out --> llc.hlIn; app.in <-- llc.hlOut; llc.macIn <-- mac.llcOut; llc.macOout --> mac.llcIn; mac.phyIn <-- in; mac.phyOut --> out;

}

Simulation Model

network EtherLAN { submodules: EtherStation;…

}

To run the executable, you need an omnetpp.ini file. 

[General] network = etherLAN *.numStations = 20 **.frameLength = normal(200,1400) **.station[0].numFramesToSend = 5000 **.station[1-5].numFramesToSend = 1000 **.station[*].numFramesToSend = 0

Running a model

NED files define the topology of network/modules A part of the model description

Ini files define Simulation parameters Results to collect Random seeds

This separation allows to change parameters without modifying the model E.g. no need to recompile, experiments can be

executed as a batch

Why use separate NED and ini files?

26

Simulation Model building

for (int i=0;i<10;i++) {}...

[General]network=test_disk

[Parameters]...

Model structure

Add behavior

Set up parameters

Compile

Run

Analyze

Build processNetwork

description

nedtool compiler

Generated C++ code

Module behavior C++

code

C++ compiler

C++ compiler

Simulation kernel

libraries

User interface libraries

Linker

Simulation

program

The capability to record simulation results by explicitly programming into the simple

modules

Output Vector omnetpp.vec

Output Scalar Files omnetpp.sca

Output of a simulation

Series of pairs timestamp, value Can store:

queue length over time end-to-end delay of received packets packet drops or channel throughput …

Can be configured from omnetpp.ini Enable or disable recording individual output

vectors Limit recording to a certain simulation time

interval Capture behaviour over time

29

Output Vector File

Contain summary statistics number of packets sent number of packet drops average end-to-end delay of received packets peak throughput …

30

Output Scalar Files

MiXiM

Questions?

Installation

OMNeT++ and

MIXIM Framework

33

download

download

Install

Create new project

Import projects

Building workspace

Development environment

Parameer assignments

Recommended