Distributed Simulations with DDS and HLA

Preview:

DESCRIPTION

The OMG DDS (Data Distribution Service) is a standard for datadistribution which is widely used as the foundation for operationalsystems such as air traffic control and management, combat systems,distributed telemetry and control, etc. On the other hand, HLA (HighLevel Architecture) is a communication and coordination standard whichis widely adopted in the distributed simulation community.DDS is increasingly gaining adoption in distributed simulation,especially for those systems that require high throughput, lowlatencies and scalability. In addition, the use of DDS in simulationprovides native interoperability between operational and simulatedsystems, thus eliminating integration overhead and complexities.This presentation introduces DDS and HLA, provide an apple-to-applecomparison between the two standards and show how DDS and HLA systemscan be seamlessly integrated together.

Citation preview

Ope

nSpl

ice

DD

S

Distributed Simulationswith DDS and HLA

Angelo CORSARO, Ph.D.Chief Technology Officer OMG DDS Sig Co-Chair

PrismTechangelo.corsaro@prismtech.com

José-Ramón Martínez-Salio Technical Sales Engineers Director

NADSjrmartinez@nexteleng.es

Copyrig

ht  2011,  PrismTech  –    A

ll  Rights  Reserved.

Ope

nSpl

ice

DD

S

Context

☐ DDS is increasingly being adopted in simulation applications either side-by-side with HLA or as a replacement

☐ This webcast provides an objective comparison of DDS and HLA allowing attendees to understand the value that each of these technologies can bring

Ope

nSpl

ice

DD

S

Genesis

Copyrig

ht  2011,  PrismTech  –    A

ll  Rights  Reserved.

Ope

nSpl

ice

DD

S

DDS and HLA Goals

☐ Foster interoperability and portability of Distributed Operational Systems

☐ Address functional and non-functional requirements of Operational Systems

☐ Foster interoperability and portability of Distributed Simulation Systems

☐ Address functional requirements and (some) non functional requirements of Simulation Systems

DDS HLA

Copyrig

ht  2011,  PrismTech  –    A

ll  Rights  Reserved.

Ope

nSpl

ice

DD

S

Standard Scope

☐ DDS and HLA define standardized ways of describing application Data.

Ownership Durability Content Subscription

Minimum Profile

Data Centric Publish Subscriber (DCPS)

DDS Interoperability Wire Protocol - DDSI-RTPS

Application

ApplicationUDP/IP

Run-Time Infrastructure (RTI)

Federate

Federation Management

Object Managenent

Time Management

Declaration Management

OwnershipManagement

Data DistributionManagement

DDS HLA

Copyrig

ht  2011,  PrismTech  –    A

ll  Rights  Reserved.

Ope

nSpl

ice

DD

S

Standardization History

2004

DDS v1.0Dec

19971996 1998 1999 2000 2001 2003

HLA HLA v1.3 HLA IEEE 1516

2005 20072006 2008 2009 2010

DDS v1.1 DDS v1.2Dec Jan

DDS-XTopicsMarch

DDSI v2.0Apr

DDSI v2.1Jan

DDS4CCMUML4DDS

2011

DDS-ISO-C++

Dec

DDS-ISO-Java

2012

Sep

DDS-Security

DDS-TCP/IP

DDS-RMI

HLA Evolved

Copyrig

ht  2011,  PrismTech  –    A

ll  Rights  Reserved.

Ope

nSpl

ice

DD

S

Similarities and Differences[DDS/HLA ]

DDS HLA

API Standard Yes Yes

Wire Protocol Standard Yes No (essentially underspecified)

Data Modeling Standard Yes (IDL, XML, XSD, UML) Yes (OMT, XML)

Discovery Fully Dynamic Static Declaration of FOMDynamic Matching Pub/Sub

Architectural Style Fully DistributedImplementation Dependent

(Most implementation have a centralized broker)

Copyrig

ht  2011,  PrismTech  –    A

ll  Rights  Reserved.

Ope

nSpl

ice

DD

S

Similarities and Differences[DDS/HLA ]

DDS HLA

Subscription Model Per Topic with Content Filters and Queries

Per Object Attribute Per Interaction

QoS 22 QoS Policies 2 QoS Policies (Reliability and Ordering)

Coupling‣ No dependency on global

knowledge‣ Time decoupling

‣ Dependency on globally defined FOM‣ Time coupling

Time Management ‣ Basic Timestamping ‣ Sophisticated time management service

