Internet of Things Simulation using OMNeT++ and Hardware...

24
Internet of Things Simulation using OMNeT++ and Hardware in the Loop Philipp Wehner, Diana Göhringer Ruhr-University Bochum, Germany {philipp.wehner, diana.goehringer}@rub.de FACULTY OF ELECTRICAL ENGINEERING AND INFORMATION TECHNOLOGY Application-specific Multi-Core Architectures Group

Transcript of Internet of Things Simulation using OMNeT++ and Hardware...

Page 1: Internet of Things Simulation using OMNeT++ and Hardware ...esda-lab.cied.teiwest.gr/wcs-iot/docs/IoTSimulationusingOMNeT.pdf · Internet of Things Simulation using OMNeT++ and Hardware

Internet of Things Simulation using OMNeT++ and

Hardware in the Loop

Philipp Wehner, Diana Göhringer Ruhr-University Bochum, Germany

{philipp.wehner, diana.goehringer}@rub.de

FACULTY OF ELECTRICAL ENGINEERING AND INFORMATION TECHNOLOGY Application-specific Multi-Core Architectures Group

Page 2: Internet of Things Simulation using OMNeT++ and Hardware ...esda-lab.cied.teiwest.gr/wcs-iot/docs/IoTSimulationusingOMNeT.pdf · Internet of Things Simulation using OMNeT++ and Hardware

2 Internet of Things Simulation using OMNeT++ and Hardware in the Loop | London | September, 4th, 2015

Outline

Motivation and Main Contributions

EU Project RADIO

Related Work

Hardware in the Loop

Network Simulator OMNeT++

Concept

Challenges and Solutions

Scheduling

HiL Interfaces

Case study in Example of Z-Wave and EnOcean Periphery

Demo Video

Conclusion and Future Prospects

Page 3: Internet of Things Simulation using OMNeT++ and Hardware ...esda-lab.cied.teiwest.gr/wcs-iot/docs/IoTSimulationusingOMNeT.pdf · Internet of Things Simulation using OMNeT++ and Hardware

3 Internet of Things Simulation using OMNeT++ and Hardware in the Loop | London | September, 4th, 2015

Motivation

Efficient data exchange is mandatory in the Internet of Things

Also the analysis of network communication is of high importance

But…

Several different communication protocols

No universally applicable standard

Standardization only meaningful as long as it does not produce high costs

Gateways are required

Page 4: Internet of Things Simulation using OMNeT++ and Hardware ...esda-lab.cied.teiwest.gr/wcs-iot/docs/IoTSimulationusingOMNeT.pdf · Internet of Things Simulation using OMNeT++ and Hardware

4 Internet of Things Simulation using OMNeT++ and Hardware in the Loop | London | September, 4th, 2015

Motivation

IoT Simulator presented in the paper

Uses Hardware in the Loop

Based on the network simulator OMNeT++

Can be extended by sensors, actuators and even processors

Provides gateway functionality

Page 5: Internet of Things Simulation using OMNeT++ and Hardware ...esda-lab.cied.teiwest.gr/wcs-iot/docs/IoTSimulationusingOMNeT.pdf · Internet of Things Simulation using OMNeT++ and Hardware

5 Internet of Things Simulation using OMNeT++ and Hardware in the Loop | London | September, 4th, 2015

European Union’s Horizon 2020 project

Robots in Assisted Living Environments: Unobtrusive, efficient, reliable and

modular solutions for independent aging

Support of elderly in their homely environment

Integration of a mobile robot in a smart home environment

Several different sensors and actuators

Simulation of the entire infrastructure useful

More about RADIO in the workshop session 2 at 4pm!

EU Project RADIO Robots in Assisted Living Environments

Page 6: Internet of Things Simulation using OMNeT++ and Hardware ...esda-lab.cied.teiwest.gr/wcs-iot/docs/IoTSimulationusingOMNeT.pdf · Internet of Things Simulation using OMNeT++ and Hardware

6 Internet of Things Simulation using OMNeT++ and Hardware in the Loop | London | September, 4th, 2015

