the OMNeT++/INET UDP Functionality from Java Henning Puttnies, Peter - - PowerPoint PPT Presentation

the omnet inet udp functionality from java
SMART_READER_LITE
LIVE PREVIEW

the OMNeT++/INET UDP Functionality from Java Henning Puttnies, Peter - - PowerPoint PPT Presentation

Institute of Applied Microelectronics and Computer Engineering jUDPWrapper: A Lightweight Approach to Access the OMNeT++/INET UDP Functionality from Java Henning Puttnies, Peter Danielis, Leonard Thiele, Dirk Timmermann University of Rostock,


slide-1
SLIDE 1

Institute of Applied Microelectronics and Computer Engineering

jUDPWrapper: A Lightweight Approach to Access the OMNeT++/INET UDP Functionality from Java

Henning Puttnies, Peter Danielis, Leonard Thiele, Dirk Timmermann University of Rostock, Germany

slide-2
SLIDE 2

Institute of Applied Microelectronics and Computer Engineering

Motivation

 Evaluation of networks during design: simulation, testbed, math analysis  Our idea of an enhanced evaluation methodology:

  • 1. Java simulation models using OMNeT++
  • 2. Derive a Java prototype implementation

 Java Extensions for OMNeT++ (JEO) exist  Next logical step: provide a socket-based API for Java simulation models  Abstraction layer between app. layer models und INETs UDP module  Ease simulating as well as the derivation of prototype implementation

10/09/2018 2 OMNeT++ Community Summit 2018

slide-3
SLIDE 3

Institute of Applied Microelectronics and Computer Engineering

Related Work

10/09/2018 3 OMNeT++ Community Summit 2018

Name Java Simulation Models Access to Simulation Time Still Under Maintenance NS-3 + LXC* + JVM (*Linux Containers)  (only app. layer)  (only with modified Linux kernel, limited precision)  NS-3 + DCE* (*Direct Code Execution)  (C++ only)   FNSS* (*Fast Network Simulation Setup)  (needs a Java simulator/ emulator)  (there is no Java simulator)  JNS/ JNetworkSim/ Jprowler/ Java Simulator     Wanted: Framework to simulate Java application layer models

slide-4
SLIDE 4

Institute of Applied Microelectronics and Computer Engineering

jUDPWrapper – Basic Concept

10/09/2018 4 OMNeT++ Community Summit 2018

 Design targets:

Fit optimally into the OMNeT++/INET ecosystem

No modifications of the OMNeT++/INET code

Lightweight  keep track with new OMNeT++/INET versions easily  DatagramSocket and InetAddress: Same API as java.net.DatagramSocket and java.net.InetAddress

OMNeT++ (Event Handling) INET (Protocol Stack, Pyhsical Models) App Layer Models (INET or Custom) Java App Layer Models jUdpWrapper (Wrapper for Socket API) INET (Wrapper for Socket API) C++ Java C++ UDP App on StandardHost UDPBasicApp like IUDPApp udp like IUDP networklayer <physicallayer> Java UDP App on StandardHost simple JUdpEchoApp extends JSimpleModule like IUDPApp udp like IUDP networklayer <physicallayer>

slide-5
SLIDE 5

Institute of Applied Microelectronics and Computer Engineering

jUDPWrapper – Accessing Message Fields of a Custom Data Type from Java: e.g., L3Address

10/09/2018 5 OMNeT++ Community Summit 2018

 String as type for domain conversion  getField(): can access any field of a message  setField(): only works for standard types (e.g., int, double, bool)  how to access a field of a custom type?  Our approach: utilize a special syntax in the *.msg file  link the setFied() method to the corresponding string constructor

cObject.setField("destAddr", ) SimkernelJNI.cObject_setField() Java_org_omnetpp_simkernel_SimkernelJNI_cObject_1setField()

  • mnetpp_cObject_setField()

cClassDescriptor.setFieldValueAsString() UDPSendCommandDescriptor.setFieldValueAsString()

C++ Code

L3Address

uint64 hi L3Address() uint64 lo L3Address(const char *str) L3Address(const IPv4Address& addr)

L3Address.h/.cc UDPControlInfo.msg UDPSendCommand

L3Address destAddr int destPort L3Address srcAddr int interfaceId

slide-6
SLIDE 6

Institute of Applied Microelectronics and Computer Engineering

