SlideShare a Scribd company logo
1 of 47
Download to read offline
OpenSplice DDS
                                      Delivering Performance, Openness, and Freedom




                                 The DDS Tutorial
Angelo Corsaro, Ph.D.
      Chief Technology Officer
        OMG DDS SIG Co-Chair
angelo.corsaro@prismtech.com



                                            ::Part I
Addressing Data Distribution Challenges
                                                          DDS is standard designed to address the data-distribution challenges across
                                                                                 a wide class of Defense and Aerospace Applications

The OMG DDS Standard
‣ Introduced in 2004, DDS is a standard
    for Real-Time, Dependable and High-
    Performance Publish/Subscribe
‣   DDS behaviour and semantics can be
    controlled via a rich set of QoS Policies
‣ DDS is today recommended by key
    administration worldwide and widely
    adopted across several different
    application domains, such as, Automated
    Trading, Simulations, SCADA, Telemetry,
    etc.

                                                © 2009, PrismTech. All Rights Reserved
The OMG Data Distribution Service (DDS)
DDS v1.2 API Standard
‣ Language Independent, OS and HW architecture                                                         Application

    independent                                                                                            Object/Relational Mapping
‣   DCPS. Standard API for Data-Centric, Topic-                                                     Data Local Reconstruction Layer (DLRL)
    Based, Real-Time Publish/Subscribe
                                                                                                                               Content
‣   DLRL. Standard API for creating Object Views out                                  Ownership           Durability
                                                                                                                             Subscription

    of collection of Topics                                                                           Minimum Profile

                                                                                           Data Centric Publish/Subscribe (DCPS)
DDSI/RTPS v2.1 Wire Protocol Standard
‣ Standard wire protocol allowing interoperability                                          Real-Time Publish/Subscribe Protocol


    between different implementations of the DDS                                              DDS Interoperability Wire Protocol

    standard                                                                                               UDP/IP

‣   Interoperability demonstrated among key DDS
    vendors in March 2009
                                             © 2009, PrismTech. All Rights Reserved
Tutorial Scope
Scope & Goals
‣ The Tutorial will cover the DCPS layer of DDS                                                   Application

‣ It will give you enough details and examples                                                        Object/Relational Mapping

  to make sure that you can get started                                                        Data Local Reconstruction Layer (DLRL)

  writing DDS applications
                                                                                                                          Content
                                                                                 Ownership           Durability
                                                                                                                        Subscription
Software
‣ OpenSplice DDS
                                                                                                 Minimum Profile

                                                                                      Data Centric Publish/Subscribe (DCPS)

  ‣ http://www.opensplice.org                                                          Real-Time Publish/Subscribe Protocol
‣ SIMple Dds (SIMD)                                                                      DDS Interoperability Wire Protocol

  ‣http://code.google.com/p/simd-cxx                                                                  UDP/IP

Prerequisite
‣ Basic C++ understanding
                                        © 2009, PrismTech. All Rights Reserved
OpenSplice DDS
Delivering Performance, Openness, and Freedom


Your will learn:
- What is a Topic
- How to define Topic Types
- How to register a Topic               Step I
                             Defining the Data
Topics

Topic
‣ Unit of information atomically
  exchanged between Publisher and
  Subscribers.
‣ An association between a unique name,
  a type and a QoS setting




                                   © 2009, PrismTech. All Rights Reserved
Topic Types

A DDS Topic Type is described by an IDL Structure containing an arbitrary number for
fields whose types might be:
‣ IDL primitive types, e.g., octet, short, long, float, string (bound/unbound), etc.
‣ Enumeration
‣ Union
‣ Sequence (bounded or unbounded)
‣ Array
‣ Structure (nested)



                                    © 2009, PrismTech. All Rights Reserved
Examples

struct HelloTopicType {                                                     enum TemperatureScale {
   string message;                                                             CELSIUS,
};                                                                             FAHRENHEIT,
                              struct ShapeType {                               KELVIN
                                 long x;                                    };
                                 long y;
                                 long shapesize;                            struct TempSensorType {
struct PingType                  string color;                                 short id;
{                             };                                               float temp;
   long         counter;                                                       float hum;
   string<32>   vendor;                                                        TemperatureScale scale;
};                                                                          };


                           struct Counter {
                              long cID;
                              long count;
                           };



                                   © 2009, PrismTech. All Rights Reserved
Topic Types & Keys



‣ Each Topic Type has to define its key-set (which might be the empty set)
‣ There are no limitations on the number of attributes used to represent a key
‣ Keys can be top-level attributes as well as nested-attributes (i.e. attributes in nested
  structures)




                                        © 2009, PrismTech. All Rights Reserved
Key Examples -- Empty Key-Set


                                                                     struct PingType
struct HelloTopicType {                                              {
   string message;                                                      long         counter;
};                                                                      string<32>   vendor;
#pragma keylist HelloTopicType                                       };
                                                                     #pragma keylist PingType




                                 © 2009, PrismTech. All Rights Reserved
Key Examples -- User-Defined Keys

                                                                 enum TemperatureScale {
                                                                    CELSIUS,
                                                                    FAHRENHEIT,
struct ShapeType {
                                                                    KELVIN
   long x;
                                                                 };
   long y;
   long shapesize;
                                                                 struct TempSensorType {
   string color;
                                                                    short id;
};
                                                                    short roomid;
#pragma keylist ShapeType color
                                                                    float temp;
                                                                    float hum;
                                                                    TemperatureScale scale;
                  struct Counter {                               };
                     long cID;                                   #pragma keylist TempSensorType id roomid
                     long count;
                  };
                  #pragma keylist Counter cID


                                        © 2009, PrismTech. All Rights Reserved
Topic Keys Gotchas
‣ Keys are used to identify specific data “instances”
‣ It we want to make a parallel with OO then we could say that:
 ‣ Keyless Topic as singletons, e.g. there is only one instance!
 ‣ Keyed Topics identify a class of instances. Each instance is identified by a key value
 ‣ Think at each different key value as really instantiating a new “object” in your system. That will avoid
   making mistakes in your keys assignment
‣ Never do something like this:
                struct Counter {
                   long cID;
                   long count;
                };
                #pragma keylist Counter count


 ... As it will create a new topic instance for each ping you send thus consuming an unbounded
 amount of resources!
                                            © 2009, PrismTech. All Rights Reserved
Compiling Topic Types
‣ Topic types have to be compiled with the DDS-provided IDL compiler
‣ The compilation process will take care of generating code for
 ‣ Strongly typed Reader and Writers
 ‣ Type Serialization
‣ When compiling a target language should be chosen, such as C/C++/Java/C#

‣ Example:
             $ idlpp -S -l cpp -d gencxx ShapeType.idl

             $ idlpp -S -l java -d genjava ShapeType.idl


              Standalone mode
                                Target Language             Target Directory               Target File

                                                  © 2009, PrismTech. All Rights Reserved
IDL Compilation in SIMD

‣ SIMD provides a template makefile that you can use to compile your IDL files.
‣ The default language is C++ (as SIMD currently supports only C++)

       Makefile.idl

        #-*-Makefile-*-
        include $(SIMD_HOME)/config/apps/Macros-idl.GNU

        TARGET_IDL=ShapeType.idl

        include $(SIMD_HOME)/config/apps/Rules-idl.GNU




                                        © 2009, PrismTech. All Rights Reserved
Putting it all Together