Core idea of OpenHAB’s event bus is the simulation of events

Smart home simulation possible

However, OpenHAB’s main target is to provide an integration platform

for different vendor-specific smart home devices

Nearly the same applies for Eclipse Smarthome

Target of the presented work is the simulation, not the realization itself

However, the approach allows a stepwise transition to a fully physical

IoT platform

No suitable IoT platforms available that support the entire development flow

from simulation to the final implementation

Related Work OpenHAB and Eclipse Smarthome

Page 7: Internet of Things Simulation using OMNeT++ and Hardware ...esda-lab.cied.teiwest.gr/wcs-iot/docs/IoTSimulationusingOMNeT.pdf · Internet of Things Simulation using OMNeT++ and Hardware

7 Internet of Things Simulation using OMNeT++ and Hardware in the Loop | London | September, 4th, 2015

Thread Group:

Creates a networking protocol

Simple to use, power efficient

Mediola Gateway

Combination of different smart home products

Flexible automation of the living environment

Different technologies controlled via smartphone app

Single point of failure

Strategic roadmap for the IoT

Need for innovative design frameworks

Inspired by HiL

However, HiL often used in an automotive context

Related Work

Page 8: Internet of Things Simulation using OMNeT++ and Hardware ...esda-lab.cied.teiwest.gr/wcs-iot/docs/IoTSimulationusingOMNeT.pdf · Internet of Things Simulation using OMNeT++ and Hardware

8 Internet of Things Simulation using OMNeT++ and Hardware in the Loop | London | September, 4th, 2015

HiL

HiL-Simulator

Hardware in the Loop

Hardware in the Loop

Can increase quality and significance of

the result

Enables the analysis of components that

are not available at early stages of the

development cycle

Virtual devices can exist among their physical counterparts

Rapid Prototyping

Simulation results not based on probably inaccurate models of the

periphery

But synchronization between physical devices and the HiL environment is

an important aspect

Page 9: Internet of Things Simulation using OMNeT++ and Hardware ...esda-lab.cied.teiwest.gr/wcs-iot/docs/IoTSimulationusingOMNeT.pdf · Internet of Things Simulation using OMNeT++ and Hardware

9 Internet of Things Simulation using OMNeT++ and Hardware in the Loop | London | September, 4th, 2015

Allows discrete event simulation of distributed systems (computer networks)

Designed for large networks

Hierarchical organization of simulation models

Number of layers is not limited

Graphical user interface

Illustrates network graphics and data flow charts

Allows observation of objects and variables during simulation

Structure of the model is defined using network description (NED) files

Reprogramming not required

Not limited to fixed topologies

Topology modifiable during runtime

OMNeT++ An Overview

Page 10: Internet of Things Simulation using OMNeT++ and Hardware ...esda-lab.cied.teiwest.gr/wcs-iot/docs/IoTSimulationusingOMNeT.pdf · Internet of Things Simulation using OMNeT++ and Hardware

10 Internet of Things Simulation using OMNeT++ and Hardware in the Loop | London | September, 4th, 2015

Co-routine based programming

Generates a thread for each module

Thread gets control from the simulation kernel when a message arrives

Thread never returns

Event-processing

Module function gets called with the message as parameter

Feasible for extensive simulations

Reduced memory requirements and number of CPU stacks

OMNeT++ Possible Implementations

Page 11: Internet of Things Simulation using OMNeT++ and Hardware ...esda-lab.cied.teiwest.gr/wcs-iot/docs/IoTSimulationusingOMNeT.pdf · Internet of Things Simulation using OMNeT++ and Hardware

11 Internet of Things Simulation using OMNeT++ and Hardware in the Loop | London | September, 4th, 2015

OMNeT++ is extensible

C++ used to describe module functionality

Replacement of user interface allows integration in larger applications

OMNeT++ already contains protocol models

TCP/IP, ATM, Ethernet

GUI (Tkenv) supports modeling of complex networks

Developed for the simulation of extensive networks

OMNeT++ is open source

Easy comprehensibility of every part of the simulation

OMNeT++ Benefits for the presented framework

