Porting of Real-Time Publish-Subscribe Middleware to Android - - PowerPoint PPT Presentation

porting of real time publish subscribe middleware to
SMART_READER_LITE
LIVE PREVIEW

Porting of Real-Time Publish-Subscribe Middleware to Android - - PowerPoint PPT Presentation

M.Vajnar, M. Sojka, P. Pa Czech Technical University in Prague Porting of Real-Time Publish-Subscribe Middleware to Android RTLWS15, Lugano-Manno Distributed applications problems 2/23 Distributed applications problems 3/23


slide-1
SLIDE 1

Porting of Real-Time Publish-Subscribe Middleware to Android

M.Vajnar, M. Sojka, P. Píša Czech Technical University in Prague

RTLWS15, Lugano-Manno

slide-2
SLIDE 2

2/23

Distributed applications – problems

slide-3
SLIDE 3

3/23

Distributed applications – problems

slide-4
SLIDE 4

4/23

Distributed applications – problems

Redundancy

slide-5
SLIDE 5

5/23

Distributed applications – problems

Configuration

slide-6
SLIDE 6

6/23

Distributed applications – problems

Scaling

slide-7
SLIDE 7

7/23

Outline

  • Data-Centric Publish Subscribe model
  • Real-Time Publish-Subscribe protocol
  • ORTE middleware
  • Android porting
  • Demo
slide-8
SLIDE 8

8/23

Data-Centric Publish-Subscribe application model

slide-9
SLIDE 9

9/23

Data-Centric Publish-Subscribe application model

slide-10
SLIDE 10

10/23

How to implement this? RTPS.

  • Real-Time Publish-Subscribe protocol
  • OMG standard – interoperability wire protocol
  • Transport independent part
  • Transport specific part (UDP => control of timing)
  • Implementation freedom

– Simple implementation, high network bandwidth demand – Complex implementation, optimized network bandwidth.

  • Utilizes multicast communication (one to many communication)
  • Offers best-effort and reliable communication
  • CDR encoding (endianing)
  • Parts

– Data exchange protocol – Discovery protocol

slide-11
SLIDE 11

11/23

ORTE – Open Real-Time Ethernet

  • Our open-source implementation of the RTPS protocol
  • One of the first few implementations that supported standardization
  • Uses custom API instead of the DDS API (another OMG standard)
  • C language, based on POSIX
  • IDL compiler to generate (de)serialization functions
  • Suported platforms

– Linux, FreeBSD, Mac OS X, Solaris – Windows (MinGW, Cygwin, ReactOS) – RTEMS – BlackBerry – Android

slide-12
SLIDE 12

12/23

Minimal ORTE application

O R T E I n i t ( ) ; d = O R T E D

  • m

a i n A p p C r e a t e ( , N U L L , N U L L , ) ; O R T E T y p e R e g i s t e r A d d ( d , " H e l l

  • M

s g " , N U L L , N U L L , N U L L , 6 4 ) ; p = O R T E P u b l i c a t i

  • n

C r e a t e ( d , " E x a m p l e H e l l

  • M

s g " , / / T

  • p

i c " H e l l

  • M

s g " , / / T y p e & i n s t a n c e 2 S e n d , / / D a t a b u f f e r T I M E ( 3 , ) , / / P e r s i s t a n c e 1 , / / S t r e n g t h N U L L , / / C a l l b a c k N U L L , / / P a r a m e t e r s N U L L ) ; . . . i n s t a n c e 2 S e n d = 1 2 3 ; O R T E P u b l i c a t i

  • n

S e n d ( p ) ; O R T E I n i t ( ) ; d = O R T E D

  • m

a i n A p p C r e a t e ( , N U L L , N U L L , ) ; O R T E T y p e R e g i s t e r A d d ( d , " H e l l

  • M

s g " , N U L L , N U L L , N U L L , 6 4 ) ; s = O R T E S u b s c r i p t i

  • n

C r e a t e ( d , I M M E D I A T E , B E S T _ E F F O R T S , " E x a m p l e H e l l

  • M

s g " , / / T

  • p

i c / " H e l l

  • M

s g " , / / T y p e & i n s t a n c e 2 R e c v , / / D a t a b u f f e r & d e a d l i n e , & m i n i m u m S e p a r a t i

  • n

, r e c v C B , / / c a l l b a c k N U L L , I P A D D R E S S _ I N V A L I D ) ; / / M u l t i c a s t v

  • i

d r e c v C B ( c

  • n

s t O R T E R e c v I n f

  • *

i n f

  • ,

v

  • i

d * i n s t a n c e , v

  • i

d * p a r a m ) { s w i t c h ( i n f

  • >

s t a t u s ) { c a s e N E W _ D A T A : p r i n t f ( " % s \ n " , i n s t a n c e ) ; b r e a k ; c a s e D E A D L I N E : p r i n t f ( " d e a d l i n e

  • c

c u r r e d " ) ; b r e a k ; } }

slide-13
SLIDE 13

13/23

RTPS/ORTE internals

slide-14
SLIDE 14

14/23

RTPS/ORTE internals

X X X

  • Dynamic addition/removal of applications
  • No single point of failure
  • Fault tolerant applications
slide-15
SLIDE 15

15/23

ORTE Discovery Protocol

slide-16
SLIDE 16

16/23

Participant discovery

slide-17
SLIDE 17

17/23

Endpoint discovery

slide-18
SLIDE 18

18/23

Android

  • Android is a Linux-based operating system developed by Google
  • It runs on devices ranging from mobile phones and tablets to home

media centers and digital cameras

  • Applications developed in Java or C/C++ using Google toolkits

– Android Software Development Kit – Java – Android Native Development Kit – C/C++

slide-19
SLIDE 19

19/23

Porting ORTE to Android

  • Overview:

– Update Java Native Interface (JNI) wrapper and make it Android compatible – Fix bugs that have not demonstrated themselves under the Oracle's VM – Add support for Android build system – Make Java version of ORTE Manager application to overcome problems with execution and termination of native processes

slide-20
SLIDE 20

20/23

Performance comparison

` Android 4.0.3 Android 4.3 Oracle Java

  • Reliable publisher and subscriber
  • Publish as fast as possible
  • Baseline: C publisher, C subscriber

Time to publish 10k integer values

slide-21
SLIDE 21

21/23

Future development

  • Make the ORTE compliant with the latest RTPS standard

– Data with key

  • New type of data objects, that allows to distribute a set of data instances

under a single topic

  • The key is used to distinguish between instances

– Discovery protocol

  • Manager is replaced with the Simple Participant Discovery Protocol and the

Simple Endpoint Discovery Protocol integrated into an user application

– Data fragmentation

  • Allow a fragmentation of big data instances and sent them as multiple

messages.

  • Security
slide-22
SLIDE 22

22/23

Demo

  • Application for remote control of

a robot

  • Monitors robot's state (battery

voltage, speed vector, output of Laser Range Finder)

  • Controls robot's motion

(direction and speed)

slide-23
SLIDE 23

23/23

Conclusion

  • ORTE can simplify both development and deployment of distributed

applications

  • We have successfully ported the ORTE library to Android
  • http://orte.sourceforge.net/

Thank you!