TUHH Institute of Telematics TUHH Hamburg University of Technology - - PowerPoint PPT Presentation

tuhh
SMART_READER_LITE
LIVE PREVIEW

TUHH Institute of Telematics TUHH Hamburg University of Technology - - PowerPoint PPT Presentation

Cross-Platform Protocol Development Based on OMNeT++ Stefan Unterschtz, Andreas Weigel and Volker Turau SIMUTools 2012: OMNeT++ Workshop 23 rd March, 2012 Institute of Telematics TUHH Institute of Telematics TUHH Hamburg University of


slide-1
SLIDE 1

Cross-Platform Protocol Development Based on OMNeT++

Stefan Unterschütz, Andreas Weigel and Volker Turau

SIMUTools 2012: OMNeT++ Workshop

23rd March, 2012

TUHH TUHH

Institute of Telematics Institute of Telematics Hamburg University of Technology Hamburg University of Technology

slide-2
SLIDE 2

1 Introduction

slide-3
SLIDE 3

Introduction Introduction

Motivation

Simulation is indispensable for the development of (wireless) network protocols. OMNeT++ is a powerful tool for simulations of network protocols.

Base Station

Andreas Weigel Cross-Platform Protocol Development Based on OMNeT++ Andreas Weigel Cross-Platform Protocol Development Based on OMNeT++ 1 1

slide-4
SLIDE 4

Introduction Introduction

Motivation

Simulation is indispensable for the development of (wireless) network protocols. OMNeT++ is a powerful tool for simulations of network protocols.

Base Station

However:

Re-implementation of protocols for a target platform is time-consuming and error-prone

Andreas Weigel Cross-Platform Protocol Development Based on OMNeT++ Andreas Weigel Cross-Platform Protocol Development Based on OMNeT++ 1 1

slide-5
SLIDE 5

Introduction Introduction

Introduction

CometOS, a component-based, extensible, tiny “operating system” Design Goals

Single code base for protocols, whether running

simulations or executing on target hardware

“Lightweight enough” for resource constrained

hardware

Flexibility, extensibility, avoidance of code redundancy Thereby: speed up protocol development and produce

safe code

Andreas Weigel Cross-Platform Protocol Development Based on OMNeT++ Andreas Weigel Cross-Platform Protocol Development Based on OMNeT++ 2 2

slide-6
SLIDE 6

Introduction Introduction

1

Introduction

2

Architecture and Concepts

3

Feasibility

4

Conclusion

Andreas Weigel Cross-Platform Protocol Development Based on OMNeT++ Andreas Weigel Cross-Platform Protocol Development Based on OMNeT++ 3 3

slide-7
SLIDE 7

2 Architecture and Concepts

slide-8
SLIDE 8

Architecture and Concepts Architecture and Concepts

Architecture

User Code

Appl. Rout. Rout. Fork NBH CSMA

CometOS Core

Module InputGate OutputGate Message Object

CometOS HIL ATmega128RFA1

  • ther platforms

Scheduler MAC AL completely independent platform independent platform dependent

Hardware platform

Andreas Weigel Cross-Platform Protocol Development Based on OMNeT++ Andreas Weigel Cross-Platform Protocol Development Based on OMNeT++ 4 4

slide-9
SLIDE 9

Architecture and Concepts Architecture and Concepts

Architecture

User Code

Appl. Rout. Rout. Fork NBH CSMA

CometOS Core

Module InputGate OutputGate Message Object

CometOS HIL ATmega128RFA1

  • ther platforms

Scheduler MAC AL completely independent platform independent platform dependent

Hardware platform

User Code

Appl. Rout. Rout. Fork NBH CSMA Module InputGate OutputGate Message Object MAC AL

CometOS Adapter

OMNeT++ completely independent

OMNeT++ simulation

Andreas Weigel Cross-Platform Protocol Development Based on OMNeT++ Andreas Weigel Cross-Platform Protocol Development Based on OMNeT++ 4 4

slide-10
SLIDE 10

Architecture and Concepts Architecture and Concepts

Gates and Message Passing

Message handlers are executed non-preemptively (millisecond precision)

Adoption of OMNeT++ message and gate concept Added type safety

  • Gates instantiated with a certain message type
  • Connections between gates are checked at compile time

⇒ dynamic_casts can be avoided

Decrease of boilerplate code

  • Gates and self-messages directly bound to handler methods
  • No handleMessage() dispatch code necessary

User-defined messages

  • Created by deriving from base class
  • Basic message types provided: Request/Confirm, Indication

Andreas Weigel Cross-Platform Protocol Development Based on OMNeT++ Andreas Weigel Cross-Platform Protocol Development Based on OMNeT++ 5 5

slide-11
SLIDE 11