Copyrig

ht  2011,  PrismTech  –    A

ll  Rights  Reserved.

Ope

nSpl

ice

DD

S

DDS in Defense and Aerospace

Integrated Modular Vetronics Training & Simulation Systems Naval Combat Systems

Air Traffic Control & Management Unmanned Air Vehicles Aerospace Applications

Copyrig

ht  2011,  PrismTech  –    A

ll  Rights  Reserved.

Ope

nSpl

ice

DD

S

DDS in Commercial Applications

Agricultural Vehicle Systems

Train Control Systems Complex Medical Devices

Smart CitiesLarge Scale SCADA Systems

High Frequency Auto-Trading

Ope

nSpl

ice

DD

S

DDS and HLA Fundamentals

Copyrig

ht  2011,  PrismTech  –    A

ll  Rights  Reserved.

Ope

nSpl

ice

DD

S

Data Distribution Service

☐ Topics: data distribution subject’s

☐ DataWriters: data producers

☐ DataReaders: data consumers

DDS provides a Topic-Based Publish/Subscribe abstraction based on:

DDS Global Data Space

...

TopicA

TopicBTopicC

TopicD

Data Writer

Data Writer

Data Writer

Data Writer

Data Reader

Data Reader

Data Reader

Data Reader

For Real-Time Systems

Copyrig

ht  2011,  PrismTech  –    A

ll  Rights  Reserved.

Ope

nSpl

ice

DD

S

Data Distribution Service

☐ DataWriters and DataReaders are automatically and dynamically matched by the DDS Dynamic Discovery

☐ A rich set of QoS allows the control existential, temporal, and spatial properties of data

DDS Global Data Space

...

TopicA

TopicBTopicC

TopicD

Data Writer

Data Writer

Data Writer

Data Writer

Data Reader

Data Reader

Data Reader

Data Reader

For Real-Time Systems

Copyrig

ht  2011,  PrismTech  –    A

ll  Rights  Reserved.

Ope

nSpl

ice

DD

S

HLA Federation☐ An HLA Federation is a collection of Federates (essentially HLA applications)

sharing a common Federation Object Model (FOM)

☐ Each Federate can publish/subscribe a subset Objects Attributes and Interactions defined by the Federation FOM.

RTI (Run-Time Infrastructure)

Federate A Federate B Federate K...Federation Object Model<FOM> <Shared object classes> <Shared interaction classes> <More></FOM>

Copyrig

ht  2011,  PrismTech  –    A

ll  Rights  Reserved.

Ope

nSpl

ice

DD

S

DDS Topics☐ A Topic defines a class of streams

☐ A Topic has associated a unique name, a user defined extensible type and a set of QoS policies

☐ QoS Policies capture the Topic non-functional invariants

☐ Topics can be discovered or locally defined

DURABILITY,DEADLINE,PRIORITY,

“Circle”, “Square”, “Triangle”, ...

TopicTypeName

QoS

ShapeType

struct ShapeType { @Key string color; long x; long y; long shapesize;};

Copyrig

ht  2011,  PrismTech  –    A

ll  Rights  Reserved.

Ope

nSpl

ice

DD

S

Instances and Samples

DURABILITY,DEADLINE,PRIORITY,

“Circle”, “Square”, “Triangle”, ...

TopicTypeName

QoS

ShapeType

struct ShapeType { @Key string color; long x; long y; long shapesize;};

Copyrig

ht  2011,  PrismTech  –    A

ll  Rights  Reserved.

Ope

nSpl

ice

DD

S

HLA Objects

☐ HLA Objects identify a class of instances whose attributes can be individually published/subscribed

☐ QoS are controlled at an attribute-level

(objects (class Shape (attribute color reliable timestamp ShapeSpace) (attribute x best_effort timestamp ShapeSpace) (attribute y best_effort timestamp ShapeSpace) (attribute shapesize reliable timestamp ShapeSpace) ) )

☐ Object attributes can be bound to spaces and dimensions to organize/partition the data distribution

Copyrig

ht  2011,  PrismTech  –    A

ll  Rights  Reserved.

Ope

nSpl

ice

DD

S

HLA Interactions

☐ HLA Interactions are used to model consumable events

☐ Interactions are published/subscribed as atomically

☐ QoS is attached with the interaciton

(interactions (class ShapeCollision reliable timestamp ShapeSpace (attribute x) (attribute y) ) )

Copyrig

ht  2011,  PrismTech  –    A