                                             Circle


struct ShapeType {
   long   x;
   long   y;
   long   shapesize;                          Topic                        QoS
   string color;
};
#pragma keylist ShapeType color




                                  © 2009, PrismTech. All Rights Reserved
Registering Topics with SIMD

‣ SIMD provides several constructors that allow to register a topic:

     Topic(const std::string& name);

     Topic(const std::string& name, const TopicQos& qos);

     Topic(const std::string& name, const std::string& type_name);

     Topic(const std::string& name, const std::string& type_name, const TopicQos& qos);




                                         © 2009, PrismTech. All Rights Reserved
Registering the Circle Topic
                                    Circle


struct ShapeType {
   long   x;
   long   y;
   long   shapesize;                                                       Default
                                     Topic                                  QoS
   string color;
};
#pragma keylist ShapeType color




                   dds::Topic<ShapeType> shape(“Circle”);


                                  © 2009, PrismTech. All Rights Reserved
Topic Registration Gotchas

‣ Topics registration is idempotent as far as you register the topic in the same way from various
    applications.
‣   It is an error to try to register a topic with the same name but a different type.

‣ Example:
                Application 1                                                         Application 2


dds::Topic<ShapeType> shape(“Circle”);                          dds::Topic<ShapeType> shape(“Circle”);     OK



dds::Topic<ShapeType> shape(“Circle”);                          dds::Topic<AnotherType> shape(“Circle”);   Errror



                                             © 2009, PrismTech. All Rights Reserved
OpenSplice DDS
Delivering Performance, Openness, and Freedom


Your will learn:
- What are DDS Partitions
- How to partitions work
                                        Step II
                            Defining the Scope
Domains and Partitions
                                              Domain


Domain
‣ A Domain is one instance of the DDS
  Global Data Space
‣ DDS entities always belong to a specific
  domain
Partition
‣ A partition is a scoping mechanism
  provided by DDS organize a partition                                             DDS
                                                                              Global Data Space
                                             Partition



                                              © 2009, PrismTech. All Rights Reserved
More about Partitions

‣ Each partition is identified by a
    string, such as “sensor-data”,
    “log-data” etc.
‣   Read/Write access to a
    partition is gained by means of
    DDS Publisher/Subscribers
‣   Each Publisher/Subscriber
    can be provided with a list of
    Partitions name, which might
    as well include wildcards ,or                                                   DDS
    generic regular expression,                                                Global Data Space
                                                          Partition
    such as “*-data”


                                      © 2009, PrismTech. All Rights Reserved
Partition as Namespaces

‣ Although DDS does not support explicit nesting of partitions, a powerful way of organizing your
    data is by always using a hierarchical “dotted” notation to describe them.
‣   For instance, for a building in which you are deploying the new temperature control system you
    might use a scheme such as “building.floor-level.room-number” for scoping the data that flows
    in each room.
    ‣ building.floor-2.room-10
    ‣ building.floor-3.room-15
‣ In this way, accessing the data for a specific floor can be done by using the partition
    expression “building.floor-2.*”
‣   While the data for all the building is available via “building.*”



                                             © 2009, PrismTech. All Rights Reserved
Emulating Partition Nesting
“building.floor-1.*”

                                           “building”

                            “building.floor-1”
        “building.floor-1.room-1” ...                                  “building.floor-N”
                     “building.floor-1.room-2”               “building.floor-N.room-1”
                                                                                         “building.floor-N.room-2”
                                                                            ...
                                      “building.floor-2”
                 “building.floor-2.room-1”
                                                          ...
                                          “building.floor-2.room-2”
                                     ...

                                                © 2009, PrismTech. All Rights Reserved
Connecting to Partitions in SIMD
‣ SIMD provides two ways of connecting to partitions.
‣ A simple one is to bound the full runtime to a partition expression by passing a string to the
    Runtime class at construction time
‣   The other is to configure a specific Publisher/Subscriber with the relevant list of partitions

Runtime();
Runtime(const std::string& partition);
Runtime(const std::string& partition, const std::string& domain);

Publisher(const std::string& partition);
Publisher(const std::string& partition, ::dds::DomainParticipant dp);
Publisher(const ::dds::PublisherQos& qos, ::dds::DomainParticipant dp);

Subscriber(const std::string& partition);
Subscriber(const std::string& partition, ::dds::DomainParticipant dp);
Subscriber(const ::dds::SubscriberQos& qos, ::dds::DomainParticipant dp);



                                            © 2009, PrismTech. All Rights Reserved
OpenSplice DDS
Delivering Performance, Openness, and Freedom


Your will learn:
- What is a Data Writer
- How to Create a Data Writer
- How to write Data                         Step III
                                Producing the Data
Writing Data in SIMD



‣ Writing data with SIMD takes two steps.
‣ First you have to create the DataWriter by using the proper constructor (this
  depends on the level of customization you require)
‣ Then, you’ll have to decide how you want to write the data




                                 © 2009, PrismTech. All Rights Reserved
Creating a DataWriter
‣ SIMD provides different DataWriter constructors allowing to control the
 level of customization required for the specific writer

template <typename T>
class dds::pub::DataWriter : public dds::core::Entity {
public:
   DataWriter();

   DataWriter(Topic<T> topic)

   DataWriter(Topic<T> topic, const DataWriterQos& qos)

   DataWriter(Topic<T> topic, const DataWriterQos& qos, Publisher pub);
// ...
};

                                 © 2009, PrismTech. All Rights Reserved
Writing Data with SIMD

‣ SIMD provides two generic writes as well as a method for creating a writer
  dedicated to a specific instance
‣ The DataInstanceWriter provides constant time writes as it does not
  need to look-up the key-fields

 DDS::ReturnCode_t write(const T& sample);

 DDS::ReturnCode_t write(const T& sample, const DDS::Time_t& timestamp);

 DataInstanceWriter<T> register_instance(const T& key);




                                © 2009, PrismTech. All Rights Reserved
Writing “Circling” Circle Samples




              © 2009, PrismTech. All Rights Reserved
OpenSplice DDS
Delivering Performance, Openness, and Freedom


Your will learn:
- Reading vs Taking data
- Sample State
- How to Create a Data Reader
- How to read/take data
                                       Step IV
                                Consuming Data
Reading Samples

                                                                                                  ‣ Read iterates over the
                                                                                                      available sample instances
                                                                                                  ‣
                   1   1     1   2   1   3   1     4
                                                                                                      Samples are not removed
                   2   1     2   2   2   3
DataReader                                                                                            from the local cache as




                                                                                                                                   Proprietary Information - Distribution without Expressed Written Permission is Prohibited.
                   3   1     3   2   3   3   3      4       3    5
                                                                                                      result of a read
                                                                     Topic                        ‣   Read samples can be read
                                                                                                      again, by accessing the
    Samples Read                 Samples not Read
                                                                                                      cache with the proper
                                                                                                      options (more later)
                           DataReader Cache

                                                                                      struct Counter {
                                                                                         int cID;
                                                                                         int count;
                                                                                      };
                                                                                      #pragma keylist Counter cID
                                                 © 2009, PrismTech. All Rights Reserved
Reading Samples
                                                                                               ‣ Read iterates over the
                                                                                                   available sample instances
                  1    1     1   2   1   3   1     4
                                                                                               ‣   Samples are not removed
                  2    1     2   2   2   3
                                                                                                   from the local cache as
DataReader




