Real Time Java DDS


Published on

Published in: Technology, Business
  • Be the first to comment

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Real Time Java DDS

  1. 1. Design and Evaluation of a High Integrity Profile for the DDS Vincenzo Caruso [email_address] With the support of Iniziativa Software - Roma
  2. 2. Outline <ul><li>Data Distribution in High Integrity Contexts </li></ul><ul><li>Overview of the OMG DDS Standard </li></ul><ul><li>An High Integrity Profile for DDS </li></ul><ul><li>Implementing the profile: </li></ul><ul><ul><li>Real Time Java as the Reference Platform </li></ul></ul><ul><ul><li>Applying patterns for the RTSJ </li></ul></ul><ul><li>Results </li></ul><ul><li>Conclusions and future works </li></ul>
  3. 3. The Context: Data Centric Systems The Right Information => To the Right People => At the Right Time <ul><li>Data Dissemination is the base of Data Centric Systems: </li></ul><ul><ul><li>Distributed systems that manage flows of information in real time (typically from sensors to actuators) </li></ul></ul>Adapted from “The Future of AWACS”, by LtCol Joe Chapa Joint Forces Global Info Grid
  4. 4. Challenges in Data Distribution <ul><li>Currently most of these systems are vertically </li></ul><ul><li>integrated, using proprietary solutions </li></ul><ul><ul><li>High cost and low evolution </li></ul></ul><ul><ul><li>Industry wants to reduce costs and </li></ul></ul><ul><ul><li>increase quality </li></ul></ul><ul><li>Research Key Challenges in this area are: </li></ul><ul><ul><li>Remove Accidental Complexity </li></ul></ul><ul><ul><li>Support Technology evolutions </li></ul></ul><ul><ul><li>Open to highly heterogeneous </li></ul></ul><ul><ul><li>Platforms and Languages </li></ul></ul><ul><li>Approach: </li></ul><ul><ul><li>Standardized Middleware for Data Distribution </li></ul></ul><ul><li>Lack of Real Time and QoS Support from Existing Standards: </li></ul><ul><ul><li>CORBA (CosEvent, CosNotification), JMS, Web Services... </li></ul></ul><ul><li>Looking for New Middlewares and Paradigms: </li></ul>The Data Distribution Service is emerging as standard solution in Data Dissemination Hardware Network Stack Middleware Application
  5. 5. The OMG Data Distribution Service <ul><li>D ata D istribution S ervice: </li></ul><ul><ul><li>Standardized by the OMG </li></ul></ul><ul><ul><li>Publish/Subscribe </li></ul></ul><ul><ul><li>Higly Customizable QoS </li></ul></ul><ul><ul><li>Platform & Language Agnostic </li></ul></ul><ul><li>Conceived as a set of API </li></ul><ul><ul><li>Infrastructural Solution, an Advanced Interface to the Network </li></ul></ul><ul><li>Global Data Space accessed in a publish/subcribe fashion </li></ul><ul><li>Typical Applications: </li></ul><ul><ul><li>Air Traffic Control (SELEX-SI & THALES CoFlight, ...) </li></ul></ul><ul><ul><li>Defense Systems (U.S. DoD GiG, THALES Naval TACTICOS CMS, ...) </li></ul></ul><ul><ul><li>Industrial Control (Schneider Electric PLCs,...) </li></ul></ul><ul><ul><li>Financial Transaction Systems </li></ul></ul>Mainly systems of systems with thousand of entities and soft RT requirements
  6. 6. DDS issues in High Integrity <ul><li>Too complex for High Integrity: </li></ul><ul><ul><li>Hard and Expensive to Certify </li></ul></ul><ul><ul><li>Too avid of resources </li></ul></ul><ul><li>Lacks of Priority Support: </li></ul><ul><ul><li>No way to set the priority of a publication </li></ul></ul><ul><li>Dynamic Features: </li></ul><ul><ul><li>Automatic Discovery and Configuration means unpredictability </li></ul></ul>Can DDS be used in High Integrity and Embedded Systems? <ul><li>In this work we want to solve these issues: </li></ul><ul><li>Definition of an High Integrity Profile </li></ul><ul><li>Definition of a Priority Model </li></ul><ul><li>Implement & Evaluate! </li></ul><ul><li>Context: Sensors and Actuators are often High Integrity Systems that can’t fail </li></ul><ul><ul><li>Avionics (fly-by-wire), weapons, nuclear reactors, trasportation, automotive, tlc, .. </li></ul></ul><ul><li>These are data centric systems and can take benefits from the DDS, but... </li></ul><ul><li>They must be certified! </li></ul><ul><ul><li>U.S. DO178, EuroControl/SWAL, ... </li></ul></ul><ul><ul><li>Code needs to be statically analizable </li></ul></ul><ul><ul><li>Going towards Essential Complexity </li></ul></ul>
  7. 7. Outline <ul><li>Data Distribution in High Integrity Systems </li></ul><ul><li>Overview of the OMG DDS Standard </li></ul><ul><li>An High Integrity Profile for DDS </li></ul><ul><li>Implementing the profile: </li></ul><ul><ul><li>Real Time Java as the Reference Platform </li></ul></ul><ul><ul><li>Applying patterns for the RTSJ </li></ul></ul><ul><li>Results </li></ul><ul><li>Conclusions and future works </li></ul>
  8. 8. DDS and the Pub/sub Paradigm <ul><li>Enables Many to Many Communication </li></ul><ul><li>Fundamental Entities: </li></ul><ul><ul><li>Topic: identifies the argument of the communication </li></ul></ul><ul><ul><li>Publisher: sends Data on a given Topic </li></ul></ul><ul><ul><li>Subscribers: receives Data on the Subscribed Topic </li></ul></ul><ul><li>Publisher and Subscribers are Completely Decoupled: </li></ul><ul><ul><li>In Space: they doesn’t know each other </li></ul></ul><ul><ul><li>In Synchronization: Writing and receiving operations are not-blocking </li></ul></ul><ul><ul><li>In Time: data are cached by the middleware, so a subscriber can join the GDS and have the past samples </li></ul></ul>
  9. 9. The DCPS Model <ul><li>DomainParticipant: provides the access to the communication Domain </li></ul><ul><li>Topic: Identified by a string, has a data type associated </li></ul><ul><li>DataReader: Accessor to read typed data on a given Topic </li></ul><ul><li>Subscriber: Aggregation of DataReaders, Receives the data </li></ul><ul><li>Notification via Listener or WaitSet </li></ul><ul><li>Access the data via take() or read() on the DataReader </li></ul>Domain Communication estabilished on QoS basis! Listener DATA_AVAILABLE <ul><li>DataWriter: Accessor to write typed data on a given Topic </li></ul><ul><li>Publisher: Aggregation of DataWriters, Disseminates the data </li></ul><ul><li>Publish via write() on DataWriter </li></ul>Each Entity has a wide range of Qos Policies Publisher Data Writer Topic Participant S Data Sample write() Subscriber Data Reader Topic Participant S Data Sample
  10. 10. QoS Policies Distilled Reliability Persistence Timeliness * T = Topic, DW = DataWriter, DR = DataReader Only the most important 9, there are over 20 total policies… Specify the (maximum) latency of a publication. Can be used to optimize the send process DR,DW,T LATENCY_ BUDGET Sets the priority of the transport, if available… DW,T TRANSPORT_ PRIORITY Minimum period between two notifications. DR TIME_BASED_FILTER The maximum period between two publications DR,DW,T DEADLINE How many data samples are kept by the middleware: KEEP_ALL, KEEP_LAST_N DR,DW,T HISTORY How publications are cached by the middleware: VOLATILE, TRANSIENT, PERSISTENT DR,DW,T DURABILITY The DataWriter with the higher STRENGTH is the only one enabled to publish on an EXCLUSIVE Topic DW STRENGTH Topic updated by any DataWriter ( SHARED ) or by only one ( EXCLUSIVE ) T OWNERSHIP Communication Semantics: RELIABLE or BEST_EFFORT DR,DW,T RELIABILITY Description: Applies To*: Policy Name:
  11. 11. Summary <ul><li>Publish/Subscribe in High Integrity Systems </li></ul><ul><li>Overview of the OMG DDS Standard </li></ul><ul><li>An High Integrity Profile for DDS </li></ul><ul><li>Implementing the profile: </li></ul><ul><ul><li>Real Time Java as the Reference Platform </li></ul></ul><ul><ul><li>Applying patterns for the RTSJ </li></ul></ul><ul><li>Results </li></ul><ul><li>Conclusions and future works </li></ul>
  12. 12. An High Integrity DDS Profile <ul><li>DDS is only an Interface Level Specification </li></ul><ul><li>Low-Level details are in the Wire Protocol: </li></ul><ul><ul><li>RTPS, Real Time Publish Subscribe Wire Protocol (august 2006) </li></ul></ul><ul><li>Still vague, designed to promote context-adaptation </li></ul><ul><ul><li>But in High Integrity we have to be precise! </li></ul></ul><ul><li>The HI-DDS Profile removes Optional Complexity from DDS: </li></ul><ul><ul><li>Restriction of the DDS specification, excluding the most complex, time-consuming and not deterministic features. </li></ul></ul><ul><ul><li>Refinement of the RTPS Wire Protocol that fits the operational context in giving more details on used protocols </li></ul></ul><ul><ul><li>Definition of a Reference Architecture </li></ul></ul><ul><ul><li>Definition of a precise Data Dissemination Technique </li></ul></ul><ul><ul><li>Definition of a priority model </li></ul></ul><ul><ul><li>Definition of a concurrency model that supports the priority model </li></ul></ul><ul><li>First, let’s see how to disseminate data over the network </li></ul>
  13. 13. Multicast Data Dissemination <ul><li>Problem : Multicast is too complex to be implemented at the middleware level and reach certifications at the same time </li></ul><ul><li>Solution : Push the complexity down into network infrastructure </li></ul><ul><ul><li>Protocol Based (IP Multicast) </li></ul></ul><ul><ul><li>One Topic, One Group (a topic has its own communication plane) </li></ul></ul><ul><li>Advantages : </li></ul><ul><ul><li>Efficiency: </li></ul></ul><ul><ul><ul><li>Reduce Network load </li></ul></ul></ul><ul><ul><ul><li>Avoids filtering at middleware level, everything is done by network switches </li></ul></ul></ul><ul><ul><li>Determinism: </li></ul></ul><ul><ul><ul><li>Uniform notification time </li></ul></ul></ul><ul><ul><li>Discovery solved at the infrastructure level </li></ul></ul>S Pressure Alarm P P P S S S S
  14. 14. The Need for Priority <ul><li>Problem : In the current DDS there is no way to specify the priority of a publication. In High Priority Systems each publication has an intrinsic priority </li></ul><ul><ul><li>With DDS you can only set the priority at the transport level </li></ul></ul><ul><ul><li>This can lead to Head Of Line Blocking (HOL) phenomenon at reception-time! </li></ul></ul><ul><li>Solution: </li></ul><ul><ul><li>Definition of a Hierarchical Priority model that takes care both of topic and publication priority </li></ul></ul><ul><ul><li>Definition of a concurrency model that supports the priority model </li></ul></ul>
  15. 15. A Hierarchical Priority Model <ul><li>Three kinds of Topic: Hard Real-Time, Real-Time, Not Real-Time </li></ul><ul><li>Real-Time Topics has two levels of priority </li></ul><ul><ul><li>Topic level (by a Topic QoS) </li></ul></ul><ul><ul><li>Publication level (by the new write(data, priority) API) </li></ul></ul><ul><li>No Priority Inversion inter-topic and intra-topic </li></ul><ul><li>No Priority Inversion inter-topic and intra-topic! </li></ul><ul><li>Virtual channels to keep the priority end-to-end, even with not real-time transport </li></ul>
  16. 16. Realize the Priority Model <ul><li>Publications are addressed by the middleware to the correct Subscriber Endpoint </li></ul><ul><li>An endpoint maintains a queue of requests of the same priority </li></ul><ul><li>With UDP/IP we can use multiple ports </li></ul><ul><li>In the thesis we propose a way to identify the port… </li></ul>
  17. 17. Outline <ul><li>Publish/Subscribe in High Integrity Systems </li></ul><ul><li>Overview of the OMG DDS Standard </li></ul><ul><li>An High Integrity Profile for DDS </li></ul><ul><li>Implementing the profile: </li></ul><ul><ul><li>Real Time Java as the Reference Platform </li></ul></ul><ul><ul><li>Applying patterns for the RTSJ </li></ul></ul><ul><li>Results </li></ul><ul><li>Conclusions and future works </li></ul>
  18. 18. The Need for Certification & The RTSJ <ul><li>Use a Safe, Efficient and Certifiable Platform: </li></ul><ul><li>RTSJ (JSR-1), the Real Time Specification for </li></ul><ul><li>Java provides two High Integrity Profiles: </li></ul><ul><ul><li>Ravenscar Java (from Ravenscar ADA and SPARK) </li></ul></ul><ul><ul><li>Safety Critical Java, defined by JSR-302 leaded by Doug Locke </li></ul></ul><ul><ul><li>Both aims to be DO-178 Level-A or SWAL-1 compatible! They can fly… </li></ul></ul><ul><li>RTSJ Features: </li></ul><ul><ul><li>New memory management models that can be used in lieu of garbage collection </li></ul></ul><ul><ul><li>Access to physical memory </li></ul></ul><ul><ul><li>Stronger semantics on threads and their scheduling </li></ul></ul><ul><ul><ul><li>RealtimeThread </li></ul></ul></ul><ul><ul><ul><li>NoHeapRealtimeThread </li></ul></ul></ul><ul><ul><li>Asynchronous Event handling mechanism </li></ul></ul><ul><ul><li>Scheduling Service (default priority preemtive with 28 prios) </li></ul></ul><ul><ul><li>Higher time resolution and Timers (One Shot and Periodic) </li></ul></ul><ul><li>RTSJ adoption: Boeing, IBM, Siemens AG, Rockwell Collins, … </li></ul>Software High Integrity
  19. 19. Memory Model <ul><li>The RTSJ Memory Model solves allocation/deallocation problems in providing the concept of Scope: a memory area that can be entered by threads and that is entirely released when no threads are in it. </li></ul><ul><li>All DDS entities are allocated in the Immortal area (a primordial area where object are never collected) </li></ul><ul><li>Each accepting thread has a private scope to unmarshal the request and another to notify the application </li></ul><ul><li>Each sending thread has its own private scope to marshal the request </li></ul>
  20. 20. Implement the Priority Model <ul><li>Problem : It is highly inefficient to have one or more threads bound to a single socket, some of them can be inactive while some can be stressed! </li></ul><ul><li>Solution : A modified version of the Leader/Follower Pattern that fits the RTSJ Memory Model and with dynamic priority adjusting </li></ul>
  21. 21. Outline <ul><li>Publish/Subscribe in High Integrity Systems </li></ul><ul><li>Overview of the OMG DDS Standard </li></ul><ul><li>An High Integrity Profile for DDS </li></ul><ul><li>Implementing the profile: </li></ul><ul><ul><li>Real Time Java as the Reference Platform </li></ul></ul><ul><ul><li>Applying patterns for the RTSJ </li></ul></ul><ul><li>Results </li></ul><ul><li>Conclusions and future works </li></ul>
  22. 22. Round Trip Time (JVM vs. jRate) <ul><li>Testbed: </li></ul><ul><ul><li>Linux 2.6.17 RTAI patched </li></ul></ul><ul><ul><li>JDK 1.6 Vs. jRate (ahead-of-time RTSJ implementation based on GNU GCJ) </li></ul></ul><ul><li>jRate shows a very low jitter (10us), practically constant with message size, and good overall performances (a mean of 250us) </li></ul><ul><li>JDK shows an high jitter, due to Memory Management problems, but a better mean value… </li></ul>
  23. 23. Round Trip Time with priorities <ul><li>Testbed: Linux 2.6.17 RTAI + jRate + GCJ 3.3.3 </li></ul><ul><li>Fixed Send Rate: 1 KHz per publisher, total rate 10KHz, pool_size=5 </li></ul><ul><li>No jitter at all for higher priorities </li></ul><ul><li>No priority Inversions for the first N priorities ( N is the pool size!) </li></ul>
  24. 24. Round Trip Time with priorities <ul><li>Better Global Performances (limited bursts) </li></ul><ul><li>Bounded priority inversion limited to a context-switch (16 us) </li></ul><ul><li>Testbed: Linux 2.6.17 RTAI + jRate + GCJ 3.3.3 </li></ul><ul><li>Variable Send Rate (decreases with priority), pool_size=5 </li></ul>
  25. 25. Outline <ul><li>Publish/Subscribe in High Integrity Systems </li></ul><ul><li>Overview of the OMG DDS Standard </li></ul><ul><li>An High Integrity Profile for DDS </li></ul><ul><li>Implementing the profile: </li></ul><ul><ul><li>Real Time Java as the Reference Platform </li></ul></ul><ul><ul><li>Applying patterns for the RTSJ </li></ul></ul><ul><li>Results </li></ul><ul><li>Conclusions and future works </li></ul>
  26. 26. Concluding Remarks <ul><li>Defined an High Integrity Profile and a priority model for the DDS </li></ul><ul><li>This work will be used by the DDS SIG @ OMG as starting point for both the official High Integrity and Real Time versions of the DDS </li></ul><ul><li>Implementation of the profile on the Real Time Java platform </li></ul><ul><ul><li>Discovered several design patterns to apply in the development of the profile </li></ul></ul><ul><ul><li>Available at </li></ul></ul><ul><li>Vision: In the vision of a Shared Global Data Space, we’ve enabled High Integrity Components to access it! </li></ul>