ll  Rights  Reserved.

Ope

nSpl

ice

DD

S

DDS HLAPolymorphism

☐ HLA provides supports for traditional subtype polymorphism as supported in declarative nominal type systems

☐ HLA supports only single inheritance

☐ This means that a subscription for a type X matches a publication for a type Y iff Y <: X

☐ DDS is equipped with a structural type system where subtype relationships are deduced based on type properties as opposed to syntactical declaration

☐ This means that a subscription for a type X matches a publication for a type Y iff Y <: X (the subtype property is antisymmetric, reflexive, and transitive)

Copyrig

ht  2011,  PrismTech  –    A

ll  Rights  Reserved.

Ope

nSpl

ice

DD

S DDS HLA

Polymorphism

☐ Point3D <: Point

☐ GPoint <: Point3D

x: longy: long

Point

z: longPoint3D

x: longy: longz: longt: long

GPoint

☐ Point3D <: Point

Copyrig

ht  2011,  PrismTech  –    A

ll  Rights  Reserved.

Ope

nSpl

ice

DD

S

Anatomy of a DDS ApplicationDomain (e.g. Domain 123)

Domain Participant

Topic

Publisher

DataWrter

Subscriber

DataReader

Partition (e.g. “Telemetry”, “Shapes”, )

Topic Instances/Samples

TaTb

Tc

Tx

Ty

T1

T1 T3

Copyrig

ht  2011,  PrismTech  –    A

ll  Rights  Reserved.

Ope

nSpl

ice

DD

S

Federate

Federation

Spaces

Anatomy of a HLA Application

AmbassadorX.a

X.b IY.c

Y.dJ

K

Copyrig

ht  2011,  PrismTech  –    A

ll  Rights  Reserved.

Ope

nSpl

ice

DD

S

Data Selection

☐ Pub/Sub granularity is the Topic

☐ Data can be organized into Partitions. Partitions matching is based on regular expression

☐ Content Filters and Queries can be used to select the data that is received

☐ Pub/Sub granularity are attributes for Object and the whole class for an Interaction

☐ Data can be organized in Spaces and Dimensions

DDS HLA

Copyrig

ht  2011,  PrismTech  –    A

ll  Rights  Reserved.

Ope

nSpl

ice

DD

S

DDS Partitions Matching☐ DDS Publishers and

Subscribers can specify a list of regular expressions representing the partitions to join

☐ Actual partition can be any string, but some structure can be given in order mimic hierarchy

M:0:0 M:0:1 M:0:2

M:1:0 M:1:1 M:1:2

M:2:0 M:2:1 M:2:2

Domain

Partitions

Copyrig

ht  2011,  PrismTech  –    A

ll  Rights  Reserved.

Ope

nSpl

ice

DD

S

M:0:0 M:0:1 M:0:2

M:1:0 M:1:1 M:1:2

M:2:0 M:2:1 M:2:2

Domain

Partitions

DDS Partitions Matching

M:0:*

Copyrig

ht  2011,  PrismTech  –    A

ll  Rights  Reserved.

Ope

nSpl

ice

DD

S

M:0:0 M:0:1 M:0:2

M:1:0 M:1:1 M:1:2

M:2:0 M:2:1 M:2:2

Domain

Partitions

DDS Partitions Matching

M:*:2

Copyrig

ht  2011,  PrismTech  –    A

ll  Rights  Reserved.

Ope

nSpl

ice

DD

S

M:0:0 M:0:1 M:0:2

M:1:0 M:1:1 M:1:2

M:2:0 M:2:1 M:2:2

Domain

Partitions

DDS Partitions Matching

M:0:0, M:1:1, M:2:2

Copyrig

ht  2011,  PrismTech  –    A

ll  Rights  Reserved.

Ope

nSpl

ice

DD

S

Anatomy of a DDS Application

Domain

Reader/Writers for User Defined for Types

Session

// Create a DataWriter/DataWriterauto writer = DataWriter<ShapeType>(pub, topic);auto reader = DataReader<ShapeType>(sub, topic);

Reader/Writer for application defined

Topic Types

Domain Participant

Publisher

DataWriter

Topic Subscriber

DataReader

[DDS C++ API 2010]

auto dp = DomainParticipant(domainId);

// Create a Topicauto topic = Topic<ShapeType>(dp, “Circle”)// Create a Publisher / Subscriberauto pub = Publisher(dp)auto sub = Subscriber(dp)

Copyrig