                                                                                                                                Proprietary Information - Distribution without Expressed Written Permission is Prohibited.
                  3    1     3   2   3   3   3      4       3    5
                                                                                                   result of a read
                                                                                               ‣   Read samples can be read
                                                                     Topic
                                                                                                   again, by accessing the
        Samples Read                 Samples not Read                                              cache with the proper
                                                                                                   options (more later)
                           DataReader Cache
                                                                                      struct Counter {
                                                                                         int cID;
                                                                                         int count;
                                                                                      };
                                                                                      #pragma keylist Counter cID
                                                 © 2009, PrismTech. All Rights Reserved
Reading Samples
                                                                                         ‣ Read iterates over the
                                                                                             available sample instances
             1   1     1   2   1   3   1     4
                                                                                         ‣   Samples are not removed
             2   1     2   2   2   3
                                                                                             from the local cache as
DataReader




                                                                                                                          Proprietary Information - Distribution without Expressed Written Permission is Prohibited.
             3   1     3   2   3   3   3      4       3    5
                                                                                             result of a read
                                                                                         ‣   Read samples can be read
                                                               Topic
                                                                                             again, by accessing the
             Samples Read              Samples not Read                                      cache with the proper
                                                                                             options (more later)
                     DataReader Cache
                                                                                struct Counter {
                                                                                   int cID;
                                                                                   int count;
                                                                                };
                                                                                #pragma keylist Counter cID
                                           © 2009, PrismTech. All Rights Reserved
Taking Samples
                                                                                         ‣ Take iterates over the
                                                                                             available sample instances
             1   1     1   2   1   3   1     4
                                                                                         ‣   Taken Samples are
             2   1     2   2   2   3
                                                                                             removed from the local
DataReader




                                                                                                                          Proprietary Information - Distribution without Expressed Written Permission is Prohibited.
                                       3      4       3    5
                                                                                             cache as result of a take
             3   1     3   2   3   3
                                                                                         ‣
                                                               Topic

                           Samples not Taken


                     DataReader Cache
                                                                                struct Counter {
                                                                                   int cID;
                                                                                   int count;
                                                                                };
                                                                                #pragma keylist Counter cID
                                           © 2009, PrismTech. All Rights Reserved
Taking Samples
                                                                                 ‣ Take iterates over the
                                                                                     available sample instances
               1   2   1   3   1     4
                                                                                 ‣   Taken Samples are
               2   2   2   3
                                                                                     removed from the local
DataReader




                                                                                                                  Proprietary Information - Distribution without Expressed Written Permission is Prohibited.
               3   2   3   3   3      4       3    5
                                                                                     cache as result of a take

                                                       Topic

                       Samples not Taken


             DataReader Cache
                                                                        struct Counter {
                                                                           int cID;
                                                                           int count;
                                                                        };
                                                                        #pragma keylist Counter cID
                                   © 2009, PrismTech. All Rights Reserved
Taking Samples
                                                                              ‣ Take iterates over the
                                                                                  available sample instances
                    1   3   1     4
                                                                              ‣   Taken Samples are
                    2   3
                                                                                  removed from the local
DataReader




                                                                                                               Proprietary Information - Distribution without Expressed Written Permission is Prohibited.
                    3   3   3      4       3    5
                                                                                  cache as result of a take

                                                    Topic

                        Samples not Taken


             DataReader Cache
                                                                     struct Counter {
                                                                        int cID;
                                                                        int count;
                                                                     };
                                                                     #pragma keylist Counter cID
                                © 2009, PrismTech. All Rights Reserved
Sample, Instance and View States
                      History Depth = 2


                                              ‣ Along with data samples, DataReaders are provided
                      1       1
                                                with state information allowing to detect relevant
                      2       2
                                                transitions in the life-cycle of data as well as data
                      3                         writers
  DataReader




                                                                                                          Proprietary Information - Distribution without Expressed Written Permission is Prohibited.
                     SampleInfo               ‣ Sample State (READ | NOT_READ): Determines
                                                wether a sample has already been read by this
                      1   1   1   2
                                                DataReader or not.
                      2   2   2   3
                                              ‣ Instance State (ALIVE, NOT_ALIVE, DISPOSED).
                      3   1
                                                Determines wether (1) writer exist for the specific
                      Samples                   instance, or (2) no matched writers are currently
                          Topic                 available, or (3) the instance has been disposed

               DataReader Cache
                                              ‣ View State (NEW, NOT_NEW). Determines wether
                                                this is the first sample of a new (or re-born) instance
                                          © 2009, PrismTech. All Rights Reserved
Application / DDS Coordination
DDS provides three main mechanism for exchanging information with the application


‣ Polling. The application polls from time to time for new data or status changes. The
  interval might depend on the kind of applications as well as data




                                                                                              Proprietary Information - Distribution without Expressed Written Permission is Prohibited.
‣ WaitSets. The application registers a WaitSet with DDS and waits (i.e. is suspended)
  until one of the specified events has happened.

‣ Listeners. The application registers a listener with a specific DDS entity to be notified
  when relevant events occur, such as state changes or




                                          © 2009, PrismTech. All Rights Reserved
Reading Data with SIMD
/**
 * Reads all new samples from any view state and alive instances. Notice
 * that this call is intended to loan the <code>samples</code> as
 * well as the <conde>infos</code> containers, thus will require a
 * return_loan.
 */
DDS::ReturnCode_t read(TSeq& samples, DDS::SampleInfoSeq& infos)

/**
 * Reads at most <code>max_samples</code> samples that have not been




                                                                                      Proprietary Information - Distribution without Expressed Written Permission is Prohibited.
 * read yet from all vies and alive instances.
 */
DDS::ReturnCode_t read(TSeq& samples, long max_samples)

/**
 * Most generic <code>read</code> exposing all the knobs provided by
 * the OMG DDS API.
 */
DDS::ReturnCode_t
read(TSeq& samples, DDS::SampleInfoSeq& infos,long max_samples,
     DDS::SampleStateMask samples_state, DDS::ViewStateMask views_state,
     DDS::InstanceStateMask instances_state)

DDS::ReturnCode_t
return_loan(TSeq& samples, DDS::SampleInfoSeq& infos);


                                             © 2009, PrismTech. All Rights Reserved
Taking Data with SIMD
/**
 * Reads all new samples from any view state and alive instances. Notice
 * that this call is intended to loan the <code>samples</code> as
 * well as the <conde>infos</code> containers, thus will require a
 * return_loan.
 */
DDS::ReturnCode_t take(TSeq& samples, DDS::SampleInfoSeq& infos)

/**




                                                                                     Proprietary Information - Distribution without Expressed Written Permission is Prohibited.
 * Reads at most <code>max_samples</code> samples that have not been
 * read yet from all vies and alive instances.
 */
DDS::ReturnCode_t take(TSeq& samples, long max_samples)

/**
 * Most generic <code>read</code> exposing all the knobs provided by
 * the OMG DDS API.
 */
DDS::ReturnCode_t
take(TSeq& samples, DDS::SampleInfoSeq& infos,long max_samples,
     DDS::SampleStateMask samples_state, DDS::ViewStateMask views_state,
     DDS::InstanceStateMask instances_state)




                                            © 2009, PrismTech. All Rights Reserved
WaitSets in SIMD

‣ SIMD provides a strongly typed WaitSet that supports automatic dispatching to functors
‣ The best way of understanding SIMD waitsets is to look at an example:




