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

41
Introduction OMNeT++ 1

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

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

Introduction

OMNeT++

1

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

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

What is OMNeT++?

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

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

3

OMNeT++ ; A Framework Approach

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

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

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

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++

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

OMNeT++ Important Features

6

Flexibility Programming model Model management Debugging, tracing, and experiment

specifications Simulation Modes

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

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

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

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

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

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

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

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

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

Command line Interactive GUI

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

11

Simulation Modes

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

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

Edit it with GNED or other text editor.

NED Overview

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

Import directives Channel definitions Simple and compound module definitions Network definitions

Components of a NED description

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

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

Import directives

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

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

endchannel

Channel definitions

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

simple TrafficGen parameters:

interarrivalTime, numOfMessages : const,

address : string; gates:

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

endsimple

Simple module definitionsApplication Layer

TrafficGen

MAC Layer

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

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

endmodule

Compound module definitions

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

module CompoundModule //... submodules:

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

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

endmodule

Compound module definitions - submodules

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

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

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

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

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

endmodule

Connections

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

network wirelessLAN: WirelessLAN parameters:

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

endnetwork

Network definitions

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

// // 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

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

// // 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;…

}

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

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

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

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?

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

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

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

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

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

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

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

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

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

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

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

MiXiM

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

Questions?

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

Installation

OMNeT++ and

MIXIM Framework

33

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

download

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

download

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

Install

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

Create new project

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

Import projects

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

Building workspace

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

Development environment

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

Parameer assignments