Page 12: Internet of Things Simulation using OMNeT++ and Hardware ...esda-lab.cied.teiwest.gr/wcs-iot/docs/IoTSimulationusingOMNeT.pdf · Internet of Things Simulation using OMNeT++ and Hardware

12 Internet of Things Simulation using OMNeT++ and Hardware in the Loop | London | September, 4th, 2015

OMNeT++ allows the integration of HiL by design

Main challenge: Integration of physical devices to the scheduling

mechanism

Real time scheduler can be extended by the user

See socket example for further information

Drawback: Single entry point

How to add multiple hardware devices to the simulation at different entry

points?

Socket example does not answer this question

Concept Challenges and Solutions

Page 13: Internet of Things Simulation using OMNeT++ and Hardware ...esda-lab.cied.teiwest.gr/wcs-iot/docs/IoTSimulationusingOMNeT.pdf · Internet of Things Simulation using OMNeT++ and Hardware

13 Internet of Things Simulation using OMNeT++ and Hardware in the Loop | London | September, 4th, 2015

One scheduler responsible for the entire simulation

Mechanism needs to be developed that

allows the integration of multiple external devices…

… on different network nodes…

… using only one extended version of the scheduler

Workaround:

Callback functions

Consecutively invoked by the scheduler

Every node informs the scheduler about relevant events

Concept Challenges and Solutions

Page 14: Internet of Things Simulation using OMNeT++ and Hardware ...esda-lab.cied.teiwest.gr/wcs-iot/docs/IoTSimulationusingOMNeT.pdf · Internet of Things Simulation using OMNeT++ and Hardware

14 Internet of Things Simulation using OMNeT++ and Hardware in the Loop | London | September, 4th, 2015

Modified scheduler derived from OMNeT’s cScheduler class

setInterface() enables the user to add external hardware

Generates a list of interface functions

getNextEvent() consecutively calls these functions to check if an

event occurs

Concept Modified Scheduler

Page 15: Internet of Things Simulation using OMNeT++ and Hardware ...esda-lab.cied.teiwest.gr/wcs-iot/docs/IoTSimulationusingOMNeT.pdf · Internet of Things Simulation using OMNeT++ and Hardware

15 Internet of Things Simulation using OMNeT++ and Hardware in the Loop | London | September, 4th, 2015

Provided in form of a shared library

Mainly consists of two virtual functions:

interfaceFunction(): Callback function that is assigned to

setInterface()

Checks for events of the respective HiL device

handleMessage(): Handles a message

in the respective module

External message from

distant module

Self message

(message within the module)

Message from the scheduler

Concept HiL Interfaces

Page 16: Internet of Things Simulation using OMNeT++ and Hardware ...esda-lab.cied.teiwest.gr/wcs-iot/docs/IoTSimulationusingOMNeT.pdf · Internet of Things Simulation using OMNeT++ and Hardware

16 Internet of Things Simulation using OMNeT++ and Hardware in the Loop | London | September, 4th, 2015

Interface function is not required to wait for results of the hardware device

Unblocking operations are possible

However, synchronization problems might occur

Concept HiL Interfaces

if (msg->isSelfMessage()) {

// handle self message

} else if (msg == hilEvent) {

// handle HiL event

} else {

// handle message from

// distant module

}

Page 17: Internet of Things Simulation using OMNeT++ and Hardware ...esda-lab.cied.teiwest.gr/wcs-iot/docs/IoTSimulationusingOMNeT.pdf · Internet of Things Simulation using OMNeT++ and Hardware

17 Internet of Things Simulation using OMNeT++ and Hardware in the Loop | London | September, 4th, 2015

Different communication standards especially in the IoT

Messages translated to intermediate representation (IR)

Should not add an additional payload

IRSwitch

.xml

Wall Plug

.xml

0x1123

1