jUDPWrapper – Accessing Message Fields of a Custom Data Type from Java: e.g., L3Address 2

10/09/2018 6 OMNeT++ Community Summit 2018

//Original *.msg file class UDPSendCommand extends UDPControlInfo { L3Address destAddr; int destPort = -1; //... } //Modified *.msg file class UDPSendCommand extends UDPControlInfo { L3Address destAddr @editable @fromstring(inet::L3Address($)); int destPort = -1; //... } //Original *.cc file bool UDPSendCommandDescriptor:: setFieldValueAsString(/*...*/) const{ //... switch (field) { case 1: pp->setDestPort(string2long( value)); return true; //... }} //Modified *.cc file bool UDPSendCommandDescriptor:: setFieldValueAsString(/*...*/) const { //... switch (field) { case 0: pp->setDestAddr(inet::L3Address( value)); return true; case 1: pp->setDestPort(string2long( value)); return true; //... }}

slide-7
SLIDE 7

Institute of Applied Microelectronics and Computer Engineering

jUDPWrapper – UDP Example Networks

10/09/2018 7 OMNeT++ Community Summit 2018

inet::UDPBasicApp inet::UDPEchoApp JUdpEchoApp inet::UDPBasicApp jUDPBasicApp inet::UDPEchoApp jUDPBasicApp JUdpEchoApp

 Four example networks used for evaluation  Show interoperability and performance of Java and C++ application layer simulation models  Every network: 2 StandardHosts connected Ethernet switch (not shown for the sake of simplicity)  jUDPBasicApp and jUDPEchoApp equivalent to their INET counterparts  Evaluation of performance is feasible

slide-8
SLIDE 8

Institute of Applied Microelectronics and Computer Engineering

jUDPWrapper – Performance Evaluation 1

10/09/2018 8 OMNeT++ Community Summit 2018

 Execution time grows linearly with the # packets expected behaviour  OMNeT++ 5.0:

10 packets: C++ (0.0008s) approx. one order of magnitude faster than Java (0.0097s)

100,000 packets: C++ (6.89s) approx. twice as fast as Java (14.5s)

0.0001 0.001 0.01 0.1 1 10 100 10 100 1,000 10,000 100,000 Execution Time [s] # Packets

OMNeT++ 5.0

UDPBasic + UDPEcho UDPBasic + jUDPEcho jUDPBasic + UDPEcho jUDPBasic + jUDPEcho

slide-9
SLIDE 9

Institute of Applied Microelectronics and Computer Engineering

0.001 0.01 0.1 1 10 100 10 100 1,000 10,000 100,000 Execution Time [s] # Packets

OMNeT++ 5.4

UDPBasic + UDPEcho UDPBasic + jUDPEcho jUDPBasic + UDPEcho jUDPBasic + jUDPEcho

jUDPWrapper – Performance Evaluation 2

10/09/2018 9 OMNeT++ Community Summit 2018

 OMNeT++ 5.4:

10 packets: C++ (0.0013s) approx. 3 times faster than Java (0.0036s)

100,000 packets: C++ (6.04s) approx. twice as fast as Java (14.39s)  Remarkable: intermediate performance of mixed language setups  Use existing C++ modules from INET to work with your Java modules

slide-10
SLIDE 10

Institute of Applied Microelectronics and Computer Engineering

Conclusion and Outlook

10/09/2018 10 OMNeT++ Community Summit 2018

 jUDPWrapper: simple + socket-based interface to INET's UDP functionality  Generic approach to access message fields that have a custom data type  Serves as example of how to access INET modules from Java  Different example applications for custom Java simulation models  Evaluation: OMNeT++ 5.0/INET 3.4.0 and OMNeT++ 5.4/INET 3.6.4.  Provide the Java Extensions for OMNeT++ 5.4  Performance: C++ approx. twice as fast as Java simulation models

Valid for long simulation runs and release mode

Speedup reduced in debug mode or if a mixed language setup is used  Entire system is publicly available 1  Everyone can retry the performance measurements  Interesting for future work: Wrapper for INET’s TCP functionality

1 https://bwsyncandshare.kit.edu/dl/fi8R6skmuBPh6UfXHWzcgBxt/.zip

slide-11
SLIDE 11

Institute of Applied Microelectronics and Computer Engineering

10/09/2018 11 OMNeT++ Community Summit 2018

Thank you for your attention. Questions?