                                                                                           Proprietary Information - Distribution without Expressed Written Permission is Prohibited.
                                       © 2009, PrismTech. All Rights Reserved
Listeners
 in SIMD


‣ SIMD provides a strongly
    typed Listeners based on
    the Signals/Slots patterns




                                                                          Proprietary Information - Distribution without Expressed Written Permission is Prohibited.
‣   The best way of
    understanding SIMD
    Listeners is to look at an
    example...




                                 © 2009, PrismTech. All Rights Reserved
OpenSplice DDS
Delivering Performance, Openness, and Freedom




                                Step V
                     Compile and Run...
What You’ve Learned today



‣ Defining Topics and Topic Types
‣ Scoping Information with Partitions
‣ Writing Data
‣ Reading (Taking) data with Waitsets and Listeners
‣ Writing an example that demonstrate all of the above



                               © 2009, PrismTech. All Rights Reserved
What I’ll Cover Next Time



‣ Content Filtered Topics and Queries
‣ QoS and the Request vs. Offered Model
‣ Setting QoS on DDS Entities
‣ Tuning OpenSplice DDS Configuration



                               © 2009, PrismTech. All Rights Reserved
Online Resources

 http://www.opensplice.com/
                                                                                  http://www.slideshare.net/angelo.corsaro
 emailto:opensplicedds@prismtech.com




 http://bit.ly/1Sreg                                                              http://twitter.com/acorsaro/




                                                                                  http://opensplice.blogspot.com
 http://www.youtube.com/OpenSpliceTube


