Java Extensions for OMNeT++ 5 - summit.omnetpp.org · Java Extensions for OMNeT++ 5.0 Henning...
-
Upload
duongquynh -
Category
Documents
-
view
215 -
download
2
Transcript of Java Extensions for OMNeT++ 5 - summit.omnetpp.org · Java Extensions for OMNeT++ 5.0 Henning...
Institute of Applied Microelectronicsand Computer Engineering
Java Extensions for OMNeT++ 5.0
Henning Puttnies, Peter Danielis, Christian Koch, Dirk Timmermann
University of Rostock, Germany
Institute of Applied Microelectronicsand Computer Engineering
Motivation
Network simulators: evaluation of innovative applications/protocols
Java:
o Very predictable + easy to debug
o Relatively platform independent (heterogeneous IoT scenarios)
Combination of both in two steps:
1. Java simulation models for early evaluation
2. Derive Java prototype implementation to evaluate the approach on
different platforms
08/09/2017 2OMNeT++ Community Summit 2017
Institute of Applied Microelectronicsand Computer Engineering
State of the Art – Java Network Simulators
08/09/2017 3OMNeT++ Community Summit 2017
Name Existing Modules
for Reuse
Simulation
Models in Java
Still under
Maintenance
NS-3
JNS (NS-2 in JAVA)
JNetworkSim
JProwler
Java Simulator
Psimulator2
(for education)
No existing simulator supports Java network simulation sufficiently
Institute of Applied Microelectronicsand Computer Engineering
MyModel (Java)
jsimple.exe (C++)
cSimpleModule.cc
cSimpleModule()
handleMessage(cMessage *msg)
JSimpleModule.cc
JSimpleModule()
handleMessage(cMessage *msg)
MyModule.java
MyModule()
handleMessage(cMessage msg)
JSimpleModule.java
JSimpleModule()
handleMessage(cMessage msg)
long swigCPtr
jobject javaPeer
Concept – Class Diagrams (Similar to OMNeT 4.6)
Base on Java Native Interface (JNI)
MyModel: Java simulation model
jsimple.exe:
o OMNeT++ simulation kernel
o Extension modules (*.cc)
JSimpleModule.cc:
o Inherits from cSimpleModule.cc
o javaPeer: pointer to SimpleModule.java
JSimpleModule.java:
o Java wrapper for JSimpleModule.cc
o swigCPtr: pointer to JSimpleModule.cc
08/09/2017 4OMNeT++ Community Summit 2017
Institute of Applied Microelectronicsand Computer Engineering
Concept – Execution Order (similar to OMNeT 4.6)
08/09/2017 5OMNeT++ Community Summit 2017
jsimple.exe: simulation executable
MySim.ini: loads a *.ned file that uses
MyModule
initialize(): calls initJVM()
initJVM(): starts JVM
JVM is a shared library that can
execute *.class files
Execution of Java simulation
models is possible
MyModule(): calls JSimpleModule()
JSimpleModule(): calls C++ code
C++
Java
Start jsimple.exe
Read MySim.ini
Call MyModule()
Call JSimpleModule()
Call JSimpleModule() via JNI
JSimpleModule::initialize()
JSimpleModule()
CSimpleModule()
JUtil::initJVM()
...
...
...
Institute of Applied Microelectronicsand Computer Engineering
Evaluation – Combination of INET and Java
Important for reuse of existing modules from INET
Never demonstrated before OMNeT++ 5.0
EtherHost: example Ethernet host
myEtherHost: own Ethernet host
EtherLLC: Link Layer
IEtherMAC: Mac Layer
EtherEchoSrv:
o Registers at EtherLLC
o Echoes received Ethernet
packets
o Modifies Ethernet packets
(switches SRC and DEST)
08/09/2017 6OMNeT++ Community Summit 2017
Combination of INET and Java is possible
EtherEchoSrv.java
EtherLLC.h/.cc(INET)
IEtherMAC.h/.cc(INET)
HostAEtherHost.ned
(INET)
HostBmyEtherHost.ned
Ethernet
Institute of Applied Microelectronicsand Computer Engineering
Conclusion and Outlook
08/09/2017 7OMNeT++ Community Summit 2017
Outlook: Java extensions for OMNeT++ 5.1 (minor effort)
Name Existing Modules
for Reuse
Simulation
Models in Java
Still Under
Maintenance
NS-3
JNS (NS-2 in JAVA)
JNetworkSim
JProwler
Java Simulator
Psimulator2
(for education)
Java + OMNeT 5.0
Institute of Applied Microelectronicsand Computer Engineering
08/09/2017 8OMNeT++ Community Summit 2017
Thank you for your attention.
Questions?