{"id": 123, "value“: 1} <state>1</state>

Concept Messages

Page 18: Internet of Things Simulation using OMNeT++ and Hardware ...esda-lab.cied.teiwest.gr/wcs-iot/docs/IoTSimulationusingOMNeT.pdf · Internet of Things Simulation using OMNeT++ and Hardware

18 Internet of Things Simulation using OMNeT++ and Hardware in the Loop | London | September, 4th, 2015

<ir>

<item pos=’0’>

<fixed>0x1</fixed>

</item>

<item pos=’1’>

<variable>

<uint8>id</uint8>

</variable>

</item>

<item pos=’2’>

<bool>

<variable>state</variable>

</bool>

</item>

</ir>

IRSwitch

.xml

Wall Plug

.xml

0x1123

1

{"id": 123, "value“: 1} <state>1</state>

Concept Messages

message GatewayMsg {

int source;

int destination;

int payload[];

}

Page 19: Internet of Things Simulation using OMNeT++ and Hardware ...esda-lab.cied.teiwest.gr/wcs-iot/docs/IoTSimulationusingOMNeT.pdf · Internet of Things Simulation using OMNeT++ and Hardware

19 Internet of Things Simulation using OMNeT++ and Hardware in the Loop | London | September, 4th, 2015

Demonstrates how HiL can be added to OMNeT++

Based on the modified scheduler

Raspberry Pis used as interfaces

Case Study EnOcean Z-Wave Gateway

Page 20: Internet of Things Simulation using OMNeT++ and Hardware ...esda-lab.cied.teiwest.gr/wcs-iot/docs/IoTSimulationusingOMNeT.pdf · Internet of Things Simulation using OMNeT++ and Hardware

20 Internet of Things Simulation using OMNeT++ and Hardware in the Loop | London | September, 4th, 2015

Case Study EnOcean Z-Wave Gateway

Light bulb connected to Fibaro Wall Plug

Simulation runs in “slow motion” mode

Flow of messages becomes visible

Page 21: Internet of Things Simulation using OMNeT++ and Hardware ...esda-lab.cied.teiwest.gr/wcs-iot/docs/IoTSimulationusingOMNeT.pdf · Internet of Things Simulation using OMNeT++ and Hardware

21 Internet of Things Simulation using OMNeT++ and Hardware in the Loop | London | September, 4th, 2015

IoT simulation environment

Hardware in the Loop

OMNeT++ used to model the infrastructure

Virtual and physical nodes

Modified scheduler allows to add further HiL devices

Sometimes, real world data is required to gain feasible results

The authors believe that the consideration of physical hardware in the virtual

environment is the key to success for the simulation of future IoT networks

Conclusion And Future Prospects

Page 22: Internet of Things Simulation using OMNeT++ and Hardware ...esda-lab.cied.teiwest.gr/wcs-iot/docs/IoTSimulationusingOMNeT.pdf · Internet of Things Simulation using OMNeT++ and Hardware

22 Internet of Things Simulation using OMNeT++ and Hardware in the Loop | London | September, 4th, 2015

Presented work features gateway functionality

Not limited to specific devices

Intermediate representation

Decentralized gateway

Nevertheless…

Further evaluation to proof the level of abstraction for standardization

Further tests, metrics

More complex networks

Conclusion And Future Prospects

Page 23: Internet of Things Simulation using OMNeT++ and Hardware ...esda-lab.cied.teiwest.gr/wcs-iot/docs/IoTSimulationusingOMNeT.pdf · Internet of Things Simulation using OMNeT++ and Hardware

23 Internet of Things Simulation using OMNeT++ and Hardware in the Loop | London | September, 4th, 2015

In future:

Rework of the data flow allows sending messages from multiple sources

to multiple destinations

Simulation of not available sensors and actuators

Security aspects

Integration of OMNeT++ libraries, e.g. iNet

System of Systems (SoS) via gateway approach

Optimizations regarding

Path planning

Power consumption

Execution time

Conclusion And Future Prospects

Page 24: Internet of Things Simulation using OMNeT++ and Hardware ...esda-lab.cied.teiwest.gr/wcs-iot/docs/IoTSimulationusingOMNeT.pdf · Internet of Things Simulation using OMNeT++ and Hardware

24 Internet of Things Simulation using OMNeT++ and Hardware in the Loop | London | September, 4th, 2015

Thank you for your attention!