                                         © 2009, PrismTech. All Rights Reserved

More Related Content

What's hot

What's hot (20)

Introduction to DDS
Introduction to DDSIntroduction to DDS
Introduction to DDS
 
DDS QoS Unleashed
DDS QoS UnleashedDDS QoS Unleashed
DDS QoS Unleashed
 
Cyclone DDS: Sharing Data in the IoT Age
Cyclone DDS: Sharing Data in the IoT AgeCyclone DDS: Sharing Data in the IoT Age
Cyclone DDS: Sharing Data in the IoT Age
 
DDS Over Low Bandwidth Data Links
DDS Over Low Bandwidth Data LinksDDS Over Low Bandwidth Data Links
DDS Over Low Bandwidth Data Links
 
The Data Distribution Service Tutorial
The Data Distribution Service TutorialThe Data Distribution Service Tutorial
The Data Distribution Service Tutorial
 
OMG DDS: The Data Distribution Service for Real-Time Systems
OMG DDS: The Data Distribution Service for Real-Time SystemsOMG DDS: The Data Distribution Service for Real-Time Systems
OMG DDS: The Data Distribution Service for Real-Time Systems
 
Introduction to RTI DDS
Introduction to RTI DDSIntroduction to RTI DDS
Introduction to RTI DDS
 
DDS Advanced Tutorial - OMG June 2013 Berlin Meeting
DDS Advanced Tutorial - OMG June 2013 Berlin MeetingDDS Advanced Tutorial - OMG June 2013 Berlin Meeting
DDS Advanced Tutorial - OMG June 2013 Berlin Meeting
 
Best Practices Using RTI Connext DDS
Best Practices Using RTI Connext DDSBest Practices Using RTI Connext DDS
Best Practices Using RTI Connext DDS
 
Overview of the DDS-XRCE specification
Overview of the DDS-XRCE specificationOverview of the DDS-XRCE specification
Overview of the DDS-XRCE specification
 
The Art and Science of DDS Data Modelling
The Art and Science of DDS Data ModellingThe Art and Science of DDS Data Modelling
The Art and Science of DDS Data Modelling
 
UML Profile for DDS
UML Profile for DDSUML Profile for DDS
UML Profile for DDS
 
Fast DDS Features & Tools
Fast DDS Features & ToolsFast DDS Features & Tools
Fast DDS Features & Tools
 
RTI DDS Intro with DDS Secure
RTI DDS Intro with DDS SecureRTI DDS Intro with DDS Secure
RTI DDS Intro with DDS Secure
 
The DDS Security Standard
The DDS Security StandardThe DDS Security Standard
The DDS Security Standard
 
10 Reasons for Choosing OpenSplice DDS
10 Reasons for Choosing OpenSplice DDS10 Reasons for Choosing OpenSplice DDS
10 Reasons for Choosing OpenSplice DDS
 
Micro XRCE-DDS: Bringing DDS into microcontrollers
Micro XRCE-DDS: Bringing DDS into microcontrollersMicro XRCE-DDS: Bringing DDS into microcontrollers
Micro XRCE-DDS: Bringing DDS into microcontrollers
 
DDS In Action Part II
DDS In Action Part IIDDS In Action Part II
DDS In Action Part II
 
RTI Data-Distribution Service (DDS) Master Class 2011
RTI Data-Distribution Service (DDS) Master Class 2011RTI Data-Distribution Service (DDS) Master Class 2011
RTI Data-Distribution Service (DDS) Master Class 2011
 
The Data Distribution Service
The Data Distribution ServiceThe Data Distribution Service
The Data Distribution Service
 

Viewers also liked

Getting Started with DDS in C++, Java and Scala
Getting Started with DDS in C++, Java and ScalaGetting Started with DDS in C++, Java and Scala
Getting Started with DDS in C++, Java and Scala
Angelo Corsaro
 
Building the Internet of Things
Building the Internet of ThingsBuilding the Internet of Things
Building the Internet of Things
Angelo Corsaro
 
Standardizing the Data Distribution Service (DDS) API for Modern C++
Standardizing the Data Distribution Service (DDS) API for Modern C++Standardizing the Data Distribution Service (DDS) API for Modern C++
Standardizing the Data Distribution Service (DDS) API for Modern C++
Sumant Tambe
 

Viewers also liked (20)

20 Tips for OpenSplice Newbies
20 Tips for OpenSplice Newbies20 Tips for OpenSplice Newbies
20 Tips for OpenSplice Newbies
 
Getting Started with DDS in C++, Java and Scala
Getting Started with DDS in C++, Java and ScalaGetting Started with DDS in C++, Java and Scala
Getting Started with DDS in C++, Java and Scala
 
OpenSplice DDS v6
OpenSplice DDS v6OpenSplice DDS v6
OpenSplice DDS v6
 
Building the Internet of Things
Building the Internet of ThingsBuilding the Internet of Things
Building the Internet of Things
 
Standardizing the Data Distribution Service (DDS) API for Modern C++
Standardizing the Data Distribution Service (DDS) API for Modern C++Standardizing the Data Distribution Service (DDS) API for Modern C++
Standardizing the Data Distribution Service (DDS) API for Modern C++
 
Comparison of MQTT and DDS as M2M Protocols for the Internet of Things
Comparison of MQTT and DDS as M2M Protocols for the Internet of ThingsComparison of MQTT and DDS as M2M Protocols for the Internet of Things
Comparison of MQTT and DDS as M2M Protocols for the Internet of Things
 
RUSTing -- Partially Ordered Rust Programming Ruminations
RUSTing -- Partially Ordered Rust Programming RuminationsRUSTing -- Partially Ordered Rust Programming Ruminations
RUSTing -- Partially Ordered Rust Programming Ruminations
 
Distributed Simulations with DDS and HLA
Distributed Simulations with DDS and HLADistributed Simulations with DDS and HLA
Distributed Simulations with DDS and HLA
 
Advanced OpenSplice Programming - Part I
Advanced OpenSplice Programming - Part IAdvanced OpenSplice Programming - Part I
Advanced OpenSplice Programming - Part I
 
Stream Processing with DDS and CEP
Stream Processing with  DDS and CEPStream Processing with  DDS and CEP
Stream Processing with DDS and CEP
 
Vortex Tutorial -- Part I
Vortex Tutorial -- Part IVortex Tutorial -- Part I
Vortex Tutorial -- Part I
 
Vortex Tutorial Part II
Vortex Tutorial Part IIVortex Tutorial Part II
Vortex Tutorial Part II
 
Desktop, Embedded and Mobile Apps with Vortex Café
Desktop, Embedded and Mobile Apps with Vortex CaféDesktop, Embedded and Mobile Apps with Vortex Café
Desktop, Embedded and Mobile Apps with Vortex Café
 
Building Real-Time Web Applications with Vortex-Web
Building Real-Time Web Applications with Vortex-WebBuilding Real-Time Web Applications with Vortex-Web
Building Real-Time Web Applications with Vortex-Web
 
Advanced OpenSplice Programming - Part II
Advanced OpenSplice Programming - Part IIAdvanced OpenSplice Programming - Part II
Advanced OpenSplice Programming - Part II
 
Connected Mobile and Web Applications with Vortex
Connected Mobile and Web Applications with VortexConnected Mobile and Web Applications with Vortex
Connected Mobile and Web Applications with Vortex
 
Getting Started with OpenSplice DDS Community Ed.
Getting Started with OpenSplice DDS Community Ed.Getting Started with OpenSplice DDS Community Ed.
Getting Started with OpenSplice DDS Community Ed.
 
Building Reactive Applications with DDS
Building Reactive Applications with DDSBuilding Reactive Applications with DDS
Building Reactive Applications with DDS
 
Getting Started with Vortex
Getting Started with VortexGetting Started with Vortex
Getting Started with Vortex
 
Introducing Vortex Lite
Introducing Vortex LiteIntroducing Vortex Lite
Introducing Vortex Lite
 

Similar to The DDS Tutorial - Part I

Real Time Java DDS
Real Time Java DDSReal Time Java DDS
Real Time Java DDS
kerush
 

Similar to The DDS Tutorial - Part I (20)

DDS vs AMQP
DDS vs AMQPDDS vs AMQP
DDS vs AMQP
 
ISO C++ DDS PSM
ISO C++ DDS PSMISO C++ DDS PSM
ISO C++ DDS PSM
 
A Gentle Introduction to OpenSplice DDS
A Gentle Introduction to OpenSplice DDSA Gentle Introduction to OpenSplice DDS
A Gentle Introduction to OpenSplice DDS
 
Tweeting with OpenSplice DDS
Tweeting with OpenSplice DDSTweeting with OpenSplice DDS
Tweeting with OpenSplice DDS
 
Cloudand Xchange
Cloudand XchangeCloudand Xchange
Cloudand Xchange
 
Fast RTPS Workshop at FIWARE Summit 2018
Fast RTPS Workshop at FIWARE Summit 2018Fast RTPS Workshop at FIWARE Summit 2018
Fast RTPS Workshop at FIWARE Summit 2018
 
Real Time Java DDS
Real Time Java DDSReal Time Java DDS
Real Time Java DDS
 
Fiware - communicating with ROS robots using Fast RTPS
Fiware - communicating with ROS robots using Fast RTPSFiware - communicating with ROS robots using Fast RTPS
Fiware - communicating with ROS robots using Fast RTPS
 
DDS-PSM-Cxx and simd-cxx
DDS-PSM-Cxx and simd-cxxDDS-PSM-Cxx and simd-cxx
DDS-PSM-Cxx and simd-cxx
 
dds.pptx
dds.pptxdds.pptx
dds.pptx
 
Distributed Systems: How to connect your real-time applications
Distributed Systems: How to connect your real-time applicationsDistributed Systems: How to connect your real-time applications
Distributed Systems: How to connect your real-time applications
 
Fiware: Connecting to robots
Fiware: Connecting to robotsFiware: Connecting to robots
Fiware: Connecting to robots
 
OMG DDS Tutorial - Part I
OMG DDS Tutorial - Part IOMG DDS Tutorial - Part I
OMG DDS Tutorial - Part I
 
Beyond messaging
Beyond messagingBeyond messaging
Beyond messaging
 
OMG DDS Interoperability Demo 2009
OMG DDS Interoperability Demo 2009OMG DDS Interoperability Demo 2009
OMG DDS Interoperability Demo 2009
 
Distributed Algorithms with DDS
Distributed Algorithms with DDSDistributed Algorithms with DDS
Distributed Algorithms with DDS
 
SimD
SimDSimD
SimD
 
Component Based DDS with C++11 and R2DDS
Component Based DDS with C++11 and R2DDSComponent Based DDS with C++11 and R2DDS
Component Based DDS with C++11 and R2DDS
 
Reactive Data Centric Architectures with DDS
Reactive Data Centric Architectures with DDSReactive Data Centric Architectures with DDS
Reactive Data Centric Architectures with DDS
 
OMG DDS and its Relation to Unmanned Vehicle Interoperability
OMG DDS and its Relation to Unmanned Vehicle InteroperabilityOMG DDS and its Relation to Unmanned Vehicle Interoperability
OMG DDS and its Relation to Unmanned Vehicle Interoperability
 

More from Angelo Corsaro

More from Angelo Corsaro (20)

Zenoh: The Genesis
Zenoh: The GenesisZenoh: The Genesis
Zenoh: The Genesis
 
zenoh: The Edge Data Fabric
zenoh: The Edge Data Fabriczenoh: The Edge Data Fabric
zenoh: The Edge Data Fabric
 
Zenoh Tutorial
Zenoh TutorialZenoh Tutorial
Zenoh Tutorial
 
Data Decentralisation: Efficiency, Privacy and Fair Monetisation
Data Decentralisation: Efficiency, Privacy and Fair MonetisationData Decentralisation: Efficiency, Privacy and Fair Monetisation
Data Decentralisation: Efficiency, Privacy and Fair Monetisation
 
zenoh: zero overhead pub/sub store/query compute
zenoh: zero overhead pub/sub store/query computezenoh: zero overhead pub/sub store/query compute
zenoh: zero overhead pub/sub store/query compute
 
zenoh -- the ZEro Network OverHead protocol
zenoh -- the ZEro Network OverHead protocolzenoh -- the ZEro Network OverHead protocol
zenoh -- the ZEro Network OverHead protocol
 
zenoh -- the ZEro Network OverHead protocol
zenoh -- the ZEro Network OverHead protocolzenoh -- the ZEro Network OverHead protocol
zenoh -- the ZEro Network OverHead protocol
 
Breaking the Edge -- A Journey Through Cloud, Edge and Fog Computing
Breaking the Edge -- A Journey Through Cloud, Edge and Fog ComputingBreaking the Edge -- A Journey Through Cloud, Edge and Fog Computing
Breaking the Edge -- A Journey Through Cloud, Edge and Fog Computing
 
Eastern Sicily
Eastern SicilyEastern Sicily
Eastern Sicily
 
fog05: The Fog Computing Infrastructure
fog05: The Fog Computing Infrastructurefog05: The Fog Computing Infrastructure
fog05: The Fog Computing Infrastructure
 
fog05: The Fog Computing Platform
fog05: The Fog Computing Platformfog05: The Fog Computing Platform
fog05: The Fog Computing Platform
 
Programming in Scala - Lecture Four
Programming in Scala - Lecture FourProgramming in Scala - Lecture Four
Programming in Scala - Lecture Four
 
Programming in Scala - Lecture Three
Programming in Scala - Lecture ThreeProgramming in Scala - Lecture Three
Programming in Scala - Lecture Three
 
Programming in Scala - Lecture Two
Programming in Scala - Lecture TwoProgramming in Scala - Lecture Two
Programming in Scala - Lecture Two
 
Programming in Scala - Lecture One
Programming in Scala - Lecture OneProgramming in Scala - Lecture One
Programming in Scala - Lecture One
 
Data Sharing in Extremely Resource Constrained Envionrments
Data Sharing in Extremely Resource Constrained EnvionrmentsData Sharing in Extremely Resource Constrained Envionrments
Data Sharing in Extremely Resource Constrained Envionrments
 
Vortex II -- The Industrial IoT Connectivity Standard
Vortex II -- The  Industrial IoT  Connectivity StandardVortex II -- The  Industrial IoT  Connectivity Standard
Vortex II -- The Industrial IoT Connectivity Standard
 
Fog Computing Defined
Fog Computing DefinedFog Computing Defined
Fog Computing Defined
 
DDS and OPC UA Explained
DDS and OPC UA ExplainedDDS and OPC UA Explained
DDS and OPC UA Explained
 
The Cloudy, Foggy and Misty Internet of Things -- Toward Fluid IoT Architect...
The Cloudy, Foggy and Misty Internet of Things --  Toward Fluid IoT Architect...The Cloudy, Foggy and Misty Internet of Things --  Toward Fluid IoT Architect...
The Cloudy, Foggy and Misty Internet of Things -- Toward Fluid IoT Architect...
 

Recently uploaded

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Recently uploaded (20)

Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 

The DDS Tutorial - Part I