Architecture and Concepts Architecture and Concepts

Message Passing (2)

class MyMsg: public Message { } ; class MyReceiver : public Module { public : InputGate <MyMsg> gateIn ; MyReceiver ( ) : gateIn ( this , &MyReceiver : : handle , " gateIn " ) { } void handle (MyMsg ∗msg) { delete msg; } } ; class MySender : public Module { public : OutputGate<MyMsg> gateOut ; MySender ( ) : gateOut ( this , " gateOut " ) { } void i n i t i a l i z e ( ) { schedule (new Message , &MySender : : t r a f f i c ,500); } void t r a f f i c ( Message ∗msg) { gateOut . send (new MyMsg ) ; delete msg; } } ;

Andreas Weigel Cross-Platform Protocol Development Based on OMNeT++ Andreas Weigel Cross-Platform Protocol Development Based on OMNeT++ 6 6

slide-12
SLIDE 12

Architecture and Concepts Architecture and Concepts

MAC abstraction layer

Goal: Basis for arbitrary, platform-independent MAC

protocols (CSMA, TDMA, LPL, LPP)

Should support Link-Layer ACKs, CCA, Random Backoffs Hardware-supported functions of 802.15.4 transceivers

MAL CSMA TDMA BoxMAC . . .

Andreas Weigel Cross-Platform Protocol Development Based on OMNeT++ Andreas Weigel Cross-Platform Protocol Development Based on OMNeT++ 7 7

slide-13
SLIDE 13

Architecture and Concepts Architecture and Concepts

Airframes and Serialization

Actual over-the-air packet: Managed byte array (Airframe) Support for serialization of simple types User-defined types (structs, classes):

⇒ serialization user-provided

struct NwkHeader { uint16_t dst ; uint16_t source ; } void s e r i a l i z e ( ByteVector &buffer , const NwkHeader &value ) { s e r i a l i z e ( buffer , value . dst ) ; s e r i a l i z e ( buffer , value . source ) ; } . . . NwkHeader nwk(SINK_ADDR, getId ( ) ) ; request−>getAirframe ( ) . s e r i a l i z e (nwk ) ;

Andreas Weigel Cross-Platform Protocol Development Based on OMNeT++ Andreas Weigel Cross-Platform Protocol Development Based on OMNeT++ 8 8

slide-14
SLIDE 14

Architecture and Concepts Architecture and Concepts

Initialization

For OMNeT++ ⇒ .ned, .ini files

/ / Setup f o r OMNeT++ in NED language / / ( skipped declaration

  • f modules )

network Network { submodules : s : MySender ; r : MyReceiver ; connections : s . gateOut −−> r . gateIn ; }

For Hardware Platforms: ⇒ C++ initialization file

/ / Setup f o r Hardware MySender s ; MyReceiver r ; int main ( ) { s . gateOut . connectTo ( r . gateIn ) ; cometos : : i n i t i a l i z e ( ) ; cometos : : run ( ) ; return 0; }

Andreas Weigel Cross-Platform Protocol Development Based on OMNeT++ Andreas Weigel Cross-Platform Protocol Development Based on OMNeT++ 9 9

slide-15
SLIDE 15

Architecture and Concepts Architecture and Concepts

Base Station Support

Currently under development Python wrapper for existing CometOS C++ code (SWIG)

  • Reuse protocol implementation for a base station
  • Usable with real testbed or OMNeT++ real-time simulation

and TCP/IP connector

Integration of powerful remote access methodology

  • Read/write of variables
  • Remote execution of methods
  • Subscribe to events

Andreas Weigel Cross-Platform Protocol Development Based on OMNeT++ Andreas Weigel Cross-Platform Protocol Development Based on OMNeT++ 10 10

slide-16
SLIDE 16

Architecture and Concepts Architecture and Concepts

Base Station Support

class MyModule : public RemoteModule { public : MyModule ( const char∗ name) : RemoteModule (name) { } void i n i t i a l i z e ( ) { declareRemote(&MyModule : : add , " add " ) ; } uint16_t add ( uint8_t &a , uint8_t &b ) { return a+b ; } } ; MyModule m( "myModule" ) ; r=RemoteModule ( "myModule" ) ; r . declareRemote ( " add " , uint16_t , uint8_t , u int 8 _ t ) print r . add(18 , 11) >>> 29

↑ Python console ← CometOS-Module

Andreas Weigel Cross-Platform Protocol Development Based on OMNeT++ Andreas Weigel Cross-Platform Protocol Development Based on OMNeT++ 10 10

slide-17
SLIDE 17

Architecture and Concepts Architecture and Concepts

Typical Development Steps

OMNeT++ Simulation

Base Station

OMNeT++ Simulation C++/Python