ht  2011,  PrismTech  –    A

ll  Rights  Reserved.

Ope

nSpl

ice

DD

S

Anatomy of a DDS Application

Domain

Reader/Writers for User Defined for Types

Session

Reader/Writer for application defined

Topic Types

Domain Participant

Publisher

DataWriter

Topic Subscriber

DataReader

[DDS C++ API 2010]

auto dp = DomainParticipant(domainId);

// Create a Topicauto topic = Topic<ShapeType>(dp, “Circle”)// Create a Publisher / Subscriberauto pub = Publisher(dp)auto sub = Subscriber(dp)

// Write datawriter.write(ShapeType(“RED”, 131, 107, 89));// But you can also write like this...writer << ShapeType(“RED”, 131, 107, 89);

// Read new data (loaned)auto data = reader.read();

Copyrig

ht  2011,  PrismTech  –    A

ll  Rights  Reserved.

Ope

nSpl

ice

DD

S

Anatomy of an HLA Applicationusing namespace std;

int main( int argc, char *argv[] ) { // 1. create the RTIambassador that we are going to work with RTI::RTIambassador* rtiamb = 0; rtiamb = new RTI::RTIambassador(); // 2. create the federation execution rtiamb->createFederationExecution( "exampleFederation", "testfom.fed" ); cout << "Created federation" << endl; // 3. join the federation execution RTI::FederateAmbassador* fedamb = new MyFedAmb(); rtiamb->joinFederationExecution( "myFederate", "exampleFederation", fedamb ); cout << "Joined federation" << endl; // Pub/Sub...

// 4. resign from the federation execution rtiamb->resignFederationExecution( RTI::DELETE_OBJECTS_AND_RELEASE_ATTRIBUTES ); cout << "Resigned from federation" << endl; // 5. destroy the federation execution rtiamb->destroyFederationExecution( "exampleFederation" ); cout << "Destroyed federation" << endl; // 6. do some cleanup and exit delete rtiamb; return 0; }

Federation

Federate

Ope

nSpl

ice

DD

S

QoS

Copyrig

ht  2011,  PrismTech  –    A

ll  Rights  Reserved.

Ope

nSpl

ice

DD

S

DDS QoS Model☐ QoS-Policies control local and

end-to-end properties of DDS entities

☐ Local properties controlled by QoS are related resource usage

☐ End-to-end properties controlled by QoS are related to temporal and spatial aspects of data distribution

☐ Some QoS-Policies are matched based on a Request vs. Offered Model thus QoS-enforcement

Publisher

DataWriter

Topic

Type

QoS

Name

writes

QoS

DataWriter

Topic

Typewrites

Subscriber

DataReaderreads

DataReaderreads

...

QoS

Name

QoS

QoS QoS

QoS matching

......

QoS QoS

Type Matching

DomainParticipant DomainParticipant

QoS QoS

Copyrig

ht  2011,  PrismTech  –    A

ll  Rights  Reserved.

Ope

nSpl

ice

DD

S

DDS QoS PoliciesQoS Policy Applicability RxO Modifiable

USER_DATATOPIC_DATA

GROUP_DATADURABILITYDURABILITY

SERVICEHISTORY

PRESENTATIONRELIABILITYPARTITION

DESTINATION ORDER

LIFESPAN

DP, DR, DW N Y

ConfigurationT N Y ConfigurationP, S N Y

Configuration

T, DR, DW Y N

Data AvailabilityT, DW N N

Data Availability

T, DR, DW N N

Data Availability

P, S Y N

Data Delivery

T, DR, DW Y N

Data DeliveryP, S N Y Data DeliveryT, DR, DW Y N

Data Delivery

T, DW N Y

Data Delivery

[T: Topic] [DR: DataReader] [DW: DataWriter] [P: Publisher] [S: Subscriber] [DP: Domain Participant]

Copyrig

ht  2011,  PrismTech  –    A

ll  Rights  Reserved.

Ope

nSpl

ice

DD

S

DDS QoS PoliciesQoS Policy Applicability RxO ModifiableDEADLINELATENCY BUDGET

TRANSPORT PRIORITY

TIME BASED FILTER

OWNERSHIPOWNERSHIP STRENGTHLIVELINESS

T, DR, DW Y Y

Temporal/Importance

Characteristics

T, DR, DW Y YTemporal/

Importance Characteristics

T, DW N YTemporal/

Importance Characteristics

DR N Y

Temporal/Importance

Characteristics

T, DR, DW Y NReplicationDW N Y Replication

T, DR, DW Y N Fault-Detection

[T: Topic] [DR: DataReader] [DW: DataWriter] [P: Publisher] [S: Subscriber] [DP: Domain Participant]

Copyrig

ht  2011,  PrismTech  –    A

ll  Rights  Reserved.

Ope

nSpl

ice

DD

S

Data Delivery

Data Delivery

Reliability

Presentation

Destination OrderPartition

Copyrig

ht  2011,  PrismTech  –    A

ll  Rights  Reserved.

Ope

nSpl

ice

DD

S

Data Availability

Data Availability

History

Ownership

DurabilityLifespan

OwnershipStrength

Copyrig

ht  2011,  PrismTech  –    A

ll  Rights  Reserved.

Ope

nSpl

ice

DD

S

Temporal Properties

Throughput

TimeBasedFilter

[Inbound]

[Outbound]Latency

Deadline

TransportPriority

LatencyBudget

Copyrig

ht  2011,  PrismTech  –    A

ll  Rights  Reserved.

Ope

nSpl

ice

DD

S

HLA QoS Policies

☐ HLA provides roughly only two policies, one for controlling the reliability and the other for controlling the ordering of data

☐ HLA ties policies with data thus does not allow different producer/consumers to refine the QoS with which data is produced/consumed

Copyrig

ht  2011,  PrismTech  –    A

ll  Rights  Reserved.

Ope

nSpl

ice

DD

S

Time ManagementDDS HLA

☐ HLA provides support for:☐ Event Driven Simulation☐ Time Stepped Simulation☐ Parallel Discrete-Event Simulation☐ Wall-clock-time Simulation

☐ The HLA Time Service provides primitives to coordinate and control the advancement of time

☐ Along with automatic time-stamping based on real-time, DDS provides an API for time-stamping messages

☐ This API can be used to implement logical clocks

Ope

nSpl

ice

DD

S

DDS Performance

Copyrig

ht  2011,  PrismTech  –    A

ll  Rights  Reserved.

Ope

nSpl

ice

DD

S

Local Latency

☐ Inter-Core latency can be as low as 10 usec!

☐ Latency distribution predictable with:☐ IQR <= 0.5 usec☐ 99% - Min <= 4 usec

Copyrig

ht  2011,  PrismTech  –    A

ll  Rights  Reserved.

Ope

nSpl

ice

DD

S

Head of Line Blocking

☐ Concurrent application w/o real-time networking might provoke unbounded priority inversion

☐ ...OpenSplice can avoid this...

Copyrig

ht  2011,  PrismTech  –    A

ll  Rights  Reserved.

Ope

nSpl

ice

DD

S

The Lane’s Effect

☐ The proper configuration of network lanes can eliminate (or bound) the priority inversion introduced by the head-of-line blocking

Copyrig

ht  2011,  PrismTech  –    A

ll  Rights  Reserved.

Ope

nSpl

ice

DD

S

Real-Time Determinism

Ope

nSpl

ice

DD

S

Integration DDS and HLA-Live Demo-

Ope

nSpl

ice

DD

S

Summing Up

Copyrig

ht  2011,  PrismTech  –    A

ll  Rights  Reserved.

Ope

nSpl

ice

DD

S

Concluding Remarks☐ DDS provides a very powerful and high-performance infrastructure

for data distribution

☐ When compared to HLA, DDS stands out for its support for evolvability and dynamic systems/federations

☐ On the down-side, DDS is a technology that was designed for Operational Systems, as such it does not provide mechanisms such as Time Management. However these mechanisms can easily be implemented over DDS

Ope

nSpl

ice

DD

S

Copyrig

ht  2011,  PrismTech  –    A

ll  Rights  Reserved.

Ope

nSpl

ice

DD

S

References

¥Fastest growing JVM Language¥Open Source¥www.scala-lang.org

¥ #1 OMG DDS Implementation¥ Open Source¥ www.opensplice.org

OpenSplice | DDS¥Scala API for OpenSplice DDS¥Open Source¥github.com/kydos/escalier

Escalier

¥Simple C++ API for DDS¥Open Source¥github.com/kydos/simd-cxx

¥DDS-PSM-Java for OpenSplice DDS¥Open Source¥github.com/kydos/simd-java

¥ DDS-based Advanced Distributed Algorithms Toolkit

¥Open Source¥github.com/kydos/dada

Recommended