  • 1. OpenSplice DDS Delivering Performance, Openness, and Freedom The DDS Tutorial Angelo Corsaro, Ph.D. Chief Technology Officer OMG DDS SIG Co-Chair angelo.corsaro@prismtech.com ::Part I
  • 2. Addressing Data Distribution Challenges DDS is standard designed to address the data-distribution challenges across a wide class of Defense and Aerospace Applications The OMG DDS Standard ‣ Introduced in 2004, DDS is a standard for Real-Time, Dependable and High- Performance Publish/Subscribe ‣ DDS behaviour and semantics can be controlled via a rich set of QoS Policies ‣ DDS is today recommended by key administration worldwide and widely adopted across several different application domains, such as, Automated Trading, Simulations, SCADA, Telemetry, etc. © 2009, PrismTech. All Rights Reserved
  • 3. The OMG Data Distribution Service (DDS) DDS v1.2 API Standard ‣ Language Independent, OS and HW architecture Application independent Object/Relational Mapping ‣ DCPS. Standard API for Data-Centric, Topic- Data Local Reconstruction Layer (DLRL) Based, Real-Time Publish/Subscribe Content ‣ DLRL. Standard API for creating Object Views out Ownership Durability Subscription of collection of Topics Minimum Profile Data Centric Publish/Subscribe (DCPS) DDSI/RTPS v2.1 Wire Protocol Standard ‣ Standard wire protocol allowing interoperability Real-Time Publish/Subscribe Protocol between different implementations of the DDS DDS Interoperability Wire Protocol standard UDP/IP ‣ Interoperability demonstrated among key DDS vendors in March 2009 © 2009, PrismTech. All Rights Reserved
  • 4. Tutorial Scope Scope & Goals ‣ The Tutorial will cover the DCPS layer of DDS Application ‣ It will give you enough details and examples Object/Relational Mapping to make sure that you can get started Data Local Reconstruction Layer (DLRL) writing DDS applications Content Ownership Durability Subscription Software ‣ OpenSplice DDS Minimum Profile Data Centric Publish/Subscribe (DCPS) ‣ http://www.opensplice.org Real-Time Publish/Subscribe Protocol ‣ SIMple Dds (SIMD) DDS Interoperability Wire Protocol ‣http://code.google.com/p/simd-cxx UDP/IP Prerequisite ‣ Basic C++ understanding © 2009, PrismTech. All Rights Reserved
  • 5. OpenSplice DDS Delivering Performance, Openness, and Freedom Your will learn: - What is a Topic - How to define Topic Types - How to register a Topic Step I Defining the Data
  • 6. Topics Topic ‣ Unit of information atomically exchanged between Publisher and Subscribers. ‣ An association between a unique name, a type and a QoS setting © 2009, PrismTech. All Rights Reserved
  • 7. Topic Types A DDS Topic Type is described by an IDL Structure containing an arbitrary number for fields whose types might be: ‣ IDL primitive types, e.g., octet, short, long, float, string (bound/unbound), etc. ‣ Enumeration ‣ Union ‣ Sequence (bounded or unbounded) ‣ Array ‣ Structure (nested) © 2009, PrismTech. All Rights Reserved
  • 8. Examples struct HelloTopicType { enum TemperatureScale { string message; CELSIUS, }; FAHRENHEIT, struct ShapeType { KELVIN long x; }; long y; long shapesize; struct TempSensorType { struct PingType string color; short id; { }; float temp; long counter; float hum; string<32> vendor; TemperatureScale scale; }; }; struct Counter { long cID; long count; }; © 2009, PrismTech. All Rights Reserved
  • 9. Topic Types & Keys ‣ Each Topic Type has to define its key-set (which might be the empty set) ‣ There are no limitations on the number of attributes used to represent a key ‣ Keys can be top-level attributes as well as nested-attributes (i.e. attributes in nested structures) © 2009, PrismTech. All Rights Reserved
  • 10. Key Examples -- Empty Key-Set struct PingType struct HelloTopicType { { string message; long counter; }; string<32> vendor; #pragma keylist HelloTopicType }; #pragma keylist PingType © 2009, PrismTech. All Rights Reserved
  • 11. Key Examples -- User-Defined Keys enum TemperatureScale { CELSIUS, FAHRENHEIT, struct ShapeType { KELVIN long x; }; long y; long shapesize; struct TempSensorType { string color; short id; }; short roomid; #pragma keylist ShapeType color float temp; float hum; TemperatureScale scale; struct Counter { }; long cID; #pragma keylist TempSensorType id roomid long count; }; #pragma keylist Counter cID © 2009, PrismTech. All Rights Reserved
  • 12. Topic Keys Gotchas ‣ Keys are used to identify specific data “instances” ‣ It we want to make a parallel with OO then we could say that: ‣ Keyless Topic as singletons, e.g. there is only one instance! ‣ Keyed Topics identify a class of instances. Each instance is identified by a key value ‣ Think at each different key value as really instantiating a new “object” in your system. That will avoid making mistakes in your keys assignment ‣ Never do something like this: struct Counter { long cID; long count; }; #pragma keylist Counter count ... As it will create a new topic instance for each ping you send thus consuming an unbounded amount of resources! © 2009, PrismTech. All Rights Reserved
  • 13. Compiling Topic Types ‣ Topic types have to be compiled with the DDS-provided IDL compiler ‣ The compilation process will take care of generating code for ‣ Strongly typed Reader and Writers ‣ Type Serialization ‣ When compiling a target language should be chosen, such as C/C++/Java/C# ‣ Example: $ idlpp -S -l cpp -d gencxx ShapeType.idl $ idlpp -S -l java -d genjava ShapeType.idl Standalone mode Target Language Target Directory Target File © 2009, PrismTech. All Rights Reserved
  • 14. IDL Compilation in SIMD ‣ SIMD provides a template makefile that you can use to compile your IDL files. ‣ The default language is C++ (as SIMD currently supports only C++) Makefile.idl #-*-Makefile-*- include $(SIMD_HOME)/config/apps/Macros-idl.GNU TARGET_IDL=ShapeType.idl include $(SIMD_HOME)/config/apps/Rules-idl.GNU © 2009, PrismTech. All Rights Reserved
  • 15. Putting it all Together Circle struct ShapeType { long x; long y; long shapesize; Topic QoS string color; }; #pragma keylist ShapeType color © 2009, PrismTech. All Rights Reserved
  • 16. Registering Topics with SIMD ‣ SIMD provides several constructors that allow to register a topic: Topic(const std::string& name); Topic(const std::string& name, const TopicQos& qos); Topic(const std::string& name, const std::string& type_name); Topic(const std::string& name, const std::string& type_name, const TopicQos& qos); © 2009, PrismTech. All Rights Reserved
  • 17. Registering the Circle Topic Circle struct ShapeType { long x; long y; long shapesize; Default Topic QoS string color; }; #pragma keylist ShapeType color dds::Topic<ShapeType> shape(“Circle”); © 2009, PrismTech. All Rights Reserved
  • 18. Topic Registration Gotchas ‣ Topics registration is idempotent as far as you register the topic in the same way from various applications. ‣ It is an error to try to register a topic with the same name but a different type. ‣ Example: Application 1 Application 2 dds::Topic<ShapeType> shape(“Circle”); dds::Topic<ShapeType> shape(“Circle”); OK dds::Topic<ShapeType> shape(“Circle”); dds::Topic<AnotherType> shape(“Circle”); Errror © 2009, PrismTech. All Rights Reserved
  • 19. OpenSplice DDS Delivering Performance, Openness, and Freedom Your will learn: - What are DDS Partitions - How to partitions work Step II Defining the Scope
  • 20. Domains and Partitions Domain Domain ‣ A Domain is one instance of the DDS Global Data Space ‣ DDS entities always belong to a specific domain Partition ‣ A partition is a scoping mechanism provided by DDS organize a partition DDS Global Data Space Partition © 2009, PrismTech. All Rights Reserved
  • 21. More about Partitions ‣ Each partition is identified by a string, such as “sensor-data”, “log-data” etc. ‣ Read/Write access to a partition is gained by means of DDS Publisher/Subscribers ‣ Each Publisher/Subscriber can be provided with a list of Partitions name, which might as well include wildcards ,or DDS generic regular expression, Global Data Space Partition such as “*-data” © 2009, PrismTech. All Rights Reserved
  • 22. Partition as Namespaces ‣ Although DDS does not support explicit nesting of partitions, a powerful way of organizing your data is by always using a hierarchical “dotted” notation to describe them. ‣ For instance, for a building in which you are deploying the new temperature control system you might use a scheme such as “building.floor-level.room-number” for scoping the data that flows in each room. ‣ building.floor-2.room-10 ‣ building.floor-3.room-15 ‣ In this way, accessing the data for a specific floor can be done by using the partition expression “building.floor-2.*” ‣ While the data for all the building is available via “building.*” © 2009, PrismTech. All Rights Reserved
  • 23. Emulating Partition Nesting “building.floor-1.*” “building” “building.floor-1” “building.floor-1.room-1” ... “building.floor-N” “building.floor-1.room-2” “building.floor-N.room-1” “building.floor-N.room-2” ... “building.floor-2” “building.floor-2.room-1” ... “building.floor-2.room-2” ... © 2009, PrismTech. All Rights Reserved
  • 24. Connecting to Partitions in SIMD ‣ SIMD provides two ways of connecting to partitions. ‣ A simple one is to bound the full runtime to a partition expression by passing a string to the Runtime class at construction time ‣ The other is to configure a specific Publisher/Subscriber with the relevant list of partitions Runtime(); Runtime(const std::string& partition); Runtime(const std::string& partition, const std::string& domain); Publisher(const std::string& partition); Publisher(const std::string& partition, ::dds::DomainParticipant dp); Publisher(const ::dds::PublisherQos& qos, ::dds::DomainParticipant dp); Subscriber(const std::string& partition); Subscriber(const std::string& partition, ::dds::DomainParticipant dp); Subscriber(const ::dds::SubscriberQos& qos, ::dds::DomainParticipant dp); © 2009, PrismTech. All Rights Reserved
  • 25. OpenSplice DDS Delivering Performance, Openness, and Freedom Your will learn: - What is a Data Writer - How to Create a Data Writer - How to write Data Step III Producing the Data
  • 26. Writing Data in SIMD ‣ Writing data with SIMD takes two steps. ‣ First you have to create the DataWriter by using the proper constructor (this depends on the level of customization you require) ‣ Then, you’ll have to decide how you want to write the data © 2009, PrismTech. All Rights Reserved
  • 27. Creating a DataWriter ‣ SIMD provides different DataWriter constructors allowing to control the level of customization required for the specific writer template <typename T> class dds::pub::DataWriter : public dds::core::Entity { public: DataWriter(); DataWriter(Topic<T> topic) DataWriter(Topic<T> topic, const DataWriterQos& qos) DataWriter(Topic<T> topic, const DataWriterQos& qos, Publisher pub); // ... }; © 2009, PrismTech. All Rights Reserved
  • 28. Writing Data with SIMD ‣ SIMD provides two generic writes as well as a method for creating a writer dedicated to a specific instance ‣ The DataInstanceWriter provides constant time writes as it does not need to look-up the key-fields DDS::ReturnCode_t write(const T& sample); DDS::ReturnCode_t write(const T& sample, const DDS::Time_t& timestamp); DataInstanceWriter<T> register_instance(const T& key); © 2009, PrismTech. All Rights Reserved
  • 29. Writing “Circling” Circle Samples © 2009, PrismTech. All Rights Reserved
  • 30. OpenSplice DDS Delivering Performance, Openness, and Freedom Your will learn: - Reading vs Taking data - Sample State - How to Create a Data Reader - How to read/take data Step IV Consuming Data
  • 31. Reading Samples ‣ Read iterates over the available sample instances ‣ 1 1 1 2 1 3 1 4 Samples are not removed 2 1 2 2 2 3 DataReader from the local cache as Proprietary Information - Distribution without Expressed Written Permission is Prohibited. 3 1 3 2 3 3 3 4 3 5 result of a read Topic ‣ Read samples can be read again, by accessing the Samples Read Samples not Read cache with the proper options (more later) DataReader Cache struct Counter { int cID; int count; }; #pragma keylist Counter cID © 2009, PrismTech. All Rights Reserved
  • 32. Reading Samples ‣ Read iterates over the available sample instances 1 1 1 2 1 3 1 4 ‣ Samples are not removed 2 1 2 2 2 3 from the local cache as DataReader Proprietary Information - Distribution without Expressed Written Permission is Prohibited. 3 1 3 2 3 3 3 4 3 5 result of a read ‣ Read samples can be read Topic again, by accessing the Samples Read Samples not Read cache with the proper options (more later) DataReader Cache struct Counter { int cID; int count; }; #pragma keylist Counter cID © 2009, PrismTech. All Rights Reserved
  • 33. Reading Samples ‣ Read iterates over the available sample instances 1 1 1 2 1 3 1 4 ‣ Samples are not removed 2 1 2 2 2 3 from the local cache as DataReader Proprietary Information - Distribution without Expressed Written Permission is Prohibited. 3 1 3 2 3 3 3 4 3 5 result of a read ‣ Read samples can be read Topic again, by accessing the Samples Read Samples not Read cache with the proper options (more later) DataReader Cache struct Counter { int cID; int count; }; #pragma keylist Counter cID © 2009, PrismTech. All Rights Reserved
  • 34. Taking Samples ‣ Take iterates over the available sample instances 1 1 1 2 1 3 1 4 ‣ Taken Samples are 2 1 2 2 2 3 removed from the local DataReader Proprietary Information - Distribution without Expressed Written Permission is Prohibited. 3 4 3 5 cache as result of a take 3 1 3 2 3 3 ‣ Topic Samples not Taken DataReader Cache struct Counter { int cID; int count; }; #pragma keylist Counter cID © 2009, PrismTech. All Rights Reserved
  • 35. Taking Samples ‣ Take iterates over the available sample instances 1 2 1 3 1 4 ‣ Taken Samples are 2 2 2 3 removed from the local DataReader Proprietary Information - Distribution without Expressed Written Permission is Prohibited. 3 2 3 3 3 4 3 5 cache as result of a take Topic Samples not Taken DataReader Cache struct Counter { int cID; int count; }; #pragma keylist Counter cID © 2009, PrismTech. All Rights Reserved
  • 36. Taking Samples ‣ Take iterates over the available sample instances 1 3 1 4 ‣ Taken Samples are 2 3 removed from the local DataReader Proprietary Information - Distribution without Expressed Written Permission is Prohibited. 3 3 3 4 3 5 cache as result of a take Topic Samples not Taken DataReader Cache struct Counter { int cID; int count; }; #pragma keylist Counter cID © 2009, PrismTech. All Rights Reserved
  • 37. Sample, Instance and View States History Depth = 2 ‣ Along with data samples, DataReaders are provided 1 1 with state information allowing to detect relevant 2 2 transitions in the life-cycle of data as well as data 3 writers DataReader Proprietary Information - Distribution without Expressed Written Permission is Prohibited. SampleInfo ‣ Sample State (READ | NOT_READ): Determines wether a sample has already been read by this 1 1 1 2 DataReader or not. 2 2 2 3 ‣ Instance State (ALIVE, NOT_ALIVE, DISPOSED). 3 1 Determines wether (1) writer exist for the specific Samples instance, or (2) no matched writers are currently Topic available, or (3) the instance has been disposed DataReader Cache ‣ View State (NEW, NOT_NEW). Determines wether this is the first sample of a new (or re-born) instance © 2009, PrismTech. All Rights Reserved
  • 38. Application / DDS Coordination DDS provides three main mechanism for exchanging information with the application ‣ Polling. The application polls from time to time for new data or status changes. The interval might depend on the kind of applications as well as data Proprietary Information - Distribution without Expressed Written Permission is Prohibited. ‣ WaitSets. The application registers a WaitSet with DDS and waits (i.e. is suspended) until one of the specified events has happened. ‣ Listeners. The application registers a listener with a specific DDS entity to be notified when relevant events occur, such as state changes or © 2009, PrismTech. All Rights Reserved
  • 39. Reading Data with SIMD /** * Reads all new samples from any view state and alive instances. Notice * that this call is intended to loan the <code>samples</code> as * well as the <conde>infos</code> containers, thus will require a * return_loan. */ DDS::ReturnCode_t read(TSeq& samples, DDS::SampleInfoSeq& infos) /** * Reads at most <code>max_samples</code> samples that have not been Proprietary Information - Distribution without Expressed Written Permission is Prohibited. * read yet from all vies and alive instances. */ DDS::ReturnCode_t read(TSeq& samples, long max_samples) /** * Most generic <code>read</code> exposing all the knobs provided by * the OMG DDS API. */ DDS::ReturnCode_t read(TSeq& samples, DDS::SampleInfoSeq& infos,long max_samples, DDS::SampleStateMask samples_state, DDS::ViewStateMask views_state, DDS::InstanceStateMask instances_state) DDS::ReturnCode_t return_loan(TSeq& samples, DDS::SampleInfoSeq& infos); © 2009, PrismTech. All Rights Reserved
  • 40. Taking Data with SIMD /** * Reads all new samples from any view state and alive instances. Notice * that this call is intended to loan the <code>samples</code> as * well as the <conde>infos</code> containers, thus will require a * return_loan. */ DDS::ReturnCode_t take(TSeq& samples, DDS::SampleInfoSeq& infos) /** Proprietary Information - Distribution without Expressed Written Permission is Prohibited. * Reads at most <code>max_samples</code> samples that have not been * read yet from all vies and alive instances. */ DDS::ReturnCode_t take(TSeq& samples, long max_samples) /** * Most generic <code>read</code> exposing all the knobs provided by * the OMG DDS API. */ DDS::ReturnCode_t take(TSeq& samples, DDS::SampleInfoSeq& infos,long max_samples, DDS::SampleStateMask samples_state, DDS::ViewStateMask views_state, DDS::InstanceStateMask instances_state) © 2009, PrismTech. All Rights Reserved
  • 41. WaitSets in SIMD ‣ SIMD provides a strongly typed WaitSet that supports automatic dispatching to functors ‣ The best way of understanding SIMD waitsets is to look at an example: Proprietary Information - Distribution without Expressed Written Permission is Prohibited. © 2009, PrismTech. All Rights Reserved
  • 42. Listeners in SIMD ‣ SIMD provides a strongly typed Listeners based on the Signals/Slots patterns Proprietary Information - Distribution without Expressed Written Permission is Prohibited. ‣ The best way of understanding SIMD Listeners is to look at an example... © 2009, PrismTech. All Rights Reserved
  • 43.
  • 44. OpenSplice DDS Delivering Performance, Openness, and Freedom Step V Compile and Run...
  • 45. What You’ve Learned today ‣ Defining Topics and Topic Types ‣ Scoping Information with Partitions ‣ Writing Data ‣ Reading (Taking) data with Waitsets and Listeners ‣ Writing an example that demonstrate all of the above © 2009, PrismTech. All Rights Reserved
  • 46. What I’ll Cover Next Time ‣ Content Filtered Topics and Queries ‣ QoS and the Request vs. Offered Model ‣ Setting QoS on DDS Entities ‣ Tuning OpenSplice DDS Configuration © 2009, PrismTech. All Rights Reserved
  • 47. Online Resources http://www.opensplice.com/ http://www.slideshare.net/angelo.corsaro emailto:opensplicedds@prismtech.com http://bit.ly/1Sreg http://twitter.com/acorsaro/ http://opensplice.blogspot.com http://www.youtube.com/OpenSpliceTube © 2009, PrismTech. All Rights Reserved