Base Station

Real-World Deployment C++/Python

Base Station

Andreas Weigel Cross-Platform Protocol Development Based on OMNeT++ Andreas Weigel Cross-Platform Protocol Development Based on OMNeT++ 11 11

slide-18
SLIDE 18

3 Feasibility

slide-19
SLIDE 19

Feasibility Feasibility

Resource Demand

Minimum example (MySender, MyReceiver)

MCU Flash RAM ATmega128RFA1 4148 Bytes 145 Bytes LPC1763 3136 Bytes 120 Bytes

7 modules, forked protocol stack

MCU Flash RAM ATmega128RFA1 10 kB 649 Bytes LPC1763 7 kB 580 Bytes

Andreas Weigel Cross-Platform Protocol Development Based on OMNeT++ Andreas Weigel Cross-Platform Protocol Development Based on OMNeT++ 12 12

slide-20
SLIDE 20

Feasibility Feasibility

Simulation Accuracy

Comparison of RTTs from field installation (93 nodes at

heliostat power plant in Jülich) and simulation for different number of hops 1 2 3 4

10 20 30 40

hops round-trip time [ms] Fieldtest Sim

Andreas Weigel Cross-Platform Protocol Development Based on OMNeT++ Andreas Weigel Cross-Platform Protocol Development Based on OMNeT++ 13 13

slide-21
SLIDE 21

4 Conclusion

slide-22
SLIDE 22

Conclusion Conclusion

Conclusion, Future Work

CometOS meets its design goals

  • Protocol implementations reusable on target hardware
  • “Lightweight enough”

Field test at heliostat power plant in Jülich, Germany

successfully running since May 2011

Current and Future Work:

  • Smart Metering application based on CometOS
  • Improvement and extension of interface to driver layer
  • Direct support for logging and statistics recording and

reporting

Andreas Weigel Cross-Platform Protocol Development Based on OMNeT++ Andreas Weigel Cross-Platform Protocol Development Based on OMNeT++ 14 14

slide-23
SLIDE 23

Cross-Platform Protocol Development Based on OMNeT++

Stefan Unterschütz, Andreas Weigel and Volker Turau

SIMUTools 2012: OMNeT++ Workshop

23rd March, 2012

Andreas Weigel

R e s e a r c h A s s i s t a n t P h

  • n

e + 4 9 / ( ) 4 4 2 8 7 8 3 7 4 6 e

  • M

a i l a n d r e a s . w e i g e l @ t u

  • h

a r b u r g . d e h t t p : / / w w w . t i 5 . t u

  • h

a r b u r g . d e / s t a f f / w e i g e l

TUHH TUHH

Institute of Telematics Institute of Telematics Hamburg University of Technology Hamburg University of Technology

slide-24
SLIDE 24

Resource Demand Revisited

RAM usage depends on target architecture (e.g., 8 bit vs

32 bit)

Values for 32 bit MCU

  • Module: 8 Bytes
  • InputGate: 16 Byte
  • OutputGate: 4 Byte
  • RemoteModule: 30 Bytes (including Module)
  • Standard modules Layer and Endpoint with 4 and 2 Gates

require 70 Bytes and 50 Bytes

ROM usage even more depends on architecture, instruction

set, compiler etc.

Andreas Weigel Cross-Platform Protocol Development Based on OMNeT++ Andreas Weigel Cross-Platform Protocol Development Based on OMNeT++ 15 15

slide-25
SLIDE 25

Experiment Setup

Packets with 50 Bytes payload 100 measurements per node 802.15.4 (2.4 GHz ISM band, 250 kbps)

Andreas Weigel Cross-Platform Protocol Development Based on OMNeT++ Andreas Weigel Cross-Platform Protocol Development Based on OMNeT++ 16 16

slide-26
SLIDE 26

Cross-Layer Support

Communication between non-adjacent modules?

Andreas Weigel Cross-Platform Protocol Development Based on OMNeT++ Andreas Weigel Cross-Platform Protocol Development Based on OMNeT++ 17 17

slide-27
SLIDE 27

Cross-Layer Support

Communication between non-adjacent modules?

Similar to OMNeT++’s ControlInfo or ns3’s object

aggregation:

  • Attach arbitrary objects to Messages and Airframes

Example: Setting MAC txPower from higher layer: / / Application : set tx power to −20 dBm request−>add (new MacTxPower( −20)); . . . / / MAC: use MacTxPower i f set MacTxPower∗ txPower= request−>get <MacTxPower > ( ) ; i f ( txPower != NULL) { . . . }

Andreas Weigel Cross-Platform Protocol Development Based on OMNeT++ Andreas Weigel Cross-Platform Protocol Development Based on OMNeT++ 17 17