Distributed Simulations with DDS and HLA

50
OpenSplice DDS Distributed Simulations with DDS and HLA Angelo CORSARO, Ph.D. Chief Technology Officer OMG DDS Sig Co-Chair PrismTech [email protected] José-Ramón Martínez-Salio Technical Sales Engineers Director NADS [email protected]

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.

Transcript of Distributed Simulations with DDS and HLA

Page 1: Distributed Simulations with DDS and HLA

Ope

nSpl

ice

DD

S

Distributed Simulationswith DDS and HLA

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

[email protected]

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

[email protected]

Page 2: Distributed Simulations with DDS and HLA

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

Page 3: Distributed Simulations with DDS and HLA

Ope

nSpl

ice

DD

S

Genesis

Page 4: Distributed Simulations with DDS and HLA

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

Page 5: Distributed Simulations with DDS and 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

Page 6: Distributed Simulations with DDS and 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

Page 7: Distributed Simulations with DDS and HLA

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)

Page 8: Distributed Simulations with DDS and HLA

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

Page 9: Distributed Simulations with DDS and HLA

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

Page 10: Distributed Simulations with DDS and HLA

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

Page 11: Distributed Simulations with DDS and HLA

Ope

nSpl

ice

DD

S

DDS and HLA Fundamentals

Page 12: Distributed Simulations with DDS and HLA

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

Page 13: Distributed Simulations with DDS and HLA

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

Page 14: Distributed Simulations with DDS and HLA

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>

Page 15: Distributed Simulations with DDS and HLA

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;};

Page 16: Distributed Simulations with DDS and HLA

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;};

Page 17: Distributed Simulations with DDS and HLA

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

Page 18: Distributed Simulations with DDS and HLA

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) ) )

Page 19: Distributed Simulations with DDS and HLA

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)

Page 20: Distributed Simulations with DDS and HLA

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

Page 21: Distributed Simulations with DDS and HLA

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

Page 22: Distributed Simulations with DDS and HLA

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

Page 23: Distributed Simulations with DDS and HLA

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

Page 24: Distributed Simulations with DDS and 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

Page 25: Distributed Simulations with DDS and HLA

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:*

Page 26: Distributed Simulations with DDS and HLA

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

Page 27: Distributed Simulations with DDS and HLA

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

Page 28: Distributed Simulations with DDS and HLA

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)

Page 29: Distributed Simulations with DDS and HLA

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();

Page 30: Distributed Simulations with DDS and HLA

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

Page 31: Distributed Simulations with DDS and HLA

Ope

nSpl

ice

DD

S

QoS

Page 32: Distributed Simulations with DDS and HLA

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

Page 33: Distributed Simulations with DDS and HLA

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]

Page 34: Distributed Simulations with DDS and HLA

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]

Page 35: Distributed Simulations with DDS and HLA

Copyrig

ht  2011,  PrismTech  –    A

ll  Rights  Reserved.

Ope

nSpl

ice

DD

S

Data Delivery

Data Delivery

Reliability

Presentation

Destination OrderPartition

Page 36: Distributed Simulations with DDS and HLA

Copyrig

ht  2011,  PrismTech  –    A

ll  Rights  Reserved.

Ope

nSpl

ice

DD

S

Data Availability

Data Availability

History

Ownership

DurabilityLifespan

OwnershipStrength

Page 37: Distributed Simulations with DDS and HLA

Copyrig

ht  2011,  PrismTech  –    A

ll  Rights  Reserved.

Ope

nSpl

ice

DD

S

Temporal Properties

Throughput

TimeBasedFilter

[Inbound]

[Outbound]Latency

Deadline

TransportPriority

LatencyBudget

Page 38: Distributed Simulations with DDS and HLA

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

Page 39: Distributed Simulations with DDS and HLA

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

Page 40: Distributed Simulations with DDS and HLA

Ope

nSpl

ice

DD

S

DDS Performance

Page 41: Distributed Simulations with DDS and HLA

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

Page 42: Distributed Simulations with DDS and HLA

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...

Page 43: Distributed Simulations with DDS and HLA

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

Page 44: Distributed Simulations with DDS and HLA

Copyrig

ht  2011,  PrismTech  –    A

ll  Rights  Reserved.

Ope

nSpl

ice

DD

S

Real-Time Determinism

Page 45: Distributed Simulations with DDS and HLA

Ope

nSpl

ice

DD

S

Integration DDS and HLA-Live Demo-

Page 46: Distributed Simulations with DDS and HLA

Ope

nSpl

ice

DD

S

Summing Up

Page 47: Distributed Simulations with DDS and HLA

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

Page 48: Distributed Simulations with DDS and HLA

Ope

nSpl

ice

DD

S

Page 49: Distributed Simulations with DDS and HLA

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