tuhh
play

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


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

  2. 1 Introduction

  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

  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

  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

  6. Introduction Introduction Introduction 1 Architecture and Concepts 2 Feasibility 3 Conclusion 4 Andreas Weigel Cross-Platform Protocol Development Based on OMNeT++ Andreas Weigel Cross-Platform Protocol Development Based on OMNeT++ 3 3

  7. 2 Architecture and Concepts

  8. Architecture and Concepts Architecture and Concepts Architecture User Code CometOS Core Module completely independent platform independent Appl. InputGate Rout. Rout. OutputGate NBH Fork Message CSMA Object CometOS MAC AL Scheduler HIL ATmega128RFA1 other platforms platform dependent Hardware platform Andreas Weigel Cross-Platform Protocol Development Based on OMNeT++ Andreas Weigel Cross-Platform Protocol Development Based on OMNeT++ 4 4

  9. Architecture and Concepts Architecture and Concepts Architecture User Code CometOS Core User Code Module Module completely independent Appl. completely independent platform independent Appl. InputGate InputGate Rout. Rout. Rout. Rout. OutputGate OutputGate OMNeT++ NBH Fork Message NBH Fork Message Object CSMA CSMA Object CometOS CometOS Adapter MAC AL MAC AL Scheduler HIL OMNeT++ simulation ATmega128RFA1 other platforms platform dependent Hardware platform Andreas Weigel Cross-Platform Protocol Development Based on OMNeT++ Andreas Weigel Cross-Platform Protocol Development Based on OMNeT++ 4 4

  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_cast s 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

  11. Architecture and Concepts Architecture and Concepts Message Passing (2) class MyMsg: public Message { } ; class MySender : public Module { class MyReceiver : public : public Module { OutputGate<MyMsg> gateOut ; public : InputGate <MyMsg> gateIn ; MySender ( ) : gateOut ( this , " gateOut " ) MyReceiver ( ) : { } gateIn ( this , void i n i t i a l i z e ( ) { &MyReceiver : : handle , schedule ( new Message , " gateIn " ) &MySender : : t r a f f i c ,500); { } } void t r a f f i c ( Message ∗ msg) { void handle (MyMsg ∗ msg) { gateOut . send ( new MyMsg ) ; delete msg; delete msg; } } } ; } ; Andreas Weigel Cross-Platform Protocol Development Based on OMNeT++ Andreas Weigel Cross-Platform Protocol Development Based on OMNeT++ 6 6

  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

  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

  14. Architecture and Concepts Architecture and Concepts Initialization / / Setup f o r OMNeT++ in NED language / / ( skipped declaration of modules ) network Network { submodules : s : MySender ; For OMNeT++ r : MyReceiver ; ⇒ .ned, .ini files connections : s . gateOut −− > r . gateIn ; } / / Setup f o r Hardware MySender s ; MyReceiver r ; For Hardware Platforms: int main ( ) { ⇒ C++ initialization file 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

  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

  16. Architecture and Concepts Architecture and Concepts Base Station Support class MyModule : r=RemoteModule ( "myModule" ) ; public RemoteModule { r . declareRemote ( " add " , public : uint16_t , MyModule ( const char ∗ name) : uint8_t , RemoteModule (name) { } u int 8 _ t ) print r . add(18 , 11) void i n i t i a l i z e ( ) { >>> 29 declareRemote(&MyModule : : add , " add " ) ; ↑ Python console } uint16_t add ( uint8_t &a , ← CometOS-Module uint8_t &b ) { return a+b ; } } ; MyModule m( "myModule" ) ; Andreas Weigel Cross-Platform Protocol Development Based on OMNeT++ Andreas Weigel Cross-Platform Protocol Development Based on OMNeT++ 10 10

  17. Architecture and Concepts Architecture and Concepts Typical Development Steps OMNeT++ Simulation OMNeT++ Simulation Real-World Deployment C++/Python C++/Python Base Station Base Station Base Station Andreas Weigel Cross-Platform Protocol Development Based on OMNeT++ Andreas Weigel Cross-Platform Protocol Development Based on OMNeT++ 11 11

  18. 3 Feasibility

  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

  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 Fieldtest Sim 40 round-trip time [ms] 30 20 10 1 2 3 4 hops Andreas Weigel Cross-Platform Protocol Development Based on OMNeT++ Andreas Weigel Cross-Platform Protocol Development Based on OMNeT++ 13 13

  21. 4 Conclusion

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend